Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
The method to get books from folio backend and then call getRenderItems
findInstances(token) { // load preference and make url for fetching books let url = hostUrl.url + '/instance-storage/instances?limit=10&query='; var len = this.state.resources.length; for (i = 0; i < len; i++) { if (this.state.resources[i].checked) { url = url + "instanceTypeId=" + this.state.resources[i].id + '%20or%20'; } } len = this.props.navigation.state.params.languages.length; for (i = 0; i < len; i++) { if (this.props.navigation.state.params.languages[i].checked) { url = url + "languages=" + this.props.navigation.state.params.languages[i].name + '%20or%20'; } } url = url.substring(0, url.length - 8); console.log(url); // get books from folio axios.get(url, { headers: { 'X-Okapi-Tenant': 'diku', 'X-Okapi-Token': token, }, }) .then((response) => { if (response.status === 200) { const instances = response.data.instances; this.setState({ books: instances, }); } else { Alert.alert('Something went wrong 1'); } }) // fetch identifier-types such as ISBN from folio .then(() => { const url = hostUrl.url + '/identifier-types?limit=30'; axios.get(url, { headers: { 'X-Okapi-Tenant': 'diku', 'X-Okapi-Token': token, }, }) .then((response) => { var types = response.data.identifierTypes; this.setState({ idTypes: types, }); }) .then(() => { this.getRenderItems(token) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBooks () {\n fetch(bookUrl)\n .then(resp => resp.json())\n .then(books => {\n renderBooks(books);\n window.allBooks = books\n }) //aspirational code to renderBooks(books)\n }", "async function getAllBooks () {\n console.log('book')\n const books = await fetchData(endpoint, config);\n // console.log(books)\n render.allBooks(books);\n}", "function getBooks() {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'GET'\n }).done(function (response) {\n setBooks(response);\n });\n }", "static displayBooksToList() {\n const books = Store.getBooks();\n\n books.forEach((book) => {\n UI.addBookToList(book)\n });\n }", "static displayBooks () {\n\t\tconst books = Store.getBooks();\n\n\t\t//Loop through each book and call method addBookToList\n\n\t\tbooks.forEach((book) => UI.addBookToList(book));\n\t}", "static displayBooks() {\n const books = Store.getBooks();\n books.forEach(function (book) {\n const ui = new UI();\n ui.addBookToList(book);\n })\n\n }", "function getAllBooks(){\n fetch(baseURL)\n .then(res => res.json())\n .then(books => listBooks(books))\n }", "static displayBooks() {\n const books = Store.getBooks();\n\n books.forEach(book => {\n const ui = new UI();\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "static displayBooks(){\n // Taking books from the local Storage\n const books = Store.getBooks();\n\n // Looping through the books and adding it to bookList\n books.forEach((book) => UI.addBookToList(book));\n }", "getBooks() {\n return this.service.sendGetRequest(this.books);\n }", "function loadAllBooksHelper() {\r\n\t\trequest(loadAllBooks, \"books\", \"\");\r\n\t}", "async getRenderItems(token) {\n let books = [];\n var isbnid;\n var coverUrl;\n for (i = 0; i < this.state.idTypes.length; i++) {\n if (this.state.idTypes[i].name == \"ISBN\") {\n isbnid = this.state.idTypes[i].id;\n break;\n }\n }\n var i;\n var id;\n for (i in this.state.books) {\n let book = this.state.books[i];\n for (j = 0; j < book.identifiers.length; j++) {\n id = book.identifiers[j].identifierTypeId;\n let value = book.identifiers[j].value.split(\" \");\n value = value[0];\n if (id == isbnid) {\n coverUrl = await this.getCover('&isbn=' + value, book.title);\n console.log(coverUrl);\n if (coverUrl != \"\") {\n console.log(book.title);\n books.push(book);\n books[books.length - 1].cover = coverUrl;\n break;\n }\n }\n else { // If a book don't have ISBN, get cover by title only\n console.log(book.title);\n books.push(book);\n coverUrl = await this.getCover('', book.title);\n console.log(coverUrl);\n books[books.length - 1].cover = coverUrl;\n break;\n }\n }\n }\n // data load complete\n this.setState({\n books: books,\n isLoadingComplete: true,\n })\n }", "function loadBooks() {\n const data = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n // Authorization: 'Kinvey ' + localStorage.getItem('authToken'),\n };\n\n fetch(url, data)\n .then(handler)\n .then(displayBooks)\n .catch((err) => {\n console.warn(err);\n });\n }", "static displayBooks(){\n let books = Store.getBooks();\n const ui = new UI();\n\n // Add all books to list\n books.forEach(function(book){\n ui.addBookToLib(book);\n });\n }", "static displayBook(){\n // //Imaginary local storage for trial purpose\n // const bookstore=[\n // {\n // title: 'Book One',\n // author: 'John Doe',\n // isbn: '345678'\n // },\n // {\n // title: 'Book Two',\n // author: 'Nobel Reo',\n // isbn: '348982'\n // }\n // ];\n const books = Store.getBooks();\n books.forEach((book) => UI.addBookToList(book));\n }", "static displayBooks() {\n\t\tconst books = Store.getBooks();\n\t\tbooks.forEach(function (book) {\n\t\t\tconst ui = new UI();\n\t\t\tui.addBookToList(book);\n\t\t});\n\t}", "function render(books) {\n libraryBooks.forEach((book) => {\n renderBook(book);\n });\n\n body.append(bookList);\n}", "function getBooks() {\n return fetch(`${BASE_URL}/books`).then(res => res.json())\n}", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "static displayBooks() {\n //get the books from storage like we did for add book\n const books = Store.getBooks();\n\n // loop through the books\n books.forEach(function(book){\n // Instantiate the UI class to display each book in UI\n const ui = new UI\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n setBooks(res.data);\n // console.log(res);\n })\n .catch(err => console.log(err.response));\n }", "function renderBooks() {\n let bookItems = CATALOG.map(describeBook);\n $(\".renderList\").html(bookItems.join(''));\n console.log(\"renderBook ran\")\n\n}", "componentDidMount() {\n this.get_all_books()\n }", "function loadBooks(res) {\n console.log(res.data)\n setBooks(res.data.data)\n }", "function displayBookList() {\n displayAllBooks();\n}", "getAllBooks() {\n return axios.get(`${url}/allBooks`);\n }", "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "async function getBooks(){\n if(!books){\n let result = await MyBooklistApi.bookSearch(\"fiction\", getCurrentDate(), user.username);\n setBooks(result);\n }\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadAndDisplayBooks() {\n\n\tloadBooks().then(books => {\n\t\tdisplayBooks(books);\n\t});\n}", "function getBooks() {\n fetch(\"http://localhost:3000/books\")\n .then(res => res.json())\n .then(books => showBooks(books))\n .catch(err => console.log(err))\n}", "function renderBooks(myLibrary) {\n // Build card for each book and add it to the display\n for (let i of myLibrary) {\n renderBook(i)\n }\n}", "function loadBooks() {\n API.getBooks()\n .then(res => {\n console.log(res.data)\n setBooks(res.data)\n })\n .catch(err => console.log(err));\n }", "function getBooks () {\n\t\t\treturn backendService.getBooks()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tallBooks = response; // keep a copy of all the books, without filtering.\n\t\t\t\t\treturn allBooks;\n\t\t\t\t});\n\t\t}", "componentDidMount() {\n this.getAllBooks();\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "componentDidMount() {\n this.getbooks();\n // this.getGoogleBooks();\n }", "async getBooks() {\n if(this.props.currentUser) {\n var bookIdList = this.props.currentUser[\"library\"][\"to_read_list\"];\n if(bookIdList === null) {\n bookIdList = [];\n this.setState({isLoading: false});\n }\n\n var bookList = [];\n\n // Get details from Cache or API and add to list - skip if not available\n for (let i = 0; i < bookIdList.length; i++) {\n var book = await this.props.getBookDetails(bookIdList[i]);\n if(book === null) {\n continue;\n }\n\n if(this.state.searchString === \"\" || (this.state.searchString !== \"\" && ((book.Title.toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1) || book.Authors.join(\"\").toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1))) {\n bookList.push(book);\n }\n\n }\n await this.setState({toReadList: bookList, isLoading: false});\n\n // Add books to cache\n this.props.addBooksToCache(bookList);\n } else {\n this.setState({isLoading: false});\n }\n\n }", "function renderBooks(books) {\n for (const book of books) {\n renderBook(book)\n }\n }", "function getBooks(request, response,next) {\n bookDb.get()\n .then(results => {\n if(results.length === 0){\n response.render('pages/searches/new');\n }else{\n response.render('pages/index', {books: results})\n }\n })\n .catch( next );\n}", "function render() {\n\tbookTable.innerHTML = \"\"; // Reset all books already rendered on page\n\t//Render the books currently in myLibrary to the HTML page\n\tfor (var book of library.getLibrary()) {\n\t\taddRow(book, book.firebaseKey); // Use book.firebaseKey to have a way to remove / update specific books\n\t}\n}", "function returnBooks(res){\n myLibrary.books = [];\n res.items.forEach(function(item) {\n //if price is undefined, then define price at 0\n if(item.saleInfo.listPrice == undefined){\n item.saleInfo[\"listPrice\"] = {amount: null};\n }\n\n //check if price is exist, if yes then create new book\n if (item.saleInfo.listPrice){\n // Book constructor is in book.js\n let temp = new Book(item.volumeInfo.title,\n item.volumeInfo.description,\n item.volumeInfo.imageLinks.smallThumbnail,\n item.saleInfo.listPrice.amount,\n item.volumeInfo.authors,\n item.volumeInfo.previewLink\n );\n myLibrary.books.push(temp);\n }\n\n });\n //print each book on webpage\n myLibrary.printBooks();\n highlightWords();\n}", "componentDidMount() {\n this.loadBooks();\n }", "componentDidMount() {\n this.loadBooks();\n }", "componentDidMount() {\n this.loadBooks();\n }", "async getAllBooks(parent,args,ctx,info){\n return await ctx.db.query.books({\n where : {active:true}\n },`{\n id\n title\n author\n publisher {\n name\n discount\n }\n category{\n name\n }\n type {\n name\n }\n images {\n src\n }\n mrp\n sku\n }`);\n \n }", "function getBook(request, response) {\n //get bookshelves\n getBookshelves()\n //using returned values\n .then(shelves => {\n bookDb.get(request.params.id)\n .then(result => {\n response.render('pages/books/show', { book: result[0], bookshelves: shelves })\n })\n .catch(err => handleError(err, response));\n })\n}", "componentDidMount(){\n this.loadBooks()\n }", "static fetchBooksFromGoogle(searchInput){ //searchInput from Content.js\n return fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchInput}`)\n .then(response => response.json())\n .then(json => {\n return json.items.map(item => this.createBook(item)) //returns an array of objects created from the createBook fn.\n })\n }", "componentDidMount() {\n this.loadBooks();\n }", "function fetchBook() {\n Books.get($stateParams.id)\n .then(function(book) {\n $scope.book = book;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "function getBooks() {\n clubID = this.value;\n // console.log('clubID', clubID);\n fetch('/get_books_in_genre?clubID=' + clubID)\n .then(function (response) {\n return response.json();\n }).then(function (json) {\n // console.log('GET response', json);\n if (json.length > 0) {\n set_book_select(json);\n };\n });\n}", "getBooks(title) {\n return this.service.sendGetRequest(this.books + '/' + title.value);\n }", "static displayBooks (){\n \n const books = Store.getBooks();\n\n //loop through the array to add the books into the local storage\n books.forEach((book) => UI.addBookToList(book));\n }", "function listBooks(response, request) {\n\n var authorID = request.params.authorID;\n\n return memory.authors[authorID].books\n \n \n}", "componentDidMount() {\n this.fetchBooks();\n }", "function getBooks(){\n fetch('http://localhost:3000/books')\n .then(resp => resp.json())\n .then(book => book.forEach(title))\n}", "render(){\n\n\t\tconst { books, onShelfSelection } = this.props\n\t\treturn (\n\t\t\t<div className=\"bookshelf\">\n\t\t\t\t<h2 className=\"bookshelf-title\">{this.props.listTitle}</h2>\n\t\t\t\t<div className=\"bookshelf-books\">\n\t\t\t\t\t<ol className=\"books-grid\">\n\t\t\t\t\t\t{books.map(book => (\n\t\t\t\t\t\t\t<li key={book.id}>\n\t\t\t\t\t\t\t\t<Book \n\t\t\t\t\t\t\t\t\tbook={book}\n\t\t\t\t\t\t\t\t\tonShelfSelection={onShelfSelection}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{books.length === 0 && (\n\t\t\t\t\t\t\t<li>No books found.</li>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\t\t\t</div>\t\t\t\n\t\t)\n\t}", "componentDidMount() {\n this.fetchBooks()\n }", "function getBooks(bibleParam, callback) {\n var dfd = $.Deferred();\n bible = bibleParam;\n // if default books found use it\n var booksPath = bible.defaultIndex ? (baseUrl + '/defaults/books/' + bible.defaultIndex + '.bz2') : (baseUrl + bible.dbpath + '/' + 'books.bz2');\n $.when(getBzData(booksPath)).then(d => {\n dfd.resolve(books = d);\n });\n return dfd.promise();\n }", "componentDidMount() {\n this.getCurrentBooks();\n }", "function findBook(req, res) {\n\n let url = 'https://www.googleapis.com/books/v1/volumes?q=';\n\n if (req.body.search[1] === 'title') { url += `+intitle:${req.body.search[0]}`; }\n\n if (req.body.search[1] === 'author') { url += `+inauthor:${req.body.search[0]}`; }\n\n superagent.get(url)\n\n .then(data => {\n // console.log('data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', data.body.items[0].volumeInfo);\n\n let books = data.body.items.map(value => {\n return new Book(value);\n });\n // console.log(books);\n res.render('pages/searches/show', { book: books });\n }).catch(error => console.log(error));\n\n}", "componentDidMount(){\n\n this.fetchBooks()\n\n }", "async getBooks(req, res, next){\n try {\n res.send( await BooksModel.paginate({}, {\n sort: 'title',\n page: req.params.page && req.params.page > 0 ? req.params.page : 1,\n limit: 20,\n }) )\n } catch(e) {\n return exhandler(res)\n }\n }", "function loadAndRenderItems() {\n pageData().then(render)\n }", "function renderBooks()\n{\n var $booksCon = $(\"#booksCon\");\n var bookHTML = $(\"#bookTemp\").html();\n var bookTemp = _.template(bookHTML);\n\n // We get rid of all the previously created books so we don't have duplicates.\n $booksCon.empty();\n\n $.get(\"/books\").\n done(function(data) {\n console.log(data);\n $(data).each(function (index, book) {\n var $book = $(bookTemp(book));\n $booksCon.append($book);\n });\n });\n}", "function getBooks(data) {\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n output = \"<div class='alert alert-danger'>You do not have any books in your collection. \";\n output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>My Books</h3>\";\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (response[i].ownerId === profId && (response[i].requestorId === \"\" || response[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].requestorId !== \"\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n profileBooks.innerHTML = output;\n }", "function allBooks(){\r\n\t\tvisibility(\"none\", \"singlebook\");\r\n\t\tvisibility(\"\", \"allbooks\");\r\n\t\tif(this.status == SUCCESS){\r\n\t\t\tvar title = this.responseXML.querySelectorAll(\"title\");\r\n\t\t\tvar folder = this.responseXML.querySelectorAll(\"folder\");\r\n\t\t\tfor (var i = 0; i < title.length; i++) {\r\n\t\t\t\tvar book = document.createElement(\"div\");\r\n\t\t\t\tvar text = document.createElement(\"p\");\r\n\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\tvar fileName = folder[i].textContent; \r\n\t\t\t\tvar img = \"books/\" + fileName + \"/cover.jpg\";\r\n\t\t\t\timage.src = img;\r\n\t\t\t\timage.alt = fileName;\r\n\t\t\t\timage.className = fileName; // gives classname to get to its page\r\n\t\t\t\ttext.className = fileName;\r\n\t\t\t\ttext.innerHTML = title[i].textContent;\r\n\t\t\t\tbook.appendChild(image);\r\n\t\t\t\tbook.appendChild(text);\r\n\t\t\t\tdocument.getElementById(\"allbooks\").appendChild(book);\r\n\t\t\t\timage.onclick = load;\r\n\t\t\t\ttext.onclick = load;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "getbooks(){\r\n BooksAPI.getAll().then((books) => {\r\n // add books to state\r\n this.setState({ books })\r\n })\r\n }", "render(){\n\n\t\treturn (\n <div className=\"bookshelf\">\n <h2 className=\"bookshelf-title\">{this.props.shelf.label}</h2>\n <div className=\"bookshelf-books\">\n <ol className=\"books-grid\">\n {this.props.shelf.books.map((book)=>(\n <li key={book.id}><Book book={book} updateBooks={this.props.updateBooks} options={this.props.shelf.shelfOptions}/></li>\n ))}\n </ol>\n </div>\n </div>\n\n\n );\n\t}", "function getBookList()\r\n\t{\r\n\t\t$.ajax({\r\n\t\t url: contextPath + \"/books/ajaxGetListOfAllBooks\", \r\n\t\t type: 'GET', \r\n\t\t dataType: 'json', \r\n\t\t contentType: 'application/json',\r\n\t\t mimeType: 'application/json',\r\n\t\t timeout: 5000,\r\n\t\t cache: false,\r\n\t\t success: function(books) \r\n\t\t {\r\n\t\t },\r\n error: function (xhr, textStatus, errorThrown) \r\n {\r\n \tconsole.log(xhr.responseText);\r\n alert('Failed to get list of books because of a server error.');\r\n loadingIndicator.fadeOut();\r\n }\r\n\t\t});\t\r\n\t}", "function loadBooks() {\n books = JSON.parse(localStorage.getItem(\"totalBooks\"));\n if (!books) {\n //alert('No books are present for now! Please add some')\n } else {\n books.forEach((book) => {\n renderBook(book);\n });\n }\n\n finishedBooks = JSON.parse(localStorage.getItem(\"finishedBooks\"));\n if (!finishedBooks) {\n //alert('No books are present for now! Please add some')\n } else {\n finishedBooks.forEach((book) => {\n renderFinishedBooks(book);\n });\n }\n}", "componentDidMount() {\n axios\n .get(\n `https://www.googleapis.com/books/v1/volumes?q=subject:fiction&filter=paid-ebooks&langRestrict=en&maxResults=20&&orderBy=newest&key=${process.env.REACT_APP_GOOGLE_BOOK_TOKEN}`\n )\n .then((response) => {\n console.log(\"axios Api\", response.data);\n this.setState({\n booksFromApi: response.data.items,\n });\n })\n .catch((error) => {\n console.log(error);\n });\n\n // service\n\n // .get(\"/bookFromData\")\n // .then((result) => {\n // console.log(\"fetch ggl id and populate \", result.data);\n // this.setState({\n // saveList: result.data,\n // });\n // })\n // .catch((error) => console.log(error));\n }", "function listBooks(books){\n books.forEach(book => bookLi(book))\n }", "function ShowItems() {\n for (let book of Books) {\n makeBookItem(book).appendTo(\"#AllBooks\");\n }\n }", "function loadBooks() {\n\n\t// We return the promise that axios gives us\n\treturn axios.get(apiBooksUrl)\n\t\t.then(response => response.data) // turns to a promise of books\n\t\t.catch(error => {\n\t\t\tconsole.log(\"AJAX request finished with an error :(\");\n\t\t\tconsole.error(error);\n\t\t});\n}", "getBooks(){\n fetch('http://localhost:3001/api/home')\n .then((res) => {\n return res.json()\n })\n .then((data) => {\n this.setState({\n books: data,\n \n })\n })\n }", "getBooks(){\n fetch('/books').then(response=>{response.json().then(data=>{\n console.log(data)\n this.setState({foundBooks:data})\n })})\n }", "componentDidMount() {\n this.getBooks();\n }", "componentDidMount() {\n this.fetchBooksDetails()\n }", "function displayBooks(data) {\n // console.log('data2: ', data)\n if (data.length > 0) { setSelectedBook(data[0].id) }\n return data.books.map(({ id, name, genre, author }) => (\n <div key={id}>\n <ul className=\"list-group\">\n <li className=\"list-group-item list-group-item-action\" name={id} onClick={e => {\n setSelectedBook(id)\n }}>\n {author.name}: {name}: {genre}\n </li>\n </ul>\n </div>\n\n ));\n }", "getBooks() {\n getAll().then((data) => {\n this.setState({books: data})\n })\n }", "@action\n getBooks(currentSearchText) {\n ApiService.getBooks()\n .then((res) => {\n if (!res) throw res.error;\n let searchItems = [];\n console.log(currentSearchText);\n console.log(res.items);\n for (let i=0; i < res.items.length; i++) {\n let title = res.items[i].volumeInfo.title;\n\n if (title.toLowerCase().indexOf(currentSearchText) !== -1) {\n searchItems.push(res.items[i]);\n }\n }\n console.log(searchItems);\n this.booksInfo = res.items;\n if (searchItems.length > 0) {\n this.searchResult = searchItems;\n this.isFoundResult = true;\n this.book = {};\n } else {\n this.searchResult = {};\n this.book = {};\n this.isFoundResult = false;\n }\n })\n .catch((e) => {\n new ErrorHandler(e);\n });\n }", "componentDidMount() {\n this.getBooks();\n }", "componentDidMount(){\n BooksAPI.getAll()\n .then(books => this.placeOnShelf(books))\n }", "function getBooks() {\n let request = new XMLHttpRequest();\n request.open('GET', 'http://localhost:7000/books');\n request.addEventListener('load', function () {\n // responseText is a property of the request object\n // (that name was chosen for us)\n let response = JSON.parse(request.responseText);\n let books = response.books;\n let parent = document.querySelector('main ul');\n\n for (let i = 0; i < books.length; ) {\n let element = document.createElement('li');\n element.textContent = books[i].title;\n\n // append to parent\n parent.appendChild(element);\n }\n });\n request.send();\n}", "function render() {\n myLibrary.forEach((value, index) => {\n addBookToTable(value, index);\n });\n}", "componentDidMount() {\n this.getBooks()\n }", "getBooks() {\n $.ajax({\n url: this._apiUrl + '/books',\n method: 'GET',\n dataType: 'JSON'\n }).done(response => { //strzalkowo, ZWRACAC UWAGE NA NAWIAS OKRAGLY-przechodzi nizej.\n console.log(response);\n let booksLength = response.length;\n for (let i=0;i<booksLength;i++) { // pętla po wszystkich ksiazkach, zeby je wrzucic do DOM\n let newLiElement = $(`<li data-id=\" ${response[i].id}\">`);\n let newSpan = $(\"<span>\");\n newSpan.append(`(${response[i].author})`); // daje autora o odpowiednim id i nawias na nim\n newLiElement.append(response[i].title); // tytul w liste\n newLiElement.append(newSpan);\n this._ul.append(newLiElement); // dodaje juz do ul w DOM\n }\n\n })\n }", "function getBookList() {\n\t\ttoggleControls(\"on\");\n\t\tif(localStorage.length === 0) {\n\t\t\talert(\"Your bookshelf was empty so example books were added\");\n\t\t\tautofillData();\n\t\t}\n\t\tvar list = $.find('#listOfBooks');\n\t\t$('#bookList').attr('id', 'items');\n\t\tfor (var i = 0, j = localStorage.length; i < j; i++) {\n\t\t\tvar makeLi = $('<li class=\"bookItem\"></li>').appendTo(list);\n\t\t\tvar linksLi = $('<li class=\"bookLink\"></li>').appendTo(list);\n\t\t\tvar key = localStorage.key(i);\n\t\t\tvar value = localStorage.getItem(key);\n\t\t\tvar object = JSON.parse(value);\n\t\t\tfor(var x in object){\n\t\t\t\t$('<p>' + object[x][0] + object[x][1] + '</p>').appendTo(makeLi);\n\t\t\t}\n\t\t\tmakeBookLinks(localStorage.key(i), linksLi);\n\t\t}\n\t\t$('#listOfBooks').listview('refresh');\t\n\t}", "loadBooksFromServer () {\n\t\t fetch('http://localhost:8080/books')\n .then(result => result.json())\n .then(result => this.setState({ books: result })\n )\n\t\t }", "componentDidMount() {\n this.props.getAllBooks();\n }", "componentDidMount(){\n this.getBooks(); \n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for(let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n let $tr = $(`<tr data-id=${book.id}></tr>`);\n $tr.data('book', book);\n $tr.append(`<td class=\"title\">${book.title}</td>`);\n $tr.append(`<td class=\"author\">${book.author}</td>`);\n $tr.append(`<td class=\"status\">${book.status}</td>`);\n $tr.append(`<button class='status-btn'>UPDATE STATUS</button>`)\n $tr.append(`<button class='edit-btn'>EDIT</button>`)\n $tr.append(`<button class='delete-btn'>DELETE</button>`)\n $('#bookShelf').append($tr);\n }\n}", "render(){\n\n\t\tconst shelves = this.props.shelves;\n\n\t\treturn (\n\t\t\t <div className=\"list-books\">\n\t <div className=\"list-books-title\">\n\t\t <h1>MyReads</h1>\n\t\t </div>\n\t\t \t<div className=\"list-books-content\">\n\t\t <div>\n\t\t \t{shelves.map((shelf) => (\n\t\t \t\t<BookShelf shelf={shelf} key={shelf.title} updateBooks={this.props.updateBooks}/>\n\t\t \t))}\n\t\t </div>\n\t\t </div>\n\t\t <div className=\"open-search\">\n\t\t <Link to=\"/search\">Add a book</Link>\n\t </div>\n \t</div>\n\n\n\t\t\t);\n\n\n \t}", "componentWillMount(){\n //getBooks(limit, start, order) from actions url parameters \n //DISPATCH accepts an ACTION and dispatches the data to the store which gives it full access to the app \n // which makes data available from getBooks function to use and display on the UI \n this.props.dispatch(getBooks(1, 0, 'desc'))\n }", "componentDidMount() {\n this.shelfBooks();\n }", "function renderBooks(books) {\n $('#bookShelf').empty();\n\n for (let i = 0; i < books.length; i += 1) {\n let book = books[i];\n // For each book, append a new row to our table\n let $tr = $(`<tr data-book-id=\"${book.id}\"></tr>`);\n $tr.data('book', book);\n $tr.append(`<td>${book.title}</td>`);\n $tr.append(`<td>${book.author}</td>`);\n $tr.append(`<td>${book.status}</td>`);\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm markReadBtn\">Mark as Read</button></td>`);\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm editBtn\">Edit</button></td>`)\n $tr.append(`<td><button class=\"btn btn-outline-dark btn-sm deleteBtn\">Delete</button></td>`);\n $('#bookShelf').append($tr);\n }\n}" ]
[ "0.7621194", "0.74260765", "0.71727484", "0.7171112", "0.70661473", "0.705041", "0.7026529", "0.70263046", "0.6961969", "0.6945645", "0.69358027", "0.6931849", "0.6873062", "0.68509036", "0.6805397", "0.6779863", "0.6779578", "0.67167157", "0.6702709", "0.6701072", "0.6680734", "0.6670699", "0.66690457", "0.66677004", "0.66465735", "0.6640957", "0.66202545", "0.6620039", "0.65944505", "0.65944505", "0.6580712", "0.6574664", "0.65685993", "0.65588236", "0.6557143", "0.6553409", "0.6540549", "0.6535481", "0.6514101", "0.6502957", "0.6490671", "0.6481761", "0.6478224", "0.64677113", "0.64668995", "0.64641595", "0.64641595", "0.64641595", "0.6456983", "0.64420563", "0.64320815", "0.64209557", "0.6406911", "0.6401735", "0.63922906", "0.63898665", "0.63731396", "0.6368976", "0.6364719", "0.6364248", "0.6358948", "0.63546693", "0.6342687", "0.6342474", "0.6325632", "0.6322466", "0.6319813", "0.6314936", "0.63141316", "0.6302092", "0.6297368", "0.62844634", "0.62781984", "0.6273607", "0.6256729", "0.62527514", "0.6250423", "0.62481815", "0.6246706", "0.622999", "0.6228676", "0.6224311", "0.62232953", "0.62163466", "0.6216251", "0.62090117", "0.62078655", "0.62043285", "0.6191563", "0.619002", "0.6181331", "0.6178647", "0.6177154", "0.6176857", "0.6175857", "0.616958", "0.61693144", "0.6163733", "0.61539453", "0.6151959", "0.6150654" ]
0.0
-1
The method to get covers from Google book API based on ISBN and title of the books
async getCover(isbn, title) { try { let response = await axios.get( 'https://www.googleapis.com/books/v1/volumes?q=title=' +encodeURIComponent(title) +isbn + "&key=AIzaSyClcFkzl_nDwrnCcwAruIz99WInWc0oRg8" ); return response.data.items[0].volumeInfo.imageLinks.smallThumbnail; } catch (error) { console.log(error); return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchBooksFromGoogle(searchInput){ //searchInput from Content.js\n return fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchInput}`)\n .then(response => response.json())\n .then(json => {\n return json.items.map(item => this.createBook(item)) //returns an array of objects created from the createBook fn.\n })\n }", "async getRenderItems(token) {\n let books = [];\n var isbnid;\n var coverUrl;\n for (i = 0; i < this.state.idTypes.length; i++) {\n if (this.state.idTypes[i].name == \"ISBN\") {\n isbnid = this.state.idTypes[i].id;\n break;\n }\n }\n var i;\n var id;\n for (i in this.state.books) {\n let book = this.state.books[i];\n for (j = 0; j < book.identifiers.length; j++) {\n id = book.identifiers[j].identifierTypeId;\n let value = book.identifiers[j].value.split(\" \");\n value = value[0];\n if (id == isbnid) {\n coverUrl = await this.getCover('&isbn=' + value, book.title);\n console.log(coverUrl);\n if (coverUrl != \"\") {\n console.log(book.title);\n books.push(book);\n books[books.length - 1].cover = coverUrl;\n break;\n }\n }\n else { // If a book don't have ISBN, get cover by title only\n console.log(book.title);\n books.push(book);\n coverUrl = await this.getCover('', book.title);\n console.log(coverUrl);\n books[books.length - 1].cover = coverUrl;\n break;\n }\n }\n }\n // data load complete\n this.setState({\n books: books,\n isLoadingComplete: true,\n })\n }", "function getBooksFromGoogleAPI(searchURL){\n\t$.ajax({\n\t\turl: searchURL,\n\t\tsuccess: function(data){\n\t\t\tvar temphtml = '';\n\t\t\tsearchResult = data;\n\t\t\tfor(var i = 0; i < 5 && i < data['totalItems']; i++){\n\t\t\t\tvar title = data.items[i].volumeInfo.title;\n\t\t\t\tvar author = \"\";\n\t\t\t\tif(data.items[i].volumeInfo.hasOwnProperty('authors')){\n\t\t\t\t\tauthor = 'By: ' + data.items[i].volumeInfo.authors[0];\n\t\t\t\t}\n\t\t\t\ttemphtml += '<a class=\"list-group-item list-group-item-action flex-column align-items-start\" href=\"#\">';\n\t\t\t\ttemphtml += '<div class=\"d-flex w-100 justify-content-between\">';\n\t\t\t\ttemphtml += '<h5 class=\"mb-1\">' + title + '</h5></div>';\n\t\t\t\ttemphtml += '<p class=\"mb-1\">' + author + '</p>';\n\t\t\t\ttemphtml += '<p class=\"sr-only\" id=\"index\">' + i + '</p>';\n\t\t\t\ttemphtml += '</a>';\n\t\t\t}\n\t\t\t$(\"#navSearchResults\").html(temphtml).removeClass(\"d-none\");\n\t\t}\n\t});\n}", "getBooks(title) {\n return this.service.sendGetRequest(this.books + '/' + title.value);\n }", "function getBookContent() {\n\tvar queryURL = 'https://www.googleapis.com/books/v1/volumes?q=' + searchTerm;\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tbookRating = response.items[0].volumeInfo.averageRating;\n\t\tvar bookPosterURL = response.items[0].volumeInfo.imageLinks.thumbnail;\n\t\tbookPoster = $('<img>');\n\t\tbookPoster.attr('src', bookPosterURL);\n\t\tbookTitle = response.items[0].volumeInfo.title;\n\t\tbookPlot = response.items[0].volumeInfo.description;\n\t\tsetContent();\n\t});\n}", "function getBook(title) {\n var book = null;\n var url = 'https://www.goodreads.com/book/title.xml?key=' + key + '&title=' + title;\n\n request(url, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n xml2js(body, function (error, result) {\n if (!error) {\n // Extract just the fields that we want to work with. This minimizes the session footprint and makes it easier to debug.\n var b = result.GoodreadsResponse.book[0];\n book = { id: b.id, title: b.title, ratings_count: b.ratings_count, average_rating: b.average_rating, authors: b.authors };\n }\n else {\n book = { error: error };\n }\n });\n }\n else {\n book = { error: error };\n }\n });\n\n // Wait until we have a result from the async call.\n deasync.loopWhile(function() { return !book; });\n\n return book;\n}", "function getSimilarBooksJSON(related_items,eventCallback) {\r\n\r\n\tvar list_of_books = [];\r\n\tvar list_of_titles = [];\r\n\tvar rank_count = 1;\r\n\tvar completed_requests = 0;\r\n\tvar getlength = related_items.length\r\n\r\n\tif (related_items.length > 5){\r\n\t\tgetlength = 5;\r\n\t}\r\n\r\n\tfor (var i = 0,length = getlength; i < length; i++ ) {\r\n\t\r\n\t\trequest.get({\r\n\t\t\turl: \"https://www.googleapis.com/books/v1/volumes?q=\" + related_items[i].ASIN +\"&orderBy=relevance&key=APIKEY\"\r\n\t\t\t}, function(err, response, body) {\r\n\t\t\t\t\r\n\r\n\t\t\tif (body){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tbody = JSON.parse(body);\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tvar empty_array = [];\r\n\t\t\t\t\teventCallback(empty_array);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\t\t//console.log(body)\r\n\t\t\t\tcompleted_requests++;\r\n\t\t\t\tvar book_details={};\r\n\t\t\t\tvar title;\r\n\r\n\t\t\t\ttitle = body.items[0].volumeInfo.title ;\r\n\t\t\t\tif (list_of_titles.indexOf(title)> 0) { \t\t\t\t\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof body.items[0].volumeInfo.authors=== 'undefined') { \t\t\t\t\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tlist_of_titles[i] = title;\r\n\t\t\t\tbook_details.title = title;\t\r\n\t\t\t\tbook_details.titleupper = title.toUpperCase();\r\n\r\n\t\t\t\tvar author_string = \"\"; \r\n\t\t\t\tvar author_array = body.items[0].volumeInfo.authors;\r\n\t\t\t\t\r\n\t\t\t\tfor (var k = 0, klength = author_array.length; k < klength; k++){\r\n\t\t\t\t\tauthor_string = author_string + author_array[k] + \" and \" ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tauthor_string = author_string.slice(0, -5);\r\n\t\t\t\tbook_details.author = author_string;\t\t\t\t\r\n\t\t\t\tbook_details.contributor = \"by \" + author_string;\r\n\r\n\t\t\t\tvar isbns_string = \"\";\r\n\t\t\t\tvar isbns_array = body.items[0].volumeInfo.industryIdentifiers;\r\n\r\n\t\t\t\tfor (var j = 0, jlength = isbns_array.length; j < jlength; j++){\r\n\t\t\t\t\tif (isbns_array[j].type === 'ISBN_10'){\r\n\t\t\t\t\t\tbook_details.primary_isbn10 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbook_details.primary_isbn13 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tisbns_string = isbns_string.slice(0, -1);\r\n\t\t\t\tbook_details.isbns_string = isbns_string;\r\n\r\n\t\t\t\tvar description = \". No description available.\";\r\n\t\t\t\t\t\t\r\n\t\t\t\tif (typeof(body.items[0].searchInfo) !=='undefined'){\r\n\t\t\t\t\tif (typeof(body.items[0].searchInfo.textSnippet) !=='undefined'){\r\n\t\t\t\t\t\tdescription = \". Here's a brief description of the book, \" + body.items[0].searchInfo.textSnippet;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbook_details.description = book_details.title + description;\r\n\r\n\t\t\t\tbook_details.description = book_details.title + \", \" + book_details.contributor + description;\r\n\t\t\t\t\t\r\n\r\n\t\t\t\tbook_details.rank = rank_count;\r\n\t\t\t\tlist_of_books[rank_count-1] = book_details;\r\n\t\t\t\trank_count++;\r\n\r\n\t\t\t\tconsole.log(\"book details title:\" + book_details.title);\r\n\t\t\t\tconsole.log(\"list of books count:\" + list_of_books.length);\r\n\r\n\t\t\t\tconsole.log(completed_requests);\r\n\t\t\t\tconsole.log(getlength);\r\n\t\t\t\t\tif (completed_requests === getlength) {\r\n\t\t\t\t\t\t// All download done, process responses array\r\n\t\t\t\t\t\tstringify(list_of_books);\r\n\r\n\t\t\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}).on('err', function (e) {\r\n \tconsole.log(\"Got error: \", e);}\r\n\t\t\r\n\t\t\r\n\t\t);\r\n\t}\r\n\r\n}", "function getBookDetailsJSON(isbn, isbns_string, eventCallback) {\r\n\r\n\tvar book_details={};\r\n\r\n\trequest.get({\r\n\t\turl: \"https://www.googleapis.com/books/v1/volumes?q=\" + isbn + \"&key=APIKEY\"\r\n\t\t}, function(err, response, body) {\r\n\r\n\t\t\tif (body){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tbody = JSON.parse(body);\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\teventCallback(book_details);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\tbook_details.longDescription = body.items[0].volumeInfo.description ;\r\n\t\t\tbook_details.googleAvgRating = body.items[0].volumeInfo.averageRating;\r\n\t\t\tbook_details.googleAvgRatingCount = body.items[0].volumeInfo.ratingsCount;\r\n\t\t\tbook_details.googleBooksID = body.items[0].id;\r\n\r\n\t\t\trequest.get({\r\n\t\t\t\turl: \"https://www.goodreads.com/book/review_counts.json?isbns=\" + isbns_string +\"&key=APIKEY\"\r\n\t\t\t\t}, function(err, response, body) {\r\n\r\n\t\t\t\t\tif (body !== 'No books match those ISBNs.'){\r\n\t\t\t\t\t\tconsole.log(body)\r\n\t\t\t\t\t\tbody = JSON.parse(body);\r\n\r\n\t\t\t\t\t\tbook_details.goodreadsAvgRating =body.books[0].average_rating;\r\n\t\t\t\t\t\tbook_details.goodreadsAvgRatingCount = body.books[0].ratings_count;\r\n\t\t\t\t\t\tbook_details.goodreadsID= body.books[0].id;\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\tvar rating_string = \"\";\r\n\t\t\t\t\tvar rating_string_long = \"\";\r\n\r\n\t\t\t\t\tif (typeof book_details.goodreadsAvgRating !== 'undefined') {\r\n\r\n\t\t\t\t\t\t\trating_string_long = \" Goodreads users rated this book \" + book_details.goodreadsAvgRating + \" stars out of 5.\";\r\n\t\t\t\t\t\t\trating_string = rating_string + \"Goodreads User Rating: \" + book_details.goodreadsAvgRating + \"/5\\n\\n\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (typeof book_details.googleAvgRating !== 'undefined') {\r\n\t\t\t\t\t\trating_string_long = rating_string_long + \" Google Book users gave it a \" + book_details.googleAvgRating + \" rating.\";\r\n\t\t\t\t\t\trating_string = rating_string + \"Google Books User Rating: \" + book_details.googleAvgRating + \"/5\\n\\n\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbook_details.rating_string = rating_string;\r\n\t\t\t\t\tbook_details.rating_string_long = rating_string_long;\r\n\t\t\t\t\teventCallback(book_details);\r\n\r\n\t\t\t\t}).on('err', function (e) {\r\n\t\t\t\tconsole.log(\"Got error: \", e);\r\n\t\t\t});\r\n\r\n\t\t\t//eventCallback(body);\r\n\t\t}).on('err', function (e) {\r\n console.log(\"Got error: \", e);\r\n });\r\n\r\n}", "function getBooks () {\n fetch(bookUrl)\n .then(resp => resp.json())\n .then(books => {\n renderBooks(books);\n window.allBooks = books\n }) //aspirational code to renderBooks(books)\n }", "queryBooks(query) {\n fetch('https://www.googleapis.com/books/v1/volumes?q='+ query).then((response)=>{\n response.json().then((data)=>{\n this.setState({\n // googleBooks: data.items[0].volumeInfo\n googleBooks: data.items\n })\n\n console.log(this.state.googleBooks);\n\n })\n }).catch((error)=>console.log(error))\n }", "function handleBookSearch () {\n // console.log(\"googleKey\", googleKey);\n axios.get(\"https://www.googleapis.com/books/v1/volumes?q=intitle:\" + book + \"&key=\" + googleKey + \"&maxResults=40\")\n .then(data => {\n const result = data.data.items[0];\n setResults(result);\n setLoad(true);\n setLoaded(false);\n })\n .catch(err => {\n console.log('Couldnt reach API', err);\n });\n }", "function getData(title, author, cb) {\n let xhr = new XMLHttpRequest();\n // Use encodeURIcomponent() to replace each instance of a space in the \n // title or author inputs with %20\n let bookTitle = \"intitle:\" + encodeURIComponent(title);\n let bookAuthor = \"+inauthor:\" + encodeURIComponent(author);\n\n let path = baseURL;\n if (title) {\n path += bookTitle;\n }\n if (author) {\n path += bookAuthor;\n }\n path += key;\n xhr.open(\"GET\", path);\n\n xhr.send();\n\n xhr.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n cb(JSON.parse(this.responseText));\n }\n else if (this.status !== 200) {\n document.getElementById(\"bookContentContainer\").innerHTML = `<h5>Error: ${this.responseText} </h5>`;\n }\n };\n}", "function getAllBooks(){\n fetch(baseURL)\n .then(res => res.json())\n .then(books => listBooks(books))\n }", "function getAuthorListJSON(author, eventCallback) {\r\n\r\n\tvar book_details={};\r\n\tvar rank_count = 1;\r\n\tauthorencode = author.replace(' ','+');\r\n\r\n\trequest.get({\r\n\t\turl: \"https://www.googleapis.com/books/v1/volumes?q=\" + authorencode +\"&orderBy=relevance&key=APIKEY\"\r\n\t\t}, function(err, response, body) {\r\n\r\n\t\t\tvar list_of_books = [];\r\n\t\t\tvar list_of_titles = [];\r\n\r\n\t\t\tif (body){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tbody = JSON.parse(body);\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tvar list_of_books = [];\r\n\t\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\tif (body.totalItems === 0){\r\n\t\t\t\tstringify(list_of_books);\r\n\t\t\t\teventCallback(list_of_books);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tfor (var i = 0,length = body.items.length; i < length; i++ ) {\r\n\r\n\t\t\t\tvar book_details={};\r\n\r\n\t\t\t\tvar title = body.items[i].volumeInfo.title;\r\n\t\t\t\tbook_details.title = title;\r\n\t\t\t\tbook_details.titleupper = title.toUpperCase();\r\n\t\t\t\tconsole.log(book_details.title);\r\n\t\t\t\t\r\n\t\t\t\tif (list_of_titles.indexOf(body.items[i].volumeInfo.title)> 0) { \t\t\t\t\r\n\t\t\t\t\tcontinue; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof body.items[i].volumeInfo.authors=== 'undefined') { \t\t\t\t\r\n\t\t\t\t\tcontinue; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tlist_of_titles[i] = body.items[i].volumeInfo.title;\r\n\r\n\t\t\t\tvar author_string = \"\"; \r\n\t\t\t\tvar author_array = body.items[i].volumeInfo.authors;\r\n\t\t\t\tvar author_array_upper = [];\r\n\r\n\t\t\t\tfor (var a = 0, alength = author_array.length; a < alength; a++){\r\n\t\t\t\t\tauthor_array_upper[a] = author_array[a].toUpperCase();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (author_array_upper.indexOf(author.toUpperCase())< 0) { \r\n\t\t\t\t\t//console.log(\"Excluded: \" + book_details.title);\t\t\t\t\t\r\n\t\t\t\t\tcontinue; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (var k = 0, klength = author_array.length; k < klength; k++){\r\n\t\t\t\t\tauthor_string = author_string + author_array[k] + \" and \" ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tauthor_string = author_string.slice(0, -5);\r\n\t\t\t\tbook_details.author = author_string;\t\t\t\t\r\n\t\t\t\tbook_details.contributor = \"by \" + author_string;\r\n\r\n\r\n\t\t\t\tbook_details.author = author_string;\t\t\t\t\r\n\t\t\t\tbook_details.contributor = \"by \" + author_string;\r\n\t\t\t\t\r\n\t\t\t\tbook_details.rank = rank_count;\r\n\t\t\t\trank_count++;\r\n\r\n\t\t\t\tvar isbns_string = \"\";\r\n\t\t\t\tvar isbns_array = body.items[i].volumeInfo.industryIdentifiers;\r\n\r\n\t\t\t\tfor (var j = 0, jlength = isbns_array.length; j < jlength; j++){\r\n\t\t\t\t\tif (isbns_array[j].type === 'ISBN_10'){\r\n\t\t\t\t\t\tbook_details.primary_isbn10 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbook_details.primary_isbn13 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tisbns_string = isbns_string.slice(0, -1);\r\n\r\n\t\t\t\tbook_details.isbns_string = isbns_string;\r\n\r\n\t\t\t\tbook_details.contributor_alt = \"\";\r\n\r\n\t\t\t\tif (typeof body.items[i].volumeInfo.publishedDate !== 'undefined') { \r\n\t\t\t\t\t//published_date = body.items[i].volumeInfo.publishedDate;\r\n\t\t\t\t\tvar published_date = new Date(body.items[i].volumeInfo.publishedDate);\r\n\t\t\t\t\tvar date_string = monthNames[published_date.getMonth()] + \" \" + published_date.getFullYear();\r\n\t\t\t\t\tbook_details.contributor_alt = \"published in \" + date_string;\r\n\t\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t\tvar description = \". No description available.\";\r\n\t\t\t\t\r\n\t\t\t\tif (typeof(body.items[i].searchInfo) !=='undefined'){\r\n\t\t\t\t\tif (typeof(body.items[i].searchInfo.textSnippet) !=='undefined'){\r\n\t\t\t\t\t\tdescription = \". Here's a brief description of the book, \" + body.items[i].searchInfo.textSnippet;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbook_details.description = book_details.title + description;\r\n\t\t\t\t\r\n\r\n\t\t\t\tlist_of_books[i] = book_details;\r\n\t\t\t}\r\n\r\n\t\t\tlist_of_books = list_of_books.filter(function(n){ return n != undefined }); \r\n\t\t\tstringify(list_of_books);\r\n\t\t\t//console.log(list_of_books);\r\n\r\n\t\t\teventCallback(list_of_books);\r\n\t\t}).on('err', function (e) {\r\n console.log(\"Got error: \", e);\r\n });\r\n\r\n}", "function writeToDocument(title, author) {\n let el = document.getElementById(\"bookContentContainer\");\n let messageContainer = document.getElementById(\"messages\");\n // Sets the page back to blank every time the button is clicked.\n el.innerHTML = \"\";\n\n getData(title, author, function (data) {\n let searchList = [];\n let books = data.items;\n if (data.totalItems == 0) {\n messageContainer.innerHTML = `<div class=\"row flashed-messages\"><h4 class>No Results Found</h4></div>`;\n }\n else {\n for (var i in books) {\n // Assign an empty string to the variables\n // as Google Books API does not always contain these fields\n let img = \"\";\n let thumbnail = \"\";\n let title = \"\";\n let authors = \"\";\n let category = \"\";\n let description = \"\";\n let publisher = \"\";\n let publishedDate = \"\";\n let pageCount = \"\";\n let isbn = \"\";\n let textSnippet = \"\";\n\n // If fields exist overwrite the empty string with the returned information\n if (books[i].volumeInfo && books[i].volumeInfo.imageLinks && books[i].volumeInfo.imageLinks.thumbnail) {\n img = books[i].volumeInfo.imageLinks.thumbnail;\n thumbnail = img.substring(0, 4) + 's' + img.substring(4);\n }\n if (books[i].volumeInfo && books[i].volumeInfo.title) {\n title = books[i].volumeInfo.title;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.authors) {\n authors = books[i].volumeInfo.authors;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.categories && books[i].volumeInfo.categories[0]) {\n category = books[i].volumeInfo.categories[0];\n }\n if (books[i].volumeInfo && books[i].volumeInfo.description) {\n description = books[i].volumeInfo.description;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.publisher) {\n publisher = books[i].volumeInfo.publisher;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.publishedDate) {\n publishedDate = books[i].volumeInfo.publishedDate;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.pageCount) {\n pageCount = books[i].volumeInfo.pageCount;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.industryIdentifiers && books[i].volumeInfo.industryIdentifiers[0] && books[i].volumeInfo.industryIdentifiers[0].identifier) {\n isbn = books[i].volumeInfo.industryIdentifiers[0].identifier;\n }\n if (books[i].searchInfo && books[i].searchInfo.textSnippet) {\n textSnippet = books[i].searchInfo.textSnippet;\n }\n\n var dict = {\n \"thumbnail\": thumbnail,\n \"title\": title,\n \"authors\": authors,\n \"category\": category,\n \"description\": description,\n \"publisher\": publisher,\n \"published_date\": publishedDate,\n \"page_count\": pageCount,\n \"isbn\": isbn,\n \"text_snippet\": textSnippet,\n };\n searchList.push(dict);\n }\n\n // Print data to screen\n messageContainer.innerHTML += `<div class=\"row flashed-messages\"><div class=\"col s12\"><h4>Choose the edition you wish to review.</h4></div></div>`;\n for (i in searchList) {\n // How to encode string to base 64 found at Stack Overflow: https://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript\n el.innerHTML += `<div class='row'>\\\n <hr><hr><br>\\\n <div class='col s12 m6 center-align'><img src='${searchList[i].thumbnail}' alt='${searchList[i].title} book cover' class='centered'><br>\\\n <button type='submit' class='btn bg-blue' onclick='sendToPython(\"${btoa(encodeURIComponent(JSON.stringify(searchList[i])))}\");'>Choose This Edition</button>\\\n </div>\\\n <div class='col s12 m6'><table>\\\n <tr><td>Title:</td><td> ${searchList[i].title}</td></tr>\n <tr><td>Author:</td><td>${searchList[i].authors}</td></tr>\n <tr><td>Category:</td><td>${searchList[i].category}</td></tr>\n <tr><td>Snippet:</td><td>${searchList[i].text_snippet}</td></tr>\n <tr><td>Publisher:</td><td>${searchList[i].publisher}</td></tr>\n <tr><td>Date Published:</td><td>${searchList[i].published_date}</td></tr>\n <tr><td>Page Count:</td><td>${searchList[i].page_count}</td></tr>\n <tr><td>ISBN:</td><td>${searchList[i].isbn}</td></tr>\\\n </table>\\\n <br></div></div>`;\n }\n }\n }\n );\n}", "function getBooks() {\n return fetch(`${BASE_URL}/books`).then(res => res.json())\n}", "function bookGet() {\n\tgetBook = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=stripbooks';\n\tsetContent();\n}", "function searchGoogleBooksAPI(query) {\n API.searchBook(query)\n .then(res => {\n console.log(\"API - Results:\", res.data.items)\n setBooks(res.data.items);\n })\n .catch(err => console.log(err));\n }", "function getBooks() {\n clubID = this.value;\n // console.log('clubID', clubID);\n fetch('/get_books_in_genre?clubID=' + clubID)\n .then(function (response) {\n return response.json();\n }).then(function (json) {\n // console.log('GET response', json);\n if (json.length > 0) {\n set_book_select(json);\n };\n });\n}", "async function getBooksPlease(){\n const userInput =document.querySelector(\".entry\").value;\n apiUrl = `https://www.googleapis.com/books/v1/volumes?q=${userInput}`;\n const fetchBooks = await fetch(`${apiUrl}`);\n const jsonBooks = await fetchBooks.json();\n contentContainer.innerHTML= \"\";\n //console.log(jsonBooks)\n \n for (const book of jsonBooks.items) {\n const bookcontainer =document.createElement(\"div\");\n bookcontainer.className = \"book-card\"\n const bookTitle =document.createElement(\"h3\");\n const bookImage =document.createElement(\"img\");\n const bookAuthor =document.createElement(\"h3\");\n bookAuthor.innerHTML = book.volumeInfo.authors[0]\n bookTitle.innerText = book.volumeInfo.title\n bookImage.src = book.volumeInfo.imageLinks.thumbnail\n bookcontainer.append(bookImage, bookTitle, bookAuthor)\n contentContainer.append(bookcontainer)\n \n }\n}", "getAllBooks(url = this.baseUrl) {\r\n return fetch(url).then(response => response.json())\r\n }", "function findBook(req, res) {\n\n let url = 'https://www.googleapis.com/books/v1/volumes?q=';\n\n if (req.body.search[1] === 'title') { url += `+intitle:${req.body.search[0]}`; }\n\n if (req.body.search[1] === 'author') { url += `+inauthor:${req.body.search[0]}`; }\n\n superagent.get(url)\n\n .then(data => {\n // console.log('data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', data.body.items[0].volumeInfo);\n\n let books = data.body.items.map(value => {\n return new Book(value);\n });\n // console.log(books);\n res.render('pages/searches/show', { book: books });\n }).catch(error => console.log(error));\n\n}", "function loadBooks() {\n const data = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n // Authorization: 'Kinvey ' + localStorage.getItem('authToken'),\n };\n\n fetch(url, data)\n .then(handler)\n .then(displayBooks)\n .catch((err) => {\n console.warn(err);\n });\n }", "function getAmazonDetailsbyKeywords(title, author, eventCallback){\r\n\tconsole.log(\"in get Amazon by Keyword\");\r\n\topHelper.execute('ItemSearch', {\r\n\t\t'Title': title,\r\n\t\t'Author': author,\r\n\t\t//'Condition': 'All',\r\n\t\t'ResponseGroup': 'Large',\r\n\t\t//'IdType' : 'ISBN',\r\n\t\t'SearchIndex':'Books'\r\n\t\t}, function(error, results) {\r\n\t\t\tif (error) { console.log('Error: ' + error + \"\\n\"); }\r\n\r\n\t\t\t//console.log(\"Results:\\n\" + util.inspect(results) + \"\\n\\n\");\r\n\t\t\t\t\t\t\r\n\t\t\tvar amazon_details = {};\r\n\t\t\tvar imageset;\r\n\t\t\tvar ASIN;\t\r\n\t\t\tvar ISBN;\r\n\t\t\tvar related_items = [];\r\n\r\n\t\t\tamazon_details.lgImage = 'https://s3.amazonaws.com/virtual-librarian/2000px-No_image_available.svg.png';\r\n\t\t\tamazon_details.smImage = 'https://s3.amazonaws.com/virtual-librarian/300px-No_image_available.svg.png';\r\n\t\t\tamazon_details.ASIN = 'None';\t\r\n\t\t\tamazon_details.ISBN = 'None';\r\n\t\t\t\t\t\t\r\n\t\t\t//console.log(\"Results:\\n\" + util.inspect(results) + \"\\n\");\r\n\t\t\tconsole.log(results.ItemSearchResponse.Items);\r\n\t\t\t//console.log(results.ItemSearchResponse.Items.Request);\r\n\r\n\t\t\tif (typeof(results.ItemSearchResponse.Items.Item) === 'undefined'){\r\n\t\t\t\tconsole.log('here')\r\n\t\t\t\teventCallback(amazon_details);\r\n\t\t\t\treturn;\r\n\t\t\t} \r\n\r\n\t\t\tvar key, count = 0;\r\n\t\t\t\tfor(key in results.ItemSearchResponse.Items.Item) {\r\n\t\t\t\tif(results.ItemSearchResponse.Items.Item.hasOwnProperty(key)) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t//\tconsole.log(\"key:\" + key);\r\n\t\t\t\t//\tconsole.log(isNumeric(key));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (isNumeric(key)){\r\n\t\t\t\tASIN = results.ItemSearchResponse.Items.Item[0].ASIN;\r\n\t\t\t\tISBN = results.ItemSearchResponse.Items.Item[0].ItemAttributes.ISBN;\r\n\t\t\t\timageset = results.ItemSearchResponse.Items.Item[0].ImageSets.ImageSet;\r\n\t\t\t\trelated_items = results.ItemSearchResponse.Items.Item[0].SimilarProducts.SimilarProduct;\r\n\t\t\t\tconsole.log(\"in num key\");\r\n\t\t\t\t//console.log(results.ItemSearchResponse.Items.Item[0]);\r\n\t\t\t\t//console.log(results.ItemSearchResponse.Items.Item[0].SimilarProducts.SimilarProduct);\r\n\t\t\t\t//console.log(results.ItemSearchResponse.Items.Item[0].SimilarProducts.SimilarProduct);\r\n\t\t\t\t//console.log(related_items.length);\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tASIN = results.ItemSearchResponse.Items.Item.ASIN;\r\n\t\t\t\tISBN = results.ItemSearchResponse.Items.Item.ItemAttributes.ISBN;\r\n\t\t\t\timageset = results.ItemSearchResponse.Items.Item.ImageSets.ImageSet;\r\n\t\t\t\trelated_items = results.ItemSearchResponse.Items.Item.SimilarProducts.SimilarProduct;\r\n\t\t\t\tconsole.log(\"in not num key\");\r\n\t\t\t\t//console.log(results.ItemSearchResponse.Items.Item);\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tvar key, index=0, count = 0;\r\n\t\t\tfor(key in imageset) {\r\n\t\t\t\tif(imageset.hasOwnProperty(key)) {\r\n\t\t\t\t\t//console.log(key);\r\n\t\t\t\t\tif (isNumeric(key)){\r\n\t\t\t\t\t\tif (imageset[key].$.Category === 'primary'){\r\n\t\t\t\t\t\t\tindex = key;\r\n\t\t\t\t\t\t\timageset = imageset[index];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcount++;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof imageset.LargeImage !== 'undefined'){\r\n\t\t\t\tamazon_details.lgImage = imageset.LargeImage.URL;\r\n\t\t\t\tamazon_details.smImage = imageset.LargeImage.URL;\r\n\t\t\t\t//console.log(\"in large\");\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof imageset.HiResImage !== 'undefined'){\r\n\t\t\t\tamazon_details.lgImage = imageset.HiResImage.URL;\r\n\t\t\t\t//console.log(\"in hi-res\");\r\n\t\t\t}\r\n\r\n\t\t\tvar correct_image = 'https://images-na.ssl-images-amazon.com';\r\n\t\t\tvar incorrect_image = 'http://ecx.images-amazon.com';\r\n\t\t\tamazon_details.lgImage = amazon_details.lgImage.replace(incorrect_image,correct_image);\r\n\t\t\tamazon_details.smImage = amazon_details.smImage.replace(incorrect_image,correct_image);\r\n\t\t\tamazon_details.ASIN = ASIN;\r\n\t\t\tamazon_details.ISBN = ISBN;\r\n\t\t\tamazon_details.related_items = related_items;\r\n\r\n\t\t\tconsole.log(amazon_details);\r\n\t\t\t\t\t\t\r\n\t\t\teventCallback(amazon_details);\r\n\r\n\t});\r\n}", "getBooks() {\n return this.service.sendGetRequest(this.books);\n }", "function getBooks(){\n fetch('http://localhost:3000/books')\n .then(resp => resp.json())\n .then(book => book.forEach(title))\n}", "function getBookReview() {\n\tvar queryURL =\n\t\t'https://api.nytimes.com/svc/books/v3/reviews.json?title=' +\n\t\tsearchTerm +\n\t\t'&api-key=AGFM7Bkp4YHthCReyXQ2KGqDWUyAaMLW';\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tbookReview = response.results[0].url;\n\t\tsetContent();\n\t});\n}", "function searchForBooks() {\n let search = document.querySelector('#search-bar').value; // save value of search bar\n const URL = 'https://www.googleapis.com/books/v1/volumes/?q='; // URL to search\n const maxResults = '&maxResults=10';\n let searchGBooks = `${URL}${search}${maxResults}`; // google books api + search value\n\n // set up JSON request\n let request = new XMLHttpRequest();\n request.open('GET', searchGBooks, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n let data = JSON.parse(request.responseText); // Success! here is the JSON data\n render(data);\n } else {\n showError('No matches meet your search. Please try again'); // reached the server but it returned an error\n }\n };\n request.onerror = function() {\n // There was a connection error of some sort\n };\n request.send();\n}", "function getApi(event) {\n\n console.log(topicSearched);\n var requestUrl = \"https://www.googleapis.com/books/v1/volumes?q=\" + topicSearched;\n fetch(requestUrl)\n .then(function (response) {\n if (response.status === 400) {\n // || Message displaying that city is invalid\n return;\n } else {\n return response.json();\n }\n })\n .then(function (response) {\n saveSearchItem();\n console.log(searchInput);\n console.log(response);\n console.log(response);\n for (var i = 0; i < response.items.length; i++) {\n var bookCard = document.createElement('li');\n bookCard.setAttribute('class', 'card cell small-2 result-card');\n\n var linkBook = document.createElement('a');\n linkBook.href = response.items[i].volumeInfo.infoLink;\n linkBook.setAttribute('target', '_blank');\n bookCard.append(linkBook);\n\n var thumbImg = document.createElement('img');\n thumbImg.setAttribute('alt', `${response.items[i].volumeInfo.title}`)\n thumbImg.src = response.items[i].volumeInfo.imageLinks.thumbnail;\n linkBook.append(thumbImg);\n\n var favoriteEl = document.createElement('span');\n favoriteEl.setAttribute('class', 'label warning');\n favoriteEl.textContent = 'Favorite Me';\n bookCard.append(favoriteEl);\n\n var isbnNumber = document.createElement('span');\n isbnNumber.textContent = response.items[i].volumeInfo.industryIdentifiers[0].identifier;\n console.log(response.items[i].volumeInfo.industryIdentifiers[0].identifier);\n console.log(isbnNumber.textContent);\n isbnNumber.setAttribute('style', 'display: none');\n bookCard.append(isbnNumber);\n\n resultsList.append(bookCard);\n\n console.log(response.items[i].volumeInfo.infoLink);\n console.log(resultCard);\n }\n if (searchInput != \"\") {\n console.log(searchInput);\n } else {\n (function (response) {\n console.log(searchInput)\n })\n }\n });\n\n}", "function fetchBookDetails( row ) {\n \n var book = {};\n \n var cover = row.find('a > img.bc-image-inset-border');\n if ( cover.length > 0 ) book.cover = cover.attr('src');\n \n var title = row.find('ul > li:nth-child(1) > a > span');\n if ( title.length > 0 ) book.title = _.kebabCase( title.text().trimAll() );\n \n return (book.title && book.cover) ? book : null;\n \n }", "function getEdgarListJSON(shelf_name, year, category, eventCallback) {\r\n\r\n\tshelf_name = shelf_name.replace(' ','+');\r\n\r\n\trequest.get({\r\n\t\turl: \"https://www.goodreads.com/review/list/60491294.xml?key=APIKEY&v=2&order=a&shelf=\" + shelf_name\r\n\t\t}, function(err, response, body) {\t\r\n\r\n\t\t\tparseString(body, {explicitArray : false, ignoreAttrs : true }, function (err, result) {\r\n\r\n\t\t\t\tvar list_of_books = [];\r\n\r\n\t\t\t\t if (err) {\r\n\t\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar list_of_books = [];\r\n\t\t\t\tvar book_results = result.GoodreadsResponse.reviews.review;\r\n\t\t\t\tvar rank_count = 1;\r\n\t\t\t\tvar Edgar_Winners = ['9780062292438','9780802123459','9780525955078'];\r\n\r\n\t\t\t\tfor (var i = 0,length = book_results.length; i < length; i++ ) {\r\n\t\t\t\t\tconsole.log(book_results[i].book.title);\r\n\r\n\t\t\t\t\tvar book_details={};\r\n\r\n\t\t\t\t\tvar title = book_results[i].book.title;\r\n\t\t\t\t\tbook_details.title = title;\r\n\t\t\t\t\tbook_details.titleupper = title.toUpperCase();\r\n\r\n\t\t\t\t\tif (typeof book_results[i].book.authors.author !== 'undefined'){\r\n\t\t\t\t\t\tbook_details.author = book_results[i].book.authors.author.name;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbook_details.author = book_results[i].book.authors.author[0].name;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbook_details.contributor = \"by \" + book_details.author;\r\n\t\t\t\t\t\r\n\t\t\t\t\tbook_details.rank = rank_count;\r\n\t\t\t\t\trank_count++;\r\n\r\n\t\t\t\t\tbook_details.primary_isbn10 = 'None';\r\n\t\t\t\t\tbook_details.primary_isbn13 = 'None';\r\n\r\n\t\t\t\t\tif (typeof book_results[i].book.isbn !== 'undefined'){\r\n\t\t\t\t\t\tbook_details.primary_isbn10 = book_results[i].book.isbn;\r\n\t\t\t\t\t\tif (book_details.primary_isbn10 === ''){book_details.primary_isbn10 = 'None;'}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (typeof book_results[i].book.isbn13 !== 'undefined'){\r\n\t\t\t\t\t\tbook_details.primary_isbn13 = book_results[i].book.isbn13;\r\n\t\t\t\t\t\tif (book_details.primary_isbn13 === ''){book_details.primary_isbn13 = 'None;'}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbook_details.isbns_string = book_details.primary_isbn10 + \",\" + book_details.primary_isbn13;\r\n\r\n\t\t\t\t\tif (Edgar_Winners.indexOf(book_details.primary_isbn13) >=0) { \r\n\t\t\t\t\t\tbook_details.contributor_alt = book_details.contributor + \". Note, this won the \" + year + \" award for \" + category + \". \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tvar description = \"\";\r\n\r\n\t\t\t\t\r\n\t\t\t\t\tif (typeof(book_results[i].book.description) !=='undefined'){\r\n\t\t\t\t\t\tdescription = striptags(book_results[i].book.description);\t\t\r\n\t\t\t\t\t\tdescription = description.replace(/.<br><br>/gi,'. ');\r\n\t\t\t\t\t\tdescription = description.replace(/<br><br>/gi,'. ');\r\n\t\t\t\t\t\tdescription = description.replace(/<br>/gi,'. ');\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tdescription = \" No Desciption available. \";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconsole.log(description);\r\n\r\n\t\t\t\t\tvar wordcount = description.split(' ').length;\r\n\r\n\t\t\t\t\tconsole.log(\"word count:\" + wordcount);\r\n\r\n\t\t\t\t\tif (wordcount > 100) {\r\n\t\t\t\t\t description = trimByWord(description);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbook_details.description = book_details.title + \", \" + book_details.contributor + \". Here's a brief description of the book, \" + description;\r\n\t\t\t\t\t\r\n\t\t\t\t\tconsole.log(book_details.description );\r\n\r\n\t\t\t\t\tlist_of_books[i] = book_details;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstringify(list_of_books);\r\n\t\t\t\t//console.log(list_of_books);\r\n\r\n\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\r\n\r\n\t\t\t});\r\n\r\n\r\n\t\t}).on('err', function (e) {\r\n console.log(\"Got error: \", e);\r\n });\r\n\r\n}", "async function getAllBooks () {\n console.log('book')\n const books = await fetchData(endpoint, config);\n // console.log(books)\n render.allBooks(books);\n}", "function searchGoogleBooks(query) {\n API.search(query)\n .then(res => setResults(res.data.items))\n .catch(err => console.log(err));\n }", "function displayBook(classData) {\n showSpinner(bookEl);\n var searchTitle = classData.book.name;\n var searchPhrase = searchTitle.replace(/ /g, \"-\");\n var searchAuthor = classData.book.author;\n var queryURL = \"https://openlibrary.org/search.json?title=\" + searchPhrase;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n for (var i = 0; response.docs.length; i++) {\n var authorName = response.docs[i].author_name[0];\n\n if (authorName === searchAuthor) {\n var isbn = response.docs[i].isbn[0];\n var bookTitle = response.docs[i].title;\n\n var title = document.createElement(\"h5\");\n title.textContent = bookTitle;\n var author = document.createElement(\"h6\");\n author.textContent = authorName;\n var bookcover = document.createElement(\"img\");\n bookcover.setAttribute(\"src\", \"http://covers.openlibrary.org/b/isbn/\" + isbn + \"-M.jpg\");\n\n clearSpinner(bookEl);\n bookEl.append(title, author, bookcover);\n break;\n }\n else {\n // if book cannot be found in open library API, displays details entered from admin page\n var title = document.createElement(\"h5\");\n title.textContent = searchTitle;\n var author = document.createElement(\"h6\");\n author.textContent = searchAuthor;\n clearSpinner(bookEl);\n bookEl.append(title, author);\n }\n }\n })\n}", "function addCategoryBooks(category, index){\n createCategory(category)\n fetch(`https://www.googleapis.com/books/v1/volumes?q=subject:${category}`)\n .then(response => {return response.json()})\n .then(data => {\n data.items.forEach(element => { \n if (element.volumeInfo.hasOwnProperty('imageLinks') \n && element.volumeInfo.hasOwnProperty('authors')\n && element.volumeInfo.hasOwnProperty('description')){\n let cover = element.volumeInfo.imageLinks.thumbnail\n let name = element.volumeInfo.title\n let author = element.volumeInfo.authors[0]\n let bookId = element.id\n if(name.length > 35){\n name = name.slice(0, 35) + \"...\" \n }\n if(author.length > 25){\n author = author.slice(0, 25) + \"...\"\n }\n createBookContainer1(cover,name,author,index,bookId)\n } \n })\n })\n}", "function Book(info) {\n this.image_url= info.imageLinks?info.imageLinks.thumbnail:'https://i.imgur.com/J5LVHEL.jpg';\n this.title = info.title || 'No title available';\n this.author=info.authors;\n this.description=info.description;\n this.isbn=info.industryIdentifiers ? info.industryIdentifiers[0].identifier: 'No isbn';\n}", "async getAllBooks(parent,args,ctx,info){\n return await ctx.db.query.books({\n where : {active:true}\n },`{\n id\n title\n author\n publisher {\n name\n discount\n }\n category{\n name\n }\n type {\n name\n }\n images {\n src\n }\n mrp\n sku\n }`);\n \n }", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "async function getBooks(){\n if(!books){\n let result = await MyBooklistApi.bookSearch(\"fiction\", getCurrentDate(), user.username);\n setBooks(result);\n }\n }", "function fetchBooks(url){\n return fetch(url)\n .then(resp => resp.json())\n}", "function fetchBook() {\n Books.get($stateParams.id)\n .then(function(book) {\n $scope.book = book;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "componentDidMount() {\n axios\n .get(\n `https://www.googleapis.com/books/v1/volumes?q=subject:fiction&filter=paid-ebooks&langRestrict=en&maxResults=20&&orderBy=newest&key=${process.env.REACT_APP_GOOGLE_BOOK_TOKEN}`\n )\n .then((response) => {\n console.log(\"axios Api\", response.data);\n this.setState({\n booksFromApi: response.data.items,\n });\n })\n .catch((error) => {\n console.log(error);\n });\n\n // service\n\n // .get(\"/bookFromData\")\n // .then((result) => {\n // console.log(\"fetch ggl id and populate \", result.data);\n // this.setState({\n // saveList: result.data,\n // });\n // })\n // .catch((error) => console.log(error));\n }", "static async find(searchQuery) {\n if (!searchQuery) {\n return [];\n }\n\n const response = await fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchQuery}`, {\n method: 'GET',\n });\n\n if (!response.ok) {\n throw new Error(\"Error Fetching Books\");\n }\n\n const payload = await response.json();\n return payload.items || [];\n }", "function getBookChapterList(bookId) {\n db.get(bookId).then(function(doc) {\n createChaptersList(doc.chapters.length);\n }).catch(function(err) {\n console.log('Error: While retrieving document. ' + err);\n });\n\n}", "function bookCoverGrab(input, randos) {\n // console.log(input);\n\n for (i = 0; i < randos.length; i++) {\n let theIsbn = input.docs[randos[i]].pnx.search.isbn[0];\n let theTitle = input.docs[randos[i]].pnx.display.title;\n let theCatalogLink = `<a href=\"https://rocky-primo.hosted.exlibrisgroup.com/permalink/f/1j18u99/${input.docs[randos[i]].pnx.control.sourceid}${input.docs[randos[i]].pnx.control.sourcerecordid}\"\n target=\"_blank\">`;\n\n let syndetics = `https://syndetics.com/index.aspx?isbn=${theIsbn}/MC.JPG&client=primo`;\n \n addToDom(syndetics, theTitle, theCatalogLink);\n }\n const loaderr = document.getElementById(\"library-preloader\");\n loaderr.style.display = \"none\";\n }", "function getBooks() {\n //Get the <div id='results'> that holds the list\n var results = document.getElementById('results');\n //Get the <div id='results'> that holds the list\n var results = document.getElementById('results');\n //Cleaning the previous result if any\n if (results.childNodes[0] != undefined) {\n results.removeChild(results.childNodes[0])\n }\n //Creating a new unordered list <ul>\n const colletion = document.createElement('ul')\n //Set the classe to the <ul>\n colletion.setAttribute('class', 'collection col s6 offset-s2')\n //Add to the DIV id\n results.appendChild(colletion)\n // Get the input\n const book = document.getElementById('search').value\n\n fetch('https://www.googleapis.com/books/v1/volumes?q=' + book + '&key=AIzaSyCfxVfRWs5eLZEwwiZemvp1iAwyAaHBHUQ')\n .then(response => {\n return response.json()\n })\n .then(data => {\n //If there is at least one result loop through all of them \n if (data.totalItems > 0) {\n for (i = 0; i < data.totalItems; i++) {\n //Those are the components to build materializecss collection component\n //See more at : https://materializecss.com/collections.html\n //Create a <li>\n const list = document.createElement('li')\n //Create a <span>\n const span = document.createElement('span')\n //Create a <p>\n const p = document.createElement('p')\n //Create a <img>\n const img = document.createElement('img')\n //Create a <li>\n const a = document.createElement('a')\n //Create a <i>\n const button = document.createElement('i')\n //Defining classes to the components for the collections\n list.setAttribute('class', 'collection-item avatar')\n span.setAttribute('class', 'title')\n img.setAttribute('class', 'circle')\n a.setAttribute('class', 'btn-floating btn-large waves-effect waves-light red')\n button.setAttribute('class', 'material-icons')\n //If there is a image thumgbail, define it as a logo\n if (data.items[i].volumeInfo.imageLinks != undefined) {\n img.setAttribute('src', data.items[i].volumeInfo.imageLinks.smallThumbnail)\n }\n //Defining the material-icons for the button\n button.innerText = 'shop';\n //The info variable stores the information of the book\n //First, add the title to it\n var info = \"Title: \" + data.items[i].volumeInfo.title\n //Store the title to pass it to the Amazon url\n title = data.items[i].volumeInfo.title\n //If there is a author add it to the info\n if (data.items[i].volumeInfo.authors != undefined) {\n info = info + '\\n Author: ' + data.items[i].volumeInfo.authors[0];\n //Store the author to pass it to the Amazon url\n author = data.items[i].volumeInfo.authors[0];\n }\n //If there is a publisher add it to the info\n if (data.items[i].volumeInfo.publisher != undefined) {\n info = info + '\\n Publisher: ' + data.items[i].volumeInfo.publisher;\n publisher = data.items[i].volumeInfo.publisher;\n }\n //If there is a category add it to the info\n if (data.items[i].volumeInfo.categories != undefined) {\n info = info + '\\n Category: ' + data.items[i].volumeInfo.categories[0];\n }\n //If there is a published date add it to the info\n if (data.items[i].volumeInfo.publishedDate != undefined) {\n var date = data.items[i].volumeInfo.publishedDate\n info = info + '\\n Year: ' + date.substring(0, 4);\n }\n // <a> is the red cicle button \n a.setAttribute('style', 'margin-top: -80px')\n // This link will send the usar to the amazon site to buy the book\n a.setAttribute('href', 'https://www.amazon.co.uk/s?k=' + title + \" \" + author + '&ref=nb_sb_noss_2')\n // To open a new window\n a.setAttribute('target', '_blank')\n //Add all the info regarding the book to the <p>\n p.innerText = info\n // Nesting the elements as:\n // <li> \n // ----<img>\n // ----<p>\n // ----<a><i>\n list.appendChild(img)\n list.appendChild(p)\n p.appendChild(a)\n colletion.appendChild(list)\n a.appendChild(button)\n }\n //If no books were found, display an message to the user\n } else {\n const error = document.createElement('p')\n error.setAttribute('style', \"color: white; text-align: center\")\n error.innerText = 'Please, try again! \\n Your search returned 0 item! :(';\n colletion.appendChild(error)\n }\n }\n )\n //If any error occurs, display a red error message to the user\n .catch(err => {\n console.log(err)\n const error = document.createElement('p')\n if (err.code != undefined) {\n error.setAttribute('style', \"color: red\")\n error.innerText = err.message;\n colletion.appendChild(error)\n }\n\n })\n}", "addBook (req, res) {\n console.log(req.body)\n // get parameter values sent from front end\n var title = req.body.title,\n author = req.body.author,\n // encode user input for inclusion within URL\n encodedTitle = encodeURIComponent(title),\n encodedAuthor = encodeURIComponent(author),\n // get book details from API\n url = `https://www.googleapis.com/books/v1/volumes?q=intitle:${encodedTitle}+inauthor:${encodedAuthor}&maxResults=1`\n // get JSON data to fill in specific book data\n fetch(url).then(response => response.json())\n .then(data => {\n // only one result is returned to reduce data load, but it still is returned as an Array\n var bookInfo = data.items[0]\n // include data retrieved from JSON API in book fields\n var key = booksRef.push({\n title: title,\n author: author,\n year: bookInfo.volumeInfo.publishedDate.split('-')[0],\n description: bookInfo.volumeInfo.description,\n url: makeURLSecure(bookInfo.volumeInfo.infoLink),\n imgUrl: makeURLSecure(bookInfo.volumeInfo.imageLinks.thumbnail)\n })\n // must send some response back\n res.send(key)\n res.end()\n })\n .catch(error => console.log(error))\n }", "function bookSearch(){\n ...\n\n $.AJAX({\n url: \"https://www.googleapis.com/books/v1/volumes?q=\" + search,\n dataType: \"json\",\n\n success: function(data) {\n console.log(data)\n },\n type: 'GET'\n });\n }", "function getBook(obj) {\n fetch(bookUrl + obj.id)\n .then(response => response.json());\n }", "getBooksFromXmlResponse(xmlResponse, goodreadsUserId) {\n return new Promise((resolve, reject) => {\n xml2js.parseString(xmlResponse, (err, result) => {\n if (err) {\n console.log(`[goodreads][${goodreadsUserId}]: Error parsing XML`);\n reject(err);\n return;\n }\n const books = [];\n if (!result || !result.GoodreadsResponse) {\n console.log(\"Found no GoodreadsResponse in xml2js result.\");\n resolve(books);\n return;\n }\n const reviews = this.getXmlProperty(result.GoodreadsResponse, \"reviews\");\n if (!reviews || !reviews.review) {\n resolve(books);\n return;\n }\n for (let review of reviews.review) {\n const grBook = this.getXmlProperty(review, \"book\", null /* defaultValue */);\n const book = {\n title: this.getXmlProperty(grBook, \"title\"),\n isbn: this.getXmlProperty(grBook, \"isbn\"),\n isbn13: this.getXmlProperty(grBook, \"isbn13\"),\n goodreadsUrl: this.getXmlProperty(grBook, \"link\"),\n imageUrl: this.getXmlProperty(grBook, \"image_url\", null /* defaultValue */),\n author: this.getAuthorForBook(grBook),\n };\n book.imageUrl =\n this.maybeGetFallbackCoverUrl(book.imageUrl, book.isbn);\n books.push(book);\n }\n resolve(books);\n });\n });\n }", "function getBooks() {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'GET'\n }).done(function (response) {\n setBooks(response);\n });\n }", "function getBook(authorName, authorSurname, library) {\n\n let listOfBooks = Object.values(library);\n let consulta = [];\n\n\n for (let book of listOfBooks) {\n if (book.author.name === authorName && book.author.surname === authorSurname) {\n consulta.push(book.title)\n }\n }\n return console.log(consulta)\n}", "function createSearch(request, response) {\n let url = \"https://www.googleapis.com/books/v1/volumes?q=\";\n\n console.log(request.body);\n console.log(request.body.search);\n\n if (request.body.search[1] === \"title\") {\n url += `+intitle:${request.body.search[0]}`;\n }\n if (request.body.search[1] === \"author\") {\n url += `+inauthor:${request.body.search[0]}`;\n }\n\n // WARNING: won't work as is. Why not?\n // superagent.get(url)\n // .then(apiResponse => console.log(util.inspect(apiResponse.body.items, {showhidden: false, depth: null})))\n // .then(results => response.render('pages/searches/show', {searchResults: results})\n // )}\n superagent\n .get(url)\n .then(apiResponse =>\n apiResponse.body.items.map(bookResult => new Book(bookResult.volumeInfo))\n )\n .then(results =>\n response.render(\"pages/searches/show\", { searchResults: results })\n );\n}", "function loadBooks() {\n\n\t// We return the promise that axios gives us\n\treturn axios.get(apiBooksUrl)\n\t\t.then(response => response.data) // turns to a promise of books\n\t\t.catch(error => {\n\t\t\tconsole.log(\"AJAX request finished with an error :(\");\n\t\t\tconsole.error(error);\n\t\t});\n}", "function Book(query, results) {\r\n this.image = results.imageLinks.thumbnail;\r\n this.title = results.volumeInfo.title;\r\n this.author = results.volumeInfo.authors;\r\n this.description = results.volumeInfo.description;\r\n this.search_query = query;\r\n}", "function peiticionLibro(title){\n title = title.replace(/\\s/g,\"+\");\n //console.log(title);\n request.get(`http://openlibrary.org/search.json?q=/${title}/`,(err,response,body) =>{\n //console.log(err);\n //console.log(response.statusCode);\n const json = JSON.parse(body);\n console.log(json.docs[0].title);\n console.log('Authors');\n json.docs[0].author_name.forEach(element => console.log(element));\n\n });\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n setBooks(res.data);\n // console.log(res);\n })\n .catch(err => console.log(err.response));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadSearchedBooks(searchTerm){\n var b = firebase.firestore().collection('books')\n console.log(b.doc)\n \n firebase.firestore().collection('books')\n .where('status','==',\"available\")\n .get()\n .then(function(querySnapshot){\n var resultingHTML = `\n <div class=\"row buydiv\">\n \n <div id=\"searchbar\">\n <div id=\"searchbar\">\n <input type=\"search\" id=\"mySearch\" name=\"q\"\n placeholder=\"Search for books..\" size=\"28\">\n <button onclick=\"loadSearchedBooks('mySearch')\">Search</button>\n </div>\n \n </br>\n </div>`\n querySnapshot.forEach(function(doc){\n var data = doc.data()\n var status= data.status\n console.log(searchTerm)\n if(data.title.includes(searchTerm)){ \n if (status == \"in_progress\"){\n var status= \"In Progress\";\n console.log(status);\n }\n for(var c in pictureshash){\n if (c== data.title){\n var imgsrc= pictureshash[c][0];\n console.log(imgsrc);\n \n }\n }\n resultingHTML += `<div class=\"row buydiv\">\n <div class=\"media tm-flexbox-ie-fix tm-width-ie-fix book\">\n <div class=\"tm-media-img-container\">\n <div class=\"text-center pt-31 pb-31 tm-timeline-date tm-bg-green\">${status}</div>\n <img class=\"d-flex img-fluid\" src=\"${imgsrc}\">\n </div>\n \n <div class=\"media-body tm-flexbox-ie-fix tm-width-ie-fix tm-bg-light-gray\">\n <div class=\"p-5\">\n <h1 class=\"mb-4 mt-0 tm-timeline-item-title\">Book Title: ${data.title}</h1>\n <h2 class=\"mb-4\">Seller Email: <p id=\"selleremail\">${data.seller}</p></h2>\n <h2 class=\"mb-4\">Course Name: ${data.course}</h2>\n <h2 class=\"mb-4\">Price: $${data.price}</h2>\n <h2 class=\"mb-4\">Condition: ${data.condition}</h2>\n \n </div>\n </div>\n <h2></h2>\n <a class=\"btn btn-primary tm-button-rounded tm-button-no-border tm-button-normal tm-button-timeline\" onclick=\"email()\">Buy Book</a> \n \n </div>\n </div> <!-- row -->`\n }\n /*\n This is where you would create an HTML element for a card \n Each loop creates a new element\n Equivalent to the \"resultingHTML\" tag in Jeff's app\n */\n })\n document.getElementById('results_html').innerHTML = resultingHTML\n\n })\n}", "static async getBook(ctx, next) {\n const market = ctx.params['market'];\n const exch1 = ctx.request.query.exch1;\n const exch2 = ctx.request.query.exch2;\n try {\n const book = await OrderBook.getOrderBook({ market, exch1, exch2 });\n return Response.success(ctx, { book }, \"Cross-Exchange Order Book\");\n }\n catch (e) {\n return Response.badRequest(ctx, null, \"Error\");\n }\n }", "function getCriticalListJSON(category, eventCallback) {\r\n\r\n\trequest.get({\r\n\t\turl: \"https://idreambooks.com/api/publications/recent_recos.json?key=APIKEY&slug=\" + category\r\n\t\t}, function(err, response, body) {\r\n\t\t\t\r\n\t\t\tvar list_of_books = [];\r\n\r\n\t\t\tif (body){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tbody = JSON.parse(body);\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tvar list_of_books = [];\r\n\t\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\t//console.log(body);\r\n\r\n\t\t\tfor (var i = 0,length = body.length; i < length; i++ ) {\r\n\t\t\t\tvar book_details={};\r\n\r\n\t\t\t\tvar title = body[i].title;\r\n\r\n\t\t\t\tbook_details.title = title;\r\n\t\t\t\tbook_details.titleupper = title.toUpperCase();\r\n\t\t\t\tbook_details.author = body[i].author;\r\n\t\t\t\tbook_details.contributor = \"by \" + body[i].author;\r\n\t\t\t\tbook_details.rank = i+1;\r\n\t\t\t\tbook_details.primary_isbn10 = 'None';\r\n\t\t\t\t//book_details.primary_isbn13 = body.results[i].book_details[0].primary_isbn13;\r\n\r\n\t\t\t\tvar isbns_string = body[i].isbns;\r\n\t\t\t\tvar n = isbns_string.indexOf(\",\");\r\n\r\n\t\t\t\tif (n<0){\r\n\t\t\t\t\tbook_details.primary_isbn13 = isbns_string ;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbook_details.primary_isbn13 = isbns_string.substring(0, n);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbook_details.isbns_string = isbns_string;\r\n\r\n\t\t\t\tvar description = body[i].review_snippet;\r\n\t\t\t\tvar review_pub = \"\"\r\n\r\n\t\t\t\tvar master_publications_list = [\"NPR\", \"Dear Author\",\"Kirkus\", \"Publishers Weekly\", \"Forbes\", \"All About Romance\", \"Time Magazine\", \"The Economist\" ]\r\n\r\n\t\t\t\tif (master_publications_list.indexOf(body[i].review_publication_name) > -1) {\r\n\t\t\t\t\t\treview_pub = body[i].review_publication_name;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\treview_pub = \"the \" + body[i].review_publication_name;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbook_details.description = book_details.title + \", \" + book_details.contributor + \". Here's a snippet of a review from \" + review_pub + \", \" + description;\r\n\r\n\t\t\t\tlist_of_books[i] = book_details;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tstringify(list_of_books);\r\n\r\n\t\t\teventCallback(list_of_books);\r\n\t\t}).on('err', function (e) {\r\n console.log(\"Got error: \", e);\r\n });\r\n\r\n}", "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "async getBooks() {\n if(this.props.currentUser) {\n var bookIdList = this.props.currentUser[\"library\"][\"to_read_list\"];\n if(bookIdList === null) {\n bookIdList = [];\n this.setState({isLoading: false});\n }\n\n var bookList = [];\n\n // Get details from Cache or API and add to list - skip if not available\n for (let i = 0; i < bookIdList.length; i++) {\n var book = await this.props.getBookDetails(bookIdList[i]);\n if(book === null) {\n continue;\n }\n\n if(this.state.searchString === \"\" || (this.state.searchString !== \"\" && ((book.Title.toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1) || book.Authors.join(\"\").toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1))) {\n bookList.push(book);\n }\n\n }\n await this.setState({toReadList: bookList, isLoading: false});\n\n // Add books to cache\n this.props.addBooksToCache(bookList);\n } else {\n this.setState({isLoading: false});\n }\n\n }", "function resultsGoogle (obj) {\n // For loop through results\n for (var i = 0; i < obj.items.length; i++) {\n var title = obj.items[i].volumeInfo.title;\n var author = obj.items[i].volumeInfo.authors[0];\n var image = obj.items[i].volumeInfo.imageLinks.thumbnail;\n var description = obj.items[i].volumeInfo.description;\n var isbn = obj.items[i].volumeInfo.industryIdentifiers[0].identifier;\n\n // Filter for only ISBN-10 values\n for(var j = 0; j < obj.items[i].volumeInfo.industryIdentifiers.length; j++) {\n if(obj.items[i].volumeInfo.industryIdentifiers[j].identifier.length === 10) {\n var isbn = obj.items[i].volumeInfo.industryIdentifiers[j].identifier;\n // Call function to write result cards and modal trigger\n resultsHTML(image, title, author, description, isbn, i);\n //console.log('ISBN', isbn);\n } // end if\n } // end j loop\n } //End i loop\n} //End resultsGoogle stored function", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "books(parent) {\n\t\t\tconsole.log('parent!!')\n\t\t\t\treturn dataSources.bookService.getAuthorBooks(parent.id);\n\t\t}", "function Book(book) {\n this.title =data.volumeInfo.title ;\n this.author=data.volumeInfo.author;\n this.description=data.volumeInfo.description || *** Description current unavailable ***;\n this.thumbnail = data.volumeInfo.imageLinks.thumbnail || null;\n this.url = ;\n}", "async function getBooks() {\r\n\ttry{\r\n\t\t// lean() transforms mongoose object to json object\r\n\t\tconst data = await newBoek.find().lean();\r\n\t\treturn data;\r\n\t} catch (error) {\r\n\t\tconsole.log('getBooks failed ' + error);\r\n\t}\r\n}", "getAllBooks() {\n return axios.get(`${url}/allBooks`);\n }", "fetchBooks ({ commit }, queryObj) {\n const query = queryGenerator(queryObj)\n return this.$axios\n .$get('/book?' + query)\n .then(\n (res) => {\n commit('SETBOOKS', res.book)\n },\n (err) => {\n // eslint-disable-next-line no-console\n console.log(err)\n }\n )\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n console.log(res.data)\n setBooks(res.data)\n })\n .catch(err => console.log(err));\n }", "function createURL(book){\n return `https://www.googleapis.com/books/v1/volumes?q=${book}`;\n}", "function searchBooks () {\n var dataStr = $( '#searchData' ).prop( 'value' );\n dataStr = dataStr.replace( / /g, '+' );\n\n $.ajax( {\n type: 'GET',\n url: 'https://openlibrary.org/search.json?q=' + dataStr,\n dataType: 'json',\n success: function ( data ) {\n \n if ( data.num_found > 0 ) {\n var dataList = data.docs;\n \n for ( var i = 0; ( i < dataList.length ) && ( i < 200 ); i++ ) {\n var itemNode = $( '<div class=\"searchItem\"></div>' );\n\n itemNode.click( { olidList: dataList[i].edition_key },\n searchBookOLIDs );\n\n if ( dataList[i].cover_i ) {\n var imgStr = '<img src=\"https://covers.openlibrary.org/b/id/';\n itemNode.append( imgStr + dataList[i].cover_i + '-S.jpg\">' );\n }\n\n itemNode.append( '<div><h1></h1><p></p></div>' );\n\n if ( dataList[i].title_suggest ) {\n itemNode.children( 'div' ).children( 'h1' )\n .append( dataList[i].title_suggest );\n }\n\n if ( dataList[i].author_name ) {\n itemNode.children( 'div' ).children( 'h1' )\n .append( ', by ' + dataList[i].author_name.join( ', ' ) );\n }\n\n if ( dataList[i].edition_key.length > 1 ) {\n itemNode.children( 'div' ).children( 'p' )\n .append( dataList[i].edition_key.length +\n ' editions. Click to view.' );\n } else {\n itemNode.children( 'div' ).children( 'p' )\n .append( dataList[i].edition_key.length +\n ' edition. Click to view.' );\n }\n\n $( '#mCSB_3_container' ).append(itemNode);\n }\n } else {\n var itemNode = $( '<h1 style=\"font-size:1em;\">No results found</h1>' );\n $( '#mCSB_3_container' ).append(itemNode);\n }\n },\n } );\n}", "function Book({ book, onShelfChange }) {\n const { title, authors = [], imageLinks } = book;\n return (\n <div className=\"book\">\n <div className=\"book-top\">\n <div\n className=\"book-cover\"\n style={{\n width: 128,\n height: 193,\n // some books come without imageLinks proprty\n backgroundImage: `url(${imageLinks && imageLinks.thumbnail})`,\n }}\n />\n <BookShelfChanger book={book} onShelfChange={onShelfChange} />\n </div>\n <div className=\"book-title\">{title}</div>\n {/* authors come as an array with one or more author*/}\n {authors.map((author) => (\n <div key={author} className=\"book-authors\">\n {author}\n </div>\n ))}\n </div>\n );\n}", "constructor(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n }", "function fetchBooks(){\n\n return fetch(BOOKS_URL)\n .then(resp => resp.json())\n\n // .then(resp => console.log(JSON.stringify(resp.length)))\n}", "function getBooks() {\n fetch(\"http://localhost:3000/books\")\n .then(res => res.json())\n .then(books => showBooks(books))\n .catch(err => console.log(err))\n}", "function getGoogleScholarCites(title, year){\n \n // Go to url\n if (year && year > 0){\n iimPlay('CODE: URL GOTO=http://scholar.google.es/scholar?hl=es&q=allintitle:\"' + title.replace(/ /g, '<SP>') + '\"&as_ylo=' + year + '&as_yhi=' + year );\n }\n else {\n iimPlay('CODE: URL GOTO=http://scholar.google.es/scholar?hl=es&q=allintitle:\"' + title.replace(/ /g, '<SP>') + '\"');\n }\n \n // Position at \"Citado por\" div\n iimPlay('CODE: TAG POS=1 TYPE=DIV ATTR=CLASS:gs_fl EXTRACT=TXT');\n var citesText = iimGetLastExtract().trim();\n \n // Extract cites number\n var n = citesText.match(/Citado por [0-9]+/gi); \n if( n == null) {\n var cites = \"\";\n } else {\n var cites = parseInt(n[0].trim().replace('Citado por ',''));\n }\n \n return cites;\n}", "function getContent(bookID,chapNum,position,stgs,width,height,callback)\n{\n \n\t var url = IP+\"/book/\"+bookID+\"/chapter/\"+chapNum;\n\t var jqxhr = $.getJSON(url, function(book) {\n\t\thandleDisplay(book,chapNum,position,width,height,stgs,function (content){\n var url = IP+\"/book/\"+bookID+\"/title/\";\n\t var jqxhr = $.getJSON(url, function(bookTitle) {\n\t\t content.title = bookTitle;\n\t\t callback(content);\n\t })\n\t .error(function() { \n\t alert(\"Fail in get book\"); \n\t var content = new Object();\n\t content.pageNum=0;\n\t content.chapNum=0;\n\t content.pagesToDisplay = new Array();\n\t content.title =\"\";\n\t callback(content);})\n });\n\t})\n\t.error(function() { \n\talert(\"Fail in get book\"); \n\tvar content = new Object();\n\tcontent.pageNum=0;\n\tcontent.chapNum=0;\n\tcontent.title = \"\";\n\tcontent.pagesToDisplay = new Array();\n\tcallback(content);\n\t})\n\n}", "function Book(title, author, genre, numPages) {\n this.title = title\n this.author = author\n this.genre = genre\n this.numPages = numPages\n}", "function load() {\r\n\t\tvisibility(\"none\", \"allbooks\");\r\n\t\tvisibility(\"\", \"singlebook\");\r\n\t\tbookTitle = this.className; // enables the user to go to page of the book that is clicked\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\"+bookTitle+\"/cover.jpg\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; \r\n\t\tsearchData(\"info&title=\" + bookTitle, oneBookInfo);\r\n\t\tsearchData(\"description&title=\" + bookTitle, oneBookDescription);\r\n\t\tsearchData(\"reviews&title=\" + bookTitle, oneBookReview);\t\r\n\t}", "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 }", "loadBooksByRating(filterObj) {\n\t\tapi.getBooks({rating: filterObj.map(rating => rating.description).join(\",\")}, result => {\n\n\t\t});\n\t}", "constructor(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n }", "function book(title, author, pageNum, read) { //constructor\n \n this.title = title\n this.author = author\n this.pageNum = pageNum\n this.read = read\n \n}", "function listBooks(response, request) {\n\n var authorID = request.params.authorID;\n\n return memory.authors[authorID].books\n \n \n}", "function Book(obj) {\n this.image = obj.volumeInfo.imageLinks ? obj.volumeInfo.imageLinks.thumbnail : `https://i.imgur.com/J5LVHEL.jpg`;\n this.title = obj.volumeInfo.title ? obj.volumeInfo.title : 'Title not available';\n this.author = obj.volumeInfo.authors ? obj.volumeInfo.authors : 'Author(s) not available';\n this.description = obj.volumeInfo.description ? obj.volumeInfo.description : 'Description not available';\n this.isbn = obj.volumeInfo.industryIdentifiers ? obj.volumeInfo.industryIdentifiers[0].identifier : 'N/A';\n this.bookshelf = obj.volumeInfo.categories ? obj.volumeInfo.categories[0] : 'No Categories';\n}", "constructor( props ){\n super( props );\n this.state = {\n bookTitle: \"\",\n author:\"\",\n volId: \"\", \n result: \"\",\n snippet : \"\",\n apiURL: 'https://www.googleapis.com/books/v1/volumes?q='\n }\n }", "function Book(title, author, pages, isRead) {\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.isRead = isRead;\n}", "function getTitelpagina(isbn, callbackEnd, context) {\r\n var tabelnaam = 'Titelpagina';\r\n\r\n var params = {\r\n TableName: tabelnaam,\r\n Key: {\"Isbn\": {N: isbn}}\r\n };\r\n\r\n var callback = function(err, data) {\r\n if (err) {\r\n console.log('error on getTitelpagina: ', err);\r\n context.done('Unable to retrieve ' + tabelnaam + ' information', null);\r\n } else {\r\n console.log(tabelnaam + ' data: ', JSON.stringify(data));\r\n if (data.Item && util.isEmpty(util.getNested(data, 'Item'))) {\r\n console.log(tabelnaam + ': geen data gevonden');\r\n } else {\r\n console.log(tabelnaam + ': data gevonden!');\r\n var resp = {};\r\n if (!util.isEmpty(util.getNested(data, 'Item.Timestamp'))) { resp['Timestamp'] = util.getNested(data, 'Item.Timestamp.S')}\r\n // if (!util.isEmpty(util.getNested(data, 'Item.Titelpagina'))) { resp['Titelpagina'] = util.getNested(data, 'Item.Titelpagina.S')}\r\n response[tabelnaam] = resp;\r\n }\r\n getColofon(isbn, callbackEnd, context);\r\n }\r\n };\r\n\r\n dynamodb.getItem(params, callback);\r\n}", "async function getBooksWithSearch(type, date) {\n try{\n let result = await MyBooklistApi.bookSearch(type, date, user.username);\n setBooks(result);\n return true;\n }\n catch(e){\n return e;\n }\n }", "function allBooks(){\r\n\t\tvisibility(\"none\", \"singlebook\");\r\n\t\tvisibility(\"\", \"allbooks\");\r\n\t\tif(this.status == SUCCESS){\r\n\t\t\tvar title = this.responseXML.querySelectorAll(\"title\");\r\n\t\t\tvar folder = this.responseXML.querySelectorAll(\"folder\");\r\n\t\t\tfor (var i = 0; i < title.length; i++) {\r\n\t\t\t\tvar book = document.createElement(\"div\");\r\n\t\t\t\tvar text = document.createElement(\"p\");\r\n\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\tvar fileName = folder[i].textContent; \r\n\t\t\t\tvar img = \"books/\" + fileName + \"/cover.jpg\";\r\n\t\t\t\timage.src = img;\r\n\t\t\t\timage.alt = fileName;\r\n\t\t\t\timage.className = fileName; // gives classname to get to its page\r\n\t\t\t\ttext.className = fileName;\r\n\t\t\t\ttext.innerHTML = title[i].textContent;\r\n\t\t\t\tbook.appendChild(image);\r\n\t\t\t\tbook.appendChild(text);\r\n\t\t\t\tdocument.getElementById(\"allbooks\").appendChild(book);\r\n\t\t\t\timage.onclick = load;\r\n\t\t\t\ttext.onclick = load;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "function getBooksInCategory(category) {\n// var db = ScriptDb.getMyDb();\n// var db_categories = ParseDb.getMyDb(applicationId, restApiKey, \"list_categories\");\n var db_gen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n \n var books = [];\n \n var query = db_gen.query({});\n while (query.hasNext()) {\n var book = query.next();\n if (category == \"\" || category == null || book.category == category) {\n books.push(book); \n }\n }\n \n return books;\n}", "function getFavorites() {\n if (localStorage.getItem('book') === null) {\n } else {\n storageArr = storageArr.concat(JSON.parse(localStorage.getItem('book')));\n console.log(storageArr);\n\n for (var i = 0; i < storageArr.length; i++) {\n var requestUrl = `https://www.googleapis.com/books/v1/volumes?q=isbn:${storageArr[i]}`;\n\n fetch(requestUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n var bookCard = document.createElement('li');\n bookCard.setAttribute('class', 'card cell medium-2 small-4 result-card');\n\n var linkBook = document.createElement('a');\n linkBook.href = data.items[0].volumeInfo.infoLink;\n linkBook.setAttribute('target', '_blank');\n bookCard.append(linkBook);\n\n console.log(data.items[0].volumeInfo.imageLinks.thumbnail);\n var thumbImg = document.createElement('img');\n thumbImg.setAttribute('alt', `${data.items[0].volumeInfo.title}`)\n thumbImg.src = data.items[0].volumeInfo.imageLinks.thumbnail;\n linkBook.append(thumbImg);\n\n var favoriteEl = document.createElement('span');\n favoriteEl.setAttribute('class', 'label warning');\n favoriteEl.textContent = 'Remove';\n bookCard.append(favoriteEl);\n\n var isbnNumber = document.createElement('span');\n isbnNumber.textContent = data.items[0].volumeInfo.industryIdentifiers[0].identifier;\n isbnNumber.setAttribute('style', 'display: none');\n bookCard.append(isbnNumber);\n\n favoriteMenu.append(bookCard);\n })\n }\n }\n}", "function getBooks () {\n\t\t\treturn backendService.getBooks()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tallBooks = response; // keep a copy of all the books, without filtering.\n\t\t\t\t\treturn allBooks;\n\t\t\t\t});\n\t\t}", "function book(title, author, pages) {\r\n this.title = title\r\n this.author = author\r\n this.pages = pages\r\n this.read = 'not'\r\n this.info = function() {\r\n return `${title} by ${author}, ${pages} pages.`\r\n }\r\n }", "function Book(title, author, isbn) {\r\n this.title = title;\r\n this.author = author;\r\n this.isbn = isbn;\r\n}" ]
[ "0.67026985", "0.6645842", "0.6580502", "0.6496905", "0.64402133", "0.63113433", "0.62750965", "0.6272987", "0.62532353", "0.620866", "0.6171927", "0.61680335", "0.6154817", "0.60867167", "0.60772777", "0.6073042", "0.60596097", "0.6036178", "0.60256964", "0.5970491", "0.59261173", "0.5915685", "0.58713883", "0.58686304", "0.5851832", "0.5842037", "0.58277285", "0.5791313", "0.5748808", "0.57133347", "0.5711713", "0.5694509", "0.5637182", "0.56286603", "0.56245065", "0.55973285", "0.559055", "0.558642", "0.557878", "0.5573317", "0.55684835", "0.5559934", "0.55408907", "0.5535062", "0.5532871", "0.55285054", "0.5516369", "0.5495725", "0.54742223", "0.54656196", "0.5450303", "0.544598", "0.54458916", "0.54397124", "0.54190946", "0.54187506", "0.5414115", "0.5414115", "0.5413523", "0.5401989", "0.5395096", "0.53907794", "0.5385976", "0.53672385", "0.53532994", "0.5350392", "0.53472733", "0.5340535", "0.5333806", "0.53330916", "0.53297025", "0.53203857", "0.5315669", "0.5311529", "0.5307761", "0.5293247", "0.52905196", "0.5289406", "0.52825546", "0.5269163", "0.52685344", "0.5265168", "0.5263653", "0.52619076", "0.52608347", "0.52583915", "0.525274", "0.52472043", "0.5239467", "0.5238031", "0.52303857", "0.5225139", "0.52225465", "0.5221963", "0.5213794", "0.5208921", "0.52064115", "0.5206122", "0.51979053", "0.51976657" ]
0.73480374
0
The method to add covers info into each books
async getRenderItems(token) { let books = []; var isbnid; var coverUrl; for (i = 0; i < this.state.idTypes.length; i++) { if (this.state.idTypes[i].name == "ISBN") { isbnid = this.state.idTypes[i].id; break; } } var i; var id; for (i in this.state.books) { let book = this.state.books[i]; for (j = 0; j < book.identifiers.length; j++) { id = book.identifiers[j].identifierTypeId; let value = book.identifiers[j].value.split(" "); value = value[0]; if (id == isbnid) { coverUrl = await this.getCover('&isbn=' + value, book.title); console.log(coverUrl); if (coverUrl != "") { console.log(book.title); books.push(book); books[books.length - 1].cover = coverUrl; break; } } else { // If a book don't have ISBN, get cover by title only console.log(book.title); books.push(book); coverUrl = await this.getCover('', book.title); console.log(coverUrl); books[books.length - 1].cover = coverUrl; break; } } } // data load complete this.setState({ books: books, isLoadingComplete: true, }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCategoryBooks(category, index){\n createCategory(category)\n fetch(`https://www.googleapis.com/books/v1/volumes?q=subject:${category}`)\n .then(response => {return response.json()})\n .then(data => {\n data.items.forEach(element => { \n if (element.volumeInfo.hasOwnProperty('imageLinks') \n && element.volumeInfo.hasOwnProperty('authors')\n && element.volumeInfo.hasOwnProperty('description')){\n let cover = element.volumeInfo.imageLinks.thumbnail\n let name = element.volumeInfo.title\n let author = element.volumeInfo.authors[0]\n let bookId = element.id\n if(name.length > 35){\n name = name.slice(0, 35) + \"...\" \n }\n if(author.length > 25){\n author = author.slice(0, 25) + \"...\"\n }\n createBookContainer1(cover,name,author,index,bookId)\n } \n })\n })\n}", "function _addBook(author, title, genre, numbOfPage) {\n _data.push({\n id: getCurrentId(),\n title: title,\n genre: genre,\n numOfPage: numbOfPage,\n author: author\n });\n }", "function addBooksToLibrary(title, author, pages) {\r\n let newItem = new book(title, author, pages); \r\n myLibrary.push(newItem);\r\n }", "function addBook(bookObject, number) {\n CATALOG.push(bookObject);\n let stock = {\n numberOfCopies: number,\n numberCheckedOut: 0,\n };\n INVENTORY[bookObject.ISBN] = stock;\n renderBooks();\n}", "function Book({ book, onShelfChange }) {\n const { title, authors = [], imageLinks } = book;\n return (\n <div className=\"book\">\n <div className=\"book-top\">\n <div\n className=\"book-cover\"\n style={{\n width: 128,\n height: 193,\n // some books come without imageLinks proprty\n backgroundImage: `url(${imageLinks && imageLinks.thumbnail})`,\n }}\n />\n <BookShelfChanger book={book} onShelfChange={onShelfChange} />\n </div>\n <div className=\"book-title\">{title}</div>\n {/* authors come as an array with one or more author*/}\n {authors.map((author) => (\n <div key={author} className=\"book-authors\">\n {author}\n </div>\n ))}\n </div>\n );\n}", "function addBooksToPage(libraryToDisplay) {\n libraryToDisplay.forEach(function (book) {\n const singleBook = document.createElement('div');\n\n const bookTitle = document.createElement('p');\n bookTitle.classList.add('book-title');\n bookTitle.textContent = book.title + \"\\r\\n\";\n\n const bookContent = document.createElement('p');\n singleBook.setAttribute('style', 'white-space: pre;');\n bookContent.textContent += \"By: \" + book.author + \"\\r\\n\";\n bookContent.textContent += \"Number of pages: \" +book.pages + \"\\r\\n\";\n bookContent.classList.add('book-content');\n singleBook.classList.add((book.isRead == 'Read' ? 'books' : 'books-unread'));\n\n /* add delete button */\n const deleteBtn = document.createElement('button');\n deleteBtn.textContent = \"Delete\";\n deleteBtn.classList.add('delete-button');\n\n /* add a status button */\n const statusBtn = document.createElement('button');\n statusBtn.textContent = book.isRead;\n statusBtn.classList.add('status-button');\n\n /* create data attributes that saves index of current book so we can delete and update it later */\n deleteBtn.setAttribute('data-index', libraryToDisplay.indexOf(book));\n statusBtn.setAttribute('data-status', libraryToDisplay.indexOf(book));\n\n singleBook.appendChild(bookTitle)\n singleBook.appendChild(bookContent)\n singleBook.appendChild(statusBtn); // add status button to book\n singleBook.appendChild(deleteBtn); // add delete button to book\n bookContainer.appendChild(singleBook); // add book to the container\n });\n}", "function displayAllBooks() {\r\n myLibrary.forEach(item => {\r\n let bookContainer = document.createElement(\"div\");\r\n bookContainer.classList.add(\"book-container\");\r\n let infoContainer = document.createElement(\"div\");\r\n infoContainer.classList.add(\"info-container\");\r\n //Adding the info text\r\n infoContainer.innerHTML = bookInfo(item);\r\n //Appending the elements to their parents\r\n bookContainer.appendChild(infoContainer);\r\n container.appendChild(bookContainer);\r\n })\r\n}", "function Book(info) {\n this.image_url= info.imageLinks?info.imageLinks.thumbnail:'https://i.imgur.com/J5LVHEL.jpg';\n this.title = info.title || 'No title available';\n this.author=info.authors;\n this.description=info.description;\n this.isbn=info.industryIdentifiers ? info.industryIdentifiers[0].identifier: 'No isbn';\n}", "function showBooks(books) {\n\t$.each(books, function(i) {\n\t\t$(\"#booksList\").append(\"<div class='book well col-xs-12'>\");\n\t\t$(\".book\").last().append(\"<div class='bookDescription overlay'>\" + books[i].descripcion + \"</div>\");\n\t\t$(\".book\").last().append(\"<img src='\" + books[i].portada + \"' alt='bookCover' width='248.4px' height='248.4px'>\");\n\t\t$(\".book\").last().append(\"<div class='bookTitle'>\" + books[i].titulo + \"</div>\");\n\t\t$(\".book\").last().append(\"<div>Idioma: \" + \"<span class='text-uppercase'>\" + books[i].idioma + \"</span></div>\");\n\t})\n}", "function DetailsPage(book_item_id, book_collection) {\n // Remove what's on that page to prep for what will be added\n const detailcontent = document.querySelector(\"#item_details\");\n\n console.log(\n document.querySelector(\"#item_details\"),\n \"Where details are going\"\n );\n\n console.log(book_collection, \"course code to find bookmark item\");\n\n // Add the course details to the page\n for (i = 0; i < book_collection.length; i++) {\n console.log(i);\n if (book_item_id.id === book_collection[i].course_id) {\n console.log(\n book_collection[i].course_id,\n \"this is items id in the collection of saved bookmarks\"\n );\n\n const coursedetail = book_collection[i];\n\n console.log(coursedetail);\n\n detailcontent.innerHTML = \"\";\n\n detailcontent.innerHTML += `\n <div id=\"for_bookmarks\">\n <div class='course-title-home' > \n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"course-code\">\n <p class=\"title\" id=\"courseID\">${coursedetail.course_id}</p>\n <p class=\"subtitle\" id=\"courseTitle\">${coursedetail.name}</p>\n </div>\n </div>\n </div>\n \n <!-- Course Stat Tiles -->\n <div class=\"course-stats\">\n <div class=\"tile is-ancestor\">\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"credit\">${coursedetail.credits}</p>\n <p class=\"subtitle\">Credits</p>\n </article>\n </div>\n \n \n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"gened\">${coursedetail.gen_ed}</p>\n <p class=\"subtitle\">Gen-Ed</p>\n </article>\n </div>\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"method\">${\n coursedetail.grading_method\n }</p>\n <p class=\"subtitle\">Grading Method</p>\n </article>\n </div>\n </div>\n </div>\n </div> \n <!-- Course Description -->\n <div class='course-description-home' > \n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"home-description\">\n <p class=\"title\" >Description</p>\n <p class=\"subtitle\" id=\"description\">${coursedetail.description}</p>\n </div>\n </div>\n </div>\n <!-- Average Grade -->\n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"average-grade\">\n <p id=\"avgGrade\"><b>Average Grade: </b>\n ${avgGPA(coursedetail.course_id)}\n </p>\n </div>\n </div> `;\n }\n }\n}", "function addBookToLibrary(title, author, pages, read) {\n let newBook = new Book(title, author, pages, read);\n libraryBooks.push(newBook);\n}", "function addBookToLibrary(title, author, pages, read) {\n let newBook = new Book(title, author, pages, read)\n myLibrary.push(newBook)\n saveLibraryInStorage(myLibrary)\n renderBook(newBook)\n}", "function addBookToLibrary(title, author, pages, read) {\n let book = new Book(title, author, pages, read);\n myLibrary.push(book);\n // do stuff here\n}", "function addBookToLibrary(title, author, numPages, read) {\n myLibrary.push(new Book(title, author, numPages, read));\n setLocalStorage();\n render();\n}", "function addBookToLibrary(title, author, pages, isRead) {\n let newBook = new Book(title, author, pages, isRead);\n myLibrary.push(newBook);\n}", "function addBookToLibrary(title, author, pages, read) {\n\t// .some searches through the array for matching title, if matching does nothing\n\tif (myLibrary.some(book => book.title === title)) return;\n\t// similar to do nothing if no title is entered\n\tif (title === '') return;\n\t// sends info to constructor, pushes to array, then constructs cards\n\tconst book = new Book(title, author, pages, read);\n\tmyLibrary.push(book);\n\tconstructCard();\n}", "function listBooks(books){\n books.forEach(book => bookLi(book))\n }", "function addBookToLibrary(name, author, pages, readStatus) {\r\n let book = new Book(name, author, pages, readStatus);\r\n myLibrary.push(book);\r\n render();\r\n}", "function addBookDetails(book){\n\t\t$newUl = $('<ul>').css('list-style-type', 'circle');\n\t\t$newAuthor = $('<li>').text('Author: '+book.author).css('font-style','italic');\n\t\t$newId = $('<li>').text('Id: '+book.id).css('font-style','italic');\n\t\t$newPublisher = $('<li>').text('Publisher: '+book.publisher).css('font-style','italic');\n\t\t$newType = $('<li>').text('Type: '+book.type).css('font-style','italic');\n\t\t$newIsbn = $('<li>').text('Isbn: '+book.isbn).css('font-style','italic');\n\t\t$newEdit = $('<button>', {class: 'edit btn btn-outline-info'}).text('Edit').attr('data-id', book.id);\n\t\t\n\t\t$editDiv = $('<div>',{class: 'edit'}).css('display', 'none').attr('data-id', book.id).attr('accept-charset','utf-8');\n\t\t$inputTitle = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','title').attr('placeholder','new title');\n\t\t$inputAuthor = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','author').attr('placeholder','new author');\n\t\t$inputPublisher = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','publisher').attr('placeholder','new publisher');\n\t\t$inputType = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','type').attr('placeholder','new type');\n\t\t$inputIsbn = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','isbn').attr('placeholder','new isbn');\n\t\t$saveBtn = $('<button>',{class: 'save btn btn-outline-info'}).text('Save').attr('data-id', book.id);\t\t\n\t\t\n\t\t$editDiv.append($inputTitle);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputAuthor);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputPublisher);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputType);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputIsbn);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($saveBtn);\n\t\t\n\t\t$newUl.append($newAuthor);\n\t\t$newUl.append($newId);\n\t\t$newUl.append($newPublisher);\n\t\t$newUl.append($newType);\n\t\t$newUl.append($newIsbn);\n\t\t$newUl.append($newEdit);\n\t\t$newUl.append('<hr>');\n\t\t$newUl.append($editDiv);\n\t\t\n\t\treturn $newUl;\n\t}", "function addtoLibrary(id, book, authorName, pages, read, list) {\n list.push(new Book(id, book, authorName, pages, read));\n}", "function addBook(bookName, bookGenre) {//Adds a new book to catalog\n booksCatalog.push({\n name: bookName,\n genre: bookGenre,\n available: true,\n owner:\"\"\n });\n }", "function updateCover(book){ // change to book \n console.log(book);\n\n var img = book.book_image;\n console.log(img);\n\n var carousel = $(\"#iDontLikeThis\");\n var imageElement = $(\"<img>\");\n imageElement.attr(\"src\", img);\n //makes image responsive\n imageElement.addClass('img-responsive');\n var aTag = $(\"<a>\");\n var isbn10 = book.isbns[0].isbn10;\n //attr pulls book cover from amazon using the isbn10 number\n aTag.attr(\"href\", \"https://amazon.com/gp/product/\" + isbn10);\n aTag.attr('target', \"__BLANK\");\n aTag.addClass(\"carousel-item\");\n //adds image and appends to github\n aTag.append(imageElement)\n aTag.append(book.title);\n carousel.append(aTag);\n carousel.carousel();\n\n }", "function Book(props) {\n\n const {imageLinks, authors, title, shelves, shelf,onShelfChanged} = props;\n\n return (\n <div className=\"book\">\n <div className=\"book-top\">\n <div className=\"book-cover\" style={{ width: 128, height: 193, backgroundImage: `url(\"${imageLinks.smallThumbnail}\")` }}></div>\n <BookShelfChanger book={props} onShelfChanged={onShelfChanged} shelves={shelves} shelf={shelf} />\n </div>\n <div className=\"book-title\">{title}</div>\n {authors.map((author,index)=>(\n <div key={`author_${index}`} className=\"book-authors\">{author}</div>\n ))}\n </div>\n )\n}", "static displayBooksToList() {\n const books = Store.getBooks();\n\n books.forEach((book) => {\n UI.addBookToList(book)\n });\n }", "static displayBooks () {\n\t\tconst books = Store.getBooks();\n\n\t\t//Loop through each book and call method addBookToList\n\n\t\tbooks.forEach((book) => UI.addBookToList(book));\n\t}", "function BookInfo(props) {\n\tconst columns = [\n\t\t{ field: 'id', headerName: 'ID', width: 80 },\n\t\t{ field: 'title', headerName: 'Title', width: 300 },\n\t\t{ field: 'authors', headerName: 'Authors', width: 300 },\n\t];\n\n\tlet count = 1;\n\tlet theRows = [];\n\tif (props.myBooks) {\n\t\tconst rows = props.myBooks.map((book) => {\n\t\t\treturn {\n\t\t\t\tid: count++,\n\t\t\t\ttitle: book.Title,\n\t\t\t\tauthors: book.Author,\n\t\t\t};\n\t\t});\n\t\ttheRows = rows;\n\t}\n\tif (!props.myBooks) {\n\t\treturn <h1> </h1>;\n\t}\n\n\tfunction addTo() {\n\t\talert('Item added to collection');\n\t}\n\treturn (\n\t\t<Paper>\n\t\t\t<div style={{ height: 800, width: '100%' }}>\n\t\t\t\t<DataGrid\n\t\t\t\t\trows={theRows}\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tpageSize={10}\n\t\t\t\t\t// onRowDoubleClick={addTo}\n\t\t\t\t\t// onRowSelected={somethingElse}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Paper>\n\t);\n}", "function setBook(data){\n var list = document.getElementById('listID');\n var totalCostElement = document.getElementById('totalCostID');\n \n var div = document.createElement('div');\n div.className = \"row shoppingMenuRow justify-content-center\";\n \n var imageDiv = document.createElement('div');\n imageDiv.className = \"col-md-3 bookImage_div\";\n var img = document.createElement('img');\n img.className = \"bookImage\";\n img.src = data.image;\n imageDiv.append(img);\n div.appendChild(imageDiv);\n \n var infoDiv = document.createElement('div');\n infoDiv.className = \"col-md-7 bookInfos\";\n var ul = document.createElement('ul');\n var titleLi = document.createElement('li');\n titleLi.innerHTML = \"<b>Title:</b> \"+data.title;\n ul.appendChild(titleLi);\n var authorsLi = document.createElement('li');\n authorsLi.innerHTML = \"<b>Auhors: </b>\";\n createAuthorsList(data.isbn, authorsLi)\n ul.appendChild(authorsLi);\n var publishingLi = document.createElement('li');\n publishingLi.innerHTML = \"<b>Publishing House:</b> \"+data.publishingHouse;\n ul.appendChild(publishingLi);\n var isbnLi = document.createElement('li');\n isbnLi.innerHTML = \"<b>ISBN:</b> \"+ data.isbn;\n ul.appendChild(isbnLi);\n var priceLi = document.createElement('li');\n priceLi.innerHTML = \"<b>Price:</b> \"+ data.price.toFixed(2) + ' €';\n ul.appendChild(priceLi);\n infoDiv.append(ul);\n div.appendChild(infoDiv);\n \n var priceDiv = document.createElement('div');\n priceDiv.className = \"col-md-2 bookPrice\";\n var innerDiv = document.createElement('div');\n innerDiv.className = \"lastColumn\";\n \n var price = document.createElement('b');\n price.textContent = (data.price*data.quantity).toFixed(2) + \" €\";\n innerDiv.appendChild(price);\n \n var incrementDiv = document.createElement('div');\n incrementDiv.className = \"row justify-content-center incrementDiv\";\n \n var value = document.createElement('p');\n value.className = \"col-6 multiplier\";\n value.textContent = data.quantity;\n \n var buttonL = document.createElement('button');\n buttonL.className = \"col-3 multiplierButtonL\";\n buttonL.setAttribute('type', 'button');\n buttonL.onclick = () => removeQty(value, data.isbn, data.price.toFixed(2), price, totalCostElement);\n buttonL.textContent = \"-\";\n incrementDiv.appendChild(buttonL);\n incrementDiv.appendChild(value);\n var buttonR = document.createElement('button');\n buttonR.className = \"col-3 multiplierButtonR\";\n buttonR.setAttribute('type', 'button');\n buttonR.onclick = () => addQty(value, data.isbn, parseFloat(data.price), price, totalCostElement);\n buttonR.textContent = \"+\";\n incrementDiv.appendChild(buttonR);\n innerDiv.appendChild(incrementDiv);\n var removeButton = document.createElement('button');\n removeButton.className = \"removeButton\";\n removeButton.setAttribute('type', 'button');\n removeButton.textContent = \"Remove\";\n removeButton.onclick = () => removeBook(data, value, div, totalCostElement);\n innerDiv.appendChild(removeButton);\n priceDiv.append(innerDiv);\n div.appendChild(priceDiv);\n \n list.appendChild(div);\n totalCost += (data.price*data.quantity);\n totalCostElement.textContent = totalCost.toFixed(2) + \" €\";\n}", "function addBookToLib(title, author, numPages, haveRead){\n let newBook = new Book(title, author, numPages, haveRead, myLib.length+1);\n myLib.push(newBook);\n displayBook(newBook);\n}", "function addBookToLibrary(book) {\n let bookList = document.querySelector('.bookList');\n \n const newBook = new Book();\n myLibrary.push(newBook);\n }", "function bookDetail(\n title,\n author,\n publishedDate,\n description,\n category,\n price,\n currencyCode,\n thumbnail\n) {\n this.title = title;\n this.author = author;\n this.publishedDate = publishedDate;\n this.description = description;\n this.category = category;\n this.price = price;\n this.currencyCode = currencyCode;\n this.thumbnail = thumbnail;\n}", "function appendBooks(response) {\n response.forEach(book => {\n\n let authors = ``\n\n book.authors.forEach(author => {\n authors += `${author.firstName} ${author.lastName}, `\n })\n\n authors = authors.substr(0, authors.length-2);\n\n $('.books-wrapper').append(`\n <div class=\"card-wrapper\">\n <div class=\"col s12 m7\">\n <div class=\"card horizontal\">\n <div class=\"card-image\">\n <img src=\"${book.cover_url}\">\n </div>\n <div class=\"card-stacked\">\n <div class=\"card-content\">\n <h3 class=\"header\">${book.title}</h3>\n <h5>${authors}</h5>\n <p>${book.genre}</p>\n <p>${book.description}</p>\n </div>\n <div class=\"card-action\">\n <a class=\"waves-effect waves-light btn blue edit-btn\" data-id=${book.id}>Edit</a>\n <a class=\"waves-effect waves-light btn red delete-btn\" data-id=${book.id}>Remove</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n `);\n });\n\n //activates delete and edit click handlers\n deleteRelocation();\n editRelocation();\n\n }", "function addBookToLibrary()\n{\n \n}", "static displayBooks() {\n const books = Store.getBooks();\n\n books.forEach(book => {\n const ui = new UI();\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "function displaySavedCovers() {\n savedCoversSection.innerHTML = ``;\n for (var i = 0; i < savedCovers.length; i++) {\n savedCoversSection.innerHTML += \n `<section class=\"mini-cover\">\n <img class=\"cover-image\" id=${savedCovers[i].id} src=${savedCovers[i].cover} alt=\"No Image Available\">\n <h2 class=\"cover-title\">${savedCovers[i].title}</h2>\n <h3 class=\"tagline\">A tale of <span class=\"tagline-1\">${savedCovers[i].tagline1}</span> and <span class=\"tagline-2\">${savedCovers[i].tagline2}</span></h3>\n </section>`\n }\n}", "function createBookContainer1(url,name,author,index,bookId){\n let bookContainer = document.createElement(\"div\")\n bookContainer.setAttribute(\"class\",`book-container ${bookId}`)\n bookContainer.addEventListener('click',addBook)\n\n let bookCover = document.createElement(\"img\")\n bookCover.setAttribute(\"src\",`${url}`)\n bookCover.setAttribute(\"class\",`book-cover ${bookId}`)\n bookCover.addEventListener('click',addBook)\n \n let bookName = document.createElement(\"p\")\n bookName.setAttribute(\"class\",`book-name ${bookId}`)\n bookName.addEventListener('click',addBook)\n\n let bookAuthor = document.createElement(\"p\") \n bookAuthor.setAttribute(\"class\",`book-author ${bookId}`)\n bookAuthor.addEventListener('click',addBook)\n\n let nameText = document.createTextNode(name);\n let authorText = document.createTextNode(author);\n\n bookName.appendChild(nameText)\n bookAuthor.appendChild(authorText)\n\n bookContainer.appendChild(bookCover)\n bookContainer.appendChild(bookName)\n bookContainer.appendChild(bookAuthor)\n\n document.querySelectorAll(\".category-books\")[index].appendChild(bookContainer)\n}", "static displayBook(){\n // //Imaginary local storage for trial purpose\n // const bookstore=[\n // {\n // title: 'Book One',\n // author: 'John Doe',\n // isbn: '345678'\n // },\n // {\n // title: 'Book Two',\n // author: 'Nobel Reo',\n // isbn: '348982'\n // }\n // ];\n const books = Store.getBooks();\n books.forEach((book) => UI.addBookToList(book));\n }", "static displayBooks() {\n const books = Store.getBooks();\n books.forEach(function (book) {\n const ui = new UI();\n ui.addBookToList(book);\n })\n\n }", "static displayBooks() {\n //get the books from storage like we did for add book\n const books = Store.getBooks();\n\n // loop through the books\n books.forEach(function(book){\n // Instantiate the UI class to display each book in UI\n const ui = new UI\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "function Book(book) {\n this.title =data.volumeInfo.title ;\n this.author=data.volumeInfo.author;\n this.description=data.volumeInfo.description || *** Description current unavailable ***;\n this.thumbnail = data.volumeInfo.imageLinks.thumbnail || null;\n this.url = ;\n}", "function Book(obj) {\n this.image = obj.volumeInfo.imageLinks ? obj.volumeInfo.imageLinks.thumbnail : `https://i.imgur.com/J5LVHEL.jpg`;\n this.title = obj.volumeInfo.title ? obj.volumeInfo.title : 'Title not available';\n this.author = obj.volumeInfo.authors ? obj.volumeInfo.authors : 'Author(s) not available';\n this.description = obj.volumeInfo.description ? obj.volumeInfo.description : 'Description not available';\n this.isbn = obj.volumeInfo.industryIdentifiers ? obj.volumeInfo.industryIdentifiers[0].identifier : 'N/A';\n this.bookshelf = obj.volumeInfo.categories ? obj.volumeInfo.categories[0] : 'No Categories';\n}", "function saveBookInfo(bookname, isbn, edition, author, picture, price, contactinfo){\r\n\tvar newBookInfoRef = bookInfoRef.push();\r\n\tnewBookInfoRef.set({\r\n\t\tbookname:bookname,\r\n\t\tisbn:isbn,\r\n\t\tedition:edition,\r\n\t\tauthor:author,\r\n\t\tpicture:picture,\r\n\t\tprice:price,\r\n\t\tcontactinfo:contactinfo\r\n\t\t\r\n\t});\r\n}", "function addBooksToLibrary(obj) {\n myLibrary.push(obj);\n}", "function feedBookInfo() {\n getBookPageValues();\n\n\n\n\n // BOOK VALUES VARS\n let bookPageBookCover = document.getElementById(\"bookPageBookCover\");\n let bookScore = document.getElementById(\"bookScore\");\n let bookTitle = document.getElementById(\"bookTitle\");\n let bookCondition = document.getElementById(\"bookCondition\");\n let bookAuthors = document.getElementById(\"bookAuthors\");\n let bookReleaseDate = document.getElementById(\"bookReleaseDate\");\n let bookPublisher = document.getElementById(\"bookPublisher\");\n let bookPagesNumber = document.getElementById(\"bookPagesNumber\");\n let bookDonationDate = document.getElementById(\"bookDonationDate\");\n let bookCategory = document.getElementById(\"bookCategory\");\n let bookTags = document.getElementById(\"bookTags\");\n let bookSynopsis = document.getElementById(\"bookSynopsis\");\n\n\n\n\n\n bookPageBookCover.src = pageBookValues._cover;\n if (pageBookValues._scores.length != 1) {\n bookScore.innerHTML = starRating(pageBookValues._scores);\n }\n else {\n bookScore.innerHTML = \"<span class='fa fa-star'></span>\" +\n \"<span class='fa fa-star'></span>\" +\n \"<span class='fa fa-star'></span>\" +\n \"<span class='fa fa-star'></span>\" +\n \"<span class='fa fa-star'></span>\"\n }\n bookTitle.innerHTML = pageBookValues._title;\n bookCondition.innerHTML = \"Estado: \" + pageBookValues._condition;\n bookAuthors.innerHTML = \"de \" + pageBookValues._autor;\n bookReleaseDate.innerHTML = \"em \" + pageBookValues._releaseDate;\n bookPublisher.innerHTML = pageBookValues._publisher;\n bookPagesNumber.innerHTML = \"Nº Páginas: \" + pageBookValues._numberPages;\n bookDonationDate.innerHTML = \"Doado em: \" + pageBookValues._donationDate;\n for (let i = 0; i < arrayCategorias.length; i++) {\n if (arrayCategorias[i]._categoryId == pageBookValues._category) {\n bookCategory.innerHTML = \"Categoria: \" + arrayCategorias[i]._nameCategory;\n }\n }\n bookTags.innerHTML = \"Tags: \" + getTagNames();\n\n\n bookSynopsis.innerHTML = pageBookValues._synopsis;\n\n}", "function addBookToLibrary(book){\n\tmyLibrary.push(book);\n\tdisplayBooks();\n}", "function addBookToLibrary() {\n library.push(new Book(form.elements[0].value, //title\n form.elements[1].value, //author\n parseInt(form.elements[2].value), //pages\n form.elements[3].checked)) //read \n clearLibrary()\n sortLibrary()\n createStoredCards()\n saveLocal()\n}", "function loadMyLibrary() {\n for (var j = 0; j < userLibrary.length; j++) {\n var savedTitle = userLibrary[j].Title;\n var savedAuthor = userLibrary[j].Author;\n var savedSummary = userLibrary[j].Summary;\n var savedCover = userLibrary[j].Cover;\n\n var savedHtml = `<section style=\"margin-bottom: 40px; padding: 30px; background-color: rgb(128, 0, 0);\" class=\"container\">\n <div class=\"container \">\n <div class=\"card-group vgr-cards\">\n <div class=\"card\">\n <div class=\"card-img-body\">\n <img style=\"max-width: 125px; padding-top: 20px\" class=\"card-img\" src=${savedCover} alt=\"book cover\">\n </div>\n <div \"card-body\">\n <h4 class=\" card-title\">${savedTitle}</h4>\n <p class=\"card-text author\">${savedAuthor}</p>\n <p style= \"font-size: 15px;\" class=\"card-text summary\">${savedSummary}</p>\n </div>\n </div>\n </section>`;\n\n $(\".myLibrary\").append(savedHtml);\n }\n}", "function makeNewCover() {\n currentCover = new Cover(\n covers[covers.length - 1],\n titles[titles.length - 1],\n descriptors[descriptors.length - 2],\n descriptors[descriptors.length - 1]\n );\n\n coverImageSource.src = currentCover.cover;\n coverTitle.innerText = currentCover.title;\n descriptorOne.innerText = currentCover.tagline1;\n descriptorTwo.innerText = currentCover.tagline2;\n}", "static displayBooks(){\n // Taking books from the local Storage\n const books = Store.getBooks();\n\n // Looping through the books and adding it to bookList\n books.forEach((book) => UI.addBookToList(book));\n }", "function getBooks(data) {\n var response = JSON.parse(data);\n var output = \"<div class='row'>\";\n if ('error' in response) {\n output = \"<div class='alert alert-danger'>You do not have any books in your collection. \";\n output += \"<a href='/search'>Search</a> for books to add!</div>\";\n } else {\n output += \"<h3>My Books</h3>\";\n for (var i = 0; i < response.length; i++) {\n var cover;\n var title;\n var bookId = response[i].bookId;\n output += \"<div class='col-sm-4 col-md-3 bookItem text-center'>\";\n\n if (response[i].cover) {\n cover = response[i].cover;\n output += '<img src=\"' + cover + '\" class=\"img-rounded img-book\" alt=\"...\">';\n } else {\n cover = '/public/img/noCover.png';\n output += '<img src=\"/public/img/noCover.png\" class=\"img-rounded img-book\" alt=\"...\">';\n }\n title = response[i].title;\n output += \"<h3 class='bookTitle'>\" + title + \"</h3><br />\";\n if (response[i].ownerId === profId && (response[i].requestorId === \"\" || response[i].approvalStatus === \"N\")) {\n output += '<div class=\"btn removeBtn ' + bookId + '\" id=\"' + bookId + '\" ><p>Remove Book</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].approvalStatus === \"Y\") {\n output += '<div class=\"btn approvedButton ' + bookId + '\"><p>Request Approved</p></div>';\n\n } else if (response[i].ownerId === profId && response[i].requestorId !== \"\") {\n output += '<div class=\"btn approveBtn ' + bookId + '\" id=\"' + bookId + '-approve\" ><p>Approve Request</p></div>';\n output += '<div class=\"btn denyBtn ' + bookId + '\" id=\"' + bookId + '-deny\" ><p>Deny Request</p></div>';\n\n }\n output += \"</div>\";\n }\n\n }\n output += \"</div>\";\n profileBooks.innerHTML = output;\n }", "function renderBooks(response) {\n $(\".results\").empty();\n for (var i = 0; i < 4; i++) {\n var imageLink = response.items[i].volumeInfo.imageLinks.thumbnail;\n var bookTitle = response.items[i].volumeInfo.title;\n var author = response.items[i].volumeInfo.authors;\n var bookSummary = response.items[i].volumeInfo.description;\n var bookHtml = `<section style=\"margin-bottom: 40px; padding: 30px; background-color: rgb(128, 0, 0);\" class=\"container\">\n <div class=\"container \">\n <div class=\"card-group vgr-cards\">\n <div class=\"card\">\n <div class=\"card-img-body\">\n <img style=\"max-width: 125px; padding-top: 20px\" class=\"card-img\" src=${imageLink} alt=\"book cover\">\n </div>\n <div \"card-body\">\n <h4 class=\" card-title\">${bookTitle}</h4>\n <p class=\"card-text author\">${author}</p>\n <p style= \"font-size: 15px;\" class=\"card-text summary\">${bookSummary}</p>\n <button class=\"btn btn-color btn-size btn-book\" data-book=\"${bookTitle}\">Add to My Library</button>\n </div>\n </div>\n </section>`;\n\n $(\".results\").append(bookHtml);\n }\n}", "static addBook(book) {\n // const books = Store.getBooks();\n const books = this.getBooks();\n\n books.push(book);\n\n localStorage.setItem('books', JSON.stringify(books));\n }", "static addbook(book) {\n const books = this.getBooks();\n books.push(book);\n localStorage.setItem(\"books\", JSON.stringify(books));\n }", "addBook(book) {\n this.books.push(book);\n }", "function attachBookElements(books) {\n const bookshelf = getBookshelfElement();\n for (let i = 0; i < books.length; i++) {\n bookshelf.appendChild(books[i]);\n }\n}", "function saveBook(e) {\n var newAuthor;\n var index;\n\n // loop to find the book object id that matches the id of the save button clicked\n for (var i=0; i<books.length; i++) {\n if ( books[i].id === e.target.id ) {\n index = i;\n break;\n }\n }\n\n // check if there are authors returned from google\n if(!books[index].volumeInfo.authors) {\n // if no authors, save a text string\n newAuthor = \"No Author provided.\";\n }\n // check if multiple authors, then join them together as one string to save\n else if(books[index].volumeInfo.authors.length > 1) {\n newAuthor = books[index].volumeInfo.authors.join(\", \");\n }\n // only a single author to save\n else {\n newAuthor = books[index].volumeInfo.authors[0];\n };\n // save the index of the book save button clicked\n bookIndex = books[index].id;\n // call save book route to save the book to database\n API.saveBook({\n title: books[index].volumeInfo.title,\n // sometimes no thumbnail image returned from google and need to handle this\n image: books[index].volumeInfo.imageLinks ? books[index].volumeInfo.imageLinks.thumbnail : \"https://dummyimage.com/128x206/c4bfb2/051421.jpg&text=No+Image+\",\n link: books[index].volumeInfo.infoLink,\n // sometimes no book description returned from google and need to handle this\n synopsis: books[index].volumeInfo.description ? books[index].volumeInfo.description : \"No description available for this book.\",\n author: newAuthor\n })\n .then(res => {\n // call update books to remove the just saved book from page\n updateBooks(bookIndex);\n })\n .catch(err => console.log(err));\n }", "function fetchBookDetails( row ) {\n \n var book = {};\n \n var cover = row.find('a > img.bc-image-inset-border');\n if ( cover.length > 0 ) book.cover = cover.attr('src');\n \n var title = row.find('ul > li:nth-child(1) > a > span');\n if ( title.length > 0 ) book.title = _.kebabCase( title.text().trimAll() );\n \n return (book.title && book.cover) ? book : null;\n \n }", "function showBook(response) {\n $.each(response.items, function (i, item) {\n\n var cover = item.volumeInfo.imageLinks.thumbnail,\n pageCount = item.volumeInfo.pageCount,\n publisher = item.volumeInfo.publisher,\n publishedDate = item.volumeInfo.publishedDate,\n description = item.volumeInfo.description;\n\n $('.cover').attr('src', cover);\n $('.pageCount').text(pageCount + ' pages');\n $('.publisher').text('Published by: ' + publisher);\n $('.publishedDate').text('Published on ' + publishedDate);\n $('.description').text(description);\n });\n }", "function ShowItems() {\n for (let book of Books) {\n makeBookItem(book).appendTo(\"#AllBooks\");\n }\n }", "function book(title, author, pages) {\r\n this.title = title\r\n this.author = author\r\n this.pages = pages\r\n this.read = 'not'\r\n this.info = function() {\r\n return `${title} by ${author}, ${pages} pages.`\r\n }\r\n }", "function createBookInfo(book) {\n\n deleteBookInfo();\n\n var myBookDiv = document.createElement('div');\n myBookDiv.id = \"arqsiWidgetBookInfo_div\";\n \n var closeA = document.createElement(\"a\");\n closeA.href = \"#\";\n closeA.onclick = deleteBookInfo;\n var closePic = document.createElement(\"img\");\n closePic.className = \"infoClose\";\n closePic.src = \"images/bot_close.png\";\n closePic.style.width = 20;\n closePic.style.height = 20;\n closePic.style.border = 0;\n closeA.appendChild(closePic);\n myBookDiv.appendChild(closeA);\n\n var title = document.createElement(\"p\");\n title.className = \"bookTitle\";\n title.innerHTML = book.getElementsByTagName(\"title\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(title);\n \n if (book.getElementsByTagName(\"picture\")[0].childNodes[0].nodeValue!=\"\"){\n var bookPic = document.createElement(\"img\");\n bookPic.className = \"bookPic\";\n bookPic.src = book.getElementsByTagName(\"picture\")[0].childNodes[0].nodeValue;\n bookPic.style.width = 100;\n bookPic.style.border = 0;\n bookPic.align = \"left\";\n myBookDiv.appendChild(bookPic);\n } \n\n var author = document.createElement(\"p\");\n author.className = \"bookAuthor\";\n author.innerHTML = \"Autor: \"+book.getElementsByTagName(\"author\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(author);\n \n var editora = document.createElement(\"p\");\n editora.className = \"bookEditora\";\n editora.innerHTML = \"Editora: \"+book.getElementsByTagName(\"editora\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(editora);\n\n var category = document.createElement(\"p\");\n category.className = \"bookCategory\";\n category.innerHTML = \"Categoria: \"+book.getElementsByTagName(\"category\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(category);\n\n var lblIsbn = document.createElement(\"p\");\n lblIsbn.className = \"bookIsbn\";\n lblIsbn.innerHTML = \"ISBN: \"+book.getElementsByTagName(\"isbn\")[0].childNodes[0].nodeValue;\n ;\n myBookDiv.appendChild(lblIsbn);\n\n var lblAno = document.createElement(\"p\");\n lblAno.className = \"bookPublicacao\";\n lblAno.innerHTML = \"Ano Publicacão: \"+book.getElementsByTagName(\"publicacao\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(lblAno);\n\n var description = document.createElement(\"p\");\n description.className = \"bookDescription\";\n description.innerHTML = book.getElementsByTagName(\"description\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(description);\n\n div.appendChild(myBookDiv);\n}", "function addBook(x, y, size, book) {\n\tvar bk = new MultiWidgets.BookWidget();\n\n\tif (bk.load(\"./Research\")) {\n\t\tbk.addOperator(new MultiWidgets.StayInsideParentOperator());\n\t\tbk.setAllowRotation(false);\n\t\tbk.setLocation(x, y);\n\t\tbk.setScale(1);\n\n\t\troot.addChild(bk);\n\t\tbk.raiseToTop();\n\t}\n}", "function updateBestSellers(nytimesBestSellers){\n console.log(nytimesBestSellers);\n var carousel = $(\"#iDontLikeThis\");\n carousel.empty();\n nytimesBestSellers.results.books.forEach(function(book){\n\n updateCover(book); // only book \n });\n }", "function addBookToLibrary(book) {\n myLibrary.push(book);\n}", "function showBooks(bookArray) {\n for (let i = 0; i < bookArray.length; i++) {\n addBook(bookArray[i]);\n }\n}", "function addBookToDisplay(bookTitle, bookAuthor, bookPages, bookRead, bookIndex){\n //creating divs to store data\n const bookCard = document.createElement('div')\n const bookHeader = document.createElement('div')\n const bookBody = document.createElement('div')\n\n\n //adding class to add style\n bookCard.classList.add('card')\n bookHeader.classList.add('bookTitle')\n bookBody.classList.add('bookBody')\n\n bookCard.setAttribute('id', `book${bookIndex}`)\n\n //adding p tag to hold data\n const title = document.createElement('p')\n const author = document.createElement('p')\n const pages = document.createElement('p')\n const read = document.createElement('p')\n\n //remove button\n const remove = document.createElement('button')\n remove.classList.add('remove')\n remove.setAttribute('id', `${bookIndex}`)\n remove.addEventListener('click', removeBook)\n\n //read button\n const changeRead = document.createElement('button')\n changeRead.classList.add('change')\n changeRead.setAttribute('id', `read${bookIndex}`)\n changeRead.addEventListener('click', changeReadEvent)\n\n title.textContent = bookTitle\n author.textContent = bookAuthor\n pages.textContent = bookPages\n read.textContent = bookRead ? \"Read\" : \"Not Read\"\n\n remove.textContent = \"Remove\"\n\n changeRead.textContent = \"Change\"\n\n bookHeader.appendChild(title)\n bookBody.appendChild(author)\n bookBody.appendChild(pages)\n bookBody.appendChild(read)\n\n bookCard.appendChild(bookHeader)\n bookCard.appendChild(bookBody)\n bookCard.appendChild(remove)\n bookCard.appendChild(changeRead)\n\n books.appendChild(bookCard)\n}", "function addBookToPage(book) {\n let newBook = bookTemplate.clone(true, true);\n newBook.attr('data-id', book.id);\n newBook.find('.book-img').attr('src', book.image_url);\n newBook.find('.bookTitle').text(book.title);\n newBook.find('.bookDesc').text(book.description);\n if (book.borrower_id) {\n newBook.find('.bookBorrower').val(book.borrower_id);\n }\n bookTable.append(newBook);\n}", "function getNewBookData(elements){\n let title = elements[0].value;\n let author = elements[1].value;\n let numPages = Number(elements[2].value);\n let haveRead = false;\n if(elements[3].checked){\n haveRead = true;\n }\n addBookToLib(title, author, numPages, haveRead);\n}", "static addBooks(book){\n const books = Store.getBooks();\n books.push(book);\n //update the books in local storage\n localStorage.setItem('books',JSON.stringify(books));\n }", "updateInfo(books){\n this.setState({\n books: books.items\n })\n }", "function displayBook() {\n for(i = 0; i < myLibrary.length; i++) {\n const newDiv = document.createElement('div');\n const newTitle = document.createElement('p');\n const newAuthLabel = document.createElement('span');\n const newAuth = document.createElement('a');\n const newPagesLabel = document.createElement('span');\n const newPages = document.createElement('p');\n const newStatus = document.createElement('button');\n const newButton = document.createElement('button');\n const newBreak = document.createElement('br');\n const newBreak1 = document.createElement('br');\n const newBreak2 = document.createElement('br');\n const newBreak3 = document.createElement('br');\n \n container.appendChild(newDiv);\n\n newDiv.setAttribute('class', 'book');\n newDiv.setAttribute('id', 'book' + i)\n\n newTitle.textContent = myLibrary[i].title;\n newTitle.setAttribute('class', 'bookTitle');\n newDiv.appendChild(newTitle);\n\n newAuthLabel.textContent = 'Author:';\n newDiv.appendChild(newAuthLabel);\n\n newDiv.appendChild(newBreak);\n\n newAuth.textContent = myLibrary[i].author;\n newAuth.setAttribute('class', 'bookAuthor');\n newAuth.setAttribute('href', 'https://www.google.com/search?q=' + myLibrary[i].author.replace(/\\s/g, '+'));\n newAuth.setAttribute('target', '_blank');\n newDiv.appendChild(newAuth);\n\n newDiv.appendChild(newBreak1);\n newDiv.appendChild(newBreak2);\n\n newPagesLabel.textContent = 'Pages:';\n newDiv.appendChild(newPagesLabel); \n\n newPages.textContent = myLibrary[i].pages;\n newPages.setAttribute('class', 'bookPages');\n newDiv.appendChild(newPages);\n\n newStatus.textContent = myLibrary[i].read;\n newStatus.setAttribute('class', 'bookStatus');\n newStatus.setAttribute('id', 'status' + i);\n newDiv.appendChild(newStatus);\n\n newDiv.appendChild(newBreak3);\n\n newButton.textContent = 'Delete';\n newButton.setAttribute('class', 'delete');\n newButton.setAttribute('id', i);\n newDiv.appendChild(newButton);\n }\n}", "addBookLibrary() {\n const bookStatus = readBtn.innerText;\n const bookItem = new Book(bookId, authorForm.value, titleForm.value, pagesForm.value, bookStatus);\n bookId++;\n myLibrary.push(bookItem);\n this.storage.saveData();\n\n this.renderElem.clearForm();\n this.renderElem.render();\n }", "static displayBooks() {\n\t\tconst books = Store.getBooks();\n\t\tbooks.forEach(function (book) {\n\t\t\tconst ui = new UI();\n\t\t\tui.addBookToList(book);\n\t\t});\n\t}", "books(parent) {\n\t\t\tconsole.log('parent!!')\n\t\t\t\treturn dataSources.bookService.getAuthorBooks(parent.id);\n\t\t}", "function addBookToLibrary() { \r\n myLibrary.push(new Book(formImg.value, formTitle.value, formAuthor.value, formPages.value, formRead.value));\r\n}", "function addBookToLibrary(){\n //book = {name:\"harry\", author:\"potter\", numPages:50, isRead:true}\n \n bookName = document.getElementById(\"bookNameField\").value;\n bookAuthor = document.getElementById(\"authorNameField\").value;\n bookNumPages = document.getElementById(\"numPagesField\").value;\n bookIsRead = document.getElementById(\"isReadField\").checked;\n\n let book = new Book(bookName, bookAuthor, bookNumPages, bookIsRead);\n myLibrary.push(book);\n addCard(book);\n}", "function addBookToLibrary() {\n let Num = myLibrary.length;\n const name = document.getElementById('name').value;\n const author = document.getElementById('author').value;\n const pages = document.getElementById('pages').value;\n const read = \"Have Not Read\"\n const bookNum = \"book\" + Num;\n\n myLibrary.push(new Book(name, author, pages, read, bookNum))\n\n let myLibraryEnd = myLibrary.length - 1;\n addBookHTML(myLibraryEnd);\n}", "function loadMyBookShelf(myBooks) {\n\t$.getJSON(myBooks, function(json) {\n\t\tvar myBooks = \"\";\n\t\tfor (i in json.items) {\n\t\t\tmyBooks+=\"<div class='col-xs-6 col-md-3'>\";\n\t\t\tmyBooks+=\"<img class='book image image-center' id='\"+ json.items[i].id +\"' \";\n\t\t\tmyBooks+=\"src='\"+ json.items[i].volumeInfo.imageLinks.smallThumbnail +\"'>\";\n\t\t\tmyBooks+=\"</div>\";\n\t\t}\n\t\t$(\"#my-books\").html(myBooks);\n\t\t$(\".book\").on('click', function() {\n\t\t\tloadBooksDetails($(this).attr('id'));\n\t\t});\n\t});\n}", "function moreOutfits() {\n getLooks();\n }", "addBook(book, shelf) {\n book.shelf = shelf;\n this.state.books.push(book);\n }", "function addBookToLibrary(book) {\n library.push(book);\n}", "function saveCover(book, image){\n if (image == null) return // Checks if an image is being sent\n const coverImage = JSON.parse(image)\n if (coverImage != null && imageMimeTypes.includes(coverImage.type)){ // Checks if an image is being sent and if the format of the image is included in the list we set up before\n book.coverImage = new Buffer.from(coverImage.data, 'base64') // Converts the image data to a buffer and stores it in the database\n book.coverImageType= coverImage.type // Stores the image type in the database\n }\n}", "function storeBookInfo() {\n}", "add(book) {\n books.push(book);\n\t\t\t\n\t\t\t// POST requests: sencond arg is data for the body\n\t\t\t$http.post('http://api.queencityiron.com/books', {\n\t\t\t\ttitle: book.title,\n\t\t\t\tauthor: book.author,\n\t\t\t});\n }", "function changeCover() {\n currentCover = new Cover(\n covers[getRandomIndex(covers)],\n titles[getRandomIndex(titles)],\n descriptors[getRandomIndex(descriptors)],\n descriptors[getRandomIndex(descriptors)]\n );\n\n coverImageSource.src = currentCover.cover;\n coverTitle.innerText = currentCover.title;\n descriptorOne.innerText = currentCover.tagline1;\n descriptorTwo.innerText = currentCover.tagline2;\n}", "static displayBooks(){\n let books = Store.getBooks();\n const ui = new UI();\n\n // Add all books to list\n books.forEach(function(book){\n ui.addBookToLib(book);\n });\n }", "function writeToDocument(title, author) {\n let el = document.getElementById(\"bookContentContainer\");\n let messageContainer = document.getElementById(\"messages\");\n // Sets the page back to blank every time the button is clicked.\n el.innerHTML = \"\";\n\n getData(title, author, function (data) {\n let searchList = [];\n let books = data.items;\n if (data.totalItems == 0) {\n messageContainer.innerHTML = `<div class=\"row flashed-messages\"><h4 class>No Results Found</h4></div>`;\n }\n else {\n for (var i in books) {\n // Assign an empty string to the variables\n // as Google Books API does not always contain these fields\n let img = \"\";\n let thumbnail = \"\";\n let title = \"\";\n let authors = \"\";\n let category = \"\";\n let description = \"\";\n let publisher = \"\";\n let publishedDate = \"\";\n let pageCount = \"\";\n let isbn = \"\";\n let textSnippet = \"\";\n\n // If fields exist overwrite the empty string with the returned information\n if (books[i].volumeInfo && books[i].volumeInfo.imageLinks && books[i].volumeInfo.imageLinks.thumbnail) {\n img = books[i].volumeInfo.imageLinks.thumbnail;\n thumbnail = img.substring(0, 4) + 's' + img.substring(4);\n }\n if (books[i].volumeInfo && books[i].volumeInfo.title) {\n title = books[i].volumeInfo.title;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.authors) {\n authors = books[i].volumeInfo.authors;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.categories && books[i].volumeInfo.categories[0]) {\n category = books[i].volumeInfo.categories[0];\n }\n if (books[i].volumeInfo && books[i].volumeInfo.description) {\n description = books[i].volumeInfo.description;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.publisher) {\n publisher = books[i].volumeInfo.publisher;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.publishedDate) {\n publishedDate = books[i].volumeInfo.publishedDate;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.pageCount) {\n pageCount = books[i].volumeInfo.pageCount;\n }\n if (books[i].volumeInfo && books[i].volumeInfo.industryIdentifiers && books[i].volumeInfo.industryIdentifiers[0] && books[i].volumeInfo.industryIdentifiers[0].identifier) {\n isbn = books[i].volumeInfo.industryIdentifiers[0].identifier;\n }\n if (books[i].searchInfo && books[i].searchInfo.textSnippet) {\n textSnippet = books[i].searchInfo.textSnippet;\n }\n\n var dict = {\n \"thumbnail\": thumbnail,\n \"title\": title,\n \"authors\": authors,\n \"category\": category,\n \"description\": description,\n \"publisher\": publisher,\n \"published_date\": publishedDate,\n \"page_count\": pageCount,\n \"isbn\": isbn,\n \"text_snippet\": textSnippet,\n };\n searchList.push(dict);\n }\n\n // Print data to screen\n messageContainer.innerHTML += `<div class=\"row flashed-messages\"><div class=\"col s12\"><h4>Choose the edition you wish to review.</h4></div></div>`;\n for (i in searchList) {\n // How to encode string to base 64 found at Stack Overflow: https://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript\n el.innerHTML += `<div class='row'>\\\n <hr><hr><br>\\\n <div class='col s12 m6 center-align'><img src='${searchList[i].thumbnail}' alt='${searchList[i].title} book cover' class='centered'><br>\\\n <button type='submit' class='btn bg-blue' onclick='sendToPython(\"${btoa(encodeURIComponent(JSON.stringify(searchList[i])))}\");'>Choose This Edition</button>\\\n </div>\\\n <div class='col s12 m6'><table>\\\n <tr><td>Title:</td><td> ${searchList[i].title}</td></tr>\n <tr><td>Author:</td><td>${searchList[i].authors}</td></tr>\n <tr><td>Category:</td><td>${searchList[i].category}</td></tr>\n <tr><td>Snippet:</td><td>${searchList[i].text_snippet}</td></tr>\n <tr><td>Publisher:</td><td>${searchList[i].publisher}</td></tr>\n <tr><td>Date Published:</td><td>${searchList[i].published_date}</td></tr>\n <tr><td>Page Count:</td><td>${searchList[i].page_count}</td></tr>\n <tr><td>ISBN:</td><td>${searchList[i].isbn}</td></tr>\\\n </table>\\\n <br></div></div>`;\n }\n }\n }\n );\n}", "function addBook(item) {\n var send = {\n Name: item.BookName,\n Id: item.BookId,\n Price: item.Price,\n GenreId: item.GenreId,\n Description: item.Description,\n AuthorId: null,\n ImgUrl: null\n };\n //set author id \n apiService.book.query().$promise.then(function (res) {\n bkl = res;\n send.Id =parseInt(bkl.pop().Id)+1;\n //store image file under book id \n var file = $scope.item.imageFile;\n var uploadUrl = \"/Images/upload\";\n send.ImgUrl = '/Content/img/' + send.Id +'.'+ file.name.split('.').pop().toLowerCase();\n send.AuthorId = existService.authorExist($scope.item.AuthorName, authors);\n fileUpload.uploadFileToUrl(file, send.Id, uploadUrl);\n apiService.book.save(send).$promise.then(function (res) {\n alert(\"Book entry successfully uplodad\");\n }, function (res) {\n alert(\"Book entry failed to add.\");\n });\n });\n\n }", "function setBooksToPage(books, elementID) {\n var deckBook = document.getElementById(elementID);\n while(deckBook.firstChild){ deckBook.removeChild(deckBook.firstChild) }\n for(let i=0; i<books.length; i++){\n var div = document.createElement('div');\n div.className = \"cardBook card-1\";\n div.onclick = () => goToBookPage(books[i].isbn, elementID);\n \n var img = document.createElement('img');\n img.className = 'cardBook__image';\n img.src = books[i].image;\n div.appendChild(img);\n \n var title = document.createElement('div');\n title.className = 'cardBook__link border__bottom';\n var b1 = document.createElement('b');\n var t1 = document.createTextNode(books[i].title);\n b1.append(t1);\n title.appendChild(b1);\n div.appendChild(title);\n \n var author = document.createElement('div');\n author.className = 'cardBook__link border__bottom';\n var b2 = document.createElement('b');\n createAuthorsList(books[i].isbn, b2);\n author.appendChild(b2);\n div.appendChild(author);\n \n var genre = document.createElement('div');\n genre.className = 'cardBook__link';\n var b3 = document.createElement('b');\n createGenresList(books[i].isbn, b3);\n genre.appendChild(b3);\n div.appendChild(genre);\n \n deckBook.appendChild(div);\n }\n \n}", "function setBooksToPage(books, elementID) {\n var deckBook = document.getElementById(elementID);\n while(deckBook.firstChild){ deckBook.removeChild(deckBook.firstChild) }\n for(let i=0; i<books.length; i++){\n var div = document.createElement('div');\n div.className = \"cardBook card-1\";\n div.onclick = () => goToBookPage(books[i].isbn, elementID);\n \n var img = document.createElement('img');\n img.className = 'cardBook__image';\n img.src = books[i].image;\n div.appendChild(img);\n \n var title = document.createElement('div');\n title.className = 'cardBook__link border__bottom';\n var b1 = document.createElement('b');\n var t1 = document.createTextNode(books[i].title);\n b1.append(t1);\n title.appendChild(b1);\n div.appendChild(title);\n \n var author = document.createElement('div');\n author.className = 'cardBook__link border__bottom';\n var b2 = document.createElement('b');\n createAuthorsList(books[i].isbn, b2);\n author.appendChild(b2);\n div.appendChild(author);\n \n var genre = document.createElement('div');\n genre.className = 'cardBook__link';\n var b3 = document.createElement('b');\n createGenresList(books[i].isbn, b3);\n genre.appendChild(b3);\n div.appendChild(genre);\n \n deckBook.appendChild(div);\n }\n \n}", "function render() {\n myLibrary.forEach(function(e, i){\n var li = document.createElement(\"li\");\n li.classList.add(\"row\");\n \n ul.appendChild(li);\n\n var div = document.createElement(\"div\");\n li.appendChild(div)\n div.classList.add(\"innercols\")\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.title\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.author\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.pages\n \n var p = document.createElement(\"p\"); \n p.classList.add('read');\n p.classList.add(i); //adds to index of the added book to the innercols div as a class. beginning at 0.\n div.appendChild(p);\n p.innerText = e.read\n\n readClicks();\n })\n}", "function addBookToLibrary() {\n const title = document.querySelector('#title-input').value;\n const author = document.querySelector('#author-input').value;\n const pages = document.querySelector('#pages-input').value;\n let read = document.querySelector('#read-input').checked;\n if (read == true) {\n read = \"read\";\n } else {\n read = \"unread\";\n } ;\n addForm.reset();\n addForm.hidden = true;\n addBtn.hidden = false;\n submitBtn.hidden = true;\n myLibrary.push(new Book(title, author, pages, read));\n clearTable();\n displayBooks();\n}", "function displayBooks(){\n books.innerHTML = ''\n myLibrary.forEach((book, index) => {\n addBookToDisplay(book.title, book.author, book.pages, book.read, index)\n });\n\n // const removeBtns = [...document.getElementsByClassName('remove')]\n\n // removeBtns.forEach((removeBtn) => {\n // removeBtn.addEventListener('click', removeBook)\n // })\n\n // const changeBtns = [...document.getElementsByClassName('change')]\n\n // changeBtns.forEach((changeBtn) =>{\n // changeBtn.addEventListener('click', changeRead)\n // })\n\n\n}", "function createBookContainer2(url,name,author,bookId){\n let resultContainer = document.createElement(\"div\")\n resultContainer.setAttribute(\"class\",`result-container ${bookId}`)\n resultContainer.addEventListener('click',addBook)\n\n let resultCover = document.createElement(\"img\")\n resultCover.setAttribute(\"src\",`${url}`)\n resultCover.setAttribute(\"class\",`result-cover ${bookId}`)\n resultCover.addEventListener('click',addBook)\n \n let resultName = document.createElement(\"p\")\n resultName.setAttribute(\"class\",`book-name ${bookId}`)\n resultName.addEventListener('click',addBook)\n\n let resultAuthor = document.createElement(\"p\")\n resultAuthor.setAttribute(\"class\",`book-author ${bookId}`)\n resultAuthor.addEventListener('click',addBook)\n\n let nameText = document.createTextNode(name);\n let authorText = document.createTextNode(author);\n\n resultName.appendChild(nameText)\n resultAuthor.appendChild(authorText)\n\n resultContainer.appendChild(resultCover)\n resultContainer.appendChild(resultName)\n resultContainer.appendChild(resultAuthor)\n\n document.querySelector(\".result-section\").appendChild(resultContainer)\n}", "function addBookToLibrary() {\n\n\n const title = document.getElementById('booktitle').value\n const author = document.getElementById('author').value\n const pages = document.getElementById('pages').value\n const alreadyRead = document.getElementById('alreadyread').checked\n const book = new Book(title, author, pages, alreadyRead)\n myLibrary.push(book)\n updateTable()\n\n\n\n\n\n}", "static displayBooks (){\n \n const books = Store.getBooks();\n\n //loop through the array to add the books into the local storage\n books.forEach((book) => UI.addBookToList(book));\n }", "function storeBooks(){\n for(i = 0; i < bookList.length; i++){\n for(prop in bookList[i]){\n let li = document.createElement(\"li\");\n li.innerText = bookList[i][prop];\n secondList.appendChild(li);\n }\n }\n}", "function BookInformation(bookIdFromArry, language, author, imgLink) {\n this.BookInformation = bookIdFromArry;\n this.title = bookIdFromArry.toUpperCase();\n this.language = language;\n this.author = author;\n this.imgLink = imgLink;\n }", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "function load() {\r\n\t\tvisibility(\"none\", \"allbooks\");\r\n\t\tvisibility(\"\", \"singlebook\");\r\n\t\tbookTitle = this.className; // enables the user to go to page of the book that is clicked\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\"+bookTitle+\"/cover.jpg\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; \r\n\t\tsearchData(\"info&title=\" + bookTitle, oneBookInfo);\r\n\t\tsearchData(\"description&title=\" + bookTitle, oneBookDescription);\r\n\t\tsearchData(\"reviews&title=\" + bookTitle, oneBookReview);\t\r\n\t}", "function addBook(book) {\n setLoading(true);\n setVisible(true);\n API.saveBook(book)\n .then(res => {\n setLoading(false);\n })\n .catch(err => {\n setLoading(false);\n setError(true);\n console.log(err);\n });\n \n }" ]
[ "0.6399229", "0.6202844", "0.61540407", "0.6067933", "0.60023546", "0.59399813", "0.59162563", "0.5916238", "0.58444685", "0.5840512", "0.58328", "0.5832684", "0.5829834", "0.58284855", "0.5822957", "0.57991415", "0.5790416", "0.5788652", "0.57770354", "0.57595783", "0.5754446", "0.57490766", "0.5709267", "0.57033664", "0.5698465", "0.5687625", "0.5683021", "0.56799567", "0.56738764", "0.56620765", "0.5656141", "0.56436586", "0.56411386", "0.56394106", "0.5627323", "0.56261235", "0.5613466", "0.56130254", "0.5608367", "0.5594822", "0.5586135", "0.55792654", "0.5577669", "0.5564784", "0.5563783", "0.5559438", "0.55523384", "0.5549617", "0.5527337", "0.5526165", "0.5518924", "0.55144185", "0.55125386", "0.55104667", "0.55071235", "0.55049247", "0.55034804", "0.5502772", "0.54976135", "0.54968214", "0.5492988", "0.5490951", "0.548903", "0.5487135", "0.54865766", "0.5465457", "0.545336", "0.5434555", "0.54315865", "0.54304045", "0.54293925", "0.5427429", "0.54263127", "0.542393", "0.54118747", "0.53985703", "0.5383124", "0.53804785", "0.5379512", "0.53671545", "0.5365264", "0.53581315", "0.53489035", "0.534669", "0.5344992", "0.5343765", "0.5342455", "0.534153", "0.534153", "0.53413755", "0.5338625", "0.53342414", "0.5331583", "0.5328632", "0.532725", "0.5326298", "0.5325808", "0.5320872", "0.5317503", "0.5314089" ]
0.58888483
8
Bias the autocomplete object to the user's geographical location, as supplied by the browser's 'navigator.geolocation' object.
function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var geolocation = { lat: position.coords.latitude, lng: position.coords.longitude }; var circle = new google.maps.Circle({ center: geolocation, radius: position.coords.accuracy }); autocompleteDeparture.setBounds(circle.getBounds()); autocompleteDestination.setBounds(circle.getBounds()); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "biasAutocompleteLocation () {\n if (this.enableGeolocation) {\n this.updateGeolocation((geolocation, position) => {\n let circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n this.autocomplete.setBounds(circle.getBounds());\n })\n }\n }", "function geolocate() {\r\n\t// Hard code for Canada\r\n\tvar geolocation = new google.maps.LatLng(62, -110.0);\r\n\tautocomplete.setBounds(new google.maps.LatLngBounds(geolocation,\r\n\t\t\tgeolocation));\r\n}", "geolocate() {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition((position) => {\n\t\t\t\tvar geolocation = {\n\t\t\t\t\tlat: position.coords.latitude,\n\t\t\t\t\tlng: position.coords.longitude\n\t\t\t\t};\n\t\t\t\tvar circle = new google.maps.Circle({\n\t\t\t\t\tcenter: geolocation,\n\t\t\t\t\tradius: position.coords.accuracy\n\t\t\t\t});\n\t\t\t\tthis.autocomplete.setBounds(circle.getBounds());\n\t\t\t});\n\t\t}\n\t}", "function geolocate() {\n /*if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n document.getElementById('latitude').value = geolocation.lat.toFixed(6);\n document.getElementById('longitude').value = geolocation.lng.toFixed(6); \n //console.log(geolocation); \n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }*/\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n //use position.coords. to biase towards current browser location\n lat: 51.528, //position.coords.latitude,\n lng: -0.381 //position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle(\n {center: geolocation, radius: position.coords.accuracy});\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle(\n {center: geolocation, radius: position.coords.accuracy});\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n }\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n })\n autocomplete.setBounds(circle.getBounds())\n })\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\tvar geolocation = {\n\t \t\tlat: position.coords.latitude,\n\t \t\tlng: position.coords.longitude\n\t \t};\n\t \tvar circle = new google.maps.Circle({\n\t \t\tcenter: geolocation,\n\t \t\tradius: position.coords.accuracy\n\t \t});\n\t \tautocomplete.setBounds(circle.getBounds());\n\t \t});\n\t}\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function geolocate() {\n const google = window.google;\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy,\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n console.log(\"geolocate\");\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n console.log('geolocate');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete1.setBounds(circle.getBounds());\n });\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n locationRaw = navigator.geolocation.getCurrentPosition(getPosition, showError);\n \n } else { \n $('#user-search-location').parent().parent().append('Cound not determine location automatically, please search your country above.')\n locationRaw = $(\"#user-search-location\").val();\n }\n}", "function geolocate() {\n console.log(\"geolocating...\");\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n console.log(position);\n let geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n let circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n } else {\n console.log(\"no\");\n }\n}", "geolocate() {\n const geolocation = {\n // lat: position.coords.latitude,\n // lng: position.coords.longitude,\n lat: -37.881812,\n lng: 145.058236,\n };\n const circle = new google.maps.Circle({\n center: geolocation,\n radius: 250000,\n // radius: 50,\n // language: en,\n });\n this.autocomplete.setBounds(circle.getBounds());\n }", "function geolocate() {\r\n if (navigator.geolocation) {\r\n console.log(navigator.geolocation);\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n //console.log(\"circle\");\r\n //console.log(circle);\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function useCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n state.location1 = [position.coords.longitude, position.coords.latitude];\n showLocationsOnMap();\n reverseGeocode(state.location1, function (address) {\n $(\"#fromInput\").val(address);\n //fromFieldInputDetected(document.getElementById(\"fromInput\"));\n });\n }, function (error) {\n if (error.code === error.PERMISSION_DENIED) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(\"geolocation.permission.denieddate\", new Date());\n }\n } else {\n console.warn(\"Accessing geolocation failed.\", error);\n }\n });\n if (typeof (Storage) !== \"undefined\") {\n localStorage.removeItem(\"geolocation.permission.denieddate\");\n }\n } else {\n console.warn(\"Geolocation is not supported by this browser.\");\n }\n}", "setGeoLocation() {\n navigator.geolocation.getCurrentPosition(function (pos) {\n _position.lat = pos.coords.latitude;\n _position.long = pos.coords.longitude;\n });\n }", "function doGeolocation()\n\t{\n\t\tif( typeof navigator.geolocation != 'undefined' )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t\tfunction(position)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.mobile.pageLoading();\n\t\t\t\t\t\tvar userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\t\t\t\t\t\tsetSingleLocation(userLocation);\n\n\t\t\t\t\t\tvar geocoder = new google.maps.Geocoder();\n\t\t\t\t\t\tgeocoder.geocode({latLng: userLocation},\n\t\t\t\t\t\t\tfunction( data, status )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( google.maps.GeocoderStatus.OK == status && data.length > 0 )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar firstAddress = data[0];\n\t\t\t\t\t\t\t\t\t$('#fromAddress').val(firstAddress.formatted_address);\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\tfunction(error)\n\t\t\t\t\t{\n\t\t\t\t\t\t// @TODO Give a nice message to users that have location disabled\n\t\t\t\t\t\t//alert(error.code + ': ' + error.message);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}", "function autoDetectLocation() {\n if (!navigator.geolocation) return;\n \n navigator.geolocation.getCurrentPosition(function(position) {\n var my_location = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\n requestPlaces(my_location);\n infowindow.close(); // close any open infowindows\n map.panTo(my_location);\n }); \n }", "function initiate_geolocation() { \n navigator.geolocation.getCurrentPosition(handle_geolocation_query); \n}", "function getLocationUser () {\n if (navigator.geolocation) {\n var location_timeout = setTimeout(\"geolocFail()\", 10000);\n \n navigator.geolocation.getCurrentPosition(function(position) {\n clearTimeout(location_timeout);\n \n locationUser.lat = position.coords.latitude;\n locationUser.lng = position.coords.longitude;\n loadNearby()\n // console.log(locationUser)\n }, function(error) {\n clearTimeout(location_timeout);\n console.log('failed to get location')\n });\n } else {\n console.log('failed to get location')\n }\n}", "function geolocate() {\n // console.log(\"i am geolocate\");\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n //console.log(\"radius is :\",circle.radius);\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function setAddress(autocomplete) {\n var place = autocomplete.getPlace();\n if (!place.geometry) {\n window.alert(\"No details available for input: '\" + place.name + \"'\");\n return;\n }\n\n map.setCenter(place.geometry.location);\n map.setZoom(15);\n\n buildRequest(place.geometry.location);\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n // this will override freegeoip settings\n defaultLat = position.coords.latitude;\n defaultLng = position.coords.longitude;\n defaultRad = position.coords.accuracy;\n });\n }\n\n // only ask once\n flag_prompted = true;\n }", "function setMapToCurrentLocation() {\n var location;\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(pos) {\n location = {\n lat: pos.coords.latitude,\n lng: pos.coords.longitude\n };\n\n setMapToLocation(location);\n }, handleError);\n } else {\n displayErrorMessage(\"Something went wrong with the Geolocation search.\");\n }\n\n function handleError(error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n displayErrorMessage(\"User denied the request for Geolocation.\");\n break;\n case error.POSITION_UNAVAILABLE:\n displayErrorMessage(\"Location information is unavailable.\");\n break;\n case error.TIMEOUT:\n displayErrorMessage(\"The request to get user location timed out.\");\n break;\n case error.UNKNOWN_ERROR:\n displayErrorMessage(\"An unknown error occurred.\");\n break;\n }\n }\n\n return location;\n}", "function initAutocomplete() {\n\n var initialInput = document.getElementById('pac-input');\n googleMapObject.controls[google.maps.ControlPosition.TOP_RIGHT].push(initialInput);\n watchID = navigator.geolocation.watchPosition(function(position) {\n // Set the center of the map to the user's location.\n var currPosition = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n // Create the search box and link it to the UI element.\n var input = document.getElementById('pac-input');\n googleMapObject.setCenter(currPosition)\n var currLat = googleMapObject.getCenter().lat();\n var currLng = googleMapObject.getCenter().lng();\n var initialBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(currLat - 0.1, currLng),\n new google.maps.LatLng(currLat + 0.1, currLng)\n );\n var searchBox = new google.maps.places.SearchBox(input, {\n bounds: initialBounds\n });\n\n // Listen for the event fired when the user selects a prediction and retrieve\n // more details for that place.\n searchBox.addListener('places_changed', function() {\n var places = searchBox.getPlaces();\n\n if (places.length == 0) {\n return;\n }\n googleMapObject.addListener('bounds_changed', function() {\n searchBox.setBounds(googleMapObject.getBounds());\n });\n\n // For each place, get the icon, name and location.\n var bounds = new google.maps.LatLngBounds();\n places.forEach(function(place) {\n if (!place.geometry) {\n console.log(\"Returned place contains no geometry\");\n return;\n }\n\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n googleMapObject.fitBounds(bounds);\n });\n });\n\n}", "function bookingAutocomplete() {\n // setup autcomplete to input fields and set location search/return values\n var input = document.getElementById('initalCollectionPoint');\n var options = {\n componentRestrictions: {country: \"za\"}\n };\n var autocomplete = new google.maps.places.Autocomplete(input, options);\n autocomplete.setFields(['adr_address', 'geometry']);\n\n}", "function initialLocation() {\n var IPapiKey = \"602f8d85bc584bb4b0b520771a9d3287\";\n var IPapi = \"https://ipgeolocation.abstractapi.com/v1/?api_key=\" + IPapiKey;\n fetch(IPapi)\n .then((r) => r.json())\n .then((d) => {\n // assign user's lat/long to variables place them on the map\n searchLat = d.latitude;\n searchLng = d.longitude;\n initMap()\n });\n}", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 8;\n this.getAddress(this.latitude, this.longitude);\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 8;\n this.getAddress(this.latitude, this.longitude);\n });\n }\n }", "function initAutocomplete() {\n // Create the autocomplete object, restricting the search to geographical location types.\n autocomplete = new google.maps.places.Autocomplete(\n /** @type {!HTMLInputElement} */\n (searchEl), {\n // options(from google documentation)\n types: ['geocode'],\n componentRestrictions: { country: \"us\" }\n })\n}", "function userLocation() {\n if (navigator.geolocation) {\n //geolocation available\n navigator.geolocation.getCurrentPosition(successfulLookup, console.log);\n }\n}", "geolocate () {\n this.updateGeolocation ((geolocation, position) => {\n this.updateCoordinates(geolocation)\n })\n }", "function geoLocate() { \n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\n var currentAddress = null;\n\n geocoder.geocode({'latLng': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n currentAddress = results[0].formatted_address;\n document.getElementById('starting_point').value = currentAddress;\n updateRouteWithStartPoint(latlng);\n }\n }); \n });\n }\n }", "function getLocation() {\n var geolocation = navigator.geolocation;\n geolocation.getCurrentPosition(showLocation);\n }", "function getCurrentLocationLatLong(){\n globalspace.searchClinicsKeyword=\"\";\n $(\"#searchClinicsKeyword\").val('');\n if(deviceAgent == \"PC\"){\n if(navigator.geolocation)\n navigator.geolocation.getCurrentPosition(searchClinicsInCurrentLocation, geoLocationError);\n else{\n //showAlert(\"Geolocation is not supported by this browser.!\");\n }\n } else{\n navigator.geolocation.getCurrentPosition( searchClinicsInCurrentLocation, geoLocationError, { enableHighAccuracy: true } );\n }\n}", "setLocationSuggestions(event){\n if (this.country_mode) return false;\n let display_location_mode = this.input_location_mode_changed ? this.input_location_mode : 1;\n let get_started = this,\n new_location = {\n input_location_mode: display_location_mode,\n input_location: event.target.value\n };\n\n get_started.setState({\n input_location: event.target.value,\n show_location_suggestions: true\n });\n\n if (get_started.$set_location_suggestions){\n clearTimeout(get_started.$set_location_suggestions);\n }\n\n // debounce location suggestions by 500ms.\n get_started.$set_location_suggestions = setTimeout(()=>{\n CalculatorApi.getAutoComplete(new_location)\n .then((locations)=>{\n get_started.setState({\n locations: locations,\n show_location_suggestions: true\n });\n });\n }, 500);\n }", "function getUserLocation() {\n geolocationService.getCurrentPosition()\n .then(function(coords) {\n setUserCoordinates(coords.latitude, coords.longitude);\n geolocationService\n .getAddressName(coords.latitude, coords.longitude)\n .then(function(addressName) {\n $scope.filters.address = addressName;\n $scope.getVenues();\n })\n }, function(){\n $scope.showSpinner = false;\n $scope.noResults = true;\n });\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function initAutocomplete() {\n var input = document.getElementById('location');\n var defaultBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(20.5937, 78.9629));\n var searchBox = new google.maps.places.SearchBox(input, {bounds: defaultBounds});\n searchBox.addListener('places_changed', function() {\n var places = searchBox.getPlaces();\n if (places.length == 0)\n return;\n var bounds = new google.maps.LatLngBounds();\n places.forEach(function(place) {\n if (!place.geometry) \n return;\n });\n });\n }", "function getLocation(evt) {\n evt.preventDefault();\n $('#search-results').empty();\n $('#search-results').css('display', 'inline');\n $('#map').removeClass('col-md-offset-3');\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(submitCoords);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n var geoObject = navigator.geolocation.watchPosition(showPosition,\n handleError,options = {\n enableHighAccuracy: true\n }\n );\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function initAutocomplete() {\n var input = document.getElementById('person')\n var options = {\n componentRestrictions: {country: \"sg\"}\n };\n\n var autocomplete = new google.maps.places.Autocomplete(input, options);\n\n google.maps.event.addListener(autocomplete, 'place_changed', function() {\n var place = autocomplete.getPlace();\n var lat = place.geometry.location.lat();\n var lng = place.geometry.location.lng();\n\n document.getElementById(\"lat\").value = lat;\n document.getElementById(\"long\").value = lng;\n });\n}", "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(postLocation, showError);\n\t}\n}", "function fillInAddress() {\n var place = autocomplete.getPlace();\n}", "function initializeAutocomplete() {\n var input = document.getElementById('community_search_field');\n searchBox = new google.maps.places.Autocomplete(input);\n searchBox.setComponentRestrictions({'country': ['us']});\n searchBox.addListener('place_changed', setLocationValue);\n}", "function onPlaceChanged() {\n var place = autocomplete.getPlace();\n if (place.geometry) {\n map.panTo(place.geometry.location);\n map.setZoom(15);\n search(\"bike share\");\n search(\"food\");\n search(\"coworking space\");\n } else {\n document.getElementById(\"autocomplete\").placeholder = \"Enter a city\";\n }\n}", "function initAutocomplete() {\n autocomplete = new google.maps.places.Autocomplete(\n /** @type {!HTMLInputElement} */\n (document.getElementById(\"location\")), {\n types: [\"geocode\"]\n });\n autocomplete.addListener(\"place_changed\", callbackPlace);\n}", "function initializeAutocomplete() {\n var input = document.getElementById('search_field');\n searchBox = new google.maps.places.Autocomplete(input, {\n types: ['(cities)'],\n componentRestrictions: {country: 'us'}\n });\n // searchBox.setComponentRestrictions({'country': ['us']});\n searchBox.addListener('place_changed', setLocationValue);\n}", "setAutocompleteToAirport() {\n if (this.autocomplete) {\n this.setAirport(this.autocomplete.name, this.autocomplete.iataCode);\n }\n }", "function getAutoLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setCoords, showAutoLocError);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "function getLocation() {\n var x = document.getElementById(\"SearchString\");\n if (navigator.geolocation) {\n navigator.geolocation.watchPosition(showPosition);\n } else {\n x.value = \"Geolocation is not supported by this browser.\";\n }\n}", "function autosuggest() {\n /** Variables for Autocomplete */\n var input = document.getElementById('searchTextField');\n var options = {componentRestrictions: {country: 'US'}};\n var autocomplete = new google.maps.places.Autocomplete(input, options);\n\n /** Creates listener for when place changes */\n google.maps.event.addListener(autocomplete, 'place_changed', function (){\n /** Initialize variable to store formatted input address */\n address = autocomplete.getPlace().formatted_address;\n /** Convert given address to geocode */\n geocoder.geocode({address: address}, function(results, status){\n if (status == google.maps.GeocoderStatus.OK){\n /** Get first result */\n var locData = results[0].geometry.location;\n /** Set new geocode based off of location input */\n var lat = String(locData.lat());\n var lng = String(locData.lng());\n /** Set new location */\n loc = new google.maps.LatLng(lat, lng);\n /** Perform new search with given location */\n initialize(loc);\n /** Pins the given location with a blue marker */\n pin(loc);\n }\n });\n });\n}", "function autocomplete() {\n\n // Autocomplete for search location\n let autocompleteSearch = $(\"#search-location\")[0];\n var autocompletedSearch = new google.maps.places.Autocomplete(autocompleteSearch);\n\n}", "function Geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(GetPosition);\n } else {\n CreateLocationForm();\n }\n}", "function initAutocomplete() {\n\n const input = document.getElementById(\"pac-input\");\n let autocomplete = new google.maps.places.Autocomplete(input);\n\n autocomplete.setComponentRestrictions({\n country: [\"in\"],\n });\n\n autocomplete.addListener(\"place_changed\", () => {\n\n const place = autocomplete.getPlace();\n\n document.getElementById('lat-input').value = place.geometry.location.lat();\n document.getElementById('lng-input').value = place.geometry.location.lng();\n });\n}", "setLocation(forcedLng, forcedLat) {\n const { updateMapCoordinates, disabled } = this.props;\n let options =\n !!forcedLng && !!forcedLat\n ? {\n setCurrentPosition: false,\n lat: forcedLat,\n lng: forcedLng\n }\n : {};\n let lp = new LocationPicker(`map${this.timestamp}`, options, {\n zoom: 15 // You can set any google map options here, zoom defaults to 15\n });\n if (!disabled) {\n // Listen to when user finished interacting with map and send new coordinates to form\n if (!!this.listener) {\n window.google.maps.event.removeListener(this.listener);\n }\n this.listener = window.google.maps.event.addListener(\n lp.map,\n 'idle',\n function(event) {\n let location = lp.getMarkerPosition();\n updateMapCoordinates(location.lng, location.lat);\n }\n );\n }\n }", "function getLocation() {\n\tif (window.navigator.geolocation) {\n\t\twindow.navigator.geolocation.getCurrentPosition(showPosition);\n\t} else {\n\t\tshowPosition(DEFAULT_POSITION);\n\t}\n}", "function findLocation(location) {\r\n document.getElementById(\"originCity\").value = location;\r\n document.getElementById(\"originCity\").focus();\r\n}", "function autocomplete() {\n element = document.getElementById('autocomplete-position');\n var top = $('#autocomplete-position').offset().top - $('#position-fixer').offset().top;\n var rect = element.getBoundingClientRect();\n var width = element.offsetWidth;\n $('.autocomplete-suggestions').css('top', top).css('left', rect.left).css('width', width).css('display', 'block');\n}", "function getUserLocationforDrinkups() {\n if (navigator.geolocation) {\n var options={timeout:30000};\n navigator.geolocation.getCurrentPosition(initializeMarkers,unableToGetLocation,options);\n } \n}", "function setAutocompleteCountry() {\n const country = document.getElementById(\"country\").value;\n if (country == \"all\") {\n autocomplete.setComponentRestrictions({\n country: [],\n });\n map.setCenter({\n lat: 15,\n lng: 0,\n });\n map.setZoom(3);\n } else {\n autocomplete.setComponentRestrictions({\n country: country,\n });\n map.setCenter(countries[country].center);\n map.setZoom(countries[country].zoom);\n }\n clearResults();\n clearMarkers();\n}", "function getUserLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showUserPosition);\n\t} \n}", "getBrowserLocation() {\n if (!navigator.geolocation) {\n console.log('<p>Geolokation wird von ihrem Browser nicht unterstützt</p>')\n return\n }\n const { searchParams } = this.state\n const success = (position) => {\n const { latitude } = position.coords\n const { longitude } = position.coords\n searchParams.latitude = latitude\n searchParams.longitude = longitude\n this.updateSearchParams(searchParams)\n }\n const error = () => {\n console.log('Es war nicht möglich Sie zu lokalisieren')\n searchParams.latitude = 51.9624047\n searchParams.longitude = 7.6255008\n this.hasGeoSelector = true\n this.updateSearchParams(searchParams)\n }\n navigator.geolocation.getCurrentPosition(success, error)\n }", "function setAutocompleteCountry() {\n var country = document.getElementById(\"country\").value\n if (country == \"all\") {\n autocomplete.setComponentRestrictions({ country: [] })\n map.setCenter({ lat: 15, lng: 0 })\n map.setZoom(2)\n } else {\n autocomplete.setComponentRestrictions({ country: country })\n map.setCenter(countries[country].center)\n map.setZoom(countries[country].zoom)\n }\n clearResults()\n clearMarkers()\n}", "function getLocation() {\n     if (navigator.geolocation) {\n // showPosition is a reference to a JS function below\n         navigator.geolocation.getCurrentPosition(showPosition);\n     }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "function initGeolocation() {\n var myOptions = {\n zoom: 6,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var coordLocation;\n var defaultLocation = new google.maps.LatLng(17.385044, 78.486671); //Hyderabad\n var map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n // Try W3C Geolocation (Preferred)\n \n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n coordLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);\n map.setCenter(coordLocation);\n setAppCity(coordLocation);\n\n });\n }\n else {\n map.setCenter(defaultLocation);\n setAppCity(defaultLocation);\n }\n}", "componentDidMount() {\n Geolocation.getCurrentPosition(\n position => {\n console.log(position);\n this.setState({\n userLocation: {\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n latitudeDelta: 0.0922,\n longitudeDelta: 0.0421,\n },\n });\n console.log(\n 'userlocation latitude --> ' + this.state.userLocation.latitude,\n );\n console.log(\n 'userlocation longitude --> ' + this.state.userLocation.longitude,\n );\n },\n error => {\n // See error code charts below.\n console.log(error.code, error.message);\n },\n {enableHighAccuracy: false, timeout: 20000}, //this worked for me\n );\n }", "function initAutocomplete() {\n\n // Create the autocomplete object, restricting the search predictions to\n // geographical location types.\n autocomplete = new google.maps.places.Autocomplete(\n document.getElementById('autocomplete'), {types: ['geocode'], componentRestrictions: {country: 'au'}});\n \n // Avoid paying for data that you don't need by restricting the set of\n // place fields that are returned to just the address components.\n autocomplete.setFields(['formatted_address']);\n \n // When the user selects an address from the drop-down, populate the\n // address fields in the form.\n autocomplete.addListener('place_changed', fillInAddress);\n }", "_getLocation() {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n var crd = position.coords;\n this.setState({\n location: {lat: crd.latitude, long: crd.longitude, city: null},\n located: true\n });\n console.log(crd);\n },\n (error) => alert(error.message),\n {enableHighAccuracy: true, timeout: 10000, maximumAge: 0}\n );\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getPosition, showError);\n } else {\n console.log('Geolocation is not supported by this browser.');\n userCountry = 'Spain';\n showTopForCountry(userCountry);\n }\n}", "function UserLocation(position) {\r\n NearestCity(position.coords.latitude, position.coords.longitude);\r\n}" ]
[ "0.757561", "0.71489835", "0.7033695", "0.6981168", "0.6907958", "0.687647", "0.687647", "0.6859294", "0.68380755", "0.68195796", "0.67971236", "0.67971236", "0.67971236", "0.67962784", "0.67962784", "0.6796255", "0.67828804", "0.67651147", "0.67490447", "0.67490447", "0.67490447", "0.67490447", "0.67490447", "0.67458767", "0.6742232", "0.6728502", "0.67207736", "0.6710332", "0.66710794", "0.66673684", "0.6638285", "0.66075677", "0.65412885", "0.64630824", "0.64416975", "0.6420073", "0.639956", "0.6394548", "0.6308561", "0.62192005", "0.6203796", "0.6169658", "0.61581504", "0.6130237", "0.60780275", "0.6025218", "0.6023329", "0.60226387", "0.6021412", "0.599227", "0.599227", "0.5982419", "0.59814477", "0.5945094", "0.5919989", "0.5908148", "0.59052753", "0.5883476", "0.58595884", "0.58434105", "0.58434105", "0.5840098", "0.58284175", "0.58267045", "0.5824851", "0.5824851", "0.58190924", "0.5816804", "0.58151823", "0.5814053", "0.5807454", "0.58065003", "0.57930696", "0.5792089", "0.57885", "0.57866746", "0.57743233", "0.57740116", "0.5772729", "0.5770046", "0.5767514", "0.57660544", "0.5755694", "0.5750994", "0.5747259", "0.5745662", "0.574408", "0.5741378", "0.5741177", "0.5732471", "0.5728811", "0.5728811", "0.5728811", "0.5728811", "0.572002", "0.57175803", "0.57173383", "0.57113415", "0.57098603", "0.57046384" ]
0.66657287
30
Grabs the users input and stores them in userStore.js
function handleReg() { 'use strict'; var userName = document.getElementById("inputEmail").Value; var password = document.getElementById("inputPassword").Value; var confirmPassword = document.getElementById("confirmInputPassword").Value; var userStore = new App.UserStore(); userStore.save(userName, password) // IF statement to confirm both passwords match before saving if (password == confirmPassword) { window.location.href = "Issues.html"; return false; } else { alert('passwords do not match.'); return false; } }// end of handleReg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get userInput() {\n return this._user;\n }", "function getInputValues() {\n let usernameInput = document.querySelector(\".signup_form-username input\")\n .value;\n let emailInput = document.querySelector(\".signup_form-email input\").value;\n let passwordInput = document.querySelector(\".signup_form-password input\")\n .value;\n let countryInput = document.querySelector(\".signup_option_form-country\")\n .textContent;\n let ageInput = document.querySelector(\".signup_form-age input\").value;\n\n newUser.username = usernameInput;\n newUser.email = emailInput;\n newUser.password = passwordInput;\n newUser.country = countryInput;\n newUser.age = ageInput;\n\n postUser(newUser);\n}", "function _user(){\n\t//userconfig = getCredentials();\n\tvar userconfig = cloudfn.users.cli.get();\n\n\tvar schema = {\n\t\tproperties: {\n\t\t\tusername: {\n\t\t\t\tdescription: colors.green(\"Username\"),\n\t\t\t\tvalidator: /^[a-zA-Z]+$/,\n\t\t\t\twarning: 'Username must be only letters',\n\t\t\t\tdefault: userconfig.username,\n\t\t\t\trequired: true,\n\t\t\t\tminLength: 2,\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\temail: {\n\t\t\t\tdescription: colors.green(\"Email\"),\n\t\t\t\tdefault: userconfig.email,\n\t\t\t\trequired: true,\n\t\t\t\tconform: function(value){\n\t\t\t\t\treturn isemail.validate(value);\n\t\t\t\t},\n\t\t\t\t//format: 'email', // too sloppy\n\t\t\t\twarning: 'Email address required, see: http://isemail.info/_system/is_email/test/?all',\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tdescription: colors.green(\"Password\"),\n\t\t\t\thidden: true,\n\t\t\t\trequired: true,\n\t\t\t\treplace: '*',\n\t\t\t\tminLength: 5,\n\t\t\t\twarning: \"Password must be at least 6 characters\"\n\t\t\t}\n\t\t}\n\t};\n\n\tprompt.start();\n\n\tprompt.get(schema, function (err, result) {\n\t\tif (err) {\n\t\t\tconsole.log(\"\");\n\t\t\treturn 1;\n\t\t}\n\t\tif( debug ) console.log('Command-line input received:');\n\t\tif( debug ) console.log(' Username: ' + result.username);\n\t\tif( debug ) console.log(' Email: ' + result.email);\n\t\tif( debug ) console.log(' Password: ' + result.password);\n\n\t\t//console.log(\"getNearestCredentialsFile():\", getNearestCredentialsFile() );\n\n\t\t// Credentials to store locally: username, email\n\t\tvar local = {\n\t\t\tusername: result.username,\n\t\t\temail: result.email\n\t\t};\n\n\t\t/// Credentials to store on the server: username, email, hash of [username, email, password]\n\t\tvar userdata = {\n\t\t\tusername: result.username,\n\t\t\temail: result.email,\n\t\t\thash: getHash({\n\t\t\t\tusername: result.username,\n\t\t\t\temail: result.email,\n\t\t\t\tpass: result.password\n\t\t\t})\n\t\t};\n\n\t\tvar url = [remote, '@', 'u', result.username, userdata.hash].join('/');\n\t\tif( debug ) console.log('@user url', url); \n\t\trequest.get({url:url, formData: userdata}, (err, httpResponse, body) => {\n\t\t\tparse_net_response(err, httpResponse, body, (body) => {\n\t\t\t\t\n\t\t\t\tif( debug ) console.log(\"@user: http-response:\", body.msg);\n\n\t\t\t\tif( body.msg === 'allow' ){\n\t\t\t\t\tconsole.log(\"Credentials verified. Now using account '\"+ chalk.green(result.username) +\"'\");\n\t\t\t\t\t//fs.writeFileSync( getNearestCredentialsFile(), local);\n\t\t\t\t\tcloudfn.users.cli.set( local );\n\n\t\t\t\t}else if( body.msg === 'deny' ){\n\t\t\t\t\tconsole.log(\"Login failed. (TODO: reset password... contact [email protected] for now... thanks/sorry.\");\n\t\t\t\t\n\t\t\t\t}else if( body.msg === 'new' ){\n\t\t\t\t\tconsole.log(\"Created account for user:\", chalk.green(result.username) );\n\t\t\t\t\t//fs.writeFileSync( getNearestCredentialsFile(), local);\n\t\t\t\t\tcloudfn.users.cli.set( local );\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t});\n}", "function fetchUserDetails() {\n var lsUser = localStorage.getItem('wceUser');\n var user = JSON.parse(lsUser);\n\n if (isRealValue(user)){\n $('#user_event_first_name').val(user.first);\n $('#user_event_last_name').val(user.last);\n $('#user_event_user_email').val(user.email);\n }\n}", "function populateUserForm() {\n var cu = currentUser;\n enter.name.value = cu.name;\n enter.email.value = cu.email;\n enter.age.value = cu.age;\n enter.currentWeight.value = cu.currentWeight;\n enter.targetWeight.value = cu.targetWeight;\n}", "function storedUser(): Object {\n return userState.selectors.getUser(store.getState());\n}", "function registerUser() {\n let email = $(\"#txtEmail\").val();\n let pass= $(\"#txtPassword\").val();\n let first= $('#txtFirst').val();\n let last = $('#txtLast').val();\n let age = $('#txtAge').val();\n let address = $('#txtAddress').val();\n let phone = $('#txtPhone').val();\n let payment = $('#txtPayment').val();\n let color = $('#txtColor').val();\n\n let user = new User(email, pass, first, last, age, address, phone, payment, color);\n console.log(user);\n\n saveUser(user); // This function is on the storeManager\n clearUser();\n\n}", "function getUserInformation() {\n displaySignInContainer()\n var userInputEmail = document.getElementById(\"user-input-email\").value\n var userInputPassword = document.getElementById(\"user-input-password\").value\n\n //IF statements that will occur when checking the locally stored info against user's input\n if (userInputEmail !== storedEmail && userInputPassword !== storedPassword) {\n displayModal()\n return\n } else if (userInputEmail == storedEmail && userInputPassword !== storedPassword) {\n displayModal()\n return\n } else if (userInputEmail !== storedEmail && userInputPassword == storedPassword) {\n displayModal()\n return\n } else if (!userInputEmail && !userInputPassword) {\n displayModal()\n return\n } else (userInputEmail === storedEmail && userInputPassword === storedPassword)\n displayExpenseInputContainer()\n}", "function gettingStoredDataFunction() {\n let allUsersFromStorage = localStorage.getItem('allUsers');\n let allUsersParse = JSON.parse(allUsersFromStorage);\n\n //don't update if the sotrage is empty\n if (allUsersParse) {\n\n //reinstantiation to restor the missed proto methods\n for (let i = 0; i < allUsersParse.length; i++) {\n\n new User(allUsersParse[i].name, allUsersParse[i].type);\n\n }\n }\n\n}", "function setUserData(userInputData){\n console.log(userInputData)\n var user = userRef.push()\n localStorage.setItem(\"userID \", user.key)\n user.set({\n name: userInputData.userName, //key: value\n birthday: userInputData.userBDay, //prop = field will need to reset\n email: userInputData.userEmail,\n recentSearches: null,\n });\n }", "function setUserInput (input) {\n user_input = input;\n }", "function createUserData() {\n\n // Saves data for application storage \n EcwidApp.setAppStorage(initialConfig.private, function (value) {\n console.log('Initial private user preferences saved!');\n });\n\n // Saves data for public app config\n EcwidApp.setAppPublicConfig(initialConfig.public, function (value) {\n console.log('Initial public user preferences saved!');\n });\n\n // Function to prepopulate values of select, input and textarea elements based on default settings for new accounts\n setValuesForPage(initialConfig);\n checkTestModeValue();\n}", "function registerUser(){\r\n let email=$(\"#txtEmail\").val();\r\n let pass=$(\"#txtPassword\").val();\r\n let firstName=$(\"#txtFirst\").val();\r\n let lastName=$(\"#txtLast\").val();\r\n let age=$(\"#txtAge\").val();\r\n let address=$(\"#txtAddress\").val();\r\n let phone=$(\"#txtPhone\").val();\r\n let payment=$(\"#selPayment\").val();\r\n let color=$(\"#txtColor\").val();\r\n let user = new User(email,pass,firstName,lastName,age,address,phone,payment,color);\r\n console.log(user);\r\n saveUser(user);// this function is on the storeManager\r\n clearForm();\r\n setNavInfo()\r\n\r\n}", "function getNewUser () {\n const inputName = document.getElementById('input-name')\n const inputEmail = document.getElementById('input-email')\n const inputAge = document.getElementById('input-age')\n const inputGender = document.getElementById('select-age')\n\n const newUser = {\n name: inputName.value,\n email: inputEmail.value,\n age: inputAge.value,\n gender: inputGender.value\n }\n return newUser\n}", "function saveUserInput(\n userSearchValue,\n dropDownOption,\n bookCheck,\n movieCheck,\n gameCheck\n ) {\n //Grab the current userSearchObject array and push the new user input into it\n userSearchObject.push({\n searchText: userSearchValue,\n DropDownChoice: dropDownOption,\n books: bookCheck,\n movies: movieCheck,\n games: gameCheck,\n });\n //Save the userSearchObject array with new search criteria in it to localStorage\n localStorage.setItem(\"userSearchObject\", JSON.stringify(userSearchObject));\n //call the renderSearchButtons function and create a button for the search\n renderSearchButtons(\n userSearchValue,\n dropDownOption,\n bookCheck,\n movieCheck,\n gameCheck\n );\n }", "function storeUser(user){\n username = user;\n if(user.filteredWords){\n teacherWords = user.filteredWords;\n }\n else{\n $http.get('/auth/teacher/'+user.teacherID)\n .then(function(data){\n teacherWords = data.data.filteredWords;\n });\n }\n }", "function getLoginInputValues(){\n return { \n username: document.querySelector('.user-input').value,\n password: document.querySelector('.user-password').value\n }\n }", "function showUserForm() {\n try {\n var user = JSON.parse(localStorage.getItem(\"user\"));\n } catch(e) {\n if (window.navigator.vendor === \"Google Inc.\") {\n if (e === DOMException.QUOTA_EXCEEDED_ERR) {\n alert(\"Error: Saving to local storage\");\n }\n } else if (e === QUOTA_EXCEEDED_ERR) {\n alert(\"Error: Saving to local storage.\");\n }\n \n console.log(e);\n }\n \n if(user != null) {\n $(\"#FirstName\").val(user.FirstName);\n $(\"#LastName\").val(user.LastName);\n $(\"#DOB\").val(user.DOB);\n $(\"#changePassword\").val(user.NewPassword);\n $(\"#height\").val(user.Height);\n $(\"#weight\").val(user.Weight);\n }\n }", "function createUserProfile() {\n const user = new Map();\n\n user.set(\"age\", document.getElementById(\"age\").value);\n user.set(\"gender\", document.querySelector(\"input[name='gender']:checked\").value.toLowerCase());\n user.set(\"weight\", document.getElementById(\"weight\").value);\n user.set(\"feet\", document.getElementById(\"feet\").value);\n user.set(\"inches\", document.getElementById(\"inches\").value);\n user.set(\"activity\", document.getElementById(\"activity-level\").value.toLowerCase());\n \n return user;\n}", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "function getUserData() {\n\n let myUsername = document.getElementById('myUsername').value;\n let myPassword = sha256(document.getElementById('myPassword').value);\n let myEmail = document.getElementById('myEmail').value;\n let profilePicUpload = document.getElementById('profile-pic-upload').value.split('\\\\')[2];\n\n return createUser(myUsername, myPassword, myEmail, profilePicUpload);\n}", "function showUserForm() {\n let user = null;\n\n // Try getting user object back from storage.\n try {\n user = JSON.parse(localStorage.getItem(\"user\"));\n } catch (e) {\n alert(\"Error loading from user information from storage.\");\n console.log(e);\n }\n\n // If the user object exists and isn't a null reference\n // update the form information with the user info.\n if (user != null) {\n $(\"#txtFirstName\").val(user.FirstName);\n $(\"#txtLastName\").val(user.LastName);\n $(\"#dateBirthday\").val(user.Birthdate);\n $(\"#txtNewPIN\").val(user.PIN);\n $(\"#sldMaxHoursPerDay\").val(user.HoursGoal);\n $(\"#sldMaxHoursPerDay\").slider(\"refresh\");\n }\n}", "function submit() {\n console.log(buildUser())\n}", "auth_user_data(state, user){\n state.auth_user = user\n }", "user(state, user) {\n state.user = user;\n }", "function submitData(e){\n e.preventDefault();\n\n var user123 = document.getElementById(\"userName\");\n \n\n // user.innerHTML = input.value;\n var userName = document.getElementById(\"nameInput\").value;\n // console.log(userName)\n window.localStorage.setItem(\"user\",userName);\n\n // var getData = localStorage.getItem(\"user\");\n // console.log(getData);\n\n // user123.innerHTML = getData;\n // console.log(getData)\n \n\n}", "static storeUser(user) {\n localStorage.setItem('userInfo', user);\n }", "async function saveUser() {\n // searched the user first, send the login name and his url\n await handleSaveList(\"/githubSearch/save\", \"save\",\n validUserNameJason.login, validUserNameJason.html_url);\n // init json object for the next user to be search\n }", "function processForm() {\n\n // get the entered user name from the input\n var enteredUsername = $('input').val();\n localStorage.setItem('username', enteredUsername);\n database.ref('users/'+ enteredUsername).set({\n \tusername: enteredUsername\n \t});\n \n finishedCurrentView();\n \t//window.location.href = '/app/davidToLife';\n $('.username').html(enteredUsername);\n\n return false;\n}", "function initializeUsers() {\n username = localStorage.getItem('staySignedInAs')\n if (username !== null) {\n useDefaults = localStorage.getItem('Defaults Used?' + username + 'Kixley@65810')\n useDefaults = parseBool(useDefaults)\n if (useDefaults === false) {\n useDefaultDiff = localStorage.getItem('Default Diff Used?' + username + 'Kixley@65810')\n useDefaultDiff = parseBool(useDefaultDiff)\n useDefaultClass = localStorage.getItem('Default Class Used?' + username + 'Kixley@65810')\n useDefaultClass = parseBool(useDefaultClass)\n }\n }\n}", "update() {\n localStorage.setItem('user', JSON.stringify(user))\n\n dataStore.set('config', user.config)\n dataStore.set('palette', user.palette)\n dataStore.set('projectPalette', user.projectPalette)\n dataStore.set('log', user.log)\n\n Log.refresh()\n }", "function prefillUserInfo() {\n fastspring.builder.recognize({\n 'email': userEmail,\n 'firstName': userFirstName,\n 'lastName': userLastName,\n 'company': userCompany\n });\n}", "function sign_up(event){\n console.log('xoxox');\n event.preventDefault();\n localStorage.clear;\n var userName = event.target.userName.value;\n var passWord = event.target.password.value;\n var name = event.target.Name.value;\n for(i = 0; i < myData.length; i++){\n if(userName = myData[i].username){\n prompt('This userName is taken, choose different.');\n };\n };\n myData.push(new Person(userName, passWord, name));\n form.reset();\n}", "function getUserObj() { return {username: $(\"#username\").val(), password: $(\"#password\").val()}}", "[USERINFO](state, userInfo) {\n //save in state\n state.userInfo = userInfo \n logger('userinfo', 'save store succeed !')\n console.log(userInfo)\n //save in localStorage\n saveUserInfo(userInfo)\n }", "static async read(){\n try {\n //read from store\n const data = await store.get(UserStore.KEY);\n //update cahched value\n _userData = data;\n return (data);\n\n } catch(error){\n console.error('Failed to read user data from store.');\n throw error;\n };\n }", "function storeTo() {\n \n //console.log(toUser);\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 readUserInput() {\n\tvar settings = {};\n\t//Plasmid Section\n\tsettings.plasmidname = readtxtField(\"txtPlasmidName\");\n\tsettings.plasmidnameon = readField(\"bolShowPlasmidName\");\n\tsettings.plasmidsize = readField(\"txtPlasmidSize\");\n\tsettings.plasmidsizeon = readField(\"bolShowPlasmidSize\");\n\tsettings.plasmidradius = readField(\"txtRadius\");\n\tsettings.bbwidth = readField(\"txtBackBoneWidth\");\n\tsettings.bbcolor = readField(\"optBackBoneColor\");\n\tsettings.bbon = readField(\"bolShowBackBone\");\n\t//Feature Section (General)\n\tsettings.fwidth = readField(\"txtFeatureWidth\");\n\tsettings.fstrokewidth = readField(\"txtFeatureStrokeWidth\");\n\tsettings.fstrokered = readField(\"txtStrokeRed\");\n\tsettings.fstrokegreen = readField(\"txtStrokeGreen\");\n\tsettings.fstrokeblue = readField(\"txtStrokeBlue\");\n\tsettings.farrowlength = readField(\"txtArrowHeadLength\");\n\tsettings.farrowwidth = readField(\"txtArrowHeadWidth\");\n\t//Text section\n\tsettings.txton = readField(\"bolShowText\");\n\tsettings.txtfamily = readField(\"optFontFamily\");\n\tsettings.txtsize = readField(\"txtFontSize\");\n\tsettings.txtcolor = readField(\"optFontColor\");\n\tsettings.txtbold = readField(\"bolTextBold\");\n\tsettings.txtloc = readField(\"optTextLocation\");\n\t//Canvas section\n\tsettings.cw = readField(\"txtCanvasWidth\");\n\tsettings.ch = readField(\"txtCanvasHeight\");\n\tsettings.error = 0;\n\tsettings.errmsg = \"\";\n\t//Calculated properties\n\tsettings.ox = settings.cw / 2;\n\tsettings.oy = settings.ch / 2;\n\tsettings.ri = settings.plasmidradius - settings.fwidth / 2;\n\tsettings.ro = settings.plasmidradius + settings.fwidth / 2;\n\tsettings.rim = settings.plasmidradius - settings.fwidth / 2 - settings.farrowwidth;\n\tsettings.rom = settings.plasmidradius + settings.fwidth / 2 + settings.farrowwidth;\n\treturn settings;\n}", "function getUserInput() {\n return inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"Your name:\"\n },\n {\n type: \"input\",\n name: \"githubUsername\",\n message: \"Your GitHub username:\"\n },\n {\n type: \"input\",\n name: \"githubURL\",\n message: \"Your GitHub profile url:\"\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"Your email address:\"\n },\n {\n type: \"input\",\n name: \"title\",\n message: \"Project title:\"\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"Project description:\"\n },\n {\n type: \"input\",\n name: \"installation\",\n message: \"Project installation information:\"\n },\n {\n type: \"input\",\n name: \"usage\",\n message: \"Project usage information:\"\n },\n {\n type: \"list\",\n name: \"license\",\n message: \"Project license:\",\n choices: [\"MIT\", \"GNU_GPLv3\", \"Apache\", \"BSD_3clause\", \"ISC\", \"Artistic\", \"GNU_LGPLv3\", \"Unlicense\"]\n },\n {\n type: \"input\",\n name: \"contributing\",\n message: \"Information about contributing to this project:\"\n },\n {\n type: \"input\",\n name: \"tests\",\n message: \"Information about testing for this project:\"\n }\n ]);\n}", "async setUserData() {\n\t\tvar userinfo;\n\t\tawait AppX.fetch('User', 'self').then(async result => {\n\t\t\tvar info = result.data;\n\t\t\tglobal.userLogin = info.login;\n\n\t\t\tawait AppX.fetch('OrganizationDetail', info.organizationUid).then(result => {\n\t\t\t\tglobal.userOrgName = result.data.name;\n\t\t\t});\n\n\t\t});\n\t}", "function getDataUserFromInput() {\n getDataUserMessage();\n setUserDataMediaDemo();\n}", "function addUser() {\n const userFirstName = document.querySelector(' #fname ').value;\n const userLastName = document.querySelector(' #lname ').value;\n const userDateOfBirth = document.querySelector(' #dob ').value;\n const inputForm = document.querySelector(' #userInfo ');\n users.push(createUserObject(userFirstName, userLastName, userDateOfBirth));\n console.table(users);\n inputForm.reset();\n}", "function createUser(){\n\n\tlet tempuserdata = new ussers(document.getElementById('regUsername').value, \n\t\tdocument.getElementById('regFullName').value,\n\t\tdocument.getElementById('regEmail').value,\n\t\tdocument.getElementById('regPassword').value,\n\t\tdocument.getElementById('regRepass').value);\n\n\n\t//{\n\n\t//\tUser: document.getElementById('regUsername').value,\n\t//\tfullName: document.getElementById('regFullName').value,\n\t//\temail: document.getElementById('regEmail').value,\n\t//\tpassword: document.getElementById('regPassword').value,\n\t//\trepass: document.getElementById('regRepass').value,\n\t//\tprivileges: 0,\n\t//\tlogged: false\n\t//};\n\t\n\tif(tempuserdata.password != tempuserdata.repass){\n\t\talert(\"Password dont match, try again.\");\t\t\n\t\tdocument.getElementById('passform').reset();\n\t\treturn;\n\t}\n\t//document.getElementById('rerForm').reset();\n\tuserData.push(tempuserdata);\n\tlocalStorage.setItem('userData',JSON.stringify(userData));\n\n}", "function initUserInfo () {\r\n\t \tvar storedUserInfo = localStorage.getItem('user'), currentUser = null;\r\n\t \tif (!!storedUserInfo) {\r\n\t \t\tcurrentUser = JSON.parse(storedUserInfo);\r\n\t \t}\r\n\t \treturn currentUser;\r\n\t }", "function getData() {\n prompt.get(promptSchema, async (err, result) => {\n let usernameOk = await checkUsername(result.username);\n if (! usernameOk) {\n console.log(\"Please re-enter the details:\")\n getData();\n return;\n }\n\n let passwordOk = await checkPassword(result.password, result.passwordAgain);\n if (!passwordOk) {\n console.log(\"Please re-enter the details:\")\n getData();\n return;\n }\n\n const passwordData = await authenticator.generateNewHash(result.password);\n const res = await query_controller.addUser(result.username, passwordData.hash, passwordData.salt, passwordData.iterations);\n if (res.success) {\n console.log(\"New user successfully created.\");\n }\n else {\n console.log(\"Error occured:\");\n console.log(res);\n }\n console.log(\"===== User setup finished =====\");\n });\n}", "function setUserdataObject () {\n\t\t// Try and get user data from local storage. Returns null or data. \n\t\tvar storageData = getUserdataFromStorage();\n\n\t\t/**\n\t\t\tCall the web service only if:\n\t\t\t\tthey force an IP lookup via URL param, \n\t\t\t\tor no data was retrieved from storage, \n\t\t\t\tor storage data was compromised (Ex: user screws with localstorage values)\n\t\t\tElse the user had valid stored data, so set our user obj.\n\t\t**/\n\t\tif (ipForced !== \"\" || !storageData || !storageData.information_level) {\n\t\t\trequestUserdataFromService();\n\t\t}\n\t\telse {\n\t\t\tpopulateUserObject(storageData);\n\t\t}\n\t}", "handleSignUp() {\n\n // Create a new user and save their information, THEN\n // - Update the display name of the user\n\n // - Return promise for chaining, THEN\n // - Set the state as the current (firebase) user\n\n }", "function store() {\n\t// Stores inputs from the register-form in variables\n\tvar name = document.getElementById('regUser').value;\n\tvar pw = document.getElementById('regPw').value;\t\n\t// Stores input from register-form\n localStorage.setItem('name', regUser.value);\n localStorage.setItem('pw', regPw.value);\n\tconsole.log('Username:' + name + ' ' + 'Password:' + pw + ' are stored in local storage');\n\t//resets form on button click//\n\tdocument.getElementById('register-form').reset();\n \t\n}", "function getUser () {return user;}", "function loadUser(){\n let userLogged = JSON.parse(localStorage.getItem(\"userLogged\"))\n setUser(userLogged)\n }", "function handleSubmit(e){\n e.preventDefault()\n console.log(user)\n \n fetch('http://localhost:3000/users')\n .then(res => res.json())\n .then(users => setUser(users[0]))\n \n }", "setUserData(state, user){\n console.log(\"[DEUG] setUserData: \", user)\n state.user = user;\n }", "user(state) {\n return state.user;\n }", "function inputStoreData() {\n console.log(\"inside original input storage\");\n inputs = $('input[type=\"text\"],input[type=\"password\"]').each(function() {\n $(this).data('original', this.value);\n });\n console.log(\"Inputs inside store function:\" + inputs);\n}", "function userInput(){\n\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"itemId\",\n message: \"Type the ID of the item you would like to purchase\"\n },\n {\n type: \"input\",\n name: \"itemQuantity\",\n message: \"How many?\"\n }\n ])\n .then(answer => {\n \n var id = answer.itemId;\n var quantity = answer.itemQuantity;\n\n getProductQuantity(id,quantity);\n\n })\n }", "get userDataInput() {\n return this._userData;\n }", "static getUser() {\n return JSON.parse(localStorage.getItem('userInfo'));\n }", "function setUser() {\n user = new User($(\"#idh\").html(),$(\"#nameh\").html());\n}", "function add_user() {\n\tif (typeof(Storage) !== \"undefined\") {\n\t\t// get info from html and make profile object\n\t\tvar profile = {\n\t\t\tname: $(\"#firstname\")[0].value + \" \" +\n\t\t\t $(\"#middlename\")[0].value + \" \" + \n\t\t\t $(\"#lastname\")[0].value, \n\t\t\tbday: $(\"#birth\")[0].value,\n\t\t\tinterests: []\n\t\t};\n\t\t// update local storage\n\t\tlocalStorage.setItem(\"profile\", JSON.stringify(profile));\n\t}\n\telse {\n\t\tconsole.log(\"Local Storage Unsupported\")\n\t}\n\n}", "userRegistration() {\n let regUserName = document.querySelector(\"#regUserName\").value;\n let regEmail = document.querySelector(\"#regEmail\").value;\n let regPassword = document.querySelector(\"#regPassword\").value; // let regConfirmPassword = document.querySelector(\"#regUserName\").value\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"POST\",\n \"dataBaseObject\": {\n \"userName\": regUserName,\n \"email\": regEmail,\n \"password\": regPassword\n }\n }).then(_nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"embedItem\": `?userName=${regUserName}`\n }).then(user => {\n console.log(user);\n user.forEach(x => {\n sessionStorage.setItem(\"userId\", x.id); //hides NOMAD heading\n\n $(\".t-border\").hide(); //hides the form\n\n $(\".form\").hide(); //displays navigatin bar\n\n _dashboard.default.createNavBar();\n\n let userId = sessionStorage.getItem(\"userId\"); //console.log verifying that credentials match and user is logged in\n\n console.log(\"logged in as\" + \" \" + x.userName);\n console.log(\"your user ID is: \" + userId);\n });\n }));\n }", "function getRegInputData() {\n const name = userName.value;\n const email = userEmail.value;\n const password = userPassword.value;\n const passwordConfirm = userPasswordCnfrm.value;\n return { name, email, password, passwordConfirm };\n}", "function promptUser() {\n return inquirer.prompt([\n {\n type: \"input\",\n name: \"repo\",\n message: \"enter your repo url\",\n validate: validator\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"write a short description of your mini project\",\n validate: validator\n },\n {\n type: \"input\",\n name: \"linkedin\",\n message: \"enter your linkedin url\",\n validate: validator\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"Enter your GitHub Username\",\n validate: validator\n },\n {\n type: \"input\",\n name: \"contributors\",\n message: \"list any additional contributors\",\n validate: validator\n },\n {\n type: \"input\",\n name: \"linkedin\",\n message: \"Enter your LinkedIn URL.\",\n validate: validator\n }\n ]);\n}", "function storeUser(fname, lname, gender, phone, add,username, email, password) {\n\n\t// Create an array of object\n var userAccount = {};\n\n\t// Stores user properties\n userAccount.firstName = fname;\n userAccount.lastName = lname;\n userAccount.gender = gender;\n userAccount.phoneNumber = phone;\n\tuserAccount.address=add;\n userAccount.emailAddress = email;\n userAccount.password = password;\n userAccount.username = username;\n userAccount.high_score=0;\n\n\t// Convert array obj into stringify\n\t// Stores into localStorage\n\t// Use username as key\n localStorage[userAccount.username] = JSON.stringify(userAccount);\n\n\n\n\n\n\n}", "function register() {\n\tvar nameValue = document.getElementById(\"name\").value;\n\tvar nameGiftValue = document.getElementById(\"name_gift\").value;\n\n\tvar spouseNameValue = document.getElementById(\"spouse_name\").value;\n\tvar spouseGiftValue = document.getElementById(\"spouse_name_gift\").value;\n\n\tuser_data = JSON.parse(localStorage.getItem(\"user_data\"));\n\tif (!user_data) {\n\t\tuser_data = [];\n\t}\n\t\n\tuser_data.push({\n\t\tname: nameValue,\n\t\tgift: nameGiftValue,\n\t\tspouse: spouseNameValue,\n\t\tspouse_gift: spouseGiftValue\n\t});\n\n\tlocalStorage.setItem(\"user_data\", JSON.stringify(user_data));\n\tlocalStorage.setItem(\"all_users\", JSON.stringify(getUserList(user_data)));\n}", "function saveUserData(userData) {\n localStorage.setItem('username', userData.username);\n localStorage.setItem('accessToken', userData.accessToken);\n localStorage.setItem('id', userData.id);\n username = userData.username;\n accessToken = userData.accessToken;\n }", "function getUserData() {\n\n // Retrieve all keys and values from application storage, including public app config. Set the values for select, input and textarea elements on a page in a callback\n\n EcwidApp.getAppStorage(function (allValues) {\n setValuesForPage(allValues);\n checkTestModeValue(); // Check if test mode is \n });\n\n}", "function userType(){\n inquirer.prompt([\n {\n type: \"list\",\n message: \"\\nWelcome to Better Broomball Store!\\n\",\n choices: [\"Browse the store\", \"Admin access\"],\n name: \"type\"\n }\n ])\n .then(function(res) {\n // If the inquirerResponse confirms, we displays the inquirerResponse's username and pokemon from the answers.\n if (res.type === \"Browse the store\") {\n browseType = \"User\";\n let customerLogin = customer.getStarted();\n \n }\n else if (res.type === \"Admin access\") {\n browseType = \"Admin\";\n login();\n }\n }); \n }", "login (state, user_info) {\n state.user_info.user_name = user_info.user_name;\n state.user_info.user_id = user_info.user_id.toString();\n }", "function userInput(){\n\t//EIngabe des users wird zu lower case gemacht und anschließend weitergeleitet und verarbeitet \n\tinput = document.getElementById(\"roomInput\").value.toLowerCase();\n\t//Wenn der user etwas valides eingegebenen hat\n\tif(input==\"edv_a2.06\"||input==\"edv_a2.07\"||input==\"edv_a5.08\"||input==\"edv_a6.08\"||input==\"edv_a6.09\"||input==\"edv_a6.10\"){\n\t//Dann springen wir in die getRoom funktion und rufen das entsprechende xml dokument auf.\n\t//Input mit value zu duplizieren ist nur Faulheit da wir beinahe dieselbe Methode wie im json Teil benutzen\t\n\t\tvalue=input;\n\t\tgetRoom();\n\t}\n\treturn false;\n}", "function loadSettings() {\n \n const curUser = getCurrentUser();\n document.getElementById('first2').value = curUser.firstName;\n document.getElementById('last2').value = curUser.lastName;\n document.getElementById('email3').value = curUser.email;\n document.getElementById('pass3').value = curUser.password;\n }", "createCurrent() {\n const userJson = PreloadStore.get('currentUser');\n\n if (userJson) {\n\n const store = Nilavu.__container__.lookup('store:main');\n return store.createRecord('user', userJson);\n }\n return null;\n }", "set_user(on) { store.dispatch(hpUser(on)); }", "function GetDataFromLocalStorage(){\n /*if (storageObject.getItem(\"username\") != null) {\n $(\".usernameval\").val(storageObject.username);\n }\n if (storageObject.getItem(\"password\") != null) {\n $(\".passwordval\").val(storageObject.password);\n }*/\n}", "function userGet(data) {\n data = data.split(\"Logged in user name: \").pop();\n data = data.substr(0, data.indexOf('\\n'));\n data = data.substr(0, data.indexOf('\\r'));\n console.log('Got username on startup')\n console.log(data)\n if(data !== undefined){\n encrypt(data);\n messaging(setup,'userSet', true, '')\n } else {\n messaging(setup,'userSet', false, '')\n }\n return\n}", "function storeUserData () {\n\t\tvar key,\n\t\tstorageData = {};\n\n\t\t// Loop thru user object and encode each name/value.\n\t\tfor (key in user) {\n\t\t\tif (user.hasOwnProperty(key)) {\n\t\t\t\tstorageData[(encryption.encode(key))] = encryption.encode(user[key]);\n\t\t\t}\n\t\t}\n\n\t\tIBM.common.util.storage.setItem(storage.key, storageData, 3600 * 24 * (user.information_level === \"basic\" ? storage.expireDaysBasic : storage.expireDaysDetailed));\n\t}", "function saveUserDetails() {\n var user = {\n 'first': $('#user_event_first_name').val(),\n 'last': $('#user_event_last_name').val(),\n 'email': $('#user_event_user_email').val()\n };\n localStorage.setItem('wceUser', JSON.stringify(user));\n}", "function getUserData() {\n return customer = {\n 'fullname' : document.getElementById('firstname').value + \" \" + document.getElementById('lastname').value,\n 'addressline1' : document.getElementById('address').value,\n 'postalcode' : document.getElementById('zip').value,\n 'country' : document.getElementById('country').value\n }\n}", "_handleSave () {\n let password = this.state.userData[1].value;\n let name = this.state.userData[2].value;\n let email = this.state.userData[3].value;\n let homeCurrency = this.state.userData[4].value;\n let userData = {\n userName: this.state.userData[0].value,\n password: password !== this.state.originalUserData[1].value ? password : null,\n name: name !== this.state.originalUserData[2].value ? name : null,\n email: email !== this.state.originalUserData[3].value ? email : null,\n homeCurrency: homeCurrency !== this.state.originalUserData[4].value ? homeCurrency : null,\n };\n this.props.dispatch(putUser(userData));\n }", "function gatherData()\n{\n\tk_username = getKeystrokesData();\n\tdocument.getElementById('k_username').value = k_username;\n\tdocument.getElementById('login_form').submit();\n\t\n}", "userHandleInputChange(e) {\n const name = e.target.name;\n const value = e.target.value;\n this.setState((prevState, props) => {\n return {\n newUser: Object.assign({}, prevState.newUser, {[name]: value})\n }\n })\n }", "function updateUser(){\n helpers.rl.question('\\nEnter user name to update: ', dealWithUserUpdate);\n}", "function scrapeUser() {\n var username = document.getElementById(\"email\").value\n var password = document.getElementById(\"password\").value\n var accountType = getAccountTypeRadioValue()\n\n var user = createUser(username, password, accountType)\n console.log(user)\n return user\n\n}", "function getUserData() {\n if (document.getElementById(\"current-user\")) {\n currentUser = JSON.parse(document.getElementById(\"current-user\").textContent);\n console.log(\"==Retrived user info:\", currentUser);\n console.log(\"Succesfully logged in as\\nUsername:\", currentUser.username, \"\\nDisplay Name:\", currentUser.displayName);\n if (!(currentUser.username && currentUser.displayName)) {\n alert(\"Error: You have been logged out due to an error in function \\\"getUserData\\\" in index.js or \\\"app.use\\\" in server.js.\");\n currentUser = \"\";\n } else {\n updateDisplayLogin();\n }\n }\n}", "function getValueofInput () {\n\tif (username) {\n\tconsole.log(username.value);\n\t}\n}", "function getUserData() {\n let storageResponse = localStorage.getItem(\"userData\");\n let userData = JSON.parse(storageResponse);\n return userData;\n }", "function renderUser(user) {\n $('#usernameFld').val(user.username);\n $('#passwordFld').val(user.password);\n $('#firstNameFld').val(user.firstName);\n $('#lastNameFld').val(user.lastName);\n $('#roleFld').val(user.role);\n }", "function saveUserData() {\n localStorage.setItem('locallyStored', JSON.stringify(userData))\n}", "function promptUser() {\n //promt Manager questions\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the manager's name?\",\n validate: function (input) {\n const namePass = input.match(/^$/);\n if (namePass) {\n return \"Please enter a name!\";\n }\n return true;\n },\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is the manager's id?\",\n validate: function (input) {\n const idPass = input.match(/^$/);\n if (idPass) {\n return \"Please enter an id!\";\n }\n return true;\n },\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the manager's email?\",\n validate: function (input) {\n const emailPass = input.match(\n /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/\n );\n if (emailPass) {\n return true;\n }\n return \"Please enter a valid email address!\";\n },\n },\n {\n type: \"input\",\n name: \"officeNum\",\n message: \"What is the manager's office number?\",\n validate: function (input) {\n const numberPass = input.match(/^[1-9]\\d*$/);\n if (numberPass) {\n return true;\n }\n return \"Please enter a number!\";\n },\n },\n {\n type: \"list\",\n name: \"menu\",\n message: \"Please select and option from the menu below:\",\n choices: [\"Add Engineer\", \"Add Intern\", \"Finished Building Team\"],\n },\n ])\n .then(function (data) {\n //create manager object and save manager object to userInput array\n let manager1 = new Manager(\n data.name,\n data.id,\n data.email,\n parseInt(data.officeNum)\n );\n userInput.push(manager1);\n //call menu selection\n if (data.menu === \"Add Engineer\" || data.menu === \"Add Intern\") {\n menuSelection(data.menu);\n } else {\n writeToFile(\"./dist/index.html\", userInput);\n }\n });\n}", "function getUser(){\n return user;\n }", "function renderUser(user){\n\t\t//console.log(\"inside renderUser ..we are getting correct user\");\n\t\t//console.log(user);\n\t\t$('#usernameFld').val(user.username);\n\t\t$('#passwordFld').val(user.password);\n\t\t$('#firstNameFld').val(user.firstName);\n\t\t$('#lastNameFld').val(user.lastName);\n\t\t$('#role').val(user.role);\n\t}", "function saveSettings() {\n \n const curUser = getCurrentUser();\n const editedUser = curUser;\n \n editedUser.firstName = document.getElementById('first2').value;\n editedUser.lastName = document.getElementById('last2').value;\n editedUser.email = document.getElementById('email3').value;\n editedUser.password = document.getElementById('pass3').value;\n \n const index = (editedUser.userId-1);\n let allUsers = getAllUsers();\n allUsers[index] = editedUser;\n setAllUsers(allUsers);\n }", "function getUserInput() {\n\tvar inputData = \"\";\n\tinputData += \"&uName=\" + document.getElementById(\"tUName\").value + \"&pass=\" + document.getElementById(\"tPass\").value;\n\treturn inputData;\n}", "function addUserBtnClicked(){\n\n // then, Get all the input fields from the Add User Form and cache them into an array variable addUserInputsUI like so.\n const addUserInputsUI = document.getElementsByClassName(\"user-input\");\n\n // this object will hold the new user information\n let newUser = {};\n\n // Now, Loop though addUserInputsUI array that has three input fields. \n // loop through View to get the data for the model \n for (let i = 0, len = addUserInputsUI.length; i < len; i++) {\n\n // Then, Inside each iteration get the value of input attribute data-key and store it into the variable 'key'.\n let key = addUserInputsUI[i].getAttribute('data-key');\n // After that… create another variable called 'value' and store in it the actual user typed value.\n let value = addUserInputsUI[i].value;\n \n // Assign the 'key' and 'value' variables to the newUser object on each iteration. So, you will have an object something like this.\n // {\n // \"age\" : \"21\",\n // \"email\" : \"[email protected]\",\n // \"name\" : \"Raja Tamil\"\n // }\n newUser[key] = value;\n\n }\n\n // Push it to the Firebase Database: Finally, push() method will go ahead insert the new user data to the Firebase Database in a given path which is in usersRef.\n usersRef.push(newUser, function(){\n console.log(\"data has been inserted\");\n })\n\n}", "getUserInput() {\n return null;\n }", "changeUser(event) {\n const field = event.target.name; // either email or password, defined in html\n const user = this.state.user;\n user[field] = event.target.value;\n this.setState({user})\n }", "type() {\n\t\tvar input = document.querySelector('input');\n\t\tinput.value = this.props.username + \" \";\n\t}", "function getInput(options, callback) {\n allUserData.push(options);\n callback(options);\n}", "getUser() {\n const userName = this.refs.userName.value\n this.props.dispatch(actions.fetchAddUser(userName))\n }", "static saveUserInfo(userData) {\n localStorage.setItem('uid', userData.uid);\n localStorage.setItem('name', userData.name);\n }", "function promptUser() {\n return inquirer.prompt([{\n type: \"input\",\n message: \"What is your name?\",\n name: \"name\"\n },\n {\n type: \"input\",\n message: \"Enter your email address.\",\n name: \"email\"\n },\n {\n type: \"input\",\n message: \"Enter your GitHub username.\",\n name: \"github\"\n },\n {\n type: \"input\",\n message: \"What is the title of your project?\",\n name: \"title\"\n },\n {\n type: \"input\",\n message: \"Please give a brief description of your project\",\n name: \"description\"\n },\n {\n type: \"input\",\n message: \"Enter your instructions on how to retrieve and install your project.\",\n name: \"installation\"\n },\n {\n type: \"input\",\n message: \"Enter a description on how to use your project.\",\n name: \"usage\"\n },\n {\n // list for license choices\n type: \"list\",\n message: \"Choose a License from the following list:\",\n choices: [\"MIT\", \"Apache\", \"Apache2\", \"GPL\", \"CPAN\", \"BSD\"],\n name: \"license\"\n },\n {\n type: \"input\",\n message: \"Enter information for project contributors.\",\n name: \"contributing\"\n },\n {\n type: \"input\",\n message: \"Enter testing information\",\n name: \"tests\"\n }\n ])\n}" ]
[ "0.6901361", "0.6828137", "0.66438776", "0.65862954", "0.64832234", "0.6346777", "0.62587905", "0.62224555", "0.6214027", "0.61725223", "0.6165362", "0.6116718", "0.6089272", "0.60808474", "0.6073208", "0.6072496", "0.6057121", "0.6043244", "0.6036908", "0.60289484", "0.60264957", "0.60221213", "0.6021443", "0.6021261", "0.602002", "0.60123783", "0.60119855", "0.59983736", "0.59927505", "0.5985094", "0.5980748", "0.59787583", "0.5977858", "0.5974543", "0.59625226", "0.5958538", "0.59581774", "0.5947454", "0.5938145", "0.5936874", "0.5934028", "0.5933008", "0.5927834", "0.5926193", "0.59232825", "0.5912953", "0.59106004", "0.5907992", "0.59070426", "0.5906982", "0.58874184", "0.58825475", "0.58776987", "0.5866578", "0.5866513", "0.58626586", "0.58532405", "0.5852048", "0.5850702", "0.5849616", "0.5849401", "0.5848489", "0.58444", "0.58436424", "0.5838082", "0.5822221", "0.5822122", "0.5818764", "0.581864", "0.5808575", "0.58039314", "0.5801719", "0.57983035", "0.57966703", "0.5794393", "0.5786364", "0.57843435", "0.5784227", "0.5777527", "0.5773711", "0.5767324", "0.57668364", "0.5765572", "0.57644784", "0.57588977", "0.5757735", "0.57499313", "0.5744262", "0.5740694", "0.57377917", "0.573434", "0.5731762", "0.5730681", "0.57233244", "0.5717716", "0.57170326", "0.57133746", "0.571334", "0.5713268", "0.5711431", "0.571024" ]
0.0
-1
Replies back to the user with information about where the attachment is stored on the bot's server, and what the name of the saved file is.
async function replyForReceivedAttachments(localAttachmentData) { if (localAttachmentData) { // Because the TurnContext was bound to this function, the bot can call // `TurnContext.sendActivity` via `this.sendActivity`; await this.sendActivity(`Attachment "${ localAttachmentData.fileName }" ` + `has been received and saved to "${ localAttachmentData.localPath }".`); } else { await this.sendActivity('Attachment was not successfully saved to disk.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleAttachmentMessage() {\n let response;\n\n // Get the attachment\n let attachment = this.webhookEvent.message.attachments[0];\n //console.log(\"Received attachment:\", `${attachment} for ${this.user.psid}`);\n\n response = Response.genQuickReply(i18n.__(\"fallback.attachment\"), [\n {\n title: i18n.__(\"menu.start_over\"),\n payload: \"GET_STARTED\"\n }\n ]);\n\n return response;\n }", "function getAttachment(bot, msg, messageLang) {\r\n\tvar patentId = msg.text.toString().toLowerCase().replace('/download', '');\r\n\tif (patentId && typeof patentId != 'undefined') {\r\n\t\tif (usersLog[msg.from.username] && usersLog[msg.from.username].lastResult) {\r\n\t\t\ttry{\r\n\t\t\t\tif (usersLog[msg.from.username].lastResult[0][patentId]) {\r\n\t\t\t\t\tbot.sendDocument(msg.chat.id, usersLog[msg.from.username].lastResult[0][patentId].attachment, {\r\n\t\t\t\t\t\t\"caption\": '*' + languageBase[messageLang].attachmentCaption + '* ' + usersLog[msg.from.username].lastResult[0][patentId].desc,\r\n\t\t\t\t\t\t\"parse_mode\": 'Markdown'\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar message = languageBase[messageLang].attachmentNotFound[0] + patentId + languageBase[messageLang].attachmentNotFound[1];\r\n\t\t\t\t\tbot.sendMessage(msg.chat.id,message);\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\tconsole.log(e);\r\n\t\t\t\tbot.sendMessage(msg.chat.id,languageBase[messageLang].attachmentError);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tbot.sendMessage(msg.chat.id, languageBase[messageLang].attachmentWarning, {\r\n\t\t\t\t\"parse_mode\": 'Markdown'\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tbot.sendMessage(msg.chat.id,languageBase[messageLang].cmdError);\r\n\t} \r\n}", "function sendTrackerFile(author, guild){\r\n\tconst trackerFile = utils.getTrackerFile(guild);\r\n\tif (fs.existsSync(trackerFile)){\r\n\t\tutils.log(\"Sent trackerfile to \"+author.username+\"\", \"<<\");\r\n\t\treturn author.send({ files: [new Discord.Attachment(trackerFile)] });\r\n\t}\r\n\telse{\r\n\t\tutils.log(\"No trackerfile to send to \"+author.username+\"\", \"<<\");\r\n\t\treturn sendMessage(author, \"Trackerfile is empty or does not exist.\");\r\n\t}\r\n}", "function sendTrackerFile(author, guild){\r\n\tconst trackerFile = utils.getTrackerFile(guild);\r\n\tif (fs.existsSync(trackerFile)){\r\n\t\tutils.log(\"Sent trackerfile to \"+author.username+\"\", \"<<\");\r\n\t\treturn author.send({ files: [new Discord.Attachment(trackerFile)] });\r\n\t}\r\n\telse{\r\n\t\tutils.log(\"No trackerfile to send to \"+author.username+\"\", \"<<\");\r\n\t\treturn sendMessage(author, \"Trackerfile is empty or does not exist.\");\r\n\t}\r\n}", "async downloadAttachmentAndWrite(attachment) {\n // Retrieve the attachment via the attachment's contentUrl.\n const url = attachment.contentUrl;\n\n // Local file path for the bot to save the attachment.\n const localFileName = path.join(__dirname, attachment.name);\n\n try {\n // arraybuffer is necessary for images\n const response = await axios.get(url, { responseType: 'arraybuffer' });\n // If user uploads JSON file, this prevents it from being written as \"{\"type\":\"Buffer\",\"data\":[123,13,10,32,32,34,108...\"\n if (response.headers['content-type'] === 'application/json') {\n response.data = JSON.parse(response.data, (key, value) => {\n return value && value.type === 'Buffer' ?\n Buffer.from(value.data) :\n value;\n });\n }\n fs.writeFileSync(localFileName, response.data, (fsError) => {\n if (fsError) {\n throw fsError;\n }\n });\n } catch (error) {\n console.error(error);\n return undefined;\n }\n // If no error was thrown while writing to disk, return the attachment's name\n // and localFilePath for the response back to the user.\n return {\n fileName: attachment.name,\n localPath: localFileName\n };\n }", "function attachedFile(senderId, attachedObj) {\n if (attachedObj !== null && attachedObj.type === 'file') {\n allSenders[senderId].cv_url = attachedObj.payload.url;\n allSenders[senderId].states++;\n sendFBmessage.send(senderId, [{text: 'Write about yourself (personal qualities, professional skills, experience, interests, and passions). You can write a review about the bot \\u263A.'}]);\n } else {\n sendFBmessage.send(senderId, [{text:\"Ouch \\u263A It doesn’t look like pdf or doc, we accept only CV in pdf or doc.\"}]); \n }\n}", "get attachment () {\n\t\treturn this._attachment;\n\t}", "function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n app.showNotification(\"Oops there are no attachments on this email.\");\n }\n else\n {\n var apicall = \"https://api.workflowmax.com/job.api/document?apiKey=\"+ apiKey + \"&accountKey=\" + accountKey;\n\n var documentXML = \"<Document><Job>\" + cJobID + \"</Job><Title>Document Title</Title><Text>Note for document</Text><FileName>test.txt</FileName><Content>\" + string64 + \"</Content></Document>\";\n\n var xhr = new XMLHttpRequest();\n\n xhr.open('POST', apicall);\n\n xhr.send(documentXML);\n }\n }", "function send_avatar_info(newpath){\n\n var objectToSend = {}; // nuestro objeto a enviar\n var auto_message = \"Auto-message: My avatar has changed!\";\n\n objectToSend.name = guestname;\n objectToSend.message = auto_message;\n objectToSend.avatar = newpath;\n\n server.sendMessage(objectToSend);\n}", "function send_avatar_info(newpath){\n\n var objectToSend = {}; // nuestro objeto a enviar\n var auto_message = \"Auto-message: My avatar has changed!\";\n\n objectToSend.name = guestname;\n objectToSend.message = auto_message;\n objectToSend.avatar = newpath;\n\n server.sendMessage(objectToSend);\n}", "function attachmentHandler (id, atts, user) {\n // For now just send a message that says that we don't handle attachments.\n return m.attachmentDefaultAnswer(id);\n}", "function respondToMessageWithFile(message, response) {\r\n message.channel.sendFile(response);\r\n}", "get attachment() {\n\t\treturn this.__attachment;\n\t}", "function profilePicPathAttachment(obj) {\n return \"data/users/\" + obj.picture;\n }", "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\", senderID, recipientID, timeOfMessage);\n\n console.log(JSON.stringify(message));\n\n var isEcho = message.is_echo;\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n var quickReply = message.quick_reply;\n\n console.log(\"\\n------------event_log receivedPostback------------\\n\"+JSON.stringify(event)+\"\\n------------event_log receivedPostback fin------------\\n\")\n\n//photocin1361801687270524='ok';\n//date=\"2017-06-15\";\n//dossieruser1361801687270524={client: 'oui' ,agence: 'centreurbainnord' , jours: '2017-06-15' ,créneaux: '11:30' };\n//datecr2017_06_15centreurbainnord = {nbcrlibre: 4 ,cr1: '8:30' ,cr2: '11:30',cr3: '14:30',cr4: '15:00'};\n\n//datecr2017_06_15ariana = {nbcrlibre: 4 ,cr1: '8:30' ,cr2: '11:30',cr3: '14:30',cr4: '15:00'};\n\n // var azerty = JSON.parse(message.attachments);\n if(messageAttachments){\n\n console.log(message.attachments);\n //console.log(messageAttachments[0].payload.url);\n //console.log(message.attachments.payload.URL);\n if(messageAttachments[0].payload){\n options = {\n url: messageAttachments[0].payload.url,\n dest: 'C:/Users/user/Desktop/gomycode/download' // Save to /path/to/dest/photo.jpg \n}\n \n//download.image(options);\n if (messageAttachments[0].payload.coordinates) {\n\nconsole.log(\"lat= \"+messageAttachments[0].payload.coordinates.lat);\nconsole.log(\"long= \"+messageAttachments[0].payload.coordinates.long);\nlat=messageAttachments[0].payload.coordinates.lat;\nlang=messageAttachments[0].payload.coordinates.long;\n//sendTextMessage(senderID,\"votre lat est : \"+lat);\n }\n\n}\n\n else if (messageAttachments[0].type== \"image\")\n { \n\n async.series([\n function(callback){\n console.log(\"+++++ url image : \"+messageAttachments[0].payload.url);\n\n\n var url = messageAttachments[0].payload.url;\n \n var options = {\n directory: \"C:/Users/user/Desktop/gomycode/download/\",\n filename: \"image\"+senderID+\".jpeg\"\n }\n \n downloadfile(url, options, function(err){\n if (err) throw err\n console.log(\"\\ndownload done :)\\n\")\n });\n\n setTimeout(function(){\n callback(null, 1);\n }, 3000);\n\n }\n\n\n ], function(error, results) {\n console.log(results);\n });\n\n }\nelse if (messageAttachments[0].type== \"audio\")\n {\n \nconsole.log(\"\\n\\n audio received :)\\n\\n \")\n\n async.series([\n function(callback){\n console.log(\"+++++ url audio : \"+messageAttachments[0].payload.url);\n\n\n var url = messageAttachments[0].payload.url;\n \n var options = {\n directory: \"C:/Users/user/Desktop/gomycode/download/voice/\",\n filename: \"speech\"+senderID+\".mp3\"\n }\n \n downloadfile(url, options, function(err){\n if (err) throw err\n console.log(\"\\ndownload mp3 done :)\")\n });\n\n setTimeout(function(){\n callback(null, 1);\n }, 3000);\n\n }\n \n\n ], function(error, results) {\n console.log(results);\n });\n\n}\n}\n\n\n /*else if (isEcho)\n {\n console.log(\"echo\");\n }*/\nelse if (quickReply) {\n var quickReplyPayload = quickReply.payload;\n\n if (quickReplyPayload=='ProgrammesPayload')\n {\n\n async.series([\n function(callback){\n\n sendTextMessage(senderID, \"Tu es un passionné du numérique ? Un féru des nouvelles technologies ? \\nTu rêves de créer ton propre jeu vidéo, app mobile ou site web ? \\nTu veux devenir un développeur professionnel ?\\nGo My Code vous propose une varietée de programmes adaptés à vos divers besoins.\");\n\n\n setTimeout(function(){\n callback(null, 1);\n }, 1000);\n\n } ,\n \n function(callback){\n\n sendGenericMessagePrograms(senderID);\n\n setTimeout(function(){\n callback(null, 2);\n }, 1000);\n }\n\n ], function(error, results) {\n console.log(results);\n });\n }\n\n }\n\n else if (messageText) {\n\n}\n}", "url() {\n const url = RB.UserSession.instance.get('userFileAttachmentsURL');\n\n return this.isNew() ? url : `${url}${this.id}/`;\n }", "sendFileMessage( recipientId ) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"file\",\n payload: {\n url: envVars.SERVER_URL + \"/assets/test.txt\"\n }\n }\n }\n };\n\n this.callSendAPI( messageData );\n }", "handleAttachmentMessage(lastevent) {\n let response;\n let attachment = this.webhookEvent.message.attachments[0];\n console.log(\"Received attachment:\", `${attachment} for ${this.user.psid}`);\n if (lastevent === \"photoquestion\") {\n response = [\n Response.genQuickReply(i18n.__(\"fallback.preparationquestion\"), [\n {\n title: i18n.__(\"menu.yes\"),\n payload: \"yes_confirmation\"\n },\n {\n title: i18n.__(\"menu.no\"),\n payload: \"deny_confirmation\"\n }\n ])\n ];\n console.log(\"Receive.js 135 help\");\n console.log(\"---------Llamando a handleAttachmentMessage----------\");\n console.log(\"Payload handleAttachmentMessage\");\n console.log(response);\n } else if (lastevent === \"file_input\") {\n console.log(\"Asignando codigo a mensaje\");\n console.log(this.user.idreport);\n let first = Response.genText(i18n.__(\"fallback.dontworry\"));\n console.log(\"first\");\n console.log(first);\n let second = Response.genText(i18n.__(\"fallback.pdfpath\"));\n let third = Response.genGenericTemplate(\n `${config.appUrl}/logo_chappy_police.png`,\n i18n.__(\"titles.title_en\"),\n this.user.idreport,\n [\n Response.genWebUrlButton(\n i18n.__(\"titles.download_here\"),\n `${config.botUrl}/${this.user.idDocument}.pdf`\n )\n ]\n );\n console.log(\"IMPRIMIENDO URL:\");\n console.log(`${config.botUrl}/${this.user.idDocument}.pdf`);\n let fourth = Response.genText(i18n.__(\"fallback.finish2\"));\n let fifth = { payload: \"finish\" };\n response = [first, second, third, fourth, fifth];\n console.log(\"---------Llamando a handleAttachmentMessage----------\");\n console.log(\"Payload handleAttachmentMessage\");\n console.log(response);\n }\n // Get the attachment\n return response;\n }", "function getFileOut(message) {\n //Need to check for file extensions\n return `./images${message.id}`;\n}", "function saveReplay() {\n fs.writeFile(\"./replyMSG.json\", JSON.stringify(replyMSG), function(err) {\n if (err) throw err;\n });\n}", "function storeOppAsAttachment() {\n var fileContents = fixBuffer(contents);\n var createitem = new SP.RequestExecutor(web.get_url());\n createitem.executeAsync({\n url: web.get_url() + \"/_api/web/lists/GetByTitle('Prospects')/items(\" + currentItem.get_id() + \")/AttachmentFiles/add(FileName='\" + file.name + \"')\",\n method: \"POST\",\n binaryStringRequestBody: true,\n body: fileContents,\n success: storeOppSuccess,\n error: storeOppFailure,\n state: \"Update\"\n });\n function storeOppSuccess(data) {\n\n // Success callback\n var errArea = document.getElementById(\"errAllOpps\");\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n\n // Workaround to clear the value in the file input.\n // What we really want to do is clear the text of the input=file element. \n // However, we are not allowed to do that because it could allow malicious script to interact with the file system. \n // So we’re not allowed to read/write that value in JavaScript (or jQuery)\n // So what we have to do is replace the entire input=file element with a new one (which will have an empty text box). \n // However, if we just replaced it with HTML, then it wouldn’t be wired up with the same events as the original.\n // So we replace it with a clone of the original instead. \n // And that’s what we need to do just to clear the text box but still have it work for uploading a second, third, fourth file.\n $('#oppUpload').replaceWith($('#oppUpload').val('').clone(true));\n var oppUpload = document.getElementById(\"oppUpload\");\n oppUpload.addEventListener(\"change\", oppAttach, false);\n showOppDetails(currentItem.get_id());\n }\n function storeOppFailure(data) {\n\n // Failure callback\n var errArea = document.getElementById(\"errAllOpps\");\n\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"File upload failed.\"));\n errArea.appendChild(divMessage);\n }\n}", "function saveAttachment(attachment) {\n \n var file = attachment.getName();\n var folder = DriveApp.getFolderById(Folder_ID);\n var check = folder.getFilesByName(file);\n var invalidExtensions = ['png', 'jpg', 'jpeg', 'pdf', 'doc', 'docx'];\n \n // strip the extension\n var extension = file.split('.');\n\n // check the filetype to make sure it isn't in the list of invalid types\n if(invalidExtensions.indexOf(extension[extension.length-1]) > -1) {\n \n Logger.log(file + ' is not audio.');\n return;\n }\n \n if(check.hasNext()) {\n Logger.log(file + ' already exists. File not overwritten.');\n return;\n }\n uploadGoogleFilesToDropbox(attachment); // Uplaod attachment to Drop Box\n folder.createFile(attachment).setName(file); // Save attachement to Google Drive\n Logger.log(file + ' saved.');\n}", "function saveAttachment(digest, data) {\n txn.objectStore(ATTACH_STORE).put({digest: digest, body: data});\n }", "function send_data(sender, receiver, message) {\n\n // Check if we have an attachment\n if ($(\"#attached-file\").length == 1) {\n var attachment = $(\"#attached-file\").attr(\"filename\")\n } else {\n var attachment = null\n }\n var data = {sender: sender, receiver: receiver, message: message,\n attachment: attachment}\n $(\"#disable\").show()\n $.ajax({\n url: \"senddata.php\",\n data: data,\n type: \"post\",\n dataType: \"JSON\",\n success: function(res) {\n if (res.err !== null) {\n alert(res.err)\n } else {\n console.log(res)\n }\n $(\"#disable\").hide()\n }, error: function(xhr, ajaxOptions, thrownError) {\n console.log(xhr.status);\n console.log(thrownError);\n }\n });\n }", "function loadAttachment(client, addr, pass, key, id, uti) {\n\tvar iv = crypto.randomBytes(8).toString('hex');\n\n\tclient.emit('attachmentGet', id,\n\t\t'http://' + addr + ':8735/attachment?id=' + encrypt(id, key, iv) + '&password=' + encrypt(pass, key, iv) + '&iv=' + iv, uti);\n}", "get attachments() {\n return this._attachments;\n }", "async handleAttachments () {\n\t\t// not yet supported\n\t}", "function fileDownloadDone(filePath) {\n signale.complete('File download done, file saved to: ' + filePath);\n}", "function MessageSender(returnFile) {\n\tg_attachment = returnFile;\n\t////\n\tvar url_file = \"sendMailMessage\";\n\tsendToUrl(url_file);\n\t//\n}", "function fileSuccess(file, message) {\n // Iterate through the file list, find the one we\n // are added as a temp and replace its data\n // Normally you would parse the message and extract\n // the uploaded file data from it\n angular.forEach(vm.files, function (item, index)\n {\n if ( item.id && item.id === file.uniqueIdentifier )\n {\n // Normally you would update the file from\n // database but we are cheating here!\n\n // Update the file info\n item.name = file.file.name;\n item.type = 'document';\n\n // Figure out & upddate the size\n if ( file.file.size < 1024 )\n {\n item.size = parseFloat(file.file.size).toFixed(2) + ' B';\n }\n else if ( file.file.size >= 1024 && file.file.size < 1048576 )\n {\n item.size = parseFloat(file.file.size / 1024).toFixed(2) + ' Kb';\n }\n else if ( file.file.size >= 1048576 && file.file.size < 1073741824 )\n {\n item.size = parseFloat(file.file.size / (1024 * 1024)).toFixed(2) + ' Mb';\n }\n else\n {\n item.size = parseFloat(file.file.size / (1024 * 1024 * 1024)).toFixed(2) + ' Gb';\n }\n }\n });\n }", "function saveFile(){\n socket.emit(\"save_file\",\n {\n room:roomname,\n user:username,\n text:editor.getSession().getValue()\n });\n}", "downloadCurrentStory() {\r\n let downloadUrl = this.getStoryLink();\r\n let randomFileName = Math.random().toString(36).substring(2);\r\n let format = downloadUrl.split(\".\").reverse()[0].split('?')[0];\r\n let downloadData = {};\r\n downloadData.section = \"single\";\r\n downloadData.url = downloadUrl;\r\n downloadData.filename = `${randomFileName}.${format}`;\r\n chrome.extension.sendMessage(downloadData, (res) => console.log(\"Background recieved download data.\"));\r\n }", "function uploadNote()\n {\n // Get the content of email and then calls the 'callback' function.\n var item = Office.context.mailbox.item.body.getAsync(\"text\", callback);\n }", "function savefilecopy() {\n // exact same as the above except the save file has a new guid\n // the file would be safe to send to a friend if you want to send out a copy of your world that they can't modify on the server\n // since there are no accounts, server can't tell who is making modifications, only that the session matches a particular guid\n}", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch() {\n\t\n\t if (!filenames.length) {\n\t return null;\n\t }\n\t\n\t var filename = filenames.pop();\n\t var att = atts[filename];\n\t var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n\t '?rev=' + doc._rev;\n\t return ajaxPromise(opts, {\n\t method: 'GET',\n\t url: genDBUrl(host, path),\n\t binary: true\n\t }).then(function (blob) {\n\t if (opts.binary) {\n\t return blob;\n\t }\n\t return new PouchPromise(function (resolve) {\n\t blobToBase64(blob, resolve);\n\t });\n\t }).then(function (data) {\n\t delete att.stub;\n\t delete att.length;\n\t att.data = data;\n\t });\n\t }", "function uploadCallback(e,data){\n\tvar filename = data.files[0][\"name\"];\n\tvar publicurl = data.result[0].publicUrl;\n\tvar path = data.result[0].location;\n\t$(\"#Post_fileFolder\").val(data.result[0].fileFolder); // add the folder with the files to the form\n\t$(\"#attachments ul\").append('<li><i name=\"'+path+'\" class=\"icon-remove cursor delAttachment\"></i> <a href=\"'+publicurl+'\" title=\"'+filename+'\"><img src=\"'+publicurl+'\" title=\"'+filename+'\" height=\"75\" width=\"75\"/></a></li>');\n}", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "handler(request, reply) {\n return reply.file(path.join('public', a, request.params.filename));\n }", "function fetch(filename) {\n\t var att = atts[filename];\n\t var path$$1 = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n\t '?rev=' + doc._rev;\n\t return ajaxPromise(opts, {\n\t method: 'GET',\n\t url: genDBUrl(host, path$$1),\n\t binary: true\n\t }).then(function (blob) {\n\t if (opts.binary) {\n\t return blob;\n\t }\n\t return new PouchPromise(function (resolve) {\n\t blobToBase64(blob, resolve);\n\t });\n\t }).then(function (data) {\n\t delete att.stub;\n\t delete att.length;\n\t att.data = data;\n\t });\n\t }", "function sendFileMessage(recipientId, fileName) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"file\",\n payload: {\n url: config.SERVER_URL + fileName\n }\n }\n }\n };\n\n callSendAPI(messageData);\n}", "function restoreFileAttachment(req, res) {\n attachmentFile.findOneAndUpdate({_id: req.body.attachmentId}, {temp_deleted: false}).exec(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, message: Constant.FILE_RESTORE, data: data});\n }\n });\n}", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function saveImageMessage(file) {\n // 1 - We add a message with a loading icon that will get updated with the shared image.\n firebase.firestore().collection('messages').add({\n name: getUserName(),\n imageUrl: LOADING_IMAGE_URL,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).then(function (messageRef) {\n // 2 - Upload the image to Cloud Storage.\n var filePath = firebase.auth().currentUser.uid + '/' + messageRef.id + '/' + file.name;\n return firebase.storage().ref(filePath).put(file).then(function (fileSnapshot) {\n // 3 - Generate a public URL for the file.\n return fileSnapshot.ref.getDownloadURL().then((url) => {\n // 4 - Update the chat message placeholder with the image's URL.\n return messageRef.update({\n imageUrl: url,\n storageUri: fileSnapshot.metadata.fullPath\n });\n });\n });\n }).catch(function (error) {\n console.error('There was an error uploading a file to Cloud Storage:', error);\n });\n}", "function sendFileMessage(recipientId) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"file\",\n payload: {\n url: SERVER_URL + \"/assets/test.txt\"\n }\n }\n }\n };\n\n callSendAPI(messageData);\n}", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob$$1) {\n if (opts.binary) {\n return blob$$1;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob$$1, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob$$1) {\n if (opts.binary) {\n return blob$$1;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob$$1, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function advertiseFile() {\n let files = document.getElementById(\"sendFile\").files; // Get our selected files\n\n let fileDetailsList = [];\n\n for (let i in files) { // For each file\n if (files[i].name && files[i].size) { // If the file has a name and size\n fileDetailsList.push({ // Add the file to the list of advertised files\n fileName: files[i].name,\n size: files[i].size\n });\n }\n }\n\n let filesJSON = {\n type: \"file\",\n files: fileDetailsList // Add the list of files to a JSON\n };\n\n for (let id in connections) {\n if (connections[id].dataChannel)\n connections[id].dataChannel.send(JSON.stringify(filesJSON)); // Send the JSON to all users\n }\n}", "function saveImageMessage(file) {\n // 1 - We add a message with a loading icon that will get updated with the shared image.\n firebase.firestore().collection('sports').add({\n name: getUserName(),\n imageUrl: LOADING_IMAGE_URL,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).then(function(messageRef) {\n // 2 - Upload the image to Cloud Storage.\n var filePath = firebase.auth().currentUser.uid + '/' + messageRef.id + '/' + file.name;\n return firebase.storage().ref(filePath).put(file).then(function(fileSnapshot) {\n // 3 - Generate a public URL for the file.\n return fileSnapshot.ref.getDownloadURL().then((url) => {\n // 4 - Update the chat message placeholder with the image's URL.\n return messageRef.update({\n imageUrl: url,\n storageUri: fileSnapshot.metadata.fullPath\n });\n });\n });\n }).catch(function(error) {\n console.error('There was an error uploading a file to Cloud Storage:', error);\n });\n}", "function saveImageMessage(file) {\n // 1 - We add a message with a loading icon that will get updated with the shared image.\n firebase.firestore().collection('messages').add({\n name: getUserName(),\n lat: pos_lat,\n lng: pos_lng,\n accuracy: pos_accuracy,\n imageUrl: LOADING_IMAGE_URL,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).then(function(messageRef) {\n // 2 - Upload the image to Cloud Storage.\n var filePath = firebase.auth().currentUser.uid + '/' + messageRef.id + '/' + file.name;\n return firebase.storage().ref(filePath).put(file).then(function(fileSnapshot) {\n // 3 - Generate a public URL for the file.\n return fileSnapshot.ref.getDownloadURL().then((url) => {\n // 4 - Update the chat message placeholder with the image's URL.\n return messageRef.update({\n imageUrl: url,\n storageUri: fileSnapshot.metadata.fullPath\n });\n });\n });\n }).catch(function(error) {\n console.error('There was an error uploading a file to Cloud Storage:', error);\n });\n}", "function notifyUser(username, artUrl, artHeadline, artSubhead){\n var message = {\n as_user: \"true\",\n \"attachments\": [\n {\n \"title\": artHeadline,\n \"title_link\": artUrl,\n \"text\": artSubhead\n }\n ]\n }\n bot.postTo(username,\"You've been published, check it out!\", message);\n}", "function fileSuccess(file, message)\n {\n\t\t\tconsole.log('imageuplaod start');\n\t\t\tvar fileReader = new FileReader();\n fileReader.readAsDataURL(file.file);\n fileReader.onload = function (event)\n {\n vm.user.profilePic = event.target.result;\n\t\t\t\t\t\t//alert(vm.user.media.url);\n };\n\n // Update the image type so the overlay can go away\n //media.type = 'image';\n\t\t\t\t\t\n\t\t\t//alert('aaa');\n // Iterate through the media list, find the one we\n // are added as a temp and replace its data\n // Normally you would parse the message and extract\n // the uploaded file data from it\n angular.forEach(vm.user.images, function (media, index)\n {\n if ( media.id === file.uniqueIdentifier )\n {\n // Normally you would update the media item\n // from database but we are cheating here!\n var fileReader = new FileReader();\n fileReader.readAsDataURL(media.file.file);\n fileReader.onload = function (event)\n {\n profilePic = event.target.result;\n\t\t\t\t\t\t//alert(media.url);\n };\n\n // Update the image type so the overlay can go away\n media.type = 'image';\n }\n });\n }", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new Promise(function (resolve) {\n pouchdbBinaryUtils.blobOrBufferToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function endDownload() {\n\n // save received file into Blob\n const blob = new Blob(incomingFileData);\n incomingFileData = [];\n\n // if file is image, show the preview\n if (isImageURL(incomingFileInfo.fileName)) {\n const reader = new FileReader();\n reader.onload = (e) => {\n Swal.fire({ allowOutsideClick: false, background: background, position: \"top\", title: \"Received file from \" + incomingFileInfo.fileSender ,\n text: incomingFileInfo.fileName,\n showDenyButton: true, confirmButtonText: `Save`, confirmButtonColor: 'black', denyButtonText: `Cancel`, denyButtonColor: 'grey',\n }).then((result) => {\n if (result.isConfirmed) saveFileFromBlob();\n });\n };\n // blob where is stored downloaded file\n reader.readAsDataURL(blob);\n } \n else {\n // not img file\n Swal.fire({ allowOutsideClick: false, background: background, position: \"top\", title: \"Received file\",\n text: incomingFileInfo.fileName,\n showDenyButton: true, confirmButtonText: `Save`, confirmButtonColor: 'black', denyButtonText: `Cancel`, denyButtonColor: 'grey',\n }).then((result) => {\n if (result.isConfirmed) saveFileFromBlob(); \n });\n }\n\n // save to device\n function saveFileFromBlob() {\n const url = window.URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.style.display = \"none\";\n a.href = url;\n a.download = incomingFileInfo.fileName;\n document.body.appendChild(a);\n a.click();\n setTimeout(() => {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 100);\n }\n}", "function sendFileMessage(recipientId, fileName) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"file\",\n payload: {\n url: process.env.SERVER_URL + fileName\n }\n }\n }\n };\n\n callSendAPI(messageData);\n}", "async function admin_save_email(edit_attachment = false) {\n let from = document.getElementById('email_from').value;\n let subject = document.getElementById('email_subject').value;\n let listname = document.getElementById('email_listname').value;\n let is_private = document.getElementById('email_private').value;\n let body = document.getElementById('email_body').value;\n let attach = null;\n if (edit_attachment) {\n attach = admin_email_meta.attachments;\n }\n let formdata = JSON.stringify({\n action: \"edit\",\n document: admin_current_email,\n from: from,\n subject: subject,\n list: listname,\n private: is_private,\n body: body,\n attachments: attach\n })\n let rv = await POST('%sapi/mgmt.json'.format(G_apiURL), formdata, {});\n let response = await rv.text();\n if (edit_attachment && rv.status == 200) return\n if (rv.status == 200) {\n modal(\"Email changed\", \"Server responded with: \" + response, \"help\");\n } else {\n modal(\"Something went wrong!\", \"Server responded with: \" + response, \"error\");\n }\n}", "function sendFileMessage(recipientId, fileName) {\n\tvar messageData = {\n\t\trecipient: {\n\t\t\tid: recipientId\n\t\t},\n\t\tmessage: {\n\t\t\tattachment: {\n\t\t\t\ttype: \"file\",\n\t\t\t\tpayload: {\n\t\t\t\t\turl: config.SERVER_URL + fileName\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tcallSendAPI(messageData);\n}", "function sendFileMessage(recipientId, fileName) {\n\tvar messageData = {\n\t\trecipient: {\n\t\t\tid: recipientId\n\t\t},\n\t\tmessage: {\n\t\t\tattachment: {\n\t\t\t\ttype: \"file\",\n\t\t\t\tpayload: {\n\t\t\t\t\turl: config.SERVER_URL + fileName\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tcallSendAPI(messageData);\n}", "function fileControlFileGet(filePath)\n{\n\t\n\t\t\t\t\t\t console.log(\"filePath\",filePath);\n\t\t\t\t\t\t const formData = new FormData();\n\tvar messageAttributes={\n\t\t\t\t\tStaffuserName:\"admin\",\n\t\t\t\t\tServerDate:\"\",\n\t\t\t\t\tsms_unique_id:\"\", \n\t\t\t\t\t}\n\t\t\t\t\tformData.append('file', $('#formInputFile')[0].files[0]);\n \t\t\t\t\tgeneralChannel.sendMessage(formData,messageAttributes).then(function(message){\n\t\t\t\t\t\t console.log(\"message\",message);\n\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(document).height() }, 10);\n\t\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\n}", "function sendBotLogs(author){\r\n\tconst logFile = utils.getCurrentLogPath();\r\n\tif (fs.existsSync(logFile)){\r\n\t\tutils.log(\"Sent log file to \"+author.username+\"\", \"<<\");\r\n\t\treturn author.send({ files: [new Discord.Attachment(logFile)] });\r\n\t}\r\n\telse{\r\n\t\tutils.log(\"No log file to send to \"+author.username+\"\", \"<<\");\r\n\t\treturn sendMessage(author, \"Logs are empty or do not exist.\");\r\n\t}\r\n}", "function sendBotLogs(author){\r\n\tconst logFile = utils.getCurrentLogPath();\r\n\tif (fs.existsSync(logFile)){\r\n\t\tutils.log(\"Sent log file to \"+author.username+\"\", \"<<\");\r\n\t\treturn author.send({ files: [new Discord.Attachment(logFile)] });\r\n\t}\r\n\telse{\r\n\t\tutils.log(\"No log file to send to \"+author.username+\"\", \"<<\");\r\n\t\treturn sendMessage(author, \"Logs are empty or do not exist.\");\r\n\t}\r\n}", "function sendFileMessage(recipientId) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"file\",\n payload: {\n url: SERVER_URL + \"/assets/test.txt\"\n }\n }\n }\n };\n\n callSendAPI(messageData);\n}", "function sendFileMessage(recipientId) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"file\",\n payload: {\n url: SERVER_URL + \"/assets/test.txt\"\n }\n }\n }\n };\n\n callSendAPI(messageData);\n}", "function getAttachmentString (grAttachment /* GlideRecord of the attachment */) {\n\tvar gsa = new GlideSysAttachment();\n\tvar attBytes = gsa.getBytes(grAttachment); //Gets it as a Java Binary Array, not useable yet\n\tvar attJavaString = Packages.java.lang.String(fileBytes); //Convert the bytes array to a Java-Rhino string\n\tvar attString = String(attJavaString); //We don't trust Rhino, convert it into a Javascript string\n\t\n\treturn attString;\n}", "function saveImageMessage(file) {\n // 1 - We add a message with a loading icon that will get updated with the shared image.\n firebase.firestore().collection('group').doc(\"10\").collection(\"messages\").add({\n name: getUserName(),\n imageUrl: LOADING_IMAGE_URL,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).then(function (messageRef) {\n // 2 - Upload the image to Cloud Storage.\n var filePath = firebase.auth().currentUser.uid + '/' + messageRef.id + '/' + file.name;\n return firebase.storage().ref(filePath).put(file).then(function (fileSnapshot) {\n // 3 - Generate a public URL for the file.\n return fileSnapshot.ref.getDownloadURL().then((url) => {\n // 4 - Update the chat message placeholder with the image’s URL.\n return messageRef.update({\n imageUrl: url,\n storageUri: fileSnapshot.metadata.fullPath\n });\n });\n });\n }).catch(function (error) {\n console.error('There was an error uploading a file to Cloud Storage:', error);\n });\n }", "function sendEmailWithAttachment(email, content,attachpath)\n{\n \n \n var ses_mail = \"From: '' <\" + email + \">\\n\"\n + \"To: \" + email + \"\\n\"\n + \"Subject: New Order Submitted!!!\\n\"\n + \"MIME-Version: 1.0\\n\"\n + \"Content-Type: multipart/mixed; boundary=\\\"NextPart\\\"\\n\\n\"\n + \"--NextPart\\n\"\n + \"Content-Type: text/html; charset=us-ascii\\n\\n\"\n + content+\"\\n\\n\"\n + \"--NextPart\\n\"\n + \"Content-Type: text/plain;\\n\"\n + \"Content-Disposition: attachment; filename=\\\"\"+attachpath+\"\\\"\\n\\n\"\n + \"Awesome attachment\" + \"\\n\\n\"\n + \"--NextPart\";\n\n var params = {\n RawMessage: { Data: new Buffer(ses_mail) },\n Destinations: [ email ],\n Source: \"'' <\" + email + \">'\"\n };\n\n\n ses.sendRawEmail(params, function(err, data) {\n if(err) {\n } \n else {\n } \n });\n}", "function save(response, postData) {\r\n\tconsole.log(\"Saving SESSION!\")\r\n\tconsole.log(\"Sent data is \" + postData);\r\n\r\n\tvar filename;\r\n\r\n\t//get the loaction of the currentFile\r\n\tfs.readFile('./tmpUserData.json', 'utf8', function(err, data) {\r\n\t\tif (err) throw err;\r\n\r\n\t\tjsondata = eval(\"(\" + data + \")\");\r\n\t\tfilename = jsondata.currentFile;\r\n\r\n\t\tconsole.log(\"FILENAME IS \" + filename);\r\n\r\n\t\tfs.writeFile(filename, postData, function(err) {\r\n\t\t\tif (err) throw err;\r\n\t\t\tconsole.log('It\\'s saved!');\r\n\t\t\tresponse.writeHead(200, {\r\n\t\t\t\t\"Content-Type\": \"text/plain\"\r\n\t\t\t});\r\n\t\t\tresponse.write(\"Save of \" + filename + \" successfull\");\r\n\t\t\tresponse.end();\r\n\t\t});\r\n\t});\r\n\r\n\t//todo. for now the clientII will be updated upon save\r\n\tvar io = server.getIo();\r\n\tconsole.log(\"io is \" + io);\r\n\tio.sockets.emit(\"load\", postData);\r\n\r\n}", "function saveAlbumInfo(success, error) { \n addDefferedFileAction(success, error);\n \n //For now do not create album on Facebook\n //Instead immediately process file\n \n doDefferedFileAction('success');\n}", "function extension(messageReaction, attachment) {\n const imageLink = attachment.split(\".\");\n const typeOfImage = imageLink[imageLink.length - 1];\n const image = /(jpg|jpeg|png|gif)/gi.test(typeOfImage);\n if (!image) return \"\";\n return attachment;\n }", "get selectedAttachment() {\n let selectedElement = this._widget.selectedItem;\n if (selectedElement) {\n return this._itemsByElement.get(selectedElement).attachment;\n }\n return null;\n }", "function savefile() {\n // send a request to the server to write the current session to a file\n // may be a long running process that requires a loading bar or spinner\n // when done, file will download to user\n}", "function handleAttachmentAction(bot, inputs) {\r\n if (inputs.type == 'add reference') {\r\n addReference(bot, inputs)\r\n }\r\n}", "sendFileCard(filename, filesize) {\n const consentContext = { filename: filename };\n\n const fileCard = {\n description: 'This is the file I want to send you',\n sizeInBytes: filesize,\n acceptContext: consentContext,\n declineContext: consentContext\n };\n\n const asAttachment = {\n content: fileCard,\n contentType: 'application/vnd.microsoft.teams.card.file.consent',\n name: filename\n };\n\n const reply = { attachments: [asAttachment] };\n return reply;\n }", "function sendFileName(){\n\tconsole.log(scriptName);\n\tdata_to_send={\"name\": scriptName, \n\t\t\t\t \"avatar\": document.getElementById(\"nameForSaving\").innerHTML};\n\tconsole.log(data_to_send);\n\tdata_to_send=JSON.stringify(data_to_send);\n\t$.ajax({\n\t\turl: '/filename',\n\t\ttype: 'POST',\n\t\tdata: data_to_send,\n\t\tcontentType: 'application/json; charset=utf-8',\n\t\terror: function(resp){\n\t\t\tconsole.log(\"Oh no...\");\n\t\t\tconsole.log(data_to_send);\n\t\t\tconsole.log(resp);\n\t\t},\n\t\tsuccess: function(resp){\n\t\t\tconsole.log('Sent file name!');\n\t\t\tconsole.log(resp);\n\t\t}\n\t});\n \tsetTimeout(function(){\n \tgetAllData();\n \t}, 2000);\n}", "function clickSendAttachments(inputFile) {\n // upload image\n QB.content.createAndUpload({name: inputFile.name, file: inputFile, type:\n inputFile.type, size: inputFile.size, 'public': false}, function(err, response){\n if (err) {\n console.log(err);\n } else {\n $(\"#progress\").fadeOut(400);\n var uploadedFile = response;\n\n sendMessageQB(\"[attachment]\", uploadedFile.id);\n\n $(\"input[type=file]\").val('');\n }\n });\n}", "saveDialog() {\n content = JSON.stringify(datastore.getDevices());\n dialog.showSaveDialog({ filters: [\n { name: 'TellSec-Dokument', extensions: ['tell'] }\n ]},(fileName) => {\n if (fileName === undefined) {\n console.log(\"Du hast die Datei nicht gespeichert\");\n return;\n }\n fileName = fileName.split('.tell')[0] \n fs.writeFile(fileName+\".tell\", content, (err) => {\n if (err) {\n alert(\"Ein Fehler tritt während der Erstellung der Datei auf \" + err.message)\n }\n alert(\"Die Datei wurde erfolgreich gespeichert\");\n });\n });\n }", "function chosenAvatar() {\n\tscriptFolder = document.querySelector('input[name=\"avatarFolderName\"]:checked').value;\n\tconsole.log(document.querySelector('input[name=\"avatarFolderName\"]:checked').value);\n\tdocument.getElementById(\"nameForSaving\").innerHTML = scriptFolder;\n\tdocument.getElementById(\"title\").innerHTML += \": \"+ capitalize(scriptFolder);\n\tdocument.getElementById(\"pageTitle\").innerHTML += \": \"+ capitalize(scriptFolder);\n\tscriptName = '../web-recorder/public/avatar-garden/'+scriptFolder+'/script.json';\n\tsendFileName();\n\tconsole.log(scriptName);\n\tdocument.getElementById(\"selectPrevious\").style.display=\"none\";\n\tdocument.getElementById(\"recorder\").style.display='';\n\tconsole.log(\"YES\");\n}", "function triggerSaveRequest(this_file){\n\tconsole.log(\"your file info is \");\n\tconsole.log(this_file);\n\tvar fd = new FormData();\n\tfd.append('blob', this_file, this_video_name);\n\tconsole.log(fd);\n\tfetch('/save',\n\t{\n\t method: 'post',\n\t body: fd\n\t});\n}", "function oppFileOnload(event) {\n contents = event.target.result;\n // The storePOAsAttachment function is called to do the actual work after we have a reference to SP.RequestExecutor.js\n $.getScript(web.get_url() + \"/_layouts/15/SP.RequestExecutor.js\", storeOppAsAttachment);\n}", "function uploaded(err, data, response) {\n\n // we need a numeric index for the uploaded image, to refer on it.\n // this image-value is 'media_id_string' and is part of data object, that comes back.\n // we save that as 'id'\n var id = data.media_id_string;\n\n // this is what we will tweet later by calling 'post' function on 'T'\n var tweet = {\n status: '#codingrainbow live from node.js',\n // there could be multiple 'id'-s, so we save it in a array -->\n // media_ids: [id, id2, id3 ...]\n media_ids: [id]\n }\n // posting the tweet\n T.post('statuses/update', tweet, tweeted);\n\n }", "function fileNameForAttachment(type: ReportAttachmentType): string {\n switch (type) {\n case 'image/jpeg': {\n return 'attachment.jpeg';\n }\n default: {\n // This case is a placeholder for future attachment types - Flow will flag if we omit one\n // eslint-disable-next-line babel/no-unused-expressions\n (type: empty);\n throw new Error('Unsupported attachment type: ' + type);\n }\n }\n}", "getOriginalFilename () {\n if (!this.originalFilename) {\n this.originalFilename = this.getDoc().originalFilename\n }\n\n return this.originalFilename\n }", "get originalFileName() {\n return this._obj.originalFileName;\n }", "attachments() {\n return this._attachments;\n }", "function SendDownloadLinkToEmailOnSuccess(json) {\n //Blur input\n $('#modal-direct-upload-send-email-input').blur();\n\n //Error\n if (json.message === undefined) {\n $('#modal-upload-directly-complete-error-container').find('.alert-danger').html($('#modal-direct-upload-send-email-form').data(\"error\") + '<i class=\"glyphicon glyphicon-remove pull-right\"></i>');\n $('#modal-upload-directly-complete-error-container').css('display', '');\n }\n else {\n //Show message\n if (json.success) {\n $('#modal-upload-directly-complete-success-container').find('.alert-success').html(json.message + '<i class=\"glyphicon glyphicon-ok pull-right\"></i>');\n $('#modal-upload-directly-complete-success-container').css('display', '');\n }\n else {\n $('#modal-upload-directly-complete-error-container').find('.alert-danger').html(json.message + '<i class=\"glyphicon glyphicon-remove pull-right\"></i>');\n $('#modal-upload-directly-complete-error-container').css('display', '');\n }\n }\n\n //Set read only inputs\n $('#modal-direct-upload-send-email-input').prop('readonly', false);\n //Disable submit button\n $('#modal-direct-upload-send-email-btn').prop('disabled', false);\n\n //Reset formValidation\n $('#modal-direct-upload-send-email-form').data('formValidation').resetForm();\n //Reset form\n $('#modal-direct-upload-send-email-form').trigger(\"reset\");\n\n //Hide spinner\n $('#modal-direct-upload-send-email-spin').css('display', 'none');\n //Show text\n $('#modal-direct-upload-send-email-text').css('display', '');\n }", "function addFileFromUser(msgObj, isSelf, isLoad){\n // format:{\n // id: timeID,\n // state: \"ND\",\n // type: \"GRP\",\n // msg_budge: contact.msg_budge + 1,\n // contact_id: \"Concierge_\" + userSelf.email, // OR grpID\n // grpID: grpSelected.grpID,\n // from: userSelf.email,\n // to: grpSelected.grpUsers,\n // filePath: filePath,\n // fileIcon: fileIcon\n // };\n\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // For budge of message..\n var contact_id;\n if(!isLoad &&\n msgObj.contact_id != curConvId && msgObj.grpID != curConvId &&\n msgObj.type != \"BOT\") {\n contact_id = msgObj.contact_id != undefined ? msgObj.contact_id : msgObj.grpID;\n setMessageBudge(contact_id, msgObj.msg_budge);\n return;\n }\n\n if(!isLoad && !isSelf && msgObj.type != \"BOT\") {\n // Let server to reset its message budge..\n contact_id = msgObj.contact_id != undefined ? msgObj.contact_id : msgObj.grpID;\n var dataObj = {\n type: msgObj.type,\n email: userSelf.email,\n contact_id: contact_id\n };\n socket.emit(\"resetBudge\", dataObj);\n }\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n var msgType = isSelf?\"message-reply\":\"message-receive\";\n var msgHtml = $('<div><div class=\"message-info\">' +\n '<div class=\"msguser-info\">' +\n '<img src=\"/images/man.jpg\" class=\"user-avatar img-thumbnail\"></div>' +\n '<div class=\"message-username\">TEST1</div>' +\n '<a href=\"download?file=\" class=\"message-content-box\", style=\"background: transparent; box-shadow: 0px -1px 3px 1px #eeeeee; cursor: pointer;\">' +\n '<div class=\"arrow\"></div>' +\n '<div class=\"message-content\">test</div></a></div>' +\n '<div class=\"message-time\">13:01 22/7/2016</div></div>');\n\n // Get current time stamp..\n var timeStamp;\n if(!isLoad) {\n timeStamp = getTimeStamp();\n }\n else {\n timeStamp = getTimeStamp(msgObj.timestamp);\n }\n\n var msgInfo = {};\n if(isSelf) {\n msgInfo = {\n img: userSelf.img,\n username: userSelf.username\n }\n }\n else {\n if(msgObj.type == \"BOT\"){\n msgInfo = {\n img: \"/images/bot.png\",\n username: \"CHAT BOT\"\n };\n }\n else if(msgObj.type == \"CON\"){\n msgInfo = {\n img: \"/images/concierge.png\",\n username: \"Concierge\"\n };\n }\n else if(msgObj.type == \"ONE\") {\n for(var i = 0; i < contactList.length; i++) {\n if(contactList[i].email == msgObj.from) {\n msgInfo = {\n img: contactList[i].img,\n username: contactList[i].username\n };\n break;\n }\n }\n }\n else if(msgObj.type == \"GRP\") {\n var grpID;\n if(isLoad) {\n grpID = msgObj.conv_id;\n }\n else {\n grpID = msgObj.grpID;\n }\n\n for(var i = 0; i < grpList.length; i++) {\n if(grpList[i].grpID == grpID) {\n for(var j = 0; j < grpList[i].grpUsers.length; j++) {\n if (grpList[i].grpUsers[j].email == msgObj.from) {\n msgInfo = {\n img: grpList[i].grpUsers[j].img,\n username: grpList[i].grpUsers[j].username\n };\n break;\n }\n }\n }\n }\n }\n }\n\n var timeID = (new Date()).getTime();\n var fileID = msgObj.type + \"_\" + msgType + \"_file\" + timeID;\n msgHtml.addClass(msgType);\n msgHtml.children('.message-info').children('.msguser-info').children('.user-avatar').attr('src',msgInfo.img);\n msgHtml.children('.message-info').children('.msguser-info').children('.user-avatar').attr('title',msgInfo.username);\n msgHtml.children('.message-info').children('.message-username').text(msgInfo.username + \" sent:\");\n msgHtml.children('.message-info').children('.message-content-box').attr('href', \"download?file=\" + msgObj.filePath);\n msgHtml.children('.message-info').children('.message-content-box').children('.message-content').html(\"<img id='\" + fileID + \"' src='/images/icons/\" + msgObj.fileIcon + \"' style='max-height: 200px; max-width: 200px'>\" +\n \"<div style='font-size: 10px; text-align: right; color: #737272;'>Download file</div>\");\n\n msgHtml.children('.message-time').text(timeStamp);\n $('.msg-content').append(msgHtml);\n $(\".msg-content\").scrollTop($(\".msg-content\")[0].scrollHeight + 300);\n}", "async imageInput(turnContext) {\n\n // Prepare Promises to download each attachment and then execute each Promise.\n const promises = turnContext.activity.attachments.map(this.downloadAttachmentAndWrite);\n const successfulSaves = await Promise.all(promises);\n\n\n async function replyForReceivedAttachments(localAttachmentData) {\n\n // function for making for making asynchronous request \n async function asyncRequest(options) {\n return new Promise((resolve, reject) => {\n request(options, (error, response, body) => resolve({ error, response, body }));\n });\n }\n\n // function for making for making asynchronous request. (POST request)\n async function asyncRequestPost(options) {\n return new Promise((resolve, reject) => {\n request.post(options.url, {\n json: options\n }, (error, response, body) => resolve({ error, response, body }));\n });\n }\n\n // If image uploaded and save, start sending request to Azure for object and scene recognition\n if (localAttachmentData) {\n var imageUrl = './'+localAttachmentData.fileName\n console.log()\n const options = {\n uri: uriBase,\n qs: params,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/octet-stream',\n 'Ocp-Apim-Subscription-Key' : subscriptionKey\n },\n body: fs.readFileSync( imageUrl )\n };\n\n let response = await asyncRequest(options);\n let azureObject = JSON.parse(response.response.body)\n let caption = \"\";\n let tags = azureObject.description.tags;\n if (azureObject.description.captions.length > 0) {\n caption = azureObject.description.captions[0].text\n }\n\n //console.log(caption)\n //console.log(tags)\n\n /* after getting reponse from Azure, start sending request to poem generater API\n */\n let options_poem = {\n \"url\":\"http://localhost:5000/todo/api/v1.0/tasks\",\n \"inputString\":caption,\n \"inputTags\":tags,\n \"queryType\":\"Image\"\n };\n let response_poem = await asyncRequestPost(options_poem);\n //let jsonResponse_poem = JSON.stringify(response_poem.response.body.task, null, ' ')\n var printPoem = response_poem.response.body.task.poem.join(\"\\r\\n\")\n var printkeywords = response_poem.response.body.task.keywords.join(\"\\r\\n\")\n \n\n await this.sendActivity(`Keywords: \\n ${ printkeywords } ` )\n await this.sendActivity(`Poem: \\n ${ printPoem } ` )\n } else {\n await this.sendActivity('Attachment was not successfully saved to disk.');\n }\n }\n\n // Prepare Promises to reply to the user with information about saved attachments.\n // The current TurnContext is bound so `replyForReceivedAttachments` can also send replies.\n const replyPromises = successfulSaves.map(replyForReceivedAttachments.bind(turnContext));\n await Promise.all(replyPromises);\n }", "async function main(photo) {\r\n // Generate test SMTP service account from ethereal.email\r\n // Only needed if you don't have a real mail account for testing\r\n // let testAccount = await nodemailer.createTestAccount();\r\n\r\n // create reusable transporter object using the default SMTP transport\r\n let transporter = nodemailer.createTransport({\r\n service: \"gmail\",\r\n port: 587,\r\n auth: {\r\n user: \"[email protected]\",\r\n pass: \"lnermzumajbfvyyg\"\r\n }\r\n });\r\n\r\n // console.log(__dirname)\r\n\r\n Attachement = {\r\n\r\n filename: 'test.png',\r\n content: photo,\r\n encoding: 'base64' // optional, would be detected from the filename\r\n }\r\n\r\n // send mail with defined transport object\r\n let info = await transporter.sendMail({\r\n from: '\"Lesspensive.com\" <www.lesspensive.com>', // sender address\r\n to: '[email protected]', // list of receivers\r\n subject: 'Lesspensive Room Request', // Subject line\r\n text: 'A request has been sent by <a user>', // plain text body\r\n html: '<b>A request has been sent by a user</b>', // html body\r\n attachments: Attachement\r\n });\r\n\r\n console.log('Message sent: %s', info.messageId);\r\n // Message sent: <[email protected]>\r\n\r\n // Preview only available when sending through an Ethereal account\r\n console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));\r\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\r\n}", "function recieveMessages(message) {\n var reader = new FileReader();\n var activeChannelID = localStorage.getItem(\"activeChannel\")\n var channelID = message.channel.id;\n\n //Check if attachment is image\n function attachIsImage(msgAttach) {\n var url = msgAttach.url;\n if(url.endsWith(\".png\")) {return url.indexOf(\"png\", url.length - \"png\".length /*or 3*/) !== -1;}\n if(url.endsWith(\".jpg\")) {return url.indexOf(\"jpg\", url.length - \"jpg\".length /*or 3*/) !== -1;}\n if(url.endsWith(\".gif\")) {return url.indexOf(\"gif\", url.length - \"gif\".length /*or 3*/) !== -1;}\n }\n\n //If has image attachment then put the image url according to the attachment image\n if (message.attachments.size > 0) {\n if (message.attachments.every(attachIsImage)){\n var Attachment = (message.attachments).array();\n Attachment.forEach(function(attachment) {\n imageUrl = attachment.url\n })\n }\n }\n \n if(activeChannelID == channelID) {\n var message;\n var id = message.id\n var div = \"message-div-\" + id\n var avatar = message.author.displayAvatarURL;\n var tag = message.author.tag;\n var name; if(message.author.nickname == undefined) {name = message.author.username} else {name = message.author.nickname}\n\n //Replaces user mentions with their username instead \n if (message.content.includes(\"<@\")) {\n var mentionedID = message.content.split(/<@!?/).pop().split('>')[0];\n try {var userid = \"@\" + message.guild.members.get(mentionedID).user.tag} catch(error) {return;}\n var textWithMention = message.content.replace(/<@!?(\\d+)>/, userid)\n message = textWithMention\n } else {\n message = message.content\n }\n \n //Create the message div\n var messageDiv = document.createElement(\"div\")\n messageDiv.className = \"message-div\";\n messageDiv.id = div;\n document.getElementById('messages-field').appendChild(messageDiv);\n\n //Create avatar of the message author\n var MessageAvatar = document.createElement(\"img\");\n MessageAvatar.className = \"author-avatar\";\n MessageAvatar.src = avatar;\n MessageAvatar.title = tag;\n MessageAvatar.setAttribute(\"onclick\", \"window.open(\"+'\"'+avatar+'\"'+\", '_blank')\");\n document.getElementById(div).appendChild(MessageAvatar);\n\n //Create the author button\n var MessageAuthor = document.createElement(\"Button\");\n MessageAuthor.className = \"author-button\";\n MessageAuthor.innerHTML = name;\n MessageAuthor.title = tag;\n MessageAuthor.id = tag;\n document.getElementById(div).appendChild(MessageAuthor);\n\n //Create the message text\n var MessageContent = document.createElement(\"p\");\n MessageContent.className = \"text-message\";\n MessageContent.innerHTML = message;\n document.getElementById(div).appendChild(MessageContent);\n\n //If message has an image then send the image afterwards\n if(imageUrl != \"no-image\") {\n var messageAttachment = document.createElement(\"img\");\n messageAttachment.className = \"message-attachment\";\n messageAttachment.src = imageUrl;\n messageAttachment.setAttribute(\"onclick\", \"window.open(\"+'\"'+imageUrl+'\"'+\", '_blank')\");\n document.getElementById(div).appendChild(messageAttachment);\n }\n\n \n\n //Scroll to latest message on new message\n try {\n var element = document.getElementById(\"messages-field\");\n element.scrollTop = element.scrollHeight;\n } catch(err) {\n return;\n }\n } else {return;}\n}", "function imageUploaded(result) {\r\n var message = result.entry.name + \" created at \" + result.entry.created;\r\n var id = result.entry.id;\r\n notify(id, message);\r\n viewImage(result);\r\n}", "async function callMeme(msg) {\n try {\n\n var m = await memeReceived();\n\n console.log(m);\n\n msg.channel.send({files: [m.url]});\n\n } catch (error) {\n console.log(error)\n }\n }", "fileString() {\n return this.id + \" \" + this.type + \" \" + this.note + \" \" + this.amount;\n }", "_uploadImage(file) {\n if (!this._isImage(file)) {\n return;\n }\n\n const userFileAttachment = new RB.UserFileAttachment({\n caption: file.name,\n });\n\n userFileAttachment.save()\n .then(() => {\n this.insertLine(\n `![Image](${userFileAttachment.get('downloadURL')})`);\n\n userFileAttachment.set('file', file);\n userFileAttachment.save()\n .catch(err => alert(err.message));\n })\n .catch(err => alert(err.message));\n }", "_appendAttachment({ id, filename, content }) {\n const renderedPromise = this._renderedCapability.promise;\n\n renderedPromise.then(() => {\n if (renderedPromise !== this._renderedCapability.promise) {\n return; // The FileAttachment annotation belongs to a previous document.\n }\n let attachments = this._attachments;\n\n if (!attachments) {\n attachments = Object.create(null);\n } else {\n for (const name in attachments) {\n if (id === name) {\n return; // Ignore the new attachment if it already exists.\n }\n }\n }\n attachments[id] = {\n filename,\n content,\n };\n this.render({\n attachments,\n keepRenderedCapability: true,\n });\n });\n }", "function saveEditorToFile(filename)\n{\n var jqxhr = $.post( \"AmandaJS/saveEditor.php\", { editorValue: functionEditor.getValue(), fileName: filename })\n .done(function(data) {\n if(data.lastIndexOf(\"OK:\", 0) === 0)\n {\n uploadedFileUrl = \"http://\"+data.substring(3);//Without 'OK:' at the start of the string.\n\n //Download file via hidden iFrame\n document.getElementById('downloader').src = uploadedFileUrl;\n showInfo(\"<b>Saved File</b><br>Check your downloads.\")\n console.log(uploadedFileUrl);\n }\n else\n {\n showError(\"Something went wrong saving the file to our servers..\");\n }\n })\n .fail(function() {\n showError(\"Something went wrong saving the file to our servers..\");\n });\n}", "async function addAttachmentModel() {\n const attachmentModel = document.querySelector('.attachment-model');\n attachmentModel.style.display = \"block\";\n document.querySelector(\"#attachment\").addEventListener(\"change\", function () {\n const fileReader = new FileReader();\n //Once the file is read store its content in the localStorage\n fileReader.addEventListener(\"load\", () => {\n imageData = fileReader.result;\n console.log(imageData);\n document.querySelector(\"#attachment-image\").src = imageData;\n });\n // Read the selected file as text\n fileReader.readAsDataURL(this.files[0]);\n });\n}", "function sendFile(){\n\t\t//TODO: remove temp file: fs.unlink(resource.path);\n\t\t\n\t\tdone({\n \t\t\turl: 'images/' + resource.name,\n \t\t\tfile: resource.name\n \t\t});\n\t}", "function uploaded(err, data, response) {\n var id = data.media_id_string;\n var picTweet = {\n status: 'Here is a picture I drew! Yay!',\n media_ids: [id]\n }\n T.post('statuses/update', picTweet, picFunc);\n\n // Function for T.post. Checks for error\n function picFunc(err, data, response) {\n if(err) {\n console.log(\"Unable to tweet image!\");\n } else {\n console.log(\"Image succesfully tweeted!\");\n }\n }\n }", "async show({ response, params }) {\n Logger.debug(\"[File] Showing file\");\n\n // The server is not handling the s3 stream correctly, so we must handle the request ourselves\n response.implicitEnd = false;\n\n // Decode id and fetch it from the database\n const hashedId = params.id;\n if (!hashedId) throw new IdRequiredException();\n const fileRecord = await File.findByHashedId(hashedId);\n\n // Downloading the file to the client\n await Storage.download(response, fileRecord);\n\n // Sending a notification to the uploader (if applicable)\n Notifications.notify(hashedId);\n\n // Creating a log\n await Log.create({ type: GET_FILE, file_id: fileRecord.id });\n Logger.debug(`[Show] Successfully Showed ${fileRecord.clientFileName}`);\n }" ]
[ "0.6406462", "0.6172073", "0.6062147", "0.6062147", "0.6020556", "0.5929268", "0.5841937", "0.5737819", "0.5737073", "0.5737073", "0.5734843", "0.56917673", "0.56610465", "0.5645517", "0.5584695", "0.5542011", "0.55292356", "0.54726654", "0.54699534", "0.5462597", "0.5378199", "0.535957", "0.5308587", "0.53016466", "0.5289799", "0.5286821", "0.5269191", "0.5255925", "0.52257466", "0.5212393", "0.5207559", "0.51984966", "0.51954216", "0.51690686", "0.5157493", "0.5157493", "0.5148122", "0.513651", "0.51328874", "0.5119995", "0.51155066", "0.5110248", "0.5106449", "0.50993145", "0.5099307", "0.50898546", "0.50870943", "0.50870943", "0.5081564", "0.5073712", "0.50585896", "0.5053678", "0.5044398", "0.5034373", "0.5017927", "0.50159425", "0.50090635", "0.50068665", "0.50068665", "0.5003479", "0.49996105", "0.49996105", "0.4999047", "0.4999047", "0.49950635", "0.49860385", "0.4985425", "0.49831733", "0.49785814", "0.49773163", "0.49718344", "0.49704766", "0.49695763", "0.49672458", "0.49598357", "0.49554724", "0.49548203", "0.4954448", "0.49497694", "0.49368858", "0.4920334", "0.4905041", "0.4899504", "0.48963302", "0.4895744", "0.48944902", "0.48901007", "0.4881516", "0.48767468", "0.4875182", "0.4874706", "0.4861036", "0.48588103", "0.48551092", "0.48550028", "0.4848415", "0.48405737", "0.48370844", "0.4826793", "0.48237705" ]
0.64615303
0
Returns an inline attachment.
getInlineAttachment() { const imageData = fs.readFileSync(path.join(__dirname, '../resources/architecture-resize.png')); const base64Image = Buffer.from(imageData).toString('base64'); return { name: 'architecture-resize.png', contentType: 'image/png', contentUrl: `data:image/png;base64,${ base64Image }` }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInlineImg(message){\n var attachments = message.getAttachments({\n includeInlineImages: true,\n includeAttachments: false\n });\n \n return attachments;\n}", "get inlineContent() {\n return this.type.inlineContent;\n }", "get attachment () {\n\t\treturn this._attachment;\n\t}", "getById(id) {\r\n return new Attachment(this, id);\r\n }", "get attachment() {\n\t\treturn this.__attachment;\n\t}", "get inline() {\n return this._inline;\n }", "get inline() {\n return this._inline;\n }", "function attach_inline(index, filename)\n{\n\tinsert_text('[attachment=' + index + ']' + filename + '[/attachment]');\n\tdocument.forms[form_name].elements[text_name].focus();\n}", "getInternetAttachment() {\n // NOTE: The contentUrl must be HTTPS.\n return {\n name: 'architecture-resize.png',\n contentType: 'image/png',\n contentUrl: 'https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize.png'\n };\n }", "get selectedAttachment() {\n let selectedElement = this._widget.selectedItem;\n if (selectedElement) {\n return this._itemsByElement.get(selectedElement).attachment;\n }\n return null;\n }", "handleAttachmentMessage() {\n let response;\n\n // Get the attachment\n let attachment = this.webhookEvent.message.attachments[0];\n //console.log(\"Received attachment:\", `${attachment} for ${this.user.psid}`);\n\n response = Response.genQuickReply(i18n.__(\"fallback.attachment\"), [\n {\n title: i18n.__(\"menu.start_over\"),\n payload: \"GET_STARTED\"\n }\n ]);\n\n return response;\n }", "embed(filePath, cid, options) {\n this.nodeMailerMessage.attachments = this.nodeMailerMessage.attachments || [];\n this.nodeMailerMessage.attachments.push({\n path: filePath,\n cid,\n ...options,\n });\n return this;\n }", "get pAttachment() {\n\t\treturn this.__pAttachment;\n\t}", "get inline() {\n return this.args.inline || false;\n }", "function replyInline( data ) {\n\tconst description = verifyData( data.description )\n\n\treturn {\n\t\tid: data.id,\n\t\ttitle: '[' + data.type.toUpperCase() + '] ' + data.title,\n\t\ttype: 'article',\n\t\tinput_message_content: {\n\t\t\tmessage_text: replyMarkdown( data ),\n\t\t\tparse_mode: 'Markdown',\n\t\t\tdisable_web_page_preview: false\n\t\t},\n\t\treply_markup: replyButton( data.type, data.title ),\n\t\tdescription: description,\n\t\tthumb_url: data.cover\n\t}\n}", "get attachments() {\n return this._attachments;\n }", "attachments() {\n return this._attachments;\n }", "get attachments() {\n return this.items.map(e => e.attachment);\n }", "getByName(name) {\r\n const f = new AttachmentFile(this);\r\n f.concat(`('${name}')`);\r\n return f;\r\n }", "get attachmentFiles() {\r\n return new AttachmentFiles(this);\r\n }", "attachmentWithText(text, fileName) {\n return { text, fileName };\n }", "function fetch() {\n\t\n\t if (!filenames.length) {\n\t return null;\n\t }\n\t\n\t var filename = filenames.pop();\n\t var att = atts[filename];\n\t var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n\t '?rev=' + doc._rev;\n\t return ajaxPromise(opts, {\n\t method: 'GET',\n\t url: genDBUrl(host, path),\n\t binary: true\n\t }).then(function (blob) {\n\t if (opts.binary) {\n\t return blob;\n\t }\n\t return new PouchPromise(function (resolve) {\n\t blobToBase64(blob, resolve);\n\t });\n\t }).then(function (data) {\n\t delete att.stub;\n\t delete att.length;\n\t att.data = data;\n\t });\n\t }", "_appendAttachment({ id, filename, content }) {\n const renderedPromise = this._renderedCapability.promise;\n\n renderedPromise.then(() => {\n if (renderedPromise !== this._renderedCapability.promise) {\n return; // The FileAttachment annotation belongs to a previous document.\n }\n let attachments = this._attachments;\n\n if (!attachments) {\n attachments = Object.create(null);\n } else {\n for (const name in attachments) {\n if (id === name) {\n return; // Ignore the new attachment if it already exists.\n }\n }\n }\n attachments[id] = {\n filename,\n content,\n };\n this.render({\n attachments,\n keepRenderedCapability: true,\n });\n });\n }", "function mmCreateUrlAttachment(attachment) {\n let type = $(attachment).data(\"type\");\n let id = $(attachment).data(\"id\");\n let $img = $(attachment).find(\".attachment-preview img\"),\n url = $img.data(\"src\"),\n urlmax = url.replace(/-150/g, \"\"),\n title = $img.attr(\"alt\"),\n max = $img.data(\"max\"),\n size = $img.data(\"size\"),\n sizes = $img.data(\"sizes\").toString(),\n align = $img.data(\"align\") || \"center\",\n textAlt = $img.attr(\"alt\") || \"\",\n proAlt = (textAlt!=null && textAlt.length>0)?`alt=\"${textAlt}\"`:\"\";\n textTitle = $img.data(\"title\") || \"\",\n proTitle = (textTitle!=null && textTitle.length>0)?`title=\"${textTitle}\"`:\"\";\n textCaption = $img.data(\"caption\") || \"\",\n tagCaption = (textCaption!=null && textCaption.length>0)?`<figcaption class=\"caption\">${textCaption}</figcaption>`:\"\";\n rs = '';\n switch (type) {\n case 'file':\n rs = `<a href=\"${url}\" title=\"${title}\">${url}</a>`;\n break;\n case 'image':\n let sizesArr = sizes.split(\",\"),\n srcset = [],\n srcsetSizes = [],\n cssAlign = \"\";\n cssAlign = (align == \"center\") ? `style=\"display: block; margin-left: auto; margin-right: auto; text-align:center;\"` : cssAlign;\n cssAlign = (align == \"right\") ? `style=\"float: right; text-align:right;\"` : cssAlign;\n sizesArr.forEach(s => {\n if (s <= size) {\n url = (s == max) ? urlmax : url.replace(/-150\\./g, `-${s}.`);\n srcset.push(`${url} ${s}w`);\n srcsetSizes.push(`${s}px`);\n }\n });\n urlmax = (size == max) ? urlmax : url.replace(/-150\\./g, `-${size}.`);\n rs = `<figure id=\"smsci-${id}\" class=\"sm-single-content-image\" ${cssAlign}>`;\n rs += `<img ${proAlt} ${proTitle} srcset=\"${srcset.join()}\" sizes=\"(max-width: ${size}px) ${srcsetSizes.join(\",\")}\" src=\"${urlmax}\" width=\"${size}\"/>`;\n rs += (tagCaption.length > 0) ? tagCaption : \"\";\n rs += \"</figure>\";\n break;\n default:\n console.log(\"wrong attachment type\");\n break;\n }\n return rs.trim();\n}", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function getAttachmentBase64(grAttachment /* GlideRecord of the attachment */) {\n\tvar gsa = new GlideSysAttachment();\n\tvar attBytes = gsa.getBytes(grAttachment); //Gets it as a Java Binary Array, not useable yet\n\tvar attBase64 = GlideStringUtil.base64Encode(attBytes); //Converts it into a Javascript string, holding the contents as a Base6-encoded string\n\t\n\treturn attBase64;\n}", "function fetch(filename) {\n\t var att = atts[filename];\n\t var path$$1 = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n\t '?rev=' + doc._rev;\n\t return ajaxPromise(opts, {\n\t method: 'GET',\n\t url: genDBUrl(host, path$$1),\n\t binary: true\n\t }).then(function (blob) {\n\t if (opts.binary) {\n\t return blob;\n\t }\n\t return new PouchPromise(function (resolve) {\n\t blobToBase64(blob, resolve);\n\t });\n\t }).then(function (data) {\n\t delete att.stub;\n\t delete att.length;\n\t att.data = data;\n\t });\n\t }", "function getAttachment(bot, msg, messageLang) {\r\n\tvar patentId = msg.text.toString().toLowerCase().replace('/download', '');\r\n\tif (patentId && typeof patentId != 'undefined') {\r\n\t\tif (usersLog[msg.from.username] && usersLog[msg.from.username].lastResult) {\r\n\t\t\ttry{\r\n\t\t\t\tif (usersLog[msg.from.username].lastResult[0][patentId]) {\r\n\t\t\t\t\tbot.sendDocument(msg.chat.id, usersLog[msg.from.username].lastResult[0][patentId].attachment, {\r\n\t\t\t\t\t\t\"caption\": '*' + languageBase[messageLang].attachmentCaption + '* ' + usersLog[msg.from.username].lastResult[0][patentId].desc,\r\n\t\t\t\t\t\t\"parse_mode\": 'Markdown'\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar message = languageBase[messageLang].attachmentNotFound[0] + patentId + languageBase[messageLang].attachmentNotFound[1];\r\n\t\t\t\t\tbot.sendMessage(msg.chat.id,message);\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\tconsole.log(e);\r\n\t\t\t\tbot.sendMessage(msg.chat.id,languageBase[messageLang].attachmentError);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tbot.sendMessage(msg.chat.id, languageBase[messageLang].attachmentWarning, {\r\n\t\t\t\t\"parse_mode\": 'Markdown'\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tbot.sendMessage(msg.chat.id,languageBase[messageLang].cmdError);\r\n\t} \r\n}", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob$$1) {\n if (opts.binary) {\n return blob$$1;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob$$1, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob$$1) {\n if (opts.binary) {\n return blob$$1;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob$$1, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new Promise(function (resolve) {\n pouchdbBinaryUtils.blobOrBufferToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function adoptToHTML(attachment, displaySettings) {\n var content = attachment.url,\n url = attachment.url,\n type = attachment.type,\n link = '',\n linkHtml = '',\n classes = '',\n dataTypeContent = 'data-media-content=\"wpdt-media-content\"',\n attrs = 'style=\"max-width: 100%; height: auto;\"',\n isEmbed = false;\n\n if (attachment) {\n if (attachment.sizes) {\n if (attachment.sizes[displaySettings.size]) {\n url = attachment.sizes[displaySettings.size].url;\n classes += ' align' + displaySettings.align + ' size-' + displaySettings.size;\n }\n if (attachment.sizes['full']) {\n fullUrl = attachment.sizes['full'].url;\n }\n }\n if (type == 'image') {\n attrs = 'width=\"' + attachment.sizes[displaySettings.size].width + '\" height=\"' + attachment.sizes[displaySettings.size].width + '\"';\n }\n switch (displaySettings.link) {\n case 'file':\n link = attachment.url;\n linkHtml = '<a ' + dataTypeContent + ' href=\"' + link + '\">' + attachment.title + '</a>';\n break;\n case 'post':\n link = attachment.link;\n linkHtml = '<a ' + dataTypeContent + ' href=\"' + link + '\">' + attachment.title + '</a>';\n break;\n case 'custom':\n link = displaySettings.linkUrl;\n break;\n case 'embed':\n isEmbed = true;\n break;\n default:\n break;\n }\n }\n switch (type) {\n case 'image':\n content = '<img ' + dataTypeContent + ' src=\"' + url + '\" class=\"' + classes + '\" ' + attrs + '\" />';\n if (link) {\n content = '<a href=\"' + link + '\">' + content + '</a>';\n }\n break;\n case 'video':\n if (isEmbed) {\n content = '<div ' + dataTypeContent + ' class=\"video-container\"><video controls>';\n content += '<source src=\"' + url + '\" ' +\n (typeof attachment.mime != 'undefined' ? 'type=\"' + attachment.mime + '\"' : '') + '>';\n content += '</video></div>';\n } else if (linkHtml) {\n content = linkHtml;\n }\n break;\n case 'audio':\n if (isEmbed) {\n content = '<div ' + dataTypeContent + ' class=\"audio-container\"><audio controls>';\n content += '<source src=\"' + url + '\" ' +\n (typeof attachment.mime != 'undefined' ? 'type=\"' + attachment.mime + '\"' : '') + '>';\n content += '</audio></div>';\n } else if (linkHtml) {\n content = linkHtml;\n }\n break;\n case 'application':\n if (linkHtml) {\n content = linkHtml;\n }\n break;\n default:\n if (attachment.mime === 'text/csv') {\n if (linkHtml) {\n content = linkHtml;\n }\n }\n break;\n }\n\n return content;\n\n }", "get isInline() {\n return this.type.isInline;\n }", "function loadAttachment(client, addr, pass, key, id, uti) {\n\tvar iv = crypto.randomBytes(8).toString('hex');\n\n\tclient.emit('attachmentGet', id,\n\t\t'http://' + addr + ':8735/attachment?id=' + encrypt(id, key, iv) + '&password=' + encrypt(pass, key, iv) + '&iv=' + iv, uti);\n}", "function mailShowAttachments(){\n\tdocument.getElementById('mailAttachmentsDivId').style.display = \"inline\";\n\tdocument.getElementById('mailAttachmentsDivId').style.visibility = \"visible\";\n\tpositionContainerAbsolut(\"mailAttachmentsDivId\",\"CENTER\",\"CENTER\",1,1,1,1);\n}", "function getAttachmentString (grAttachment /* GlideRecord of the attachment */) {\n\tvar gsa = new GlideSysAttachment();\n\tvar attBytes = gsa.getBytes(grAttachment); //Gets it as a Java Binary Array, not useable yet\n\tvar attJavaString = Packages.java.lang.String(fileBytes); //Convert the bytes array to a Java-Rhino string\n\tvar attString = String(attJavaString); //We don't trust Rhino, convert it into a Javascript string\n\t\n\treturn attString;\n}", "function attachmentHandler (id, atts, user) {\n // For now just send a message that says that we don't handle attachments.\n return m.attachmentDefaultAnswer(id);\n}", "function TinyMCE_advanced_getInsertAttachmentTemplate() {\n var template = new Array();\n\n template['file'] = 'attachment.htm';\n template['width'] = 300;\n template['height'] = 150;\n\n // Language specific width and height addons\n template['width'] += tinyMCE.getLang('lang_insert_attachment_delta_width', 0);\n template['height'] += tinyMCE.getLang('lang_insert_attachment_delta_height', 0);\n\n return template;\n}", "function mmCreateDetail($attachment) {\n var id = $attachment.attr(\"data-id\"),\n ajaxUrl = `/${dashboard}/media/info/${id}`;\n $.ajax({\n type: \"GET\",\n url: ajaxUrl,\n success: function(rs) {\n if (rs.code == 1) {\n var curSize = $attachment.find(\".attachment-preview img\").attr(\"data-size\");\n $attachment.closest(\".mediaModal\").find(\".mmcb-detail\").html(mmCreateDetailDom(rs.data, curSize));\n }\n }\n });\n}", "function getAttachmentFromName(doc, attachmentName, mediaRelativePath, documentSource){\n\tvar att = null;\n\t\n\tif( doc\n\t && doc.nunaliit_attachments\n\t && doc.nunaliit_attachments.files\n\t && doc.nunaliit_attachments.files[attachmentName] ) {\n\t\t\n\t\tatt = new Attachment({\n\t\t\tdoc: doc\n\t\t\t,attName: attachmentName\n\t\t\t,mediaRelativePath: mediaRelativePath\n\t\t\t,documentSource: documentSource\n\t\t});\n\t};\n\t\n\treturn att;\n}", "createAttachmentsModel(options) {\n return new attachments_1.AttachmentsModel(options);\n }", "async function addAttachmentModel() {\n const attachmentModel = document.querySelector('.attachment-model');\n attachmentModel.style.display = \"block\";\n document.querySelector(\"#attachment\").addEventListener(\"change\", function () {\n const fileReader = new FileReader();\n //Once the file is read store its content in the localStorage\n fileReader.addEventListener(\"load\", () => {\n imageData = fileReader.result;\n console.log(imageData);\n document.querySelector(\"#attachment-image\").src = imageData;\n });\n // Read the selected file as text\n fileReader.readAsDataURL(this.files[0]);\n });\n}", "function addAttachmentRow(container, attachment) {\n var attachmentLink = createAnchorTag(attachment.text, attachment.href, attachment.download);\n attachmentLink.classList.add('attachment');\n container.appendChild(attachmentLink);\n\n // Attach an author and a timestamp. We'll have the timestamp be a comment permalink, since\n // other parts in this script provide us with that functionality.\n\n var attachmentExtraInfo = document.createElement('div');\n\n attachmentExtraInfo.appendChild(document.createTextNode(attachment.author + ' on '));\n\n var attachmentCommentLink = createAnchorTag(attachment.time, null);\n attachmentCommentLink.classList.add('attachment-comment-link');\n attachmentCommentLink.onclick = highlightComment.bind(null, attachment.commentId);\n\n attachmentExtraInfo.appendChild(attachmentCommentLink)\n container.appendChild(attachmentExtraInfo);\n\n return container;\n}", "embedData(content, cid, options) {\n if (this.deferred) {\n throw new Error('Cannot attach raw data when using \"Mail.sendLater\" method');\n }\n this.nodeMailerMessage.attachments = this.nodeMailerMessage.attachments || [];\n this.nodeMailerMessage.attachments.push({\n content,\n cid,\n ...options,\n });\n return this;\n }", "async function showAttachmentsModel() {\n if (currentAdmission.attachments.length != 0) {\n const editDeleteAttachmentsModel = document.querySelector('.edit-delete-attachments-model');\n editDeleteAttachmentsModel.style.display = \"block\";\n const attachmentsList = document.querySelector('.attachments-list');\n const attachmentsListHTML = currentAdmission.attachments.map((att, index) => {\n return `<tr>\n <td style=\"padding: 10px 20px;\"><img class=\"filed\" src=\"${att}\" style=\"max-height: 200px\"/></td>\n <td style=\"padding: 10px 20px;\"><button class=\"btn action-btn red\" onclick=\"deleteAttachment(${index})\">Delete</button></td>\n </tr>`\n }).join('\\n');\n attachmentsList.innerHTML = attachmentsListHTML;\n } else\n alert('There are no attachments to be edited!')\n}", "function InlineDialog(items, identifier, url, options) {\n options = options || [];\n\n if (options.hasOwnProperty('onTop')) {\n onTopDeprecationLogger();\n if (options.onTop && options.gravity === undefined) {\n options.gravity = 's';\n }\n }\n\n // attempt to generate a random identifier if it doesn't exist\n if (typeof identifier === 'undefined') {\n identifier = String(Math.random()).replace('.', '');\n\n // if the generated supplied identifier already exists when combined with the prefixes we'll be using, then bail\n if ((0, _jquery2.default)('#inline-dialog-' + identifier + ', #arrow-' + identifier + ', #inline-dialog-shim-' + identifier).length) {\n throw 'GENERATED_IDENTIFIER_NOT_UNIQUE';\n }\n }\n\n var escapedIdentifier = (0, _css2.default)(identifier);\n\n var opts = _jquery2.default.extend(false, InlineDialog.opts, options);\n if (opts.gravity === 'w') {\n // TODO Once support for gravity: 'e' is added, it should also\n // transpose the defaults for offsetX and offsetY.\n opts.offsetX = options.offsetX === undefined ? 10 : options.offsetX;\n opts.offsetY = options.offsetY === undefined ? 0 : options.offsetY;\n }\n\n var hash;\n var hideDelayTimer;\n var showTimer;\n var beingShown = false;\n var shouldShow = false;\n var contentLoaded = false;\n var mousePosition;\n var targetPosition;\n var popup = (0, _jquery2.default)('<div id=\"inline-dialog-' + identifier + '\" class=\"aui-inline-dialog\"><div class=\"aui-inline-dialog-contents contents\"></div><div id=\"arrow-' + identifier + '\" class=\"aui-inline-dialog-arrow arrow aui-css-arrow\"></div></div>');\n\n var arrow = (0, _jquery2.default)('#arrow-' + escapedIdentifier, popup);\n var contents = popup.find('.contents');\n\n if (!opts.displayShadow) {\n contents.addClass('aui-inline-dialog-no-shadow');\n }\n\n if (opts.autoWidth) {\n contents.addClass('aui-inline-dialog-auto-width');\n } else {\n contents.width(opts.width);\n }\n\n contents.on({\n mouseenter: function mouseenter() {\n clearTimeout(hideDelayTimer);\n popup.unbind('mouseenter');\n },\n mouseleave: function mouseleave() {\n hidePopup();\n }\n });\n\n var getHash = function getHash() {\n if (!hash) {\n hash = {\n popup: popup,\n hide: function hide() {\n hidePopup(0);\n },\n id: identifier,\n show: function show() {\n showPopup();\n },\n persistent: opts.persistent ? true : false,\n reset: function reset() {\n\n function drawPopup(popup, positions) {\n //Position the popup using the left and right parameters\n popup.css(positions.popupCss);\n\n arrow.removeClass('aui-bottom-arrow aui-left-arrow aui-right-arrow');\n if (positions.gravity === 's' && !arrow.hasClass('aui-bottom-arrow')) {\n arrow.addClass('aui-bottom-arrow');\n } else if (positions.gravity === 'w') {\n arrow.addClass('aui-left-arrow');\n } else if (positions.gravity === 'e') {\n arrow.addClass('aui-right-arrow');\n }\n // Default styles are for 'n' gravity.\n\n arrow.css(positions.arrowCss);\n }\n\n //DRAW POPUP\n var viewportHeight = (0, _jquery2.default)(window).height();\n var popupMaxHeight = Math.round(viewportHeight * 0.75);\n popup.children('.aui-inline-dialog-contents').css('max-height', popupMaxHeight);\n\n var positions = opts.calculatePositions(popup, targetPosition, mousePosition, opts);\n if (positions.hasOwnProperty('displayAbove')) {\n displayAboveDeprecationLogger();\n positions.gravity = positions.displayAbove ? 's' : 'n';\n }\n\n drawPopup(popup, positions);\n\n // reset position of popup box\n popup.fadeIn(opts.fadeTime, function () {\n // once the animation is complete, set the tracker variables\n // beingShown = false; // is this necessary? Maybe only the shouldShow will have to be reset?\n });\n\n if ((0, _browser.needsLayeringShim)()) {\n // iframeShim, prepend if it doesnt exist\n var jQueryCache = (0, _jquery2.default)('#inline-dialog-shim-' + escapedIdentifier);\n if (!jQueryCache.length) {\n (0, _jquery2.default)(popup).prepend((0, _jquery2.default)('<iframe class = \"inline-dialog-shim\" id=\"inline-dialog-shim-' + identifier + '\" frameBorder=\"0\" src=\"javascript:false;\"></iframe>'));\n }\n // adjust height and width of shim according to the popup\n jQueryCache.css({\n width: contents.outerWidth(),\n height: contents.outerHeight()\n });\n }\n }\n };\n }\n return hash;\n };\n\n var showPopup = function showPopup() {\n if (popup.is(':visible')) {\n return;\n }\n showTimer = setTimeout(function () {\n if (!contentLoaded || !shouldShow) {\n return;\n }\n opts.addActiveClass && (0, _jquery2.default)(items).addClass('active');\n beingShown = true;\n if (!opts.persistent) {\n bindHideEvents();\n }\n InlineDialog.current = getHash();\n (0, _jquery2.default)(document).trigger('showLayer', ['inlineDialog', getHash()]);\n // retrieve the position of the click target. The offsets might be different for different types of targets and therefore\n // either have to be customisable or we will have to be smarter about calculating the padding and elements around it\n\n getHash().reset();\n }, opts.showDelay);\n };\n\n var hidePopup = function hidePopup(delay) {\n // do not auto hide the popup if persistent is set as true\n if (typeof delay === 'undefined' && opts.persistent) {\n return;\n }\n if (typeof popup.get(0)._datePickerPopup !== 'undefined') {\n // AUI-2696 - This inline dialog is host to a date picker... so we shouldn't close it.\n return;\n }\n\n shouldShow = false;\n // only exectute the below if the popup is currently being shown\n // and the arbitrator callback gives us the green light\n if (beingShown && opts.preHideCallback.call(popup[0].popup)) {\n delay = delay == null ? opts.hideDelay : delay;\n clearTimeout(hideDelayTimer);\n clearTimeout(showTimer);\n // store the timer so that it can be cleared in the mouseenter if required\n //disable auto-hide if user passes null for hideDelay\n if (delay != null) {\n hideDelayTimer = setTimeout(function () {\n unbindHideEvents();\n opts.addActiveClass && (0, _jquery2.default)(items).removeClass('active');\n popup.fadeOut(opts.fadeTime, function () {\n opts.hideCallback.call(popup[0].popup);\n });\n beingShown = false;\n shouldShow = false;\n (0, _jquery2.default)(document).trigger('hideLayer', ['inlineDialog', getHash()]);\n InlineDialog.current = null;\n if (!opts.cacheContent) {\n //if not caching the content, then reset the\n //flags to false so as to reload the content\n //on next mouse hover.\n contentLoaded = false;\n contentLoading = false;\n }\n }, delay);\n }\n }\n };\n\n // the trigger is the jquery element that is triggering the popup (i.e., the element that the mousemove event is bound to)\n var initPopup = function initPopup(e, trigger) {\n var $trigger = (0, _jquery2.default)(trigger);\n\n opts.upfrontCallback.call({\n popup: popup,\n hide: function hide() {\n hidePopup(0);\n },\n id: identifier,\n show: function show() {\n showPopup();\n }\n });\n\n popup.each(function () {\n if (typeof this.popup !== 'undefined') {\n this.popup.hide();\n }\n });\n\n //Close all other popups if neccessary\n if (opts.closeOthers) {\n (0, _jquery2.default)('.aui-inline-dialog').each(function () {\n !this.popup.persistent && this.popup.hide();\n });\n }\n\n //handle programmatic showing where there is no event\n targetPosition = { target: $trigger };\n if (!e) {\n mousePosition = { x: $trigger.offset().left, y: $trigger.offset().top };\n } else {\n mousePosition = { x: e.pageX, y: e.pageY };\n }\n\n if (!beingShown) {\n clearTimeout(showTimer);\n }\n shouldShow = true;\n var doShowPopup = function doShowPopup() {\n contentLoading = false;\n contentLoaded = true;\n opts.initCallback.call({\n popup: popup,\n hide: function hide() {\n hidePopup(0);\n },\n id: identifier,\n show: function show() {\n showPopup();\n }\n });\n showPopup();\n };\n // lazy load popup contents\n if (!contentLoading) {\n contentLoading = true;\n if (_jquery2.default.isFunction(url)) {\n // If the passed in URL is a function, execute it. Otherwise simply load the content.\n url(contents, trigger, doShowPopup);\n } else {\n //Retrive response from server\n _jquery2.default.get(url, function (data, status, xhr) {\n //Load HTML contents into the popup\n contents.html(opts.responseHandler(data, status, xhr));\n //Show the popup\n contentLoaded = true;\n opts.initCallback.call({\n popup: popup,\n hide: function hide() {\n hidePopup(0);\n },\n id: identifier,\n show: function show() {\n showPopup();\n }\n });\n showPopup();\n });\n }\n }\n // stops the hide event if we move from the trigger to the popup element\n clearTimeout(hideDelayTimer);\n // don't trigger the animation again if we're being shown\n if (!beingShown) {\n showPopup();\n }\n return false;\n };\n\n popup[0].popup = getHash();\n\n var contentLoading = false;\n var added = false;\n var appendPopup = function appendPopup() {\n if (!added) {\n (0, _jquery2.default)(opts.container).append(popup);\n added = true;\n }\n };\n var $items = (0, _jquery2.default)(items);\n\n if (opts.onHover) {\n if (opts.useLiveEvents) {\n // We're using .on() to emulate the behaviour of .live() here. on() requires the jQuery object to have\n // a selector - this is actually how .live() is implemented in jQuery 1.7+.\n // Note that .selector is deleted in jQuery 1.9+.\n // This means that jQuery objects created by selection eg $(\".my-class-selector\") will work, but\n // object created by DOM parsing eg $(\"<div class='.my-class'></div>\") will not work.\n // Ideally we should throw an error if the $items has no selector but that is backwards incompatible,\n // so we warn and do a no-op - this emulates the behaviour of live() but has the added warning.\n if ($items.selector) {\n (0, _jquery2.default)(document).on('mouseenter', $items.selector, function (e) {\n appendPopup();\n initPopup(e, this);\n }).on('mouseleave', $items.selector, function () {\n hidePopup();\n });\n } else {\n logger.log('Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.');\n }\n } else {\n $items.on({\n mouseenter: function mouseenter(e) {\n appendPopup();\n initPopup(e, this);\n },\n mouseleave: function mouseleave() {\n hidePopup();\n }\n });\n }\n } else {\n if (!opts.noBind) {\n //Check if the noBind option is turned on\n if (opts.useLiveEvents) {\n // See above for why we filter by .selector\n if ($items.selector) {\n (0, _jquery2.default)(document).on('click', $items.selector, function (e) {\n appendPopup();\n if (shouldCloseOnTriggerClick()) {\n popup.hide();\n } else {\n initPopup(e, this);\n }\n return false;\n }).on('mouseleave', $items.selector, function () {\n hidePopup();\n });\n } else {\n logger.log('Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.');\n }\n } else {\n $items.on('click', function (e) {\n appendPopup();\n if (shouldCloseOnTriggerClick()) {\n popup.hide();\n } else {\n initPopup(e, this);\n }\n return false;\n }).on('mouseleave', function () {\n hidePopup();\n });\n }\n }\n }\n\n var shouldCloseOnTriggerClick = function shouldCloseOnTriggerClick() {\n return beingShown && opts.closeOnTriggerClick;\n };\n\n var bindHideEvents = function bindHideEvents() {\n bindHideOnExternalClick();\n bindHideOnEscPressed();\n };\n\n var unbindHideEvents = function unbindHideEvents() {\n unbindHideOnExternalClick();\n unbindHideOnEscPressed();\n };\n\n // Be defensive and make sure that we haven't already bound the event\n var hasBoundOnExternalClick = false;\n var externalClickNamespace = identifier + '.inline-dialog-check';\n\n /**\n * Catch click events on the body to see if the click target occurs outside of this popup\n * If it does, the popup will be hidden\n */\n var bindHideOnExternalClick = function bindHideOnExternalClick() {\n if (!hasBoundOnExternalClick) {\n (0, _jquery2.default)('body').bind('click.' + externalClickNamespace, function (e) {\n var $target = (0, _jquery2.default)(e.target);\n // hide the popup if the target of the event is not in the dialog\n if ($target.closest('#inline-dialog-' + escapedIdentifier + ' .contents').length === 0) {\n hidePopup(0);\n }\n });\n hasBoundOnExternalClick = true;\n }\n };\n\n var unbindHideOnExternalClick = function unbindHideOnExternalClick() {\n if (hasBoundOnExternalClick) {\n (0, _jquery2.default)('body').unbind('click.' + externalClickNamespace);\n }\n hasBoundOnExternalClick = false;\n };\n\n var onKeydown = function onKeydown(e) {\n if (e.keyCode === _keyCode2.default.ESCAPE) {\n hidePopup(0);\n }\n };\n\n var bindHideOnEscPressed = function bindHideOnEscPressed() {\n (0, _jquery2.default)(document).on('keydown', onKeydown);\n };\n\n var unbindHideOnEscPressed = function unbindHideOnEscPressed() {\n (0, _jquery2.default)(document).off('keydown', onKeydown);\n };\n\n /**\n * Show the inline dialog.\n * @method show\n */\n popup.show = function (e, trigger) {\n if (e) {\n e.stopPropagation();\n }\n appendPopup();\n if (opts.noBind && !(items && items.length)) {\n initPopup(e, trigger === undefined ? e.target : trigger);\n } else {\n initPopup(e, items);\n }\n };\n /**\n * Hide the inline dialog.\n * @method hide\n */\n popup.hide = function () {\n hidePopup(0);\n };\n /**\n * Repositions the inline dialog if being shown.\n * @method refresh\n */\n popup.refresh = function () {\n if (beingShown) {\n getHash().reset();\n }\n };\n\n popup.getOptions = function () {\n return opts;\n };\n\n return popup;\n}", "function uploadAttachment()\n {\n if (Office.context.mailbox.item.attachments == undefined)\n {\n app.showNotification(\"Sorry attachments are not supported by your Exchange server.\");\n }\n else if (Office.context.mailbox.item.attachments.length == 0)\n {\n app.showNotification(\"Oops there are no attachments on this email.\");\n }\n else\n {\n var apicall = \"https://api.workflowmax.com/job.api/document?apiKey=\"+ apiKey + \"&accountKey=\" + accountKey;\n\n var documentXML = \"<Document><Job>\" + cJobID + \"</Job><Title>Document Title</Title><Text>Note for document</Text><FileName>test.txt</FileName><Content>\" + string64 + \"</Content></Document>\";\n\n var xhr = new XMLHttpRequest();\n\n xhr.open('POST', apicall);\n\n xhr.send(documentXML);\n }\n }", "function sendEmailWithAttachment(email, content,attachpath)\n{\n \n \n var ses_mail = \"From: '' <\" + email + \">\\n\"\n + \"To: \" + email + \"\\n\"\n + \"Subject: New Order Submitted!!!\\n\"\n + \"MIME-Version: 1.0\\n\"\n + \"Content-Type: multipart/mixed; boundary=\\\"NextPart\\\"\\n\\n\"\n + \"--NextPart\\n\"\n + \"Content-Type: text/html; charset=us-ascii\\n\\n\"\n + content+\"\\n\\n\"\n + \"--NextPart\\n\"\n + \"Content-Type: text/plain;\\n\"\n + \"Content-Disposition: attachment; filename=\\\"\"+attachpath+\"\\\"\\n\\n\"\n + \"Awesome attachment\" + \"\\n\\n\"\n + \"--NextPart\";\n\n var params = {\n RawMessage: { Data: new Buffer(ses_mail) },\n Destinations: [ email ],\n Source: \"'' <\" + email + \">'\"\n };\n\n\n ses.sendRawEmail(params, function(err, data) {\n if(err) {\n } \n else {\n } \n });\n}", "attachmentWithBinary(data, fileName, contentType) {\n return { data, fileName, contentType };\n }", "function createAttachmentEnvelopeItem(\n attachment,\n textEncoder,\n ) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n }", "function sendMailWithAttach(EMailJSON){\n\tvar from = EMailJSON[\"from\"].toString();\n\tvar emails = EMailJSON[\"to\"].toString();\n\tvar subject = EMailJSON[\"subject\"].toString();\n\tvar body = EMailJSON[\"content\"].toString();\n\tvar fileArray = JSON.stringify(EMailJSON.fileArray);\n\tvar ss = new com.ibm.cio.sendemail.MailBean();\n\t\n\treturn {\n\t\tresult : ss.sendMailWithAtt(from, emails,subject,body,fileArray,EMailJSON.zipFlag)\n\t};\n}", "function createAnchorTag(text, href, download) {\n var link = document.createElement('a');\n\n link.textContent = text;\n\n if (href) {\n link.href = href;\n }\n\n if (download) {\n link.download = download;\n\n var lowerCaseName = download.toLowerCase();\n\n var isLikelyInline = ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.webp', '.pdf'].some(function(substr) {\n return lowerCaseName.length > substr.length &&\n lowerCaseName.indexOf(substr) == lowerCaseName.length - substr.length;\n });\n\n if (isLikelyInline) {\n link.onclick = function() {\n downloadAttachment(link, downloadBlob);\n return false;\n };\n }\n\n }\n else if (href && href.charAt(0) != '#') {\n link.target = '_blank';\n }\n\n return link;\n}", "function createAttachmentEnvelopeItem(\n attachment,\n textEncoder,\n) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n object.dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n}", "function createMime(name, mimeType, contents) {\n var mime = new MimeAttachment();\n mime.name = name;\n mime.mimeType = mimeType;\n mime.content = contents;\n \n return mime;\n}", "get valueAttachment () {\r\n\t\treturn this.__valueAttachment;\r\n\t}", "function downloadAttachment(id) {\n $scope.inProgress = true;\n\n var deferred = $q.defer();\n var url = svApiURLs.Attachment + id;\n // url = 'http://localhost:56466/api/data/attachment/' + id;\n $http.get(url, {responseType:'blob'}).then(function successCallback(response) {\n $scope.inProgress = false;\n deferred.resolve(response);\n\n var contentDispositionHeader = response.headers('Content-Disposition');\n var contentType = response.headers('Content-Type');\n var fileName = response.headers('x-filename');\n var data = new Blob([response.data], {type: contentType + ';charset=UTF-8'});\n\n FileSaver.saveAs(data, fileName);\n svToast.showSimpleToast('Attachment \"' + fileName + '\" has been downloaded successfully.');\n }, function errorCallback(error) {\n $scope.inProgress = false;\n svDialog.showSimpleDialog($filter('json')(error.data), 'Error');\n $mdDialog.hide();\n });\n\n return deferred.promise;\n }", "get valueAttachment () {\r\n\t\treturn this._valueAttachment;\r\n\t}", "function createAttachmentEnvelopeItem(\n\t attachment,\n\t textEncoder,\n\t) {\n\t const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n\t return [\n\t dropUndefinedKeys({\n\t type: 'attachment',\n\t length: buffer.length,\n\t filename: attachment.filename,\n\t content_type: attachment.contentType,\n\t attachment_type: attachment.attachmentType,\n\t }),\n\t buffer,\n\t ];\n\t}", "async handleAttachments () {\n\t\t// not yet supported\n\t}", "function inlineElem() {\n var args = Array.prototype.slice.call(arguments)\n var p = document.createElement('p');\n args.forEach(function(elem){\n var str = elem[0] + ' ';\n var tag = document.createElement(elem[1]);\n tag.innerText = str;\n if (elem[2]) {\n tag.className = elem[2];\n }\n if (elem[3]) {\n tag.href = elem[3];\n }\n p.appendChild(tag);\n })\n return p;\n}", "function attachments(threadid)\n{\n\treturn openWindow(\n\t\t'misc.php?' + SESSIONURL + 'do=showattachments&t=' + threadid,\n\t\t480, 300\n\t);\n}", "function getAttachmentsByEntityTypeId(id) {\n var url = svApiURLs.Attachment + id;\n return $resource(\n url,\n {isEntityTypeId:true},\n {'query': {method:'GET', isArray:true}}\n ).query(function() { // GET: /attachment/3?isEntityTypeId=true\n }, function(error) { // error handler\n svDialog.showSimpleDialog($filter('json')(error.data), 'Error');\n $mdDialog.hide();\n });\n }", "function SegmentInline(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames_default()('inline', className);\n var rest = lib_getUnhandledProps(SegmentInline, props);\n var ElementType = lib_getElementType(SegmentInline, props);\n return react_default.a.createElement(ElementType, extends_default()({}, rest, {\n className: classes\n }), childrenUtils_namespaceObject.isNil(children) ? content : children);\n}", "function bindMarkdownUpload(input) {\n var _pfile;\n input.inlineattachment({\n uploadUrl: '/attachments/cache',\n jsonFieldName: 'url',\n allowedTypes: [\n 'image/jpeg',\n 'image/png',\n 'image/jpg',\n 'image/gif',\n 'text/plain',\n 'text/comma-separated-values',\n 'text/csv',\n 'application/csv',\n 'application/excel',\n 'application/vnd.ms-excel',\n 'application/vnd.msexcel'\n ],\n urlText: function(filename, result) {\n var url = \"[\" + _pfile.name + \"](\" + filename + \")\";\n if (fileIsImage(_pfile)) {\n url = \"!\" + url;\n }\n return url;\n },\n onFileReceived: function(file) {\n _pfile = file;\n },\n beforeFileUpload: function(xhr) {\n xhr.file = _pfile;\n return true;\n },\n onFileUploadResponse: function(xhr) {\n var id = xhr.id || JSON.parse(xhr.responseText).id;\n var filefield = input.parent().find(\"input.is-hidden[type=file]\");\n var reference = filefield.data(\"reference\");\n var metadatafield = $(\"input[type=hidden][data-reference='\" + reference + \"']\");\n var data = JSON.parse(metadatafield.attr(\"value\"));\n data.push({ id: id, filename: xhr.file.name, content_type: xhr.file.type, size: xhr.file.size })\n metadatafield.attr(\"value\", JSON.stringify(data));\n filefield.removeAttr(\"name\");\n return true;\n },\n onFileUploaded: function() {\n input.trigger(\"keyup\");\n },\n remoteFilename: function(file) {\n return file.name;\n }\n });\n}", "toJSON() {\n let cell = super.toJSON();\n if (this.attachments.length) {\n cell.attachments = this.attachments.toJSON();\n }\n return cell;\n }", "function addAttachmentRow(container, attachment) {\n var attachmentCheckbox = document.createElement('input');\n attachmentCheckbox.setAttribute('type', 'checkbox');\n attachmentCheckbox.setAttribute('data-text', attachment.text);\n attachmentCheckbox.setAttribute('data-download', attachment.download);\n attachmentCheckbox.setAttribute('data-href', attachment.href);\n if (attachment.missingCorsHeader) {\n attachmentCheckbox.disabled = true;\n attachmentCheckbox.setAttribute('title', 'The domain where this attachment is hosted does not send proper CORS headers, so it is not eligible for bulk download.');\n }\n else {\n attachmentCheckbox.checked = true;\n }\n container.appendChild(attachmentCheckbox);\n var attachmentLink = createAnchorTag(attachment.text, null);\n attachmentLink.setAttribute('data-href', attachment.href);\n attachmentLink.classList.add('attachment');\n attachmentLink.onclick = function (e) {\n attachment.element.click();\n };\n var attachmentWrapper = document.createElement('span');\n attachmentWrapper.appendChild(attachmentLink);\n container.appendChild(attachmentWrapper);\n}", "function getEmailAttachments(msg) {\n var attachments = msg\n //var attachments = msg.getAttachments();\n if (!!attachments) {\n var is_zip = (attachments[0].getContentType() == 'application/zip') ? true : false\n \n if (is_zip) {\n return Utilities.unzip(attachments[0])\n } else {\n return attachments \n } \n }\n}", "get attachmentsSourceInput() {\n return this._attachmentsSource;\n }", "function fetchData(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ourFetch(genDBUrl(host, path)).then(function (response) {\n if (typeof process !== 'undefined' && !process.browser) {\n return response.buffer();\n } else {\n /* istanbul ignore next */\n return response.blob();\n }\n }).then(function (blob) {\n if (opts.binary) {\n // TODO: Can we remove this?\n if (typeof process !== 'undefined' && !process.browser) {\n blob.type = att.content_type;\n }\n return blob;\n }\n return new Promise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "get isInline() {\n return !this.isBlock;\n }", "processInline(paragraph) {\n let obj = linepar.toObject(paragraph);\n let url = String(obj[\"url\"]);\n // get type ( html or txt );\n let lastIndex = url.lastIndexOf(\".\");\n let ext = url.substring(lastIndex + 1, url.length);\n var stringData = $.ajax({\n url: url,\n async: false\n }).responseText;\n if (ext == \"txt\") {\n this.parseText(stringData);\n }\n else {\n let div = html.Html.createElement(\"div\", \"\", \"\");\n div.innerHTML = stringData;\n this.elArray.push(div);\n }\n }", "attach(filePath, options) {\n this.nodeMailerMessage.attachments = this.nodeMailerMessage.attachments || [];\n this.nodeMailerMessage.attachments.push({\n path: filePath,\n ...options,\n });\n return this;\n }", "function fetchData(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ourFetch(genDBUrl(host, path)).then(function (response) {\n if (typeof process !== 'undefined' && !process.browser) {\n return response.buffer();\n } else {\n /* istanbul ignore next */\n return response.blob();\n }\n }).then(function (blob) {\n if (opts.binary) {\n // TODO: Can we remove this?\n if (typeof process !== 'undefined' && !process.browser) {\n blob.type = att.content_type;\n }\n return blob;\n }\n return new Promise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function joinAttachToMessage({\n resource_type,\n secure_url,\n original_filename\n }) {\n const fileExtension = getFileExtension(secure_url);\n\n content = {\n attachment: {\n type:\n // The CDN Cloudinary saves the PDF files as a\n // resource_type='image', then we have to know\n // if the image is a PDF or another extension (eg: jpg).\n resource_type === 'raw' || fileExtension === 'pdf'\n ? 'file'\n : 'image',\n payload: {\n fileName: original_filename,\n url: secure_url\n }\n }\n };\n\n return createMessage(room._id, content, pubnub);\n }", "function wpabstracts_add_attachment() {\n var container = document.createElement('div');\n var input = document.createElement('input');\n input.setAttribute('type','file');\n input.setAttribute('name','attachments[]');\n container.appendChild(input);\n document.getElementById('wpabstract_form_attachments').appendChild(container);\n}", "function wpabstracts_add_attachment() {\n var container = document.createElement('div');\n var input = document.createElement('input');\n input.setAttribute('type','file');\n input.setAttribute('name','attachments[]');\n container.appendChild(input);\n document.getElementById('wpabstract_form_attachments').appendChild(container);\n}", "function uploadNote()\n {\n // Get the content of email and then calls the 'callback' function.\n var item = Office.context.mailbox.item.body.getAsync(\"text\", callback);\n }", "get defaultValueAttachment() {\n\t\treturn this.__defaultValueAttachment;\n\t}", "function downloadAttachment(link, callback) {\n link.classList.add('downloading');\n\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n callback(link.download, this.response);\n link.classList.remove('downloading');\n };\n\n xhr.open('GET', link.href);\n xhr.send(null);\n}", "function getImageStreamFromMessage(message) {\n var headers = {};\n var attachment = message.attachments[0];\n if (utils.checkRequiresToken(message)) {\n // The Skype attachment URLs are secured by JwtToken,\n // you should set the JwtToken of your bot as the authorization header for the GET request your bot initiates to fetch the image.\n // https://github.com/Microsoft/BotBuilder/issues/662\n connector.getAccessToken(function (error, token) {\n var tok = token;\n headers['Authorization'] = 'Bearer ' + token;\n headers['Content-Type'] = 'application/octet-stream';\n\n return needle.get(attachment.contentUrl, { headers: headers });\n });\n }\n\n headers['Content-Type'] = attachment.contentType;\n return needle.get(attachment.contentUrl, { headers: headers });\n}", "function getImageStreamFromMessage(message) {\n var headers = {};\n var attachment = message.attachments[0];\n if (utils.checkRequiresToken(message)) {\n // The Skype attachment URLs are secured by JwtToken,\n // you should set the JwtToken of your bot as the authorization header for the GET request your bot initiates to fetch the image.\n // https://github.com/Microsoft/BotBuilder/issues/662\n connector.getAccessToken(function (error, token) {\n var tok = token;\n headers['Authorization'] = 'Bearer ' + token;\n headers['Content-Type'] = 'application/octet-stream';\n\n return needle.get(attachment.contentUrl, { headers: headers });\n });\n }\n\n headers['Content-Type'] = attachment.contentType;\n return needle.get(attachment.contentUrl, { headers: headers });\n}", "getEmbedded(table, id, embed) {\n return fetch(`${remoteURL}/${table}/${id}?_embed=${embed}`)\n .then(result => result.json())\n }", "function loadAttachments(worker, taskId) {\n\n}", "function xfmtLink(inlineContext) /* (inlineContext : inlineContext) -> ((ctx : inlineContext, isImage : bool, link : common/link, content : string) -> string) */ {\n return inlineContext.xfmtLink;\n}", "img(id, url, messaging_type = 'RESPONSE') {\n const obj = {\n messaging_type,\n recipient: { id },\n message: {\n attachment: {\n type: 'image',\n payload: {\n url\n }\n }\n }\n }\n return this.sendMessage(obj);\n }", "function asciidocToHTMLInline(content) {\n return asciidoctor.convert(content, { doctype: \"inline\" });\n}", "async downloadAttachmentAndWrite(attachment) {\n // Retrieve the attachment via the attachment's contentUrl.\n const url = attachment.contentUrl;\n\n // Local file path for the bot to save the attachment.\n const localFileName = path.join(__dirname, attachment.name);\n\n try {\n // arraybuffer is necessary for images\n const response = await axios.get(url, { responseType: 'arraybuffer' });\n // If user uploads JSON file, this prevents it from being written as \"{\"type\":\"Buffer\",\"data\":[123,13,10,32,32,34,108...\"\n if (response.headers['content-type'] === 'application/json') {\n response.data = JSON.parse(response.data, (key, value) => {\n return value && value.type === 'Buffer' ?\n Buffer.from(value.data) :\n value;\n });\n }\n fs.writeFileSync(localFileName, response.data, (fsError) => {\n if (fsError) {\n throw fsError;\n }\n });\n } catch (error) {\n console.error(error);\n return undefined;\n }\n // If no error was thrown while writing to disk, return the attachment's name\n // and localFilePath for the response back to the user.\n return {\n fileName: attachment.name,\n localPath: localFileName\n };\n }", "function SegmentInline(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('inline', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(SegmentInline, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(SegmentInline, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function SegmentInline(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('inline', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(SegmentInline, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(SegmentInline, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function downloadInnerHtml() {\n\t// Find the first <input> element using the getElementsByTagName() method, return the content using the value propery, and assign to the fileName variable\n\tvar fileName = document.getElementById('file-name').value;\n\n\t// Concatenate the user selected blocks of HTML with the static blocks of HTML (defined as string literals in gha-email-builder.js) to create a full template\n\tvar emailTemplate = templateShellBlock0 + emailPreheaderInput.innerHTML + templateShellBlock1 + emailHeaderInput.innerHTML + emailTierBarInput.innerHTML + emailHeroInput.innerHTML + emailBodyInput.innerHTML + templateShellBlock2 + emailFooterInput.innerHTML + templateShellBlock3;\n\n\t// Create a new <a> tag using the createElement() method and assign to downloadLink variable\n\tvar downloadLink = document.createElement('a');\n\t\n\t// Set the download attribute of the link so that it uses the user defined name\n\tdownloadLink.setAttribute('download', fileName);\n\t\n\t// Set the href attribute of the link\n\t// The data URI scheme is a Uniform Resource Identifier (URI) scheme that provides a way to include data in-line in web pages as if they were external resources.\n\t// The The encodeURIComponent() function encodes the special characters of a URI component\n\t// More infomration about the data URI scheme available here: https://en.wikipedia.org/wiki/Data_URI_scheme\n\t// More infomration about the encodeURIComponent() function available here: https://www.w3schools.com/jsref/jsref_encodeURIComponent.asp\n\tdownloadLink.setAttribute('href', 'data:text/html;charset=UTF-8,' + encodeURIComponent(emailTemplate));\n\n\t// Simulate a mouse-click on the link using the click() method\n\tdownloadLink.click();\n}", "function format(mail) {\n\t\t\treturn \"<a href='\"+mail.permalink+\"'><img src='\" + mail.image + \"' /><span class='title'>\" + mail.title +\"</span></a>\";\t\t\t\n\t\t}", "function SegmentInline(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = (0, _classnames[\"default\"])('inline', className);\n var rest = (0, _lib.getUnhandledProps)(SegmentInline, props);\n var ElementType = (0, _lib.getElementType)(SegmentInline, props);\n return _react[\"default\"].createElement(ElementType, (0, _extends2[\"default\"])({}, rest, {\n className: classes\n }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "function clickSendAttachments(inputFile) {\n // upload image\n QB.content.createAndUpload({name: inputFile.name, file: inputFile, type:\n inputFile.type, size: inputFile.size, 'public': false}, function(err, response){\n if (err) {\n console.log(err);\n } else {\n $(\"#progress\").fadeOut(400);\n var uploadedFile = response;\n\n sendMessageQB(\"[attachment]\", uploadedFile.id);\n\n $(\"input[type=file]\").val('');\n }\n });\n}", "static async Create(req, res) {\n var attachment = req.file;\n var blobName = getBlobName(attachment.originalname);\n const containerClient = blobServiceClient.getContainerClient(containerName);\n await uploadStream(containerClient, blobName, attachment.buffer);\n var url = `https://${key.getStorageAccountName()}.blob.core.windows.net/${containerName}/${blobName}`;\n let body = JSON.parse(req.body.body);\n new mssql.ConnectionPool(config.config).connect().then((pool) => {\n return pool.request().query(`EXEC sp_create_attachment ${body.id_person},${body.id_attachment_catalog},'${url}','${body.description}'`)\n }).then((fields) => {\n mssql.close();\n res.json(\"CREATED SUCCESSFULLY\");\n }).catch((err) => {\n mssql.close();\n res.json(err)\n\n })\n }", "_next() {\n const attachmentViewer = this.attachmentViewer;\n const index = attachmentViewer.attachments.findIndex(attachment =>\n attachment === attachmentViewer.attachment\n );\n const nextIndex = (index + 1) % attachmentViewer.attachments.length;\n attachmentViewer.update({\n attachment: [['link', attachmentViewer.attachments[nextIndex]]],\n });\n }", "_previous() {\n const attachmentViewer = this.attachmentViewer;\n const index = attachmentViewer.attachments.findIndex(attachment =>\n attachment === attachmentViewer.attachment\n );\n const nextIndex = index === 0\n ? attachmentViewer.attachments.length - 1\n : index - 1;\n attachmentViewer.update({\n attachment: [['link', attachmentViewer.attachments[nextIndex]]],\n });\n }", "function showMailAjaxInline(mailId) {\n //alert(\"in showMail\");\n var objReadMailWindow;\n var v_u = getUrlParameter('v_u');\n var v_s = getUrlParameter('v_s');\n var fileName = 'showMail.pl'\n var nothingRand;\n var relativeUrl = \"./\" + fileName + \"?v_u=\" + v_u + \"&v_s=\" + v_s + \"&mailId=\" + mailId\n //alert(relativeUrl);\n \n nothingRand = Math.random();\n getMethodAnswerInId(relativeUrl + \"&nothing=\" + nothingRand,pushAnswerInId,\"contantArea\");\n\n}" ]
[ "0.6851515", "0.6266762", "0.6195806", "0.6073926", "0.603093", "0.6015178", "0.6015178", "0.58593965", "0.5832146", "0.5763233", "0.5739862", "0.5718545", "0.5606278", "0.55855846", "0.5533645", "0.5493206", "0.5454444", "0.5404289", "0.5361439", "0.53519976", "0.5322941", "0.5233849", "0.5183889", "0.5175523", "0.51751244", "0.5171834", "0.5171834", "0.51612526", "0.51500845", "0.5145925", "0.5118151", "0.5117598", "0.5117598", "0.5076787", "0.5056034", "0.5034653", "0.502574", "0.49874455", "0.4980891", "0.49524876", "0.49252582", "0.49236253", "0.4911373", "0.49105713", "0.49092183", "0.49033523", "0.49028274", "0.4900579", "0.48692173", "0.4866904", "0.48597088", "0.4847926", "0.48471594", "0.4829712", "0.4827036", "0.48196524", "0.48063377", "0.48047447", "0.48015112", "0.4793101", "0.47914898", "0.47877562", "0.47773966", "0.4745992", "0.47250366", "0.47194132", "0.47112197", "0.46975088", "0.4674138", "0.4669962", "0.4669553", "0.46539104", "0.4646234", "0.46383315", "0.4636742", "0.4635044", "0.46314242", "0.46103477", "0.46103477", "0.45865226", "0.45773032", "0.45640397", "0.4553346", "0.4553346", "0.4546264", "0.45447904", "0.45183307", "0.45079297", "0.4501307", "0.44986495", "0.44956914", "0.44956914", "0.44832093", "0.44814613", "0.4478978", "0.44768313", "0.44674903", "0.44662845", "0.4464367", "0.4461521" ]
0.71616316
0
Returns an attachment to be sent to the user from a HTTPS URL.
getInternetAttachment() { // NOTE: The contentUrl must be HTTPS. return { name: 'architecture-resize.png', contentType: 'image/png', contentUrl: 'https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize.png' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getFileURLSigned(url) {\n const path = await this.getPathFromUrl(url);\n const result = await this.doRequest({\n path,\n method: \"GET\",\n params: {\n noRedirect: true,\n },\n });\n return result;\n }", "function getAttachment(bot, msg, messageLang) {\r\n\tvar patentId = msg.text.toString().toLowerCase().replace('/download', '');\r\n\tif (patentId && typeof patentId != 'undefined') {\r\n\t\tif (usersLog[msg.from.username] && usersLog[msg.from.username].lastResult) {\r\n\t\t\ttry{\r\n\t\t\t\tif (usersLog[msg.from.username].lastResult[0][patentId]) {\r\n\t\t\t\t\tbot.sendDocument(msg.chat.id, usersLog[msg.from.username].lastResult[0][patentId].attachment, {\r\n\t\t\t\t\t\t\"caption\": '*' + languageBase[messageLang].attachmentCaption + '* ' + usersLog[msg.from.username].lastResult[0][patentId].desc,\r\n\t\t\t\t\t\t\"parse_mode\": 'Markdown'\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar message = languageBase[messageLang].attachmentNotFound[0] + patentId + languageBase[messageLang].attachmentNotFound[1];\r\n\t\t\t\t\tbot.sendMessage(msg.chat.id,message);\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\tconsole.log(e);\r\n\t\t\t\tbot.sendMessage(msg.chat.id,languageBase[messageLang].attachmentError);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tbot.sendMessage(msg.chat.id, languageBase[messageLang].attachmentWarning, {\r\n\t\t\t\t\"parse_mode\": 'Markdown'\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tbot.sendMessage(msg.chat.id,languageBase[messageLang].cmdError);\r\n\t} \r\n}", "async function getDownloadLink(uri, credential, _id) {\n return axios.post(buildEndpointOperationURL(ENDPOINT_OP_URL, getUriType(uri), DOWNLOAD_OP_URL), {\n \"identifier\": credential[\"name\"],\n \"credId\": credential[\"uuid\"],\n \"path\": uri,\n \"fileToDownload\": \"\"\n })\n .then((response) => {\n if (!(response.status === 200))\n console.log(\"Error in download API call\");\n else {\n return response.data\n }\n })\n .catch((error) => {\n handleRequestFailure(error);\n console.log(\"Error encountered while generating download link\");\n });\n}", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch() {\n\t\n\t if (!filenames.length) {\n\t return null;\n\t }\n\t\n\t var filename = filenames.pop();\n\t var att = atts[filename];\n\t var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n\t '?rev=' + doc._rev;\n\t return ajaxPromise(opts, {\n\t method: 'GET',\n\t url: genDBUrl(host, path),\n\t binary: true\n\t }).then(function (blob) {\n\t if (opts.binary) {\n\t return blob;\n\t }\n\t return new PouchPromise(function (resolve) {\n\t blobToBase64(blob, resolve);\n\t });\n\t }).then(function (data) {\n\t delete att.stub;\n\t delete att.length;\n\t att.data = data;\n\t });\n\t }", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob$$1) {\n if (opts.binary) {\n return blob$$1;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob$$1, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob$$1) {\n if (opts.binary) {\n return blob$$1;\n }\n return new PouchPromise$1(function (resolve) {\n blobToBase64(blob$$1, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "async function getFileContentRequest(url, customOptions) {\n var _response$headers$con2, _response$headers$sky2;\n\n const opts = { ...defaultDownloadOptions,\n ...this.customOptions,\n ...customOptions\n }; // GET request the data at the skylink.\n\n const response = await this.executeRequest({ ...opts,\n method: \"get\",\n url\n });\n\n if (typeof response.data === \"undefined\") {\n throw new Error(\"Did not get 'data' in response despite a successful request. Please try again and report this issue to the devs if it persists.\");\n }\n\n if (typeof response.headers === \"undefined\") {\n throw new Error(\"Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists.\");\n }\n\n const contentType = (_response$headers$con2 = response.headers[\"content-type\"]) !== null && _response$headers$con2 !== void 0 ? _response$headers$con2 : \"\";\n const metadata = response.headers[\"skynet-file-metadata\"] ? JSON.parse(response.headers[\"skynet-file-metadata\"]) : {};\n const portalUrl = (_response$headers$sky2 = response.headers[\"skynet-portal-api\"]) !== null && _response$headers$sky2 !== void 0 ? _response$headers$sky2 : \"\";\n const skylink = response.headers[\"skynet-skylink\"] ? (0, _skylink.formatSkylink)(response.headers[\"skynet-skylink\"]) : \"\";\n return {\n data: response.data,\n contentType,\n portalUrl,\n metadata,\n skylink\n };\n}", "function fetch(filename) {\n\t var att = atts[filename];\n\t var path$$1 = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n\t '?rev=' + doc._rev;\n\t return ajaxPromise(opts, {\n\t method: 'GET',\n\t url: genDBUrl(host, path$$1),\n\t binary: true\n\t }).then(function (blob) {\n\t if (opts.binary) {\n\t return blob;\n\t }\n\t return new PouchPromise(function (resolve) {\n\t blobToBase64(blob, resolve);\n\t });\n\t }).then(function (data) {\n\t delete att.stub;\n\t delete att.length;\n\t att.data = data;\n\t });\n\t }", "function downloadAttachment(link, callback) {\n link.classList.add('downloading');\n\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n callback(link.download, this.response);\n link.classList.remove('downloading');\n };\n\n xhr.open('GET', link.href);\n xhr.send(null);\n}", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new PouchPromise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function joinAttachToMessage({\n resource_type,\n secure_url,\n original_filename\n }) {\n const fileExtension = getFileExtension(secure_url);\n\n content = {\n attachment: {\n type:\n // The CDN Cloudinary saves the PDF files as a\n // resource_type='image', then we have to know\n // if the image is a PDF or another extension (eg: jpg).\n resource_type === 'raw' || fileExtension === 'pdf'\n ? 'file'\n : 'image',\n payload: {\n fileName: original_filename,\n url: secure_url\n }\n }\n };\n\n return createMessage(room._id, content, pubnub);\n }", "function _downloadUsingServer(serverPort, url)\n{\n return new Promise((accept, reject) => {\n if(url == null)\n {\n reject(null);\n return;\n }\n\n // We use i-cf for image URLs, but we don't currently have this in @connect,\n // so we can't use that here. Switch from i-cf back to the original URLs.\n url = new URL(url);\n if(url.hostname == \"i-cf.pximg.net\")\n url.hostname = \"i.pximg.net\";\n\n // Send a message to the sandbox to retrieve the image with GM.xmlHttpRequest, giving\n // it a message port to send the result back on.\n let { port1: serverResponsePort, port2: clientResponsePort } = new MessageChannel();\n\n clientResponsePort.onmessage = (e) => {\n clientResponsePort.close();\n \n if(e.data.success)\n accept(e.data.response);\n else\n reject(e.data.error);\n };\n\n serverPort.realPostMessage({\n url: url.toString(),\n\n options: {\n responseType: \"arraybuffer\",\n headers: {\n \"Cache-Control\": \"max-age=360000\",\n Referer: \"https://www.pixiv.net/\",\n Origin: \"https://www.pixiv.net/\",\n },\n },\n }, [serverResponsePort]);\n });\n}", "function downloadFile(url) {\n return new Promise((resolve, reject) => {\n console.log(\"Downloading file...\");\n var scheme = (url.indexOf(\"https\") === 0) ? https : http;\n\n scheme.get(url, response => {\n var data = [];\n response.on(\"data\", chunk => {\n data.push(chunk);\n });\n response.on(\"end\", () => {\n if (response.statusCode !== 200) return reject(response.statusMessage);\n\n var download = Buffer.concat(data);\n resolve(new Uint8Array(download).buffer);\n });\n })\n .on(\"error\", error => {\n reject(error);\n });\n });\n}", "async downloadAttachmentAndWrite(attachment) {\n // Retrieve the attachment via the attachment's contentUrl.\n const url = attachment.contentUrl;\n\n // Local file path for the bot to save the attachment.\n const localFileName = path.join(__dirname, attachment.name);\n\n try {\n // arraybuffer is necessary for images\n const response = await axios.get(url, { responseType: 'arraybuffer' });\n // If user uploads JSON file, this prevents it from being written as \"{\"type\":\"Buffer\",\"data\":[123,13,10,32,32,34,108...\"\n if (response.headers['content-type'] === 'application/json') {\n response.data = JSON.parse(response.data, (key, value) => {\n return value && value.type === 'Buffer' ?\n Buffer.from(value.data) :\n value;\n });\n }\n fs.writeFileSync(localFileName, response.data, (fsError) => {\n if (fsError) {\n throw fsError;\n }\n });\n } catch (error) {\n console.error(error);\n return undefined;\n }\n // If no error was thrown while writing to disk, return the attachment's name\n // and localFilePath for the response back to the user.\n return {\n fileName: attachment.name,\n localPath: localFileName\n };\n }", "function mmCreateUrlAttachment(attachment) {\n let type = $(attachment).data(\"type\");\n let id = $(attachment).data(\"id\");\n let $img = $(attachment).find(\".attachment-preview img\"),\n url = $img.data(\"src\"),\n urlmax = url.replace(/-150/g, \"\"),\n title = $img.attr(\"alt\"),\n max = $img.data(\"max\"),\n size = $img.data(\"size\"),\n sizes = $img.data(\"sizes\").toString(),\n align = $img.data(\"align\") || \"center\",\n textAlt = $img.attr(\"alt\") || \"\",\n proAlt = (textAlt!=null && textAlt.length>0)?`alt=\"${textAlt}\"`:\"\";\n textTitle = $img.data(\"title\") || \"\",\n proTitle = (textTitle!=null && textTitle.length>0)?`title=\"${textTitle}\"`:\"\";\n textCaption = $img.data(\"caption\") || \"\",\n tagCaption = (textCaption!=null && textCaption.length>0)?`<figcaption class=\"caption\">${textCaption}</figcaption>`:\"\";\n rs = '';\n switch (type) {\n case 'file':\n rs = `<a href=\"${url}\" title=\"${title}\">${url}</a>`;\n break;\n case 'image':\n let sizesArr = sizes.split(\",\"),\n srcset = [],\n srcsetSizes = [],\n cssAlign = \"\";\n cssAlign = (align == \"center\") ? `style=\"display: block; margin-left: auto; margin-right: auto; text-align:center;\"` : cssAlign;\n cssAlign = (align == \"right\") ? `style=\"float: right; text-align:right;\"` : cssAlign;\n sizesArr.forEach(s => {\n if (s <= size) {\n url = (s == max) ? urlmax : url.replace(/-150\\./g, `-${s}.`);\n srcset.push(`${url} ${s}w`);\n srcsetSizes.push(`${s}px`);\n }\n });\n urlmax = (size == max) ? urlmax : url.replace(/-150\\./g, `-${size}.`);\n rs = `<figure id=\"smsci-${id}\" class=\"sm-single-content-image\" ${cssAlign}>`;\n rs += `<img ${proAlt} ${proTitle} srcset=\"${srcset.join()}\" sizes=\"(max-width: ${size}px) ${srcsetSizes.join(\",\")}\" src=\"${urlmax}\" width=\"${size}\"/>`;\n rs += (tagCaption.length > 0) ? tagCaption : \"\";\n rs += \"</figure>\";\n break;\n default:\n console.log(\"wrong attachment type\");\n break;\n }\n return rs.trim();\n}", "async function urlToFile(url, filename, mimeType){\n try {\n const resp = await fetch(url);\n const buffer = await resp.arrayBuffer();\n return new File([buffer], filename, { type: mimeType });\n } catch (err) {\n throw err;\n }\n}", "function getURL(){\n\tvar html = document.getElementById(\"report\")\n\tvar share = document.getElementById(\"share\")\n\tvar url = window.location.href\n\thtml.innerHTML += \"<a href=\\\"mailto:[email protected]?subject=Reported%20Image&body=\"+ encodeURIComponent(url) +\"\\\">Report offensive image here</a>\"\n\tshare.innerHTML += \"<a href=\\\"mailto:?subject=Check%20out%20this%20image%20on%20PhotoSect!&body=\"+ encodeURIComponent(url) +\"\\\">Share with friends!</a>\"\n}", "get attachment () {\n\t\treturn this._attachment;\n\t}", "function httpsGet(opt) {\n return new Promise((fres, frej) => https.get(opt, (res) => {\n var err = null, cod = res.statusCode, dat = '';\n if(cod!==200) err = new Error(`HTTPS GET failed (${cod}).\\n${opt}`);\n if(err) { res.resume(); return frej(err); }\n res.setEncoding('utf8');\n res.on('data', (cnk) => dat+=cnk);\n res.on('end', () => fres(dat));\n }).on('error', frej));\n}", "function getImageStreamFromMessage(message) {\n var headers = {};\n var attachment = message.attachments[0];\n if (utils.checkRequiresToken(message)) {\n // The Skype attachment URLs are secured by JwtToken,\n // you should set the JwtToken of your bot as the authorization header for the GET request your bot initiates to fetch the image.\n // https://github.com/Microsoft/BotBuilder/issues/662\n connector.getAccessToken(function (error, token) {\n var tok = token;\n headers['Authorization'] = 'Bearer ' + token;\n headers['Content-Type'] = 'application/octet-stream';\n\n return needle.get(attachment.contentUrl, { headers: headers });\n });\n }\n\n headers['Content-Type'] = attachment.contentType;\n return needle.get(attachment.contentUrl, { headers: headers });\n}", "function getImageStreamFromMessage(message) {\n var headers = {};\n var attachment = message.attachments[0];\n if (utils.checkRequiresToken(message)) {\n // The Skype attachment URLs are secured by JwtToken,\n // you should set the JwtToken of your bot as the authorization header for the GET request your bot initiates to fetch the image.\n // https://github.com/Microsoft/BotBuilder/issues/662\n connector.getAccessToken(function (error, token) {\n var tok = token;\n headers['Authorization'] = 'Bearer ' + token;\n headers['Content-Type'] = 'application/octet-stream';\n\n return needle.get(attachment.contentUrl, { headers: headers });\n });\n }\n\n headers['Content-Type'] = attachment.contentType;\n return needle.get(attachment.contentUrl, { headers: headers });\n}", "function loadAttachment(client, addr, pass, key, id, uti) {\n\tvar iv = crypto.randomBytes(8).toString('hex');\n\n\tclient.emit('attachmentGet', id,\n\t\t'http://' + addr + ':8735/attachment?id=' + encrypt(id, key, iv) + '&password=' + encrypt(pass, key, iv) + '&iv=' + iv, uti);\n}", "function downloadFile(href, filename, callback) {\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function () {\n if (callback) {\n callback(this.response);\n }\n else {\n downloadBlob(filename, this.response);\n }\n };\n xhr.onerror = function () {\n if (callback) {\n callback(this.response);\n }\n };\n if (href.indexOf('https://help.liferay.com') == 0) {\n xhr.open('GET', href.substring('https://help.liferay.com'.length));\n }\n else {\n xhr.open('GET', href);\n }\n xhr.setRequestHeader('Cache-Control', 'no-cache, no-store, max-age=0');\n xhr.setRequestHeader('Pragma', 'no-cache');\n xhr.send(null);\n}", "function forceDownload(url, fileName){\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"blob\";\n xhr.onload = function(){\n var urlCreator = window.URL || window.webkitURL;\n var imageUrl = urlCreator.createObjectURL(this.response);\n var tag = document.createElement('a');\n tag.href = imageUrl;\n tag.download = fileName;\n document.body.appendChild(tag);\n tag.click();\n document.body.removeChild(tag);\n }\n xhr.send();\n}", "function sendEmailWithAttachment(email, content,attachpath)\n{\n \n \n var ses_mail = \"From: '' <\" + email + \">\\n\"\n + \"To: \" + email + \"\\n\"\n + \"Subject: New Order Submitted!!!\\n\"\n + \"MIME-Version: 1.0\\n\"\n + \"Content-Type: multipart/mixed; boundary=\\\"NextPart\\\"\\n\\n\"\n + \"--NextPart\\n\"\n + \"Content-Type: text/html; charset=us-ascii\\n\\n\"\n + content+\"\\n\\n\"\n + \"--NextPart\\n\"\n + \"Content-Type: text/plain;\\n\"\n + \"Content-Disposition: attachment; filename=\\\"\"+attachpath+\"\\\"\\n\\n\"\n + \"Awesome attachment\" + \"\\n\\n\"\n + \"--NextPart\";\n\n var params = {\n RawMessage: { Data: new Buffer(ses_mail) },\n Destinations: [ email ],\n Source: \"'' <\" + email + \">'\"\n };\n\n\n ses.sendRawEmail(params, function(err, data) {\n if(err) {\n } \n else {\n } \n });\n}", "function convertToBlobURL(url) {\n return new RSVP.Promise(function (resolve, reject) {\n var URL = window.URL || window.webkitURL;\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"blob\";\n xhr.onload = function (e) {\n resolve(URL.createObjectURL(xhr.response));\n };\n xhr.onerror = reject;\n xhr.send();\n });\n}", "url() {\n const url = RB.UserSession.instance.get('userFileAttachmentsURL');\n\n return this.isNew() ? url : `${url}${this.id}/`;\n }", "downloadFile(url) {\n axios({\n url: url,\n method: \"GET\",\n responseType: \"blob\" // important\n }).then(async response => {\n const blob1 = new Blob([response.data])\n toBuffer(blob1, function (err, buffer) {\n if (err) throw err\n const dec = decrypt(localStorage.getItem('privateKey'), buffer)\n let blob = new Blob([dec], { type: 'application/pdf' });\n let url = URL.createObjectURL(blob);\n window.open(url);\n })\n });\n }", "function fetch() {\n\n if (!filenames.length) {\n return null;\n }\n\n var filename = filenames.pop();\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ajaxPromise(opts, {\n method: 'GET',\n url: genDBUrl(host, path),\n binary: true\n }).then(function (blob) {\n if (opts.binary) {\n return blob;\n }\n return new Promise(function (resolve) {\n pouchdbBinaryUtils.blobOrBufferToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "async download(url, dest, cb) {\n var file = fs.createWriteStream(dest);\n var request = https.get(url, function(response) {\n response.pipe(file);\n file.on('finish', function() {\n file.close(cb);\n });\n });\n }", "function handleAddingAttachment(url){\n let api = collector.getModule('ModalDialogAPI');\n let md = new api.modalDialog(\n function(attachment){\n attachment.sleep(sleep);\n attachment.type(new elementslib.Lookup(attachment.window.document, '/id(\"commonDialog\")/[4]/'\n + '[1]/id(\"loginContainer\")/id(\"loginTextbox\")/anon({\"class\":\"textbox-input-box\"})/'\n + 'anon({\"anonid\":\"input\"})'), url);\n attachment.click(new elementslib.Lookup(attachment.window.document, '/id(\"commonDialog\")/'\n + 'anon({\"anonid\":\"buttons\"})/{\"dlgtype\":\"accept\"}'));\n }\n );\n md.start();\n}", "function downloadFile(url,path)\n{\n\n\tvar deferred = q.defer();\n\n\tvar file = fs.createWriteStream(path);\n\tvar request = https.get(url, function(response) {\n\t\tif(response.statusCode == 200)\n\t\t{\n\t\t\tresponse.pipe(file);\n\t\t\tdeferred.resolve(response);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconsole.log(\" == ERROR: Could not fetch file [\" + url + \"] \");\n\t\t\tconsole.log(\" == Does this CodeBox not exist? Or is GitHub down? \");\n\t\t\tprocess.abort();\n\t\t}\n\t});\n\n\treturn deferred.promise;\n\n}", "function sendFile(fileLink) {\n downloadFile(fileLink);\n}", "async function download(url, filePath) {\n const proto = https;\n\n return new Promise((resolve, reject) => {\n const file = fs.createWriteStream(filePath);\n let fileInfo = null;\n\n const request = proto.get(url, response => {\n if (response.statusCode !== 200) {\n reject(new Error(`Failed to get '${url}' (${response.statusCode})`));\n return;\n }\n\n fileInfo = {\n mime: response.headers['content-type'],\n size: parseInt(response.headers['content-length'], 10),\n };\n\n response.pipe(file);\n });\n\n // The destination stream is ended by the time it's called\n file.on('finish', () => resolve(fileInfo));\n\n request.on('error', err => {\n fs.unlink(filePath, () => reject(err));\n });\n\n file.on('error', err => {\n fs.unlink(filePath, () => reject(err));\n });\n\n request.end();\n });\n}", "get attachment() {\n\t\treturn this.__attachment;\n\t}", "function uploadFile(url, fileContent) {\r\n\r\n return new Promise(function (resolve, reject) {\r\n\r\n const formData = new FormData();\r\n fileData = new Blob([fileContent], { type: 'text/plain' });\r\n formData.append('email_raw', fileData, \"email.eml\");\r\n\r\n const options = {\r\n method: 'POST',\r\n body: formData,\r\n };\r\n\r\n fetch(url, options)\r\n .then(response => response.text())\r\n .then(result => {\r\n console.log(\"Server response:\", result);\r\n resolve(result);\r\n })\r\n .catch(error => {\r\n console.log('Server response:', error);\r\n reject(error);\r\n });\r\n\r\n });\r\n}", "function downloadAttachment(id) {\n $scope.inProgress = true;\n\n var deferred = $q.defer();\n var url = svApiURLs.Attachment + id;\n // url = 'http://localhost:56466/api/data/attachment/' + id;\n $http.get(url, {responseType:'blob'}).then(function successCallback(response) {\n $scope.inProgress = false;\n deferred.resolve(response);\n\n var contentDispositionHeader = response.headers('Content-Disposition');\n var contentType = response.headers('Content-Type');\n var fileName = response.headers('x-filename');\n var data = new Blob([response.data], {type: contentType + ';charset=UTF-8'});\n\n FileSaver.saveAs(data, fileName);\n svToast.showSimpleToast('Attachment \"' + fileName + '\" has been downloaded successfully.');\n }, function errorCallback(error) {\n $scope.inProgress = false;\n svDialog.showSimpleDialog($filter('json')(error.data), 'Error');\n $mdDialog.hide();\n });\n\n return deferred.promise;\n }", "getURL() {\n return Meteor.absoluteUrl(`${ UploadFS.config.storesPath }/${ this.name }`, {\n secure: UploadFS.config.https\n });\n }", "function getFile(url){\n var req = request.get(url, function(err, res){\n if (err) throw err;\n console.log('Response ok:', res.ok);\n console.log('Response text:', res.text);\n return res.text;\n });\n}", "function getRequest(url, success, error) {\n var req = false;\n try{\n // most browsers\n req = new XMLHttpRequest();\n } catch (e){\n\n }\n if (!req) return false;\n if (typeof success != 'function') success = function () {};\n if (typeof error!= 'function') error = function () {};\n req.onreadystatechange = function(){\n if(req.readyState === 4) {\n return req.status === 200 ?\n success(req.responseText) : error(req.status);\n }\n }\n url = \"http://0.0.0.0:3001/src/back_end_components/email/\" + url;\n console.log(url);\n req.open(\"GET\", url, true);\n req.responseType = \"text\";\n req.send();\n return req;\n\n}", "img(id, url, messaging_type = 'RESPONSE') {\n const obj = {\n messaging_type,\n recipient: { id },\n message: {\n attachment: {\n type: 'image',\n payload: {\n url\n }\n }\n }\n }\n return this.sendMessage(obj);\n }", "async function getFile(url){\n const response = await fetch(url);\n // blobs are usuually any files, like images or other files.\n const data = await response.blob();\n return new File([data], 'test.jpg', {type: 'image/jpeg'});\n }", "function getFileURL() {\n return urlVars['file'];\n}", "function getDownloadURL(ref) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var authToken, requestInfo;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref._throwIfRoot('getDownloadURL');\n return [4 /*yield*/, ref.storage._getAuthToken()];\n case 1:\n authToken = _a.sent();\n requestInfo = getDownloadUrl(ref.storage, ref._location, getMappings());\n return [2 /*return*/, ref.storage\n ._makeRequest(requestInfo, authToken)\n .getPromise()\n .then(function (url) {\n if (url === null) {\n throw noDownloadURL();\n }\n return url;\n })];\n }\n });\n });\n}", "function getDownloadURL(ref) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var authToken, requestInfo;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref._throwIfRoot('getDownloadURL');\n return [4 /*yield*/, ref.storage._getAuthToken()];\n case 1:\n authToken = _a.sent();\n requestInfo = getDownloadUrl(ref.storage, ref._location, getMappings());\n return [2 /*return*/, ref.storage\n ._makeRequest(requestInfo, authToken)\n .getPromise()\n .then(function (url) {\n if (url === null) {\n throw noDownloadURL();\n }\n return url;\n })];\n }\n });\n });\n}", "function downloadCertificate() {\n var cert = certificate;\n downloadFile(cert.pem, 'UniVoteCertificate.pem');\n}", "function download(url) {\n return new Promise((resolve, reject) => {\n get(url, response => {\n resolve(response);\n })\n .on('error', err => {\n reject(err);\n });\n });\n}", "async function download(url, filePath) {\n const proto = !url.charAt(4).localeCompare('s') ? https : http\n\n return new Promise((resolve, reject) => {\n const file = fs.createWriteStream(filePath)\n let fileInfo = null\n\n const request = proto.get(url, response => {\n if (response.statusCode !== httpStatus.OK) {\n reject(new Error(`Failed to get '${url}' (${response.statusCode})`))\n return\n }\n\n fileInfo = {\n mime: response.headers['content-type'],\n size: parseInt(response.headers['content-length'], 10),\n }\n\n response.pipe(file)\n })\n\n // The destination stream is ended by the time it's called\n file.on('finish', () => resolve(fileInfo))\n\n request.on('error', err => {\n fs.unlink(filePath, () => reject(err))\n })\n\n file.on('error', err => {\n fs.unlink(filePath, () => reject(err))\n })\n\n request.end()\n })\n}", "async function getFileURL(user, fileName) {\n return await storageRef.child(user + \"/\" + fileName).getDownloadURL();\n}", "function make_file_request(url) \n{\n try {\n var xhr = new XMLHttpRequest();\n \n // Note: synchronous\n xhr.open('GET', url, false); \n \n xhr.responseType = 'arraybuffer';\n \n xhr.send();\n \n return xhr.response;\n } catch(e) {\n\t\tconsole.log('XHR Error ' + e.toString());\n }\n}", "function toURL(path) {\n return file(path).then(function(fileEntry) {\n return fileEntry.toURL();\n });\n }", "function toDataURL(url) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open('get', url);\n xhr.responseType = 'blob';\n xhr.onload = () => {\n const fr = new FileReader();\n fr.onload = () => resolve(this.result);\n fr.readAsDataURL(xhr.response);\n };\n xhr.send();\n });\n}", "download(url) {\n // request structure\n var options = {\n url: url,\n headers: {\n 'sessionid' : 'ttfro6401v022pm2i1uaho9fqt'\n }\n };\n // return the value obtained after the api request using promises\n return new Promise( ( resolve, reject) => {\n // request to api\n _request( options, ( error, response, body) => {\n if(!error && response.statusCode == 200) {\n // return response\n resolve(body);\n }\n else {\n // resturn error object for error\n reject({\n reason: 'Unable to download page'\n });\n }\n });\n });\n }", "sendFileMessage( recipientId ) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"file\",\n payload: {\n url: envVars.SERVER_URL + \"/assets/test.txt\"\n }\n }\n }\n };\n\n this.callSendAPI( messageData );\n }", "function get_http(url, target) {\r\n // create the agent, obfuscate to avoid paranoid anti-virus\r\n ws.Environment(\"Process\")(\"OBFUSCATE\") = \"MSXML2.XMLHTTP\";\r\n var xmlhttp = WScript.CreateObject(ws.ExpandEnvironmentStrings(\"%OBFUSCATE%\"));\r\n\r\n xmlhttp.Open('GET', url, false);\r\n xmlhttp.Send();\r\n\r\n if (xmlhttp.Status == 200) {\r\n // Create the Data Stream\r\n var stream = WScript.CreateObject('ADODB.Stream');\r\n\r\n // Establish the Stream\r\n stream.Open();\r\n stream.Type = 1; // adTypeBinary\r\n stream.Write(xmlhttp.ResponseBody);\r\n stream.Position = 0;\r\n\r\n // Write the Data Stream to the File\r\n // adSaveCreateOverWrite = 2\r\n stream.SaveToFile(target, 2); \r\n stream.Close();\r\n } else {\r\n WScript.Echo(\"Failed to download: \" + url);\r\n }\r\n}", "function fetchData(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ourFetch(genDBUrl(host, path)).then(function (response) {\n if (typeof process !== 'undefined' && !process.browser) {\n return response.buffer();\n } else {\n /* istanbul ignore next */\n return response.blob();\n }\n }).then(function (blob) {\n if (opts.binary) {\n // TODO: Can we remove this?\n if (typeof process !== 'undefined' && !process.browser) {\n blob.type = att.content_type;\n }\n return blob;\n }\n return new Promise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "function toURL(path) {\n return file(path).then(function (fileEntry) {\n return fileEntry.toURL();\n });\n }", "function GET(url) {\n return new Promise((resolve, reject) => {\n let k = https.get(url, d => {\n\n let data = \"\";\n\n d.on(\"data\", c => { data += c; });\n d.on(\"end\", () => {\n try {\n resolve(JSON.parse(data));\n } catch(e) {\n reject(data);\n }\n });\n });\n k.on(\"error\", e => { reject(e); });\n });\n}", "function getDownloadURL(ref) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var requestInfo;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref._throwIfRoot('getDownloadURL');\n requestInfo = getDownloadUrl(ref.storage, ref._location, getMappings());\n return [4 /*yield*/, ref.storage.makeRequestWithTokens(requestInfo)];\n case 1: return [2 /*return*/, (_a.sent())\n .getPromise()\n .then(function (url) {\n if (url === null) {\n throw noDownloadURL();\n }\n return url;\n })];\n }\n });\n });\n}", "async function httpsRequest (requestUrl, requestOptions) { \n try {\n const response = await fetch(requestUrl, requestOptions);\n if (response.ok) {\n const jsonResponse = await response.json();\n return jsonResponse;\n } else {\n console.log('Network error');\n }\n } catch (err) {\n console.log(requestUrl);\n console.log(err.message);\n console.log(requestUrl);\n }\n}", "function fetchData(filename) {\n var att = atts[filename];\n var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n return ourFetch(genDBUrl(host, path)).then(function (response) {\n if (typeof process !== 'undefined' && !process.browser) {\n return response.buffer();\n } else {\n /* istanbul ignore next */\n return response.blob();\n }\n }).then(function (blob) {\n if (opts.binary) {\n // TODO: Can we remove this?\n if (typeof process !== 'undefined' && !process.browser) {\n blob.type = att.content_type;\n }\n return blob;\n }\n return new Promise(function (resolve) {\n blobToBase64(blob, resolve);\n });\n }).then(function (data) {\n delete att.stub;\n delete att.length;\n att.data = data;\n });\n }", "async getFileFromUrl(url, name) {\n return new Promise((resolve, reject) => {\n fetch(url)\n .then(response => response.blob())\n .then(blob => resolve(new File([blob], name)))\n .catch(error => reject(new DOMException(error)));\n });\n }", "function get (url, cb) {\n if (url.indexOf('https') !== 0) {\n cb(new Error('SSL only!'))\n } else {\n cb(null, 'some data!')\n }\n}", "function whathost(ssl) {\r\n if (ssl) return \"https://ssl.what.cd/\";\r\n else if (!ssl) return \"http://what.cd/\";\r\n}", "function download(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n\n var d = $.Deferred();\n xhr.onload = function (e) {\n d.resolve(this.response);\n };\n xhr.onerror = function (e) {\n d.reject();\n };\n xhr.send(null);\n return d.promise();\n }", "function sendEmail() {\n\tvar email = readCookie('email');\n\tvar url = \"https://api.dc1.exacttarget.com/integrate.aspx?qf=xml&xml=<exacttarget><authorization><username>[email protected]</username><password>gocubs1!</password></authorization><system><system_name>triggeredsend</system_name><action>add</action><TriggeredSend xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns='http://exacttarget.com/wsdl/partnerAPI'><TriggeredSendDefinition><CustomerKey>476</CustomerKey></TriggeredSendDefinition><Subscribers><SubscriberKey>\"+email+\"</SubscriberKey><EmailAddress>\"+email+\"</EmailAddress></Subscribers></TriggeredSend></system></exacttarget>\";\n document.getElementById(\"ExactTarget\").src = url;\n\n //alert(url);\n}", "handleAttachmentMessage() {\n let response;\n\n // Get the attachment\n let attachment = this.webhookEvent.message.attachments[0];\n //console.log(\"Received attachment:\", `${attachment} for ${this.user.psid}`);\n\n response = Response.genQuickReply(i18n.__(\"fallback.attachment\"), [\n {\n title: i18n.__(\"menu.start_over\"),\n payload: \"GET_STARTED\"\n }\n ]);\n\n return response;\n }", "getImageFromMessageAsync(message, connector) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!message || !message.attachments || message.attachments.length <= 0)\n return undefined;\n let attachment = message.attachments[0];\n let token = undefined;\n let headers = {};\n if (this.checkRequiresToken(message)) {\n // The Skype and Teams attachment URLs are secured by JwtToken.\n // You should set the JwtToken of your bot as the authorization header for the GET request your bot initiates to fetch the image.\n try {\n token = yield this.getAccessTokenAsync(connector);\n headers['Authorization'] = 'Bearer ' + token;\n }\n catch (error) {\n token = undefined;\n }\n }\n let response;\n if (attachment.contentUrl) {\n headers['Content-Type'] = 'application/octet-stream';\n response = yield node_fetch_1.default(attachment.contentUrl, { headers: headers });\n if (response && response.status && response.status >= 200 && response.status <= 299) {\n return yield response.buffer();\n }\n }\n return undefined;\n });\n }", "async function downloadFileHns(domain, customOptions) {\n /* istanbul ignore next */\n if (typeof domain !== \"string\") {\n throw new Error(\"Expected parameter domain to be type string, was type \".concat(typeof domain));\n }\n\n const opts = { ...defaultDownloadHnsOptions,\n ...this.customOptions,\n ...customOptions,\n download: true\n };\n const url = this.getHnsUrl(domain, opts); // Download the url.\n\n window.location.assign(url);\n return url;\n}", "function getFileUrl(aName, aAllowMissing=false) {\n let file = do_get_file(aName, aAllowMissing);\n return Services.io.newFileURI(file).spec;\n}", "function getDownloadURL$1(ref) {\n return getDownloadURL(ref);\n}", "async function getFileContent(skylinkUrl, customOptions) {\n /* istanbul ignore next */\n if (typeof skylinkUrl !== \"string\") {\n throw new Error(\"Expected parameter skylinkUrl to be type string, was type \".concat(typeof skylinkUrl));\n }\n\n const opts = { ...defaultDownloadOptions,\n ...this.customOptions,\n ...customOptions\n };\n const url = this.getSkylinkUrl(skylinkUrl, opts);\n return this.getFileContentRequest(url, opts);\n}", "printWorksite(id) {\n try {\n return this.request({\n url: `/worksites/${id}/download`,\n method: 'POST',\n responseType: 'blob',\n headers: { Accept: 'application/pdf' },\n save: false,\n });\n } catch (e) {\n // console.error(e)\n }\n }", "function download(host, url, cookies, callback) {\n var reqData = \"\";\n var headers = {\n 'Host': host,\n 'Cookie': cookies,\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(data, 'utf8')\n };\n var options = {\n hostname: host,\n port: 443,\n path: url,\n method: 'GET',\n headers: headers\n };\n var data = \"\";\n var req = https.request(options, (res) => {\n console.log('statusCode: ', res.statusCode);\n console.log('headers: ', res.headers);\n\n res.on('data', function (chunk) {\n data += chunk;\n });\n res.on('end', function () {\n callback(data);\n });\n });\n req.end();\n req.on(\"error\", (e) => {\n console.error(e);\n callback(null);\n });\n\n}", "fetch(options, data) {\n return new Promise((resolve, reject) => {\n const request = https.request(options);\n request.end(data);\n request.on('response', response => {\n response.body = '';\n response.on('data', data => response.body += data);\n response.on('end', () => resolve(response));\n });\n request.on('error', reject);\n });\n }", "function makeReq(href) {\n var req = new XMLHttpRequest;\n req.overrideMimeType(\"text/plain\");\n req.open(\"GET\", href, false);\n try {\n req.send(null);\n } catch (e) {\n }\n return req.responseText;\n}", "function GM_download_emu(url, name, options) {\n let defaultOptions = {\n onerror(err) { alert(\"Error: \" + r.statusText); },\n ontimeout() { alert(\"Timeout!\"); },\n timeout: 10000\n };\n options = { ...defaultOptions, ...options };\n name = cleanFilename(name);\n\n GM_xmlhttpRequest({\n method: 'GET',\n url: url,\n responseType: \"blob\",\n timeout: options.timeout,\n onload: function(r) {\n saveAs(r.response, name);\n },\n onerror: options.onerror,\n ontimeout: options.ontimeout,\n });\n}", "function getDownloadURL$1(ref) {\n ref = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"getModularInstance\"])(ref);\n return getDownloadURL(ref);\n}", "function getDownloadURL$1(ref) {\n ref = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"getModularInstance\"])(ref);\n return getDownloadURL(ref);\n}", "function downloadSAML() {\n\t$('#mainContainer').html('<div id=\"getSAML\"></div>');\n\tsetLoadImage('getSAML', '40px', '500px');\n\tsendHTMLAjaxRequest(false, 'getView/getSAMLCertificatePage.html', null, fnDisplayContent, null,'getSAML');\n}", "function getURL (url, cb) {\n log.trace(\"getUrl: \" + url);\n var client = false;\n if (url.match(/^https:/)) {\n client = https;\n } else if (url.match(/^http:/)) {\n client = http;\n }\n if (client) {\n client.get(url, function(response) {\n log.trace(\"response status code: \" + response.statusCode);\n var body = '';\n response.on('data', function (chunk) {\n body += chunk;\n });\n response.on('end', function () {\n cb(null, body);\n });\n }).on('error', function(err) {\n log.error(\"unable to http/s get bpmn file: \" + url + \" err: \" + util.inspect(err));\n cb(err, null)\n });\n } else if (url.match(/^file:/)) {\n var filepath = url.replace(/^file:\\/\\//, '');\n console.log('f:' + filepath);\n fs.readFile(filepath, 'utf8', function (err,data) {\n if (err) {\n log.error(\"unable to read bpmn file: \" + filepath + \" err: \" + util.inspect(err));\n cb({\"exception\" : true, \"message\" : err}, null);\n }\n cb(null, data);\n });\n\n } else {\n cb({\"exception\" : true, \"message\" : \"must be http or https URL\"}, null);\n }\n}", "function _blobAjax(url) {\n\t return new Promise(function (resolve, reject) {\n\t var xhr = new XMLHttpRequest();\n\t xhr.open('GET', url);\n\t xhr.withCredentials = true;\n\t xhr.responseType = 'arraybuffer';\n\n\t xhr.onreadystatechange = function () {\n\t if (xhr.readyState !== 4) {\n\t return;\n\t }\n\t if (xhr.status === 200) {\n\t return resolve({\n\t response: xhr.response,\n\t type: xhr.getResponseHeader('Content-Type')\n\t });\n\t }\n\t reject({ status: xhr.status, response: xhr.response });\n\t };\n\t xhr.send();\n\t });\n\t }", "function _blobAjax(url) {\n\t return new Promise(function (resolve, reject) {\n\t var xhr = new XMLHttpRequest();\n\t xhr.open('GET', url);\n\t xhr.withCredentials = true;\n\t xhr.responseType = 'arraybuffer';\n\n\t xhr.onreadystatechange = function () {\n\t if (xhr.readyState !== 4) {\n\t return;\n\t }\n\t if (xhr.status === 200) {\n\t return resolve({\n\t response: xhr.response,\n\t type: xhr.getResponseHeader('Content-Type')\n\t });\n\t }\n\t reject({ status: xhr.status, response: xhr.response });\n\t };\n\t xhr.send();\n\t });\n\t }", "function _blobAjax(url) {\n\t return new Promise(function (resolve, reject) {\n\t var xhr = new XMLHttpRequest();\n\t xhr.open('GET', url);\n\t xhr.withCredentials = true;\n\t xhr.responseType = 'arraybuffer';\n\n\t xhr.onreadystatechange = function () {\n\t if (xhr.readyState !== 4) {\n\t return;\n\t }\n\t if (xhr.status === 200) {\n\t return resolve({\n\t response: xhr.response,\n\t type: xhr.getResponseHeader('Content-Type')\n\t });\n\t }\n\t reject({ status: xhr.status, response: xhr.response });\n\t };\n\t xhr.send();\n\t });\n\t }", "function getFile(localUrl) {\n let extensionUrl = chrome.extension.getURL(localUrl);\n let xhr = new XMLHttpRequest();\n let response = null;\n\n xhr.open('GET', extensionUrl, false);\n xhr.onload = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n response = xhr.responseText;\n } else {\n console.error(xhr.statusText);\n }\n }\n };\n xhr.onerror = function() {\n console.error(xhr.statusText);\n };\n xhr.send(null);\n return response + '\\n\\n//# sourceURL=polydev' + localUrl;\n }", "function get (parsed, opts, fn) {\n opts.http = https;\n http(parsed, opts, fn);\n}", "function get (parsed, opts, fn) {\n opts.http = https;\n http(parsed, opts, fn);\n}", "function downloadURL(url, downloadedPath) {\n return new Promise((resolve, reject) => {\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';\n\n // debug(`${url}:${downloadedPath}`);\n\n const outputStream = fs.createWriteStream(downloadedPath);\n outputStream.on('error', (e) => {\n reject(new Error(`download() : pipe error ${e}`));\n }).on('data', () => {\n // debug(d);\n }).on('finish', () => {\n resolve(downloadedPath);\n });\n\n request.get(url)\n .on('response', () => {})\n .on('error', (response) => {\n debug(`downloadURL() : request error ${response}`);\n reject(new Error(`download() : request error ${response}`));\n })\n .pipe(outputStream);\n });\n }", "function SendDownloadLinkToEmailOnBegin() {\n //Show spinner\n $('#modal-direct-upload-send-email-spin').css('display', '');\n //Hide text\n $('#modal-direct-upload-send-email-text').css('display', 'none');\n\n //Blur input\n $('#modal-direct-upload-send-email-input').blur();\n\n //Set read only inputs\n $('#modal-direct-upload-send-email-input').prop('readonly', true);\n //Disable submit button\n $('#modal-direct-upload-send-email-btn').prop('disabled', true);\n }", "toDataURL(url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"get\", url);\n xhr.responseType = \"blob\";\n xhr.onload = function () {\n var fr = new FileReader();\n fr.onload = function () {\n callback(fr.result);\n };\n fr.readAsDataURL(xhr.response);\n };\n xhr.send();\n }", "function getAttachmentBase64(grAttachment /* GlideRecord of the attachment */) {\n\tvar gsa = new GlideSysAttachment();\n\tvar attBytes = gsa.getBytes(grAttachment); //Gets it as a Java Binary Array, not useable yet\n\tvar attBase64 = GlideStringUtil.base64Encode(attBytes); //Converts it into a Javascript string, holding the contents as a Base6-encoded string\n\t\n\treturn attBase64;\n}", "async function downloadFile(url, filename) {\n const res = await fetch(url, {\n method: 'GET',\n headers: {\n \"Authorization\": 'Basic ' + base64.encode(constants.API_KEY + ':' + constants.API_SECRET)\n }\n });\n\n return new Promise((resolve, reject) => {\n const dest = fs.createWriteStream(filename);\n\n res.body.pipe(dest);\n\n res.body.on('error', (err) => { reject(err) });\n dest.on('error', (err) => { reject(err) });\n dest.on('finish', () => { resolve() });\n });\n}", "_createApiUrl() {\n this._apiUrl = `https://api.trello.com/1/cards/${this._cardId}/attachments/${this._attachmentId}`;\n }", "function get_file(url) {\n\tconst request = new XMLHttpRequest()\n\t// This throws a warning about synchronous requests being deprecated\n\trequest.open('GET',url,false)\n\trequest.send()\n\treturn request.responseText\n}", "function getDownloadUrl(id) {\n\treturn fetch('https://www.yt-download.org/api/button/mp3/' + id)\n\t\t.then(response => response.text())\n\t\t.then(text => {\n\t\t\tconst html = new DOMParser().parseFromString(text, 'text/html');\n\t\t\tconst download_link = html.documentElement.querySelector('div.download > a').href;\n\t\t\treturn download_link;\n\t\t})\n\t\t.catch(error => {\n\t\t\tconsole.log(error);\n\t\t\treturn null;\n\t\t});\n}", "function _blobAjax(url) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.withCredentials = true;\n xhr.responseType = 'arraybuffer';\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== 4) {\n return;\n }\n if (xhr.status === 200) {\n return resolve({\n response: xhr.response,\n type: xhr.getResponseHeader('Content-Type')\n });\n }\n reject({status: xhr.status, response: xhr.response});\n };\n xhr.send();\n });\n }", "function downloadMeme() {\n const downloadLink = document.getElementById(\"hidden-download\");\n const meme = document.getElementById(\"screenshot\").src;\n downloadLink.setAttribute(\"href\", meme);\n downloadLink.setAttribute(\"download\", \"meme\");\n downloadLink.click();\n downloadLink.removeAttribute(\"href\");\n downloadLink.removeAttribute(\"download\");\n}" ]
[ "0.5525053", "0.5393399", "0.52978003", "0.52469337", "0.5226839", "0.5204368", "0.5202747", "0.5202747", "0.5176209", "0.51752496", "0.51749665", "0.5170118", "0.5170118", "0.5165892", "0.51444054", "0.5136136", "0.51212376", "0.51186424", "0.50992525", "0.5085678", "0.508078", "0.5078666", "0.50545126", "0.50545126", "0.5052476", "0.5033564", "0.5031633", "0.5026783", "0.50256795", "0.5012171", "0.5010804", "0.5007881", "0.49746075", "0.4961987", "0.49613062", "0.49451533", "0.49396032", "0.49205467", "0.49094516", "0.49032313", "0.488913", "0.48817042", "0.48811463", "0.48806626", "0.48743132", "0.487383", "0.48726618", "0.48726618", "0.48505777", "0.48459947", "0.48424673", "0.483232", "0.48167473", "0.48156065", "0.4809435", "0.48041815", "0.47951502", "0.47927183", "0.47893822", "0.47883773", "0.47858256", "0.47721073", "0.4763097", "0.4761722", "0.4760955", "0.47366074", "0.47215694", "0.4713782", "0.47026545", "0.47010273", "0.4692949", "0.46895063", "0.4666838", "0.4664922", "0.46472752", "0.46394897", "0.46381587", "0.4638089", "0.46341267", "0.46305028", "0.4623599", "0.4623599", "0.46184546", "0.4611315", "0.4597044", "0.4597044", "0.4597044", "0.45923778", "0.45860043", "0.45860043", "0.45769393", "0.45768887", "0.45764023", "0.457485", "0.45730302", "0.45640495", "0.45617548", "0.45543507", "0.45416412", "0.4541071" ]
0.59386057
0
private function defined inside of another function
function hide(ele) { ele.classList.remove(showClass); ele.classList.add(hideClass); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _privateFn(){}", "_privateFunction() {}", "function privateFunction(){\n\t// That will be used only on this file\n}", "function _____SHARED_functions_____(){}", "function privateFunction() {\n\n}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "private public function m246() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function __func(){}", "static private internal function m121() {}", "function myPrivateFn ( param1, param2 ) {\n\n }", "function priv () {\n\t\t\t\n\t\t}", "private internal function m248() {}", "static private protected public internal function m117() {}", "static private protected internal function m118() {}", "function miFuncion (){}", "transient private protected public internal function m181() {}", "function fn() {\n\t\t }", "function privateFunction1() {\n return \"private function 1\"\n}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "function StupidBug() {}", "privateMethod() {\n\t}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "static transient private protected internal function m55() {}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "static transient final private internal function m43() {}", "function doSomething() {\n _somePrivateMethod();\n // Code goes here...\n return;\n}", "function privateFunc() {\n console.log('This is private...');\n}", "function fuction() {\n\n}", "static transient private protected public internal function m54() {}", "function yourPrivateFunc() {\n nn.log($page.globalVariable, 'debug');\n nn.log('private function testing...', 'debug');\n nn.log(cms.config.IS_DEBUG, 'debug');\n nn.log(yourPrivateVariable, 'debug');\n }", "function _somePrivateMethod() {\n // Code goes here...\n return;\n}", "function wa(){}", "_private_method() {\n console.log('private hey');\n }", "function miFuncion(){\n\n}", "function fm(){}", "static final private protected public internal function m102() {}", "static transient private public function m56() {}", "function oi(){}", "transient final private protected internal function m167() {}", "static transient final protected public internal function m46() {}", "function modulePrivateMethod () {\n return;\n }", "function modulePrivateMethod () {\n return;\n }", "static transient final protected internal function m47() {}", "function fuctionPanier(){\n\n}", "function Helper() {}", "static protected internal function m125() {}", "static final private internal function m106() {}", "function ea(){}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function fun() { }", "transient private public function m183() {}", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function doOtherStuff() {}", "static transient final private protected internal function m40() {}", "static transient final protected function m44() {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function reserved(){}", "function Scdr() {\r\n}", "function fPrivate() {\n console.log(`private f method ${a}`);\n }", "function Func_s() {\n}", "function func() {\n var priv = \"secret code\";\n}", "static private public function m119() {}", "function TMP(){return;}", "function TMP(){return;}", "function FunctionUtils() {}", "function func(){\r\n\r\n}", "function nonewFun() {}", "function accessesingData1() {\n\n}", "function accessesingData1() {\n\n}", "static transient private internal function m58() {}", "static final private protected internal function m103() {}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "transient final private protected public internal function m166() {}", "function Coolmodule(){\n\nvar something = \"Cool\" ; // The private data member\nvar cool = [1,2,3] ; // The private data member\n\nfunction doSomething(){\n\tconsole.log(something) ;\n}\n\nfunction doAnother(){\n\tconsole.log(cool.join(\" ! \"));\n}\n\nreturn { // Returning the object which hides the internal functions which access the private Data member\n\tdoSomething : doSomething,\n\tdoAnother : doAnother\n}\n\n}", "function dummyReturn(){\n}", "function privateMethod() {\n console.log(\"Soy un metodo privado\")\n }", "function exampleFunction1() {\n /* SOME CODE */\n }", "function Expt() {\r\n}", "function privateMethod(){\n console.log( \"I am private\" );\n }", "function ourReusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "function an(){}", "function funcionPorDefinicion(){\n //Body\n }", "function privateLog() {\n console.log('Private Function');\n}", "function fun1( /*parametros opcionais*/ ){ /*retorno opcional*/ }", "function da(){}", "function da(){}" ]
[ "0.7571467", "0.73252374", "0.7186675", "0.7097648", "0.69567215", "0.68375", "0.677175", "0.676269", "0.6695914", "0.6695914", "0.6695914", "0.66492236", "0.6640564", "0.6586807", "0.6585637", "0.65433586", "0.65216255", "0.65185213", "0.649684", "0.6475942", "0.64243406", "0.64117765", "0.6401191", "0.6371031", "0.6355861", "0.6320045", "0.6316979", "0.6257577", "0.6257577", "0.6257577", "0.62212807", "0.6214933", "0.6214933", "0.6212569", "0.6201359", "0.61569387", "0.6116066", "0.6105365", "0.61008936", "0.60900706", "0.6084851", "0.60848135", "0.6067666", "0.60667735", "0.6064389", "0.6057755", "0.6034891", "0.60310477", "0.6030806", "0.6025063", "0.6025063", "0.6019378", "0.5996515", "0.59825903", "0.5982015", "0.596823", "0.596627", "0.5963808", "0.5963808", "0.5963808", "0.59567744", "0.5940533", "0.592705", "0.5915188", "0.5884538", "0.5881343", "0.5880278", "0.5880278", "0.5880278", "0.5880278", "0.5872539", "0.5863239", "0.5862522", "0.582972", "0.58216", "0.579874", "0.5790454", "0.5790454", "0.5787382", "0.5786013", "0.5782567", "0.5773492", "0.5773492", "0.5772496", "0.57582295", "0.5756461", "0.5756461", "0.5753977", "0.5753875", "0.5721905", "0.57218087", "0.5713495", "0.57047623", "0.5694699", "0.56884915", "0.568076", "0.5678954", "0.5664751", "0.5660446", "0.5657317", "0.5657317" ]
0.0
-1
private function defined inside of another function
function show(ele) { ele.classList.remove(hideClass); ele.classList.add(showClass); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _privateFn(){}", "_privateFunction() {}", "function privateFunction(){\n\t// That will be used only on this file\n}", "function _____SHARED_functions_____(){}", "function privateFunction() {\n\n}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "private public function m246() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function __func(){}", "static private internal function m121() {}", "function priv () {\n\t\t\t\n\t\t}", "function myPrivateFn ( param1, param2 ) {\n\n }", "private internal function m248() {}", "static private protected public internal function m117() {}", "static private protected internal function m118() {}", "function miFuncion (){}", "transient private protected public internal function m181() {}", "function fn() {\n\t\t }", "function privateFunction1() {\n return \"private function 1\"\n}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "function StupidBug() {}", "privateMethod() {\n\t}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "static transient private protected internal function m55() {}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "static transient final private internal function m43() {}", "function doSomething() {\n _somePrivateMethod();\n // Code goes here...\n return;\n}", "function privateFunc() {\n console.log('This is private...');\n}", "function fuction() {\n\n}", "static transient private protected public internal function m54() {}", "function yourPrivateFunc() {\n nn.log($page.globalVariable, 'debug');\n nn.log('private function testing...', 'debug');\n nn.log(cms.config.IS_DEBUG, 'debug');\n nn.log(yourPrivateVariable, 'debug');\n }", "function _somePrivateMethod() {\n // Code goes here...\n return;\n}", "function wa(){}", "_private_method() {\n console.log('private hey');\n }", "function fm(){}", "function miFuncion(){\n\n}", "static final private protected public internal function m102() {}", "static transient private public function m56() {}", "function oi(){}", "transient final private protected internal function m167() {}", "static transient final protected public internal function m46() {}", "function modulePrivateMethod () {\n return;\n }", "function modulePrivateMethod () {\n return;\n }", "static transient final protected internal function m47() {}", "function fuctionPanier(){\n\n}", "function Helper() {}", "static protected internal function m125() {}", "static final private internal function m106() {}", "function ea(){}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function fun() { }", "transient private public function m183() {}", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function doOtherStuff() {}", "static transient final private protected internal function m40() {}", "static transient final protected function m44() {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function reserved(){}", "function Scdr() {\r\n}", "function fPrivate() {\n console.log(`private f method ${a}`);\n }", "function Func_s() {\n}", "function func() {\n var priv = \"secret code\";\n}", "static private public function m119() {}", "function TMP(){return;}", "function TMP(){return;}", "function FunctionUtils() {}", "function func(){\r\n\r\n}", "function nonewFun() {}", "static transient private internal function m58() {}", "function accessesingData1() {\n\n}", "function accessesingData1() {\n\n}", "static final private protected internal function m103() {}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "transient final private protected public internal function m166() {}", "function Coolmodule(){\n\nvar something = \"Cool\" ; // The private data member\nvar cool = [1,2,3] ; // The private data member\n\nfunction doSomething(){\n\tconsole.log(something) ;\n}\n\nfunction doAnother(){\n\tconsole.log(cool.join(\" ! \"));\n}\n\nreturn { // Returning the object which hides the internal functions which access the private Data member\n\tdoSomething : doSomething,\n\tdoAnother : doAnother\n}\n\n}", "function dummyReturn(){\n}", "function privateMethod() {\n console.log(\"Soy un metodo privado\")\n }", "function exampleFunction1() {\n /* SOME CODE */\n }", "function Expt() {\r\n}", "function privateMethod(){\n console.log( \"I am private\" );\n }", "function ourReusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "function an(){}", "function funcionPorDefinicion(){\n //Body\n }", "function privateLog() {\n console.log('Private Function');\n}", "function fun1( /*parametros opcionais*/ ){ /*retorno opcional*/ }", "function da(){}", "function da(){}" ]
[ "0.7569897", "0.7323845", "0.7184587", "0.7097763", "0.69543916", "0.68383545", "0.67730814", "0.6763524", "0.66957223", "0.66957223", "0.66957223", "0.66489774", "0.6640806", "0.6584797", "0.6584436", "0.65443206", "0.65216", "0.6518762", "0.6496795", "0.6476739", "0.6424182", "0.640982", "0.6402308", "0.6372023", "0.6356719", "0.6319375", "0.6315292", "0.6257405", "0.6257405", "0.6257405", "0.6221677", "0.6214515", "0.6214515", "0.62134737", "0.62006503", "0.6154753", "0.6115218", "0.6105796", "0.60996485", "0.6089206", "0.6085076", "0.6082991", "0.60668", "0.6066781", "0.606504", "0.6058133", "0.60355717", "0.6032015", "0.603139", "0.6023642", "0.6023642", "0.602021", "0.599551", "0.5982441", "0.59820247", "0.5969277", "0.596699", "0.59634674", "0.59634674", "0.59634674", "0.5956741", "0.5941414", "0.59260666", "0.5914886", "0.588537", "0.5881955", "0.58809316", "0.58809316", "0.58809316", "0.58809316", "0.5872232", "0.58629686", "0.58607423", "0.5829101", "0.58200955", "0.5798258", "0.57910776", "0.57910776", "0.57864404", "0.57851255", "0.57820237", "0.57731825", "0.57730675", "0.57730675", "0.5759223", "0.57555974", "0.57555974", "0.5754526", "0.57530504", "0.5722087", "0.57199603", "0.5712052", "0.57047004", "0.569257", "0.56876314", "0.56804127", "0.5678712", "0.56634986", "0.5660207", "0.5657406", "0.5657406" ]
0.0
-1
create an object contructor for the about page
function About(obj) { this.name = obj.name; this.giturl = obj.giturl; this.porturl = obj.porturl; this.description = obj.description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AboutViewModel() {\n \n\t \n\t \n return AboutViewModel();\n }", "function load_about() {\n\t\tvar about_card = new UI.Card({\n\t\t\tbody: 'WMATA With You\\n' +\n\t\t\t\t'version 2.5\\n' +\n\t\t\t\t'by Alex Lindeman\\n\\n' +\n\t\t\t\t'Built with Pebble.js and the WMATA API.',\n\t\t\tscrollable: true\n\t\t});\n\t\tabout_card.show();\n\t}", "function About() {\n\n}", "function displayAbout() {\n\t\t\n\t\tvar newdiv1 = document.createElement(\"div\");\n\t\t$.getJSON(\"https://people.rit.edu/~sarics/web_proxy.php?path=about\")\n \n\t\t.done(function (data) {\n\t\t\t\n\t\t\tvar newdiv2 = document.createElement(\"div\");\n\t\t\tvar newdiv3 = document.createElement(\"div\");\n\t\t\tvar newdiv4 = document.createElement(\"div\");\n\t\t\t\t\t\n\t\t\t$(newdiv1).append(document.createTextNode(data.title));\n\t\t\t$(newdiv1).attr(\"id\",\"title\");\n\t\n \t$(newdiv2).attr(\"id\",\"dscrp\");\n\t\t\t$(newdiv3).attr(\"id\",\"quote\");\n\t\t\t\n\t\t\t$(newdiv4).attr(\"id\",\"Author\");\t\t\t\t\t\n\t\t\t$(newdiv2).append(document.createTextNode(data.description));\n\t\t\t\n\t\t\t$(newdiv3).append(document.createTextNode(data.quote));\n\t\t\t$(newdiv4).append(document.createTextNode(data.quoteAuthor));\n\t\t\t\t\t\n\t\t\t$(\"#about\").append(newdiv1);\n\t\t\t$(\"#about\").append(newdiv2);\n\t\t\t\t\t\n\t\t\t$(\"#about\").append(newdiv3);\n\t\t\t$(\"#about\").append(newdiv4);\n\t\t\t\n\t\t})\n\t\t\n\t\t.fail(function () {\n alert('some Problem occured');\n });\n\t\t\n\t}", "function renderAboutPage(){\n\t\tvar page = $('.about');\n\t\tpage.addClass('visible');\n\t}", "function renderAboutPage(){\n\t\tvar page = $('.about');\n\t\tpage.addClass('visible');\n\t}", "function OogaahTutorialContent1() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function editor_about(objname) {\r\n showModalDialog(_editor_url + \"/html/egovframework/com/cmm/utl/htmlarea/popups/about.html\", window, \"resizable: yes; help: no; status: no; scroll: no; \");\r\n}", "constructor(title, author,pages,technology) { // constructor com as informações cosntantes da nova classe\n super(title,author,pages); // informações herdadas da classe superior\n this.technology = technology; // nova atribuição da nova classe.\n\n }", "constructor(title, author, pages) {\n super(title);\n this._author = author;\n this._pages = pages;\n }", "function OogaahTutorialContent4() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function aboutPage()\n {\n // did we already download that?\n if (app.graphs === void 0) {\n $.getJSON(\"static/js/graphs.json\", function(graphs) {\n app.graphs = graphs;\n\n // mutate once to turn 0.75(...) to 75.(...)\n app.graphs.forEach(function (graph) {\n graph.series.forEach(function (member) {\n member.data.forEach(function (datum, _i, data) {\n // mutate array members\n data[_i] = (datum * 100);\n });\n });\n });\n\n // key iteration\n app.graphs.forEach(function (graph) {\n drawLineGraph(graph.title, {series: graph.series}, graph.time, graph.title);\n });\n });\n\n } else {\n // key iteration\n $(\"#line-graphs\").empty();\n\n app.graphs.forEach(function (graph) {\n drawLineGraph(graph.title, {series: graph.series}, graph.time, graph.title);\n });\n }\n\n // Clear graph content and about page if there\n //$('#metro-pie-charts').empty()\n //$('#census-pie-charts').empty()\n }", "function OogaahTutorialContent3A() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "showAbout(request, response) {\n return response.render('app/pages/about-us');\n }", "function _(id) {\n\n // About object is returned if there is no 'id' parameter\n var about = {\n Version: 0.5,\n Author: \"Sujeet Srivastava\",\n Created: \"Fall 2015\",\n Updated: \"04 Jun 2015\"\n };\n\n if (id) {\n\n // Avoid clobbering the window scope:\n // return a new _ object if we're in the wrong scope\n if (window === this) {\n return new _(id);\n }\n\n // We're in the correct object scop:\n // Init our element object and return the object\n this.e = document.getElementById(id);\n return this;\n } else {\n // No 'id' paramter was given, return the 'about' object\n return about;\n }\n}", "async createAboutObject() {\n return this.aic.getAboutData();\n }", "function loadAboutMe(profileObj) {\n let aboutme = document.getElementById(\"aboutme\");\n createAboutMe(aboutme, profileObj);\n}", "function getAboutViewModel(callback) {\n var page = topLevelPages.about;\n callback(null, new ViewModel(page.title, page.pageTemplateName));\n }", "function OogaahTutorialContent2() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function aboutmeClick(){\r\n\t\tcallAjax(createAboutme, \"aboutme\", \"get\");\r\n\t}", "constructor(name) {\n this.name = name;\n this.hidden = true;\n if (!overview_instance) overview_instance = this;\n return overview_instance;\n }", "static initialize(obj, events, pageInfo) { \n obj['events'] = events;\n obj['page_info'] = pageInfo;\n }", "function initialisePage(){\n\t\t\tcurrent_tab = \"about\";\n\t\t\tgenerateNav(register_navevents);\n\t\t\tgenerateFramework(current_tab, generatePage);\n\t\t\t// Enable button again\n\t\t\tbuttonOff();\n\t\t}", "static about() {\n return \"a vehicle is a means of transportion.\"\n }", "function createIntroWindow() {\n pageCollection.showHelp();\n}", "function OogaahTutorialContent33() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "render () {\n\t\t// se retorna la vista \n\t\treturn (\n\t\t\t// div about\n\t\t\t<div className=\"About\">\n\t\t\t\t// se coloca el titulo \n\t\t\t\t<h1>Acerca de.</h1>\n\t\t\t</div>\n\t\t);\n\t}", "function OogaahTutorialContent3C() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function OogaahTutorialContent31() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function Newhomepage(browser)\n{\n this.browser= browser;\n}", "openHelpPage() {}", "constructor(author, title, pages) {\n super(title);\n this._author = author;\n this._pages = pages;\n }", "function OogaahTutorialContent35() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "createAboutWindow() {\n if( this._aboutDialog ) { return; }\n\n const w = new Electron.BrowserWindow( {\n width: 400,\n height: 256,\n resizable: false,\n alwaysOnTop: true\n } );\n\n w.setMenu( null );\n\n w.on( 'closed', () => {\n if( DEBUG ) { Util.log( 'The about application window was closed.' ); }\n\n this._aboutDialog = null;\n } );\n\n const filePath = Path.join( __dirname, 'about.html' );\n w.loadURL( 'file://' + filePath );\n\n this._aboutDialog = w;\n }", "constructor(title,author,pages){ // construção dos campos da classe com título,autor e n depáginas\n this.title= title; // Atribui informações ao campo\n this.author= author;\n this.pages= pages;\n }", "function OogaahTutorialContent34() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function OogaahTutorialContent34() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function zoto_detail_meta_info(options) {\n\tthis.options = options || {};\n\tthis.options.mode = this.options.mode || 'page'; // 'page' or 'modal'\n\n\t/*\n\t * Create our page elements\n\t */\n\tvar desc_epaper_options = {'attribute': \"description\", 'multi_line': 1, 'starting_text': _(\"click here to add a photo description.\")};\n\tvar tag_cloud_options = {'can_delete': true, 'weighted': false};\n\tif(this.options.mode == 'modal') {\n\t\tdesc_epaper_options['maxchar'] = 300;\n\t\ttag_cloud_options['tag_count'] = 15;\n\t} else {\n\t\tthis.modal_licensing = new zoto_modal_licensing(this.options.mode);\n\t\tthis.a_edit_license = A({'href':\"javascript:void(0)\"}, \"edit\");\n\t\tthis.edit_license = SPAN({'style':\"font-size: 9px;\"}, \" (\", this.a_edit_license, \")\");\n\t}\n\tthis.title_epaper = new zoto_e_paper_lite({'id': \"title_epaper\", 'blur_update': true, 'attribute': \"title\", 'starting_text': _(\"click here to add a title\")});\n\tthis.description_epaper = new zoto_e_paper_image_attributes(desc_epaper_options);\n\tthis.tags_header = DIV({'style': \"margin-bottom: 3px\"}, H3({}, _('tags')));\n\tthis.look_ahead = new zoto_tag_lookahead({min_length: 3, allow_spaces: true});\n\tthis.tag_cloud = new zoto_image_tag_cloud(tag_cloud_options);\n\n\t//replaceChildNodes(this.albums_header, H3({'style': \"margin-top: 10px;\"}, _(\"albums\")));\n\t//this.albums_header = DIV({'syle': \"margin-bottom: 10px; margin-top: 10px;\"});\n\tthis.albums_header = H3({'style': \"margin-top: 10px;\"}, _(\"albums\"));\n\tthis.album_list = SPAN({}, \"\");\n\n\t//\n\t// Advanced info\n\t//\n\tthis.perms = SPAN({});\n\tthis.license_text = SPAN({}, \"\");\n\n\tthis.date_taken_link = A({'href': \"javascript: void(0);\"}, \"\");\n\tthis.date_taken = SPAN({});\n\tthis.date_taken_holder = SPAN({}, _('taken: '), this.date_taken);\n\n\tthis.date_uploaded = SPAN({});\n\tthis.date_uploaded_holder = SPAN({}, _(\"uploaded: \"), this.date_uploaded);\n\t\t\n\t/* Advanced info */\n\tvar advanced = DIV({'style': \"margin-top: 5px\"},\n\t\tH3({}, _('advanced info')),\n\t\tthis.perms,\n\t\tthis.license_text, BR({'clear':\"ALL\"}),\n\t\tthis.date_taken_holder, BR({'clear':\"ALL\"}),\n\t\tthis.date_uploaded_holder, BR()\n\t);\n\n\tif (this.options.mode == \"page\") {\n\t\n\t\tthis.filename = SPAN({});\n\t\tthis.filename_holder = SPAN({}, _(\"filename\"), ': ', this.filename, BR());\n\t\n\t\tthis.source_name = SPAN({});\n\t\tthis.source_name_holder = SPAN({}, _(\"uploaded via\"), \": \", this.source_name, BR());\n\t\n\t\tthis.camera_make = SPAN({});\n\t\tthis.camera_make_holder = SPAN({}, _(\"make\"), \": \", this.camera_make, BR());\n\t\n\t\tthis.camera_model = SPAN({});\n\t\tthis.camera_model_holder = SPAN({}, _(\"model\"), \": \", this.camera_model, BR());\n\t\n\t\tthis.iso_speed = SPAN({});\n\t\tthis.iso_speed_holder = SPAN({}, _(\"iso speed\"), \": \", this.iso_speed, BR());\n\t\n\t\tthis.focal_length = SPAN({});\n\t\tthis.focal_length_holder = SPAN({}, _(\"focal length\"), \": \", this.focal_length, BR());\n\t\n\t\tthis.fstop = SPAN({});\n\t\tthis.fstop_holder = SPAN({}, _(\"f-stop\"), \": \", this.fstop, BR());\n\t\n\t\tthis.exposure_time = SPAN({});\n\t\tthis.exposure_time_holder = SPAN({}, _(\"exposure time\"), \": \", this.exposure_time, BR());\n\t\n\t\tvar extra_advanced = DIV({id: 'extra_advanced'}, \n\t\t\tthis.filename_holder,\n\t\t\tthis.source_name_holder,\n\t\t\tthis.camera_make_holder,\n\t\t\tthis.camera_model_holder,\n\t\t\tthis.iso_speed_holder,\n\t\t\tthis.focal_length_holder,\n\t\t\tthis.fstop_holder,\n\t\t\tthis.exposure_time_holder\n\t\t);\n\t\tappendChildNodes(advanced, extra_advanced);\n\t\tthis.advanced_link = element_opener(extra_advanced, _(\"view all advanced info\"), _(\"hide advanced info\"));\n\t} else {\n\t\tthis.advanced_link = A({'href': \"javascript: void(0);\"}, _(\"more\"));\n\t}\n\tappendChildNodes(advanced, this.advanced_link);\n\n\tthis.el = DIV({id: 'meta_holder'},\n\t\tthis.title_epaper.el,\n\t\tthis.description_epaper.el,\n\t\tthis.tags_header,\n\t\tthis.look_ahead.el,\n\t\tthis.tag_cloud.el,\n\t\tthis.albums_header,\n\t\tthis.album_list,\n\t\tadvanced\n\t);\n\t\n\tconnect(this.title_epaper, 'EPAPER_EDITED', this, 'handle_edit');\n\tconnect(this.title_epaper, 'IMAGE_ATTRIBUTE_CHANGED', this, function(new_value) {\n\t\tthis.info.title = new_value;\n\t});\n\tconnect(this.tag_cloud, 'TAG_CLICKED', this, function(tag_name) {\n\t\tsignal(this, 'TAG_CLICKED', tag_name);\n\t});\n\tconnect(this.description_epaper, 'IMAGE_ATTRIBUTE_CHANGED', this, function(new_value) {\n\t\tthis.info.description = new_value;\n\t});\n\tconnect(this.look_ahead, 'NEW_TAG_ADDED', this.tag_cloud, 'refresh');\n\tconnect(this.look_ahead, 'NEW_TAG_ADDED', this, function(){\n\t\tsignal(this, 'NEW_TAG_ADDED');\n\t});\n\tconnect(authinator, 'USER_LOGGED_IN', this, 'update');\n\tconnect(this.date_taken_link, 'onclick', this, function(e) {\n\t\tsignal(this, 'DATE_CLICKED', this.info.date);\n\t});\n\n\tif (this.options.mode == \"page\") {\n\t\tconnect(this.a_edit_license, 'onclick', this, function(e){\n\t\t\tthis.modal_licensing.handle_image_detail_click(this.media_id)\n\t\t});\n\t\tconnect(this.modal_licensing, \"LICENSE_UPDATED\", this, function(result){\n\t\t\tthis.info.license = Number(result);\n\t\t\tthis.update();\n\t\t});\n\t} else {\n\t\tconnect(this.advanced_link, 'onclick', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t\tconnect(this.description_epaper, 'MORE_CLICKED', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t\tconnect(this.tag_cloud, 'MORE_CLICKED', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t}\n\n\tthis.a_cc_icon_attribution = this.create_license_icon(\n\t\t['attribution'], \"by\");\n\tthis.a_cc_icon_noderivs = this.create_license_icon(\n\t\t['attribution', 'noderivs'], \"by-nd\");\n\tthis.a_cc_icon_noncomm_noderivs = this.create_license_icon(\n\t\t['attribution', 'noderivs', 'noncomm'], \"by-nc-nd\");\n\tthis.a_cc_icon_noncomm = this.create_license_icon(\n\t\t['attribution', 'noncomm'], \"by-nc\");\n\tthis.a_cc_icon_noncomm_sharealike = this.create_license_icon(\n\t\t['attribution', 'noncomm', 'sharealike'], \"by-nc-sa\");\n\tthis.a_cc_icon_sharealike = this.create_license_icon(\n\t\t['attribution', 'sharealike'], 'by-sa');\n}", "aboutPage() {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }", "function OogaahTutorialContent36() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function OogaahTutorialContent37() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function getAboutUs() {\n\tvar aboutus = document.createElement(\"div\");\n\t\n\tvar h2 = document.createElement(\"h2\");\n\th2.innerHTML = \"About Us\";\n\t\n\tvar info1 = document.createElement(\"p\");\n\tinfo1.innerHTML = \"Computer Forge at CU is a student organization that promotes software project collaboration. Any full-time student at the University of Colorado Boulder can become a member. Some of the benefits of being a member include:\";\n\t\n\tvar ol = document.createElement(\"ol\");\n\t\n\tvar li0 = document.createElement(\"li\");\n\tli0.innerHTML = \"Members can post projects & contact each other on this site.\";\n\t\n\tvar li1 = document.createElement(\"li\");\n\tli1.innerHTML = \"Members will get hosting privileges on the CU Boulder Computer Science Department's OpenStack cloud.\";\n\t\n\tvar li2 = document.createElement(\"li\");\n\tli2.innerHTML = \"Members can also attend Computer Forge seminars where they can learn and implement knowledge on software development, including server implementation, scaling, security, databases, and more.\";\n\t\n\tvar info2 = document.createElement(\"p\");\n\tinfo2.innerHTML = \"If you are interested in becoming a member, you can find information about that by clicking the 'Become A Member' button above.\";\n\t\n\tol.appendChild(li0);\n\tol.appendChild(li1);\n\tol.appendChild(li2);\n\t\n\taboutus.appendChild(h2);\n\taboutus.appendChild(info1);\n\taboutus.appendChild(ol);\n\taboutus.appendChild(info2);\n\t\n\t/* current executive council */\n\tvar exech2 = document.createElement(\"h2\");\n\texech2.innerHTML = \"Executive Council\";\n\t\n\tvar president = document.createElement(\"h4\");\n\tpresident.innerHTML = \"Eric Fossas (President) - [email protected]\";\n\t\n\tvar presidentInfo = document.createElement(\"p\");\n\tpresidentInfo.innerHTML = \"Eric is a senior computer science major. The responsibilities of the President include the coordination of organization's principle tasks, such as managing the OpenStack, supervising this website, and hosting seminars. In addition, the President applies for funding and communicates directly with the computer science department and the organization's faculty advisor.\";\n\t\n\tvar vptechnology = document.createElement(\"h4\");\n\tvptechnology.innerHTML = \"Callie Jones (VP of Technology) - [email protected]\";\n\t\n\tvar vptechnologyInfo = document.createElement(\"p\");\n\tvptechnologyInfo.innerHTML = \"Callie is a junior computer science major. The responsibilities of the Vice President of Technology include managing the organization's allocated OpenStack resources, such as creating and destroying VMs for members to use.\";\n\t\n\tvar vpnetworks = document.createElement(\"h4\");\n\tvpnetworks.innerHTML = \"Ryan Craig (VP of Networking) - [email protected]\";\n\t\n\tvar vpnetworksInfo = document.createElement(\"p\");\n\tvpnetworksInfo.innerHTML = \"Ryan is a senior-ish computer science major. The responsibilities of the Vice President of Networking include the management of this website and granting accounts to new members.\";\n\t\n\tvar vpseminars = document.createElement(\"h4\");\n\tvpseminars.innerHTML = \"Cameron Tierney (VP of Seminars) - [email protected]\";\n\t\n\tvar vpseminarsInfo = document.createElement(\"p\");\n\tvpseminarsInfo.innerHTML = \"Cameron is a senior computer science major. The responsibilities of the Vice President of Seminars include hosting the organization's seminars where we teach and discuss important topics in server development and cloud computing.\";\n\t\n\tvar vpfinances = document.createElement(\"h4\");\n\tvpfinances.innerHTML = \"Ryan Riley (VP of Finances) - [email protected]\";\n\t\n\tvar vpfinancesInfo = document.createElement(\"p\");\n\tvpfinancesInfo.innerHTML = \"Ryan is a senior computer science major. The responsibilities of the Vice President of Finances include managing spending of the organization's allocated funding.\";\n\t\n\tvar vpelections = document.createElement(\"h4\");\n\tvpelections.innerHTML = \"Jacob Brauchler (VP of Elections) - [email protected]\";\n\t\n\tvar vpelectionsInfo = document.createElement(\"p\");\n\tvpelectionsInfo.innerHTML = \" is a senior computer science major. The responsibilities of the Vice President of Elections include organizing the yearly election for President.\";\n\t\n\taboutus.appendChild(exech2);\n\taboutus.appendChild(president);\n\taboutus.appendChild(presidentInfo);\n\taboutus.appendChild(vptechnology);\n\taboutus.appendChild(vptechnologyInfo);\n\taboutus.appendChild(vpnetworks);\n\taboutus.appendChild(vpnetworksInfo);\n\taboutus.appendChild(vpseminars);\n\taboutus.appendChild(vpseminarsInfo);\n\taboutus.appendChild(vpfinances);\n\taboutus.appendChild(vpfinancesInfo);\n\taboutus.appendChild(vpelections);\n\taboutus.appendChild(vpelectionsInfo);\n\t\n\t/* link to bylaws */\n\tvar bylaws = document.createElement(\"h2\");\n\tbylaws.innerHTML = \"ByLaws\";\n\t\n\tvar bylawsLink = document.createElement(\"a\");\n\tbylawsLink.setAttribute(\"href\", \"CUCF_ByLaws.pdf\");\n\tbylawsLink.innerHTML = \"<strong>Computer Forge @ CU Bylaws</strong>\";\n\n\taboutus.appendChild(bylaws);\n\taboutus.appendChild(bylawsLink);\n\t\n\treturn aboutus;\n}", "about(request, response){\n\t\tresponse.send('about HomeController');\n\t}", "about(request, response){\n\t\tresponse.send('about HomeController');\n\t}", "function createHomePage() {\n // Ensures that the choices are hidden\n btnGroup.addClass(\"hide\");\n\n // Hides the home button\n homeBtn.addClass(\"hide\");\n\n // Unhides the highscores button\n highscoresBtn.removeClass(\"hide\");\n\n // Changes header\n $(\"#header\").text(\"Coding Quiz Challenge\");\n\n // Empties content element\n contentEl.empty();\n\n // Creates paragraph element\n var introParagraph = $(\"<p>\").addClass(\"intro-paragraph\");\n\n // Adds text to paragraph element\n introParagraph.text(\"Try to answer the following code-related question within the time limit. Keep in mind that incorrect answers will penalize your score/time by ten seconds!\");\n\n // Creates start button element\n var startButton = $(\"<button>\").addClass(\"start-button\");\n\n // Adds text to start button element\n startButton.text(\"Start\");\n\n // Appends both elements to the content div\n contentEl.append(introParagraph);\n contentEl.append(startButton);\n }", "renderAbout() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<p>This simple web-app developed for test purpose. It allows to fetch some user data from <b>GitHub</b> account: all profile info and repository list</p>\n\t\t\t\t<p>Used technologies: \n\t\t\t\t\t<b>React.js</b>, \n\t\t\t\t\t<b>Bable.js</b>, \n\t\t\t\t\t<b>Webpack</b>\n\t\t\t\t</p>\n\t\t\t\t<br/>\n\t\t\t\t<p><i>Developed by Volodymyr Tochytskyi, 2016</i></p>\n\t\t\t</div>\n\t\t);\t\t\n\t}", "function showAbout() {\n\t\n\tvar info = \"\";\n\tinfo += \"Shift Work Calendar WebApp by DesignaQuark\\n\";\n\tinfo += \"Version: 1.0\\n\";\n\tinfo += \"Author: Josiah Neuberger\\n\";\n\tinfo += \"Contact: http://[email protected]\\n\";\n\tinfo += \"\\n\\nLicense: \" + getLicenseInfo() + \"\\n\";\n\t\n\talert(info);\n}", "static get title() {\n return __('About');\n }", "function HomeContent() {}", "function Page() {}", "function createPage(name, div, button, links, butRef) {\r\n\t// Create page object\r\n\tconst obj = {};\r\n\t// Assign the variables to the page object\r\n\tobj.name = name;\r\n\tobj.div = div;\r\n\tobj.button = button;\r\n\tobj.videoLinks = [];\r\n\tobj.id = \"#\"+name;\r\n\tobj.vidLinks = links;\r\n\tobj.buttonName = butRef;\r\n\t// Return the page object\r\n\treturn obj;\r\n}", "function AboutComponent(leaderservice) {\n this.leaderservice = leaderservice;\n }", "function showAbout () {\n showModalDialog({\n type : 'about',\n app : {\n version : (packageJson && packageJson.version)\n }\n });\n}", "function WWHHelp_Object(ParamURL)\n{\n var URLParams;\n\n\n this.mbInitialized = false;\n this.mbAccessible = false;\n this.mInitialTabName = null;\n this.mNewTabName = null;\n this.mInitStage = 0;\n this.mSettings = new WWHCommonSettings_Object();\n this.mMessages = new WWHCommonMessages_Object();\n this.mDocumentLoaded = null;\n this.mLocationURL = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);\n this.mBaseURL = WWHStringUtilities_GetBaseURL(this.mLocationURL);\n this.mHelpURLPrefix = this.mBaseURL;\n this.mContextDir = null;\n this.mTopicTag = null;\n this.mDocumentURL = \"\";\n this.mPopup = null;\n this.mPopupContext = \"\";\n this.mPopupLink = \"\";\n this.mPopupLoaded = false;\n this.mPopupHideDisabled = false;\n this.mBookGroups = new WWHBookGroups_Object();\n this.mBooks = new WWHBookList_Object();\n this.mFavoritesCookie = \"WWH\" + this.mSettings.mCookiesID + \"_Favs\";\n this.mbIgnoreNextKeyPress = false;\n this.mbAltKeyDown = false;\n this.mAccessKey = -1;\n this.mbAutoSyncTOC = false;\n this.mbAlwaysSyncTOC = true;\n this.mCollapsingTOCEntry = false;\n this.mImages = new Array();\n\n this.fSingleTopic = WWHHelp_SingleTopic;\n this.fGetFrameReference = WWHHelp_GetFrameReference;\n this.fSetLocation = WWHHelp_SetLocation;\n this.fReplaceLocation = WWHHelp_ReplaceLocation;\n this.fReloadLocation = WWHHelp_ReloadLocation;\n this.fGetURLParameters = WWHHelp_GetURLParameters;\n this.fCookiesEnabled = WWHHelp_CookiesEnabled;\n this.fInitStage = WWHHelp_InitStage;\n this.fHandlerInitialized = WWHHelp_HandlerInitialized;\n this.fGetFrameName = WWHHelp_GetFrameName;\n this.fSetFrameName = WWHHelp_SetFrameName;\n this.fSetDocumentFrameWithURL = WWHHelp_SetDocumentFrameWithURL;\n this.fSetDocumentFrame = WWHHelp_SetDocumentFrame;\n this.fSetDocumentHREF = WWHHelp_SetDocumentHREF;\n this.fGetBookIndexFileIndexURL = WWHHelp_GetBookIndexFileIndexURL;\n this.fDetermineContextDocument = WWHHelp_DetermineContextDocument;\n this.fLoadTopicData = WWHHelp_LoadTopicData;\n this.fProcessTopicResult = WWHHelp_ProcessTopicResult;\n this.fDisplayContextDocument = WWHHelp_DisplayContextDocument;\n this.fSetContextDocument = WWHHelp_SetContextDocument;\n this.fGetBookFileHREF = WWHHelp_GetBookFileHREF;\n this.fHREFToBookIndexFileIndexAnchor = WWHHelp_HREFToBookIndexFileIndexAnchor;\n this.fGetSyncPrevNext = WWHHelp_GetSyncPrevNext;\n this.fHREFToTitle = WWHHelp_HREFToTitle;\n this.fEscapeHTML = WWHHelp_EscapeHTML;\n this.fPopupHTML = WWHHelp_PopupHTML;\n this.fShowPopup = WWHHelp_ShowPopup;\n this.fPopupAdjustSize = WWHHelp_PopupAdjustSize;\n this.fPopupLoaded = WWHHelp_PopupLoaded;\n this.fRevealPopup = WWHHelp_RevealPopup;\n this.fResetPopupHideDisabled = WWHHelp_ResetPopupHideDisabled;\n this.fHidePopup = WWHHelp_HidePopup;\n this.fClickedPopup = WWHHelp_ClickedPopup;\n this.fDisplayFile = WWHHelp_DisplayFile;\n this.fDisplayFirst = WWHHelp_DisplayFirst;\n this.fShowTopic = WWHHelp_ShowTopic;\n this.fUpdate = WWHHelp_Update;\n this.fUpdateHash = WWHHelp_UpdateHash;\n this.fSyncTOC = WWHHelp_SyncTOC;\n this.fFavoritesCurrent = WWHHelp_FavoritesCurrent;\n this.fDocumentBookkeeping = WWHHelp_DocumentBookkeeping;\n this.fAutoSyncTOC = WWHHelp_AutoSyncTOC;\n this.fUnload = WWHHelp_Unload;\n this.fIgnoreNextKeyPress = WWHHelp_IgnoreNextKeyPress;\n this.fHandleKeyDown = WWHHelp_HandleKeyDown;\n this.fHandleKeyPress = WWHHelp_HandleKeyPress;\n this.fHandleKeyUp = WWHHelp_HandleKeyUp;\n this.fProcessAccessKey = WWHHelp_ProcessAccessKey;\n this.fFocus = WWHHelp_Focus;\n\n // Load up messages\n //\n this.mMessages.fSetByLocale(WWHFrame.WWHBrowser.mLocale);\n\n // Set cookie path\n //\n WWHFrame.WWHBrowser.fSetCookiePath(WWHStringUtilities_GetBaseURL(ParamURL));\n\n // Check URL parameters\n //\n URLParams = this.fGetURLParameters(this.mLocationURL);\n\n // Set accessibility flag\n //\n if (this.mSettings.mAccessible == \"true\")\n {\n this.mbAccessible = true;\n }\n else\n {\n if (URLParams[4] != null)\n {\n if (URLParams[4] == \"true\")\n {\n this.mbAccessible = true;\n }\n }\n }\n\n // Determine initial tab\n //\n if (URLParams[5] != null)\n {\n this.mInitialTabName = URLParams[5];\n }\n\n // Set popup capabilities\n //\n if (this.mbAccessible)\n {\n WWHFrame.WWHBrowser.mbSupportsPopups = false;\n WWHFrame.WWHBrowser.mbSupportsIFrames = false;\n }\n\n // Create popup\n //\n this.mPopup = new WWHPopup_Object(\"WWHFrame.WWHHelp.mPopup\",\n this.fGetFrameReference(\"WWHDocumentFrame\"),\n WWHPopupFormat_Translate,\n WWHPopupFormat_Format,\n \"WWHPopupDIV\", \"WWHPopupText\", 500, 12, 20,\n this.mSettings.mPopup.mWidth);\n}", "function OogaahTutorialContent39() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function _init () {\n $log.debug('AboutController init');\n\n // ...\n }", "init() {\n this._super(...arguments);\n this._createPages();\n }", "function OogaahTutorialContent38() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "static get is() {\n return \"page-about\";\n }", "getAboutDetails() {\n return axios.get(ABOUT_API_BASE_URL);\n }", "function makeArticle(obj){\n this.title = obj.title;\n this.category = obj.category;\n this.author = obj.author;\n this.authorUrl = obj.authorUrl;\n this.publishedOn = obj.publishedOn;\n this.body = obj.body;\n }", "function prepareAboutTab(){\n populateAboutVersionInformation()\n populateReleaseNotes()\n}", "function aboutSetup(){\n\n}", "function HomePage(navCtrl, navParams, http, loading, menuCtrl) {\n this.navCtrl = navCtrl;\n this.navParams = navParams;\n this.http = http;\n this.loading = loading;\n this.menuCtrl = menuCtrl;\n }", "function loadAbout() {\n\tapp.innerHTML = nav + about;\n}", "function OogaahTutorialContent32() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function about() {\n stopHandlers();\n AboutHandler.start();\n}", "function MasterBlockAbout() {\n this.tp = new Typograf({lang: 'ru'});\n}", "function showAboutDialog() {\r\n\tvar dialog = new SimpleDialog(\"About\");\r\n\tdialog.addButton(\"OK\",SimpleDialog.CLOSE_BUTTON);\r\n\tdialog.addMessage(\"ETI Blank\", \"center\");\r\n\tdialog.addMessage(\"Version 0.1.r177\", \"center\");\r\n\tdialog.show();\r\n}", "function Book(title, author,pages) {\n this.title=title;\n this.author=author;\n this.pages=pages;\n\n this.info=function(){\n return title;\n }\n}", "about(request, response){\n\t\tresponse.json({\n\t\t\tpage: 'about HomeController',\n\t\t\tisControllerFilter: response.locals.isControllerFilter,\n\t\t\tisActionFilter: response.locals.isActionFilter || false\n\t\t});\n\t}", "constructor() {\n // Must call superconstructor first.\n super();\n\n // Initialize properties\n this.footer={\n name:'Footer',\n actions:['New User','Menu']\n }\n }", "function AboutController($location) {\n var ctrl = this;\n\n ctrl.selectOption = selectOption;\n ctrl.getHash = getHash;\n\n ctrl.options = {\n 'about' : {\n 'title': 'About RefStack',\n 'template': 'components/about/templates/README.html',\n 'order': 1\n },\n 'uploading-your-results': {\n 'title': 'Uploading Your Results',\n 'template': 'components/about/templates/' +\n 'uploading_private_results.html',\n 'order': 2\n },\n 'managing-results': {\n 'title': 'Managing Results',\n 'template': 'components/about/templates/' +\n 'test_result_management.html',\n 'order': 3\n },\n 'vendors-and-products': {\n 'title': 'Vendors and Products',\n 'template': 'components/about/templates/vendor_product.html',\n 'order': 4\n }\n };\n\n /**\n * Given an option key, mark it as selected and set the corresponding\n * template and URL hash.\n */\n function selectOption(key) {\n ctrl.selected = key;\n ctrl.template = ctrl.options[key].template;\n $location.hash(key);\n }\n\n /**\n * Get the hash in the URL and select it if possible.\n */\n function getHash() {\n var hash = $location.hash();\n if (hash && hash in ctrl.options) {\n ctrl.selectOption(hash);\n } else {\n ctrl.selectOption('about');\n }\n }\n\n ctrl.getHash();\n }", "function OogaahTutorialContent3B() {\n\tOogaahTutorialContent.apply(this, null); // construct the base class\n}", "function AboutPage() {\n return (\n <div className=\"container\">\n <div>\n <p>This Webpage will show info about the current version of the application. It will also show what version of league it's set for as well as list the upcoming additions to the application.</p>\n </div>\n </div>\n );\n}", "constructor() {\n this.url = '';\n this.pageTitle = '';\n }", "constructor(title, genero, year){ //es un metodo, y las propiedades se enlistan dentro del constructor. \n this.title = title;\n this.genero = genero;\n this.year = year;\n }", "function InfoBarWindow(){}", "getAboutDetails() {\n return axios.get(ABOUT_API_BASE_URL + \"/get\");\n }", "function updateAboutPage(urlObj, options) {\n\tvar $page = $( urlObj.hash );\n\t$page.page();\n\toptions.dataUrl = urlObj.href;\n\t$.mobile.changePage( $page, options );\n\tupdatePageLayout(\"#aboutContent\", \"#aboutHeader\", \"#aboutNavbar\");\n}", "function AboutPage() {\n return (\n <div className=\"container\">\n <div>\n <h2>What is Planel?</h2>\n\n <p>\n Most concrete foundations are made by assembling large aluminum form\n panels. Calculating how many are needed for a job, and keeping track\n of how many are in the yard, are two challenges any company using this\n build method will face. Planel is an application that provides a means\n of documenting and sharing how many panels will be needed for a job,\n as well as tracking how many are in use.\n </p>\n </div>\n </div>\n );\n}", "function Window_Help() {\n this.initialize.apply(this, arguments);\n}", "function aboutNarrative(){\n alter.innerHTML = '';\n let about = document.createElement('div');\n about.classList.add('about');\n alter.appendChild(about);\n let title = document.createElement('h1');\n title.textContent = aboutHTML.title;\n let p1 = document.createElement('p');\n p1.textContent = aboutHTML.p1;\n let p2 = document.createElement('p');\n p2.textContent = aboutHTML.p2;\n about.appendChild(title);\n about.appendChild(p1);\n about.appendChild(p2);\n}", "static initialize(obj, version, title, license) { \n obj['version'] = version;\n obj['title'] = title;\n obj['license'] = license;\n }", "function OnePage(el, options) {\n\t\t\tthis.el = $(el);\n\t\t\tthis.init(options);\n\t\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa32dd600;\n this.SUBCLASS_OF_ID = 0x476cbe32;\n\n this.webpage = args.webpage;\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}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf259a80b;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.url = args.url;\n this.webpageId = args.webpageId;\n this.authorPhotoId = args.authorPhotoId;\n this.author = args.author;\n this.date = args.date;\n this.blocks = args.blocks;\n this.caption = args.caption;\n }", "constructor(page){\n this.page = page;\n }", "constructor(title, imagURL,price,description){\n this.title=title;\n this.imagURL=imagURL;\n this.price=price;\n this.description=description;\n }", "constructor(\n\t\t\t\ttitle,\n\t\t\t\tlink,\n\t\t\t\tauthor,\n\t\t\t\timg,\n\t\t\t\tbody){\n\t\t\t\t\tthis.title = title;\n\t\t\t\t\tthis.link = link;\n\t\t\t\t\tthis.author = author;\n\t\t\t\t\tthis.img = img;\n\t\t\t\t\tthis.body = body;\n\t}", "function initHome() {\n\tgetCurrentUser();\n\tinitializeStudentInfo();\n\tloadCourses(buildCourseContent);\n\tprogressBarFunc();\n\tw3_open(); \n}", "function renderAbout(req, res) {\n res.ViewData.title = \"Labumentous - About\";\n res.render(\"about\", res.ViewData);\n }", "function book(title, author, pages) {\r\n this.title = title\r\n this.author = author\r\n this.pages = pages\r\n this.read = 'not'\r\n this.info = function() {\r\n return `${title} by ${author}, ${pages} pages.`\r\n }\r\n }", "function FcAbout (props) {\n return Object(_lib__WEBPACK_IMPORTED_MODULE_0__[\"GenIcon\"])({\"tag\":\"svg\",\"attr\":{\"version\":\"1\",\"viewBox\":\"0 0 48 48\",\"enableBackground\":\"new 0 0 48 48\"},\"child\":[{\"tag\":\"path\",\"attr\":{\"fill\":\"#2196F3\",\"d\":\"M37,40H11l-6,6V12c0-3.3,2.7-6,6-6h26c3.3,0,6,2.7,6,6v22C43,37.3,40.3,40,37,40z\"}},{\"tag\":\"g\",\"attr\":{\"fill\":\"#fff\"},\"child\":[{\"tag\":\"rect\",\"attr\":{\"x\":\"22\",\"y\":\"20\",\"width\":\"4\",\"height\":\"11\"}},{\"tag\":\"circle\",\"attr\":{\"cx\":\"24\",\"cy\":\"15\",\"r\":\"2\"}}]}]})(props);\n}", "function createBasicSEOSection() {\n var div = document.createElement('div');\n div.id = 'ouiseo-basic-seo';\n\n var title = document.createElement('h2');\n title.innerHTML = 'SEO';\n\n div.appendChild(title);\n return div;\n }", "function Main() {\n this.detailsView = new DetailsView();\n this.detailsItem = null;\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x16115a96;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.title = args.title;\n this.articles = args.articles;\n }", "constructor(title, author, year){\n this.title = title,\n this.author = author,\n this.year = year \n }", "constructor(title, author, text) {\n ///Prop for Title\n this.props = {};\n ///Prop for Author\n this.props.author = author;\n ///Prop for Text\n this.props.content = text;\n }" ]
[ "0.65293044", "0.65177935", "0.63212216", "0.61964065", "0.61757743", "0.61757743", "0.611987", "0.609772", "0.6075698", "0.60373044", "0.601762", "0.59945744", "0.59507304", "0.59452647", "0.5937162", "0.5936154", "0.5930287", "0.5927293", "0.59219724", "0.59016234", "0.59012026", "0.5900575", "0.5897329", "0.5895749", "0.58832705", "0.5844147", "0.5838296", "0.5838295", "0.58361894", "0.58140403", "0.58133185", "0.58055985", "0.58053803", "0.57987356", "0.579709", "0.57914853", "0.57914853", "0.57894146", "0.5769228", "0.5749995", "0.5742276", "0.57306737", "0.5724938", "0.5724938", "0.57199913", "0.5717865", "0.5704306", "0.5698822", "0.5697256", "0.56963485", "0.5688879", "0.56884557", "0.56881756", "0.56744313", "0.56720793", "0.5671367", "0.5649056", "0.5644521", "0.56439763", "0.56406355", "0.5628414", "0.562668", "0.56053597", "0.5601929", "0.5599993", "0.5592725", "0.55895", "0.55805266", "0.5578651", "0.5578124", "0.5573855", "0.5549316", "0.5548706", "0.5547095", "0.5538074", "0.55088836", "0.5506511", "0.55060446", "0.54779893", "0.54659593", "0.5465341", "0.54619837", "0.54589707", "0.5456248", "0.54518116", "0.54456097", "0.5442985", "0.5426977", "0.5426895", "0.54175305", "0.54166955", "0.5410611", "0.54106104", "0.5408332", "0.5400014", "0.53975654", "0.5395651", "0.5384481", "0.53813607", "0.53754205" ]
0.75398135
0
You can extend webpack config here
extend (config, ctx) { config.node = { fs: 'empty' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }" ]
[ "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" ]
0.0
-1
ejecuto la funcion cada 5 segundos de manera asincrona mando a ejutar un codigo php donde revisa los tados de la variable de sesion el nombre de usuario y el Id_de la sesion correspondan, si no es asi entonces significa que alguien mas ya inicio sesion y es necesario cerrar la sesion
function sesiondoble(){ $.ajax({ url : 'src/doblesesion.php', type : 'GET', dataType : 'text', success:function(data){ if(data=='false'){ alert('¡La sesión ha caducado!'); location.href ="src/proces-unlgn.php"; } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iniciar_Sesion()\n{\n\t// obtiene el nombre del usuario\n\tvar nombre_usuario = document.getElementById(\"user\").value;\n\t// obtiene la contraseña del usuario\n\tvar contrasenna = document.getElementById(\"password\").value;\n\t// pregunta si el nombre es admin y la contraseña es $uperadmin para saber si es el administrador\n\tif(nombre_usuario === \"admin\" && contrasenna === \"$uper4dmin\"){\n\t\t// si es asi validar va a decir que el que va a iniciar sesion es el administrador\n\t\tvalidar = \"Entra como administracion\";\n\t\t// entonces el usuario actual va a ser admin\n\t\tuser_actual = 'Admin';\n\t\t// se va al localstorage y guarda el usuario actual para saber quien fue el que entró\n\t\tlocalStorage.setItem(\"Usuario_Actual\",user_actual);\n\t\t// si no fuera así\n\t}else{\n\t\t// se va a la funcion donde valida si el usuario existe o no y si existe cual es\n\t\tvalidacion();\n\t}\n\t// si validar fuera igual a nulo\n\tif(validar === null){\n\t\t// se muestra un mensaje donde le indica que lo debe crear primero entonces no puede iniciar sesion\n\t\talert(\"Debe crearlo primero antes de iniciar sesion\");\n\t\t// si validar fuera que entra coo administrador\n\t}else if(validar === \"Entra como administracion\"){\n\t\t// entonces entra como administrador\n\t\tlocation.href=\"tablero-de-instrucciones.html\";\n\t\t// muestra un mensaje de bienvenida\n\t\talert(\"BIENVENIDO\");\n\t\t// si validar fuera que entra como particular\n\t}else if(validar === \"Entra como particular\"){\n\t\t// entonces se valida el nombre de usuario para saber quien es.\n\t\tuser_actual = document.getElementById(\"user\").value;\n\t\t//lo guarda en el localstorage\n\t\tlocalStorage.setItem(\"Usuario_Actual\", user_actual);\n\t\t// entra como particular\n\t\tlocation.href=\"tablero-de-instrucciones.html\";\n\t\t// muestra un mensaje de bienvenida\n\t\talert(\"BIENVENIDO\");\n\t}\n\n}", "function responderSolicitudASolicitante(req,res){\n let id_solicitante = req.params.id;\n let solicitud= buscarSolicitud(id_solicitante); //verificamos si la aceptaron\n if(solicitudes[solicitud].estatus=='aceptada' && solicitudes[solicitud].operador != ''){\n console.log(`PRUEBA: si la aceptaron`);\n let id_operador=solicitudes[solicitud].operador;\n let lat = solicitudes[solicitud].latOperador;\n let lng = solicitudes[solicitud].lngOperador;\n let id_servicio = solicitudes[solicitud].id_servicio;\n let data = {};\n \n let sql = `Select * FROM usuarios WHERE id_usuario = ${ id_operador }`; \n consultaBd.consultaBd(sql,(result)=>{\n if(result){\n console.log(`PRUEBA: si la aceptaron 2`);\n data.nombreOperador = result[0].nombre + \" \" + result[0].ap + \" \" + result[0].am ;\n data.telefonoOperador = result[0].telefono;\n \n }\n })\n sql = `SELECT * FROM servicio WHERE id_servicio = ${id_servicio}`;\n consultaBd.consultaBd(sql,(result)=>{\n if(result){\n console.log(`PRUEBA: si la aceptaron 3`);\n data.servicio=result[0].descripcion;\n data.costoMax = result[0].costo_max;\n data.costoMin= result[0].costo_min;\n data.lat = lat;\n data.lng = lng;\n res.status(200).send({message:[{'flag':'true','cuerpo':[data]}]});\n }\n }) \n \n }else if(solicitudes[solicitud].estatus=='pendiente'){\n buscarOperadorPorFiltros(solicitudes[solicitud].id_solicitante); //si aun no la aceptan se busca al operador de nuevo\n res.status(200).send({message:[{'flag':'false','cuerpo':[{'nombre':'estatus pendiente'}]}]});\n //console.log(solicitudes[solicitud]);\n }else if(solicitudes[solicitud].estatus=='enEspera'){\n res.status(200).send({message:[{'flag':'false','cuerpo':[{'nombre':'Esperando respuesta de operador'}]}]});\n }else{\n res.status(200).send({message:[{'flag':'false','cuerpo':[{'nombre':'buscando operador'}]}]});\n }\n}", "run({ accion, socket, Socket, leccionId, paraleloId, fechaInicioTomada, tiempoEstimado, usuarioId }) {\n // limpiarlos por si acaso el moderador envia dos veces la misma peticion\n const existeInterval = intervals.some(leccion => leccionId == leccion.leccionId)\n const existeTimeout = timeouts.some(leccion => leccionId == leccion.leccionId)\n socket.join(`${paraleloId}`) // cada vez que realiza una de las acciones de debe agregar al profesor al room del paralelo\n if (existeInterval)\n intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n if (existeTimeout) { // si comento esto, se crean 3?\n timeouts = timeouts.filter(inicial => { if (inicial.leccionId == leccionId) {clearTimeout(inicial.timeout)} return inicial.leccionId != leccionId })\n }\n if (accion === 'comenzar') {\n logger.info(`moderador-comenzar usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n } else if (accion === 'aumentarTiempo') {\n logger.info(`moderados-aumentarTiempo usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}`)\n } else if (accion === 'continuar') {\n logger.info(`moderador-continuar usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoPausado+TiempoRestante: ${tiempoEstimado}`)\n } else if (accion === 'reconectarModerador') {\n logger.info(`moderador-reconectarModerador usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoPausado+TiempoRestante: ${tiempoEstimado}`)\n }\n const CURRENT_TIME = moment(moment().tz('America/Guayaquil').format())\n const FECHA_INICIO = moment(fechaInicioTomada)\n const FECHA_FIN = FECHA_INICIO.add(tiempoEstimado, 's')\n intervalId = setInterval(() => {\n let fechaFinLeccion = FECHA_FIN.subtract(1, 's')\n let tiempoRestante = moment.duration(fechaFinLeccion.diff(CURRENT_TIME)).format('h:mm:ss')\n // console.log(tiempoRestante)\n Socket.in(`${paraleloId}`).emit(EMIT.TIEMPO_RESTANTE, tiempoRestante)\n if (!CURRENT_TIME.isBefore(fechaFinLeccion)) {\n intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n Socket.in(`${paraleloId}`).emit(EMIT.LECCION_TERMINADA)\n Socket.in(`${paraleloId}`).emit(EMIT.TIEMPO_RESTANTE, 0)\n logger.info(`moderador-leccion-termino usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n }\n }, 1000)\n intervalId.ref()\n\n const SEGUNDOS_FIN = parseInt(moment.duration(FECHA_FIN.clone().add(5, 's').diff(CURRENT_TIME), 'seconds').format('ss'), 10) // si no termina con setInterval, despues de 5 segundos terminara con setTimeout\n timeoutId = 1 // prueba\n // timeoutId = setTimeout(() => {\n // if (intervalExiste(intervals, leccionId)) {\n // intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n // Socket.in(`${paraleloId}`).emit(EMIT.LECCION_TERMINADA)\n // logger.info(`moderador-leccion-termino-setTimeout usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n // } else {\n // logger.info(`moderador-leccion-termino-setInterval usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n // }\n // timeouts = timeouts.filter(inicial => { if (inicial.leccionId == leccionId) {clearTimeout(inicial.timeouts)} return inicial.leccionId !=leccionId })\n // }, SEGUNDOS_FIN)\n intervals.push({ leccionId, interval: intervalId, usuarioId })\n timeouts.push({ leccionId, timeout: timeoutId, usuarioId })\n if (accion === 'comenzar') {\n Socket.in(`${paraleloId}`).emit(EMIT.EMPEZAR_LECCION) // este solo sirve cuando los estudiantes estan en \"ingresar-codigo\"\n }\n }", "function acceder(usuario){\n console.log(`2. ${usuario} Ahora puedes acceder`)\n entrar();\n}", "iniciarSesion() {\n this.presentLoadingA();\n this.Servicios.userState().subscribe((user) => {\n this.Servicios.iniciarsesion(this.account.email, this.account.password).then(res => {\n this.cargandoA.dismiss();\n this.Servicios.getUsuario(user.uid).subscribe(res => {\n const UsuarioA = res.payload.val();\n console.log(UsuarioA);\n if (UsuarioA !== undefined) {\n this.account.email = \"\";\n this.account.password = \"\";\n console.log(UsuarioA.admin);\n if (UsuarioA.admin == true) {\n this.navCtrl.navigateRoot('/admin');\n }\n else {\n this.navCtrl.navigateRoot('/mainmenu');\n }\n }\n else {\n console.log(\"Error al iniciar\");\n }\n });\n this.storage.set('log', 'si');\n }).catch(err => {\n this.cargandoA.dismiss();\n console.log(\"Error al iniciar\");\n });\n });\n }", "function actualizadbZinck()\n{\n //console.log(localStorage['sesion']);\n $.ajax({\n url : 'https://www.jarboss.com/mobile/controller/procesarLogin.php',\n type: 'POST',\n dataType : 'json',\n data: \"email=\"+localStorage['mail']+\"&password=\"+localStorage['pass']+\"&type_log=2\",\n success: function(server){ \n //console.log(server); \n window.db.transaction(function(txt){\n // console.log('localstorage'+localstorage['idusuario']);\n txt.executeSql(\"SELECT * FROM usuarios WHERE iduser=\\'\"+server.idus+\"\\';\",[], function(tx, results){\n var row = results.rows.length;\n if (results.rows.length == 0){\n txt.executeSql(\"INSERT INTO usuarios(iduser, nombreuser, fecha, idempresa, token, sesionuser, logintype, empresa, correo ) VALUES (\\'\"+server.idus+\"\\', \\'\"+server.nombres_usuario+\"\\', \\'\"+server.fecha+\"\\', \\'\"+server.idem+\"\\',\\'\"+server.token+\"\\',\\'1\\',\\'\"+server.loginType+\"\\',\\'\"+server.empresa+\"\\',\\'\"+localStorage['mail']+\"\\');\"); \n }else\n {\n txt.executeSql(\"UPDATE usuarios SET sesionuser='1' where iduser=\\'\"+server.idus+\"\\';\"); \n }\n });\n });\n setTimeout(function() {\n // alert('siguiente paso');\n dinamicSection();\n }, 1000);\n }\n }); \n}", "function iniciarSesion(dataUsuario) {\n usuarioLogueado = new Usuario(dataUsuario.data._id, dataUsuario.data.nombre, dataUsuario.data.apellido, dataUsuario.data.email, dataUsuario.data.direccion, null);\n tokenGuardado = dataUsuario.data.token;\n localStorage.setItem(\"AppUsuarioToken\", tokenGuardado);\n navegar('home', true, dataUsuario);\n}", "async cancelarSolicitudesParaInmueble(infoSolicitud){\n let idInmueble = infoSolicitud.idInmueble\n let idSolicitudAprobada = infoSolicitud.idFirebase\n let fecha1 = infoSolicitud.fechaInicio\n let fecha2 = infoSolicitud.fechaFin\n let respuesta = await ManejadorBD.realizarConsulta(\"Solicitudes\", [\"idInmueble\"], [\"==\"], [idInmueble])\n for(let i in respuesta){\n if ( respuesta[i].idFirebase !== idSolicitudAprobada ){\n let objRervaAux = new SolicitudReserva( respuesta[i] )\n if ( objRervaAux.estaAbierta() && objRervaAux.fechasSeCruzan(fecha1, fecha2) ){\n this.cambiarEstadoSolicitudBaseDatos(respuesta[i].idFirebase, \"O\" )\n }\n }\n }\n }", "function verificar_tiempo_restante_session() {\n\t\nvar parametros = {\n\t\"accion\":\"tiempo_restante_session\",\n\t\"tipo_accion\":\"modelo\",\n\t\"request_tiempo_restante_session\":\"beep_boop\",\n};\n\t$.ajax({\n url: '../api/api.php',\n type: 'POST',\n\t\tdataType: 'json',\n data: parametros,\n success:function(data){\n\t\t\tvar tiempo_restante_session = (data[\"tiempo_restante_session\"]); //El tiempo en segundos restantes antes de que la session caduque\n\n\t\t\t//Si quedan menos de 30 segundos cierra la session\n\t\t\tif(tiempo_restante_session < 30)\n\t\t\t\t{\n\t\t\t\twindow.location.href = \"../logout.php\";\n\t\t\t\t}\t\t\t\t\t\t\n },\n //Si el request falla genera mensajes de errores de posibles eventos comunes\n error:function(x,e) {\n if (x.status==0) {\n $('#modal_error_internet').modal('show');\n } else if(x.status==404) {\n $('#modal_error_404').modal('show');\n } else if(x.status==500) {\n $('#modal_error_500').modal('show');\n } else if(e=='parsererror') {\n $('#modal_error_parsererror').modal('show');\n } else if(e=='timeout'){\n $('#modal_error_timeout').modal('show');\n } else {\n $('#modal_error_otro').modal('show');\n }\n },\n\t});\n}", "function escucha_users(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByTagName(\"article\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\tlimpiar(\"article\");\n\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\tvar y=$(this).find(\"input\");\n\t\t\tconfUsers[indice]=y.val();\n\t\t\tconsole.log(confUsers[indice]);\n\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\tsessionStorage.setItem(\"conf\", confUsers[indice]);\n\t\t};\n\t}\n}", "function evalRegistro(){\n msjClean();\n\n let id = $(\"#usuario\").val();\n let pass = $(\"#pass\").val();\n let pass2 = $(\"#repetir-pass\").val();\n let nombre = $(\"#nombre\").val();\n let departamento = $(\"#departamento\").val();\n let nivel = $(\"#nivel\").val();\n\n let errores = validateRegistro(id, pass, pass2, nombre, departamento);\n\n if(errores.length == 0){ loginManager.getLogin(id, '', 'checkExistLogin'); }\n else {\n let msjError = \"\";\n for(let i = 0; i < errores.length; i++){\n msjError += errores[i];\n }\n msjDanger('Registro', msjError);\n }\n}", "function nuevaSolicitud(req,res){\n //agarramos todos lo datos\n let id_solicitante = req.body.id_user, lat = req.body.lat, lng = req.body.lng,valoracion = req.body.valoracion,\n mayorCosto = req.body.mayorCosto,menorCosto = req.body.menorCosto,hombre = req.body.hombre,\n mujer = req.body.mujer,conTransporte = req.body.conTransporte,idServicio = req.body.id_servicio,\n fecha = req.body.fecha,hora = req.body.hora, descripcion=req.body.descripcion, nombreServicio = req.body.nombre_servicio;\n \n \n\n \n let sql = `SELECT * FROM usuarios WHERE id_usuario= ${id_solicitante}`;\n consultaBd.consultaBd(sql,(result)=>{\n if(result) {\n //console.log(result);\n let nombreSolicitante = result[0].nombre + \" \" + result[0].ap + \" \" + result[0].am ; \n let telefono = result[0].telefono;\n let correo = result[0].correo;\n let genero = result[0].genero;\n //guardamos la solicitud en la tabla en ram:\n solicitudes.push({id_servicio :idServicio, servicio: nombreServicio, id_solicitante:id_solicitante,\n nombre:nombreSolicitante, telefono: telefono, correo:correo,\n fecha:fecha, hora: hora, lat:lat, \n lng:lng, costo:\"\", estatus:\"pendiente\",\n operador:\"\", valoracion:valoracion, mayorCosto:mayorCosto,\n menorCosto:menorCosto, hombre:hombre, mujer:mujer,\n conTransporte:conTransporte, descripcion:descripcion, generoSolicitante:genero\n }); \n res.status(200).send({ message: `Nueva solicitud enviada de : ${ nombreSolicitante }` });\n }\n\n });\n}", "function activaFuncionamientoReloj() {\n let tiempo = {\n hora: 0,\n minuto: 0,\n segundo: 0\n };\n\n tiempo_corriendo = null;\n\n\n tiempo_corriendo = setInterval(function () {\n // Segundos\n tiempo.segundo++;\n if (tiempo.segundo >= 60) {\n tiempo.segundo = 0;\n tiempo.minuto++;\n }\n\n // Minutos\n if (tiempo.minuto >= 60) {\n tiempo.minuto = 0;\n tiempo.hora++;\n }\n\n $horasDom.text(tiempo.hora < 10 ? '0' + tiempo.hora : tiempo.hora);\n $minutosDom.text(tiempo.minuto < 10 ? '0' + tiempo.minuto : tiempo.minuto);\n $segundosDom.text(tiempo.segundo < 10 ? '0' + tiempo.segundo : tiempo.segundo);\n }, 1000);\n corriendo = true;\n\n }", "function registro(){ \r\n limpiarMensajesError();//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombre = document.querySelector(\"#txtNombre\").value;\r\n let nombreUsuario = document.querySelector(\"#txtNombreUsuario\").value;\r\n let clave = document.querySelector(\"#txtContraseña\").value;\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n let recibirValidacion = validacionesRegistro (nombre, nombreUsuario, clave); //\r\n if(recibirValidacion && perfil != -1){ \r\n crearUsuario(nombre, nombreUsuario, clave, perfil);\r\n if(perfil === 2){\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n alumnoIngreso();\r\n }else{\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado\r\n docenteIngreso();//Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n }\r\n }\r\n if(perfil === -1){\r\n document.querySelector(\"#errorPerfil\").innerHTML = \"Seleccione un perfil\";\r\n }\r\n}", "actionAutoLoginUser ({ data }) {\n var fechaDay = new Date(sessionStorage.getItem('validDate'))\n var fechaActual = new Date()\n var diasdif= fechaActual.getTime()-fechaDay.getTime();\n var contdias = Math.round(diasdif/(1000*60*60*24)); \n if (contdias >= 1) {\n store.dispatch('actionCloseSesion')\n } else {\n let user = sessionStorage.getItem('data')\n store.commit('setUser', JSON.parse(user))\n store.dispatch('actionGetPionero', JSON.parse(user))\n router.push('/inicio')\n }\n }", "inactivar(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n let transaction;\n try {\n const lRespuesta = yield VerificacionTokenController_1.VERIFICACIONTOKEN_CONTROLLER.VerificarToken(req, res);\n // if (!lRespuesta) {\n // res.sendStatus(403);\n // } else {\n transaction = yield database_1.sequelize.transaction();\n req.body.dtModificacion = Date.now();\n //*Validacion - itera el objeto y algun elemento esta inactivado, lo activa y viceversa.\n req.body = req.body.map((item) => { item.lActivo = !item.lActivo; return item; });\n yield tblClientes_1.default.bulkCreate(req.body, { updateOnDuplicate: ['iIdCliente', 'lActivo'] }, { transaction });\n //Obtener el o los Ids de los datos a inactivar para actualizar otras tablas\n let iIdPadron = req.body.map((x) => x.iIdPadron);\n //Actualiza las tablas realcionadas\n req.body.map((x) => {\n x.lActivo == true ? 1 : 0;\n //Actualiza la tabla de padron \n tblPadronPersonas_1.default.update({ lAsignado: x.lActivo }, { where: { iIdPadron: iIdPadron } });\n }, { transaction });\n yield transaction.commit();\n return res.json({\n message: \"Registro Eliminado con Exito\",\n data: req.body\n });\n // }\n }\n catch (error) {\n if (transaction)\n yield transaction.rollback();\n res.status(500).json({\n message: 'ocurrio un error'\n });\n }\n });\n }", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function escucha_Permisos(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByClassName(\"work_data\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\tif($(this).find(\"input\").val()!=0){/*Encuentro el input con el valor de id de permiso*/\n\t\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\t\tlimpiar(\".work_data\");\n\t\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\t\tvar y=$(this).find(\"input\");/*Encuentro el input con el valor de id de permiso*/\n\t\t\t\tconfUsers[indice]=y.val();/*Obtengo el valor del input \"idPermiso\" y lo almaceno*/\n\t\t\t\tconsole.log(confUsers[indice]);\n\t\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\t\tsessionStorage.setItem(\"confp\", confUsers[indice]);\n\t\t\t}\n\t\t};\n\t}\n}", "function loginIniciarSesionHandler() {\n let emailIngresado = $(\"#txtLoginEmail\").val();\n let passwordIngresado = $(\"#txtLoginPassword\").val();\n const opciones = { title: 'Error' };\n //Antes de hacer una llamada innecesaria a la api, validamos de nuestro lado los datos ingresados\n if (validarCorreo(emailIngresado)) {\n if (validarPassword(passwordIngresado)) {\n const datosUsuario = {\n email: emailIngresado,\n password: passwordIngresado\n };\n\n $.ajax({\n type: 'POST',\n url: urlBase + 'usuarios/session',\n contentType: \"application/json\",\n data: JSON.stringify(datosUsuario),\n success: iniciarSesion,\n error: errorCallbackLogin\n });\n } else {\n ons.notification.alert('La contraseña debe tener al menos 8 caracteres', opciones);\n }\n } else {\n ons.notification.alert('El formato del correo no es válido', opciones);\n }\n}", "function AdelanteFact(dato,ciclo,ruta,num)\n{\n\t$(\"#btnAntFact\").attr(\"onClick\", \"validarLectAntFact()\");\n\tvar numero = parseInt(num);\n\tvar cantidad = dato;\n\tvar cic = ciclo;\n\tvar rut = ruta;\n\n\tif(numero != cantidad-1)\n\t{\n\t\tvar RegAnt = numero;\t\n\t\tvar RegSig = numero + 1;\n\t\tvar RegSigSig = numero + 2;\n\t\tdocument.getElementById('txtNumRegistro').value=RegSig;\n\t}\n\n\telse\n\t{\n\t\tdocument.getElementById('txtNumRegistro').value=numero;\n\t}\n\n \tdbShell.transaction(function(tx) \n\t{ \t\t\n\t\ttx.executeSql(\"select * from UsuariosServicios where Ciclo=? and Ruta=?\",[cic,rut], \n\t\tfunction(tx, result)\n\t\t{\n\t\t\t$(\"#btnAntFact span\").removeClass(\"disable\");\n\t\t\t$(\"#btnAntFact i\").removeClass(\"disable\");\n\n\t\t\tif(RegSig == cantidad-1)\n\t\t\t{\n\t\t\t\tdocument.getElementById('txtIdUsuarioLecturaSigFact').value = \" \";\n\t\t\t\t$(\"#btnSigFact i\").addClass(\"disable\");\n\t\t\t\t$(\"#btnSigFact span\").addClass(\"disable\");\n\t\t\t\t$(\"#btnSigFact\").attr(\"onClick\", \" \");\n\t\t\t}\n\n\t\t\tif(RegSig > 0 && RegSig <= cantidad-2)\n\t\t\t{\n\t\t\t\t$(\"#btnSigFact i\").removeClass(\"disable\");\n\t\t\t\t$(\"#btnSigFact span\").removeClass(\"disable\");\n\t\n\t\t\t\tvar ConsecSig = result.rows.item(RegSigSig)['Consecutivo'];\n\n\t\t\t\tdocument.getElementById('txtIdUsuarioLecturaSigFact').value = \"Sig.: \" + result.rows.item(RegSigSig)['IdUsuario'] + \"-\" + ciclo + \"-\" + ruta + \"-\" + ConsecSig;\n\t\t\t}\n\n\t\t\tvar ConsecAnt = result.rows.item(RegAnt)['Consecutivo'];\n\n\t\t\tdocument.getElementById('txtIdUsuarioLecturaAntFact').value = \"Ant.: \" + result.rows.item(RegAnt)['IdUsuario'] + \"-\" + ciclo + \"-\" + ruta + \"-\" + ConsecAnt;\n\n\n\t\t\tvar lecturaActual = result.rows.item(RegSig)['LecturaActual'];\n\t\t\tvar causalActual = result.rows.item(RegSig)['CausalActual'];\n\t\t\tvar impreso = result.rows.item(RegSig)['impreso'];\n\n\t\t\tvar idUsuario = result.rows.item(RegSig)['IdUsuario'];\n\t\t\tdocument.getElementById('txtIdUsuarioLecturaFact').value = idUsuario;\n\n\t\t\tif(impreso == \"si\")\n\t\t\t{\n\t\t\t\tactivarImpresionFact();\n\t\t\t\t$(\"#datos-entradaFact\").show();\n\t\t\t\t$(\"#datosGenerales\").show();\n\t\t\t\t$(\"#LecturaNoDiligenciada\").hide();\n\t\t\t\tdocument.getElementById('txtNumeroFact').value = result.rows.item(RegSig)['Numero'];\n\t\t\t\t\n\t\t\t\tdocument.getElementById('txtidUsuarioLecturaCtrl').value = idUsuario;\n\n\t\t\t\tvar Ciclotx = result.rows.item(RegSig)['Ciclo'];\n\t\t\t\tdocument.getElementById('txtCiclo2Fact').value = \"Ciclo: \" + Ciclotx;\n\n\t\t\t\tvar Rutatx = result.rows.item(RegSig)['Ruta'];\n\t\t\t\tdocument.getElementById('txtRuta2Fact').value = \"Ruta: \" + Rutatx;\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"txtImpresoFact\").value = impreso;\n\n\n\t\t\t\tvar nombreUsuario = result.rows.item(RegSig)['Suscriptor'];\n\t\t\t\tdocument.getElementById(\"txtIdNombreUsuarioFact\").innerHTML = \"ID:\" + \"<b>\" + idUsuario + \" - \" + nombreUsuario.toUpperCase() + \"</b>\";\n\t\t\t\t\n\t\t\t\tvar direccionUsuario = result.rows.item(RegSig)['Direccion'];\n\t\t\t\tdocument.getElementById('txtDireccionFact').innerHTML = \"Dirección: <b>\" + direccionUsuario.toUpperCase() + \"</b>\";\n\n\t\t\t\tdocument.getElementById('txtMedidorFact').innerHTML = \"MED.# <b>\" + result.rows.item(RegSig)['NumeroMedidor'] + \"</b>\";\n\n\t\t\t\tdocument.getElementById('txtConsumoFact').innerHTML = \"Consumo: <b>\" + result.rows.item(RegSig)['Consumo'] + \"</b>\";\n\n\n\t\t\t\tvar Uso;\n\t\t\t\tvar IdUsotx = result.rows.item(RegSig)['IdUso'];\n\t\t\t\tdocument.getElementById('txtUsoFact').value=IdUsotx;\n\n\t\t\t\tif(IdUsotx == 1)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>RESIDENCIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 2)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>COMERCIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 3)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>INDUSTRIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 4)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>OFICIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 5)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>ESPECIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 6)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>PROVISIONAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tvar categoria = result.rows.item(RegSig)['IdCategoria'];\n\n\t\t\t\tdocument.getElementById(\"txtUsoCatFact\").innerHTML = Uso + \" Cat: <b>\" + categoria + \"</b>\";\n\n\t\t\t\tvar CtasAcR = parseInt(result.rows.item(RegSig)['CtasAcR']);\n\t\t\t\tvar CtasAcNR = parseInt(result.rows.item(RegSig)['CtasAcNR']);\n\t\t\t\tvar CtasAlR = parseInt(result.rows.item(RegSig)['CtasAlR']);\n\t\t\t\tvar CtasAlNR = parseInt(result.rows.item(RegSig)['CtasAlNR']);\n\t\t\t\tvar CtasAsR = parseInt(result.rows.item(RegSig)['CtasAsR']);\n\t\t\t\tvar CtasAsNR = parseInt(result.rows.item(RegSig)['CtasAsNR']);\n\n\t\t\t\tvar CuentasAcueducto;\n\t\t\t\tvar CuentasAlcantarillado;\n\t\t\t\tvar CuentasAseo;\n\t\t\t\tvar NumeroCuentasAcueducto = CtasAcR+CtasAcNR;\n\t\t\t\tvar NumeroCuentasAlcantarillado = CtasAlR+CtasAlNR;\n\t\t\t\tvar NumeroCuentasAseo = CtasAsR+CtasAsNR;\n\n\t\t\t\tif (CtasAcR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAcueducto = \"# Ctas Acued.: <b>\" + CtasAcR + \" (R)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAcNR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAcueducto = \"# Ctas Acued.: <b>\" + CtasAcR + \" (NR)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAlR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAlcantarillado = \"# Ctas Alcant.: <b>\" + CtasAlR + \" (R)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAlNR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAlcantarillado = \"# Ctas Alcant.: <b>\" + CtasAlNR + \" (NR)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAsR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAseo = \"# Ctas Aseo: <b>\" + CtasAsR + \" (R)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAsNR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAseo = \"# Ctas Aseo: <b>\" + CtasAsNR + \" (NR)</b>\";\n\t\t\t\t}\n\n\t\t\t\tdocument.getElementById(\"txtNumCuentasAcueductoFact\").innerHTML = CuentasAcueducto;\n\t\t\t\tdocument.getElementById(\"txtNumCuentasAlcantarilladoFact\").innerHTML = CuentasAlcantarillado;\n\t\t\t\tdocument.getElementById(\"txtNumCuentasAseoFact\").innerHTML = CuentasAseo;\n\n\t\t\t\tvar VolumenAseo = result.rows.item(RegSig)['VolumenAseo'];\n\n\t\t\t\tdocument.getElementById(\"txtToneladasProducidasFact\").innerHTML = \"Ton. de Basura Prod: <b>\" + VolumenAseo + \"</b>\";\n\n\t\t\t\tvar LecturaAnteriortx = document.getElementById('txtLecturaAnteriorFact');\n\n\t\t\t\tLecturaAnteriortx.innerHTML = \"Lectura Anterior: <b>\" + result.rows.item(RegSig)['LecturaAnterior'] + \"</b>\";\n\n\t\t\t\tvar ConsumoMediotx = document.getElementById('txtConsumoPromedioFact');\n\n\t\t\t\tConsumoMediotx.innerHTML = \"Consumo Promedio: <b>\" + result.rows.item(RegSig)['ConsumoMedio'] + \"</b>\";\n\n\t\t\t\tif (causalActual == 0)\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById('txtCausalFact').innerHTML = \"Sin Causal\";\n\t\t\t\t\tdocument.getElementById('txtLecturaActualFact').innerHTML = \"Lectura Actual: <b>\" + lecturaActual + \"</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(causalActual > 0)\n\t\t\t\t{\n\t\t\t\t\tasignarCausalFact(causalActual);\t\n\t\t\t\t}\n\n\t\t\t\tvar observacionActual = result.rows.item(RegSig)['ObservacionActual'];\n\n\t\t\t\tif(observacionActual == 0)\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById('txtObservacionFact').innerHTML = \"Sin Observación\";\n\t\t\t\t}\n\n\t\t\t\tif(observacionActual > 0)\n\t\t\t\t{\n\t\t\t\t\tasignarObsFact(observacionActual);\n\t\t\t\t}\n\n\t\t\t\tvar fechaFactura = result.rows.item(RegSig)['fechaFactura'];\n\t\t\t\tvar fechaLimiteDePago = result.rows.item(RegSig)['fechaLimiteDePago'];\n\t\t\t\tvar numeroFactura = result.rows.item(RegSig)['numeroFactura'];\n\n\t\t\t\tif (fechaFactura == \"\") \n\t\t\t\t{\n\t\t\t\t\tsetFechaFactura();\n\t\t\t\t\tsetNumeroFactura();\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById('txtFechaFact').innerHTML = \"Fecha Facturación: <b>\" + fechaFactura + \"</b>\";\n\t\t\t\t\tdocument.getElementById('txtFechaFactura').value = fechaFactura;\n\n\t\t\t\t\tdocument.getElementById('txtFechaLimiteFact').innerHTML = \"Fecha Limite de Pago: <b>\" + fechaLimiteDePago + \"</b>\";\n\t\t\t\t\tdocument.getElementById('txtFechaLimiteDePagoFactura').value = fechaLimiteDePago;\n\n\t\t\t\t\tdocument.getElementById('txtNumeroFactReal').value = numeroFactura;\n\t\t\t\t\tdocument.getElementById('txtNumFact').innerHTML = \"Factura #: <b>\" + numeroFactura + \"</b>\";\n\t\t\t\t}\n\n\t\t\t\tcargarDatosEmpresaFact();\n\t\t\t\tcargarDatosPeriodoFact();\n\n\t\t\t\tvar ConsuMedio = result.rows.item(RegSig)['ConsumoMedio'];\n\t\t\t\tvar ConsumoMes = result.rows.item(RegSig)['Consumo'];\n\t\t\t\tvar EdadAcueducto = result.rows.item(RegSig)['EdadAcueducto'];\n\t\t\t\tdocument.getElementById('txtEdadAcueducto').value = EdadAcueducto;\n\t\t\t\tdocument.getElementById('txtEdadAcueductoFact').innerHTML = \"Facturas Pendientes: <b>\" + EdadAcueducto + \"</b>\";\n\n\t\t\t\tif (ConsumoMes > 0) \n\t\t\t\t{\n\t\t\t\t\tliquidacionFactura(ConsumoMes,VolumenAseo,IdUsotx,categoria,idUsuario,NumeroCuentasAcueducto,NumeroCuentasAlcantarillado,NumeroCuentasAseo,EdadAcueducto);\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tliquidacionFactura(ConsuMedio,VolumenAseo,IdUsotx,categoria,idUsuario,NumeroCuentasAcueducto,NumeroCuentasAlcantarillado,NumeroCuentasAseo,EdadAcueducto);\n\t\t\t\t}\n\n\t\t\t\tvar fechaLectura = result.rows.item(RegSig)['Fecha'];\n\t\t\t\tdocument.getElementById('txtFechaFinalFact').innerHTML = \"Fecha de Lectura: <b>\" + fechaLectura + \"</b>\";\n\n\t\t\t\tvar fechaInicial = result.rows.item(RegSig)['UltimaFechaDeFacturacion'];\n\n\t\t\t\tdocument.getElementById('txtFechaInicialFact').innerHTML = \"Fecha Inicial: <b>\" + fechaInicial + \"</b>\";\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tdesactivarImpresionFact();\n\t\t\t\t$(\"#datos-entradaFact\").hide();\n\t\t\t\t$(\"#datosGenerales\").hide();\n\t\t\t\t$(\"#LecturaNoDiligenciada\").show();\n\t\t\t}\n\t\t});\n\t});\n}", "function inicializaInterfaz(){\n $.ajax({\n url:'tipoUsuario.php',//SE CONULSTA EL TIPO DE USUARIO DEL USUARIO QUE INICIÓ SESIÓN\n data:{},\n method:'POST',\n dataType:'json',\n async:false,\n success:function(data){\n tipo_usuario=data;\n if(data=='Inhabilitado'){//SE DESPLIEGA CONTENIDO PARA USUARIO \"INHABILITADO\"\n $('#mensaje-superior').text(\"Su cuenta está inhabilitada\");\n $('#espere').text(\"No tiene acceso a ninguna funcionalidad del sitema\");\n $('#loading-contenedor').show();\n $('#map').css({'z-index':'-1'});\n $('.boton').not('.btn-7').remove();\n $('.btn-7').css({'margin-top':'400px'}).show();\n \n }if(data=='Operador'){//SE DESPLIEGA CONTENIDO PARA USUARIO \"OPERADOR\"\n $('.btn-2').remove();\n $('.btn-4').remove(); \n $('.btn-5').remove();\n $('.controles').css({'margin-top':'60vh'}); \n }\n }\n \n \n });\n \n \n}", "function guardaUsuario(){\n var url = '../../ccontrol/control/control.php';\n habilitado=document.nuevo_usuario.habilitado_usuario.checked;\n if(habilitado==true || habilitado==1){\n habilitado=1;\n }\n else{\n habilitado=0;\n }\n var data = 'p1=GuardaNuevoUsuario&' + $('nuevo_usuario').serialize() + '&habilitado_usuario=' + habilitado;\n\n if($('estado').value=='nuevo'){\n new Ajax.Request (url,\n {method : 'get',\n parameters : data,\n onLoading : function(transport){est_cargador(1);},\n onComplete : function(transport){est_cargador(0);\n alert(transport.responseText);\n Windows.close(\"Div_buscador4\");\n mostrarEmpleadosPorRegistrar();\n }\n }\n )\n }\n else\n if($('estado').value=='editar'){\n new Ajax.Request (url,\n {method : 'get',\n parameters : data,\n onLoading : function(transport){est_cargador(1);},\n onComplete : function(transport){est_cargador(0);\n alert(transport.responseText);\n Windows.close(\"Div_buscador4\");\n usuariosDHabAjax();\n }\n }\n )\n }\n}", "function mostraAlunos() {\n var id = sessionStorage.getItem(\"idUser\");\n var idDisc = sessionStorage.getItem(\"idDisciplina\");\n var alunos = true;\n query = \"SELECT explicando.user_id as idExplicando, explicando.nome as nomeExplicando FROM explicando, explicando_tem_explicador, explicador WHERE explicando.user_id = explicando_tem_explicador.explicando_user_id AND explicando_tem_explicador.explicador_user_id = explicador.user_id AND explicando_tem_explicador.explicador_user_id = '\" + id + \"' AND explicando_tem_explicador.disciplina_id = '\" + idDisc + \"'\";\n console.log(query);\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n result.forEach((explicando) => {\n console.log(explicando);\n if (alunos != false) {\n document.getElementById(\"conteudo\").appendChild(document.createTextNode(\"Selecione o aluno:\"));\n }\n alunos = false;\n //CARD:\n var explic = document.createElement(\"div\");\n explic.value = explicando.user_id;\n explic.setAttribute(\"class\", \"wd-100 mb-1\");\n\n //NOME ALUNO:\n var nome = document.createElement(\"button\");\n nome.setAttribute(\"class\", \"card border-left-info shadow h-100 py-0 w-100\");\n var nomeAux = document.createElement(\"div\");\n nomeAux.setAttribute(\"class\", \"card-body w-100\");\n var nomeAux2 = document.createElement(\"div\");\n nomeAux2.setAttribute(\"class\", \"text-x font-weight-bold text-danger text-uppercase mb-1\");\n nomeAux2.innerHTML = explicando.nomeExplicando;\n nomeAux.appendChild(nomeAux2);\n\n nome.onclick = function () {\n var edita = \"false\";\n var idSumario = null;\n var aux;\n sessionStorage.setItem(\"idExplicando\", explicando.idExplicando);\n sessionStorage.setItem(\"idDisciplina\", idDisc);\n sessionStorage.setItem(\"edita\", edita);\n sessionStorage.setItem(\"idSumario\", idSumario);\n verificaData(1);\n };\n nome.appendChild(nomeAux);\n\n explic.appendChild(nome);\n document.getElementById(\"listaAlunos\").appendChild(explic);\n });\n if (alunos != false) {\n document.getElementById(\"conteudo\").appendChild(document.createTextNode(\"Não existe alunos inscritos nesta disciplina.\"));\n }\n }\n });\n closeConnectionDataBase();\n}", "function operadorAceptoSolicitud(req,res){\n let id_operador= req.params.id, id_solicitante = req.params.id_solicitante;\n let solicitud = buscarSolicitud(id_solicitante);\n let flag=buscarOperador(id_operador);\n\n\n solicitudes[solicitud].estatus='aceptada';\n solicitudes[solicitud].operador= id_operador;\n solicitudes[solicitud].latOperador = operadores[flag.i-1].lat;\n solicitudes[solicitud].lngOperador = operadores[flag.i-1].lng;\n\n console.log('SOLICITUD AGENDADA:',solicitudes[solicitud]);\n\n //AQUI VA LA FECHA POR EJEMPLO\n var date = new Date();\n var fechaActual = moment(date).format('YYYY-MM-DD');\n console.log(` fechas ${ fechaActual } == ${solicitudes[solicitud].fecha}`);\n if(fechaActual < solicitudes[solicitud].fecha ){\n //aqui se guardara\n console.log(`se guardardo en base de datos solicitud agendada`);\n let sql = `INSERT INTO solicitud \n (id_solicitud, id_solicitante, id_operador, id_servicio, fecha, hora, lat_inicio, lng_inicio, lat_fin, lng_fin, costo, estatus) \n VALUES \n ('NULL', \n '${solicitudes[solicitud].id_solicitante}',\n '${id_operador}',\n '${solicitudes[solicitud].id_servicio}', \n '${solicitudes[solicitud].fecha}', \n '${solicitudes[solicitud].hora}', \n '${operadores[flag.i-1].lat}', \n '${operadores[flag.i-1].lng}', \n '${solicitudes[solicitud].lat}', \n '${solicitudes[solicitud].lng}', \n '100', \n 'AGENDADA'\n )`;\n consultaBd.insertar(sql,(result)=>{\n if(result){\n console.log('se guardo en la base de datos solicitud agendada');\n res.status(200).send({message:[{'flag':'guardado','cuerpo':[]}]});\n solicitudes.splice(solicitud,1);\n }\n })\n }else{\n //buscamos al solicitante en la base de datos\n \n console.log(`solicitud de : ${ solicitudes[solicitud].id_solicitante } fue ${ solicitudes[solicitud].estatus }\n por el operador: ${ id_operador }`);\n //buscamos la lat y lng del operador para agregarlos al row de la solicitud en el arreglo\n let flag=buscarOperador(id_operador);\n solicitudes[solicitud].latOperador = operadores[flag.i-1].lat;\n solicitudes[solicitud].lngOperador = operadores[flag.i-1].lng;\n if(flag.flag){//verificamos que el operador este en el arreglo\n operadores.splice(flag.i-1,1);\n let rechazada = verificarRechazo(id_operador);\n if(rechazada.flag){//verificamos si alguien rechazo la solicitud\n arregloSolicitudRechazada.splice(rechazada.pos,1); //la eliminamos del arreglo de rechazadas\n }\n res.status(200).send({message:['Estado: Desconectado']})\n }else{\n res.status(404).send({message:['Error: No se encontro el operador']})\n }\n }\n}", "busquedaUsuario(termino, seleccion) {\n termino = termino.toLowerCase();\n termino = termino.replace(/ /g, '');\n this.limpiar();\n let count = +0;\n let busqueda;\n this.medidoresUser = [], [];\n this.usersBusq = [], [];\n for (let index = 0; index < this.usuarios.length; index++) {\n const element = this.usuarios[index];\n switch (seleccion) {\n case 'nombres':\n busqueda = element.nombre.replace(/ /g, '').toLowerCase() + element.apellido.replace(/ /g, '').toLowerCase();\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n case 'cedula':\n busqueda = element.cedula.replace('-', '');\n termino = termino.replace('-', '');\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n default:\n count = -1;\n break;\n }\n }\n if (count < 1) {\n this.usersBusq = null;\n }\n this.conteo_usuario = count;\n }", "function contadorInactividad() {\n\t// actualizamos el valor de la variable\n\tt = setTimeout(\"inactividad()\", 1000*60*5);\n}", "async function desactivarUsuarios (seleccionados){\n var messages = new Array();\n for (i=0; i < seleccionados.length; i++){\n await $.ajax({\n url: \"https://localhost:3000/volvo/api/GU/GU_GESTION_USUARIOS\",\n headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')},\n data: {\n \"accion\" : 'DESACTIVATE',\n \"nombreUsuario\" : $('#nombreUsuario'+seleccionados[i]).text()\n },\n dataType: \"json\",\n method: \"POST\",\n success: function(respuesta){\n if(respuesta.output.pcodigoMensaje == 0){\n messages.push({pcodigoMensaje: respuesta.output.pcodigoMensaje, usuario: $('#nombreUsuario'+seleccionados[i]).text()})\n }else{\n messages.push({pcodigoMensaje: respuesta.output.pcodigoMensaje, usuario: $('#nombreUsuario'+seleccionados[i]).text()})\n }\n },\n error : function(error){\n messages.push({pcodigoMensaje: respuesta.output.pcodigoMensaje, usuario: $('#nombreUsuario'+seleccionados[i]).text()})\n }\n });\n }\n return messages;\n}", "async function serverResponse(estado, respuesta) {\n\n if (estado === 400) {\n mensajeError(\"El email o la contraseña no son validos\"); // muestra elemento HTML \n } else {\n console.log(respuesta) \n // Guarda en el Storage el token y el id \n localStorage.setItem('token', respuesta.token)\n // localStorage.setItem('id-usuario', respuesta.id)\n\n mensajeSuccess(respuesta.msg); // Muestra elemento HTML\n \n await peticionRedireccionamiento() // Redirecciona al Home\n\n }\n }", "function cambiarDatosDeUsuarioEnElSitio(){\n\tvar mail=document.getElementById(\"formUserEmail\").value;\n\tvar firstName=document.getElementById(\"formUserFirstName\").value;\n\tvar lastName=document.getElementById(\"formUserLastName\").value;\n\tvar nickname=document.getElementById(\"formUserNick\").value;\n\tif(mail.length < 1 || firstName.length < 1 || lastName.length < 1 || nickname.length < 1 ){\n\t\t\tvar camposVacios=\"\";\n\t\t\tif(mail.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Correo electrónico</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (firstName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Nombre</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (lastName.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apellido</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\tif (nickname.length < 1){\n\t\t\t\tcamposVacios+=\"<p class='trn'>El Campo <b>Apodo</b> es obligatorio</p>\";\n\t\t\t}\n\t\t\t// Termina el tipo de mensaje\n\t\t\tavisoEmergenteJugaPlay(\"<span class='trn'>Campos vacíos</span>\",camposVacios);\n\treturn false ;\n\t}// Si paso es que los campos estan bien\n\tvar json=JSON.stringify({ \"user\": { \"first_name\": firstName,\"last_name\": lastName, \"email\": mail, \"nickname\":nickname } });\n\tif(startLoadingAnimation()==true){\n\tmensajeAlServidorConContenidoRegistro(json);}\n}", "function fn_procesoDetalleIndicador(url, estado) {\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n var num_validar = 0;\n if (estado == 1 || estado == 0) { num_validar = 8 }\n else if (estado == 5 || estado == 6) { num_validar = 11 }\n\n if (rol_usuario != 7) {\n var mns = ValidarRevision('1', $(\"#Control\").data(\"iniciativa\"), num_validar, \"mensajeDangerRegistro\", \"El detalle de esta acción de mitigación ya fue enviada para su revisión\");\n\n if (mns != \"\") {\n if (estado == 1 || estado == 5) {\n $(\"#solicitar-revision #modalRegistrarBoton\").hide();\n $(\"#pieCorrecto\").show();\n $('#mensajeModalRegistrar').append(mns);\n $(\"#Control\").data(\"modal\", 1);\n } else if (estado == 6 || estado == 0) {\n $(\"#guardar-avance #modalAvanceBoton\").hide();\n $(\"#pieCorrectoAvance\").show();\n $('#mensajeModalAvance').append(mns);\n $(\"#Control\").data(\"modal\", 1);\n }\n return false;\n }\n }\n\n let validar_fecha_imple = false;\n if ($(\"#Control\").data(\"mitigacion\") == 4 && (estado == 1 || estado == 5)) validar_fecha_imple = verificarFecha();\n if (validar_fecha_imple) { mensajeError('Por favor, si ha confirmado la implementación de la acción de mitigación debe ingresar la fecha de implementación', '#mensajeModalRegistrar'); return; }\n\n if ($(\"#Control\").data(\"mitigacion\") == 4 && (estado == 1 || estado == 5)) validar_fecha_imple = verificarFechaVerificacion();\n if (validar_fecha_imple) { mensajeError('Por favor, si ha confirmado la verificación de la acción de mitigación debe ingresar la fecha de verificación', '#mensajeModalRegistrar'); return; }\n\n indicadores = [];\n documentos = [];\n var medida = $(\"#Control\").data(\"mitigacion\");\n var enfoque = $(\"#cbo-enfoque\").val();\n var parametros = \"\";\n var n = $(\"#tablaIndicador\").find(\"tbody\").find(\"th\").length + 1;\n var nom = \"\";\n let arrValores = []; //add 27-09-2020\n for (var fila = 1 ; fila < n; fila++) {\n var enfoque = $(\"#cbo-enfoque\").val();\n var ind = $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\") == null ? \"0\" : $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\") == \"\" ? \"0\" : $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\");\n var filas = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"[data-param]\");\n var Xfilas = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"input[name=fledoc]\");\n var nomarchivo = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"[data-nomarchivo]\");//add 18-04-2020 \n\n if (fn_validarCampoReg(fila)) {\n let ListaValores = [], nom_t;\n filas.each(function (index, value) {\n let enfoque_t = enfoque;\n let medida_t = medida;\n let parametro_t = $(value).attr(\"data-param\");\n let m = $(value).attr(\"id\").substring(0, 3);\n let valor = m == \"txt\" ? $(\"#\" + $(value).attr(\"id\")).val().replace(/,/gi, '') : $(\"#\" + $(value).attr(\"id\")).val();\n valor = valor == \"0\" ? \"\" : valor;\n let objValores = {\n ID_ENFOQUE: enfoque_t,\n ID_MEDMIT: medida_t,\n ID_PARAMETRO: parametro_t,\n VALOR: valor\n }\n ListaValores.push(objValores);\n });\n\n nomarchivo.each(function (index, value) {\n nom = $(\"#\" + $(value).attr(\"id\")).val();\n });\n\n if (Xfilas != null && Xfilas != undefined)\n nom_t = Xfilas[0].files.length > 0 ? Xfilas[0].files[0].name : nom != \"\" ? nom : \"\";\n else\n nom_t = \"\";\n\n arrValores.push({\n ID_INDICADOR: ind,\n ADJUNTO: nom_t,\n listaInd: ListaValores,\n objAIV: arrAIV[fila - 1],\n });\n }\n }\n\n for (var i = 0, len = storedFiles.length; i < len; i++) {\n var sux = {\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ADJUNTO_BASE: storedFiles[i].name,\n FLAG_ESTADO: \"1\"\n }\n documentos.push(sux);\n }\n\n //===========================================\n var terminos = $(\"#chk-publicar\").prop(\"checked\");\n var inversion = $(\"#chk-publicar-monto-inversion\").prop(\"checked\");\n var privacidad = '0';\n var privacidad_monto = '0';\n if (terminos) {\n privacidad = '1'; //0 - PRIVADO : 1 - PUBLICO\n }\n if (inversion) {\n privacidad_monto = '1'; //0 - PRIVADO : 1 - PUBLICO\n }\n //===========================================\n\n var archivos = \"\";\n for (var i = 0, len = storedFiles.length; i < len; i++) {\n archivos += storedFiles[i].name + \"|\";\n }\n if (archivos == \"\") archivos = \"|\";\n\n\n var id_delete = \"\";\n if ($(\"#cuerpoTablaIndicador\").data(\"delete\") != \"\") {\n id_delete = $(\"#cuerpoTablaIndicador\").data(\"delete\");\n id_delete = id_delete.substring(0, id_delete.length - 1);\n }\n\n var id_eliminar = \"\";\n if ($(\"#total-documentos\").data(\"eliminarfile\") != \"\") {\n id_eliminar = $(\"#total-documentos\").data(\"eliminarfile\");\n id_eliminar = id_eliminar.substring(0, id_eliminar.length - 1);\n }\n\n let arrInversion = [];\n $('.anio').each((x, y) => {\n let anio = $(y).data('valor');\n let moneda = $(`#ms-${anio}`).val();\n let inversion = $(`#m-${anio}`).val() == '' ? 0 : $(`#m-${anio}`).val().replace(/,/gi, '');\n arrInversion.push({\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ANIO: anio,\n MONEDA: moneda,\n INVERSION: inversion,\n USUARIO_REGISTRO: $(\"#Control\").data(\"usuario\"),\n });\n });\n\n var item = {\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ID_USUARIO: $(\"#Control\").data(\"usuario\"),\n NOMBRE_INICIATIVA: $(\"#txa-nombre-iniciativa\").val(),\n ID_INDICADOR_DELETE: id_delete,\n ID_INDICADOR_ELIMINAR: id_eliminar,\n ID_ESTADO: estado,\n ID_ENFOQUE: enfoque,\n ID_MEDMIT: medida,\n TOTAL_GEI: parseFloat($(\"#total-detalle\").html()),\n ID_TIPO_INGRESO: 1,\n PRIVACIDAD_INICIATIVA: privacidad,\n PRIVACIDAD_INVERSION: privacidad_monto,\n ListaSustentos: documentos,\n extra: archivos,\n ListaIndicadoresData: arrValores,\n SECTOR_INST: medida == 4 ? $('#cbo-sector').val() : '',\n INSTITUCION_AUDITADA: medida == 4 ? $('#txt-institucion').val() : '',\n TIPO_AUDITORIA: medida == 4 ? $('#cbo-tipo_auditoria').val() : '',\n DESCRIPCION_TIPO_AUDITORIA: medida == 4 ? $('#txt-descripcion-tipo-auditoria').val() : '',\n AUDITOR_AUDITORIA: medida == 4 ? $('#txt-auditor').val() : '',\n NOMBRE_INSTITUCION: medida == 4 ? $('#txt-institucion-auditor').val() : '',\n FECHA_AUDITORIA: medida == 4 ? $('#fch-fecha-auditoria').val() : '',\n listaMonto: arrInversion,\n };\n\n var options = {\n type: \"POST\",\n dataType: \"json\",\n contentType: false,\n //async: false, // add 040620\n url: url,\n processData: false,\n data: item,\n xhr: function () { // Custom XMLHttpRequest\n var myXhr = $.ajaxSettings.xhr();\n if (myXhr.upload) { // Check if upload property exists\n //myXhr.upload.addEventListener('progress', progressHandlingFunction, false); // For handling the progress of the upload\n }\n return myXhr;\n },\n resetForm: false,\n beforeSubmit: function (formData, jqForm, options) {\n return true;\n },\n success: function (response, textStatus, myXhr) {\n if (response.success) {\n arrAIV = [];\n //CargarDetalleDatos(); \n if (estado == 0 || estado == 6) CargarArchivosGuardados();\n if (estado == 0 || estado == 6) CargarDatosGuardados();\n $(\"#cuerpoTablaIndicador\").data(\"delete\", \"\");\n $(\"#total-documentos\").data(\"eliminarfile\", \"\");\n $(\"#fledocumentos\").val(\"\");\n if (estado == 0 || estado == 6) {\n $(\"#mensajeModalAvance #mensajeDangerAvance\").remove();\n //var msj = ' <div class=\"col-sm-12 col-md-12 col-lg-12\" id=\"mensajeWarningAvance\">';\n //msj = msj + ' <div class=\"alert alert-warning d-flex align-items-stretch\" role=\"alert\">';\n //msj = msj + ' <div class=\"alert-wrap mr-3\">';\n //msj = msj + ' <div class=\"sa\">';\n //msj = msj + ' <div class=\"sa-warning\">';\n //msj = msj + ' <div class=\"sa-warning-body\"></div>';\n //msj = msj + ' <div class=\"sa-warning-dot\"></div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' <div class=\"alert-wrap\">';\n //msj = msj + ' <h6>Sus avances fueron guardados</h6>';\n //msj = msj + ' <hr>Recuerde, podrá solicitar una revisión una vez complete todos los campos obligatorios.';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n var msj = mensajeCorrecto(\"mensajeWarningAvance\", \"Bien\", \"Usted a guardado correctamente su avance.\");\n\n $(\"#guardar-avance #modalAvanceBoton\").hide();\n $(\"#pieCorrectoAvance\").show();\n $('#mensajeModalAvance').append(msj);\n } else if (estado == 1 || estado == 5) {\n $('#mensajeModalRegistrar #mensajeGoodRegistro').remove();\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n //var msj = ' <div class=\"alert alert-success d-flex align-items-stretch\" role=\"alert\" id=\"mensajeGoodRegistro\">';\n //msj = msj + ' <div class=\"alert-wrap mr-3\">';\n //msj = msj + ' <div class=\"sa\">';\n //msj = msj + ' <div class=\"sa-success\">';\n //msj = msj + ' <div class=\"sa-success-tip\"></div>';\n //msj = msj + ' <div class=\"sa-success-long\"></div>';\n //msj = msj + ' <div class=\"sa-success-placeholder\"></div>';\n //msj = msj + ' <div class=\"sa-success-fix\"></div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' <div class=\"alert-wrap\">';\n //msj = msj + ' <h6>Felicitaciones</h6>';\n //msj = msj + ' <hr><a class=\"float-right\" href=\"#\" target=\"_blank\"><img src=\"./images/sello_new.svg\" width=\"120\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Ir a la web del sello\"></a>';\n //msj = msj + ' <small class=\"mb-0\">Usted a completado el envío de detalle de su iniciativa de mitigación que será verificada por uno de nuestros especialistas. También, le recordamos que puede ingresar a nuestra plataforma del <b>Sello de Energía Sostenible</b></small>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n $(\"#solicitar-revision #modalRegistrarBoton\").hide();\n $(\"#pieCorrecto\").show();\n $(\"#mensajeSuccess\").removeAttr(\"hidden\");\n //$('#mensajeModalRegistrar').append(msj);\n $(\"#Control\").data(\"modal\", 1);\n if (response.extra == \"1\") {\n //if (ws != null) ws.send(response.extra);\n }\n }\n } else {\n if (estado == 0) {\n $(\"#mensajeModalAvance #mensajeDangerAvance\").remove();\n var msj = ' <div class=\"col-sm-12 col-md-12 col-lg-12\" id=\"mensajeDangerAvance\">';\n msj = msj + ' <div class=\"alert alert-danger d-flex align-items-stretch\" role=\"alert\">';\n msj = msj + ' <div class=\"alert-wrap mr-3\">';\n msj = msj + ' <div class=\"sa\">';\n msj = msj + ' <div class=\"sa-error\">';\n msj = msj + ' <div class=\"sa-error-x\">';\n msj = msj + ' <div class=\"sa-error-left\"></div>';\n msj = msj + ' <div class=\"sa-error-right\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"sa-error-placeholder\"></div>';\n msj = msj + ' <div class=\"sa-error-fix\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"alert-wrap\">';\n msj = msj + ' <h6>Error al guardar</h6>';\n msj = msj + ' <hr><small class=\"mb-0\">Verifique que los datos e intente otra vez.</small>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n $('#mensajeModalAvance').append(msj);\n } else {\n $('#mensajeModalRegistrar #mensajeGoodRegistro').remove();\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n var msj = ' <div class=\"alert alert-danger d-flex align-items-stretch\" role=\"alert\" id=\"mensajeDangerRegistro\">';\n msj = msj + ' <div class=\"alert-wrap mr-3\">';\n msj = msj + ' <div class=\"sa\">';\n msj = msj + ' <div class=\"sa-error\">';\n msj = msj + ' <div class=\"sa-error-x\">';\n msj = msj + ' <div class=\"sa-error-left\"></div>';\n msj = msj + ' <div class=\"sa-error-right\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"sa-error-placeholder\"></div>';\n msj = msj + ' <div class=\"sa-error-fix\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"alert-wrap\">';\n msj = msj + ' <h6>Error de registro</h6>';\n msj = msj + ' <hr><small class=\"mb-0\">Verifique que los datos sean correctamente ingresados, complete todos los campos obligatorios e intente otra vez.</small>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n $('#mensajeModalRegistrar').append(msj);\n }\n }\n },\n error: function (myXhr, textStatus, errorThrown) {\n console.log(myXhr);\n console.log(textStatus);\n console.log(errorThrown);\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"\");\n $(\"#titulo-carga-avance\").addClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"\");\n $(\"#titulo-carga\").addClass(\"d-none\");\n }\n },\n beforeSend: function () { //add 28-09-2020\n console.log('before send');\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n $(\"#titulo-carga-avance\").removeClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n $(\"#titulo-carga\").removeClass(\"d-none\");\n }\n //$(\"#carga-preload\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n //$(\"#titulo-carga\").removeClass(\"d-none\");\n $('#modal-carga').show();\n },\n complete: function () {\n console.log('complete send');\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"\");\n $(\"#titulo-carga-avance\").addClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"\");\n $(\"#titulo-carga\").addClass(\"d-none\");\n }\n //$(\"#carga-preload\").html(\"\");\n //$(\"#titulo-carga\").addClass(\"d-none\");\n $('#modal-carga').hide();\n }\n };\n\n $(\"#formRegistrar\").ajaxForm(options);\n $(\"#formRegistrar\").submit();\n\n}", "function etreasuryUsersAdmin() {\n $scope.isDataReadyEtUsers = false;\n $http({\n method: 'GET',\n url: baseUrl + 'admin/user_admin/list',\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n $scope.etreasuryUsers = response.data.admin_list;\n for (var i = 0; i < $scope.etreasuryUsers.length; i++) {\n if ($scope.etreasuryUsers[i].idUtilisateur == sessionStorage.getItem(\"iduser\")) {\n $scope.isuserInsessionLine = i;\n break;\n };\n };\n $scope.isDataReadyEtUsers = true;\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "constructor() {\n //vamos a poner un setTimeout para que no arranque ni bien el usuario pulsa el boton\n this.inicializar();\n this.generarSecuencia();\n setTimeout(this.siguienteNivel,500);\n }", "function salvaNota(){\n\tvar idSessione= $(\"#sessionID\").val();\n\tnota=$(\"#notaSessione\").val();\n\t//scrivo la nota in un input hidden.\n\t//La uso quando viene premuto 'annulla'\n\t$(\"#notaHidden\").val(nota);\n\t\n\t\n\t\n\tMetronic.startPageLoading();\n\t\n\t$.ajax( {\n\t\ttype : 'GET',\n\t\t//AuditorsAction.java\n\t\turl : '/CruscottoAuditAtpoWebWeb/salvaNotaAccesso',\n\t\tdata :{ 'idSessione' : idSessione,\n\t\t\t\t'notaSessione' : nota\n\t\t\t \n\t\t\t\t\t },\n\t\t\t\t\t \n\t\n\t\tsuccess : function(data) {\n\t\t\tMetronic.stopPageLoading();\n\t\t\t//$('#indicatori').DataTable().ajax.reload();\n\t\t\t\n\t\t\t\t\t\treturn; \n\t\t\t\n\n\t\t},error: function(data){\n\t\t\tMetronic.stopPageLoading();\n\t\t\tvar settings = {\n\t\t\t\t\ttheme: 'teal',\n\t\t\t\t\tsticky: false,\n\t\t\t\t\thorizontalEdge: 'top',\n\t\t\t\t\tverticalEdge: 'right',\n\t\t\t\t\tlife: 3000\n\t\t\t\t};\n\t\t\t\t\t$.notific8('zindex', 11500);\n\t\t\t\t\t$.notific8('Errore durante il salvataggio ', settings);\n\t\t\t\t\treturn; \n\t\t}\n\t});\n\t}", "function start() {\n if (sessionStorage.getItem(\"usuarioSessionStore\") === null) {\n datos.innerHTML = `Participante no registrado... tenga en cuenta`;\n }else{\n createNombre();\n }\n}", "mostrarPagina(nombrePagina, id_escuderia) {\n this.paginaVacia();\n this.barraNavegacion();\n\n if (nombrePagina == \"CLASIFICACION CONSTRUCTORES\") {\n rellenarTablaClasificacionEscuderias();\n crearTablaClasificacionEscuderias();\n\n } else if (nombrePagina == \"CLASIFICACION PILOTOS\") {\n rellenarTablaClasificacionPilotos();\n crearTablaClasificacionPiloto();\n\n } else if (nombrePagina == \"HOME\") {\n paginaHome();\n\n } else if (nombrePagina == \"ESCUDERIAS\") {\n mostrarEscuderias();\n\n } else if (nombrePagina == \"CIRCUITOS\") {\n mostrarCircuits();\n\n } else if (nombrePagina == \"LOGOUT\") { //Login\n this.logout();\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n } else if (nombrePagina == \"Login\") { //Login\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n //SUB PAGiNES\n } else if (nombrePagina == \"ESCUDERIA-2\") { //Mostrar els pilotos\n mostrarPilotosDeXEscuderia(id_escuderia);\n \n } else if (nombrePagina == \"NUEVO CIRCUITO\") { //Añadir nou circuit\n formularioCircuito();\n\n } else if (nombrePagina == \"NUEVO PILOTO\") { //Añadir nou piloto\n formularioPiloto();\n \n } else if (nombrePagina == \"SIMULAR CARRERA\") { //Simular carrera\n simularCarrera();\n crearSimulacioClasificacionPiloto();\n }\n\n\n\n this.piePagina();\n\n console.log(nombrePagina);\n }", "function operadorRechazoSolicitud(req,res){\n console.log('rechazo solicitud');\n let id_operador= req.params.id, id_solicitante = req.params.id_solicitante;\n let solicitud = buscarSolicitud(id_solicitante);\n solicitudes[solicitud].estatus='pendiente';\n arregloSolicitudRechazada.push({idSolicitante:id_solicitante,idOperador:id_operador});\n console.log(`El operador ${ arregloSolicitudRechazada[0].idSolicitante } rechazo la solicitud de ${ id_solicitante }`);\n res.status(200).send({message:['Mamon']});\n}", "VerificarDatos(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n let list = req.files;\n let cadena = list.uploads[0].path;\n let filename = cadena.split(\"\\\\\")[1];\n var filePath = `./plantillas/${filename}`;\n const workbook = xlsx_1.default.readFile(filePath);\n const sheet_name_list = workbook.SheetNames; // Array de hojas de calculo\n const plantilla = xlsx_1.default.utils.sheet_to_json(workbook.Sheets[sheet_name_list[0]]);\n var contarDatos = 0;\n var contarCedula = 0;\n var contarContrato = 0;\n var contarPeriodos = 0;\n var contador = 1;\n /** Periodo de vacaciones */\n plantilla.forEach((data) => __awaiter(this, void 0, void 0, function* () {\n // Datos obtenidos de la plantilla\n const { nombre_empleado, apellido_empleado, cedula, descripcion, vacaciones_tomadas, fecha_inicia_periodo, fecha_fin_periodo, dias_vacacion, horas_vacacion, minutos_vacacion, dias_por_antiguedad, dias_perdidos } = data;\n // Verificar si los datos obligatorios existen\n if (cedula != undefined && descripcion != undefined && vacaciones_tomadas != undefined &&\n fecha_inicia_periodo != undefined && fecha_fin_periodo != undefined && dias_vacacion != undefined &&\n horas_vacacion != undefined && minutos_vacacion != undefined && dias_por_antiguedad != undefined &&\n dias_perdidos != undefined) {\n contarDatos = contarDatos + 1;\n }\n // Verificar si la cédula del empleado existen dentro del sistema\n if (cedula != undefined) {\n const CEDULA = yield database_1.default.query('SELECT id, codigo FROM empleados WHERE cedula = $1', [cedula]);\n if (CEDULA.rowCount != 0) {\n contarCedula = contarCedula + 1;\n // Verificar si el empleado tiene un contrato\n const CONTRATO = yield database_1.default.query('SELECT MAX(ec.id) FROM empl_contratos AS ec, empleados AS e WHERE ec.id_empleado = e.id AND e.id = $1', [CEDULA.rows[0]['id']]);\n if (CONTRATO.rowCount != 0) {\n contarContrato = contarContrato + 1;\n // Verificar si el empleado ya tiene registrado un periodo de vacaciones\n const PERIODO = yield database_1.default.query('SELECT * FROM peri_vacaciones WHERE codigo = $1', [parseInt(CEDULA.rows[0]['codigo'])]);\n if (PERIODO.rowCount === 0) {\n contarPeriodos = contarPeriodos + 1;\n }\n }\n }\n }\n // Verificar que todos los datos sean correctos\n console.log('datos', contarDatos, contarCedula, contarContrato);\n if (contador === plantilla.length) {\n if (contarDatos === plantilla.length && contarCedula === plantilla.length &&\n contarContrato === plantilla.length && contarPeriodos === plantilla.length) {\n return res.jsonp({ message: 'correcto' });\n }\n else {\n return res.jsonp({ message: 'error' });\n }\n }\n contador = contador + 1;\n }));\n fs_1.default.unlinkSync(filePath);\n });\n }", "function enviar() {\n if (!validar()) {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n } else if (!validarTamCampos()) {\n mostrarMensaje(\"alert alert-danger\", \"Tamaño de los campos marcados Excedido\", \"Error!\");\n } else {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuariosAction\").val(),\n idUsuario: $(\"#idUsuario\").val(),\n password: $(\"#password\").val(),\n nombre: $(\"#nombre\").val(),\n apellido1: $(\"#primerApellido\").val(),\n apellido2: $(\"#segundoApellido\").val(),\n correo: $(\"#correo\").val(),\n fechaNacimiento: $(\"#fechaNacimiento\").data('date'),\n direccion: $(\"#direccion\").val(),\n telefono1: $(\"#telefono1\").val(),\n telefono2: $(\"#telefono2\").val(),\n tipo: \"normal\"\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarModal(\"myModal\", \"Exito\", \"Usuario agregado Correctamente!\", \"true\");\n limpiarForm();\n } else {\n if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador\", \"Error!\");\n }\n }\n },\n type: 'POST'\n });\n }\n}", "function listando_todos_os_contatos_001(){ \n try{ \n \n var linha_recebida = lista_de_contatos.split(\"@\"); \n for( var i = ( linha_recebida.length - 1 ); i >= 0; i-- ) {\n if( linha_recebida[i].includes(\"-\") ){\n var web_id;\n var web_comando;\n var web_usuario_logado;\n \n var web_contato_email;\n var web_contato_nome;\n var web_contato_nome_meio;\n var web_contato_ultimo_nome;\n\n var argumentos = linha_recebida[i].split(\"j\");\n for( var j = 0; j < argumentos.length; j++ ) {\n if(j === 0){ \n web_id = argumentos[j];\n }\n else if(j === 1){\n web_comando = argumentos[j];\n }\n else if(j === 2){\n web_usuario_logado = argumentos[j];\n }\n else if(j === 3){\n web_contato_email = argumentos[j];\n }\n else if(j === 4){\n web_contato_nome = argumentos[j];\n }\n else if(j === 5){\n web_contato_nome_meio = argumentos[j];\n }\n else if(j === 6){\n web_contato_ultimo_nome = argumentos[j];\n }\n }\n\n //Verificar se este contato é deste usuário\n var nome_principal = \"\"; try{ nome_principal = converter_base64(web_contato_nome).trim(); }catch(Exception){}\n var web_contato_email_str = importar_Para_Alfabeto_JM( web_contato_email ).trim().toUpperCase();\n \n percorrer_todas_as_conversas( web_id, web_contato_email_str, nome_principal );\n }\n } \n }catch(Exception){\n \n document.getElementById(\"ul_meus_contatos\").innerHTML = \"consultar_contato_antes_de_cadastrar_003 -- \" + Exception;\n }finally { \n \n //alert(\"Acabou\");\n setTimeout(function(){ \n \n //alert(\"Reiniciando\");\n if( carregado === 1 ){\n \n _01_controle_loop_sem_fim();\n }\n else if( carregado === 0 ){\n \n carregado = 0;\n document.getElementById(\"ul_meus_contatos\").style.display = 'block';\n \n document.getElementById(\"contato_tabela_xy_01\").style.display = 'none';\n document.getElementById(\"contato_tabela_xy_01\").innerHTML = \"\";\n \n _01_controle_loop_sem_fim();\n }\n \n }, 1000);\n }\n \n }", "function getDatos() {\n\tvar comando= {\n\t\t\tid : sessionStorage.getItem(\"idUsuario\")\n\t};\n\t\n\tvar request = new XMLHttpRequest();\t\n\trequest.open(\"post\", \"GetDatosUsuario.action\");\n\trequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\trequest.onreadystatechange=function() {\n\t\tif (request.readyState==4 && request.status==200) {\n\t\t\tvar respuesta=JSON.parse(request.responseText);\n\t\t\trespuesta=JSON.parse(respuesta.resultado);\n\t\t\tif (respuesta.tipo==\"error\") {\n\t\t\t\talert(\"Ocurrió un error al recuperar los datos: \" + respuesta.mensaje);\n\t\t\t} else {\n\t\t\t\tvar email=document.getElementById(\"email\")\n\t\t\t\tvar nombre=document.getElementById(\"nombre\");\n\t\t\t\tvar apellido1=document.getElementById(\"apellido1\");\n\t\t\t\tvar apellido2=document.getElementById(\"apellido2\");\n\t\t\t\tvar fechaDeAlta=document.getElementById(\"fechaDeAlta\");\n\t\t\t\tvar telefono=document.getElementById(\"telefono\");\n\t\t\t\tvar idUbicacion=document.getElementById(\"idUbicacion\");\n\t\t\t\tif (email!=null) email.value=respuesta.email;\n\t\t\t\tif (nombre!=null) nombre.value=respuesta.nombre;\n\t\t\t\tif (apellido1!=null) apellido1.value=respuesta.apellido1;\n\t\t\t\tif (apellido2!=null) apellido2.value=respuesta.apellido2;\n\t\t\t\tif (fechaDeAlta!=null) fechaDeAlta.value=respuesta.fechaDeAlta;\n\t\t\t\tif (telefono!=null) telefono.value=respuesta.telefono;\n\t\t\t\tif (idUbicacion!=null) idUbicacion.value=respuesta.idUbicacion;\n\t\t\t}\n\t\t}\n\t};\n\tvar pars=\"command=\" + JSON.stringify(comando);\n\trequest.send(pars);\n}", "function valida_sesion_iniciada()\n{\n //validar si esta en alguna sesion\n id_plan = buscarlocal('id_plan');\n id_sesion = buscarlocal('id_sesion');\n\n\n if(id_plan === null && id_sesion === null)\n {\n console.log(\"no existe ninguno en local\");\n estadoPlan = false;\n estadoSesion = false;\n\n }else if(id_plan =! null && id_sesion === null)\n {\n console.log(\"solo existe el plan, mas no la sesion\");\n console.log(id_plan);\n estadoPlan = true;\n estadoSesion = false;\n\n }else\n {\n console.log(\"existen las dos en el local\");\n console.log(id_plan);\n console.log(id_sesion);\n estadoPlan = true;\n estadoSesion = true;\n }\n}", "function enviar() {\n if (validar()) {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuarioAction\").val(),\n id: $(\"#idUsuario\").val(),\n nombre: $(\"#nom\").val(),\n apellidos: $(\"#ape\").val(),\n fechaNacimiento: $(\"#ano\").data('date'),\n correo: $(\"#email\").val(),\n direccion: $(\"#dir\").val(),\n telefono: $(\"#tel\").val(),\n celular: $(\"#cel\").val(),\n password: $(\"#pass\").val()\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarMensaje(\"alert alert-success\", respuestaTxt, \"Correcto!\");\n //$(\"#myModalFormulario\").modal(\"hide\");\n // consultarPersonas();\n } else {\n if(tipoRespuesta === \"P~\"){\n mostrarMensaje(\"alert alert-danger\", \"Ya existe un usuario con este número de cédula\", \"Error!\");\n $(\"#idUsuario\").addClass(\"has-error\");\n } \n else if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } \n \n else {\n mostrarMensaje(\"alert alert-danger\", \"Se generó un error, contacte al administrador\", \"Error!\");\n }\n }\n\n },\n type: 'POST'\n });\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n }\n}", "function _cambioregistro_7767() {\n $_ETNIAPACIW = \"\";\n if (($_EMBALTOPACIW == \"S\") || ($_EMBALTOPACIW == \"N\")) {\n\n setTimeout(_dato4_7767, 100);\n _consultademostrarinf_7767();\n\n } else {\n $_EMBALTOPACIW = \"\";\n setTimeout(_dato4_7767, 100);\n _consultademostrarinf_7767();\n\n }\n}", "function mensajes(respuesta){\n\n\t\t\t\tvar foo = respuesta;\n\n\t\t\t\t\tswitch (foo) {\n\n\t\t\t\t\t\tcase \"no_exite_session\":\n\t\t\t\t\t\t//============================caso 1 NO EXISTE SESSION==================//\n\t\t\t\t\t\tswal(\n\t\t\t\t\t\t\t\t'Antes de comprar Inicia tu Session en la Pagina?',\n\t\t\t\t\t\t\t\t'Recuerda si no tienes cuenta en la pagina puedes registrarte?',\n\t\t\t\t\t\t\t\t'question'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\tcase \"saldo_insuficiente\":\n\t\t\t\t\t\t//==============CASO 2 SALDO INSUFICIENTE=======================//\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\ttitle: 'Oops...',\n\t\t\t\t\t\t\ttext: 'Tu saldo es insuficiente para poder realizar la trasaccion, recarga tu monedero e intenta de nuevo',\n\t\t\t\t\t\t\tfooter: 'Puedes recargas tu saldo con nostros mas informacion en nuestras redes sociales'\n\t\t\t\t\t\t})\n\t\t\t\t\t\tbreak;\n\n\n\n\t\t\t\t\t}\n\t\t\t}", "function autenticacao() {\r\r /*\r * EXIBE O PRELOAD PARA O USUARIO FINAL\r */\r $(\".load-autenticacao\").removeClass(\"hide\");\r\r /*\r * REALIZA A REQUISICAO AJAX\r */\r $.ajax({\r type: 'post',\r data: 'email=' + $(\".email-autenticacao\").val() + \"&actionType=login&senha=\" + $(\".senha-autenticacao\").val(),\r url: getMyFolderRoot() + '/pt/produtos/autenticacao',\r success: function (data) {\r\r /*\r * CASO CASO PELO REQUEST RETORNE \"/produtos/endereco/\" O USUARIO \r * ESTA DEVIDAMENTE ALTENTICADO\r */\r if (data == \"/produtos/endereco/\") {\r /*\r * REALIZA A SEGUNDA REQUISICAO AJAX\r * VERIFICAR SE EXITE ENDERECO DE ENTREGA\r */\r $.ajax({\r type: 'post',\r data: '',\r url: getMyFolderRoot() + '/pt/produtos/endereco/',\r success: function (data) {\r /*\r * ADICIONA A CLASSE HIDE PRA OCULPAR O PRELOAD\r */\r $(\".load-autenticacao\").addClass(\"hide\");\r /*\r * REMOVE A CLASSE HIDE EXIBINDO O PASSO 2\r */\r $(\".step-2\").removeClass(\"hide\");\r /*\r * ATUALIZA O HTML COM O FORMULARIO DE ENDERECO\r */\r $(\"#step-2\").html(data);\r /*\r * CONSULTA O CEP PELO WEBSERVICE PARA POPULAR O FORMULARIO COM O ENDERCO PRE INFORMADO\r */\r get_action_cep();\r /*\r * CASO ENDERECO EXISTA ABRE O TERCEIRO PASSO\r */\r if ($(\"#EXISTE_ENDERECO_ENTREGA\").val() == \"SIM\") {\r /*\r * CHAMA FUNCAO QUE GERENCIA O PASSO 3 REFERENTE A FORMA DE ENVIO\r */\r forma_envio();\r }\r }\r });\r\r /*\r * REQUISICAO AJAX PARA EXIBIR HTML DO PASSO 1\r */\r $.ajax({\r type: 'post',\r data: '',\r url: getMyFolderRoot() + '/pt/produtos/autenticacao',\r success: function (data) {\r $(\".load-autenticacao\").addClass(\"hide\");\r $(\"#step-1\").html(data);\r }\r });\r\r /*\r * REQUISICAO AJAX PARA ALTERAR HTML DO TOP\r */\r $.ajax({\r type: 'post',\r data: '',\r url: getMyFolderRoot() + '/pt/index/top',\r success: function (data) {\r $(\"#stt_logado_print\").html(data);\r }\r });\r\r } else {\r /*\r * CASO NAO ESTEJA DEVIDAMENTE ALTENTICADO ADICIONA A CLASSE HIDE PARA OCULTAR PRELOAD \r */\r $(\".load-autenticacao\").addClass(\"hide\");\r /*\r * ADICIONA O FORMULARIO COM ALERTAS DE AUTENTICACAO INVALIDA\r */\r $(\"#step-1\").html(data);\r }\r\r }\r });\r\r}", "function SolicitudesRX(IdExpediente,pagina){\t\r\n\t\t//alert('Numero Expediente '+IdExpediente+' Pagina '+pagina);\r\n\t\t accion=6;\r\n\t\t// Crear Objeto Ajax\r\n\t\tObjetoAjax=NuevoAjax();\t\t\t\r\n\t\t// Hacer el Request y llamar o Dibujar el Resultado\r\n\t\tObjetoAjax.onreadystatechange = CargarContenido;\r\n\t\tObjetoAjax.open(\"POST\", 'ResultadosEstudios.php', true);\r\n\t\tObjetoAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\r\n\r\n\t\t// Declaraci�n de par�metros\r\n\r\n\t\tvar NumeroExp=IdExpediente;\r\n\t\tvar NoPagina=pagina;\r\n\t\tvar Proceso='ConsultasRX';\r\n\t\tvar param = 'Proceso='+Proceso;\r\n\t\t\r\n\t\t// Concatenaci�n y Env�o de Par�metros\r\n\t\tparam += '&IdNumeroExp='+NumeroExp+'&pag='+NoPagina;\r\n\t\tObjetoAjax.send(param); \r\n\t\t\r\n}", "crearUsuario() {\n if (this.lista_usuario.findIndex(usuario => usuario.id == this.usuario.id) === -1) {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n this.lista_usuario.push(this.usuario)\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.estado = \"\"\n }\n else {\n alert('Este usuario ya se encuentra Registrado')\n }\n }", "function cadastraUsuario(u,s,e) {\n return new Promise((resolve,reject) => {\n let sqlValida = \"select user from tbUser where user = ? and email = ?\"\n let stmValida = db.prepare(sqlValida)\n stmValida.get([u,e],(err, row) => {\n if(err) reject(new Error(err))\n else if(row!==undefined) reject(new Error(\"usuario_ja_cadastrado\"))\n else {\n let sqlInsert = \"INSERT INTO tbUser(user,pw,email) values(?,?,?);\"\n let stmInsert = db.prepare(sqlInsert);\n stmInsert.run([u,getSha256([s,u.substr(0,3)].join(\";\")),e], (err) => {\n if(err) reject(new Error(err))\n else resolve(\"usuario_cadastrado_sucesso\")\n })\n }\n })\n })\n}", "function login_verifica(){\n\n //let consulta = \"https://gtproyeccion.000webhostapp.com/api/Api_usuarios.php?operacion=validar&dni_u=04079175&contrasena=123\";\n var datos = $('#form_login').serialize();\n datos = datos+\"&operacion=validar\";\n $.ajax({\n url: \"https://gtproyeccion.000webhostapp.com/api/Api_usuarios.php\",\n type:\"POST\",\n data: datos,\n async: false,\n success: function(r, status, XHR){\n r.map((d)=>{\n if(\"Secretaria General\" === d.rol){\n $('#contenedor_principal').empty();\n cargar_vice();\n }\n });\n \n },\n error: function(XHR, status, error){\n alert(\"Usuario o Password incorrecto\");\n }\n });\n\n /*let usuario = $(\"#l_usuario\").val();\n let pass = $(\"#l_pass\").val();\n\n if(usuario==\"admin1\" && pass==\"admin1\"){\n $('#contenedor_principal').empty();\n \n }else if(usuario==\"admin2\" && pass==\"admin2\") {\n\n }else if(usuario==\"vice\" && pass==\"vice\") {\n $('#contenedor_principal').empty();\n cargar_vice();\n }else {\n alert(\"Usuario o Password incorrecto\");\n }*/\n}", "function get_sucursal(){\n\tvar ids=sessionStorage.getItem(\"id\");\n\tvar idd=JSON.parse(ids);\n\tvar parametros = {\n \"id\" : idd.id,\n \"user\": idd.nombre,\n \"suc\": idd.s\n \t};\n\t$.ajax({\n\t\t/*paso los paramentros al php*/\n\t\tdata:parametros,\n\t\turl: 'getsucursal.php',\n\t\ttype:'post',\n\t\t/*defino el tipo de dato de retorno*/\n\t\tdataType:'json',\n\t\t/*funcion de retorno*/\n\t\tsuccess: function(data){\n\t\t\t/*Agrego el numero de sucursal y los datos respectivos en la etiqueta para mostrar al usuario \n\t\t\tla sucursal en la que se esta registrando el nuevo usuario*/\n\t\t\tvar cadenaP=data['name']+\" \"+data['dir'];\n\t\t\t$(\"#suc\").val(data['id']);\n\t\t\t$(\"#label_suc\").html(cadenaP);\n\t\t}\n\t});\n}", "mensajes_dos_usuarios(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { cod_r } = req.params;\n const { cod_d } = req.params;\n const usuarios = yield pool.query('SELECT mensaje.cod_mensaje, mensaje.cod_usuario_remitente,usuario.nombre as nom_remitente, mensaje.cuerpo,mensaje.archivos_adjuntos, mensaje.asunto,mensaje.fecha as fecha , mensaje.cod_usuario_destinatario as cod_destinatario FROM proyecto_ionic.mensaje inner join usuario on usuario.cod_usuario = mensaje.cod_usuario_remitente where cod_usuario_remitente =? and cod_usuario_destinatario=? or cod_usuario_remitente =? and cod_usuario_destinatario=? order by cod_mensaje asc', [cod_r, cod_d, cod_d, cod_r]);\n if (usuarios.length > 0) {\n return res.json(usuarios);\n }\n else {\n res.status(404).json({ text: 'No existen conversaciones' });\n }\n });\n }", "cancelar() {\n // se borran las busquedas de usuarios y se deja la variable \"users\" en blanco //\n this.users = [], [];\n // se hace un llamado a la funcion \"getUsers()\" para volver a llenar la variable \"users\" con el conjunto de usuarios del servidor\n this.getUsers();\n }", "function registroRegistrarseHandler() {\n let nombreIngresado = $(\"#txtRegistroNombre\").val();\n let apellidoIngresado = $(\"#txtRegistroApellido\").val();\n let direccionIngresada = $(\"#txtRegistroDireccion\").val();\n let emailIngresado = $(\"#txtRegistroEmail\").val();\n let passwordIngresado = $(\"#txtRegistroPassword\").val();\n let passwordIngresado2 = $(\"#txtRegistroRepPassword\").val();\n const opciones = { title: 'Error' };\n if (validarCorreo(emailIngresado)) {\n if (passwordIngresado === passwordIngresado2) {\n if (validarPassword(passwordIngresado)) {\n if (validarNombre(nombreIngresado)) {\n if (validarApellido(apellidoIngresado)) {\n if (validarDireccion(direccionIngresada)) {\n //Guardamos los datos del usuario en un objeto llamado datosUsuario,m que luego lo pasamos por string a la llamada ajax\n const datosUsuario = {\n nombre: nombreIngresado,\n apellido: apellidoIngresado,\n email: emailIngresado,\n direccion: direccionIngresada,\n password: passwordIngresado\n };\n\n $.ajax({\n type: 'POST',\n url: urlBase + 'usuarios',\n contentType: \"application/json\",\n data: JSON.stringify(datosUsuario),\n // Ya que lo que debemos ejecutar es tan simple, lo hacemos en una funcion anonima.\n success: function () {\n ons.notification.alert(\"El usuario ha sido creado correctamente\", { title: 'Aviso!' });\n navegar('login', true);\n },\n error: errorCallback\n });\n } else {\n ons.notification.alert('La dirección debe contener un nombre de calle y un numero de puerta', opciones);\n }\n } else {\n ons.notification.alert('El apellido no puede estar vacío o contener un solo caracter', opciones);\n }\n } else {\n ons.notification.alert('El nombre no puede estar vacío o contener un solo caracter', opciones);\n }\n } else {\n ons.notification.alert('La contraseña debe tener al menos 8 caracteres', opciones);\n }\n } else {\n ons.notification.alert('Los passwords no coinciden', opciones);\n }\n } else {\n ons.notification.alert('El formato del correo no es válido', opciones);\n }\n}", "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = [];\n this.grabarArchivo();\n this.ultimos4 = []\n console.log('Se ha inicializado el sistema');\n \n }", "function modificarCliente(){\n let cliente = new Cliente(document.getElementById('').value, document.getElementById('').value, \n document.getElementById('').value, document.getElementById('').value, document.getElementById('').value, \n document.getElementById('').value);\n\n //Actualizar registroUsuarios\n for(let i in registroUsuarios){\n if(registroUsuarios[i]== cliente.correo){\n //Aqui debo preguntar si no existe ya este cliente por el hecho que lo tomaremos como identificador unico que es el correo\n //Debo tener en cuenta los permisos a la hora de modificar, capas que un cliente puede modificarse el estado\n registroUsuarios[i].nombre = cliente.nombre;\n registroUsuarios[i].apellido = cliente.apellido;\n registroUsuarios[i].contraseña = cliente.contraseña;\n registroUsuarios[i].correo = cliente.correo;\n registroUsuarios[i].tipo = cliente.tipo;\n registroUsuarios[i].estado = cliente.estado;\n break;\n }\n }\n localStorage.setItem('Usuarios', JSON.stringify(registroUsuarios));\n\n}", "function cargarDatosSoporte(idSoporte) {//Verificar si ya se cargo el usuario...\n UsuarioService.getUsuario().then(function () {\n if (idSoporte) {\n $scope.adminSoportesActive = SoporteService.isAdminSoportes();\n $scope.showLoader($scope, \"Cargando soporte...\", \"SoporteDetalleCtrl:cargarSoporte\");\n return cargarSoporte(idSoporte).then(function (data) {\n if (data) {\n //Cargar notas del soporte\n cargarNotas(idSoporte);\n //Cargar archivos del soporte\n cargarArchivos(idSoporte);\n }\n }, function (error) {\n console.log(error);\n if (error.message) {\n //$scope.showAlert('ERROR', error.message);\n }\n }).finally(function () {\n $scope.hideLoader($scope, \"SoporteDetalleCtrl:cargarSoporte\");\n });\n }\n return $q.reject(\"El id del soporte a cargar es nulo\");\n });\n }", "async function activarUsuarios (seleccionados){\n var messages = new Array();\n for (i=0; i < seleccionados.length; i++){\n await $.ajax({\n url: \"https://localhost:3000/volvo/api/GU/GU_GESTION_USUARIOS\",\n headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')},\n data: {\n \"accion\" : 'ACTIVATE',\n \"nombreUsuario\" : $('#nombreUsuario'+seleccionados[i]).text()\n },\n dataType: \"json\",\n method: \"POST\",\n success: function(respuesta){\n if(respuesta.output.pcodigoMensaje == 0){\n messages.push({pcodigoMensaje: respuesta.output.pcodigoMensaje, usuario: $('#nombreUsuario'+seleccionados[i]).text()})\n }else{\n messages.push({pcodigoMensaje: respuesta.output.pcodigoMensaje, usuario: $('#nombreUsuario'+seleccionados[i]).text()})\n }\n },\n error : function(error){\n messages.push({pcodigoMensaje: respuesta.output.pcodigoMensaje, usuario: $('#nombreUsuario'+seleccionados[i]).text()})\n }\n });\n }\n return messages;\n}", "function iniciarConsulta(id_expediente)\n{\n\t\t\t$(\"#id_expediente\").prop('value',id_expediente);\n\t\t\t$.post('includes/expediente_emp.php?id_expediente='+id_expediente,{},function(data){ \n\t\t\t\tremoverBuzon(id_expediente);\n\t\t\t\t$(\"#contenedor\").html(data); \n\t\t\t});\n\n\n}", "function saludarUsuario(nombreUsuario){\n\n console.log(\"Buenas tardes \"+nombreUsuario);\n\n}", "function actualizar_dia(cod_tie,estatu,dia){\n\n\t\n\n\tswitch(dia){\n\n\t\tcase 1: semana=\"lun_hor_tie=\"; \n\t\t\t\tday=\"lun_hor_tie\";\n\t\tbreak;\n\n\t\tcase 2: semana=\"mar_hor_tie=\"; \n\t\t\t\tday=\"mar_hor_tie\";\n\t\tbreak;\n\n\t\tcase 3: semana=\"mie_hor_tie=\"; \n\t\t\t\tday=\"mie_hor_tie\";\n\t\tbreak;\n\n\t\tcase 4: semana=\"jue_hor_tie=\"; \n\t\t\t\tday=\"jue_hor_tie\";\n\t\tbreak;\n\n\t\tcase 5: semana=\"vie_hor_tie=\"; \n\t\t\t\tday=\"vie_hor_tie\";\n\t\tbreak;\n\n\t\tcase 6: semana=\"sab_hor_tie=\"; \n\t\t\t\tday=\"sab_hor_tie\";\n\t\tbreak;\n\n\t\tcase 7: semana=\"dom_hor_tie=\"; \n\t\t\t\tday=\"dom_hor_tie\";\n\t\tbreak;\n\n\t}\n\nif(estatu==1){\n\testatu2=0;\n\test=\"Dia Inactivo\";\n\test2=\"Desactivar\";\n}\n\nelse{\n\testatu2=1;\n\test=\"Dia Activo\";\n\test2=\"Activar\";\t\n}\n\n\nSwal.fire({\n\t title: '¿Desea '+est2+\" Este Dia?\",\n\t showCancelButton: true,\n\t confirmButtonText: 'Si'\n\t\t}).then((result) => {\n\t /* Read more about isConfirmed, isDenied below*/ \n\t\t if (result.isConfirmed) {\n\n\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl:\"../../backend/controlador/horario/hora.php\",\n\t\t\t\t\t\tdata: semana+estatu2+\"&&tienda_cod_tie=\"+cod_tie+\"&&opcion=\"+day+\"&&estatu=\"+estatu2+\"&&accion=actualizar_dia\",\n\t\t\t\t\t\tsuccess:function(r){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\t\t\tposition: 'top-end',\n\t\t\t\t\t\t\t\t\ticon: 'success',\n\t\t\t\t\t\t\t\t\ttitle: est,\n\t\t\t\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t\t\t\t\ttimer: 1500\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t//location.href=\"cuenta.php\";\n\t\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t \t} \n\t})\n}", "busqueda(termino, parametro) {\n // preparacion de variables //\n // ------ Uso de la funcion to lower case [a minusculas] para evitar confuciones en el proceso\n // ------/------ La busqueda distingue mayusculas de minusculas //\n termino = termino.toLowerCase();\n parametro = parametro.toLowerCase();\n // variable busqueda en la que se almacenara el dato de los usuarios que se buscara //\n var busqueda;\n // [Test] variable conteo para registar el numero de Usuarios que coinciden con la busqueda //\n var conteo = +0;\n // Se vacia el conjunto de objetos [users] para posteriormente rellenarlos con los usuarios que coincidan con la busqueda //\n this.users = [], [];\n // [forEach] = da un recorrido por los objetos de un conjunto en este caso, selecciona cada usuario del conjunto \"usuarios\" //\n this.usuarios.forEach(item => {\n // Bifurcador de Seleccion [switch] para detectar en que dato del usuario hacer la comparacion de busqueda //\n switch (parametro) {\n //------En caso de que se ingrese la opcion por defecto, es decir, no se haya tocado el menu de selecicon\n case 'null':\n {\n // Se hace un llamado a la funcion \"getUsers\" que carga los usuarios almacenados en el servidor //\n this.getUsers();\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Nombre\n case 'nombre':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion apellido\n case 'apellido':\n {\n console.log('entro en apellido...');\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.apellido.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion apellido: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cedula\n case 'cedula':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cedula.replace('-', '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion cedula: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cuenta\n case 'cuenta':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Buscar en Todo\n case 'todo':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase() + item.apellido.replace(/ /g, '').toLowerCase() + item.cedula.replace('-', '').toLowerCase() + item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n }\n // if (parametro == 'null') {\n // console.log('dentro de null');\n // this.getUsers();\n // this.test = 'Ingrese un Campo de busqueda!!..';\n // }\n // if (parametro == 'nombre') {\n // // preparacion de variables:\n // busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // if (busqueda.indexOf(termino, 0) >= 0) {\n // this.users.push(item);\n // conteo = conteo +1;\n // console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n // }\n // }\n // if (parametro == 'apellido') {\n // console.log('dentro de apellido');\n // }\n // if (parametro == 'cedula') {\n // console.log('dentro de cedula');\n // }\n // if (parametro == 'cuenta') {\n // console.log('dentro de cuenta');\n // }\n // if (parametro == 'todo') {\n // console.log('dentro de todo');\n // }\n });\n if (this.users.length >= 1) {\n console.log('existe algo.... Numero de Registros: ' + conteo);\n return;\n }\n else if (this.users.length <= 0) {\n this.getUsers();\n }\n }", "showAlertAcessoParticipante(sucess_error,mensagem){\n if(sucess_error==='success'){\n const div = document.createElement('div')\n div.id = 'message'\n div.innerHTML = `\n <div class=\"container text-center mx-auto my-auto\" style=\"padding: 5px;\">\n <div id=\"inner-message\" class=\"alert alert-primary text-center\">\n <div class=\"\" style=\"width:11%!important;float:right\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n </div>\n <p>${mensagem}</p>\n </div>\n </div>\n `\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\n }\n if(sucess_error==='error'){\n const div = document.createElement('div')\n div.id = 'message'\n div.innerHTML = `\n <div class=\"container text-center mx-auto\" style=\"padding: 5px;\">\n <div id=\"inner-message\" class=\"alert alert-danger text-center\">\n <div class=\"\" style=\"width:11%!important;float:right\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n </div>\n <p>${mensagem}</p>\n </div>\n </div>\n `\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\n }\n setTimeout(() => {\n document.getElementById('message').remove()\n }, 3000);\n }", "function verificaData(aux) {\n query = \"SELECT id, data, sumario FROM sumario ORDER BY id DESC LIMIT 1\";\n console.log(query);\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n verificaQuery();\n if(result.length > 0){\n result.forEach((sumario) => {\n var data = new Date();\n console.log(query);\n if(aux == 0){\n if (isDateInThisWeek(data, sumario.data)) {\n var edita = \"true\";\n var idSumario = sumario.id;\n sessionStorage.setItem(\"edita\", edita);\n sessionStorage.setItem(\"idSumario\", idSumario);\n sessionStorage.setItem(\"sumText\", sumario.sumario);\n window.location.replace(\"../html/alunoSumario.html\")\n }\n else{\n var edita = \"false\";\n sessionStorage.setItem(\"edita\", edita);\n window.location.replace(\"../html/alunoSumario.html\")\n }\n }\n else{\n if (isDateInThisWeek(data, sumario.data)) {\n var edita = \"true\";\n var idSumario = sumario.id;\n sessionStorage.setItem(\"edita\", edita);\n sessionStorage.setItem(\"idSumario\", idSumario);\n sessionStorage.setItem(\"sumText\", sumario.sumario);\n window.location.assign(\"../html/alunoSumario.html\")\n }\n else{\n var edita = \"false\";\n sessionStorage.setItem(\"edita\", edita);\n window.location.assign(\"../html/alunoSumario.html\")\n }\n }\n });\n } else {\n var idSumario = null;\n var idSumarioaux = null;\n var sumText = \"\";\n sessionStorage.setItem(\"idSumario\", idSumario);\n sessionStorage.setItem(\"idSumarioaux\", idSumarioaux);\n sessionStorage.setItem(\"sumText\", sumText);\n window.location.assign(\"../html/alunoSumario.html\")\n }\n }\n });\n closeConnectionDataBase();\n}", "function cargarSaldo(u_condominio, u_condomino) {\n\n\n\n /**\n * SUMAR CUENTAS\n */\n // if (x < 1) {\n // $timeout(function () {\n cargarTransacciones(u_condominio, u_condomino);\n\n\n /* LOGS propiedades de condomino\n console.log(u_condominio)\n console.log(u_condomino.$id)\n console.log(u_condomino.costo_cuota_agua)\n console.log(u_condomino.costo_cuota_agua_exceso)\n console.log(u_condomino.cuota_agua)*/\n\n // Prefijo S_ para variables de sumatoria.\n\n /**\n * CUOTA DE MANTENIMIENTO\n */\n\n var s_mantenimiento = u_condomino.cuota_agua;\n // console.log('cuota de mantenimiento', s_mantenimiento)\n s_costo_mantenimiento = s_mantenimiento;\n\n /**\n * Exceso de Agua\n */\n\n var dt = new Date();\n var month = dt.getMonth() + 1;\n var year = dt.getFullYear();\n var fecha_actual = \"0\" + 5 + \"-\" + year;\n var contador = u_condomino.contador;\n\n\n getConsumo(u_condominio, contador, fecha_actual).then(consumo => calcular_exceso(\n consumo, u_condomino.costo_cuota_agua_exceso, u_condomino.$id)).catch(err => {\n\n if (!err) {\n\n arr_cosumop.push({\n id_condomino: u_condomino.$id,\n valor: 0\n });\n $scope.excesos = arr_cosumop;\n }\n\n })\n\n\n\n\n /**\n * Amenidades \n */\n\n\n //cargar_amenidad(u_condominio, u_condomino.$id)\n\n\n\n\n costo_amenidad_pos(u_condominio, u_condomino.$id).then(\n amenidadades_pos => exportPos(amenidadades_pos)\n );\n\n\n\n\n costo_amenidad_neg(u_condominio, u_condomino.$id).then(\n amenidadades_neg => exportNeg(amenidadades_neg)\n );\n\n\n\n\n var s_costo_amenidad_total = s_costo_amenidad_neg - s_costo_amenidad_pos;\n var total = s_costo_mantenimiento + s_costo_amenidad_total + s_costo_exceso;\n\n\n arr_cuota.push({\n cuota: s_costo_mantenimiento\n })\n\n $scope.saldosMant = arr_cuota;\n\n // })\n\n }", "function RealizarCorte() {\r\n let date = getDate();\r\n let count = 0;\r\n let usuario = \"\";\r\n for (let i = 0; i < ventaBD.length; i++) {\r\n for (let j = 0; j < usuariosBD.length; j++) {\r\n if (ventaBD[i].id_usuario === usuariosBD[j].id) {\r\n usuario = usuariosBD[j].nombre + \" \" + usuariosBD[j].apellido;\r\n }\r\n }\r\n if (ventaBD[i].fecha === date) {\r\n count++;\r\n document.getElementById(\r\n \"tabla-corte-body\"\r\n ).innerHTML += `<tr><td>${ventaBD[i].fecha}</td><td>${ventaBD[i].id_venta}</td><td>${ventaBD[i].id_usuario}</td><td>${usuario}</td><td>$${ventaBD[i].total}</td></tr>`;\r\n }\r\n }\r\n\r\n if (count === 0) {\r\n document.getElementById(\"div-tablacorte\").style.display = \"none\";\r\n document.getElementById(\"none-alert\").style.display = \"block\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = false;\r\n } else {\r\n document.getElementById(\"div-tablacorte\").style.display = \"block\";\r\n document.getElementById(\"none-alert\").style.display = \"none\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = true;\r\n }\r\n}", "function iniciarSesion() {\r\n // prompt(\"Ingresa tu usuario\")\r\n\r\n swal(\"Inicia sesión con tu nombre de usuario\", {\r\n content: 'input',\r\n })\r\n .then((name) => {\r\nfor( var i = 0; i < numUsers; i++){\r\nif(value==users[i]){\r\n swal(\"¡Bienvenido/a!\", name, \"success\");\r\n document.getElementById('usuario').innerHTML = value;\r\n document.getElementById('cerrar_Sesion').style.display = 'block';\r\n localStorage.setItem('nombreUsuario', value);\r\n console.log(value);\r\n document.getElementById('usuario').style.display = 'block';\r\n document.getElementById('iniciar_Sesion').style.display = 'none';\r\n console.log(i);\r\n} \r\n if (value !=users[i] & i == numUsers-1){\r\n swal(\"Debe registrarse primero\",\"\",\"warning\");\r\n }\r\n}\r\n})\r\n}", "function _inicioSesionUsuario(aUsuario){\n\n var usuarioValido = false.\n tipoUsuario = '';\n\n for (var i = 0; i < usuarios.length; i++) {\n if (usuarios[i].correo == aUsuario.correo && usuarios[i].contrasenna == aUsuario.contrasenna) {\n if (usuarios[i].tipo == 'administrador') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'estudiante') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'asistente') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }else if (usuarios[i].tipo == 'profesor') {\n usuarioValido = true;\n tipoUsuario = usuarios[i].tipo;\n }\n }\n }\n\n if (usuarioValido == true) {\n return tipoUsuario;\n alert(tipoUsuario);\n }else {\n alert('Usuario No existe');\n }\n\n\n }", "function contrata(){\n url = '..\\\\negocio\\\\registrar-contrato.php';\n adjunto = {'id_usuario': id_usuario,\n 'tipo_usuario': tipo_usuario,\n 'nombre_servicio': document.getElementById('salida_nombre').innerHTML};\n $.post(url, adjunto)\n .done(function(respuesta){\n if(respuesta > 0){//debe ser el id del contrato----------------OJO!!\n alert('ENHORABUENA! ya has contratado el servicio.');\n }else {\n alert('LO SENTIMOS NO has podido contratar el servicio.');\n }\n desactivar_contratar(respuesta);\n mostrar_contratos_en_vigor();//OJO esta debe ser la última sentencia\n });\n}", "function guardaconteudo(id, idExpndo, idDisc, textarea, idSumario) {\n var edita = sessionStorage.getItem(\"edita\");\n \n if (edita == \"true\") {\n console.log(edita); \n query = \"UPDATE sumario SET sumario = '\" + textarea + \"' WHERE id = '\" + idSumario + \"'\"\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n texto = \"true\";\n var idSumarioaux = null;\n sessionStorage.setItem(\"idSumarioaux\", idSumarioaux);\n sessionStorage.setItem(\"idExplicando\", idExpndo);\n sessionStorage.setItem(\"idDisciplina\", idDisc);\n sessionStorage.setItem(\"texto\", texto);\n verificaData(0);\n }\n });\n closeConnectionDataBase();\n } else {\n \n query = \"INSERT INTO sumario (id_explicando, id_explicador, id_disciplina, sumario, data) VALUES ('\" + idExpndo + \"', '\" + id + \"', '\" + idDisc + \"', '\" + textarea + \"', CURDATE())\";\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n texto = \"true\";\n var idSumarioaux = null;\n sessionStorage.setItem(\"idSumarioaux\", idSumarioaux);\n sessionStorage.setItem(\"idExplicando\", idExpndo);\n sessionStorage.setItem(\"idDisciplina\", idDisc);\n sessionStorage.setItem(\"texto\", texto);\n verificaData(0);\n }\n });\n closeConnectionDataBase();\n }\n}", "async function cajas_dia_especifico() {\n const datos = new FormData();\n //Se obtiene el valor del dia\n const fecha = document.querySelector(\"#fecha_elegida\").value;\n console.log(\"fecha \"+fecha);\n if(fecha != 0){\n datos.append(\"fecha\", fecha);\n datos.append(\"accion\", \"buscar_fecha\");\n try {\n const URL = \"../../../inc/peticiones/cajas/funciones.php\";\n const resultado = await fetch(URL, {\n method: \"POST\",\n body: datos,\n });\n const db = await resultado.json();\n let mensaje =db.length;\n console.log(mensaje);\n \n \n const listado_pedidos = document.querySelector(\"#contenido_fecha\"); \n listado_pedidos.innerHTML = \"\";\n if (mensaje >= 1){\n db.forEach((servicio) => {\n console.log(servicio);\n const {id_caja,usuario,fecha_y_hora_abertura, fecha_y_hora_cierre, monto_inicial, monto_final , monto_final_ventas, corte } = servicio;\n \n if(corte == 1){\n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-success text-wrap\">Caja cerrada</div></td>\n </tr>\n `\n }\n else if(corte == 0){ \n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-danger text-wrap\">Caja abierta</div></td>\n </tr>\n `\n }\n });\n }\n else{\n const mensajes = document.querySelector(\"#mensaje2\");\n mensajes.innerHTML += ` \n <div class=\"alert alert-danger alert-dismissible bg-warning text-white border-0 fade show\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong>¡ALERTA! </strong> No existen registros en la fecha seleccionada.\n </div>\n `;\n }\n \n //imprime el total\n //console.log(suma);\n } catch (error) {\n console.log(error);\n }\n }\n else{\n //Mensaje de alerta\n const mensajes = document.querySelector(\"#mensaje2\");\n mensajes.innerHTML += ` \n <div class=\"alert alert-danger alert-dismissible bg-danger text-white border-0 fade show\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong>¡ERROR! </strong> No ha seleccionado una fecha.\n </div>\n `;\n }\n \n}", "function VerUsuario(Id){\n /* Realiza conexión con el servidor */\n var vId = Id;\n\n var vurl = \"\";\n\n var vurl = \"../../datos/controller/contactosController.php\";\n\n if(vId != 0){\n\n $.ajax({\n data: {\"accion\":\"single\", \"pId\":vId},\n type: \"POST\",\n datatype: \"json\",\n url: vurl,\n })\n\n .done(function(data){\n if (data.success) {\n $('#verUsuario').modal({keyboard: false});\n $('#st').html(data.Status);\n $('#st2').html(data.Status2);\n $('#cedu').html(data.Cedula);\n $('#nombre').html(data.Nombre_completo);\n $('#tel').html(data.Celular);\n $('#mail').html(data.Email);\n $('#usu').html(data.Programa);\n $('#per').html(data.Origen_Campana);\n $('#cId').html(data.Campana_Id);\n $('#dir').html(data.Mensaje);\n $('#Asig').html(data.Asignado_a);\n $('#DateAsig').html(data.Fecha_asignado);\n $('#reg').html(data.Created_date);\n $(\"#upd\").empty();\n $(\"#upd\").append('<input type=\"hidden\" id=\"img\" name=\"accion\" class=\"form-control\" value=\"upd\">');\n $('#txtId').val(vId);\n }\n })\n .fail(function(){\n alert(\"Ha ocurrido un problema\");\n });\n }\n }", "abrirSessao(bd, usuario, hashSenha) {\n var resLogin = [];\n var papelUsuario = \"\";\n var colunasProjetadas = [\"nomeusuario\", \"senha\", \"carteira\"];\n var nomeColunaCarteira = \"carteira\";\n\n configuracoes.tabelas.forEach(function (nomeTabela, indice) {\n var resLoginTemp = interfaceBD.select(\n bd,\n nomeTabela,\n colunasProjetadas,\n { nomeusuario: usuario, senha: hashSenha },\n 1\n );\n if (resLoginTemp != null) {\n resLogin = resLogin.concat(resLoginTemp);\n if (resLoginTemp.length && papelUsuario === \"\")\n papelUsuario = nomeTabela;\n }\n console.log(\n `A saida da tabela ${nomeTabela} foi: ${resLoginTemp}\\nE possui comprimento de ${resLoginTemp.length}`\n );\n });\n\n console.log(\n `A saida das tabelas foi: ${resLogin}\\nE possui comprimento de ${resLogin.length}`\n );\n\n if (resLogin != null && resLogin != {}) {\n if (resLogin.length > 0) {\n return {\n estado: \"aberta\",\n conteudo: resLogin,\n papelUsuario: papelUsuario,\n carteiraUsuario:\n resLogin[0][colunasProjetadas.indexOf(nomeColunaCarteira)],\n horaAbertura: new Date(),\n };\n }\n /*return ContentService.createTextOutput(\n JSON.stringify({ nome: \"isaias\" })\n ).setMimeType(ContentService.MimeType.JSON);*/\n }\n\n return { estado: \"fechada\", conteudo: [], horaAbertura: new Date() };\n }", "function actualizarUsuarioTodos() {\n var configmail = $(\"#configmail\").val();\n var id = $(\"#idusuarioUpTodos\").val();\n\n // UPDATE nombre\n var nombreup2Todos = $(\"#nombreup2Todos\").val();\n if ($(\"#nombreup2Todos\").val() == \"\") {\n $(\"#nombreup2Todos\").addClass(\"is-invalid\");\n swal(\"Algo salió mal!\", \"El campo nombre es obligatorio\", \"warning\");\n $(\"#statusEmailTodos\").html(\n '<span class=\"label label-error\" style=\"color: red\">Campo obligatorio</span>'\n );\n return false;\n }\n\n // //UPDATE email\n var newemailUpTodos = $(\"#newemailUpTodos\").val();\n\n //UPDATE contraseña\n var pass2UpTodos = $(\"#pass2UpTodos\").val();\n if (pass2UpTodos == \"\") {\n swal(\n \"Validación!\",\n \"El campo contraseña es obligatorio y no debe estar vacío\",\n \"warning\"\n );\n return false;\n }\n if (\n pass2UpTodos.length == 0 ||\n pass2UpTodos.length <= 8 ||\n pass2UpTodos.length >= 35 ||\n getUppercarse(pass2UpTodos) == 0 ||\n getNumber(pass2UpTodos) == 0\n ) {\n swal(\n \"Validación\",\n \"Su contraseña debe tener entre 8 y 35 caracteres, contener letras, números y alguna letra en mayúscula.\",\n \"warning\"\n );\n return false;\n }\n\n //UPDATE checkUp\n var checkUpTodos = 0;\n if ($(\"#adminconfirmationUpTodos\").prop(\"checked\") == true) {\n checkUpTodos = 1;\n } else {\n checkUpTodos = 0;\n }\n\n checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n );\n}", "async function cajas_hoy() {\n const datos = new FormData();\n datos.append(\"accion\", \"cajas_hoy\");\n\n try {\n const URL = \"../../../inc/peticiones/cajas/funciones.php\";\n const resultado = await fetch(URL, {\n method: \"POST\",\n body: datos,\n });\n const db = await resultado.json();\n //console.log(db);\n let suma = 0;\n db.forEach((servicio) => {\n //console.log(servicio);\n const {id_caja,usuario,fecha_y_hora_abertura, fecha_y_hora_cierre, monto_inicial, monto_final , monto_final_ventas, corte } = servicio;\n \n const listado_pedidos = document.querySelector(\"#contenido_tabla\"); \n\n if(corte == 1){\n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-success text-wrap\">Caja cerrada</div></td>\n </tr>\n `\n }\n else if(corte == 0){ \n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-danger text-wrap\">Caja abierta</div></td>\n </tr>\n `\n }\n });\n\n //imprime el total\n //console.log(suma);\n\n } catch (error) {\n console.log(error);\n }\n}", "function comprobar_sesion() {\n console.log(\"Comprobar login\");\n $.ajax({\n url: \"php/peticiones/comprobar_sesion.php\",\n type: \"POST\",\n dataType: \"json\",\n success: function(data) {\n if (data.Res == \"OK\") {\n NombreUsuario = data.Nombre;\n }\n },\n error: function(err) {\n console.log(\"Error sucedido en la peticion ajax, Funcion que falla comprobar_sesion()\");\n errorServ(err, \"sesion.js: comprobar_sesion()\");\n }\n });\n}", "function tienenSaldoDisponible (callback){\n \n var arg = {}\n arg['falseId'] = {}\n arg['falseId']['$gt'] = rangos[0] \n arg['falseId']['$lt'] = rangos[1]\n \n obtenerParametros.conFiltros(arg,function(error,parametros){\n \n if (error){throw error}\n else {\n \n console.log('Tienen saldo ', parametros)\n var result = [] // Id's de los usuarios\n \n for (var a=0;a<parametros.length;a++){\n \n if (parametros[a]['totalDisponible'] >= parametros[a]['totalXInvs']){\n \n result.push(parametros[a]['_id']) // Id del usuario\n \n }\n }\n\n if (result.length > 0){\n\n return callback(result)\n\n }else {\n\n acabarPreInversion()\n\n }\n }\n })\n}", "function checkUserConnexion(){\n $(\"#kwick_content_user\").addClass(\"d-none\");\n //Vérifier la session\n let token = localStorage.getItem('token');\n let _tempUrl = server_url+\"user/logged/\"+token;\n $.ajax({\n url: _tempUrl,\n dataType: \"jsonp\",\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n success: function (result, status, xhr) {\n let _status = getResultKwick(result, 'logged', 'status');\n if(_status==\"done\"){\n let timerInterval\n Swal.fire({\n title: `Chargement...`,\n html: `Vos messages s'afficheront dans <b></b> millisecondes.`,\n timer: 5000,\n timerProgressBar: true,\n onBeforeOpen: () => {\n Swal.showLoading()\n timerInterval = setInterval(() => {\n Swal.getContent().querySelector('b')\n .textContent = Swal.getTimerLeft()\n }, 100)\n },\n onClose: () => {\n clearInterval(timerInterval)\n }\n }).then((result) => {\n //if (result.dismiss === Swal.DismissReason.timer) console.log('I was closed by the timer');\n })\n $(\"#kwick_content_user\").removeClass(\"d-none\");\n loadEmojis();\n }\n else if(_status==\"failure\") window.location.href = 'login.html';\n },\n error: function (xhr, status, error) {\n console.log(\"Error\");\n }\n });\n\n }", "function ejecutarFuncinesDeLaTabla_ESt(myTabla)\r\n{\r\n\t//\tPasamos por cada fila suponiendo que sea una sola pagina\r\n\tfor(var contFilas_=0;contFilas_<myTabla.contenidoDeLasFilas_ESt.length;contFilas_++)\r\n\t{\r\n\t\t//\tFila en la que esta pasoando\r\n\t\t_filaActual_ESt=contFilas_;\r\n\t\t//\tPagina en que esta ahora\r\n\t\t_paginaVisible_ESt=myTabla.noDeLaPaginaVisible;\r\n\t\t//\tObjeto actual de la tabla\r\n\t\t_oTablaActual_ESt=myTabla;\r\n\t\t//\tSi existe la funcion por fila\r\n\t\tif(myTabla.tablaJSON.funcionesPorFila)\r\n\t\t{\r\n\t\t\t//\ttrue mientras se este ejecutando una funcion por filas\r\n\t\t\t_bnEjecuntandoFuncionPorFilas_ESt=true;\r\n\t\t\t//\tEjecuta la funcion creada por el usuario\r\n\t\t\tmyTabla.tablaJSON.funcionesPorFila();\r\n\t\t\t//\ttrue mientras se este ejecutando una funcion por filas\r\n\t\t\t_bnEjecuntandoFuncionPorFilas_ESt=false;\r\n\t\t}\r\n\t}\r\n}", "function loginAjax(){\n \n userkorp = $.trim($('#usuario').val());\n passkorp = $.trim($('#password').val());\n\n if(userkorp =='')\n {\n mensage=\"Debes ingresar tu usuario\";\n shakeModalVerificar(mensage);\n }\n else if (passkorp == ''){\n mensage = \"Debes ingresar tu contraseña\";\n shakeModalVerificar(mensage);\n\n } \n else {\n\n $.getJSON(repos, { op: 'loginKorp', user: userkorp, pass: passkorp })\n .done(function (dataLogin) {\n\n if (dataLogin.sms == \"error\") {\n shakeModal();\n } else if (dataLogin.sms == 1){\n\n conteoInstructor = dataLogin.conteo;\n idUser = dataLogin.id;\n // alert(conteoInstructor+idUser);\n //if (conteoInstructor <10){\n\n // $('#modalInstructorConteo').modal('show');\n /* $.getJSON(repos, { op: 'upConteo', cantidad: conteoInstructor, userId: idUser, })\n .done(function (dataLogin) {\n });*/\n\n /* swal({\n title: \"Su periodo de prueba a finalizado!\", \n text: \"Debe suscribirse\", \n icon: \"success\",\n }).then(function () {*/\n //location.reload();\n shakeModalTrue();\n\n var n = 3;\n var l = document.getElementById(\"number\");\n window.setInterval(function () {\n l.innerHTML = n;\n n--;\n }, 700);\n \n setTimeout(function () {\n\n window.location.replace(\"/perfil-instructor\"); \n \n },2000);\n // });\n //}\n /* else if (conteoInstructor ==10) {\n $.getJSON(repos, { op: 'upestadoUser', userId: idUser, })\n .done(function (dataLogin) {\n });\n swal({\n title: \"Estimado Instructor debe validar su cargo!\", \n text: \"cuenta\" + \" \"+ userkorp +\" \"+ \"Inactiva\", \n icon: \"success\",\n }).then(function () {\n //location.reload();\n shakeModalTrue();\n\n var n = 3;\n var l = document.getElementById(\"number\");\n window.setInterval(function () {\n l.innerHTML = n;\n n--;\n }, 700);\n \n setTimeout(function () {\n\n window.location.replace(\"/perfil-instructor\"); \n \n },2000);\n });\n\n }*/\n \n } else if (dataLogin.sms == 2){\n shakeModalTrue();\n\n var n = 3;\n var l = document.getElementById(\"number\");\n window.setInterval(function () {\n l.innerHTML = n;\n n--;\n }, 700);\n\n setTimeout(function () {\n\n window.location.replace(\"/perfil-alumno\");\n\n }, 2000);\n }\n else{\n shakeModal();\n }\n })\n .fail(function (xhr, err) {\n alert(\"readyState: \" + xhr.readyState + \"\\nstatus: \" + xhr.status);\n alert(\"responseText: \" + xhr.responseText);\n //$.getJSON(repos, { op: 'regLogError', cotizacion: '', proceso: 'Seguro Automotriz - Paso1 (getCliente)', aseguradora: '', coderror: '', detalle: 'Fail: No se puede obtener datos del cliente', cliente: $('#viajes_rut').val() });\n })\n }\n\n}", "function crearDatosInspector(){\n\tprobar_conexion_red();\n\tvar codigo=$('#txt_codigo').val();\n\tvar nombre_usuario=$('#txt_nombre_usuario').val();\n\tvar cedula=$('#txt_cedula').val();\n\tvar nombre=$('#txt_nombre').val();\n\tvar apellido=$('#txt_apellido').val();\n\tvar correo=$('#txt_correo').val();\n\tvar rol=$('#txt_rol').val();\n\t\n\tif (cedula!=\"\" && nombre!=\"\" && apellido!=\"\" && correo!=\"\" && rol!=\"\"){\n\t\tif (codigo != \"Procesando, espere por favor...\") {\n\t\t\t$.post('http://www.montajesyprocesos.com/inspeccion/servidor/php/crear_inspector.php',{\n\t\t\t\tCaso:'Crear',\n\t\t\t\tId: codigo,\n\t\t\t\tUsuario: nombre_usuario,\n\t\t\t\tCedula: cedula,\n\t\t\t\tNombre: nombre,\n\t\t\t\tApellido: apellido,\n\t\t\t\tCorreo: correo,\n\t\t\t\tRol: rol\n\t\t\t},function(e){\t\t\t\t\t\t\n window.localStorage.setItem('codigo_inspector', codigo); //se crea la variable persistente del codigo del inspector\n crearTablaUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol);\n addItemUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol); //agregamos el usario a la BD\n crearTablaConsecutivoAscensores();\n addItemConsecutivoAscensores(codigo, 0);\n crearTablaConsecutivoEscalerasAndenes();\n addItemConsecutivoEscalerasAndenes(codigo, 0);\n crearTablaConsecutivoPuertas();\n addItemConsecutivoPuertas(codigo, 0);\n\t\t\t});\t\n\t\t} else {\n if (numeroUsuarios > 0) {\n if(navigator.notification && navigator.notification.alert){\n navigator.notification.alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema!\", null, \"Montajes & Procesos M.P SAS\", \"Ok :)\");\n location.href='../websites/crear_inspector.html';\n }else{\n alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema! :)\");\n location.href='../websites/crear_inspector.html';\n } \n }\n\t\t}\t\n\t}\n}", "function operadorDesactivado(req,res){\n var id_operador = req.params.id; \n var flag=buscarOperador(id_operador);\n if(flag.flag==true){\n operadores.splice(flag.i-1,1);\n res.status(200).send({message:[{'flag':'guardada','se guardo solicitud en la base de datos':[]}]});\n console.log('Operador desconectado...Tabla Operadores Actualizada: ');\n console.log(operadores);\n res.status(200).send({message:['Estado: Desconectado']})\n }else{\n res.status(404).send({message:['Error: No se encontro el operador']})\n }\n}", "function actualizarUsuario() {\n //var configmail = $(\"#configmail\").val();\n var id = $(\"#idusuarioUp\").val();\n\n // UPDATE nombre\n var nombreup2 = $(\"#nombreup2\").val();\n if ($(\"#nombreup2\").val() == \"\") {\n $(\"#nombreup2\").addClass(\"is-invalid\");\n swal(\"Algo salió mal!\", \"El campo nombre es obligatorio\", \"warning\");\n $(\"#statusEmail\").html(\n '<span class=\"label label-error\" style=\"color: red\">Campo obligatorio</span>'\n );\n return false;\n }\n\n //UPDATE email\n var newemailUp = $(\"#newemailUp\").val();\n // console.log('probando el email'+ newemailUp);\n // var inputemailcolorUp=$(\"#newemailUp\");\n\n // if( $(\"#newemailUp\").val()==\"\" ){\n // $(\"#newemailUp\").addClass('is-invalid');\n\n // swal(\"Validación!\",\n // \"El campo email/usuario es obligatorio\", \"warning\");\n // $(\"#statusEmailUp\").html('<span class=\"label label-error\" style=\"color: red\">Campo obligatorio</span>');\n // return false;\n // }\n\n // if (newemailUp.indexOf(configmail) == -1){\n // swal(\"Algo salió mal!\", \"El dominio de este mail [\" + newemailUp.substr(newemailUp.indexOf(\"@\")) + \"] no corresponde al configurado en el sistema [Config.ini].\", \"error\");\n // $(\"#statusEmailUp\").html('<span class=\"label label-error\" style=\"color: red\">Dominio de email no valido</span>');\n\n // inputemailcolorUp.css(\"border-color\",\"red\");\n // inputemailcolorUp.removeClass(\"is-active\");\n // inputemailcolorUp.addClass(\"is-inactive\");\n // return false;\n\n // } else if(newemailUp.substr(newemailUp.indexOf(\"@\")) != (\"@\" + configmail)){\n // swal(\"Algo salió mal!\", \"El dominio de este mail [\" + newemailUp.substr(newemailUp.indexOf(\"@\")) + \"] no corresponde al configurado en el sistema [Config.ini].\", \"error\");\n // $(\"#statusEmail\").html('<span class=\"label label-error\" style=\"color: red\">Dominio de email no valido</span>');\n // inputemailcolorUp.css(\"border-color\",\"red\");\n // inputemailcolorUp.removeClass(\"is-active\");\n // inputemailcolorUp.addClass(\"is-inactive\");\n // return false;\n\n // }\n\n //UPDATE contraseña\n var pass2Up = $(\"#pass2Up\").val();\n if (pass2Up == \"\") {\n swal(\n \"Validación!\",\n \"El campo contraseña es obligatorio y no debe estar vacío\",\n \"warning\"\n );\n return false;\n }\n // La contraseña debe tener entre 8 y 35 caracteres\n if (\n pass2Up.length == 0 ||\n pass2Up.length <= 8 ||\n pass2Up.length >= 35 ||\n getUppercarse(pass2Up) == 0 ||\n getNumber(pass2Up) == 0\n ) {\n swal(\n \"Validación\",\n \"Su contraseña debe tener entre 8 y 35 caracteres, contener letras, números y alguna letra en mayúscula.\",\n \"warning\"\n );\n return false;\n }\n\n //UPDATE checkUp\n var checkUp = 0;\n if ($(\"#adminconfirmationUp\").prop(\"checked\") == true) {\n checkUp = 1;\n } else {\n checkUp = 0;\n }\n\n checkValidMailUp(newemailUp, pass2Up, nombreup2, checkUp, id);\n}", "function escucharOperadores(req,res){\n let id_operador = req.params.id, lat_operador = req.params.lat, lng_operador = req.params.lng;\n let flag=buscarOperador(id_operador) \n //ver si el operador esta en linea para actualizar lat y lng o agregarlo al arreglo\n if(flag.flag==true){\n operadores[flag.i-1].lat=lat_operador;\n operadores[flag.i-1].lng=lng_operador;\n }else{\n operadores.push({id:id_operador,lat:lat_operador,lng:lng_operador});\n }\n let operadorOcupado = false;\n let pos;\n for(let i=0; i< solicitudes.length; i++){\n var rechazada = verificarRechazo(id_operador);\n if(rechazada.flag == false){//verificamos si alguien rechazo la solicitud\n if(solicitudes[i].operador == id_operador && solicitudes[i].estatus=='pendiente'){\n let solicitud= buscarSolicitud(solicitudes[i].id_solicitante);\n if(solicitudes[solicitud].estatus=='pendiente'){\n solicitudes[solicitud].estatus='enEspera';\n }\n operadorOcupado=true;\n pos = i;\n }\n }\n }\n if(operadorOcupado==true){\n res.status(200).send({message:[{'flag':'true','cuerpo':[solicitudes[pos]]}]});\n }else{\n res.status(200).send({message:[{'flag':'false','cuerpo':[]}]});\n } \n \n}", "function estPost(req, res, next) {\n try {\n console.log('apiREST params', req.params);\n console.log('apiREST query', req.query);\n console.log('apiREST body', req.body);\n var msg = \"ESTUDIANTE REGISTRADO EXITOSAMENTE!\"\n if(req.body.nomb==\"\"){\n msg = \"no dejar en blanco\";\n }\n let error = valEst(req.body);\n if (error) {\n console.log (\"MENSAJES DE VALIDACIONES:\");\n console.log(error)\n res.status(422).send({\n finalizado: true,\n mensaje: 'Campos imcompletos',\n error: error,\n });\n return;\n }\n // Si no hay errores se puede insertar los datos\n let sql=\"INSERT INTO personas (nombres,paterno,materno,ci,direccion,telefono,genero,fecha_nac,rol,estado) VALUE(?,?,?,?,?,?,?,?,?,?)\"\n\t\tlet sql2=\"INSERT INTO estudiantes (id_estudiante,rude,ci_tutor,id_curso) VALUES(?,?,?,?)\"\n let sql4 = 'SELECT * FROM personas WHERE ci=?';\n let sql3=\"SELECT * FROM tutor WHERE ci=?\"\n let fecha=req.body.dia+\"-\"+req.body.mes+\"-\"+req.body.aa;\n con.query(sql4,[req.body.ci], function(err,result2){\n if(!result2[0]){\n console.log('se puede guardar!!')\n con.query(sql3,[req.body.citut], function(err,result){ \n if(err){throw err;}\n if(!result[0]){//no existe tutor\n console.log('no existe')\n res.status(200).send({\n finalizado: true,\n mensaje: 'no existe tutor',\n datos: result[0],\n dato2: req.body.citut,\n ms:msg\n });\n }else{//si existe tutor\n console.log(result[0])\n res.status(200).send({\n finalizado: true,\n mensaje: 'si existe tutor',\n datos: result[0],\n ms:msg\n });\n }\n })\n }else{\n res.status(200).send({\n finalizado: true,\n mensaje: 'post ok',\n duplicado: result2[0],\n ms:'YA EXISTE UN CI CON ESE NUMERO INGRESE OTRO CI'\n });\n }\n })\n \n\n // let a = con.query(sql,[req.body.nomb,req.body.apep,req.body.apem,req.body.ci,req.body.dir,req.body.tel,req.body.optradio,fecha,rol.estud,estado.a], function(err,result) {\n\t\t// \tif(err) {\n // // Enviar error SQL\n // console.error('ERR',err.message);\n // res.status(500).send({\n // finalizado: true,\n // mensaje: 'post Error SQL',\n // });\n // } else {\n // // Manipular resultados\n // let idPer=result.insertId;\n // console.log('id asignado a la persona :'+idPer);\n\n \n\n // con.query(sql2,[idPer,req.body.rude,req.body.citut,req.body.curso],function(err,result2){\n // if(err){ throw err;}\n // //console.log('number of record table estudiantes...'+result.affectedRows);\n // console.log('number of record table estudiantes...'+result.affectedRows+'Id asignada :'\n // +idPer);\n \n // res.status(200).send({\n // finalizado: true,\n // mensaje: 'post OK',\n // ms:msg,\n // datos: result\n // });\n // })\n // }\n\n\t\t// });\n } catch(e) {\n console.log('ERROR', e);\n res.status(501).send({\n finalizado: true,\n mensaje: 'post Error',\n });\n }\n}", "conver_un_usuario(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { nom } = req.params;\n const { id } = req.params;\n const usuarios = yield pool.query('SELECT cod_usuario, mensaje.cod_usuario_destinatario as cod_destinatario, mensaje.cod_usuario_remitente, usuario.nombre as nom_destinatario, usuario.correo FROM proyecto_ionic.mensaje inner join usuario on usuario.cod_usuario = mensaje.cod_usuario_destinatario and usuario.nombre !=? or usuario.cod_usuario = mensaje.cod_usuario_remitente and usuario.nombre !=? where cod_usuario_destinatario =? or cod_usuario_remitente =? group by usuario.nombre', [nom, nom, id, id]);\n if (usuarios.length > 0) {\n return res.json(usuarios);\n }\n else {\n res.status(404).json({ text: 'No existen conversaciones' });\n }\n });\n }", "function funcionIntermediaFin(request, response,next)\n{// console.log(\"Ejecuta a las: \" +new Date());\n response.send(\"fin\"); // veo que sino pongo response.find en el encadenado se para --> enseña el fin en el postman \n //pero no enseña\n //Ahroa podria poner esto\n /*if(noAutenticado)\n {\n response.send(\"fin\");\n }else\n {\n next();\n }*/\n}", "async function setVendaPadraoTopVendedores() {\n $('#vendaPadraoTopVendedoresBlock').fadeIn(0);\n var tempo = 200;\n $('#vendaPadraoTopVendedorGrafico').html('<div style=\"padding: 15px;padding-top: 0px\"><small class=\"text-muted flashit\">Carregando registros ...</small></div>');\n const retorno = await getVendaPadraoTopVendedorAJAX();\n if (retorno.length) {\n $('#vendaPadraoTopVendedorGrafico').html('');\n for (var i = 0; i < 6; i++) {\n if (retorno[i]) {\n var registro = retorno[i];\n var html = '';\n html += '<div class=\"d-flex div-registro\" style=\"cursor: pointer;padding: 10px;margin-top: 1px;padding-left: 15px;padding-right: 10px;animation: slide-up 1s ease\">';\n html += ' <div style=\"padding-top: 14px;width: 25px\">';\n html += ' <p class=\"mb-0\"><b>' + (i + 1) + '</b></p>';\n html += ' </div>';\n html += ' <div style=\"margin-right: 10px;position: relative\">';\n html += ' <img src=\"data:image/png;base64,' + registro['entidadeUsuario']['imagemPerfil'] + '\" alt=\"user\" class=\"rounded-circle img-user\" height=\"47\" width=\"47\">';\n if (i === 0) {\n html += ' <small style=\"position: absolute; right: -7px; top: -8px;color: yellow\"><i class=\"mdi mdi-crown font-20\"></i></small>';\n } else if (i === 1) {\n html += ' <small class=\"text-muted\" style=\"position: absolute; right: -7px; top: -8px\"><i class=\"mdi mdi-crown font-20\"></i></small>';\n } else if (i === 2) {\n html += ' <small class=\"text-orange\" style=\"position: absolute; right: -7px; top: -8px\"><i class=\"mdi mdi-crown font-20\"></i></small>';\n }\n if (registro['empresa'] == 'telecom') {\n html += ' <small style=\"position: absolute; right: -4px; bottom: 3px\"><img style=\"height: 15px\" src=\"' + APP_HOST + '/public/template/assets/img/faviconTelecom.png\"></small>';\n } else {\n html += ' <small style=\"position: absolute; right: -4px; bottom: 3px\"><img style=\"height: 15px\" src=\"' + APP_HOST + '/public/template/assets/img/faviconConectividade.png\"></small>';\n }\n html += ' </div>';\n html += ' <div class=\"text-truncate\" style=\"padding-top: 11px\">';\n html += ' <h5 class=\"userNome mb-0 text-truncate color-default font-11\">' + registro['entidadeUsuario']['usuarioNome'] + '</h5>';\n html += ' <p class=\"userCargo mb-0 text-truncate text-muted font-11\" style=\"max-height: 20px\">' + registro['entidadeUsuario']['cargoNome'] + '</p>';\n html += ' </div>';\n html += ' <div class=\"d-flex ml-auto\">';\n html += ' <div style=\"padding-top: 14px;width: 45px\" title=\"Vendas de planos\">';\n html += ' <p class=\"mb-0\"><i class=\"mdi mdi-shopping \"></i> ' + registro['quantidade'] + '</p>';\n html += ' </div>';\n html += ' <div style=\"padding-top: 14px;width: 45px\" title=\"Vendas de roteadores\">';\n html += ' <p class=\"mb-0\"><i class=\"mdi mdi-router-wireless\"></i> ' + registro['quantidadeVendaRoteador'] + '</p>';\n html += ' </div>';\n html += ' <div style=\"padding-top: 14px;width: 45px\" title=\"Vendas de telefonia\">';\n html += ' <p class=\"mb-0\"><i class=\"mdi mdi-phone\"></i> ' + registro['quantidadeVendaTelefonia'] + '</p>';\n html += ' </div>';\n html += ' </div>';\n html += '</div>';\n $('#vendaPadraoTopVendedorGrafico').append(html);\n await sleep(tempo);\n }\n }\n } else {\n $('#vendaPadraoTopVendedorGrafico').html('<div style=\"padding: 15px;padding-top: 0px\"><small class=\"text-muted\">Nenhum registro encontrado ...</small></div>');\n }\n $('#vendaPadraoTopVendedoresBlock').fadeOut(150);\n}", "function LoginSiswa(tipe, judul, pesan)\n{\n var shortCutFunction = tipe;\n var msg = pesan;\n var title = judul || '';\n var showDuration = \"1000\";\n var hideDuration = \"1000\";\n var timeOut = \"5000\";\n var extendedTimeOut = \"1000\";\n var showEasing = \"swing\";\n var hideEasing = \"linear\";\n var showMethod = \"slideDown\";\n var hideMethod = \"slideUp\";\n\n toastr.options = {\n closeButton: false,\n debug: false,\n positionClass: 'toast-top-left',\n onclick: null\n };\n\n if (showDuration.length) {\n toastr.options.showDuration = showDuration;\n }\n\n if (hideDuration.length) {\n toastr.options.hideDuration = hideDuration;\n }\n\n if (timeOut.length) {\n toastr.options.timeOut = timeOut;\n }\n\n if (extendedTimeOut.length) {\n toastr.options.extendedTimeOut = extendedTimeOut;\n }\n\n if (showEasing.length) {\n toastr.options.showEasing = showEasing;\n }\n\n if (hideEasing.length) {\n toastr.options.hideEasing = hideEasing;\n }\n\n if (showMethod.length) {\n toastr.options.showMethod = showMethod;\n }\n\n if (hideMethod.length) {\n toastr.options.hideMethod = hideMethod;\n }\n\n if (!msg) {\n msg = getMessage();\n }\n\n $(\"#toastrOptions\").text(\"Command: toastr[\" + shortCutFunction + \"](\\\"\" + msg + (title ? \"\\\", \\\"\" + title : '') + \"\\\")\\n\\ntoastr.options = \" + JSON.stringify(toastr.options, null, 2));\n\n var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists\n $toastlast = $toast;\n}", "function IdCuenta() {\n\n if (usuario.user.id) {\n console.log('entro')\n axios.get(`http://${URL}/api/account/?userId=${usuario.user.id}`)\n .then((resp) => {\n // console.log('LO QUE SERIA LA CUENTA', resp.data.data.id)\n setIdCuenta(resp.data.data.id)\n })\n .catch(error => {\n console.log(error.response)\n })\n\n }\n\n }", "function entrar() {\n var senha = pass.value;\n\n // SE A SENHA FOR VALIDA\n if (dig == 1 && senha == 'recife' || dig == 2 && senha == 'manaus' || dig == 3 && senha == 'fortaleza') {\n telaSenha.style = 'display: none';\n cadeira.style = 'display: block';\n }\n // SE A SENHA FOR INVALIDA\n else {\n res.innerHTML += \"<p>Senha invalida!</p>\";\n contador++;\n }\n\n // SE AS TENTATIVAS FOREM EXCEDIDAS\n if (contador >= 4) {\n contador = 0;\n alert(\"Você excedeu o número de tentativas, sua conta está bloqueada, PROCURE O SUPORTE\");\n telaSenha.style = 'display: none';\n content.style = 'display: block';\n }\n}", "function verUsuariosAnamnesis() {\n\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('ANAMNESIS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('CREACION DE ANAMNESIS');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Información de Usuarios');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let tablaResponsiva = document.createElement(\"div\");\n tablaResponsiva.setAttribute('class', 'table-responsive');\n let tablas = document.createElement(\"table\");\n tablas.setAttribute('class', 'table table-bordered');\n tablas.setAttribute('id', 'dataTable');\n tablas.setAttribute('width', '100%');\n tablas.setAttribute('cellspacing', '0');\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(tablaResponsiva);\n tablaResponsiva.appendChild(tablas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('verUsuariosAnamesis=');\n\n\n}", "function verUsuarios() {\n\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('GESTIÓN DE USUARIOS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('AÑADE PACIENTES O ELIMINA LOS USUARIOS CREADOS');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Información de Usuarios');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let tablaResponsiva = document.createElement(\"div\");\n tablaResponsiva.setAttribute('class', 'table-responsive');\n let tablas = document.createElement(\"table\");\n tablas.setAttribute('class', 'table table-bordered');\n tablas.setAttribute('id', 'dataTable');\n tablas.setAttribute('width', '100%');\n tablas.setAttribute('cellspacing', '0');\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(tablaResponsiva);\n tablaResponsiva.appendChild(tablas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('verUsuarios=');\n}", "function leerSiPulsadoresActivados() {\n /**\n * Simular pulsador en intro_cotas\n */\n let b_i_c = cogerVariable(\"./variables/intro_cotas.html\");\n if (b_i_c == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_cotas\").val(\"0\");\n\n $('#boton_cota').css(\"background-color\",\"white\");\n $('#boton_parada').css(\"background-color\",\"white\");\n $('#boton_cota').removeAttr(\"disabled\");\n $('#boton_parada').removeAttr(\"disabled\");\n\n $(\"#form_cotas\").submit();\n }\n /**\n * Simular pulsador en intro_paradas\n */\n let b_i_p = cogerVariable(\"./variables/intro_paradas.html\");\n if (b_i_p == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_paradas\").val(\"0\");\n\n $('#boton_cota').css(\"background-color\",\"white\");\n $('#boton_parada').css(\"background-color\",\"white\");\n $('#boton_cota').removeAttr(\"disabled\");\n $('#boton_parada').removeAttr(\"disabled\");\n\n $(\"#form_paradas\").submit();\n }\n\n let b_i_o = cogerVariable(\"./variables/origen.html\");\n if (b_i_o == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_origen\").val(\"0\");\n $(\"#origen_form\").submit();\n }\n\n let b_i_r = cogerVariable(\"./variables/reset.html\");\n if (b_i_r == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_reset\").val(\"0\");\n $(\"#reset_form\").submit();\n }\n\n}", "SumaManoObraId_Empresa(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const id_Empresa = req.params.Id_Empresa;\n yield database_1.default.query('SELECT sum(Salario) as Salario FROM ManoObra where Id_Empresa=?', [id_Empresa], function (err, datos, fields) {\n if (err) {\n return res.status(500).json({\n ok: false,\n mensaje: 'Error fltrando Auxiliar',\n errors: err,\n });\n }\n return res.status(200).json({\n ok: true,\n Suma: datos,\n });\n });\n });\n }", "function handle(data) {//用户签退\n // console.log(`${data.user.openid}退出游戏, 持续${now() - data.user.loginTime}秒`,this.sysCur.debug);\n switch(data.user.domainType) {\n case DomainType.TX:\n //在线状态发生变化\n data.user.baseMgr.info.UnsetStatus(UserStatus.online);\n let onlinetime = commonFunc.now() - data.user.loginTime;\n //累计游玩时间\n let d1 = (Date.parse(new Date()) < Date.parse(new Date(\"October 23,2017 0:0:0\")) && Date.parse(new Date()) >= Date.parse(new Date(\"October 21,2017 0:0:0\")))?true:false;\n let d2 = (Date.parse(new Date()) < Date.parse(new Date(\"October 30,2017 0:0:0\")) && Date.parse(new Date()) >= Date.parse(new Date(\"October 28,2017 0:0:0\")))?true:false;\n let d3 = (Date.parse(new Date()) < Date.parse(new Date(\"November 6,2017 0:0:0\")) && Date.parse(new Date()) >= Date.parse(new Date(\"November 4,2017 0:0:0\")))?true:false;\n if(d1 || d2 || d3){\n let temp = commonFunc.now() - data.user.totalTime;\n data.user.totalTime = commonFunc.now();\n data.user.baseMgr.task.Execute(this.const.em_Condition_Type.totalTime, temp, this.const.em_Condition_Checkmode.add);\n }\n // if(!this.sysCur.debug){\n // this.service.txApi.Report_Logout(data.user.openid, onlinetime).then(apiRet=>{\n // if(apiRet.ret != 0){\n // console.log(`Report_Logout Error: ${JSON.stringify(aipRet)}`);\n // }\n // }).catch(e=>{});\n // }\n break;\n\n case DomainType.SYSTEM:\n this.service.users.mapServer(data.user, true); //清理先前注册的逻辑服信息\n break;\n \n default:\n break;\n }\n}", "function guarda_estudiante(){\n\tif($('#pass').val() == $('#rpass').val() ){\n\t\tvar real = confirm(\"Desea finalizar el registro de los datos en la plataforma?\");\n\t\tif(real == true){\n\t\t\t$.ajax({\n\t\t\t\turl: 'home_actualiza.php',\n\t\t\t\ttype: 'POST',\n\t\t\t\tasync: false,\n\t\t\t\tdata: {\n\t\t\t\t\tnuevo_estudiante: 1,\n\t\t\t\t\tfirstname:$('#firstname').val() ,\n\t\t\t\t\tlastname:$('#lastname').val() ,\n\t\t\t\t\tuser:$('#user').val(),\n pass:$('#pass').val(),\n id_est:$('#id_est').val(),\n code:$('#code').val(),\n\n\t\t\t\t},\n\t\t\t\tsuccess:function(result){\n if (result == 'ya'){\n alert(\"El usuario ya se encuentra registrado\");\n }else{\n \t$('#myModalEstudiante').modal('hide');\n alert(\"¡Registro Realizado con exito! \");\n estudiantes()\n \n }\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}else{\n\t\talert(\"La contraseña de confirmacion debe ser igual a la contraseña digitada\");\n\t}\n}", "function loginSiteMudancas() {\n imagensPaginaInicio();\n let saberAverdade = sessionStorage.getItem('Usuario');\n if (saberAverdade == \"Usuario\") {\n return \"Usuario\";\n } else if (saberAverdade == \"Empresa\") {\n return \"Empresa\";\n } else {\n return \"nao\";\n }\n}", "function crear_usuario()\n{\n\t// se va al metodo de validacion\n\tvalidacion();\n\t//debugger;\n\t// si validar es igual a nulo\n\tif(validar === null){\n\t\t// se va a crear un nuevo usuario\n\t\tusuario = [];\n\t\t// se obtiene la contraseña\n\t\tvar contrasenna = document.getElementById(\"password\").value;\n\t\t// se optiene la repeticion de la contraseña\n\t\tvar contrasenna_repeat = document.getElementById(\"password_repeat\").value;\n\t\t// si la contraseña es vacia o nula\n\t\tif(contrasenna == \"\" || contrasenna == null){\n\t\t\t// muestra un mensaje de error\n\t\t\talert(\"No puede dejar el campo de contraseña vacio\");\n\t\t\t// si la repeticion de la contraseña es vacio o nula\n\t\t}else if(contrasenna_repeat == \"\" || contrasenna_repeat == null){\n\t\t\t// muestra un mensaje de error\n\t\t\talert(\"No puede dejar el campo de repetir contraseña vacio\");\n\t\t}else{\n\t\t\t// si la contraseña es igual a la repeticion de la contraseña\n\t\t\tif(contrasenna === contrasenna_repeat){\n\t\t\t\t// obtiene el nombre de usuario\n\t\t\t\tvar nombreU = document.getElementById(\"user\").value;\n\t\t\t\t// obtiene el nombre completo\n\t\t\t\tvar nombreFull = document.getElementById(\"fullName\").value;\n\t\t\t\t// pregunta que si el nombre de usuario es vacio o nulo\n\t\t\t\tif(nombreU == \"\" || nombreU == null){\n\t\t\t\t\t// si es asi muestra un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de nombre de usuario vacio\");\n\t\t\t\t\t// pregunta que si el nombre completo es vacio o nulo\n\t\t\t\t}else if(nombreFull == \"\" || nombreFull == null){\n\t\t\t\t\t// muestra un mensaje de error\n\t\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\t\t// si no fuera asi\n\t\t\t\t}else{\n\n\t\t\t\t\t// crea el usuario\n\t\t\t\t\tusuario.push(document.getElementById(\"numero\").value, document.getElementById(\"fullName\").value, document.getElementById(\"user\").value,\n\t\t\t\t\t\tdocument.getElementById(\"password\").value, document.getElementById(\"password_repeat\").value);\n\t\t\t\t\t// lo agrega al arreglo de usuarios\n\t\t\t\t\tUser.push(usuario);\n\t\t\t\t\t// agrega el arreglo de arreglos al localstorage con el usuario nuevo\n\t\t\t\t\tlocalStorage['usuarios'] = JSON.stringify(User);\n\t\t\t\t\t// muestra un mensaje que ya puede iniciar sesion\n\t\t\t\t\talert(\"Usuario creado ya puedes iniciar sesion\");\n\t\t\t\t\t// se va a la pagina principal\n\t\t\t\t\tlocation.href=\"tablero-de-instrucciones.html\"\n\t\t\t\t}\n\t\t\t\t// si no fuera asi\n\t\t\t}else{\n\t\t\t\t// muestra un mensaje de error donde muestra que las contraseñas son diferentes\n\t\t\t\talert(\"No puedes crear el usuario porque las contraseñas son diferentes, asegurese que sea las mismas\");\n\t\t\t}\n\t\t}\n\t\t// si no es asi pregunta que si es administrador\n\t}else if(validar === \"Entra como administracion\"){\n\t\t// si es asi no lo puede crear porque ya exite\n\t\talert(\"No puedes crear con ese nombre de usuario porque ya existe\");\n\t\t// si no es asi pregunta que si es particular\n\t}else if(validar === \"Entra como particular\"){\n\t\t// si es asi no lo puede crear porque ya exite\n\t\talert(\"No puedes crear con ese nombre de usuario porque ya existe\");\n\t\t// si no es asi pregunta si no se pudo crear\n\t}else if(validar === \"No_se_pudo_crear\"){\n\t\t// si es asi no lo puede crear\n\t\talert(\"No se pudo crear el usuario\");\n\t\t// se le asigna a validar el valor de nulo\n\t\tvalidar = null;\n\t}\n}", "async geraUsuariosNovos(){\n\t\tawait this.geraUsuarios(1);\n\t\t\n\t\t//Botei esse tempo porque acredito que mesmo esperando geraUsuarios, os setState dentro podem não ter terminado, pode ser por estar mal configurado também.\n\t\tawait new Promise(resolve => { setTimeout(resolve, 1000); });\n\t\tthis.setState({carregando: false});\n\t}", "function iniciarSesion(event) {\n var u3r, pA$;\n u3r = $('input:text').val();\n pA$ = $('input:password').val();\n if (u3r.length > 0 && pA$.length > 0) {\n try{\n val_ie(event); \n $.ajax({ \n url: \"php/soap.php\",\n type: \"POST\",\n cache: false,\n\t data: {\n User: u3r,\n Pass: pA$\n }, \n beforeSend: function () {\n showMessage('L', '#update', \"<img src=\\\"img/ajax-loader.gif\\\" alt=\\\"Verificando con el servidor\\\">\", true, \"message\");\n }, \n success: function (mensaje) { \n if (mensaje == 1) { \n location.href=\"php/main.php\"; \n } else { \n showMessage('E', '#update', mensaje, true, \"message\");\n }\n }, \n error: function (mensaje) {\n showMessage('E', '#update', 'Error: No se ha podido establecer comunicacion con el servidor intente mas tarde'+mensaje, true, \"error\"); \n } \n });\n }catch(err){\n showMessage('E', '#update', \"Catch: No se ha podido establecer comunicacion con el servidor intente mas tarde\"+err.message, true, \"error\");\n }\n } \n}" ]
[ "0.6525565", "0.63537925", "0.61922014", "0.6178559", "0.6134287", "0.6097374", "0.60960543", "0.6025432", "0.5994556", "0.5975013", "0.5925412", "0.59084034", "0.59013116", "0.5900532", "0.58966297", "0.5896281", "0.5889829", "0.5860884", "0.5848753", "0.5840015", "0.5837493", "0.5828214", "0.58271754", "0.5826087", "0.5821925", "0.5813018", "0.5806744", "0.5805278", "0.58052474", "0.58028567", "0.58010536", "0.5784304", "0.5777916", "0.576214", "0.57605606", "0.57497174", "0.5744258", "0.5740784", "0.5728348", "0.57219213", "0.57202536", "0.57192445", "0.57083035", "0.57035077", "0.56845534", "0.5677734", "0.5673743", "0.567118", "0.5668725", "0.56673795", "0.5667084", "0.5664202", "0.56563336", "0.5655068", "0.56523216", "0.5649099", "0.56487244", "0.5641422", "0.56409436", "0.56399757", "0.5634659", "0.563001", "0.5629851", "0.56276923", "0.5627515", "0.562163", "0.5620217", "0.56166136", "0.5616178", "0.5599394", "0.55990946", "0.5598576", "0.55927545", "0.5585389", "0.5582687", "0.55768335", "0.55756575", "0.55749905", "0.55729157", "0.55697703", "0.5569035", "0.5565232", "0.556483", "0.5562582", "0.55597675", "0.55548555", "0.5554071", "0.55535626", "0.5552805", "0.5546032", "0.55443084", "0.553814", "0.55122703", "0.55097574", "0.5504631", "0.5501011", "0.55006874", "0.54984987", "0.54948896", "0.5493873", "0.5491047" ]
0.0
-1
prikazi na ekranu random boju
function displayColorsOnScren() { boxContainer.innerHTML = ''; for (let i = 0; i < 5; i++) { let color = generateColors(); let div = document.createElement('div'); div.classList.add('card'); div.innerHTML = ` <div class='inner-color' style="background-color:${color}"></div> <p>${generateColors()}</p> `; div.addEventListener('click', copyToClipboard); boxContainer.appendChild(div); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rand(){\n return Math.random()-0.5;\n }", "function random() {\n\t\tseed = Math.sin(seed) * 10000;\n\t\treturn seed - Math.floor(seed);\n\t}", "function r(){return Math.random().toString().slice(2,7)}", "function random () {\n\t\n\tseed = 312541332155 * (4365216455 + seed) % 7654754253243312;\n\t\n\treturn 0.0000001 * (seed % 10000000);\n\t\n}", "function rng() {\n return random();\n }", "function rng() {\n return random();\n }", "static random () {\n return getRandomNumberFromZeroTo(500);\n }", "_random() {\n return Math.rnd();\n }", "rando() {\n randomNum = Math.floor(Math.random() * 20);\n }", "function rng () {\n return random()\n }", "popuniIzvjestaj() {\n this.donja = Util.getRandomIntIn(50, 100);\n this.gornja = Util.getRandomIntIn(70, 140);\n this.puls = Util.getRandomIntIn(50, 160);\n }", "function obtenerAleatorio(){\n\treturn Math.random();\n}", "function gen_random(){\r\n\treturn 0.3\r\n}", "function generaRandom(){\n return Math.floor(Math.random() * 5 + 1);\n}", "function SeededRandom(){}", "function rand(){\n return Math.random()\n}", "function getRandom() {\n\treturn Math.random();\n}", "function rng() {\n return random();\n }", "function rng() {\n return random();\n }", "function random_generate() {\r\n let ran_num = Math.floor(Math.random() * sq.length);\r\n if (sq.ran_num % 2)\r\n }", "function randomizer(){\n\treturn Math.floor(Math.random() * 256);\n}", "function random(){\n\t return random.get();\n\t }", "function random(){\n\t return random.get();\n\t }", "function generateRandomSeed(){\n return Math.random() * 0.73 + 0.27;\n}", "function random() {\n var x = Math.sin(seed++) * 10000;\n return x - Math.floor(x);\n}", "function rnd() \n{\n\t\t\n rnd.seed = (rnd.seed*9301+49297) % 233280;\n return rnd.seed/(233280.0);\n}", "function random() {\r\n return Math.round(Math.random() * 10);\r\n}", "function random() {\n\t\tr = (r + 0.1) % 1\n\t\treturn r\n\t}", "function getRandomNumber () {}", "function randomize (){\n\tvar random = Math.floor(Math.random()*4);\n\treturn ligth(random);\n}", "function rand() {\r\n if(!gnt--) {\r\n prng(); gnt = 255;\r\n }\r\n return r[gnt];\r\n }", "function karteGenerieren() {\r\n /* Eine beliebige Zahl wird mit der Länge multipliziert und die Karte nehmen wir*/\r\n let random = Math.floor(Math.random() * alle32Karten.length);\r\n console.log('random Number: ' + random);\r\n let karte = alle32Karten[random];\r\n alle32Karten.splice(random, 1);\r\n return karte;\r\n}", "function random() {\n return Math.random();\n}", "function random()\n {\n m_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask;\n m_w = (18000 * (m_w & 65535) + (m_w >> 16)) & mask;\n var result = ((m_z << 16) + m_w) & mask;\n result /= 4294967296;\n return result + 0.5;\n }", "function randomOrder(){\n\t\treturn ( Math.round( Math.random()) -0.5 ); \t\n\t}", "function randOrd() {\n return(Math.round(Math.random())-0.5);\n }", "function aleatorio(max){\n return ~~(Math.random()*max);//retorno del numero aleatorio\n}", "function random () {\n return MIN_FLOAT * baseRandInt();\n }", "function getIdPublicacion(){\n\treturn Math.round(Math.random() * 20) + 1;\n}", "function inning(){\n \n //DEBUGGING\n //console.log( Math.round(Math.random() * 2 ) );\n \n return Math.round(Math.random() * 2);\n }", "popuniIzvjestaj() {\n this.vrijednost = Util.getRandomFloatIn(2, 10);\n this.vrijemeObroka = Util.randomDate(new Date(2012, 0, 1), new Date());\n }", "function random() {\n\treturn ((Math.random()*99)+1).toFixed();\n}", "function inning() {\n\n return Math.floor(Math.random() * 3)\n }", "function random(){\n return random.get();\n }", "function random(){\n return random.get();\n }", "function rand() {\n return Math.round(Math.random() * 20) - 10;\n}", "function rand() {\n return Math.round(Math.random() * 20) - 10;\n}", "next_rand() {\n this.jitter_pos *= 10;\n if (this.jitter_pos > 10000000000)\n this.jitter_pos = 10;\n return (this.jitter * this.jitter_pos) % 1;\n }", "function gerarProbabilidade() {\r\n return Math.random();\r\n}", "function randomizer() {\n return Math.floor((Math.randon() * 3) + 1)\n}", "function randomizer() {\n return Math.floor((Math.randon() * 3) + 1)\n}", "function crystall() {\n return Math.floor(Math.random() * 20 + 5)\n }", "function des()\n {\n\treturn (0|(Math.random()*12)+1);\n }", "function getRandomeVerse() {\n \n var randomVerseToGet = Math.floor(Math.random() * 68) + 0;\n \n console.log(randomVerseToGet);\n \n return text3.Verse[randomVerseToGet];\n}", "function aleatorio(ate) {\n return Math.floor(Math.random() * ate);\n}", "function generarAleatorio(){\r\n let aleatorio = Math.floor(Math.random()*(10-5)+5);\r\n alert(aleatorio);\r\n}", "function seededRandom()\n{\n m_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask;\n m_w = (18000 * (m_w & 65535) + (m_w >> 16)) & mask;\n var result = ((m_z << 16) + m_w) & mask;\n result /= 4294967296;\n return result + 0.5;\n}", "next_rand() {\n\t\tthis.jitter_pos *= 10;\n\t\tif (this.jitter_pos > 10000000000)\n\t\t\tthis.jitter_pos = 10;\n\t\treturn (this.jitter * this.jitter_pos) % 1;\n\t}", "function random() {\n return (Math.floor(Math.random() * 3));\n }", "function randomizer() {\n target = Math.floor(Math.random() * 100) + 19;\n gem1rando = Math.floor(Math.random() * 13) + 2;\n gem2rando = Math.floor(Math.random() * 13) + 2;\n gem3rando = Math.floor(Math.random() * 13) + 2;\n gem4rando = Math.floor(Math.random() * 13) + 2;\n }", "function getRandom(caleatoria){\n if(Math.random() < (caleatoria/10)){\n return 0;\n }else{\n return 1;\n }\n}", "function randomNumber() {\r\n return Math.random;\r\n}", "function randStart() {\n return Math.random() - .5;\n}", "function distribucionLineal(rango) {\n return Math.floor(Math.random() * rango);\n }", "getRandom() {\n return Math.floor((Math.random() * 10) + 1);\n }", "function getRandom() {\n return Math.random();\n}", "function getRandom() {\n return Math.random();\n}", "function getRandom() {\n return Math.random();\n}", "function randomValue(){\n return Math.floor( Math.random() * 40 );\n }", "function random() {\n\tvar x = Math.floor((Math.random() * 16) + 0); // random number generator \t\n\tif(x>9){ // numbers higher than 15 are changed to letters, as needed for a hexadecimal\n\t\tvar lett = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"]; \n\t\tx = lett[x-10];\n\t}\n\treturn x;\n}", "function inning(){\n return Math.floor(Math.random() * 3);\n \n}", "function getRandom(){\r\n\treturn Math.floor(Math.random() * 10);\r\n}", "generarSecuencia(){\n this.secuencia = new Array(10).fill(0).map(m => Math.floor(Math.random() * 4))\n }", "function randomGenerator() {\r\n var random = Math.floor(6 * Math.random()) + 1;\r\n return random;\r\n}", "function srandom() {\n randomSeed = (randomSeed * 9301 + 49297) % 233280;\n return randomSeed / 233280;\n}", "function inning(){\n return Math.floor(Math.random() * 3);\n}", "function getAleatorio(){\n return Math.random();\n}", "function randomNumber(){\n return (Math.round(1 * Math.random()) + 1);\n }", "function random() { // different sequence to Math.random()\n var T16 = 0x10000, T32 = T16*T16,\n cons = 0x0808, tant = 0x8405, // cons*T16 + tant = 134775813\n X = RandSeed*cons % T16 * T16 + RandSeed*tant + 1; // Exact 32=bit arithmetic\n return (RandSeed = X % T32) / T32;\n }", "function getRandomValue() {\n return (Math.random() * (0.9 - 0.2) + 0.2)\n}", "selectRand() {\n\t}", "random(): number {\n let u: number = (prng.random(): any);\n return this._random(u);\n }", "function randomNumber(){\r\n return Math.random();\r\n}", "function rando() {\n return Math.floor(Math.random() * (people.length));\n }", "function azarDulce(){\n var NroDulce = Math.floor(Math.random()*MAXIMO_IMAGENES);\n return tipoDulce[NroDulce];\n}", "function generate() {\n\treturn (Math.random() * 1e18).toString(32).slice(0, 11);\n}", "function randomOffset() {\n\t\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\n\t\t}", "function rand(){\n\t\treturn(\n\t\t\tMath.floor(Math.random() * 4));\n\t}", "function random() {\n return Math.floor((Math.random() * 1000000)+1);\n}", "static random() {\r\n return BigIntHelper.read8(RandomHelper.generate(8), 0);\r\n }", "function randomNotReally() {\n var x = Math.sin(seed++);\n return x - Math.floor(x);\n}", "function randomOffset() {\r\n\r\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\r\n\r\n\t}", "function locRnd() {\n return (Math.random() - 0.5) / 50;\n}", "function randomH()\n{\n\treturn Math.floor((Math.random()*((500)*.5))+1);\n}", "function r(r){return (\"0\"+Math.floor(Math.random()*r).toString(16)).substr(-2)}", "function randomNumber(){\n return Math.random\n}", "function random() {\n return Math.floor((Math.random() * 12) + 1);\n}", "function genSimPrice(){\r\n return ((Math.round(Math.random()) * 2 - 1) * genRanNum(0,6));\r\n}", "function randomindex() {\n return Math.floor(Math.random() * Busmall.allimg.length);\n}", "static random() {\r\n return BigIntHelper.read8(randomHelper_1.RandomHelper.generate(8), 0);\r\n }", "function setRandom(){\n \n correctAns=Math.floor(1000+Math.random()*9000) +\"\";\n // console.log(\"Generated no is\"+correctAns);\n}" ]
[ "0.76581866", "0.7561327", "0.7476238", "0.7422026", "0.741523", "0.741523", "0.7407506", "0.73963237", "0.7395402", "0.7393059", "0.73906994", "0.7389383", "0.7380398", "0.7360194", "0.731661", "0.7281502", "0.72800887", "0.72769994", "0.72769994", "0.72538954", "0.7252942", "0.7248047", "0.7248047", "0.72473204", "0.7221002", "0.72165406", "0.7198427", "0.7190153", "0.7176584", "0.7162339", "0.71553266", "0.7150865", "0.7148258", "0.71421456", "0.71371233", "0.7132484", "0.71313184", "0.71281385", "0.7122427", "0.7114955", "0.7106984", "0.71026975", "0.7099777", "0.70913327", "0.70913327", "0.7079935", "0.7079935", "0.7074918", "0.7070637", "0.70666975", "0.70666975", "0.70648193", "0.70627177", "0.70592135", "0.7054699", "0.7047576", "0.704133", "0.7037642", "0.70316744", "0.702474", "0.70199746", "0.70133257", "0.7007946", "0.7002494", "0.70009464", "0.69949925", "0.69949925", "0.6993541", "0.699156", "0.6984727", "0.69611174", "0.6960094", "0.69499123", "0.6942384", "0.69307137", "0.69275504", "0.6926025", "0.6921759", "0.69186974", "0.6913609", "0.6911563", "0.691124", "0.69059235", "0.6894304", "0.6892033", "0.68833447", "0.6883143", "0.687902", "0.6872419", "0.6872134", "0.6870861", "0.6861094", "0.6850578", "0.6849266", "0.6848231", "0.68410045", "0.6840711", "0.6839276", "0.683759", "0.6835754", "0.68325144" ]
0.0
-1
Map.addLayer(zones,vizParams,'zones'); throw('stop') create bounds for training samples inside area of interest
function buffer(geometry) { return geometry.buffer(60).bounds(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPlaceMarks() {\n // first init layer\n if (gazetteerLayer == null) {\n gazetteerLayer = new WorldWind.RenderableLayer(\"GazetteerLayer\"); \n\n for (var i = 0; i < availableRegionsCSV.length; i++) { \n // create a marker for each point\n var name = availableRegionsCSV[i].name;\n var latitude = availableRegionsCSV[i].center_lat;\n var longitude = availableRegionsCSV[i].center_lon; \n var diameter = parseFloat(availableRegionsCSV[i].diameter);\n\n var labelAltitudeThreshold = 0; \n\n if (diameter >= 0 && diameter < 10) { \n labelAltitudeThreshold = 1.1e3;\n } else if (diameter > 10 && diameter < 20) {\n labelAltitudeThreshold = 1.7e3;\n } else if (diameter >= 20 && diameter < 40) {\n labelAltitudeThreshold = 1.2e4;\n } else if (diameter >= 40 && diameter < 60) {\n labelAltitudeThreshold = 1.7e4;\n } else if (diameter >= 60 && diameter < 80) {\n labelAltitudeThreshold = 1.2e5;\n } else if (diameter >= 80 && diameter < 100) {\n labelAltitudeThreshold = 1.7e5;\n } else if (diameter >= 100 && diameter < 200) {\n labelAltitudeThreshold = 1.2e6;\n } else if (diameter >= 200 && diameter < 400) {\n labelAltitudeThreshold = 1.7e6;\n } else if (diameter >= 400 && diameter < 600) {\n labelAltitudeThreshold = 1.2e7;\n } else if (diameter >= 600 && diameter < 1000) {\n labelAltitudeThreshold = 1.7e7;\n } else if (diameter >= 1000 && diameter < 1400) {\n labelAltitudeThreshold = 1.2e8;\n } else if (diameter >= 1400 && diameter < 2000) {\n labelAltitudeThreshold = 1.7e8;\n } else {\n labelAltitudeThreshold = 1.2e9;\n }\n\n\n var placemark = new WorldWind.Placemark(new WorldWind.Position(latitude, longitude, 10), true, null);\n placemark.label = name;\n placemark.altitudeMode = WorldWind.RELATIVE_TO_GROUND; \n\n placemark.eyeDistanceScalingThreshold = labelAltitudeThreshold - 1e5;\n placemark.eyeDistanceScalingLabelThreshold = labelAltitudeThreshold;\n\n var placemarkAttributes = new WorldWind.PlacemarkAttributes(); \n placemarkAttributes.labelAttributes.color = new WorldWind.Color(0.43, 0.93, 0.97, 1);\n placemarkAttributes.labelAttributes.depthTest = false;\n placemarkAttributes.labelAttributes.scale = 1.2;\n placemarkAttributes.imageScale = 0.8;\n placemarkAttributes.imageSource = \"html/images/close.png\"; \n\n placemark.attributes = placemarkAttributes;\n\n\n // as they are small and slow\n if (diameter < MIN_DEFAULT_LOAD) {\n placemark.enabled = false;\n }\n\n var obj = {\"diameter\": diameter};\n placemark.userProperties = obj;\n\n\n // add place mark to layer\n gazetteerLayer.addRenderable(placemark); \n } \n\n // Marker layer\n wwd.insertLayer(10, gazetteerLayer);\n\n } else { \n if (isShowGazetteer === false) {\n gazetteerLayer.enabled = false; \n } else { \n gazetteerLayer.enabled = true;\n }\n } \n }", "function add_bounding_area_layer(layer,a,b,c,d) {\n if(dirty_layer_uid) {\n remove_a_layer(dirty_layer_uid);\n }\n var uid=getRnd(\"UCVM\");\n var tmp={\"uid\":uid,\"latlngs\":[{\"lat\":a,\"lon\":b},{\"lat\":c,\"lon\":d}]};\n set_area_latlons(uid,a,b,c,d);\n ucvm_area_list.push(tmp);\n var group=L.layerGroup([layer]);\n viewermap.addLayer(group);\n\n load_a_layergroup(uid,AREA_ENUM,group, EYE_NORMAL);\n dirty_layer_uid=uid;\n}", "function countryBorders(){\n // Define layer to map\n var layer = ui.Map.Layer({\n eeObject: country_borders.style(s.countryborders),\n visParams: {},\n name: 'Country Borders',\n opacity: 0.5\n });\n // Add layer to map\n c.map.layers().set(2, layer); // Define nth layer\n}", "function addDealAreasToLayerControl(map, dbDealAreas) {\n // iterate over dictionary\n var layerDictionary = [];\n var areaLayers = [];\n $.each(dbDealAreas, function (key, polygon) { // method doku: http://api.jquery.com/jquery.each/\n var coords = polygon.coordinates;\n var coordsTransformed;\n if (polygon.type === 'Polygon') {\n coordsTransformed = coords.map(function(c) {\n return L.GeoJSON.coordsToLatLngs(c);\n });\n } else if (polygon.type === 'MultiPolygon') {\n coordsTransformed = coords.map(function(c2) {\n return c2.map(function(c1) {\n return L.GeoJSON.coordsToLatLngs(c1);\n })\n });\n }\n var polygonL = L.polygon(\n coordsTransformed,\n {\n color: getPolygonColorByLabel(key)\n });\n areaLayers.push(polygonL);\n\n map.addLayer(polygonL); // polygons are initially added to the map\n layerDictionary[key] = polygonL;\n });\n\n // add Layers to layer control\n // try: https://gis.stackexchange.com/questions/178945/leaflet-customizing-the-layerswitcher\n // http://embed.plnkr.co/Je7c0m/\n if (!jQuery.isEmptyObject(layerDictionary)) { // only add layer control if layers aren't empty\n L.control.layers([], layerDictionary).addTo(map);\n }\n return areaLayers;\n}", "function controlLayers(map){\n var overlayMaps = {\n \"Population\": newLayer\n };\n//toggle population points on and off\n L.control.layers(null, overlayMaps).addTo(map);\n}", "function amphibianlayeron(){\n\n$(\"#species_richness_scale\").show();\n\nfor (i=0; i <= 600; i++){\n\nif (countrieslayer._layers[i]){\nvar country = countrieslayer._layers[i];\ncountry.setStyle(grey);\n\n}\n}\n\nfor (var polygon in amphibianszones._layers) {\nmap.addLayer(amphibianszones._layers[polygon]);\namphibianszones._layers[polygon].setStyle(none);\nfor (var inner in amphibianszones._layers[polygon]._layers){\nif(inner && amphibianszones._layers[polygon].feature.id){\nif(amphibianszones._layers[polygon].feature.id >= 150){\namphibianszones._layers[polygon].setStyle(one);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 140){\namphibianszones._layers[polygon].setStyle(two);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 120){\namphibianszones._layers[polygon].setStyle(three);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 100){\namphibianszones._layers[polygon].setStyle(four);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 80){\namphibianszones._layers[polygon].setStyle(five);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 60){\namphibianszones._layers[polygon].setStyle(six);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 40){\namphibianszones._layers[polygon].setStyle(seven);\n}\n}\n}\n} \n}", "function showExtent(bbox) {\n vectors = new ol.layer.Vector({source: new ol.source.Vector()});\n map.addLayer(vectors);\n vectors.getSource().addFeatures([new ol.Feature({geometry: new ol.geom.Polygon.fromExtent(bbox)})]);\n}", "addLayer(details){\n //if the layer already exists then delete it\n if (this.map.getLayer(details.id)){\n this.map.removeLayer(details.id);\n } \n this.map.addLayer({\n 'id': details.id,\n 'type': details.type,\n 'source': details.sourceId,\n 'source-layer': details.sourceLayer,\n 'paint': details.paint\n }, (details.beforeId) ? details.beforeId : undefined);\n //set a filter if one is passed\n if (details.hasOwnProperty('filter')) this.map.setFilter(details.id, details.filter);\n if (this.props.view === 'country'){\n //set the visibility of the layer depending on the visible property of the status \n let status = this.props.statuses.filter(status => {\n return (status.layers.indexOf(details.id) !== -1);\n })[0];\n if (status) this.map.setLayoutProperty(details.id, \"visibility\", (status.visible) ? \"visible\" : \"none\" );\n }\n }", "function addAreas(){\n //draws the areas\n areaMap.forEach(function(item, key, mapObj){\n polyArea = drawArea(item);\n polyArea.addTo(areaLayer);\n })\n}", "function layersControl () {\r\n if (maptype == \"artmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"geomap\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />': mapnik,\r\n 'Mapquest open <img src=\"./lib/images/external.png\" />': mapquestopen,\r\n 'Mapquest aerial <img src=\"./lib/images/external.png\" />': mapquest\r\n }; \r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />': maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />': boundaries,\r\n 'Radwege <img src=\"./lib/images/external.png\" />': cycling\r\n };\r\n }\r\n \r\n else if (maptype == \"gpxmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"monmap\") {\r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik, \r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Denkmäler <img src=\"./lib/images/wv-logo-12.png\" />' : monuments\r\n };\r\n }\r\n\r\n else if (maptype == \"poimap2\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik,\r\n 'Mapnik s/w <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnikbw,\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapquest Aerial <img src=\"./lib/images/external.png\" />' : mapquest,\r\n 'Verkehrsliniennetz <img src=\"./lib/images/external.png\" />' : transport,\r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />' : maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />' : boundaries,\r\n 'Schummerung <img src=\"./lib/images/wmf-logo-12.png\" />' : hill,\r\n 'Radwege <img src=\"./lib/images/external.png\" />' : cycling,\r\n 'Wanderwege <img src=\"./lib/images/external.png\" />' : hiking,\r\n 'Sehenswürdigkeiten <img src=\"./lib/images/wv-logo-12.png\" />' : markers,\r\n 'Reiseziele <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles,\r\n 'GPX Spuren / Kartenmaske <img src=\"./lib/images/wv-logo-12.png\" />' : tracks\r\n };\r\n }\r\n}", "function loadMap() {\n\n //Change the cursor\n map.getCanvas().style.cursor = 'pointer';\n\n //NOTE Draw order is important, largest layers (covers most area) are added first, followed by small layers\n\n\n //Add raster data and layers\n rasterLayerArray.forEach(function(layer) {\n map.addSource(layer[0], {\n \"type\": \"raster\",\n \"tiles\": layer[1]\n });\n\n map.addLayer({\n \"id\": layer[2],\n \"type\": \"raster\",\n \"source\": layer[0],\n 'layout': {\n 'visibility': 'none'\n }\n });\n });\n\n //Add polygon data and layers\n polyLayerArray.forEach(function(layer) {\n map.addSource(layer[0], {\n \"type\": \"vector\",\n \"url\": layer[1]\n });\n\n map.addLayer({\n \"id\": layer[2],\n \"type\": \"fill\",\n \"source\": layer[0],\n \"source-layer\": layer[3],\n \"paint\": layer[4],\n 'layout': {\n 'visibility': 'none'\n }\n });\n });\n\n map.setLayoutProperty('wildness', 'visibility', 'visible');\n\n //Add wildness vector data source and layer\n for (i = 0; i < polyArray.length; i++) {\n map.addSource(\"vector-data\"+i, {\n \"type\": \"vector\",\n \"url\": polyArray[i]\n });\n\n //fill-color => stops sets a gradient\n map.addLayer({\n \"id\": \"vector\" + i,\n \"type\": \"fill\",\n \"source\": \"vector-data\" + i,\n \"source-layer\": polySource[i],\n \"minzoom\": 6,\n \"maxzoom\": 22,\n \"paint\": wildPolyPaint\n });\n }\n\n //Add polygon/line data and layers\n for (i=0; i<lineLayerArray.length; i++) {\n map.addSource(lineLayerArray[i][0], {\n \"type\": \"vector\",\n \"url\": lineLayerArray[i][1]\n })\n\n map.addLayer({\n \"id\": lineLayerArray[i][2],\n \"type\": \"line\",\n \"source\": lineLayerArray[i][0],\n \"source-layer\": lineLayerArray[i][4],\n \"paint\": {\n 'line-color': lineLayerArray[i][5],\n 'line-width': 2\n }\n });\n\n map.addLayer({\n \"id\": lineLayerArray[i][3],\n \"type\": \"fill\",\n \"source\": lineLayerArray[i][0],\n \"source-layer\": lineLayerArray[i][4],\n \"paint\": {\n 'fill-color': lineLayerArray[i][5],\n 'fill-opacity': .3\n }\n });\n\n map.setLayoutProperty(lineLayerArray[i][2], 'visibility','none');\n map.setLayoutProperty(lineLayerArray[i][3], 'visibility','none');\n map.moveLayer(lineLayerArray[i][2]);\n map.moveLayer(lineLayerArray[i][3]);\n }\n\n //Add States data set\n map.addSource('states', {\n \"type\": \"vector\",\n \"url\": \"mapbox://wildthingapp.2v1una7q\"\n });\n\n //Add States outline layer, omitting non-state territories\n map.addLayer({\n \"id\": \"states-layer\",\n \"type\": \"line\",\n \"source\": \"states\",\n \"source-layer\": \"US_State_Borders-4axtaj\",\n \"filter\": [\"!in\",\"NAME\",\"Puerto Rico\", \"Guam\",\"American Samoa\", \"Commonwealth of the Northern Mariana Islands\",\"United States Virgin Islands\"]\n });\n\n map.setLayerZoomRange('wildness', 0, 7);\n}", "addMapLayers() {\r\n // console.log('method: addMapLayers');\r\n let layers = this.map.getStyle().layers;\r\n // Find the index of the first symbol layer in the map style\r\n let firstSymbolId;\r\n for (let i = 0; i < layers.length; i++) {\r\n if (layers[i].type === 'symbol') {\r\n firstSymbolId = layers[i].id;\r\n break;\r\n }\r\n }\r\n this.options.mapConfig.layers.forEach((layer, index) => {\r\n\r\n // Add map source\r\n this.map.addSource(layer.source.id, {\r\n type: layer.source.type,\r\n data: layer.source.data\r\n });\r\n \r\n\r\n // Add layers to map\r\n this.map.addLayer({\r\n \"id\": layer.id,\r\n \"type\": \"fill\",\r\n \"source\": layer.source.id,\r\n \"paint\": {\r\n \"fill-color\": this.paintFill(layer.properties[0]),\r\n \"fill-opacity\": 0.8,\r\n \"fill-outline-color\": \"#000\"\r\n },\r\n 'layout': {\r\n 'visibility': 'none'\r\n }\r\n }, firstSymbolId);\r\n\r\n\r\n // check if touch device. if it's not a touch device, add mouse events\r\n if (!checkDevice.isTouch()) {\r\n this.initMouseEvents(layer);\r\n } // checkDevice.isTouch()\r\n\r\n\r\n // Store all the custom layers\r\n this.customLayers.push(layer.id);\r\n });\r\n }", "function areaChanged() {\n if (selectedArea === undefined) {\n //get the selected area name\n selectedArea = $(\"#areas\").val();\n } else {\n var deselectId = reverseLookup[selectedArea].LAD14CD;\n topoLayer.eachLayer(function(layer) {\n if (layer.feature.id == deselectId) {\n deselectLayer(layer);\n }\n });\n }\n selectedArea = $(\"#areas\").val();\n analyze();\n var id = reverseLookup[selectedArea].LAD14CD;\n topoLayer.eachLayer(function(layer) {\n if (layer.feature.id == id) {\n selectLayer(layer);\n map.fitBounds(layer.getBounds(), {padding: [100, 100]});\n }\n });\n}", "addMap() {\n const {createMap} = this.props;\n\n let bounds = {\n north: this.state.bounds.north === '' ? undefined : parseFloat(this.state.bounds.north),\n south: this.state.bounds.south === '' ? undefined : parseFloat(this.state.bounds.south),\n east: this.state.bounds.east === '' ? undefined : parseFloat(this.state.bounds.east),\n west: this.state.bounds.west === '' ? undefined : parseFloat(this.state.bounds.west),\n centerLat: this.state.bounds.centerLat === '' ? undefined : parseFloat(this.state.bounds.centerLat),\n centerLon: this.state.bounds.centerLon === '' ? undefined : parseFloat(this.state.bounds.centerLon),\n range: this.state.bounds.range === '' ? undefined : parseFloat(this.state.bounds.range),\n scale: this.state.bounds.scale === '' ? undefined : parseFloat(this.state.bounds.scale)\n };\n\n let blankBounds = true;\n for (let prop in bounds) {\n if (typeof bounds[prop] !== 'undefined') {\n blankBounds = false;\n break;\n }\n }\n if (blankBounds) {\n bounds = undefined;\n }\n\n createMap(bounds, this.state.engineId === '' ? undefined : this.state.engineId,\n false, this.state.recorder, parseInt(this.state.brightness), parseInt(this.state.midDistanceThreshold),\n parseInt(this.state.farDistanceThreshold));\n }", "addFromLayers(){\n let _from = this.props.fromVersion.key;\n //add the sources\n this.addSource({id: window.SRC_FROM_POLYGONS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_polygons\" + window.TILES_SUFFIX]}});\n this.addSource({id: window.SRC_FROM_POINTS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_points\" + window.TILES_SUFFIX]}});\n //add the layers\n this.addLayer({id: window.LYR_FROM_DELETED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(255,0,0, 0.2)\", \"fill-outline-color\": \"rgba(255,0,0,0.5)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_DELETED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n //geometry change in protected areas layers - from\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.5}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_COUNT_CHANGED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_SHIFTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n //selection layers\n this.addLayer({id: window.LYR_FROM_SELECTED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POLYGON, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_LINE, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POINT, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n }", "function addBoundaryLayer(object) {\n\n var points = ['airports-extended', 'healthsites', 'volcano_list', 'glopal_power_plant', 'world_port_index']\n\n\n var k = Object.keys(object); //what layer is being added\n var v = Object.values(object)[0]; //true or false if clicked\n\n var clicked = k[0]\n\n console.log(v)\n console.log(clicked)\n\n\n if(points.includes(clicked)) {\n\n if(map.getLayer(clicked)) {\n map.removeLayer(clicked)\n } else {\n\n\n map.addLayer({\n 'id': clicked,\n 'type': 'circle',\n 'source': 'points-source',\n 'filter': ['==', 'layer', clicked],\n 'layout': {\n 'visibility': 'visible'\n },\n 'paint': {\n 'circle-color': pointColors[clicked],\n 'circle-radius': 7,\n 'circle-opacity': 0.7\n }\n })\n\n }\n console.log(clicked)\n\n map.on('click', clicked, (e) => {\n const coordinates = e.features[0].geometry.coordinates.slice();\n const description = e.features[0].properties[pointDesc[clicked]];\n\n //console.log(coordinates);\n getIso(coordinates)\n\n new mapboxgl.Popup({\n className: 'popupCustom'\n })\n .setLngLat(coordinates)\n .setHTML(description)\n .addTo(map);\n\n })\n\n \n\n //map.setFilter('points', ['==', 'layer', clicked])\n //addPointLayer($(this))\n\n }\n else if (clicked === 'underwater-overlay') {\n addCables()\n\n } else if (!v) {\n \n map.removeLayer(clicked)\n console.log('uncheck: ' + clicked);\n \n } else {\n\n var slayer;\n var color;\n var source;\n\n if (clicked === 'admin1-overlay') {\n source = 'admin1'\n slayer = 'admin1'\n color = 'red'\n } else if (clicked === 'admin2-overlay') {\n source = 'admin2'\n slayer = 'admin2'\n color = '#003399'\n } else if (clicked === 'allsids') {\n //console.log('sids!')\n source = 'allsids'\n slayer = 'allSids'\n color = 'orange'\n } else {\n //source = 'pvaph'\n\n //layer == 'airports=extended', 'healthsites', 'volcano-list', 'glopal_power_plant', ''\n console.log($(this).val());\n //console.log($(this).id())\n console.log($(this))\n }\n\n map.addLayer({\n 'id': clicked,\n 'type': 'line',\n 'source': source,\n 'source-layer': slayer,\n 'layout': {\n 'visibility': 'visible'\n },\n\n 'paint': {\n 'line-color': color,\n 'line-width': 1\n\n }\n }, firstSymbolId);\n\n if (map.getLayer('admin1-overlay')) {\n map.moveLayer(clicked, 'admin1-overlay')\n\n }\n\n map.on('mouseover', function () {\n\n\n\n })\n\n }\n\n\n}", "function startHere(){\n createStartMap();// step 1: Create a map on load with basemap and overlay map (with empty faultlinesLayer & EarhtquakesLayer ).\n addFaultlinesLayer();//step 2: Query data and add them to faultlinesLayer \n addEarthquakesLayer(); //step 3: Query data and add them to EarhtquakesLayer \n}", "function removeAlertAreas(){\n if(alertareaLayer) {\n $scope.map.removeLayer(alertareaLayer);\n alertareaLayer.clearLayers();\n $scope.map.addLayer(alertareaLayer);\n }\n }", "function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg'); // Place polygon under this labels.\n\n map.addLayer({ \n //selected rout section layer\n \"id\": \"routes-today\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'housenum-label'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"routes\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(120, 180, 244, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"routes-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'routes'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"walked\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(80, 200, 50, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"walked-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'walked'); // Place polygon under this labels.\n\n map.addLayer({\n \"id\": \"SelectedMapLocationLayer\",\n \"type\": \"symbol\",\n \"source\": \"SelectedMapLocationSource\",\n \"layout\": {\n \"icon-image\": \"CustomPhotoSelected\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg');\n //ClickbleMapItemCursor(); //Now that the layers a loaded, have the mouse cursor change when hovering some of the layers\n NewSelectedMapLocation();\n\n}", "constructor(map, uniqueId, mapBoxSourceId, addBeforeLayer) {\n this.map = map.map || map;\n this.uniqueId = uniqueId;\n this.mapBoxSourceId = mapBoxSourceId;\n\n // Add the colored fill area\n map.addLayer(\n {\n id: this.uniqueId+'fillpoly',\n type: 'fill',\n source: this.mapBoxSourceId,\n paint: {\n 'fill-antialias': true,\n 'fill-outline-color': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n 'rgba(0, 0, 0, 0.9)',\n 'rgba(100, 100, 100, 0.4)'\n ],\n 'fill-opacity': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n 0.6,\n FILL_OPACITY\n ]\n }\n },\n addBeforeLayer\n );\n }", "function addEmptyLayerToWebmap()\r\n\t\t\t{\r\n\t\t\t\tvar layer = MapTourBuilderHelper.getNewLayerJSON(MapTourBuilderHelper.getFeatureCollectionTemplate(true));\r\n\t\t\t\t_webmap.itemData.operationalLayers.push(layer);\r\n\t\t\t\t\r\n\t\t\t\t// Set the extent to the portal default\r\n\t\t\t\tif ( app.portal && app.portal.defaultExtent )\r\n\t\t\t\t\tapp.data.getWebMapItem().item.extent = Helper.serializeExtentToItem(new Extent(app.portal.defaultExtent));\r\n\t\t\t\t\r\n\t\t\t\tvar saveSucceed = function() {\r\n\t\t\t\t\tchangeFooterState(\"succeed\");\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t_initCompleteDeferred.resolve();\r\n\t\t\t\t\t}, 800);\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tif( app.isDirectCreationFirstSave || app.isGalleryCreation ) \r\n\t\t\t\t\tsaveSucceed();\r\n\t\t\t\telse\r\n\t\t\t\t\tWebMapHelper.saveWebmap(_webmap, _portal).then(saveSucceed);\r\n\t\t\t}", "addToLayers(){\n try {\n let _to = this.props.toVersion.key;\n //add the sources\n let attribution = \"IUCN and UNEP-WCMC (\" + this.props.toVersion.year + \"), The World Database on Protected Areas (\" + this.props.toVersion.year + \") \" + this.props.toVersion.title + \", Cambridge, UK: UNEP-WCMC. Available at: <a href='http://www.protectedplanet.net'>www.protectedplanet.net</a>\";\n this.addSource({id: window.SRC_TO_POLYGONS, source: {type: \"vector\", attribution: attribution, tiles: [ window.TILES_PREFIX + \"wdpa_\" + _to + \"_polygons\" + window.TILES_SUFFIX]}});\n this.addSource({id: window.SRC_TO_POINTS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _to + \"_points\" + window.TILES_SUFFIX]}});\n //no change protected areas layers\n this.addLayer({id: window.LYR_TO_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(99,148,69,0.2)\", \"fill-outline-color\": \"rgba(99,148,69,0.3)\"}, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(99,148,69)\", \"circle-opacity\": 0.6}, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //selection layers\n this.addLayer({id: window.LYR_TO_SELECTED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POLYGON, filter:INITIAL_FILTER});\n this.addLayer({id: window.LYR_TO_SELECTED_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_LINE, filter:INITIAL_FILTER});\n this.addLayer({id: window.LYR_TO_SELECTED_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POINT, filter:INITIAL_FILTER});\n //add the change layers if needed\n if (this.props.fromVersion.id !== this.props.toVersion.id) this.addToChangeLayers();\n } catch (e) {\n console.log(e);\n }\n }", "function fit_markers_to_map(){ \n map.fitBounds(bounds);\n }", "function set_bounds() {\n\n\t// Get the new zoom level\n\tvar zoom \t= esomap.getZoom();\n\tvar center \t= esomap.getCenter();\n\t\n\t// Define the allowed boundaries [SW,NE]\n\tvar zoomBounds = [\n\t\t[-35,-20,35,20],\n\t\t[-70,-100,70,100],\n\t\t[-75,-120,75,120],\n\t\t[-80,-130,80,130],\n\t\t[-85,-135,85,135],\n\t\t[-87,-140,87,140],\n\t];\n\tvar swlat = zoomBounds[zoom-2][0];\n\tvar swlng = zoomBounds[zoom-2][1];\n\tvar nelat = zoomBounds[zoom-2][2];\n\tvar nelng = zoomBounds[zoom-2][3];\n\t\n\t// Set the new bounds\n\tallowedBounds = new google.maps.LatLngBounds(\n\t\tnew google.maps.LatLng( swlat , swlng ), //SouthWest Corner\n\t\tnew google.maps.LatLng( nelat , nelng ) //NorthEast Corner\n\t);\n\t\n\t// Helper function for checking the sign of a variable\n\tfunction sign( x ) { return x > 0 ? 1 : x < 0 ? -1 : 0; }\n\t\t\n\t// If changing the zoom has put us out of bounds, move\n\tif ( !allowedBounds.contains( center ) ) {\n\t\t\n\t\t// Figure out which dimension is out of bounds\n\t\tif ( Math.abs( center.lat() ) > Math.abs( swlat ) ) {\n\t\t\tgoodLat = sign( center.lat() ) * ( Math.abs( swlat ) - 0.01 );\n\t\t} else {\n\t\t\tgoodLat = center.lat();\n\t\t}\n\t\tif ( Math.abs( center.lng() ) > Math.abs( swlng ) ) {\n\t\t\tgoodLng = sign( center.lng() ) * ( Math.abs( swlng ) - 0.01 );\n\t\t} else {\n\t\t\tgoodLng = center.lng();\n\t\t}\n\t\t\n\t\t// Set some new good bounds\n\t\tvar goodBounds = new google.maps.LatLng( goodLat , goodLng );\n\t\tesomap.panTo( goodBounds );\n\t}\n\t\n\treturn allowedBounds;\n}", "function _map_addTrafficLayer(map,target){\r\n\t/* tbd */\r\n}", "constructor(olMap, $slider, dynamicLayerRenderer1, dynamicLayerRenderer2) {\n\n dynamicLayerRenderer1.getVectorLayer().on('precompose', function(event) {\n const percent = $slider.val() / 100;\n var ctx = event.context;\n var width = ctx.canvas.width * percent;\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(0, 0, width, ctx.canvas.height);\n ctx.clip();\n\n });\n\n dynamicLayerRenderer1.getVectorLayer().on('postcompose', function(event) {\n var ctx = event.context;\n ctx.restore();\n });\n\n dynamicLayerRenderer2.getVectorLayer().on('precompose', function(event) {\n const percent = $slider.val() / 100;\n var ctx = event.context;\n var width = ctx.canvas.width * percent;\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(width, 0, ctx.canvas.width - width, ctx.canvas.height);\n ctx.clip();\n\n // Draw a separating vertical line.\n if (percent < 100) {\n ctx.beginPath();\n ctx.moveTo(width, 0);\n ctx.lineTo(width, ctx.canvas.height);\n ctx.stroke();\n }\n\n });\n\n dynamicLayerRenderer2.getVectorLayer().on('postcompose', function(event) {\n var ctx = event.context;\n ctx.restore();\n });\n\n $slider.on('input change', function() {\n olMap.render();\n });\n\n }", "function initMap(){\n $scope.mapDefaults = {\n minZoom: 6,\n dragging: false,\n };\n\n $scope.mapCenter = {\n lat: 50.5,\n lng: 4.303,\n zoom: 7,\n };\n\n $scope.mapLayers = {\n baselayers: {\n mapbox_terrain: {\n name: 'MapboxTerrain',\n url: 'http://api.tiles.mapbox.com/v4/{mapid}/{z}/{x}/{y}.png?access_token={apikey}',\n type: 'xyz',\n layerOptions: {\n apikey: 'pk.eyJ1Ijoia3NlcnJ1eXMiLCJhIjoiZk9JSWRQUSJ9.SvA5S_FzBKsyXVm6xf5lGQ',\n mapid: 'kserruys.lmilh1gp'\n }\n }\n }\n };\n }", "function addLayersOnMap(){\n\n var layers = map.getStyle().layers;\n // Find the index of the first symbol layer in the map style\n var firstSymbolId;\n for (var i = 0; i < layers.length; i++) {\n if (layers[i].type === 'symbol') {\n firstSymbolId = layers[i].id;\n console.log(firstSymbolId);\n break;\n }\n }\n\n // 3d extruded buildings\n // apartments from json\n map.addLayer({\n 'id': 'extrusion',\n 'type': 'fill-extrusion',\n \"source\": {\n \"type\": \"geojson\",\n \"data\": \"https://denyskononenko.github.io/maprebuild/buildigs_appartments.geojson\"\n },\n 'paint': {\n 'fill-extrusion-color': '#696969',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': 1.0\n }\n }, firstSymbolId);\n\n // all buildings excepts hospitals and apartments\n map.addLayer({\n 'id': '3d-buildings',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['!=', 'type', 'hospital'], ['!=', 'type' ,'apartments']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#dedede',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .4\n }\n }, firstSymbolId);\n\n // hospitals\n map.addLayer({\n 'id': '3d-buildings-hospitals',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'hospital']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#A52A2A',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .2\n }\n }, firstSymbolId);\n\n // universities\n map.addLayer({\n 'id': '3d-buildings-university',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'university']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // schools\n map.addLayer({\n 'id': '3d-buildings-school',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'school']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // kindergarten\n map.addLayer({\n 'id': '3d-buildings-kindergarten',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'kindergarten']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n // use an 'interpolate' expression to add a smooth transition effect to the\n // buildings as the user zooms in\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n}", "function addGeoJsonToMap(v){\n\t\t\t$('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\n\t\t\tif(layer.currentGEERunID === geeRunID){\n if(v === undefined){loadFailure()}\n\t\t\t\tlayer.layer = new google.maps.Data();\n // layer.viz.icon = {\n // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n // scale: 5,\n // strokeWeight:2,\n // strokeColor:\"#B40404\"\n // }\n\t\t layer.layer.setStyle(layer.viz);\n\t\t \n\t\t \tlayer.layer.addGeoJson(v);\n if(layer.viz.clickQuery){\n map.addListener('click',function(){\n infowindow.setMap(null);\n })\n layer.layer.addListener('click', function(event) {\n console.log(event);\n infowindow.setPosition(event.latLng);\n var infoContent = `<table class=\"table table-hover bg-white\">\n <tbody>`\n var info = event.feature.h;\n Object.keys(info).map(function(name){\n var value = info[name];\n infoContent +=`<tr><th>${name}</th><td>${value}</td></tr>`;\n });\n infoContent +=`</tbody></table>`;\n infowindow.setContent(infoContent);\n infowindow.open(map);\n }) \n }\n\t\t \tfeatureObj[layer.name] = layer.layer\n\t\t \t// console.log(this.viz);\n\t\t \n\t\t \tif(layer.visible){\n\t\t \tlayer.layer.setMap(layer.map);\n\t\t \tlayer.rangeOpacity = layer.viz.strokeOpacity;\n\t\t \tlayer.percent = 100;\n\t\t \tupdateProgress();\n\t\t \t$('#'+layer.legendDivID).show();\n\t\t \t}else{\n\t\t \tlayer.rangeOpacity = 0;\n\t\t \tlayer.percent = 0;\n\t\t \t$('#'+layer.legendDivID).hide();\n\t\t \t\t}\n\t\t \tsetRangeSliderThumbOpacity();\n\t\t \t}\n \t\t}", "function drawMap () {\n const winHill=new Point([ -1.721040,53.362571]).transform( 'EPSG:4326','EPSG:3857');\n const activityLayer = new LayerVector({\n style: function(feature) {\n return styles[feature.get('type')];\n },\n source: new VectorSource({}),\n name: 'activity' \n });\n const animationLayer = new LayerVector({\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n source: new VectorSource({}),\n name: 'animation' \n });\n \n const osmLayer = new LayerTile({\n title: 'Open Steet Map',\n type: 'base',\n source: new OSM()\n });\n\n const osmTopoLayer = new LayerTile({\n title: 'OSM Topo',\n type: 'base',\n visible: false,\n source: new XYZ({\n url: 'https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png'\n })\n });\n // OSMImpl.CycleMap(name)\n //{\n // \"url\" : \"http://tile2.opencyclemap.org/transport/{z}/{x}/{y}.png\"\n // }\n // https://a.tile.thunderforest.com/cycle/15/16234/10624.png?apikey=a5dd6a2f1c934394bce6b0fb077203eb\n const arcGISEsriTopoLayer=new LayerTile({\n title: 'ArcGIS Esri Topographical',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Topo_Map/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n const arcGISEsriImagaryLayer=new LayerTile({\n title: 'ArcGIS Esri Image',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Imagery/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n }); \n\n\n const map = new Map({\n target: document.getElementById('map'),\n view: new View({\n center: winHill.flatCoordinates,\n zoom: 14,\n minZoom: 2,\n maxZoom: 19\n }),\n layers: [\n arcGISEsriTopoLayer,osmTopoLayer,arcGISEsriImagaryLayer,osmLayer\n ]\n });\n \n var layerSwitcher = new LayerSwitcher();\n map.addControl(layerSwitcher);\n\n return map;\n}", "addToChangeLayers(){\n let _to = this.props.toVersion.key;\n //attribute change in protected areas layers\n this.addLayer({id: window.LYR_TO_CHANGED_ATTRIBUTE, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(99,148,69,0.4)\", \"fill-outline-color\": \"rgba(99,148,69,0.8)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //geometry change in protected areas layers - to\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //added protected areas layers\n this.addLayer({id: window.LYR_TO_NEW_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(63,127,191,0.2)\", \"fill-outline-color\": \"rgba(63,127,191,0.6)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_NEW_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(63,127,191)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n \n }", "function add_bounding_area(uid, a,b,c,d) {\n var group=addAreaLayerGroup(a,b,c,d);\n var tmp={\"uid\":uid,\"latlngs\":[{\"lat\":a,\"lon\":b},{\"lat\":c,\"lon\":d}]};\n ucvm_area_list.push(tmp);\n load_a_layergroup(uid, AREA_ENUM, group, EYE_NORMAL);\n}", "function create_PlateBoundary_Layer(b_data){\n console.log(b_data)\n var myStyle = {\n \"color\": \"#ff7800\",\n \"weight\": 3,\n \"opacity\": 0.7\n };\n var boundaryLayer = L.geoJson(b_data.features, {\n style: myStyle\n })\n return boundaryLayer;\n}", "function setupMap(geoOutline, geoCountries) {\n\n // Data prep\n var germanyOutline = topojson.feature(geoOutline, geoOutline.objects['d-01']); // Convert TopoJSON to GeoJSON\n var germanyCountries = topojson.feature(geoCountries, geoCountries.objects['deutschland-bl']); // Convert TopoJSON to GeoJSON\n\n vis.geo = { outline: germanyOutline, countries: germanyCountries };\n\n // Projection\n var projection = d3.geoConicEqualArea()\n .parallels([48, 54])\n .fitExtent([[vis.dims.margin.left, vis.dims.margin.top], [vis.dims.width, vis.dims.height*0.95]], vis.geo.outline); // just a little leeway for the text at the bottom\n\n // Path generator\n var path = d3.geoPath()\n .projection(projection);\n\n // Add to global\n vis.maptools = { projection: projection, path: path };\n\n} // setupMap()", "function addLayerToControlLayer(featureCollection, layer) {\n var layer_display_name, display_name, name\n if (featureCollection.type == \"FeatureCollection\") {\n var type = \"Devices\"\n if (featureCollection.features.length > 0) {\n type = (featureCollection.features[0].geometry.type == \"Point\") ? \"Devices\" : \"Zones\"\n }\n layer_display_name = Util.isSet(featureCollection.properties) && Util.isSet(featureCollection.properties.layer_display_name) ? featureCollection.properties.layer_display_name : type\n display_name = featureCollection.properties.display_name\n name = featureCollection.properties.name\n } else if (Array.isArray(featureCollection) && featureCollection.length > 0) { // collections of features gets the name of the type of the first element\n layer_display_name = (featureCollection[0].geometry.type == \"Point\") ? \"Devices\" : \"Zones\"\n display_name = Util.isSet(featureCollection[0].properties.display_type) ? featureCollection[0].properties.display_type : featureCollection[0].properties.type\n name = Util.isSet(featureCollection[0].properties.layer_name) ? featureCollection[0].properties.layer_name : null\n } else { // layers from one element gets the name from that element\n layer_display_name = (featureCollection.geometry.type == \"Point\") ? \"Devices\" : \"Zones\"\n display_name = featureCollection.properties.display_name\n name = featureCollection.properties.name\n }\n if (_layerControl) {\n _layerControl.addGipOverlay(layer, display_name, layer_display_name)\n if (name) {\n // console.log('Map::addLayerToControlLayer: Info - Adding', name)\n _gipLayers[name] = layer\n } else {\n console.log('Map::addLayerToControlLayer: featureCollection has no layer name', featureCollection)\n }\n } else {\n console.log('Map::addLayerToControlLayer: _layerControl not set', featureCollection)\n }\n}", "function makeMap() {\n // Make containers\n\n const div = mapsContainer.append('div').attr('class', 'map-container');\n const svg = div.append('svg').html(DEFS);\n\n const pathContainer = svg.append('g').attr('class', 'features');\n const baselineContainer = svg.append('g').attr('class', 'baseline');\n const chart19Container = svg.append('g').attr('class', 'slopes-19');\n const chart20Container = svg.append('g').attr('class', 'slopes-20');\n const textContainer = svg\n .append('g')\n .attr('class', 'text')\n // Create separate groups for white background and black foreground\n .selectAll('g')\n .data([true, false])\n .enter()\n .append('g');\n\n const riverLabel = svg\n .append('text')\n .attr('class', 'river-label')\n .selectAll('tspan')\n .data(['Hudson', 'River'])\n .join('tspan')\n .text(d => d);\n const campusLabel = svg\n .append('g')\n .attr('class', 'campus-labels')\n // Create separate groups for white background and black foreground\n .selectAll('text')\n .data([true, false])\n .enter()\n .append('text')\n .classed('white-background', d => d)\n .selectAll('tspan')\n .data(['Main', 'Campus'])\n .join('tspan')\n .text(d => d);\n\n const labelContainer = svg.append('g');\n const neighborhoodLabelsBg = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .attr('class', 'white-background')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n const neighborhoodLabels = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n\n // Extract census tract features (contains all tracts in Manhattan)\n\n const allTracts = feature(influxData, influxData.objects.tracts);\n\n // Create a separate GeoJSON object that holds only the tracts we want to fit\n // the projection around\n\n const tracts = {\n type: 'FeatureCollection',\n features: allTracts.features.filter(({ properties: { census_tract } }) =>\n [36061018900, 36061021900].includes(+census_tract),\n ),\n };\n\n // Extract census tract centroids\n\n const centroids = feature(influxData, influxData.objects.tracts_centroids);\n\n // Create the paths that will become census tracts.\n // The `d` attribute won't be set until the resize function is called.\n\n const paths = pathContainer\n .selectAll('path')\n .data(allTracts.features)\n .enter()\n .append('path')\n .classed(\n 'columbia-outline',\n d => d.properties.census_tract === '36061020300',\n );\n paths\n .filter(\n ({ properties: { aug20, oct20, aug19, oct19 } }) =>\n (oct20 - aug20) / aug20 > (oct19 - aug19) / aug19,\n )\n .style('fill', shadedColor);\n\n // Create the things that will become the slope chart (e.g. line, arrow, circles)\n\n const circles = chart20Container\n .selectAll('circle')\n .data(centroids.features)\n .enter()\n .append('circle')\n .attr('r', 3);\n\n const baseline = baselineContainer\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line');\n\n /* const text = textContainer\n .selectAll('text')\n .data(centroids.features)\n .enter()\n .append('text')\n .classed('white-background', function () {\n return this.parentNode.__data__;\n }); */\n\n const slopes2020 = chart20Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c20);\n\n const slopes2019 = chart19Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c19);\n\n // Make a handleResize method that handles the things that depend on\n // width (path generator, paths, and svg)\n\n function handleResize() {\n // Recompute width and height; resize the svg\n\n const width = Math.min(WIDTH, document.documentElement.clientWidth - 30);\n const isMobile = width < 460;\n const height = (width * (isMobile ? 36 : 28)) / 30;\n arrowSize = isMobile ? 32 : 45;\n svg.attr('width', width);\n svg.attr('height', height);\n\n // Create the projection\n\n const albersprojection = geoAlbers()\n .rotate([122, 0, 0])\n .fitSize([width, height], tracts);\n\n // Create the path generating function; set the `d` attribute to the path\n // generator, which is called on the data we attached to the paths earlier\n\n const pathGenerator = geoPath(albersprojection);\n paths.attr('d', pathGenerator);\n\n // Define some commonly used coordinate functions\n\n const x = d => albersprojection(d.geometry.coordinates)[0];\n const y = d => albersprojection(d.geometry.coordinates)[1];\n const endpointX = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const x = arrowSize * Math.cos(Math.atan(slope * 2));\n return albersprojection(d.geometry.coordinates)[0] + x;\n };\n const endpointY = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const y = arrowSize * Math.sin(Math.atan(slope) * 2);\n return albersprojection(d.geometry.coordinates)[1] - y;\n };\n\n // Modify the positions of the elements\n\n circles.attr('cx', x).attr('cy', y);\n slopes2020\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(20))\n .attr('y2', endpointY(20));\n slopes2019\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(19))\n .attr('y2', endpointY(19));\n\n /* text\n .attr('x', x)\n .attr('y', y)\n .text(d => {\n let difference =\n (100 * (d.properties.oct - d.properties.aug)) / d.properties.aug;\n difference =\n difference < 10 ? difference.toFixed(1) : Math.round(difference);\n if (difference > 0) return '+' + difference + '%';\n else return '–' + Math.abs(difference) + '%';\n }); */\n\n baseline\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', d => x(d) + arrowSize)\n .attr('y2', y);\n\n riverLabel\n .attr('x', isMobile ? 0 : width / 6)\n .attr('y', (_, i) => height / 2 + i * 22);\n\n campusLabel\n .attr('x', albersprojection(CAMPUS_LABEL_LOC)[0])\n .attr('y', (_, i) => albersprojection(CAMPUS_LABEL_LOC)[1] + i * 18);\n\n neighborhoodLabels\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n\n neighborhoodLabelsBg\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n }\n\n // Call the resize function once; attach it to a resize listener\n\n handleResize();\n window.addEventListener('resize', debounce(handleResize, 400));\n}", "function addUSMap(usmap, args) {\n if (args == null) args = {};\n var numCanvas = \"county\" in usmap ? 2 : 1;\n if (\"pyramid\" in args && args.pyramid.length != numCanvas)\n throw new Error(\n \"Adding USMap: args.pyramid does not have matching number of canvases\"\n );\n\n // add to project\n this.usmaps.push(usmap);\n\n // rendering params\n var rpKey = \"usmap_\" + (this.usmaps.length - 1);\n var rpDict = {};\n rpDict[rpKey] = usmap.params;\n this.addRenderingParams(rpDict);\n\n // ================== state map canvas ===================\n var canvases = [];\n var stateMapCanvas;\n if (\"pyramid\" in args) stateMapCanvas = args.pyramid[0];\n else {\n stateMapCanvas = new Canvas(\n \"usmap\" + (this.usmaps.length - 1) + \"_\" + \"state\",\n usmap.stateMapWidth,\n usmap.stateMapHeight\n );\n this.addCanvas(stateMapCanvas);\n }\n if (\n stateMapCanvas.w != usmap.stateMapWidth ||\n stateMapCanvas.h != usmap.stateMapHeight\n )\n throw new Error(\"Adding USMap: state canvas sizes do not match\");\n\n // static legends layer\n var stateMapLegendLayer = new Layer(null, true);\n stateMapCanvas.addLayer(stateMapLegendLayer);\n stateMapLegendLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"stateMapLegendRendering\")\n );\n stateMapLegendLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 0);\n\n // state boundary layer\n var stateMapTransform = new Transform(\n `SELECT name, ${usmap.stateRateCol}, geomstr \n FROM ${usmap.stateTable}`,\n usmap.db,\n usmap.getUSMapTransformFunc(\"stateMapTransform\"),\n [\"bbox_x\", \"bbox_y\", \"name\", \"rate\", \"geomstr\"],\n true\n );\n var stateBoundaryLayer = new Layer(stateMapTransform, false);\n stateMapCanvas.addLayer(stateBoundaryLayer);\n stateBoundaryLayer.addPlacement({\n centroid_x: \"col:bbox_x\",\n centroid_y: \"col:bbox_y\",\n width: `con:${usmap.stateMapWidth / usmap.zoomFactor}`,\n height: `con:${usmap.stateMapWidth / usmap.zoomFactor}`\n });\n stateBoundaryLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"stateMapRendering\")\n );\n stateBoundaryLayer.addTooltip(\n [\"name\", \"rate\"],\n [\"State\", usmap.tooltipAlias]\n );\n stateBoundaryLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 0);\n\n // add to canvases (return)\n canvases.push(stateMapCanvas);\n\n // ========== Views ===============\n if (!(\"view\" in args)) {\n var view = new View(\n \"usmap\" + (this.usmaps.length - 1),\n usmap.stateMapWidth,\n usmap.stateMapHeight\n );\n this.addView(view);\n this.setInitialStates(view, stateMapCanvas, 0, 0);\n } else if (!(args.view instanceof View)) {\n throw new Error(\"Adding USMap: view must be a View object\");\n }\n\n // ================== county map canvas ===================\n if (\"countyTable\" in usmap) {\n var countyMapCanvas;\n if (\"pyramid\" in args) countyMapCanvas = args.pyramid[1];\n else {\n countyMapCanvas = new Canvas(\n \"usmap\" + (this.usmaps.length - 1) + \"_\" + \"county\",\n usmap.stateMapWidth * usmap.zoomFactor,\n usmap.stateMapHeight * usmap.zoomFactor\n );\n this.addCanvas(countyMapCanvas);\n }\n if (\n countyMapCanvas.w != usmap.stateMapWidth * usmap.zoomFactor ||\n countyMapCanvas.h != usmap.stateMapHeight * usmap.zoomFactor\n )\n throw new Error(\"Adding USMap: county canvas sizes do not match\");\n\n // static legends layer\n var countyMapLegendLayer = new Layer(null, true);\n countyMapCanvas.addLayer(countyMapLegendLayer);\n countyMapLegendLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"countyMapLegendRendering\")\n );\n countyMapLegendLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 1);\n\n // thick state boundary layer\n var countyMapStateBoundaryTransform = new Transform(\n `SELECT geomstr FROM ${usmap.stateTable}`,\n usmap.db,\n usmap.getUSMapTransformFunc(\"countyMapStateBoundaryTransform\"),\n [\"bbox_x\", \"bbox_y\", \"bbox_w\", \"bbox_h\", \"geomstr\"],\n true\n );\n var countyMapStateBoundaryLayer = new Layer(\n countyMapStateBoundaryTransform,\n false\n );\n countyMapCanvas.addLayer(countyMapStateBoundaryLayer);\n countyMapStateBoundaryLayer.addPlacement({\n centroid_x: \"col:bbox_x\",\n centroid_y: \"col:bbox_y\",\n width: \"col:bbox_w\",\n height: \"col:bbox_h\"\n });\n countyMapStateBoundaryLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"countyMapStateBoundaryRendering\")\n );\n countyMapStateBoundaryLayer.setUSMapId(\n this.usmaps.length - 1 + \"_\" + 1\n );\n\n // county boundary layer\n var countyMapTransform = new Transform(\n `SELECT name, ${usmap.countyRateCol}, geomstr\n FROM ${usmap.countyTable};`,\n usmap.db,\n usmap.getUSMapTransformFunc(\"countyMapTransform\"),\n [\"bbox_x\", \"bbox_y\", \"bbox_w\", \"bbox_h\", \"name\", \"rate\", \"geomstr\"],\n true\n );\n var countyBoundaryLayer = new Layer(countyMapTransform, false);\n countyMapCanvas.addLayer(countyBoundaryLayer);\n countyBoundaryLayer.addPlacement({\n centroid_x: \"col:bbox_x\",\n centroid_y: \"col:bbox_y\",\n width: \"col:bbox_w\",\n height: \"col:bbox_h\"\n });\n countyBoundaryLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"countyMapRendering\")\n );\n countyBoundaryLayer.addTooltip(\n [\"name\", \"rate\"],\n [\"County\", usmap.tooltipAlias]\n );\n countyBoundaryLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 1);\n\n // add to canvases (return)\n canvases.push(countyMapCanvas);\n\n // =============== jump ===============\n if (usmap.zoomType == \"literal\") {\n this.addJump(\n new Jump(stateMapCanvas, countyMapCanvas, \"literal_zoom_in\")\n );\n this.addJump(\n new Jump(countyMapCanvas, stateMapCanvas, \"literal_zoom_out\")\n );\n } else if (usmap.zoomType == \"jump\") {\n var selector = new Function(\n \"row\",\n \"args\",\n `return args.layerId = ${stateMapCanvas.layers.length - 1}`\n );\n var newPredicates = function() {\n return {};\n };\n var newViewportBody = function(row, args) {\n var zoomFactor = REPLACE_ME_zoomfactor;\n var vpW = args.viewportW;\n var vpH = args.viewportH;\n return {\n constant: [\n row.bbox_x * zoomFactor - vpW / 2,\n row.bbox_y * zoomFactor - vpH / 2\n ]\n };\n };\n var newViewport = new Function(\n \"row\",\n \"args\",\n getBodyStringOfFunction(newViewportBody).replace(\n /REPLACE_ME_zoomfactor/g,\n usmap.zoomFactor\n )\n );\n var jumpName = function(row) {\n return \"County map of \" + row.name;\n };\n this.addJump(\n new Jump(\n stateMapCanvas,\n countyMapCanvas,\n \"geometric_semantic_zoom\",\n {\n selector: selector,\n viewport: newViewport,\n predicates: newPredicates,\n name: jumpName\n }\n )\n );\n }\n }\n\n return {pyramid: canvases, view: args.view ? args.view : view};\n}", "function setupMap() {\n\tvar bbox = getURLParameter('bbox') || \"-11.0133787,51.222,-5.6582362,55.636\";\n\tapi_url = \"https://api.openstreetmap.org/api/0.6/changesets?bbox=\" + bbox\n\tvar fields = bbox.split(',');\n\tvar minlong = fields[0] * 1;\n\tvar minlat = fields[1] * 1;\n\tvar maxlong = fields[2] * 1;\n\tvar maxlat = fields[3] * 1;\n\tmymap = L.map(\"mapid\", {editable: true});\n\tvar OpenStreetMap_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\tmaxZoom: 19,\n\t\tattribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n\t});\n\tvar southwest = new L.latLng(minlat, minlong);\n\tvar northeast = new L.latLng(maxlat, maxlong);\n\tbounds = new L.LatLngBounds([southwest, northeast]);\n\tupdateLocationBar(minlong, minlat, maxlong, maxlat);\n\n\tmymap.fitBounds(bounds);\n\n\tOpenStreetMap_Mapnik.addTo(mymap);\n\n\tL.EditControl = L.Control.extend({});\n\tL.NewRectangleControl = L.EditControl.extend({});\n\tvar rectangle = L.rectangle([southwest,northeast]).addTo(mymap);\n\trectangle.enableEdit();\n\trectangle.on(\"editable:dragend editable:vertex:dragend\", function() {\n\t\tbounds = this.getBounds();\n\t\tupdateMap();\n\t});\n}", "function addFraPositionsToMap()\n{\n //leafletMap.remove();\n //leafletMap = L.map('map').fitBounds(mapBounds);\n /*L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {\n maxZoom: 18,\n attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n }).addTo(leafletMap);*/\n\n\n for(var test in positionDataFra.allSites)\n {\n var site = positionDataFra.allSites[test];\n if(site.terminal != null && site.latitude != undefined) {\n drawOnMap(site.latitude, site.longitude, site.name, 'blue');\n }\n }\n}", "function fitMapBounds() {\n var mapBounds = L.latLngBounds([]);\n\n trackLayerGroup.eachLayer(function (layer) {\n mapBounds.extend(layer.getBounds());\n });\n\n map.fitBounds(mapBounds);\n }", "function AddMapOverlays() { try { LoadPoliticalBoundaries(); LoadSoilsService(); } catch (e) { HiUser(e, \"AddMapOverlays\"); } }", "function addLayers(){\n\n\t// Get renderer\n\tvar renderer = OpenLayers.Util.getParameters(window.location.href).renderer;\n\trenderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;\n\t// renderer = [\"Canvas\", \"SVG\", \"VML\"];\n\n\t// Create vector layer with a stylemap for vessels\n\tvesselLayer = new OpenLayers.Layer.Vector(\n\t\t\t\"Vessels\",\n\t\t\t{\n\t\t\t\tstyleMap: new OpenLayers.StyleMap({\n\t\t\t\t\t\"default\": {\n\t\t\t\t\t\texternalGraphic: \"${image}\",\n\t\t\t\t\t\tgraphicWidth: \"${imageWidth}\",\n\t\t\t\t\t\tgraphicHeight: \"${imageHeight}\",\n\t\t\t\t\t\tgraphicYOffset: \"${imageYOffset}\",\n\t\t\t\t\t\tgraphicXOffset: \"${imageXOffset}\",\n\t\t\t\t\t\trotation: \"${angle}\"\n\t\t\t\t\t},\n\t\t\t\t\t\"select\": {\n\t\t\t\t\t\tcursor: \"crosshair\",\n\t\t\t\t\t\texternalGraphic: \"${image}\"\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\trenderers: renderer\n\t\t\t}\n\t\t);\n\n\tmap.addLayer(vesselLayer);\n\t\n\t// Create vector layer with a stylemap for the selection image\n\tmarkerLayer = new OpenLayers.Layer.Vector(\n\t\t\t\"Markers\",\n\t\t\t{\n\t\t\t\tstyleMap: new OpenLayers.StyleMap({\n\t\t\t\t\t\"default\": {\n\t\t\t\t\t\texternalGraphic: \"${image}\",\n\t\t\t\t\t\tgraphicWidth: \"${imageWidth}\",\n\t\t\t\t\t\tgraphicHeight: \"${imageHeight}\",\n\t\t\t\t\t\tgraphicYOffset: \"${imageYOffset}\",\n\t\t\t\t\t\tgraphicXOffset: \"${imageXOffset}\",\n\t\t\t\t\t\trotation: \"${angle}\"\n\t\t\t\t\t},\n\t\t\t\t\t\"select\": {\n\t\t\t\t\t\tcursor: \"crosshair\",\n\t\t\t\t\t\texternalGraphic: \"${image}\"\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\trenderers: renderer\n\t\t\t}\n\t\t);\n\t\n\tmap.addLayer(markerLayer);\n\n\t// Create vector layer with a stylemap for the selection image\n\tselectionLayer = new OpenLayers.Layer.Vector(\n\t\t\t\"Selection\",\n\t\t\t{\n\t\t\t\tstyleMap: new OpenLayers.StyleMap({\n\t\t\t\t\t\"default\": {\n\t\t\t\t\t\texternalGraphic: \"${image}\",\n\t\t\t\t\t\tgraphicWidth: \"${imageWidth}\",\n\t\t\t\t\t\tgraphicHeight: \"${imageHeight}\",\n\t\t\t\t\t\tgraphicYOffset: \"${imageYOffset}\",\n\t\t\t\t\t\tgraphicXOffset: \"${imageXOffset}\",\n\t\t\t\t\t\trotation: \"${angle}\"\n\t\t\t\t\t},\n\t\t\t\t\t\"select\": {\n\t\t\t\t\t\tcursor: \"crosshair\",\n\t\t\t\t\t\texternalGraphic: \"${image}\"\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\trenderers: renderer\n\t\t\t}\n\t\t);\n\n\t// Create vector layer for past tracks\n\ttracksLayer = new OpenLayers.Layer.Vector(\"trackLayer\", {\n styleMap: new OpenLayers.StyleMap({'default':{\n strokeColor: pastTrackColor,\n strokeOpacity: pastTrackOpacity,\n strokeWidth: pastTrackWidth\n }})\n });\n\n\t// Create vector layer for time stamps\n\ttimeStampsLayer = new OpenLayers.Layer.Vector(\"timeStampsLayer\", {\n styleMap: new OpenLayers.StyleMap({'default':{\n label : \"${timeStamp}\",\n\t\t\tfontColor: timeStampColor,\n\t\t\tfontSize: timeStampFontSize,\n\t\t\tfontFamily: timeStampFontFamily,\n\t\t\tfontWeight: timeStampFontWeight,\n\t\t\tlabelAlign: \"${align}\",\n\t\t\tlabelXOffset: \"${xOffset}\",\n\t\t\tlabelYOffset: \"${yOffset}\",\n\t\t\tlabelOutlineColor: timeStamtOutlineColor,\n\t\t\tlabelOutlineWidth: 5,\n\t\t\tlabelOutline:1\n }})\n });\n\n\t// Create cluster layer\n\tclusterLayer = new OpenLayers.Layer.Vector( \"Clusters\", \n\t\t{\n\t\t styleMap: new OpenLayers.StyleMap({\n\t\t 'default':{\n\t\t fillColor: \"${fill}\",\n\t\t fillOpacity: clusterFillOpacity,\n\t\t strokeColor: clusterStrokeColor,\n\t\t strokeOpacity: clusterStrokeOpacity,\n\t\t strokeWidth: clusterStrokeWidth\n \t}\n })\n });\n\t\t\n\tmap.addLayer(clusterLayer);\n\n\t// Create cluster text layer\n\tclusterTextLayer = new OpenLayers.Layer.Vector(\"Cluster text\", \n\t\t{\n\t\t styleMap: new OpenLayers.StyleMap(\n\t\t {\n\t\t\t\t'default':\n\t\t\t\t{\n\t\t\t\t\t\tlabel : \"${count}\",\n\t\t\t\t\t\tfontColor: clusterFontColor,\n\t\t\t\t\t\tfontSize: \"${fontSize}\",\n\t\t\t\t\t\tfontWeight: clusterFontWeight,\n\t\t\t\t\t\tfontFamily: clusterFontFamily,\n\t\t\t\t\t\tlabelAlign: \"c\"\n\t\t\t\t}\n\t\t\t})\n \t});\n\n\tmap.addLayer(clusterTextLayer); \n\n\t// Create layer for individual vessels in cluster \n\tindieVesselLayer = new OpenLayers.Layer.Vector(\"Points\", \n\t\t{\n\t\t styleMap: new OpenLayers.StyleMap({\n\t\t \"default\": {\n pointRadius: indieVesselRadius,\n fillColor: indieVesselColor,\n strokeColor: indieVesselStrokeColor,\n strokeWidth: indieVesselStrokeWidth,\n graphicZIndex: 1\n \t},\n\t\t\t\"select\": {\n pointRadius: indieVesselRadius * 3,\n fillColor: indieVesselColor,\n strokeColor: indieVesselStrokeColor,\n strokeWidth: indieVesselStrokeWidth,\n graphicZIndex: 1\n \t}\n })\n });\n \n\t\n map.addLayer(indieVesselLayer); \n map.addLayer(selectionLayer);\n map.addLayer(tracksLayer); \n map.addControl(new OpenLayers.Control.DrawFeature(tracksLayer, OpenLayers.Handler.Path)); \n\tmap.addLayer(timeStampsLayer); \n\n\t// Add OpenStreetMap Layer\n\tvar osm = new OpenLayers.Layer.OSM(\n\t\t\"OSM\",\n\t\t\"//osm.e-navigation.net/${z}/${x}/${y}.png\",\n\t\t{\n\t\t\t'layers':'basic',\n\t\t\t'isBaseLayer': true\n\t\t} \n\t);\n\n\t// Add OpenStreetMap Layer\n\tmap.addLayer(osm);\n\t\n\t// Add KMS Layer\n\t//addKMSLayer();\n\n}", "function mapBoundaries(data){\n boundaries = L.geoJSON(data, {\n style: {\n color: 'blue', // base layers can change that\n weight: 2\n }\n });\n\n styleBound()\n\n return boundaries\n\n}", "function drawAllBuses(){\n map.on(\"load\", function(){\n console.log(\"adding buses\");\n\n console.log(cta);\n map.addSource(\"Bus Routes\", {\n \"type\":\"geojson\",\n \"data\":cta});\n\n console.log(\"layer\");\n\n map.addLayer({\n \"id\": \"Bus Routes\",\n \"type\": \"line\",\n \"source\": \"Bus Routes\",\n \"layout\": {\n \"line-join\": \"round\",\n \"line-cap\": \"butt\"\n },\n \"paint\": {\n \"line-color\": \"#31a354\",\n \"line-width\": 4,\n \"line-opacity\": 0.4\n }\n });\n });\n}", "addNoiseAll(){\n\t\tthis.geo.features.map(this.addNoise);\n\t}", "function createMap(bikesLayer) {\n\n // Create the base layers.\n var streetmap = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n })\n\n var topomap = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {\n attribution: 'Map data: &copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors, <a href=\"http://viewfinderpanoramas.org\">SRTM</a> | Map style: &copy; <a href=\"https://opentopomap.org\">OpenTopoMap</a> (<a href=\"https://creativecommons.org/licenses/by-sa/3.0/\">CC-BY-SA</a>)'\n });\n\n // Create a baseMaps object.\n var baseMaps = {\n \"Street Map\": streetmap,\n \"Topographic Map\": topomap\n };\n\n // Create an overlay object to hold our overlay.\n var overlayMaps = {\n \"Bike Station\": bikesLayer\n };\n\n // Create our map, giving it the streetmap and bikeStations layers to display on load.\n var myMap = L.map(\"map-id\", {\n center: [40.73, -74.0059],\n zoom: 12,\n layers: [streetmap, topomap, bikesLayer]\n });\n\n // Create a layer control.\n // Pass it our baseMaps and overlayMaps.\n // Add the layer control to the map.\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n}", "function initLayerAllFeatures(points, mainMap) {\n var context = function(feature) {return feature;} // a magic line from somewhere..\n var myStyle = new OpenLayers.Style( {\n graphicName: \"circle\", fillOpacity: \"1\", fillColor: \"#378fe0\", strokeColor: \"blue\", pointRadius: 5,\n graphicTitle: \"${label}\", labelYOffset: \"7px\", externalGraphic: \"${iconUrl}\", graphicWidth: \"${size}\",\n fontSize: \"10px\", fontFamily: \"Verdana, Arial\", fontColor: \"#ffffff\"}); //, cursor: \"pointer\"} );\n var textStyle = new OpenLayers.Style( {\n graphicName: \"circle\", fillOpacity: \"1\", fillColor: \"#378fe0\", strokeColor: \"#378fe0\", pointRadius: 8,\n fontSize: \"11px\", fontWeight: \"bold\", labelXOffset: \"-2px\", fontFamily: \"Verdana, Arial\",\n fontColor: \"#ffffff\", label: \"${text}\"} );\n var symbolizer = OpenLayers.Util.applyDefaults( myStyle, OpenLayers.Feature.Vector.style[\"default\"]);\n var myStyleMap = new OpenLayers.StyleMap({\n \"default\": symbolizer, \"enumeration\": textStyle, // cursor: \"pointer\",\n \"select\": {strokeColor:\"red\", fillOpacity: \"1\", fillColor:\"white\", strokeWidth: 2 , graphicWidth: 23},\n \"temporary\": {strokeColor:\"white\", fillOpacity: \"1\", fillColor: \"blue\", strokeWidth: 2, graphicWidth: 25}\n });\n //\"hotspot\": {pointRadius: 8}});\n var lookup = {\n \"normal\": {pointRadius: 5}, // normal\n \"hotspot\": {pointRadius: 7} // hotspot / cluster\n };\n myStyleMap.addUniqueValueRules(\"default\", \"marker\", lookup);\n // myStyleMap.addUniqueValueRules(\"temporary\", \"label\", labelook);\n myNewLayer = new OpenLayers.Layer.Vector('Kiezatlas Marker', {\n styleMap: myStyleMap, displayInLayerSwitcher: false\n // strategies: [ new OpenLayers.Strategy.Cluster() ]\n });\n // ### redundant^^\n kiezatlas.setLayer(myNewLayer);\n //\n var selectFeatureHandler = new OpenLayers.Control.SelectFeature(kiezatlas.layer, {\n multiple: false, clickout: false, toggle: false,\n hover: false, highlightOnly: false, renderIntent: \"select\",\n onSelect: function() {\n // jQuery(\"#memu\").css(\"visibility\", \"hidden\");\n }\n });\n mainMap.addControl(selectFeatureHandler);\n selectFeatureHandler.activate();\n //\n var featureHandler = new OpenLayers.Handler.Feature(selectFeatureHandler, myNewLayer, {\n //stopClick: true,\n stopUp: true, stopDown: true,\n click: function(feat) {\n for ( i = 0; i < kiezatlas.layer.selectedFeatures.length; i++) {\n selectFeatureHandler.unselect(kiezatlas.layer.selectedFeatures[i]);\n }\n showInfoWindowForMarker(feat.data);\n selectFeatureHandler.select(feat);\n }, // clickFunction\n clickout: function (feat) {\n selectFeatureHandler.unselect(feat);\n hideAllInfoWindows();\n }\n }); // end FeatureHandlerInit\n /* commented out the mouseover cluster menu */\n var highlightCtrl = new OpenLayers.Control.SelectFeature(kiezatlas.layer, {\n hover: true, highlightOnly: true,\n renderIntent: \"temporary\",\n eventListeners: { // makes use of the global propertyMap for eventListeners\n beforefeaturehighlighted: function(e) {\n e.feature.attributes.label = e.feature.data.topicName;\n // no menu just label\n var marker = e.feature.attributes.marker;\n if (marker == \"hotspot\") {\n e.feature.attributes.label = \"mehrere Einsatzm\\u00F6glichkeiten\";\n }\n },\n // ### ToDo: mostly unused and to be removed\n /* featurehighlighted: function(e) {\n var marker = e.feature.attributes.marker;\n if (marker == \"hotspot\") {\n //log(\"hotSpotFeature highlght, to show contextMenu at l:\" + e.feature.geometry.bounds.getCenterPixel()); // + \"b:\"+ e.feature.geometry.bounds.bottom);\n var centerPoint = myNewLayer.getViewPortPxFromLonLat(e.feature.geometry.bounds.getCenterLonLat());\n var htmlString = \"\";\n if ( e.feature.data.cluster != null && e.feature.data.cluster != undefined ) {\n /* for ( i = 0; i < e.feature.data.cluster.length; i++) {\n // htmlString += '<a href=javascript:showInfoWindowForTopicId(\"'\n // + e.feature.data.cluster[i].topicId+'\");>'+e.feature.data.cluster[i].topicName+'</a><br/>';\n }\n // jQuery(\"#memu\").html(htmlString);\n // jQuery(\"#memu\").css(\"visibility\", \"visible\");\n // jQuery(\"#memu\").css(\"left\", centerPoint.x);\n // jQuery(\"#memu\").css(\"top\", centerPoint.y + headerGap + 27); // ### headergap seems unneccessary\n }\n } else {\n // log(\"normalFeature just highlight\");\n // e.feature.attributes.label = \"\";\n }\n }, */\n featureunhighlighted: function(e) {\n // TODO: is wrong one, if one is already selected and the user wants to deal with a cluster\n // log(\"feature\" + e.feature.data.topicId + \" unhighlighted\");\n var marker = e.feature.attributes.marker;\n if (marker == \"hotspot\") {\n jQuery(\"#memu\").css(\"visibility\", \"hidden\");\n // var testXY = e.feature.geometry.clone().transform(map.projection, map.displayProjection);\n // log(\"hotSpotFeature highlght, to hide contextMenu at l:\" + myNewLayer.getViewPortPxFromLonLat(testXY));\n // + \"t:\"+ e.feature.geometry.bounds.top);\n } else {\n // e.feature.attributes.label = \" \";\n }\n }\n } // eventListeners end\n });\n mainMap.addControl(highlightCtrl);\n highlightCtrl.activate();\n featureHandler.activate();\n allFeatures = [points.length];\n for ( var i = 0; i < points.length; i++ ) {\n allFeatures[i] = new OpenLayers.Feature.Vector (\n new OpenLayers.Geometry.Point(points[i].lonlat.lon, points[i].lonlat.lat), {\"marker\": \"normal\", \"label\": \"\"}\n );\n allFeatures[i].data = {\n topicName: points[i].topicName, topicId: points[i].topicId, defaultIcon: points[i].defaultIcon,\n lon:points[i].lonlat.lon, lat:points[i].lonlat.lat, originId: points[i].originId\n };\n allFeatures[i].cluster = null;\n allFeatures[i].attributes.iconUrl = \"\"; // not to show feature after initializing\n // allFeatures[i].attributes.renderer = \"circle\"; // = \"blackdot.gif\"; // not to show feature after initializing\n allFeatures[i].attributes.size = \"15\"; // item-style when geoobject is directly called from outside www\n allFeatures[i].attributes.label = points[i].topicName;\n allFeatures[i].renderIntent = \"default\"; // not to show feature after initializing\n // add new feature\n kiezatlas.layer.addFeatures(allFeatures[i]);\n }\n map.addLayer(kiezatlas.layer);\n }", "_init() {\r\n let that = this;\r\n\r\n // //FIRST LAYER OF GROUP FOR HOUSE MAP IMAGE\r\n // this.firstLayer = this.canvas.append(\"g\").attr(\"id\", \"firstLayer\").style('pointer-events', 'all');\r\n\r\n // //SECOND LAYER OF GROUP FOR BACKGROUND GRID\r\n // this.secondLayer = this.canvas.append(\"g\").attr(\"id\", \"secondLayer\");\r\n\r\n this.RECT_SIZE = {\r\n x: Utility.centerOfCanvas(this.canvasSize, 1200, 1200).x,\r\n y: Utility.centerOfCanvas(this.canvasSize, 1200, 1200).y,\r\n width: 1200,\r\n height: 1200\r\n }\r\n\r\n this.screenBoundariesCoords = [\r\n [this.RECT_SIZE.x, this.RECT_SIZE.y],\r\n [this.RECT_SIZE.width, this.RECT_SIZE.y],\r\n [this.RECT_SIZE.width, this.RECT_SIZE.height],\r\n [this.RECT_SIZE.x, this.RECT_SIZE.height]\r\n ]\r\n\r\n // this.rect = this.secondLayer\r\n // .append(\"rect\")\r\n // .attr('data-object','rects')\r\n // .attr(\"x\", this.RECT_SIZE.x)\r\n // .attr(\"y\", this.RECT_SIZE.y)\r\n // .attr(\"width\", this.RECT_SIZE.width)\r\n // .attr(\"height\", this.RECT_SIZE.height)\r\n // .style(\"fill-opacity\", 0)\r\n // .style(\"stroke-dasharray\", 10)\r\n // .style(\"stroke\", \"#68b2a1\")\r\n // .style(\"stroke-width\", 4);\r\n\r\n if(this.mapId != null) {\r\n d3.select('.drawing-tools').classed('d-none', true);\r\n\r\n let data = {\r\n matrix: this.houseMap.imageData.matrix,\r\n src: this.houseMap.imageData.src,\r\n width: this.houseMap.imageData.width,\r\n height: this.houseMap.imageData.height,\r\n x: this.houseMap.imageData.x,\r\n y: this.houseMap.imageData.y,\r\n };\r\n\r\n\r\n let object = new Object({\r\n layer: this.canvas,\r\n data: data,\r\n objectName: 'map',\r\n attribute: this.attribute,\r\n transform: this.houseMap.imageData.transform,\r\n });\r\n //console.log(object.getObject());\r\n this.hasImportedMap = true;\r\n d3.select('#rightSidebar').classed('d-none', false);\r\n\r\n this.start();\r\n }\r\n\r\n }", "function addMarkersAndSetViewBounds() {\n const group = new H.map.Group();\n map.addObject(group);\n\n const reports = []\n let bubbles = [];\n\n group.addEventListener('tap', function (evt) {\n // event target is the marker itself, group is a parent event target\n // for all objects that it contains\n\n evt.stopPropagation();\n\n bubbles.forEach((bubble) => {\n ui.removeBubble(bubble)\n });\n\n var bubble = new H.ui.InfoBubble(evt.target.getPosition(), {\n // read custom data\n content: evt.target.getData()\n });\n\n bubbles.push(bubble);\n\n // show info bubble\n setTimeout(function(){ ui.addBubble(bubble); }, 10);\n\n }, false);\n const markerSize = pixelRatio !== 1 ? {size: {w: 75, h: 75}} : {size: {w: 32, h: 32}}\n //change marker colour based on condition\n const iconPhysical = new H.map.Icon('https://res.cloudinary.com/khaotyl/image/upload/v1560161914/icons8-marker-32_gbpv0n.png', markerSize);\n const iconVerbal = new H.map.Icon('https://res.cloudinary.com/khaotyl/image/upload/v1560163227/icons8-marker-32_3_tvjayi.png', markerSize);\n const iconFeeling = new H.map.Icon('https://res.cloudinary.com/khaotyl/image/upload/v1560161914/icons8-marker-32_2_ggypsx.png', markerSize);\n\n actualMarkers.forEach((marker) => {\n if (marker.type == \"Physical\") {\n var markerObject = new H.map.Marker({lat:marker.lat, lng:marker.lng}, {icon: iconPhysical})\n } else if(marker.type == \"Verbal\") {\n var markerObject = new H.map.Marker({lat:marker.lat, lng:marker.lng}, {icon: iconVerbal})\n } else {\n var markerObject = new H.map.Marker({lat:marker.lat, lng:marker.lng}, {icon: iconFeeling})\n }\n\n // markerObject.setData('div');\n markerObject.setData(marker.infoWindow);\n reports.push(markerObject);\n });\n\n group.addObjects(reports);\n // get geo bounding box for the group and set it to the map\n map.setViewBounds(group.getBounds());\n\n\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 2,\n center: new google.maps.LatLng(2.8,-187.3),\n mapTypeId: 'terrain',\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n // Create a <script> tag and set the USGS URL as the source.\n var script = document.createElement('script');\n\n // This example uses a local copy of the GeoJSON stored at\n // http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojsonp\n script.src = 'https://developers.google.com/maps/documentation/javascript/examples/json/earthquake_GeoJSONP.js';\n document.getElementsByTagName('head')[0].appendChild(script);\n\n map.data.setStyle(function(feature) {\n var magnitude = feature.getProperty('mag');\n return {\n icon: getCircle(magnitude)\n };\n });\n }", "function drawPolygonOverYourCountry(map) {\n // Initialise the FeatureGroup to store editable layers\n var drawnItems = new L.FeatureGroup();\n map.addLayer(drawnItems);\n\n // Initialise the draw control and pass it the FeatureGroup of editable layers\n var drawControl = new L.Control.Draw({\n draw: {\n circle: false,\n polyline: false,\n marker: false\n },\n edit: {\n featureGroup: drawnItems\n }\n });\n map.addControl(drawControl);\n\n // respond to shapes that have been drawn\n map.on('draw:created', function (e) {\n var type = e.layerType;\n var layer = e.layer;\n\n // add to drawn items feature group\n drawnItems.addLayer(layer);\n });\n}", "function appInit() {\n\n // add layers to map:\n\n // Reference\n serviceArea.addTo(map);\n muniLayer.addTo(map);\n \n // Trace Search, Source, and Results\n trwwTraceResult.addTo(map);\n //trwwTracePoints.addTo(map);\n trwwTraceSource.addTo(map);\n addressPoint.addTo(map);\n trwwTraceDestin.addTo(map);\n\n\n // set map view to the service area layer extents\n serviceArea.query().bounds(function(error, latlngbounds) {\n map.fitBounds(latlngbounds);\n });\n\n\n /** -------------------------------------------------------------------------\n * MAP CONTROLS\n */\n\n\n L.control.attribution({ prefix: \"Not for official use or planning\" })\n .addAttribution(\"<a href='#' onclick='jQuery(\\\"#attributionModal\\\").modal(\\\"show\\\"); return false;'>Credits</a>\")\n .addTo(map);\n // L.control.attribution()\n // .addAttribution(\"Not for official use or planning | Data from 3RWW\")\n // .addTo(map);\n\n L.control.zoom({ position: 'bottomleft' }).addTo(map);\n\n\n /** -------------------------------------------------------------------------\n * MISC. MAP AND DOM EVENT LISTENERS\n */\n\n /**\n * make sure layers stay in the correct order when new ones are added later on\n */\n map.on(\"layeradd\", function(e) {\n trwwTraceSource.bringToFront();\n addressPoint.bringToFront();\n });\n\n /** -------------------------------------------------------------------------\n * SEWER DATA QUERY\n */\n\n /**\n * From a point (as L.latlng) find the nearest sewer structure.\n * This is made to work with a the Sewer Atlas map service.\n */\n function findNearestStructure(latlng) {\n var searchDistance = 1320;\n console.log(\"seaching within\", searchDistance, \"feet\");\n var targetPoint = turfHelpers.point([latlng.lng, latlng.lat]);\n var buffered = buffer(targetPoint, searchDistance, { units: 'feet' });\n //ajax request function\n //trwwStructures\n atlas.rsi_featurelayer.layer.query().layer(4).fields([]).intersects(buffered)\n //.nearby(latlng, searchDistance) // only works with feature layers\n .run(function(error, featureCollection, response) {\n if (error) {\n console.log(error);\n messageControl.onError('<i class=\"fa fa-frown-o\"></i> There was an error when searching for the nearest structure (' + error.message + ')');\n } else {\n if (featureCollection.features.length > 0) {\n console.log(\"trwwStructures.query():\", response);\n //returns[searchDistance] = featureCollection;\n var nearest = nearestPoint(targetPoint, featureCollection);\n console.log(\"nearest:\", nearest);\n trwwTraceSource.addData(nearest);\n traceExecute(nearest);\n return nearest;\n } else {\n console.log(\"...nothing found within this distance.\");\n var content = '<div class=\"alert alert-danger\" role=\"alert\"><h4>It does not appear that ' + traceSummary.datum.name + ' is within the ALCOSAN service area</h4><p>(We could not find any ALCOSAN-connected sewer structures within 1/4 mile of ' + traceSummary.datum.lng + ', ' + traceSummary.datum.lat + ')</p><h4>Try another address.</h4></div>';\n addressPoint.setPopupContent(content);\n }\n }\n });\n }\n\n /** -------------------------------------------------------------------------\n * NETWORK TRACE functions\n */\n\n /**\n * clear the network trace layers from the map\n */\n function clearNetworkTrace() {\n // remove trace start point\n trwwTraceSource.clearLayers();\n // remove trace line\n trwwTraceResult.clearLayers();\n }\n\n /**\n * display message when trace is running\n */\n function traceRunning() {\n console.log(\"Trace initialized...\");\n messageControl.onTraceStart();\n }\n\n /**\n * display error when trace fails\n */\n function traceError(error) {\n var msg = \"Trace: \" + error.message + \"(code: \" + error.code + \")\";\n console.log(msg);\n messageControl.onError('<p><i class=\"fa fa-frown-o\"></i> There was an error with the trace:<br>' + msg + '<p>');\n }\n\n /**\n * do things when trace is complete\n */\n function traceSuccess() {\n messageControl.onTraceComplete();\n var msg = \"Trace Complete\";\n console.log(msg);\n }\n\n /**\n * takes the raw trace response and calculates some totals\n */\n function traceSummarize(featureCollection, summaryGeography) {\n console.log(\"summarizing trace...\");\n // generate totals\n $.each(featureCollection.features, function(k, v) {\n traceSummary.length += v.properties.Shape_Length * 3.28084;\n traceSummary.inchmiles += v.properties.INCHMILES;\n });\n\n // calculate flow time\n traceSummary.calcTime();\n\n // generate a list of summary geographies\n var exploded = explode(featureCollection);\n var tagged = tag(exploded, summaryGeography, 'LABEL', 'places');\n var places = geojson_set(tagged.features, 'places');\n\n traceSummary.places = [];\n $.each(places, function(i, v) {\n traceSummary.places.push({ \"name\": v });\n });\n // console.log(traceSummary);\n }\n\n /**\n * given an input feature (geojson point), trace downstream on the 3RWW Sewer\n * Atlas network dataset.\n */\n function traceExecute(inputFeature) {\n\n // display \"flushing\" message\n traceRunning();\n\n // create a Terraformer Primitive from input (passed to the GP tool)\n var source = new Terraformer.Point({\n type: \"Point\",\n coordinates: [\n inputFeature.geometry.coordinates[0],\n inputFeature.geometry.coordinates[1]\n ]\n });\n //console.log(source);\n\n /**\n * set up the geoprocessing task\n */\n //var traceTask = traceService.createTask();\n console.log(atlas);\n var traceTask = atlas.rsi_networktrace.service.createTask();\n\n\n /**\n * run the georpocessing task\n */\n traceTask.on('initialized', function() {\n // set input Flags parameter, and then add fields references.\n traceTask.setParam(\"Flag\", source);\n traceTask.params.Flag.features[0].attributes = {\n \"OBJECTID\": 1\n };\n traceTask.params.Flag.fields = [{\n \"name\": \"OBJECTID\",\n \"type\": \"esriFieldTypeOID\",\n \"alias\": \"OBJECTID\"\n }];\n //console.log(traceTask);\n var trace_result;\n traceTask.setOutputParam(\"Downstream_Pipes\");\n traceTask.gpAsyncResultParam(\"Downstream_Pipes\", trace_result);\n\n console.log(\"Trace initialized. Submitting request to tracing service...\");\n traceTask.run(function(error, result, response) {\n console.log(\"Trace completed.\");\n if (error) {\n console.log(\"There was an error: \", error);\n traceError(error);\n } else {\n /**\n * Derive a simplified trace from the GP results for display\n */\n // convert ESRI Web Mercator to Leaflet Web Mercator\n console.log(\"reprojecting results...\");\n var fc1 = Terraformer.toGeographic(result.Downstream_Pipes);\n // dissolve the lines\n console.log(\"dissolving results...\");\n var gc1 = dissolve(fc1);\n console.log(\"Adding data to layer...\"); //, gc1);\n // add to the data to the waiting Leaflet object\n trwwTraceResult.addData(gc1);\n // add that to the map\n console.log(\"Adding layer to map...\");\n trwwTraceResult.addTo(map);\n // adjust the map position and zoom to definitely fit the results\n map.fitBounds(\n trwwTraceResult.getBounds()\n // {\n // paddingTopLeft: L.point(300, 75),\n // paddingBottomRight: L.point(300, 75)\n // }\n );\n //map.setZoom(map.getZoom() - 2);\n\n /**\n * Generate Summaries\n */\n traceSummarize(fc1, muniFC);\n\n /**\n * Animate\n */\n // preprocess data fro animation\n //var tracePoints = traceAnimatePrep(geometryCollection);\n // animate\n //traceAnimate(tracePoints);\n\n // Display completion messages, results, etc.\n traceSuccess();\n // console.log(\"Trace Results:\", gc1);\n }\n });\n });\n }\n\n /**\n * NETWORK TRACE button click - run the trace once address has been identified (this could be accessed from the address pop-up)\n */\n $(document).on(\"click\", \"#networkTrace\", function() {\n //disable the button\n $(this).prop(\"disabled\", true);\n // clear previous traces\n clearNetworkTrace();\n // search for the nearest structure\n var nearest = findNearestStructure(L.latLng({\n lat: traceSummary.datum.lat,\n lng: traceSummary.datum.lng\n }));\n console.log(\"nearest\", nearest);\n // run the GP using the geojson\n traceExecute(nearest);\n });\n\n /**\n * ABOUT BUTTON\n */\n $('#aboutModal').on('hidden.bs.modal', function(e) {\n messageControl.onAboutModalClose();\n });\n\n /**\n * click event to reset the analysis function\n */\n $(document).on(\"click\", '#' + messageControl.resetButton.id, function() {\n console.log(\"Resetting the trace.\");\n console.log(\"--------------------\");\n // reset all controls to initial state\n messageControl.reset();\n // set traceSummary object to initial values\n traceSummary.reset();\n // remove the network trace from the map\n clearNetworkTrace();\n // remove the geocoded address point from the map\n resetAddressSearch();\n });\n\n /**--------------------------------------------------------------------------\n * Typeahead search functionality\n */\n\n /* Highlight search box text on click */\n $(\".searchbox\").click(function() {\n $(this).select();\n });\n\n /* Prevent hitting enter from refreshing the page */\n $(\".searchbox\").keypress(function(e) {\n if (e.which == 13) {\n e.preventDefault();\n }\n });\n\n // var geocoding_url = L.Util.template(\n // \"https://api.mapbox.com/geocoding/v5/mapbox.places/%QUERY.json?bbox={bbox}&access_token={access_token}\", {\n // bbox: \"-80.2863,40.2984,-79.6814,40.5910\",\n // access_token: mapbox_key\n // }\n // )\n // \"https://search.mapzen.com/v1/search?text=%QUERY&size=5&boundary.country=USA&api_key=mapzen-ZGFLinZ\"\n //console.log(\"geocoding_url\", geocoding_url);\n var addressSearch = new Bloodhound({\n name: \"Mapbox\",\n datumTokenizer: function(d) {\n return Bloodhound.tokenizers.whitespace(d.name);\n },\n queryTokenizer: Bloodhound.tokenizers.whitespace,\n remote: {\n // rateLimitWait: 1000,\n // wildcard: '%QUERY',\n url: 'https://api.mapbox.com/geocoding/v5/mapbox.places/%QUERY.json?bbox=-80.2863,40.2984,-79.6814,40.5910&access_token=pk.eyJ1IjoiY2l2aWNtYXBwZXIiLCJhIjoiY2pjY2d2N2dhMDBraDMzbXRhOXpiZXJsayJ9.8JfoANBxEIrySG5avX4PWQ',\n // prepare: function(query, settings) {\n // console.log(settings);\n // // $(\"#searchicon\").removeClass(\"fa-search\").addClass(\"fa-refresh fa-spin\");\n // },\n // transform: function(response) {\n // console.log(response);\n // },\n // transport: function(options, onSuccess, onError) {\n // // $('#searchicon').removeClass(\"fa-refresh fa-spin\").addClass(\"fa-search\");\n // $.ajax(options)\n // .done(function(data, textStatus, request) {\n // console.log(data);\n // console.log(textStatus);\n // console.log(request);\n // var results = $.map(data.features, function(feature) {\n // return {\n // name: feature.place_name,\n // lat: feature.geometry.coordinates[1],\n // lng: feature.geometry.coordinates[0],\n // source: \"Mapbox\"\n // };\n // });\n\n // onSuccess(results);\n // })\n // .fail(function(request, textStatus, errorThrown) {\n // console.log(request, textStatus, errorThrown);\n // onError(errorThrown);\n // });\n // }\n filter: function(data) {\n return $.map(data.features, function(feature) {\n return {\n name: feature.place_name,\n lat: feature.geometry.coordinates[1],\n lng: feature.geometry.coordinates[0],\n source: \"Mapbox\"\n };\n });\n },\n ajax: {\n beforeSend: function(jqXhr, settings) {\n // console.log(\"beforeSend\", jqXhr, settings);\n $(\"#searchicon\").removeClass(\"fa-search\").addClass(\"fa-refresh fa-spin\");\n // settings.url += \"&boundary.rect.min_lat=40.1243&boundary.rect.min_lon=-80.5106&boundary.rect.max_lat=40.7556&boundary.rect.max_lon=-79.4064\";\n },\n complete: function(jqXHR, status) {\n // console.log(\"afterSend\", status);\n $('#searchicon').removeClass(\"fa-refresh fa-spin\").addClass(\"fa-search\");\n\n }\n }\n },\n limit: 5\n });\n\n addressSearch.initialize();\n\n var typeaheadTimeout;\n // non-Bloodhound source callback function for the CoreJS-flavor of Typeahead\n function corejsTypeaheadSource(query, syncResults, asyncResults) {\n var geocoding_url = L.Util.template(\n \"https://api.mapbox.com/geocoding/v5/mapbox.places/{address}.json?bbox={bbox}&access_token={access_token}&autocomplete=true{autocomplete}limit={limit}\", {\n address: query,\n bbox: \"-80.2863,40.2984,-79.6814,40.5910\",\n access_token: mapbox_key,\n autocomplete: true,\n limit: 5\n }\n );\n try { clearTimeout(typeaheadTimeout); } catch (e) {}\n typeaheadTimeout = setTimeout(function() {\n $.get(geocoding_url, function(data) {\n var response = $.map(data.features, function(feature) {\n return {\n name: feature.place_name,\n lat: feature.geometry.coordinates[1],\n lng: feature.geometry.coordinates[0],\n source: \"Mapbox\"\n };\n });\n console.log(response);\n asyncResults(response);\n });\n }, 500);\n }\n\n $(\".searchbox\").typeahead({\n minLength: 3,\n highlight: true,\n hint: false\n }, {\n name: \"Mapbox\",\n displayKey: \"name\",\n source: addressSearch.ttAdapter(),\n templates: {\n header: \"<p class='typeahead-header'>Select address at which to flush the toilet:</p>\",\n suggestion: Handlebars.compile([\"{{name}}\"].join(\"\"))\n }\n }).on(\"typeahead:selected\", function(obj, datum) {\n // once an address is selected from the drop-down:\n\n // store geocoding results in the global summary object\n traceSummary.datum = datum;\n\n // store the position of the address at latLng object\n var latlng = L.latLng({\n lat: datum.lat,\n lng: datum.lng\n });\n\n console.log(\"Search found this: \", datum, latlng);\n\n // set the map view to the address location\n map.setView(latlng, 15);\n // clear the previous network trace\n clearNetworkTrace();\n // remove the previous geocoded address point\n //addressPoint.remove();\n // add a point at the address, bind a pop-up, and open the pop-up automatically\n //addressPoint.setLatLng(latlng).bindPopup(\"<h4>\" + datum.name + \"</h4><p>\" + datum.lng + \", \" + datum.lat + \"</p>\").openPopup();\n\n addressPoint.clearLayers();\n addressPoint\n .addData({\n \"type\": \"FeatureCollection\",\n \"features\": [{\n \"type\": \"Feature\",\n \"properties\": {\n \"name\": datum.name\n },\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [datum.lng, datum.lat]\n }\n }]\n })\n //.bindPopup(\"<h4>\" + datum.name + \"</h4><p>\" + datum.lng + \", \" + datum.lat + '</p><p><button id=\"networkTrace\" type=\"button\" class=\"btn btn-default btn-lg btn-block\">Flush! <i class=\"fa fa-caret-square-o-down\"></i></button>')\n .bindPopup(\"<h4>\" + datum.name + \"</h4><p>\" + datum.lng + \", \" + datum.lat + '</p>')\n .openPopup();\n // from that point, automatically find the nearest sewer structure\n findNearestStructure(latlng);\n });\n\n $(\".twitter-typeahead\").css(\"position\", \"static\");\n $(\".twitter-typeahead\").css(\"display\", \"block\");\n\n /**\n * reset the address search box, remove the geocoded address point, and\n * close the pop-up.\n */\n function resetAddressSearch() {\n $('.searchbox').val('');\n addressPoint.clearLayers();\n addressPoint.closePopup();\n }\n\n /**\n * given the features array from a geojson feature collection, and a property,\n * get a \"set\" (unique values) of values stored in that property\n */\n function geojson_set(array, property) {\n var unique = [];\n $.each(array, function(i, e) {\n var p = e.properties[property];\n if ($.inArray(p, unique) == -1) {\n if (p !== undefined) {\n unique.push(e.properties[property]);\n }\n }\n });\n return unique;\n }\n\n /**---------------------------------------------------------------------------\n * DOCUMENT INITIALIZATION\n */\n\n messageControl.init(map);\n\n // enable popovers\n // $('.legend-popovers').popover();\n // $('.result-popovers').popover();\n $(function () {\n $('[data-toggle=\"popover\"]').popover()\n })\n\n}", "function createMap(){\n\t//create the map and zoom in order to grab the entire US\n\tvar map = L.map('mapid',{\n\t\tmaxZoom: 7,\n\t\tminZoom:4,\n\t\t//maxBounds: bounds\n\t}).setView([38,-102],5);\n\n\tvar CartoDB_Positron = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', {\n attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors &copy; <a href=\"https://carto.com/attributions\">CARTO</a>',\n subdomains: 'abcd',\n\tminZoom: 0,\n\tmaxZoom: 20,\n}).addTo(map);\n\n\t//unique basemap by stamen, also adding zillow data info \n// \tvar Stamen_Toner = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}', {\n// \tattribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors',\n// \tsubdomains: 'abcd',\n// \tminZoom: 0,\n// \tmaxZoom: 20,\n// \text: 'png'\n// }).addTo(map);\n\n getData(map);\n}", "function fitBoundaries() {\n if (0 < cfg.boundaries.length) {\n cfg.map.fitBounds(cfg.boundaries);\n }\n }", "function buildLayerMap(){\n // OpenStreetMap\n let osm = L.tileLayer(\"http://{s}.tile.osm.org/{z}/{x}/{y}.png\", {\n attribution:\n '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n });\n\n // Sentinel Hub WMS service\n // tiles generated using EPSG:3857 projection - Leaflet takes care of that\n let baseUrl =\n \"https://services.sentinel-hub.com/ogc/wms/ca37eeb6-0a1f-4d1b-8751-4f382f63a325\";\n let sentinelHub = L.tileLayer.wms(baseUrl, {\n tileSize: 512,\n attribution:\n '&copy; <a href=\"http://www.sentinel-hub.com/\" target=\"_blank\">Sentinel Hub</a>',\n urlProcessingApi:\n \"https://services.sentinel-hub.com/ogc/wms/aeafc74a-c894-440b-a85b-964c7b26e471\",\n maxcc: 0,\n minZoom: 6,\n maxZoom: 16,\n preset: \"CUSTOM\",\n evalscript: \"cmV0dXJuIFtCMDEqMi41LEIwMSoyLjUsQjA0KjIuNV0=\",\n evalsource: \"S2\",\n PREVIEW: 3,\n layers: \"NDVI\",\n time: \"2020-05-01/2020-11-07\"\n });\n let agriHub = L.tileLayer.wms(baseUrl, {\n tileSize: 512,\n attribution: '&copy; <a href=\"http://www.sentinel-hub.com/\" target=\"_blank\">Sentinel Hub</a>',\n urlProcessingApi:\"https://services.sentinel-hub.com/ogc/wms/aeafc74a-c894-440b-a85b-964c7b26e471\", \n maxcc:20, \n minZoom:6, \n maxZoom:16, \n preset:\"AGRICULTURE\", \n layers:\"AGRICULTURE\", \n time:\"2020-05-01/2020-11-07\", \n \n });\n\n layerMap.default = osm;\n layerMap.one = sentinelHub;\n layerMap.two = agriHub;\n}", "function addOverlay() {\n logger('function addOverlay is called');\n NEWLayer.prototype = new gmap.OverlayView();\n function NEWLayer() {\n this.div = null;\n this.startcenter = null;\n this.setMap(map);\n }\n\n NEWLayer.prototype.onAdd = function () {\n var self = this;\n self.startcenter = this.getProjection().fromLatLngToDivPixel(map.getCenter());\n var wrapper = document.createElement('div');\n var menu = document.createElement('menu');\n $(menu).addClass('menu');\n $(menu).append('i am menu');\n var div = document.createElement('div');\n $(div).addClass('searchbar sidebar right');\n $(div).attr('id', 'searchbar');\n $(div).append('<div class=\"searchlist\" data-bind=\"component: \\'searchlist\\'\"></div>');\n $(div).append('<div class=\"pager\" data-bind=\"component: \\'pager\\'\"></div>');\n $(div).append('<div class=\"wikirelevant\"></div>');\n $(wrapper).append($(menu)).append($(div));\n self.div = $(wrapper)[0];\n var searchlist = container.getInstance('searchlist');\n ko.applyBindings(searchlist.viewModel, self.div);\n self.getPanes().overlayMouseTarget.appendChild(self.div);\n\n var isidebar = sidebar('menu',$('.menu')).sidebar('bar', $('.sidebar')).sidebar('icon', '<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAgAElEQVR4Xu2dCdh2VVnv/2kKaB4k6ZwyE8Ep9Zho5VCe0GNXWqI4DzkgqTkLOA85K2pWQll5mnDCjBAEw1lQsMkhxRxKU8RSM0XUTFIczvWHveH5vu9932c/e++1133v/VvX9V7vB+/ea/it9Tz7v9e6hx8QBQIQgAAEIACBxRH4gcWNmAFDAAIQgAAEICAEAItg7gSuJemAkQb57pHqoRoIQAAC1QkgAKpPAR3YkMDBkvaV5N9Xbe71Q94/Lv5//lvp8lVJH1pp5F0r//b/99/Pk/SZ0h2hfghAAAJ9CCAA+lDjnpIEdn/Atw/61Qd+yfZL1N0Kgt1/n9MIhRJtUicEIACBHQkgAFggtQj4Tf0mkm7TvL37Dd7/XlppdxK8g+DdAouC1Z2FpfFgvBCAwEQEEAATgV54M364H9I86P2Qz/w2P9VUWgT4x6LA4gD7g6nI0w4EFkIAAbCQiZ54mH7A+4HfPuzb8/mJuzG75iwELApaQeDdAwoEIACBXgQQAL2wcdNuBNqHvR/4S9zGr7Ug2t2BVhBgcFhrJmgXAgkJIAASTlqALvuN/rDmYX+XAP2hC5cQsAB4Q7NDcCpQIAABCOxEAAHA+uhKYPWBz5Z+V2p1r1sVA+wO1J0LWodAOAIIgHBTEqZDttL3Q99v+Lzlh5mW3h1pdwdeiZdBb4bcCIFZEUAAzGo6Bw+Gh/5ghCkqQAykmCY6CYGyBBAAZflmqJ2HfoZZKtdHxEA5ttQMgdAEEAChp6do57y9/yC294syzla5xcArJPmYAJuBbLNHfyGwIQEEwIbAkl9u473Dmwc/hnzJJ7Nw921A6B+LAQoEIDBDAgiAGU7qFkPyQx9jvmXM9dijdLAh7wocx67A2GipDwJ1CSAA6vIv2brf8I9s3vbbrHkl26Pu+RNwwKH2iGD+o2WEEJg5AQTA/CbYkfj84Md1b35zG2VE3hU4ttkVIBxxlFmhHxDYkAACYENggS9vz/YJxRt4kmbWNT/8bSfwHI4HZjazDGcRBBAAuafZW/t+8B/VZNrLPRp6n5lAezTgYwIKBCCQgAACIMEkbdFFP/i9ze8HP+f7Oedwrr22APDxALkI5jrDjGs2BBAAuaaSB3+u+Vpyb522+OgmMdGSOTB2CIQlgAAIOzW7dIwHf455opd7EvCOgG0EOBpgdUAgGAEEQLAJ2a07PPhjzw+9604AIdCdFVdCYBICCIBJMG/cCA/+jZFxQxICCIEkE0U3508AARBvjm3VbyMqjPvizQ09Go+A3QdtI0DOgfGYUhMENiKAANgIV9GL7b//LEn48RfFTOXBCDybgELBZoTuLIYAAqD+VDtkrx/8zsxHgcASCTigkF1aSTy0xNlnzNUIIACqob94ix9f/nr8aTkeAewD4s0JPZoxAQRAncl1nP6XEr2vDnxaDU/AUQUJLxx+muhgdgIIgGln0Nv9x3POPy10WktJwMcCrX1AygHQaQhEJ4AAmG6GvN3vLzSs+6djTkv5CfhY4Ai8BfJPJCOIRwABUH5ODm62+7HuL8+aFuZLwOLZxwIUCEBgJAIIgJFAblONrfv9xUWZjsA5ktoc9fYx38rP3H93rPrtindpLNy2KqtCztfsO93QFt+S58y7ATvN3eIhAQACXQkgALqS2uw6PyR81u8zf8p4BNqHux8A7UPcvyPEmfdcr/5YHLRCApEw3hpwTQ6U5d2AVuiNWzu1QWAhBBAA4080b/3Dmb67eXP3g779yf5lb0FggeDfFoj+9wHDUS22BnYDFjv1DHwsAgiAsUhe8oV+yg5bx+O1NJ+avtY84P0G3z7olxYa1mKgFQf+903mM72TjATbgEkw08gcCSAAxplVR/GzXz8W/jvzPK/ZrvfDvn3ojzMD86mlPTawGPDPIfMZWrGR4ClQDC0Vz5kAAmDY7PrL2mf9DuxD2ZNA+8B34hc/9Jf2dj/Wmmh3CbzOEARbU/URkQ0EvdYoEIBABwIIgA6QtrkEQ7+twfj83l/CvOH3X1s73WnR6bVnMeDf2BHsSstRBJ1lMLvNSJnVQ60QWCGAAOi3HDD0u4ybz/H9wG8f+nzx9ltTfe9qjQp9DIX9wCUUMRDsu5q4b1EEEACbTTdb/pfwWn3os+W62RoqebUNUb0zgBi4ZAfAOwHeEaBAAAJbEEAAdF8WftOylf9Sfft56HdfKxGuRAxcMguOGWAhQIEABHYjgADotiSWbOXvM32/RfEm1W2tRLzKYuCoZmdgiUGJbI9yV+wCIi5N+lSTAAJgPX279/nLc0nFb/t+4PvtCcv9ec28xayPCQ6b17DWjsZHArcljPBaTlywIAIIgO0n2+f9Zy4ssM+pzYOfc/35fwl4V8BiwD9L8iSwqyC7WfNf34ywAwEEwNaQfN7vh/8SAvu0Z/uOqMbbfocPzQwvsQjwLtdSvAgsACwEKBBYNAEEwJ7Tb99qG/vN/eHvB7+3+P2D696ivwYuHbzXvoXAEo4HvMtlEcDaZ+0vlgACYNep95uQI/vNuTg6n9/22Qad8ywPG5uPB7xGDh9WTfi7HS/AdgGIgPBTRQdLEEAAXEZ17sZ+TqXrL3XO90t8kuZZp3fBvCPgn7l6D/jYyx4CFgMUCCyKAALgkun2W7/f/udYeOOf46xOOyYLAR8VzXVHwDsAFgF2F6RAYDEEli4A5mzpz4N/MR/jyQY696MBPAQmW0o0FIHAkgXAXB/+PPgjfLLm3Yc5CwFEwLzXLqNbIbBUAeAvMFv6291vLqW16vc5PwUCUxDw58dHA3NLUUz44ClWD21UJ7BEATBHH/9XNoZaS7VmXl3HPyjphyX594GSfqgJdPM/Jfm6y0u6pqQrrnz6vt9Ygn9M0t9gELbx95IjC/qhOaeAQsQK2HgZcEM2AksTAHN7+DtOvy20l2LBfDlJ12se3leQ9L+b5Ez7S7qxpOs0D3yv6+9J8vX+7Wuv3PHD+S1JFlQvkPTZjvdw2SUEvPs0J48BRAAre9YEliQA5vTwX8o5vx/qN5B0o+Zt/mrN2/0tmrf5kh9Ou4fdU9L7SzYyw7rn5jGACJjhImVIlxBYigCY08P/uOZNa07b/VeR5If7QZJuJun/Srp58yH1Vr3/XqNYBLgv59ZoPHmbjiroh+ccjgUQAckXI93fmsASBMBcHv5+63esgrn4KvvB8AuSfrrZ1v9ZSd7Kj1b+TNKDo3UqSX/aQELPStLfnbrpz52jBlIgMBsCcxcAc3n4P6d568+68PwG7zf560s6tBEyNrzbR9J+wQf1nWY34oPB+xm5e/4c+i06e7IhdgIirzL6tjGBOQuAOTz8sxv5+e3ehnl3lnQ7Sf9r4xUa44anSHpxjK6k7sUcjAQRAamXIJ1fJTBXATCHh3/Gt/69m218u4X5uOJHGpe77J86vvTHm8E57AawHsZbD9RUkcAcBUD2h7/P+v0AzeTa91ONO94Dm77b135O5WRJd5/TgAKMxbsBmW0DEAEBFhFdGEZgbgLARke22PbvjCVTQB/71t9a0q9J+vnGTS8j8y59fomkJ3W5kGs2IpDdUwARsNF0c3E0AnMSAJlj+zuMr7fMo6fqdXQ9G/LdvsmeZgEw92IjwIc0wYHmPtYa4/Pn1g/Sw2o0PkKb5A4YASJV1CEwFwGQ+eFvQz8//O1zHrV4nfySpEdKulVzth+1r2P369NNxMELx66Y+nYh4M+Awwnvm5ALIiDhpNHl+QQCOlOStxOzFQf1cejUqMUx9e/Y+MH7bX9uZ/tduPuI4/guF3LNYAK23/EuWMbgQXdNsIM3eIKoYF4E5rAD4C9nvz1kKt7y94PfW58RiyPy3UvS3STdtEmsE7Gfpfv0/yTZBXBOURdLMxtaf9YjAa8RBwrKZLw7dK64PzmB7ALAD9GXJpuDcxrBEvGL4uqSHtBYZztIz1LLlyS9WtLTJDk5EGV6Ahm9BCwCnIESwTj9eqHFHgQyCwC/9Wfbmj21efhH+4Jwhj3ztCHWDXuso2y3OAphW1Y/A5+X9NZmZ+asbIOaYX/tDutdskx2ARb23gmI9hmf4fJgSEMJZBUAPivMFpo1YmCfH5VkAya/6f7Q0MVU+f6vS/qPJv2vH/DflPQvzRexYyv4//nHX9AXrfTV/88GmP/VvO3/tyQM/ipP5krz12rO1jOFESZvQJz1Q092IJBRAGQM9BPNStg+/A+T9LiE/vt+YH9O0t9I+qKkT0o6X9IFzW8fsbBtP6+vPdsF+KGaSQQQI2Bea3CWo8kmALK5+9nYz9uYUTL4+Vz/FyV5N+Lakv5H4FX9leZN/QuS3ivJD/Z/kORtevvmWwj4b5TlEPBD9fBEwz26cW1M1GW6uiQC2QTAKc0DNcMcRQvpe0tJT20S80TlZ5/7jzTb9P8kyTES/MCnQKAlkM040PYAUV4AWEUQ2IVAJgGQ6YPvt1XHJYhgCLSXpN9s3Pp85h+pfEPSByS9UdLZkr7cPPB9Dk+BwHYEMhkA4xnAOg5LIIsA8Da63/4zlCiW/vtL+hVJT2wi2UVhZ+PNf5V0uqS/k/ThKB2jH6kIWGA7aFAGDwEbnjqeBgUCoQhkEAC2AvZDI0OCHyfzqR2UyHPq8/3fk3SHAKvN5/U+q3+dJLvWfUySt/opEBhKwAbB3l7PIAIwChw629w/OoHoAiCT0V+Eh39r3f/8AF+KPsP/hKTXSDqpMdobfQFT4eIJZBIB0byBFr94lg4gugDIEuY3wsP/5pJeIMnGfrV8+v22b8O9V0n628ZFb+mfMcZfnkAWEUC44PJrgRY2IBBZAGQJ81v74X+1Jnzv4yVdY4O5H/NSB9w5UdJrJX28CcYzZv3UBYF1BLKIAAedsj1ABAPhdUz5+8wJRBUAWYL91I7u5xC+L5LkTGQ1irf5f1/SmyV9qkYHaBMCKwSyBAyy8WKtzywLBgKXEogqAGz0ZxEQudRM5bu3pJ+RdJqk/SaG5EQ5NuRz7vY3Sfpu8zNxN2gOAlsSsAiw1X30lMLYA7CAqxOIKAD8YDmyOpmdO1Bz299+/X7rdyjfKTP2+UHvDHk+3z8z+PzQvWUTyHAc4CMAHwX4SIACgSoEogkA+/ZGf7jUfPg7dO/bJN1Y0pUmWjGOsW9/fdsYnCuJID0TgaeZQQQyiADiAwyaYm4eSiCSAPDWnR8wkf39az787ynpWZJuNHTSO97vN34fMbxM0hkd7+EyCEQikEEE1LYjijRf9GViApEEQPQ4/7Ue/j7v99u3I/pNEfDEaXH/UdLTJb1P0n9OvCZpDgJjEsggAsgXMOaMU1dnAlEEQHSXP/u2+3hi6mK3Pr/1P2Sihp1178WSTp6oPZqBwBQELAJsWBy14BoYdWZm3q8IAiB6qN9aiX2uK8m7DreaYA36rf+Fkl4u6fwJ2qMJCExNIHoCoVo7jFPPA+0FIhBBANjor8bbdZdp+Frjjji1pe7/keTY4Qd16eTAaxzA5xhJFjoUCMyZQPSMohwFzHn1BRxbbQEQWZX74W9hYkvdqcrlJDnzoRP5XL1go9+T5CA+z5P0dt76C5Km6mgELKwPj9appj8cBQSdmLl2q6YAiG7170hdjtg1VbmiJAcHcRwEG/6VKt+Q9CeSnibpwlKNUC8EAhNwBsFDgvavZoCxoEjoVikCNQVAZKv/qaN0+eH/OEnPleSMfqWKE/TYm8B+/Xbzo0BgiQSihwx2gKApdx6XuAYYs6RaAsDb3BYAEcvUxjhXbrL4PbLww/93mwiCX4gInT5BYGICNj72Q3YK19pNh0aAoE2JcX0vAjUEgNW3XXL8AYxWbAg3ZQ4Ch/X1g/nBki5fCMZHJP22pNfj01+IMNVmJRA58igBgrKuqkT9riEAosb6t9GfRclUaTod1vclkh5Y6Mzf4/CWv48WbPBHgQAE9iQQNQYJuQJYrcUJTC0AIgfkmPLczW/+FkK/LsmW/2MXG/rZyO8POOsfGy31zZCAjX0PCzguGyvaNZACgSIEphYAUX3+j24eyEUg71ap3/wddMdv/j9UoMEvNl9mPmb5doH6qRICcyMQ2SiQ2ABzW22BxjOlAIjq8z+l0Z+t/X0eb4O/Em/+ZzVhgz8ZaI3RFQhkIBA1Z4BjAxyYASB9zEdgKgEQ1fBvyjC/ftv/rebNf58CS8W+/b8hyTsAFAhAYHMCUb2TMAjcfC65owOBqQRAxBCcU0b6s2+/H/6PLvDm7wf+iyT9vqSLOsw5l0AAAtsTiBgp0AaB3gWYykCZ9bEQAlMIgKjJfqY697fBny2NHeTHRwBjlvMkPVzSW8aslLogsGAC3q20H/4BwRhMeVQZbOh0pxSBKQRAREU9VXpfn/P7AW2L/7Ej/P2DpCdJemepxUG9EFgogajeSlN6Ki106pc17NICIGKgjan8/dvEPq+V5F2AMcv7m+BBHx6zUuqCAAQuJRDx2BK3QBboqARKC4CIbn9TJflxSt83FXD1e2tzpEBwn1E/ClQGgT0IREwahFsgC3U0AiUFQMS3/6kybd1Q0l8VcN/xWf+vSSKe/2gfASqCwLYEIuYLwC2QBTsagZICINrbvw3mfLZX2pLW1rqvkfRzo82S9PXG0M85AxzljwIBCExDIGKo4KmzlU5DmlYmJ1BKAEQM+jPF1tnekl7WnM+POZl/Kumhkr4/ZqXUBQEIdCIQ7SiAXYBO08ZF6wiUEgDnBsv2d6okB/koXRyw45kjN3KSpPtL+tbI9VIdBCDQjUDEowB2AbrNHVftQKCEAIj29j+V1b8f0k7tu9+IK+50SQ+T9LkR66QqCEBgcwLRvALYBdh8DrljNwIlBEC0t/8prP5t9PeXkvx7rPJmSfeQ9M2xKqQeCEBgEAEHCLrJoBrGvZldgHF5Lq62sQVAtLf/KQL+2MffZ4S3HHH12IPAb/6fH7FOqoIABIYRiBYgiF2AYfO5+LvHFgCR3v699e8PrD8kpYqT+rygycB3lZEasZ//vSW5/xQIQCAWgWhHAewCxFofqXozpgCI9vY/RQate0p6lSRb/49RHN7XH2gi/I1BkzogMD4B5wrwS8W+41fdq0Z2AXph4yYTGFMARPL7n8Ln//qS/nZEoz/32Q9/c6RAAAJxCUR72ZnCzinubNCz3gTGEgDRov6V3hazpf8fNUZ6veGv3OiUvk9oAgiNUR91QAACZQlEMggkR0DZuZ5t7WMJgDdIOiwIpSkM/x4ryWGFxyqPl/Q7Y1VGPRCAQHEC0V56pgh0VhwqDUxLYAwB4CAZNv6LUkqnzLy5pNdLusZIA/ZOwqMlXTRSfVQDAQhMQyDSi88rJfloggKBzgTGEACvkHR45xbLXlj6Q3CFJsnPL400jJMlPVKSjwAoEIBALgLRXn6ch6Sk11Ou2aG3awkMFQC2iL1gbSvTXDCF29+jJL1Y0pVHGJIf+k4Y9OkR6qIKCECgDoFIboGlX4DqEKbVYgSGCoBIi7+0298NGqv/Mdx/nNHvFyR9sNjMUjEEIDAFgUhugc506l2A0hlPp+BKGxMQGCoA/PbvD0DtUjre//6Sjpd06AgDdV9f0vx8e4T6qAICEKhLINKL0NGSjq2Lg9azEBgiAJxd75QgAy399v+rkk4YaaxnSLq9pO+MVB/VQAACdQlE2gUgMFDdtZCq9SECIIoFbOm3f4f4dcCfG40ws/Ydvo+kfx6hLqqAAATiEIi0C4BLYJx1EbonfQVAJOvX0m//9ve33//Q8qXG3e/EoRVxPwQgEI5ApF0AjAHDLY+YHeorAKKo3dJv/079eZqka44wfT6X8/kcBQIQmCeBKN+LputopRgDznOdjTaqvgIgSta/0m//Din8ZyPQ9hHCnSSdP0JdVAEBCMQkEGkXAGPAmGskVK/6CIAoxn+l3/49Ufb5f9LAGbPLn70HHKKYAgEIzJtAlF0A2xs5KioFAtsS6CMAohj/TXHONYYAcKhfBxDC6p8PIgTmTyBScLTSYdHnP5szH+GmAiCS8d8UYS/tr+8sfX3LvzQBf77QtwLugwAE0hGIEh59ipekdJNDhy8jsKkAOErSSwMAnGphO8eBP8x9i5NzuK8UCEBgOQSivCjZCNDGgBQIbElgUwHg0LUHB2A5lZ+rt9DsBdAn899Jkh4h6csBeNEFCEBgWgLvknTItE1u2dpdJfnYlgKBPQhsIgCiqFob0zkX91TF7ntHbtiYDf9uKemjG97H5RCAwDwI+DvqzABDmWq3NMBQ6cKmBDYRAFG2/+2aN2RbflNGP9KEPP75jjc6vv8dJb2j4/VcBgEIzJOALfEdS6Rm4RigJv3gbW8iACJs/9v1r0byoatLerukn5R0uR3m9CuSnizptZK+GXzu6R4EIFCWgG2AnESsduEYoPYMBG2/qwCIsv3vsLzeiahRbExz3+bn1rt14FPNdt/LJX2gRudoEwIQCEcgikvgqZIcv4UCgV0IdBUAUbb/p3D9W7dEriZp35WtPWff+qKkz6+7kb9DAAKLIxDFJZDQwItbeusH3FUARNj+n9r4bz09roAABCCwM4EoxoBT206xLhIQ6CIAomz/s4ATLCi6CAEI7EHAu4QHVObCMUDlCYjYfBcBEGH7v5bxX8Q5o08QgEAuAhG+Q02sy/d9LrL0dhCBLgsiQkCLmsZ/gwBzMwQgsHgCUYwB8QZY/FLcFcA6ARBl4ZLUgoULAQhkJhAhiRovUplXUIG+rxMAEVL/nifJdggUCEAAAlkJRIgJYFsEe1JRIHAxgXUCIIILC6qVxQoBCGQnEGU3NYIrdfa5nE3/1wmAcwO8fbP9P5vlxkAgsGgCEY4B8KZa9BLcdfA7CQBn/bP/f83C9n9N+rQNAQiMSSDCMQDugGPOaPK6dhIAEVxX2P5PvsDoPgQgcCmBCMcAJAdiQV5KYCcBEMH9j+1/FisEIDAnAhHsqm4ryd/vlIUT2EkAfL8yG7b/K08AzUMAAqMTiOBZ9RxJzx59ZFSYjsB2AiBC/Gq2/9MtJzoMAQisIRDhGIC8KizTiwlsJwCsDp9VmRFRqypPAM1DAAJFCHxoJZtokQY6VLrOA6xDFVySncB2iyCCuwoLNPvqov8QgMBWBCK8YGEHwNrcdgfgAkneqqpVcFWpRZ52IQCB0gQiuFgfLenY0gOl/tgEtnrLZnHGnjN6BwEI5Cdgd7x9Kw6Dl6yK8KM0vZUAiBCsgnCVUVYI/YAABEoQqO0OSDyAErOarM6tBEDthYn7X7JFRHchAIGNCfCitTEybhibwFYCoHb8/1dK8oeDAgEIQGCuBCK4A5IXYK6rq+O4dhcALMqO4LgMAhCAwEACTs97wMA6htzOy9YQejO4d3cBECEAUOnz//0kHS7p/0jaW5IjHn5X0kck+QPxiRnMK0OAAATiE6h93EpAoPhrpGgPdxcAtRMAfa2g++HlJN1Pkt1fnGNgq/Lvkvyh/G1JXy5KnsohAIGlE4hgB0C8lQWvwt0nv7YiLeWa4nG+UNLjJF2hw3y/TpLF0Bc7XMslEIAABPoQiOByXXrHtQ8X7pmIwO4CoHYGwFLBKe4s6URJe23A9XclvUDSf2xwD5dCAAIQ2IRA7XgAhFzfZLZmdu3uAqB2BsAS4SmvKMmeDVfvMXc/K+n9Pe7jFghAAAJdCNQOu05mwC6zNNNrVgVAhO2oEudR95X0Z43B36bT6CMRu8pQIAABCJQgUDsvQKlj1xKsqHNkAqsP3Np5qktZpL5c0sN6cvsHSb8oybkRKBCAAATGJlDb88quiLYDoCyQwKoAqK1ES/ik2uDvHEk36Dm3NgI8TNLf97yf2yAAAQjsRCBC7JUSO6/MegICqxNf+yyqhAHgQZL+qaPl/1bT5fN/7x54J4ACAQhAoASB2oaAJWyvSnCizpEJrAqAD0qyHUCtUmIR/pqkPx0woPdJuvmA+7kVAhCAwDoCtb2vCAm8boZm+vdVAVDbA8AR+qyExyx25XvMgApPknTPAfdzKwQgAIF1BI6VdOS6iwr+HU+AgnAjV90KgNrnUCUiAF5Z0gnNGX7fOXhCExWw7/3cBwEIQGAdgdoRAUvYX60bM38PQKAVALUtUUt4AFjU2P/fv/uWG0n6WN+buQ8CEIBABwJz/P7tMGwuqU2gFQC1XQBLbEHdQtLfDQB8niR/MO0mQ4EABCBQkkDNI1hcAUvObOC6WwFQ2wWwhAfA4yX91gD2b5d0B0nfG1AHt0IAAhDoQqB2amBcAbvM0syuaSe9thFKCQ+AP5H04AHz9RJJTxpwP7dCAAIQ6EqgticASYG6ztSMrmsFQO3F5/S8HxqZ61sl/dKAOh8o6dUD7udWCEAAAl0J1M7EWuIlrOvYua4SgVYA2FjuWpX64GbH3n46QNKfS7rVgDHtL+n8AfdzKwQgAIGuBGofwxILoOtMzei69sFb0wClhAugIwB+asA8fUDS7REAAwhyKwQgsAmB2q6AJQyxNxk/11YgEEEAlHABvJ2kdwzgebKkuw+4n1shAAEIbEKgtisgAmCT2ZrJtRYAtdMAlwhC4QA+NuLrW142MIJg33a5DwIQWCYBH8H6KLZWKfEiVmsstNuRgAXAHJXnH0p6eEcGW13msJwOI0yBAAQgMBWBmkexCICpZjlQO3MVAG+S9Ms9OX9H0gMkva7n/dwGAQhAoA+BmlkBEQB9Ziz5PRYAtY1PSrif/LWkn+s5NxdJcgjgT/a8n9sgAAEI9CFQ0x3b4sMJ2SgLImABUNv9pIQAOFvSrXvOowWAPwj/1fN+boMABCDQh0BNAeD+ju2O3YcB90xIYI4CwEGFXi7p5j05/ruka0v6Zs/7uQ0CEIBAHwIIgD7UuKc3AQuA2mGA/bbt7aexys9Ieo+kvXpW+HFJPy3pwp73cxsEIACBPgRq78YSDrjPrCW+xwJgbqrzlpL+dsCcOAnQ3SR9Y0Ad3AoBCEBgUwK1BUCJ49hNGXD9hATmKAB89m8bgL7leEkPIQtgX3zcBwEI9CSAAL9hMFoAACAASURBVOgJjtv6EagtAM4rkIPAZ/9/3w/HxXcdJ+moAfdzKwQgAIE+BObokdWHA/dMRKC2ACjhe3pIc6zRFyECoC857oMABIYQqB2UjSOAIbOX8F4EwJ6ThgBIuJDpMgRmQAABMINJzDQEBAACINN6pa8QmDOB2gLg6MYrbM6MGdsKAQuACyRdtRKVEkcAvyDJ9fYtz5f0jL43cx8EIACBngRqCwAyAvacuKy3WQDMLQHFUCPAJ0v6zawTSr8hAIG0BBAAaacuZ8fnKABuIunVkm7cY0q+JenBkk7ocS+3QAACEBhCAAEwhB73bkxgjgLAED4g6WYb07gk+M+PEQSoBzlugQAEhhJAAAwlyP0bEZirALizpFM3InHJxQ6LbEMYCgQgAIGpCRws6YNTN7rSHjYAFeHXaHquAmB/SS9sIvp15fo+SUdI+mjXG7gOAhCAwMgEatpkIQBGnszo1c1VAJj7j0t6saT7dZiEv5P0BEl/3eFaLoEABCBQggBHACWoUue2BOYsADxouzd6S98hNq+5BYWLJJ3YCIV/ZJ1AAAIQqEgAAVAR/hKbnrsAaOf0RyTZLsAeAteS9EVJ/9w8/L8gyUKAAgEIQKAmAQRATfoLbHspAmCBU8uQIQCBZAQQAMkmLHt3LQA+I+mASgMpEQmw0lBoFgIQgMAgAgiAQfi4eVMCc8wFsCkDrocABCAQgUBtAWAvqFdEAEEfpiGAAJiGM61AAAIQWEegtgAgHfC6GZrZ3xEAM5tQhgMBCKQlgABIO3U5O15bAHxV0n450dFrCEAAAqMSsLvy8aPWuFll7ABsxiv91bUFgAG6DxQIQAACSyfwbEnPqggBAVARfo2mEQA1qNMmBCAAgT0JIABYFZMSsACovegObFwRJx04jUEAAhAIRsDJyI6s2Ccfx/pYlrIQAhEEANtOC1lsDBMCENiRwLskHVKREcexFeHXaBoBUIM6bUIAAhDYkwACgFUxKQELgLtIOmXSVndt7K6S3lCxfZqGAAQgEIFATQFwXpMnJQIH+jARAQuA2r6n5KCeaLJpBgIQCE3g+xV7R1j2ivBrNY0AqEWediEAAQjsSgABwIqYlIAFgNPjnjtpq7s2dmpzDFGxCzQNAQhAoCqBgyV9sGIP+B6uCL9W063VJ8qz1gzQLgQgAAGOYlkDFQhEEACEA64w8TQJAQiEInCUpJdW7BG2WBXh12q6FQAfknSTWp0gHHBF8jQNAQhEIFA7IBveWBFWwcR9aAVATfcTD5lgQBNPPM1BAAKhCNgV+rCKPeI7uCL8Wk23AqB2CEoWX60VQLsQgEAEArVfwggDHGEVTNyHVgDU3n7i/Gniiac5CEAgFIELJF21Yo8IA1wRfq2m20mvHQzoOEk2gqFAAAIQWBoBP/gtAGqVcyTZDZGyMAJRBABRqBa28BguBCBwKYHaL2B8/y50Ma5u+9SMBYAr4EIXIMOGAAQu3v2s6QLIDuxCF2EUAWD8B0r6zELngWFDAALLJVDbCBsbrIWuvVUBUNsKFU+AhS5Chg2BhROo/d1LDICFLsBVAVDbDxUVutBFyLAhsHACNY9fjf6mkhwMjrIwAqsCoLYrIMkoFrb4GC4EIFA9GZunABfAhS7E1YmvbYlqBWolSoEABCCwFAJ3kXRKxcHiAlgRfu2mVwVA7bTAKNHaq4H2IQCBqQnU3nl9paQHTT1o2otBYPetH7vj7VuxaxgCVoRP0xCAwOQEahsAYns1+ZTHaXB3AcBijDM39AQCEJg/gdoGgLx0zX+NbTvC3QVAbX9UIlIteDEydAgsjIDD736w8piJv1J5Amo2v7sAqB2RioiANVcDbUMAAlMSqP19+7XKCYimZE1bWxDYXQDU9gRwF/FJZalCAAJLIFA79go7rktYZTuMcSv/z9pnUkdL8lEEBQIQgMCcCdROAUwOgDmvrg5j20oA2B//Jh3uLXUJAYFKkaVeCEAgCoEIbteEAI6yGir1YysBUNsQEDuASouBZiEAgckI2Pf++Mla27ohDAArT0Dt5rcSABEWJnYAtVcG7UMAAiUJ1D7/P0+6OAwxZcEEthIAEbamCE6x4EXJ0CGwAAK1z/+JALiARbZuiNslgfiMpAPW3Vzw7+QFKAiXqiEAgaoEInhbYWxddQnEaHw7AfAKSYdX7uJ+kmwPQIEABCAwJwK17azMkmPWOa2onmPZTgDUDlDh4RwhyUKEAgEIQGBOBBz9z1EAaxUCANUiH6zd7QRAhBCVnFEFWyx0BwIQGEwggo0VAYAGT+M8KthOAHh0tTMD4g44jzXGKCAAgcsIRPCywsiaFXkxgZ0EQG03FfePTFUsVAhAYE4EInyvcv4/pxU1YCw7CYAISpVjgAGTy60QgEAoAleVZPe/moXz/5r0g7W9kwCIcFbFMUCwBUN3IACB3gR4qeqNjhtLENhJALi92nkB3AfiVZeYeeqEAASmJhBh+x/vqqlnPXB76wRABH9VjgECLyC6BgEIdCIQYUfVHSW+SqfpWsZF6wRAhIhVHAMsYy0ySgjMmUCE2CrnVI4/MOf5TTm2dQLAg6rtDsgxQMqlRachAIEVArWD/7gruP+xJHch0EUARDi34hiAhQsBCGQlEGX7H/e/rCuoUL+7CIAIlqucXRVaAFQLAQgUJ/BsSc8q3srODeD+V3kCIjbfRQBEUa9kr4q4gugTBCCwjsC5kvw9WrOwi1qTftC2uwgAdz2CO6BTFB8YlCPdggAEILAVgbtIOiUAGtypA0xCtC50FQARLFjNjjOsaCuI/kAAAjsRiGBDxfY/a3RLAl0FQIQQlh4A21gsZAhAIAuBKMenfG9mWTET97OrAHC3IihZuyT6GMC/KRCAAAQiE4hg/Gc+bP9HXiUV+7aJAIjiDUAoy4oLhqYhAIHOBCIY/7H933m6lnfhJgIgyjEAxoDLW6eMGALZCER5YWL7P9vKmbC/mwiAKMcAbGlNuEBoCgIQ6EUgQuQ/d/y2kt7VawTcNHsCmwqAKKrWC9oLmwIBCEAgGoEIOVTM5LwA8QeizQ39WSGwqQDwMYC34PcNQBFlG2AS6AIEILAHgQgG0+7UcZLswk2BwJYENhUAruQVkg4PwJOzrQCTQBcgAIFdCERx/XOn7DHlFzYKBEYTAAdL8vlWhMICjzAL9AECEGgJRHlBerckH0VQILAtgT47AK7MqvKAAFzZBQgwCXQBAhC4mEAUTyn3BXdpFuVaAn0FQJTQwB4guwBrp5kLIACBCQgcK+nICdpZ1wS+/+sI8feLCfQVAJGULrsALGYIQKA2gUhn/xj/1V4NSdrvKwA8vChnXewCJFlsdBMCMybA9+GMJ3euQxsiAKL4unpu2AWY6wplXBCITyDS2/85kmyoTYHAWgJDBIArj2IMyC7A2qnmAghAoBCBSG//GP8VmuQ5VjtUAESJDMguwBxXJ2OCQHwCkd7+Mf6Lv15C9XCoAIgUGZBdgFBLi85AYBEEIr39P0eSUxBTINCJwFAB4Eai5Lx2X8gR0GnauQgCEBiBQCQ7KL/9ezfiqyOMiyoWQmAMARDJJdDTdldJjsVNgQAEIFCSwJmBou1hCF1ypmda9xgCwGgibYPZMNHBgSgQgAAEShGIZP/kMRIQrdRMz7jesQRAJEMYTxdnYTNetAwNApUJeNfT+VD8vReh8PYfYRYS9mEsAeChR0mB6b74HMyKmPOwhIuSLkMgOIFIdk9GRWr04AsmavfGFACRDGLMG1UcddXRLwjkJRBtt5Osf3nXUvWejykAPBhb4R9SfVSXdeCmkj4UqD90BQIQyE3gFEl3CTQEjJ4DTUa2rowtAKLtAvjhbxFAgQAEIDCUgB/8FgBRCm//UWYiaT/GFgARdwEwCEy6OOk2BAIRsOHfuZL8O0rh7D/KTCTtRwkBEG0XwFODi0zSBUq3IRCEwLGSjgzSF3eDt/9Ak5G1KyUEQMRdACIEZl2h9BsC9QlEfKnh7b/+ukjfg1ICIOIH5mhJVvEUCEAAApsQ8NZ/FJ9/3v43mTmu3ZFAKQEQcReA2AB8GCAAgU0JRPP5d/95+990Frl+SwIlBUDEXQCOAvggQAACXQkc3ET863r9FNdx9j8F5YW0UVIAGGGkHAHtlHIUsJDFzTAhMIBAtHC/7VB4+x8wqdy6K4HSAiBa1Kx29AQI4pMAAQjsROB4SU74E6kQ3TTSbMygL6UFgBFFPEMjQNAMFi9DgEAhAtEC/niYX5PkIwlnO6VAYBQCUwgAb6V50e47So/Hq+Q4SUeNVx01QQACMyDgXUtn+osU8MdYCWg2g8UVbQhTCACPOVru7HYeOE+LtiLpDwTqEjhTkg2YI5Xzmrd/sptGmpUZ9GUqAWBU3na/STBmuAYGmxC6A4GKBCIeVxrH0yUdU5ELTc+UwJQCIKJbYCtMSBg00wXOsCDQkUDU7yd3/9OSXibptZK+2HE8XAaBtQSmFADuzBskHba2V9NfgD3A9MxpEQJRCEQ991/l8z1JH5Z0P0kfiwKOfuQmMLUA8AfNRwHRDAI9i0c0cQtyzyi9hwAENiFgYz+f+9vCPkP5T0mPl/QaSRdm6DB9jEtgagFgElHP2WwPYKNACxQKBCCwDAIR/f27kH+LpEfgFtgFFddsR6CGAHBfIhoEul92V7Q9ANa2fGYgMH8CUb2TupL/rKRfkGQvAQoENiZQSwBEjLHdwrOdwl03JskNEIBAJgKRv4M24WijwNtLOmeTm7gWAiZQSwC47ahHAe6bcxjYJoACAQjMj4Af/j73jxbspy/p8yU9UNKb+lbAfcskUFMA+MPno4ADgqInaVDQiaFbEBhAIJvRX9ehfkPSnSQ54ykFAp0I1BQA7mBk31v3D8+ATsuIiyCQgsBcH/4tfIuAO0o6K8Vs0MnqBGoLAAM4VtKR1Uls3QE8A4JODN2CQA8CzqbnrfI5F4uAX5F09pwHydjGIRBBAERNFtQSRgSMs9aoBQI1CTjY12NrdmDCti0CDpX07gnbpKmEBCIIAGOLfhRgWwXHCMA9MOEip8uLJ5Dd3a/PBDpgkKOu2tiRAoEtCUQRAO5c5KMA9w8RwIcIAvkILPHh387S1yTdW9Jb800bPZ6CQCQB0D5ko2UMXJ0HRMAUq5I2IDAOgYdL+sNxqkpbi3ct74MISDt/RTseTQDYP9duLBFzBbQTgQgouiSpHAKjEHhUk0FvlMqSV+KdAAc34zgg+USO3f1oAsDjO0rSS8ce6Mj1WaTYJoACAQjEI2CbordJukK8rlXrkW0CHCcAw8BqUxCv4YgCwJSipg1enUGiBcZbz/QIAj8v6QxJVwTFHgRwEWRR7EIgqgCI7hrYQkQE8IGCQBwCPy3pPZL2jtOlcD0hWFC4KanXoagCwESiuwa2s+bdCkcMxEWw3jqmZQj4SO50SfuAYi0BwgavRbSMCyILAM9A5IRBqysEw8BlfF4YZUwCS3b16zsjX5d0D0lv71sB9+UnEF0AmHAGewD3ExGQ//PACPIR4OHff87sHWAXwbf0r4I7MxPIIABsD2Cr+8jxAdo1gAjI/Gmg79kI8PAfPmMWAXeX9M7hVVFDNgIZBICZZogPsCoC7HP7mWyLgf5CIBEBJxBz9FDKcAI+DnDYYFIJD2eZqoYsAsBQM6l9Egil+hjQ2WQEjm++D5J1O3R3cREMPT1lOpdJAJhA9HwBq7NkEXC0JLsKUiAAgeEEfBzoh/9dhldFDVsQwEVwYcsimwDw9Hib6pBE82QXQURAogmjqyEJ+OHvULY+DqSUI4AIKMc2XM0ZBUAmo8B2wgkYFG7p06FEBPzQ98Pfn31KeQIOG+xdFkdUpMyYQEYB4Om4VuN2Fzlp0O7LhoBBM/4gMbRiBPwg8rZ/1of/dyT9jaT9Jd2wGKXxK8ZFcHym4WrMKgAMMpNnQDvxdhP0kYB/UyAAgZ0JPKsJBpaR03clvbKxW/qkpKs0n/1jJF0+yYAsAu7VJFZK0mW6uQmBzALA48zkGdDOi40DLQK8I0CBAAT2JJDd2O88SQ+Q9LeSvAPQFj/4nyLpGZL2SjLxdhH0LgyphJNM2CbdzC4AsooA99seDfYSoEAAApcR8M7eKc0xXzYu35P03ubh/y/bdP5ykryz8cREeQtsE3CopLOyTQj93ZnAHASAR2gju8MTTrY9Ghw0iERCCSePLo9OwDt6L0163n+hpNdIOkrSN9eQ8ffu85oXgCuNTrFMhcQJKMO1aq1zEQCZRYAjBvpIgChcVT8KNF6RgLf8/Vbsh2fG4rNyb+u/XNJFHQfg797nSnpCovTFiICOk5vlsjkJADO3cV2GnAFbrQ9nPnxOloVDPyEwEgFv+dvKP6t//39Jeoik1/Xg4e9fC4ffkHSFHvfXuMXHAXfmhaUG+vHbnJsAyBgjYHVWLWDIIzD+OqfGmASyx/P3tv+vDjTotWGgdwHsHWD7gAwF74AMs9Shj3MTAB5ydhFACOEOC5dLUhPwZ9SGfrdJPIovSvoZSf82whh+sLEHeFEyEUAq4REmv2YVcxQAcxABHgOBg2p+Mmi7FIHsgX3M5d+bIwuLgLGKRYB3AmwXkOU4gFTCY81+pXrmKgDmIgKIGVDpg0GzoxPI7tvfAvFD/2aSPj86oUsCBNkewLEC9i5Qf4kqHSfgTrgIlkBbvs45C4BWBNjKPlPI4K1m3bsBjhngsVAgkI2AXXQd9yJrON+Wt63gbyppOx//Meal9Q54nKRMLoJ3RASMMf3T1jF3AWCaGUMGb7UKvBtgT4Hjpl0itAaB3gScs8MW/pnP+tvB/7eke0s6rTeN7je2cQIsAvbpflvVK3ERrIq/X+NLEADtToD97LO6CK7Orsfh3QDyCfRb89w1DQFb+FuwZn/rNy0//O3qd8I06C5uxd/N5ufjgCtO2O6QpiwCHDHw3UMq4d7pCCxFAMxNBHg87W4AUQSn+7zQ0noCftt3NL+sfv27j9CufveXdPL6oY9+hW0CntxEDcziImibALsyk0p49OUwfoVLEgBzFAF++Dt6mrOOUSBQk4C3+/3gt5X/nMoLmgBdXSP8jT12XATHJkp9lxJYmgCYowjwmHwc4GMBwgnz4Z6agLf42+3+qdsu3Z6F9aMleWu7ZrEIsD2AxYj/naEQLCjBLC1RAMxVBHhceAsk+NDNqIu27vdRlN/+51Y+2wT6+VKQgfk44GmSnp4slfBhvJgEWUFbdGOpAqAVAXZNyphFcN2KcnZE5xXAbXAdKf7eh4DP+W3dP8cHv3n43N++/v/UB07Be2wHYMH1+EQugqQSLrgghla9ZAHQssuaSnjd3Ns+wALHboMYCq6jxd+7EPCD31n75uDWt9N4f7MxvuvCZOprSCU8NfEZt4cAuGRybUhnA6Y5FoTAHGd12jEt5cFvqt7yv7Ykv7lGLVlTCRMsKNiKQgBcNiEPat6Ys0cN3G6JIQSCffgSdGdJD/52OhyK18Z20YuPA9xXpxPOYhhIKuFgqwoBsOuEzCVq4E7LzELAxoLYCAT7MAbqju1ivCs2F1/+TdA+QtLLN7mh4rUZUwk7TsC9JL21IjeabgggAPZcCv7Ss13AHKIGrlvoFgK2EcB9cB2p+f/d7nztg3+uxn1dZvE9TXKbLHYzxAnoMqtcsyUBBMDWC8NfhnMJHdxl6XusFj0EFOpCa17X+GFvP34fgc0hbO/Q2fm+pFMbHvZlz1AsAp7YeAhkCRtsto4YeGYGwHPtIwJg55mdq4fAdqO222C7K4AL4Vw/9ZeMy/7ZfujPLXLfGLNmEXCipEdK+soYFU5Qh48DbA/wpEQJhGwT4FTC5A6YYIFs1QQCYD34uRsHbkeAXYH1ayPbFbztbzZj3hGzz/35m91W7WpcBKuhz9kwAqDbvNkuwG/GB3S7fFZX+Sy0PR4gA2G+qfW2fvu2P3f//RKzk1UEkEq4xGqYWZ0IgO4T6i9Si4BDut8yuys5IsgzpWzxjzdXr5H0mEQBtfy97oBNT02USpjjgPHWa+eaEACdUV16oUNx+sO19OLdAO8M2GAKe4EYq8EPfZ/p+weDvnHnxOmAfRwYOUDQ6ohtE2B7gOdLypRK+G6S3jnu1FHbdgQQAP3Whr9g/fCba9CgTalYDHh3xHYDGPRsSq//9e32vrf2eej359jlThsGnibp/gGyA3bpr6/J6iJ4X0lv7jpIrutPAAHQn50NqiwClnwksBU92wxYCFgQWAywO9B/jW11p9db+8BfYqCecWluVtv3JL1R0gMS7QRYBNiQ0TsBWSIG2kXwHpLesdn0cPWmBBAAmxLb83qOBHZm6N0BC4J2dyBLgJXhK2OcGvyQbx/6fvCztT8O1761eCfAxwEPlXRB30omvq9NJex0wntP3Hbf5hwxkFTCfel1vA8B0BHUmsuW7CWwKUELglYUsEOwJ73Vh73XFQ/8TVfYNNe/WtLRiVwEM6YS/oakX5F09jRTurxWEADjzbm/qL0b4KhqlO4EvCPQCgL/Pq/57+415LzS68Xhpv2QX/3JOZpl9jqri6CFy5WSTBkioOBEIQDGh4uB4DhM250C2xD4+MDnghnjELQPetuM+Mfb+LzZj7NGItTyqmYnIEvEQH/nOxGYPQT2igCwQx8sAkgl3AHUppcgADYl1u16f+nbQNBnWJRxCbQ7Brv/ditTi4T24e62/e/2wb76e9zRU1tEAg4bbJsAn1tnKD4OeLqkZyYyDLT7pb9PyR0w4gpDAIwIc4uqvBtw7EIjCJYl26323bMctqKh292XPdRXr2/f5LvWwXXzJ9AmELJ3gN9WMxQbBto74IWJ4gRY4N9H0lsyAM7QRwRA+VnCNqA8Y1qYN4HvSvIDK3IhTsA0s2MRcG9Jb52muXm3ggCYbn599utjgSXmE5iOMi3NjcBxki6U9GRJ0b+vLAIc/+KI5jgqw1w4NoDtARzdNFMqYUcMPCMD4Mh9jP6Bisyub9+IG9CXHPcticA5ko5qDEB9Zv02SbdLAuDPJT06WSph2wM8MVkq4UMlnZVkTYTsJgKgzrQQRbAOd1qNT8BbvLabsVBeLTdu8k4cGH8IF/cQF8HyE4WL4EDGCICBAAfejpHgQIDcPisCfmj6rX+7aJGPkvQ7ibaqfeT3hETBgvw8eG7T5ywRAxEBA74CEAAD4I14q992/MVHcqERoVJVGgKOCOn1vy7Ogw0BHYHPyWKylNdKsnDJEgK7TSXssMFXSALZIsDHASQi23DCEAAbAit4ub0FvPV5eME2qBoCkQg46qMf/Dac61r2keSHqnfPshRSCZefKcdgcAKht5dvaj4tIADizaWDyFgIkGUw3tzQo3EItOf8Xud93oyvIukvJd1+nO4UrwUXweKIL26AOAEbckYAbAhswsvtNuijAYTAhNBpqiiBoQ/+1c7tJ+m9kq5TtMfjVd4GC/IOX5aIgW0q4eclOg4glfAGaxYBsAGsSpciBCqBp9lRCdif34K2zxv/dh35cUnvlHT9UXtarjKLgJMkPSxZKmGHDX5qslTCd8YmYP1CRgCsZxTligc1X6AEEooyI/SjCwFb9vvB76ROJcq1JZ0m6YYlKi9UZ8ZUwk4g9DiyCBZaEZWqRQBUAj+gWYTAAHjcOhmB0g/+1YHcoHmzziQCMroI+ijAIsCGmBkKLoJrZgkBkGEZb91HCwH/YCOQdw7n1nOfv9qiv+Qb/3bMfAxwiiSLgSzFOwFHJjoOIJVwlpXVsZ8IgI6gAl9mGwG7UpF6OPAkzbxrdufzG21fq/6x8FyzsQnIYhjocdub4SGJDAPbVMLOHRA9QVO7rmx0abdRUgnv9klDAIz11VO/HocX9psXcQTqz8VSeuAHv9ecH/5RytWb+PC2DchQMqYStneAjwJIJZxhhe3QRwRA8gncovsOKOQdASILzm9uo4zIEdf84H9XlA7t1o8fk3S2pEwiwIaM95fkc+sMpRUBxyTaCSCVMDsAGT5bo/URO4HRUC6+In95ttv8pSz6x4TsnQBv+V5vzEoL1uWdANswPHhkV8mCXZZFgNM0P0PSXiUbGrFuHwf4uDSqeB1xqOurYgdgPaM5XOHjAe8I+BwMN8I5zOh0Y/Dbvh/8kbb5u47ea/3NyQwDHeb4sYkSCNkmwPYApBLuuioDXYcACDQZE3XFIsA7AxgNTgQ8YTM+27c1v436Mrzt74T4JyW9PlmcgKwugkcTJyDXpx0BkGu+xuytdwVaMXCTMSumrrQETm3e9DdJzpNhsBnjBDiOgg3tvpIBsCRSCSeZqNVuIgASTlqBLnNEUABqkir90PcD3z9jhumNNvyDmuOALDYB5ufjgEc2SW6i8dyqPz4OeKakTKmE/1OSwwYv0iYAAZDhYzVtH52N0EcE2AtMy33K1pby0N+dqXMH2KYhi3eA+2/DwAcm8g5wbADbA7xAkgVBhrLYVMIIgAzLs14fWzHgYEMcE9Sbh6Et24LfbzhLeNNfxwoXwXWEhv/d3gG2B3hRIhHgz8h9m12i4QSS1IAASDJRAbrpYwILAf94d2DfAH2iC9sTOGflob/I7c0dFodFwFnJUglbvHlnLlMq4SdIem6yVMJ3k3TGUr5YEABLmenxx+ndAQsB/7A7MD7fTWtcfcv3Az+79f6m49/0eh8HvEOSvQQyFMcJcNjgRyQyDPRxwG9IegqphGMuMQRAzHnJ1itHH/TOgEWBf5OgqPwM2lXvQ81bvh/4/jdlMwLXlWR7iEwJhF7VeAecv9lQq11tOwBSCVfDv3PDCICgEzODbrXHBa0o4Mhg2KS2W/rtQ583/GE827uzugg+PlGwID9nSCU8znodtRYEwKg4qWwHAhYCtiNoBYH/TVTCrYHZUt0PeP+0b/dzdtGr/cGxa6B3ArIcB5hX1lTCDh18xdoT3rF952U4tPEc6XhLrssQALnma2699dGBBUH7Y1GwpOMDb+OvPuT9b7by66zyazS5AzKlEnaEwyMk2Zc9AnNBiQAAEnBJREFUQ/FxwFObI4FMqYTvOlfDQARAho/N8vrYCoOtfmcyOLRhnh/ofnvf6vfyZjb2iHERLD8/fvD7+CJbKuFZuggiAMoveFoYn0ArDFzz6r/937Y9aIt3Fsa2PfBZfLsd327Tu732Ib/7v8cfPTWWJJBNBHxPklMJO1hQlp2ArKmE7ynp7SUX39R1IwCmJk570QhYJFhEuLRv6dH6SH+mJUAq4fK8vRPg4wC7CZJKuDzvLVtAAFQCT7MQgEBoAgdKOj2Zi+AJko5M5B1gm4BnS3LAoH1Cr4bLOuddljtKOjtJf3fsJgJgDrPIGCAAgRIEMqYSdhbBjC6CpBIusYLX1IkAqACdJiEAgTQELAJOTrYTkDGVsOMEWLjsnWRl2EXQOwEOKZ22IADSTh0dhwAEJiLg44C3SMqUSvh1kh6eLJWw7QGeIclGghlK+lTCCIAMy4w+QgACtQnYMNBve1lSCTt3gBMIZUslbHuAYxJlEXRypntJemvtBdqnfQRAH2rcAwEILJFANhdBiwBHOHyAJG9ZZyhZUwnfp9klysD40j4iAFJNF52FAAQqE8iYStgiwKmEHZgqQ7EIeGLjIZAlbLDZOmLgmRkAt31EAGSaLfoKAQhEIOCwwQ4IkyV3gHcC/kLSo5KlErY9wJMSuQj6OOBOmQwDEQARvk7oAwQgkI2ADQJPkXTDRB3PlkrYz6fnNumPr5SEs49afiVLnAAEQJJVRTchAIFwBJxK2Al5/DtLeUUTeOf8JB32M+r5khwnIEuwoDQiAAGQ5FNANyEAgZAErtvE4s9yHGCIjhj4GEkXhCS6Z6f8nHpWEzo4i01AilTCCIAknwC6CQEIhCXw45LeJSlTKmEHN7JhYJYEQs4d8GRJDhjkEMIZim0C7i7pHVE7iwCIOjP0CwIQyEQgY5wAXATLrzB7B4R1EUQAlF8AtAABCCyDQLY4AU4l/MYmTkCWnQC7CDpksO0CskQMtAgImUoYAbCMLyZGCQEITEPAxwFnJAobbBdBHwc8NJFNgI8Dnibp6YlSCVsEHCbp3dMsw26tIAC6ceIqCEAAAl0JHNS8WWdyEXyNpKMSphL2bgAugl1X5m7XIQB6guM2CEAAAjsQsGvgScniBGR1EbRwQQT0+DgiAHpA4xYIQAACHQhkTCXsYEH2uf9Kh/FFuMTPsOc0EQP3itChDn0Ik0oYAdBhtrgEAhCAQE8CB0h6WyKbAA/zREm/nih3gN0CbQ/wzESGgTa6vEtjL9JzaQ2/DQEwnCE1QAACENiJQEYXQVIJl1/TNgy8d81UwgiA8pNMCxCAAASyuQjaO+A0SfcnlXDRxVtVBCAAis4tlUMAAhC4lIB3AuwGliVioEWAdwKOSHQc4NgAziDo0MFZwgZXSyWMAODbCQIQgMB0BH6i2fLNkkCIVMLTrA3bBBw6dSphBMA0k0srEIAABFoC12+C72SKE/DKJgJftiyCuAju8LlDAPClBAEIQGB6AhnjBGQUAc9thAuphLdY4wiA6T/4tAgBCEDABGwL8FeSvCOQpbxW0qMkfTVJh7OmEr5Tk2GyKGYEQFG8VA4BCEBgRwIZUwm/vjEMzJJAyLkDbBjoBEKkEl5ZjggAvp0gAAEI1CWAi2B5/vYOcITDFyUSAcVTCSMAyi88WoAABCCwjkA2EeBUwo4TcLikr68bXJC/Z00lfHdJ7yzBEAFQgip1QgACENicgI8D/EWfxSbALoI+DnDY4As2H26VO3wc4LDBT5W0d5UebN6oBdadS6QSRgBsPhncAQEIQKAUgWs3qYSzxAkwh1c32+tZXARtB2DvAB8JZMkiaHuLO0o6e8yFhwAYkyZ1QQACEBhOABfB4QzX1eBn3/MkPU7SYl0EEQDrlgl/hwAEIDA9AR8DnCIp206AA++QSrjcenEqYUcMdEjpwQUBMBghFUAAAhAoQuCakt4h6bpFai9TqVMJPzSRYaCPA54m6dmSbB+Qofg44DBJZw7tLAJgKEHuhwAEIFCOQDbvABsGnirpAYmyCPrB/3hJL0zmIjg4lTACoNwHl5ohAAEIjEHAIuA9kg4ao7IJ6mhdBDOJALsI2h7gmEQ7AY7GeJ8muVSvaUUA9MLGTRCAAAQmJeBUwu9KdBzQphL+tURhg70T8BRJz0yUStgugj4O8NrYuCAANkbGDRCAAASqEDhA0lsk/WSV1vs16twBj0lkGGibANsDPCGRd0BvmwAEQL9FzV0QgAAEahAglXB56q2LYKY4ARdKurWkf9gEDwJgE1pcCwEIQKA+Ae8AOALfDet3pXMPnErYZ+yZXAQdLMg7AVkiBv6jpHtI+kTXWUEAdCXFdRCAAATiEHDEwNMThQ02uWyphH0c8IwmdPAV4kz9jj3xw/8Oks7t0l8EQBdKXAMBCEAgHgEbBjogzHXidW3bHjm40QOTuQg+UdILErkIeifglpK+uW5dIADWEeLvEIAABOISyOYimDFOQLZUwhc1uxYvWbdsEQDrCPF3CEAAArEJWASclWgnIGsqYdsD2C4gw3GAEzPdb12MAARA7A82vYMABCDQhUDGVMJ/KekRiQwDHSfANgFPTmIY+ClJP7XTUQACoMtHi2sgAAEIxCdgWwCH4c3kHZAxlfBzGo+GDKmEfQxgweKjlz0KAiD+h5oeQgACEOhKgFTCXUn1vy5TKmHHBzhE0vsQAP0nnDshAAEIZCFwvWYnIFPEQO8EHCnpgiSQLQIcMdBv13sF7/MZjWugjQN3KewABJ85ugcBCECgB4FrSPIXf6ZUwidJenCyVMJPleQjgeiphB8kycGYEAA9PkzcAgEIQCAbAccJODtRFsGsLoKOcBg9lbCzSR4q6Wuri5gdgGwfafoLAQhAoDsBuwhaBDhyYIZiF8E3SnIqYSe5yVCypBJ+mKQ/QgBkWFL0EQIQgMA4BDKmEj5Z0kMSpRK2CPBxwNMD2wS8o8kVcOkuADsA43zAqAUCEIBAZALXkvQmSfYSyFKcO+CxkhzUJkPJkEr4zs0Oy8U8EQAZlhV9hAAEIDCcAKmEhzNcV0P0VMKvaY5XEADrZpK/QwACEJgZAe8AOJVwpp0AUgmPtwg/Lcm7AB9lB2A8qNQEAQhAIAuBAyW9OVkq4ddJevjuVuyBgfs44Dean0i5AxwL4FGS/hgBEHj10DUIQAACBQk4d4BTCWfxDrCL4BsSphJ2AqFjgqUSfq+kWyAACn66qBoCEIBAcALZXAQtAk6TdH9J3wjOtu1exFTCn5N0a0mfwQgwySqimxCAAAQKELCLoHcCnEgoQ2l3Ao5IdBxgEfDEJmJghOMAiycfp5yAAMiw5OkjBCAAgXIEHDb47ZKy5A6wCCCV8LD18Ae2BUAADIPI3RCAAATmQMAJhHzGnsk74FVNWt4scQL8vP09SY8M4IL/QUk3QwDM4aPLGCAAAQgMJ5AxlfArJNnQLosIuJKkd0n62eHTNagGZ108EAEwiCE3QwACEJgVAWcPtKFdluMAw3dwG0cMzJJK+GBJp0uy/UWt4jwLt0EA1MJPuxCAAARiErBNwJmJDANN0cGNbBiYJYGQcwY8v+L0f0vS0xAAFWeApiEAAQgEJeC307OSxQnI5CJorwsn5zmg4vwfgwCoSJ+mIQABCAQmkC1OgFMJWwQ8MMFOgN0Bf1/SQyvO/2kIgIr0aRoCEIBAcAKOGPjORGGD7SJ4SpNKOLpNwKGrmfkqrIOzEAAVqNMkBCAAgUQEDpL0V8lcBG0YeFRw7wCHYf64pFrBgT6AAEj0KaSrEIAABCoRwEVwfPC2s3iP3fHGr7pTjZ9DAHTixEUQgAAEFk/g+s32erZgQUdL+krA2ftRSadKunmlvl2IAKhEnmYhAAEIJCRwLUlvk+R4AVlK1FTC9gA4EQGQZRnRTwhAAAIQyOgi6DftBwTLIogA4LMEAQhAAALpCNhF0OfXNhDMUOwdEE0EcASQYeXQRwhAAAIQ2IOAdwIc1z7LcUArAh4UJJWwXSz/TpIjL9Yo/4ENQA3stAkBCEBgHgR+orEJyJI7wCLgL5wKN4Bh4A0lfaRiZsAPIwDm8SFkFBCAAARqEXAqYQff8QMtS3mlpMdXjhNwtyaHQS1mBAKqRZ52IQABCMyIQMY4ATVFwBUl/YGkB1dcA3/FDkBF+jQNAQhAYEYEnODGEQMdLyBLOUHSoyV9deIOOyXw2yXtP3G7q82RDKgifJqGAAQgMDcCNmyzYaDFQJZysiQbBk6VStgv3vb/v0dFQN8mHXBF+jQNAQhAYKYEcBHceWJv1SQBulrF+bfYuS1HABVngKYhAAEIzJSARcBZiXYCnEr4jU2woJI7Afaa8DHJT1Wed4dGvgYCoPIs0DwEIACBmRLwccAZkuwlkKHYRfD1kn5dUolUwleS9A5J3gGoXRx/4FYIgNrTQPsQgAAE5kvAKW9PS+Yi+G5JD5X0yRGn5aqSTpJ0uxHrHFLVSyQ9CQEwBCH3QgACEIDAOgIOEuQ360xxAj7euOj5Tdk7A32Ln7GO9PdaSbfuW8nI931d0hGSTkYAjEyW6iAAAQhAYA8Cdg18g6QsEQM9gO9I+l1JL5N0bo85dajkx0h6mKT9etxf6pZPN2LkCwiAUoipFwIQgAAEVgk4+51937PkDmj7bgPBl/uNWdI710zplSXdqHErtGvhPgGXwPsl/az7hQAIODt0CQIQgMBMCfit+OxEWQRXp8FC4CJJ75X0ZUmfaOwEfnjFsO8OkvYO/Gy1/7+FyZ8jAGb6CWNYEIAABAITsIugRYANBDMXP0wtCC7fPPQzjOWjku7UHmmwA5BhyugjBCAAgXkRyJZKeC70f6dJgnTxeBAAc5lWxgEBCEAgF4FrSnqLJCcSokxD4LZNqGYEwDS8aQUCEIAABLYhYO8AG9dlchHMOpmOQ2D3v2+0A2AHIOtU0m8IQAAC8yDgHQDHCWAnoOx83l7S21abQACUBU7tEIAABCCwnoANAk9Plkp4/ajiXOFdlgdI+iYCIM6k0BMIQAACELiEgHMHOAxvdu+AaPPpgEa3kfTXu3eMHYBoU0V/IAABCCyXwFxcBCPNoMMQP1DSdxEAkaaFvkAAAhCAwO4EEAHjrQnH/T9I0vlbVckOwHigqQkCEIAABMYh4OMAh921lwClP4HnSHr2drcjAPqD5U4IQAACEChH4DqSTsVFsDfgf5Z0U0kXIgB6M+RGCEAAAhCoRMCugfZfJ07AZhPweUm/KMlpjbct7ABsBpWrIQABCEBgWgI+BjiFOAGdodvVzwF/Tlx3BwJgHSH+DgEIQAACtQn8hKQzJPlYgLIzgVdJerAku//tWBAA6wjxdwhAAAIQiEDACYTOIk7AjlNxgqRHS/pqlwlDAHShxDUQgAAEIBCBgF0E39O4tkXoT6Q+vF/SPSSd17VTCICupLgOAhCAAAQiEPBOwJmSrhehM0H68ClJd5X0j5v0BwGwCS2uhQAEIACBCAQOkPQGSQdH6EzlPvybpDtK+vCm/UAAbEqM6yEAAQhAIAKBa0l6jaSfj9CZSn34oqTbSfpon/YRAH2ocQ8EIAABCEQgsFcTLMipbpdUvt+k9n2UJG//9yoIgF7YuAkCEIAABIIQ2FvSb0t6iKQrBulTyW744e/0vg+S9I0hDSEAhtDjXghAAAIQiEDgck3Gu2Mk2VNgrsUP/CMlHS/JQmBQQQAMwsfNEIAABCAQiIBj3/++pFsF6tNYXTlX0i9Lcoz/UQoCYBSMVAIBCEAAAkEI+EjgeZIOl/QjQfo0pBv/Kel0SY+T9IUhFe1+LwJgTJrUBQEIQAACUQjctnloHhqlQxv2w6F8/0bSUY2V/7c3vH/t5QiAtYi4AAIQgAAEkhLYtzEOdHhcuw1mKfbpf4Wkl++UznfoYBAAQwlyPwQgAAEIRCfwo82RwGObY4ErBO3wP0lyMh//fK50HxEApQlTPwQgAAEIRCHgB//dJVkI3EyS4wjULhdJ+qykP5b0J5LOn6pDCICpSNMOBCAAAQhEInBtSQ+VdD9J15i4Y3bhc9KeEyWdJOl9E7d/cXMIgBrUaRMCEIAABKIQuJKkG0u6g6RbSLqNpH0KdO6/mwf9GU0yow9K+nqBdjpXiQDojIoLIQABCEBgxgT8PPSD/yqNIPAOwUGSrtv83Ghl7Fs9O1cD83xGktPzOlb/Jxrf/Y9I+lpj1Pe9CBwRABFmgT5AAAIQgEBUAldrRIFjClgg+E1+f0n7SfpBSX6Y/5ekf5XkGAR21/uSJPvvf3mMiH2lwCAASpGlXghAAAIQgEBgAgiAwJND1yAAAQhAAAKlCPx/YDx9SebRTiQAAAAASUVORK5CYII=\" width=\"30\" height=\"30\">');\n map.addListener('center_changed', function () {\n self.align(isidebar);\n });\n $(window).resize(function () {\n var width = $(window).width();\n var height = $(window).height();\n $(isidebar.getSideBar()).offset({\n top: height * 0.1,\n left: width * 0.65\n });\n $(isidebar.getMenu()).trigger('searchlist_align');\n });\n };\n NEWLayer.prototype.draw = function () {\n };\n NEWLayer.prototype.align = function (isidebar) {\n logger('NEWLayer align function is called');\n var currentcenter = this.getProjection().fromLatLngToDivPixel(map.getCenter());\n var changex = currentcenter.x - this.startcenter.x;\n var changey = currentcenter.y - this.startcenter.y;\n logger('change of position trigger- changex:' + changex + ' ' + 'changey' + changey);\n // can create a function in sidebar to replace\n $(isidebar.getMenu()).css('transform', 'translate(' + changex + 'px,' + changey + 'px)');\n $(isidebar.getSideBar()).css('transform', 'translate(' + changex + 'px,' + changey + 'px)');\n\n logger('NEWLayer align function is ended');\n };\n NEWLayer.prototype.onRemove = function () {\n logger('NEWLayer onRemove function is called');\n if (this.div)\n this.getPanes().overlayMouseTarget.removeChild(this.div);\n logger('NEWLayer onRemove function is ended');\n };\n var instance = new NEWLayer();\n logger('function addOVerlay is ended');\n }", "function initMap() {\n const pos = { lat: 40.694449, lng: -73.8978617 };\n const opt = {\n center: pos,\n zoom: 13,\n disableDefaultUI: true,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dadada\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c9c9c9\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n }\n ]\n }\n const myMap = new google.maps.Map(document.getElementById(\"map\"), opt);\n const marker = new google.maps.Marker({\n position: pos,\n map: myMap,\n title: \"91 Nolan Extensions Suite 670\",\n icon: 'img/Pin.png',\n animation: google.maps.Animation.BOUNCE,\n });\n\n const infowindow = new google.maps.InfoWindow({\n content: 'From 07:05AM to 19:30PM'\n });\n\n google.maps.event.addListener(marker, 'click', function () {\n console.log('click');\n infowindow.open(myMap, marker);\n });\n\n\n}", "function Layers() {\n\n\tthis.mask = 1 | 0;\n\n}", "function drawAffMap(affId) {\n coverageLayer.removeAllFeatures();\n \n\n //draw source layer \n mySourceJson.features = [];\n var sourceP = new OpenLayers.Format.GeoJSON(options);\n\n for (i = 0; i < sourceJson.features.length; i++) {\n if (sourceJson.features[i].properties.affiliation.toString().indexOf(affId.toString())>=0) {\n mySourceJson.features.push(sourceJson.features[i]);\n }\n }\n //alert(\"source layer feature length:\" + mySourceJson.features.length );\n\n if (mySourceJson.features.length > 0) {\n var sourceFeats = sourceP.read(mySourceJson);\n sourceLayer.removeAllFeatures();\n ////////alert(\"inside sourceFeats Length: \" + sourceFeats.length);\n sourceLayer.addFeatures(sourceFeats);\n\n }\n\n var sourceFeats = sourceP.read(mySourceJson);\n sourceLayer.removeAllFeatures();\n ////alert(\"outside sourceFeats Length: \" + sourceFeats.length);\n sourceLayer.addFeatures(sourceFeats);\n\n //draw contour layer\n myJson.features = [];\n var p = new OpenLayers.Format.GeoJSON(options);\n\n\n for (i = 0; i < cmaJson.features.length; i++) {\n if (cmaJson.features[i].properties.affiliation.toString().indexOf(affId.toString()) >= 0) {\n myJson.features.push(cmaJson.features[i]);\n }\n }\n\n\n if (myJson.features.length > 0) {\n var feats = p.read(myJson);\n cmaLayer.removeAllFeatures();\n cmaLayer.addFeatures(feats);\n map.zoomToExtent(cmaLayer.getDataExtent());\n }\n var feats = p.read(myJson);\n cmaLayer.removeAllFeatures();\n cmaLayer.addFeatures(feats);\n ////alert(\"outside contour feats Length: \" + feats.length);\n map.zoomToExtent(cmaLayer.getDataExtent());\n}", "function createMap() {\n\n //create the map\n var map = L.map('mapid', {\n center: [36, -98],\n zoom: 4\n });\n\n // set map boundaries to restrict panning out of bounds\n var southWest = L.latLng(0, -170),\n northEast = L.latLng(80, -10);\n var bounds = L.latLngBounds(southWest, northEast);\n\n map.setMaxBounds(bounds);\n map.on('drag', function () {\n map.panInsideBounds(bounds, {\n animate: false\n });\n });\n\n curMap = map;\n\n // add basemap tilelayer\n L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {\n minZoom: 3,\n attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'\n }).addTo(curMap);\n\n //call getData function\n getData(curMap);\n createLegend(curMap);\n\n}", "function addSites() {\n require([\n\t\t\t\"esri/map\",\n\t\t\t\"esri/geometry/Point\",\n\t\t\t\"esri/symbols/SimpleMarkerSymbol\",\n\t\t\t\"esri/graphic\",\n\t\t\t\"esri/layers/GraphicsLayer\",\n\t\t\t\"esri/layers/ArcGISDynamicMapServiceLayer\",\n\t\t\t\"esri/layers/ImageParameters\",\n\t\t\t\"esri/layers/FeatureLayer\",\n\t\t\t\"dojo/domReady!\"\n ], function (Map, Point, SimpleMarkerSymbol, Graphic, GraphicsLayer, ArcGISDynamicMapServiceLayer, FeatureLayer, InfoTemplate) {\n if (map != null) {\n\t\t\t\tdropSitesLayer = new ArcGISDynamicMapServiceLayer(\"http://services4.geopowered.com/arcgis/rest/services/LATA/DropSites2015/MapServer\");\n //dropSitesLayer = new ArcGISDynamicMapServiceLayer(\"http://38.124.164.214:6080/arcgis/rest/services/DropZones/MapServer\");\n //dropSitesLayer = new ArcGISDynamicMapServiceLayer(\"http://38.124.164.214:6080/arcgis/rest/services/DropZones/FeatureServer\");\n /*\n\t\t\t\tvar infoTemplate = new InfoTemplate();\n\t\t\t\tinfoTemplate.setTitle(\"${Name}\");\n\t\t\t\tinfoTemplate.setContent(\"<b>Name: </b>${Name}\");\n\t\t\t\tdropSitesFeatureLayer = new esri.layers.FeatureLayer(\"http://38.124.164.214:6080/arcgis/rest/services/DropZones/FeatureServer/0\",{\n\t\t\t\t\tmode: esri.layers.FeatureLayer.MODE_ONDEMAND,\n\t\t\t\t\tinfoTemplate: infoTemplate,\n\t\t\t\t\toutFields: [\"*\"]\n\t\t\t\t});\n\t\t\t\t*/\n map.addLayer(dropSitesLayer);\n //map.addLayer(dropSitesFeatureLayer);\n }\n else {\n alert('no map');\n }\n });\n }", "function changeLayer() {\n var str = $('#queryLayers').val();\n //map.removeLayer(countiesLyr);\n //map.removeLayer(regionsLyr);\n //map.removeLayer(outageLyr);\n //map.removeLayer(customerOutagesLyr);\n\n countiesLyr.hide();\n regionsLyr.hide();\n outageLyr.hide();\n customerOutagesLyr.hide();\n\n getOutages();\n if (app.locations) {\n getOutageCustomerLocations(app.locations);\n }\n //if (str == \"Region\") {\n if ($('#rRegion').is(':checked')){\n getRegions();\n// map.addLayer(regionsLyr);\n// map.addLayer(outageLyr);\n // map.addLayer(customerOutagesLyr);\n regionsLyr.show();\n outageLyr.show();\n customerOutagesLyr.show();\n $('#rCounty').removeAttr(\"checked\");\n dojo.forEach(regionsLyr.graphics, function (graphic) {\n graphic.setSymbol(defaultRegionsSymbol);\n });\n } else if ($('#rCounty').is(':checked')) {\n getCounties();\n// map.addLayer(countiesLyr);\n// map.addLayer(outageLyr);\n // map.addLayer(customerOutagesLyr);\n countiesLyr.show();\n outageLyr.show();\n customerOutagesLyr.show();\n dojo.forEach(countiesLyr.graphics, function (graphic) {\n graphic.setSymbol(defaultCountiesSymbol);\n });\n } else {\n// map.addLayer(outageLyr);\n // map.addLayer(customerOutagesLyr);\n outageLyr.show();\n customerOutagesLyr.show();\n }\n}", "addMapBox() {\n\t\t//let imageUrl = `http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export?bbox=-41.8929093,12.4888119,41.8894933,12.4894844&bboxSR=4326&layers=&layerDefs=&size=1274%2C796&imageSR=&format=jpg&transparent=false&dpi=&time=&layerTimeOptions=&dynamicLayers=&gdbVersion=&mapScale=&f=image`;\n\t\tlet imageUrl = `map.jpg`;\n\t\tvar geom = new THREE.PlaneBufferGeometry( 2200 * 0.6, 1500 * 0.6 );\t\n\t\tvar material = new THREE.MeshPhongMaterial({ opacity:1 ,transparent:false, map:THREE.ImageUtils.loadTexture(imageUrl) });\n\t\tvar mesh = new THREE.Mesh(geom, material);\n\t\tmesh.position.set(60, -11.5, -25);\n\t\tmesh.rotateZ(3.08);\n\t\tthis.viewer.overlays.addScene('map-scene');\t\n\t\tthis.viewer.overlays.addMesh(mesh, 'map-scene');\n\t}", "function initialiseMap() {\n var enableDrawing = options.drawControl;\n\n options.drawControl = false;\n\n mapImpl = L.map(id, options);\n\n mapImpl.addLayer(drawnItems);\n\n addCoordinates();\n\n L.Icon.Default.imagePath = getLeafletImageLocation();\n\n mapImpl.addLayer(options.baseLayer);\n if (options.defaultLayersControl) {\n self.addLayersControl(options.otherLayers, options.overlays, {overlayLayersSelectedByDefault: options.overlayLayersSelectedByDefault, autoZIndex: options.autoZIndex});\n }\n\n\n if (options.showFitBoundsToggle) {\n var css = \"ala-map-fit-bounds fa \" + (options.zoomToObject ? \"fa-search-minus\" : \"fa-search-plus\");\n self.addButton(\"<span class='\" + css + \"' title='Toggle between the full map and the bounds of the data'></span>\", self.toggleFitBounds, \"topleft\");\n }\n\n if (options.useMyLocation) {\n var title = options.myLocationControlTitle || \"Use my location\";\n self.addButton(\"<span class='ala-map-my-location fa fa-location-arrow' title='\" + title + \"'></span>\", self.markMyLocation, \"topleft\");\n }\n\n if (options.allowSearchLocationByAddress) {\n addGeocodeControl(ALA.MapConstants.DRAW_TYPE.POINT_TYPE);\n }\n\n if (options.allowSearchRegionByAddress) {\n addGeocodeControl(ALA.MapConstants.DRAW_TYPE.POLYGON_TYPE);\n }\n\n if (enableDrawing) {\n initDrawingControls(options);\n }\n\n if(options.trackWindowHeight) {\n addWindowResizeListener();\n adjustMapContainerHeight();\n }\n\n if (options.showReset) {\n self.addButton(\"<span class='ala-map-reset fa fa-refresh reset-map' title='Reset map'></span>\", self.resetMap, \"bottomright\");\n }\n\n // If the map container is not visible, add a listener to trigger a redraw once it becomes visible.\n // This avoids problems with the map viewport being initialised to an incorrect size because Leaflet could not\n // determine the size of the container.\n var container = $(\"#\" + id);\n if (!container.is(\":visible\")) {\n container.onImpression({\n callback: self.redraw\n });\n }\n\n // make sure the base layers never sit on top of other layers when the base layer is changed\n mapImpl.on('baselayerchange', function (event) {\n currentBaseLayer = event.layer;\n\n if (event.layer.setZIndex) {\n event.layer.setZIndex(-1);\n }\n });\n\n // when an overlay layer is selected, bring it to the front and mark it as selected\n mapImpl.on('overlayadd', function (e) {\n if (e && e.layer) {\n overlayLayerSelect(e.layer);\n }\n });\n\n // when an overlay layer is de-selected, remove selected marker\n mapImpl.on('overlayremove', function (e) {\n if (e && e.layer) {\n overlayLayerDeselect(e.layer);\n }\n });\n }", "function createMap() {\n // define street, outdoor, satellite maps\n var satellite = L.tileLayer(\"https://api.mapbox.com/styles/v1/cherngywh/cjfkdlw8x057v2smizo9hqksx/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoiY2hlcm5neXdoIiwiYSI6ImNqZXZvcGhhYTcxdm4ycm83bjY1bnV3amgifQ.MOA-PIHTOV90Ql8_Tg2bvQ\");\n\n var dark = L.tileLayer(\"https://api.mapbox.com/styles/v1/cherngywh/cjfon2bd904iy2spdjzs1infc/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoiY2hlcm5neXdoIiwiYSI6ImNqZXZvcGhhYTcxdm4ycm83bjY1bnV3amgifQ.MOA-PIHTOV90Ql8_Tg2bvQ\");\n\n var street = L.tileLayer(\"https://api.mapbox.com/styles/v1/cherngywh/cjfokxy6v0s782rpc1bvu8tlz/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoiY2hlcm5neXdoIiwiYSI6ImNqZXZvcGhhYTcxdm4ycm83bjY1bnV3amgifQ.MOA-PIHTOV90Ql8_Tg2bvQ\");\n\n // define a baselayer object to hold our base layer objects\n var baseLayers = {\n \"Street\": street, \n \"Dark\": dark,\n \"Satellite\": satellite\n };\n\n // define a overlay object to hold our overlay layer objects\n var overlays = {\n \"Earthquakes\": earthquakeLayer,\n \"Plate Boundaries\": plateLayer,\n };\n\n // initialize the map on the \"map\" div with a given center and zoom\n mymap = L.map('map', {\n center: [30, 0],\n zoom: 2,\n layers: [street, earthquakeLayer]\n })\n\n // create the legend to show diffent colors corresponding to the level of magnitude\n L.control.layers(baseLayers, overlays).addTo(mymap);\n\n var legend = L.control({position: \"bottomright\"});\n\n legend.onAdd = function(map) {\n var div = L.DomUtil.create(\"div\", \"info legend\"),\n grades = [0, 1, 2, 3, 4, 5, 6, 7, 8],\n labels =[];\n \n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + magColor(grades[i]) + '\"></i> ' +\n grades[i] + (grades[i+1] ? '&ndash;' + grades[i+1] + '<br>' : '+');\n }\n return div;\n };\n legend.addTo(mymap);\n}", "function addLayer(choroplethMode) {\n console.log(choroplethMode);\n const ctStyle = {\n color: 'white',\n weight: 1,\n fillOpacity: 0.5,\n };\n\n const tcOnEach = (feature, layer) => {\n console.log(feature.properties);\n layer.on({\n mouseover: (e) => {\n const region = e.target;\n region.setStyle({\n fillOpacity: 0.3,\n });\n regionInfoLayer.update(region.feature.properties);\n },\n mouseout: (e) => {\n tcLayer.resetStyle(e.target);\n regionInfoLayer.update();\n },\n });\n };\n console.log(tcBoundaries);\n tcLayer = L.choropleth(tcBoundaries, { valueProperty: choroplethMode, scale: ['#BFBFBF', 'blue'], style: ctStyle, onEachFeature: tcOnEach }).addTo(map);\n}", "function createDDLayers(){\n var geoCriteria = \"<p style=\\\"margin:1px\\\"><a> \"+layerText+\": </a>\"+\n \"<a href=\\\"javascript:\\\" onclick=\\\"shiftGeo()\\\" class=\\\"shift\\\">\"+changeSelector+\"</a></p>\";\n var geoLimit = \"<p style=\\\"margin:1px\\\"><a> \"+limitLayers+\": </a></p>\";\n //Geographical layers\n geoCriteria += \"<div id=\\\"layerComponents\\\" style=\\\"width:260px;\\\">\"+\n \"<select name=ddLayer style=\\\"width:120px;\\\" class=\\\"geoCommons\\\" \"+\n \"onchange=\\\"onChangeLayer(this.form.ddLayer,this.form.cbAll);\\\">\";\n for(var i=0;i<layersList.length;i++){ //Setting drop down options\n geoCriteria+= \"<option>\"+layersList[i][1]+\"</option>\";\n }\n geoCriteria+= \"</select>\"+addAll+\"<input type=\\\"checkbox\\\" name=\\\"cbAll\\\" style=\\\"width:20px;\\\" class=\\\"geoCommons\\\"\"+\n \" onchange=\\\"onChangeSelectAll(this.form.cbAll,this.form.ddLayer);\\\"</input>\"+\n \"<input type=\\\"button\\\" name=\\\"clearAll\\\" style=\\\"width:25px;\\\" class=\\\"geoClear\\\"\"+\n \" onclick=\\\"clearAllPolygons(this.form.cbAll);\\\"</input></>\"+\"</div>\";\n document.getElementById('currentLayer').innerHTML = geoCriteria;\n //Limit layer\n geoLimit += \"<div id=\\\"layerLimitComponents\\\" style=\\\"width:260px;display:none;\\\">\"+\n \"<select name=ddLimitLayer style=\\\"width:120px;\\\" class=\\\"geoCommons\\\" \"+\n \"onchange=\\\"onChangeLimitLayer(this.form.ddLimitLayer,this.form.cbLimitAll);\\\">\";\n for(var j=0;j<layersList.length;j++){ //Setting drop down options\n geoLimit+= \"<option>\"+layersList[j][1]+\"</option>\";\n }\n geoLimit+= \"</select>\"+addAll+\"<input type=\\\"checkbox\\\" name=\\\"cbLimitAll\\\" style=\\\"width:20px;\\\" class=\\\"geoCommons\\\"\"+\n \" onchange=\\\"onChangeSelectAllLimits(this.form.cbLimitAll,this.form.ddLimitLayer);\\\"</input>\"+\n \"<input type=\\\"button\\\" name=\\\"clearAll\\\" style=\\\"width:25px;\\\" class=\\\"geoClear\\\"\"+\n \" onclick=\\\"clearAllLimitPolygons(this.form.cbLimitAll);\\\"</input></>\"+\"</div>\";\n document.getElementById('currentLimitLayer').innerHTML = geoLimit;\n}", "function drawRegionsMap() {\n\t\n\t// Junk data\n\tdata = google.visualization.arrayToDataTable([\n\t\t['Place', 'Searches'],\n\t\t['', 0]\n\t]);\n\t\n\t// Init the chart and draw the data\n\tchart = new google.visualization.GeoChart(document.getElementById('chart'));\n\tchart.draw(data, defaultOptions);\n\t\n\t// Init event handlers for the chart\n\tgoogle.visualization.events.addListener(chart, 'select', selectHandler);\n\tgoogle.visualization.events.addListener(chart, 'ready', imReady);\n\t\n\tgoogle.visualization.events.addListener(chart, 'select', function() {\n\t\tchart.setSelection(chart.getSelection());\n\t});\n}", "function mammallayeron(){\n\n$(\"#species_richness_scale\").show();\n\nfor (i=0; i <= 600; i++){\n\nif (countrieslayer._layers[i]){\nvar country = countrieslayer._layers[i];\ncountry.setStyle(grey);\n\n}\n}\n\nfor (var polygon in mammalszones._layers) {\nmap.addLayer(mammalszones._layers[polygon]);\nmammalszones._layers[polygon].setStyle(none);\nfor (var inner in mammalszones._layers[polygon]._layers){\nif(inner && mammalszones._layers[polygon].feature.id){\nif(mammalszones._layers[polygon].feature.id >= 150){\nmammalszones._layers[polygon].setStyle(one);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 140){\nmammalszones._layers[polygon].setStyle(two);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 120){\nmammalszones._layers[polygon].setStyle(three);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 100){\nmammalszones._layers[polygon].setStyle(four);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 80){\nmammalszones._layers[polygon].setStyle(five);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 60){\nmammalszones._layers[polygon].setStyle(six);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 40){\nmammalszones._layers[polygon].setStyle(seven);\n}\n}\n}\n} \n}", "function createLayers(map){\n let torqueLayer = createTorqueLayer(map)\n let polygonLayer = createPolygonLayer(map)\n\n let loadedTorqueLayer;\n let loadedPolyLayer;\n\n polygonLayer.addTo(map)\n .on('done', function(layer) {\n loadedPolyLayer = layer;\n if (loadedTorqueLayer) {\n onPolygonLoad(map, loadedTorqueLayer, loadedPolyLayer)\n }\n })\n .on('error', logError);\n\n torqueLayer.addTo(map)\n .on('done', function(layer) {\n onTorqueLoad(map, layer)\n loadedTorqueLayer = layer\n if (loadedPolyLayer) {\n onPolygonLoad(map, loadedTorqueLayer, loadedPolyLayer)\n }\n })\n .on('error', logError);\n }", "function initMap() {\n // Create a styles array to use with the map.\n var styles = [{\n featureType: 'water',\n stylers: [{\n color: '#19a0d8'\n }]\n }, {\n featureType: 'administrative',\n elementType: 'labels.text.stroke',\n stylers: [{\n color: '#ffffff'\n },\n {\n weight: 6\n }\n ]\n }, {\n featureType: 'administrative',\n elementType: 'labels.text.fill',\n stylers: [{\n color: '#e85113'\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#efe9e4'\n },\n {\n lightness: -40\n }\n ]\n }, {\n featureType: 'transit.station',\n stylers: [{\n weight: 9\n },\n {\n hue: '#e85113'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'labels.icon',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{\n lightness: 100\n }]\n }, {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{\n lightness: -100\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{\n visibility: 'on'\n },\n {\n color: '#f0e4d3'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#efe9e4'\n },\n {\n lightness: -25\n }\n ]\n }];\n\n // Constructor creates a new map - only center and zoom are required.\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 46.249981,\n lng: 20.147891\n },\n zoom: 11,\n styles: styles,\n mapTypeControl: false\n });\n\n // Style the markers a bit. This will be our listing marker icon.\n defaultIcon = makeMarkerIcon('0091ff');\n\n // Create a \"highlighted location\" marker color for when the user\n // mouses over the marker.\n highlightedIcon = makeMarkerIcon('FFFF24');\n\n // Create locations\n textSearchPlaces();\n\n}", "function initMap(){\n map = new google.maps.Map(document.getElementById('map'), {\n // required\n center: {\n lat: 30.0,\n lng: 0.0\n },\n zoom: 3,\n\n // optional\n backgroundColor: mapColors.sea,\n disableDoubleClickZoom: true,\n maxZoom: 6,\n minZoom: 3,\n\n // hide clickables\n zoomControl: false,\n streetViewControl: false,\n scaleControl: false,\n fullscreenControl: false,\n mapTypeControl: false,\n\n // styling\n styles: [\n {\n elementType: 'geometry',\n stylers: [{color: mapColors.land}]\n }, {\n elementType: 'labels.text.stroke',\n stylers: [{color: mapColors.countryTextStroke}]\n }, {\n elementType: 'labels.text.fill',\n stylers: [{color: mapColors.countryText}] // show country labels\n }, {\n featureType: 'administrative.country',\n elementType: 'geometry.stroke',\n stylers: [{color: mapColors.countryBorder}] // show country borders\n }, {\n featureType: 'administrative.province',\n elementType: 'geometry.stroke',\n stylers: [{color: mapColors.provinceBorder}] // show province borders\n }, {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: mapColors.provinceText}] // show province labels\n }, {\n featureType: 'adminstrative.locality',\n elementType: 'labels.text.stroke',\n stylers: [{color: mapColors.provinceTextStroke}] // show cities\n }, {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: mapColors.parks}] // show parks\n }, {\n featureType: 'poi',\n elementType: 'labels.text',\n stylers: [{visibility: 'off'}] // hide park labels\n }, {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{visibility: 'off'}]\n }, {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{visibility: 'off'}] // hide roads\n }, {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{visibility: 'off'}]\n }, {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{visibility: 'off'}] // hide road labels\n }, {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{visibility: 'off'}]\n }, {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{visibility: 'off'}] // hide transit\n }, {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{visibility: 'off'}] // hide transit labels\n }, {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: mapColors.sea}] // show bodies of water\n }, {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: mapColors.seaText}] // show water labels\n }, {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: mapColors.seaTextStroke}]\n }\n ]\n });\n\n /**\n * Prevent user from dragging outside of map\n *\n * Latitude values range from (-90 (SOUTH), 90 (NORTH))\n * Reset map scale and center if user drags out of bounds\n */\n map.addListener('drag', function(){\n var southLat = map.getBounds().getSouthWest().lat();\n var northLat = map.getBounds().getNorthEast().lat();\n\n if(southLat < -89 || northLat > 89){\n var newBounds = new google.maps.LatLngBounds(\n {lat: 80, lng: -170},\n {lat: -50, lng: 170}\n );\n map.fitBounds(newBounds);\n }\n });\n\n /**\n * Add marker on click\n */\n map.addListener('click', function(event){\n placeMarker(event.latLng);\n });\n}", "function createArmiesOverlays(){\n let armiesOverlay = [];\n\n map.data.forEach(function(feature){\n if(feature.getGeometry().getType()=='Polygon'){\n let coord = [];\n feature.getGeometry().forEachLatLng(function(LatLng){\n coord.push(LatLng);\n });\n const poly = new google.maps.Polygon({paths: coord});\n const center = poly.getApproximateCenter();\n\n armiesOverlay[feature.getProperty('name')] = new ArmiesOverlay(center, map);\n }\n });\n\n return armiesOverlay;\n}", "initLayers() {\n this.level.game.world.setBounds(0, 0, 1920, 1080);\n\n this.level.map = this.level.game.add.tilemap(this.levelName);\n this.level.map.addTilesetImage(this.tileMapImage, 'tiles');\n this.level.backgroundLayer = this.level.map.createLayer('Background Layer');\n this.level.platformLayer = this.level.map.createLayer('Platform Layer');\n this.level.itemLayer = this.level.map.createLayer('ItemLayer');\n this.level.homeBaseLayer = this.level.map.createLayer('HomeBaseLayer');\n this.level.playerLayer = this.level.map.createLayer('Player Layer');\n\n this.level.map.setCollisionBetween(1, 100000, true, 'Platform Layer');\n }", "function drawCases(){\n clear();\n \n div.hide();\n let data = boundary[0].the_geom.coordinates[0];\n stroke(255);\n fill(100,100,100, 50);\n\tbeginShape();\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tlet lon = boundary[0].the_geom.coordinates[0][i][0];\n let lat = boundary[0].the_geom.coordinates[0][i][1];\n \n const p = myMap.latLngToPixel(lat, lon);\n\n\t\t\tlet x = map(lon, city_limit.xMin, city_limit.xMax, 0+padding, width-padding);\n\t\t\tlet y = map(lat,city_limit.yMin, city_limit.yMax, height-padding, 0+padding);\n\n\t\t\tvertex(p.x,p.y);\n\t\t}\n\tendShape(CLOSE);\n\n\n fill(109, 255, 0);\n stroke(100);\n for(var i = 0; i < Object.keys(covidData).length; i++)\n {\n\n const latitude = covidData[i][\"attributes\"][\"Y\"];\n const longitude = covidData[i][\"attributes\"][\"X\"];\n \n\n //if (myMap.map.getBounds().contains([latitude, longitude])) {\n // Transform lat/lng to pixel position\n const pos = myMap.latLngToPixel(latitude, longitude);\n \n //map(value, start1, stop1, start2, stop2)\n let size = covidData[i][\"attributes\"][\"Point_Count\"];\n size = map(size, 0, covidData[0][\"attributes\"][\"Point_Count\"], 1, 25) + myMap.zoom();\n ellipse(pos.x, pos.y, size, size); \n\n \n }\n\n }", "addLayer(layer) {\n super.addLayer(layer);\n var i = 0;\n this.getLayers().forEach(function(layer) {\n // Layers having zIndex equal to 1000 are overlays.\n if (layer.getZIndex() < 1000) {\n layer.setZIndex(i);\n i++;\n }\n });\n }", "function createMap(){\n\t//create the map\n\tmap = L.map('mapid', {\n\t\tcenter: [53, -95],\n\t\tzoom: 4,\n\t\tminZoom: 4,\n\t\tmaxZoom: 5,\n\t\tdragging: false,\n\t\t//maxBounds: L.latLngBounds() //working on this one\n\t});\n\n\t//add OSM base tilelayer\n L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox/dark-v10',\n accessToken: 'pk.eyJ1Ijoic21pdGh5ODc2IiwiYSI6ImNrNmpyMGNiNTAwaDczbW15ZTA0NXRxY3MifQ.otKyUrLqesRLXLhm-7tZ2A'\n }).addTo(map);\n\n\t//call getData function\n\tgetData(map);\n}", "async function getIso(coords) {\n\n var lon = coords[0];\n var lat = coords[1];\n\n\n const query = await fetch(\n `${urlBase}${profile}/${lon},${lat}?contours_minutes=${minutes}&polygons=true&access_token=${mapboxgl.accessToken}`,\n { method: 'GET' }\n );\n const data = await query.json();\n console.log(data);\n\n\n\n if(map.getLayer('iso')) {\n map.removeLayer('iso');\n map.removeLayer('iso')\n }\n\n\n map.addSource('iso', {\n type: 'geojson',\n data: {\n 'type': 'FeatureCollection',\n 'features': []\n }\n });\n \n map.addLayer(\n {\n 'id': 'iso',\n 'type': 'fill',\n 'source': 'iso',\n 'layout': {},\n 'paint': {\n 'fill-color': '#5a3fc0',\n 'fill-opacity': 0.7\n }\n },\n 'poi-label'\n );\n\n map.getSource('iso').setData(data);\n\n console.log(turf.bbox(data))\n\n\n map.fitBounds(turf.bbox(data), {\n linear: true,\n padding: 100\n })\n\n\n\n}", "function setupGraphics($scope){\r\n var bbox = $scope.bbox;\r\n $scope.south = bbox[$scope.sub][0][0];\r\n $scope.west = bbox[$scope.sub][0][1];\r\n $scope.north = bbox[$scope.sub][1][0];\r\n $scope.east = bbox[$scope.sub][1][1];\r\n}", "visibleMapDisplay() {\n vtx.fillStyle = \"pink\";\n vtx.beginPath();\n vtx.lineWidth = 5;\n vtx.moveTo(this.borders[0],this.borders[1]);\n\n for (var i = 2; i < (this.borders.length); i += 2){\n vtx.lineTo(this.borders[i],this.borders[i+1]);\n }\n\n vtx.lineTo(this.borders[0],this.borders[1]);\n vtx.strokeStyle = \"blue\";\n vtx.stroke();\n vtx.fill();\n }", "function createLayer() {\r\n \r\n /* FUNCTION createLayer\r\n * Creates an empty layer of map size (WIDTH x HEIGHT)\r\n */\r\n \r\n return new Array(this.CONFIGURATION.WIDTH * this.CONFIGURATION.HEIGHT).fill(0);\r\n \r\n }", "function addLayer(layer) {\n map.add(layer);\n }", "function createOpenLayersMaps() {\n var canadaMapOptions = {\n center: new OpenLayers.LonLat(-73.55, 45.51)\n };\n var canadaMap = new OpenLayers.Map('map_canada', canadaMapOptions);\n var wholeEarth = new OpenLayers.Layer.WMS(\"OpenLayers WMS\",\n \"http://vmap0.tiles.osgeo.org/wms/vmap0\",\n { layers: 'basic' });\n var canada = new OpenLayers.Layer.WMS(\"Canada\",\n \"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap\",\n {\n layers: \"road,popplace\",\n transparent: \"true\",\n format: \"image/png\"\n },\n {\n isBaseLayer: false,\n visibility: false\n });\n canadaMap.addLayers([wholeEarth, canada]);\n canadaMap.addControl(new OpenLayers.Control.LayerSwitcher());\n canadaMap.zoomTo(4);\n }", "function setBoundries() {\n var deferred = $q.defer();\n _.each(stateConfig.tools.map.supportingLayers, function (b) {\n if (b.admin_level || b.admin_level === 0) {\n switch (b.admin_level) {\n case 0:\n service.boundaries.admin0[b.function] = b;\n break;\n case 1:\n service.boundaries.admin1[b.function] = b;\n break;\n case 2:\n service.boundaries.admin2[b.function] = b;\n break;\n case 3:\n service.boundaries.admin3[b.function] = b;\n break;\n }\n service.boundaries.aliases[b.function].push(b.alias);\n }\n });\n deferred.resolve();\n return deferred.promise;\n }", "function initMap() {\n\n\n var styles=[\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n \n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n \n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ];\n map=new google.maps.Map(document.getElementById('map'),{\n center:{lat: 23.022505 ,lng: 72.571362},\n zoom:13,\n styles:styles,\n mapTypeControl:false\n\n });\n\n\n var locations=[\n {title:\"Ahmedabad\" ,location:{lat: 23.022505 ,lng: 72.571362}},\n {title:\"surat\",location:{lat:21.17024, lng:72.831061}},\n {title:\"Gandhinagar\",location:{lat: 23.215635 ,lng:72.636941}},\n {title:\"vadodara\",location:{lat:22.307159 ,lng:73.181219}}\n\n ];\n\n var largeInfowindow=new google.maps.InfoWindow();\n \n for (var i=0;i<locations.length;i++){\n var marker=new google.maps.Marker({\n // map:map,\n position:locations[i].location,\n title:locations[i].title,\n id:1,\n animation: google.maps.Animation.DROP,\n }); \n\n\n\n markers.push(marker);\n //document.getElementById('closee').addEventListener('click',jesse);\n document.getElementById('openee').addEventListener('click',jesse1);\n marker.addListener('click',function(){\n populateInfoWindow(this,largeInfowindow);\n\n });\n\n\n\n \n \n }\n\n\n \n \n \n\n }", "function initMap (data) {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: latLong,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n displayGoogleMarkers (data,map);\n}", "function polygonGeneration() {\n earthquakeLayer = new WorldWind.RenderableLayer(\"Earthquakes\");\n\n for (var i = 0; i < GeoJSON.features.length; i++) {\n // var polygon = new EQPolygon(GeoJSON.features[i].geometry['coordinates']);\n // polygonLayer.addRenderable(polygon.polygon);\n\n // var polygon = new Cylinder(GeoJSON.features[i].geometry['coordinates'], GeoJSON.features[i].properties['mag'] * 5e5);\n // polygonLayer.addRenderable(polygon.cylinder);\n\n var placeMark = new EQPlacemark(GeoJSON.features[i].geometry.coordinates, GeoJSON.features[i].properties.mag);\n earthquakeLayer.addRenderable(placeMark.placemark);\n }\n }", "function markMap() {\n for (let key in Memory.warControl) {\n if (Memory.warControl[key]) {\n new RoomVisual(key).text(\n Memory.warControl[key].type,\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n if (Memory.warControl[key].siegePoint) {\n new RoomVisual(Memory.warControl[key].siegePoint).text(\n 'Siegepoint',\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n }\n}", "function drawNaturalEarth() {\n var tiles = tile();\n\n india.selectAll('.subunit')\n .classed('natural-earth', true);\n\n var clips = defs.append(\"clipPath\")\n .attr(\"id\", \"clip\");\n clips.append(\"use\")\n .attr(\"xlink:href\", \"#INX\");\n clips.append(\"use\")\n .attr(\"xlink:href\", \"#INA\");\n clips.append(\"use\")\n .attr(\"xlink:href\", \"#INN\");\n clips.append(\"use\")\n .attr(\"xlink:href\", \"#INL\");\n\n ne.attr(\"clip-path\", \"url(#clip)\")\n .selectAll(\"image\")\n .data(tiles)\n .enter().append(\"image\")\n .attr(\"xlink:href\", function(d) { return \"http://\" + [\"a\", \"b\", \"c\", \"d\"][Math.random() * 4 | 0] + \".tiles.mapbox.com/v3/mapbox.natural-earth-2/\" + d[2] + \"/\" + d[0] + \"/\" + d[1] + \".png\"; })\n .attr(\"width\", Math.round(tiles.scale))\n .attr(\"height\", Math.round(tiles.scale))\n .attr(\"x\", function(d) { return Math.round((d[0] + tiles.translate[0]) * tiles.scale); })\n .attr(\"y\", function(d) { return Math.round((d[1] + tiles.translate[1]) * tiles.scale); });\n}", "function zoomPreview(zf, xoff, yoff, visData) {\n //console.log(arguments.callee.name);\n visData.contextOcean.clearRect(0, 0, visData.displaySize[0], visData.displaySize[1]);\n visData.contextArrows.clearRect(0, 0, visData.displaySize[0], visData.displaySize[1]);\n zf = Number(zf);\n if (zf < 1) {\n zf = 1;\n }\n\n //Maintain the center of the landmap\n var parentSize = [$('#Map').width(), $('#Map').height()];\n\n // Calculate relative distance to center of image\n var distTop = (parentSize[1] / 2) - visData.previewPosition[1];\n var distLeft = (parentSize[0] / 2) - visData.previewPosition[0];\n distTop = distTop / visData.previewSize[1];\n distLeft = distLeft / visData.previewSize[0];\n\n // Calculate new width and height for the LandMap\n var newWidth = visData.landImageSize[0] * zf;\n var newHeight = visData.landImageSize[1] * zf;\n\n // Calculate distance to left in pixels\n var newLeft = newWidth * distLeft;\n var newTop = newHeight * distTop;\n // Subtract half the width of the parent container\n newLeft = -(newLeft - parentSize[0] / 2);\n newTop = -(newTop - parentSize[1] / 2);\n // Calculate new left and top in order to maintain the center\n\n $('#LandMap').width((newWidth) + 'px');\n $('#LandMap').height((newHeight) + 'px');\n $('#LandMap').css({ \"left\": newLeft + 'px' });\n $('#LandMap').css({ \"top\": newTop + 'px' });\n\n}", "function setNewPointLayerStyle(Layer, analysis_params){\n max_min = getMaxMin(Layer, analysis_params.energy, analysis_params.moisture, analysis_params.content, analysis_params.potential, analysis_params.year);\n max = max_min[0]\n min = max_min[1]\n var rs = d3.scaleLinear()\n .domain([0, max])\n .range([2,7]);\n\n Layer.setStyle(function(feature) {\n type = feature.getProperty(\"Type\");\n // As thermochemical facilities do not have a tag but are listed as dry we need to do the step below\n if (analysis_params.energy == '_dry'){\n moisture = '_dry'\n }\n else{\n moisture = analysis_params.moisture\n }\n if (type == 'crop'){\n if (moisture == ''){\n res_val = getTotalBiomass(feature, analysis_params.energy, '_dry', analysis_params.content, analysis_params.potential, analysis_params.year);\n cull_val = getTotalBiomass(feature, analysis_params.energy, '_wet', analysis_params.content, analysis_params.potential, analysis_params.year);\n size = rs(res_val+cull_val)\n if (res_val == 0 && cull_val == 0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n else{\n biomass_val = getTotalBiomass(feature, analysis_params.energy, analysis_params.moisture, analysis_params.content, analysis_params.potential, analysis_params.year);\n size = rs(biomass_val)\n if (biomass_val == 0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n }\n else{\n biomass_val = getTotalBiomass(feature, analysis_params.energy, analysis_params.moisture, analysis_params.content, analysis_params.potential, analysis_params.year);\n size = rs(biomass_val)\n if (biomass_val == 0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n if (size>7){\n size=7\n }\n return ({cursor: 'pointer',\n icon: { \n path: google.maps.SymbolPath.CIRCLE,\n strokeWeight: 0.5,\n strokeColor: 'black',\n strokeOpacity: opacity,\n scale: size,\n fillColor: 'red',\n fillOpacity: opacity,\n }\n })\n });\n}", "function mapBuild(){\n\tvar width = window.w * mapDim.ratio,\n\t\theight = width * 3/4;\t\t\t\t// 4:3 screen ratio\n\n\tvar projection = d3.geo.albers()\n\t\t.center([0, 42])\n .rotate([347, 0])\n .parallels([35, 45])\n .scale(height * 4)\n .translate([width/2, height/2]);\n\n\tvar path = d3.geo.path()\n\t\t.projection(projection);\n\n\tvar svg = d3.select(\"#map\").append(\"svg\")\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", height);\n\n\tvar sub = svg.append(\"g\")\n\t\t.attr(\"id\", \"subunits\");\n\n//\tsvg.append(\"rect\")\n//\t\t.attr(\"class\", \"background\")\n//\t\t.attr(\"width\", width)\n//\t\t.attr(\"height\", height);\n\t\n\tvar gcircles = svg.append(\"g\")\n\t\t.attr(\"class\", \"ranking\");\n\n\tvar subunits = topojson.feature(ita, ita.objects.regions);\n\tvar features = subunits.features;\n//\t\tvar boundaries = topojson.mesh(ita, ita.objects.regions, function(a, b){return a!==b;});\n\tranking = d3.nest().key(function(d){ return d.region; })\n\t\t.rollup(function(d, i){ return {coordinates:[+d[0].lon, +d[0].lat], value:+d[0].value}; })\n\t\t.entries(ranking);\n\n\tsub.selectAll(\".region\")\n\t\t.data(features)\n\t\t.enter().append(\"path\")\n\t\t\t.attr(\"class\", \"region\")\n\t\t\t.attr(\"id\", function(d, i){ return d.properties.name.toLowerCase().split(\"/\")[0]; })\n\t\t\t.on(\"click\", selected)\n\t\t\t.on(\"mouseover\", function(d){ highlight(d); })\n\t\t\t.on(\"mouseout\", function(d){ highlight(null); });\n\n//\t\tsub.selectAll(\".region-border\")\n//\t\t\t.datum(boundaries)\n//\t\t\t.enter().append(\"borders\")\n//\t\t\t.attr(\"class\", \"region-border\")\n//\t\t\t.attr(\"d\", path);\n\t\n\tcircles = gcircles.selectAll(\".ranking\")\n\t\t.data(ranking)\n\t\t.enter().append(\"circle\")\n\t\t\t.attr(\"class\", \"ranking\");\n\t\n\tvar hotels = hotelList();\n\t\n\tfunction drawMap(){\n\t\tsub.selectAll(\".region\")\n\t\t\t.attr(\"d\", path);\n\t\t\n\t\tgcircles.selectAll(\".ranking\")\n\t\t\t.attr(\"r\", function(d){return d.values.value * 3;})\n\t\t\t.attr(\"cx\", function(d){return projection(d.values.coordinates)[0];})\n\t\t\t.attr(\"cy\", function(d){return projection(d.values.coordinates)[1];});\n\t};\n\t\n\tfunction selected(region){\n\t\tvar x, y, zoom;\n\t\t\n\t\t// Select the region\n\t\t// If there is still a selected region or the current one has not a focus\n\t\t// and so it have not beening selected yet, then selects it (thus acquire the focus)\n\t\tif(regionSelected.path !== region || !regionSelected.focus){\n\t\t\tvar center = path.centroid(region);\n\t\t\tvar name = region.properties.name;\n\n\t\t\tx = center[0];\n\t\t\ty = center[1];\n\t\t\tzoom = 2;\n\t\t\t\n\t\t\tregionSelected.name = name.capitalize();\n\t\t\tregionSelected.path = region;\n\t\t\tregionSelected.focus = true;\n\t\t\t\n\t\t\tconsole.log(\"list hotel for '\" + regionSelected.name);\n\t\t\t\n\t\t\t// List all the hotel for the selected region\n\t\t\thotels.draw(regionSelected.name);\n\t\t\t\n\t\t\t// Dispatch the stateChane event to update all the charts\n\t\t\tdispatch.regionChange(regionSelected.name);\n\n\t\t\t// otherwise clear the selections\n\t\t} else {\n\t\t\tx = width / 2;\n\t\t\ty = height / 2;\n\t\t\tzoom = 1;\n\t\t\t\n\t\t\tregionSelected.name = null;\n\t\t\tregionSelected.path = null;\n\t\t\tregionSelected.focus = false;\n\t\t\t\n\t\t\t// Clear hotel list\n\t\t\thotels.draw(null);\n\t\t\t\n\t\t\t// Clear all the charts\n//\t\t\tdispatch.regionChange(null);\n\t\t}\n\t\t\n\t\t// Center and zoom the map\n\t\tsub.transition()\n\t\t.duration(duration)\n\t\t.attr(\"transform\", \"translate(\" + width/2 + \",\" + height/2 + \")scale(\" + zoom + \")translate(\" + -x + \",\" + -y + \")\")\n\t\t.style(\"stroke-width\", \"3px\");\n\t\n\t\tgcircles.selectAll(\"circle\").transition()\n\t\t\t.duration(duration)\n\t//\t\t.attr(\"r\", function(d){ return d.values.value * zoom; })\n\t\t\t.attr(\"transform\", \"translate(\" + width/2 + \",\" + height/2 + \")scale(\" + zoom + \")translate(\" + -x + \",\" + -y + \")\");\n\t\t\n\t\t// Update classes\n\t\tsub.selectAll(\"path\")\n\t\t\t.classed(\"highlight\", false)\n\t\t\t.classed(\"active\", regionSelected && function(d){ return d === regionSelected.path; });\n\t};\n\t\n\tfunction highlight(region){\n\t\tconsole.log(\"highlight '\" + regionSelected.name + \"' region data\");\n\n\t\tif(regionSelected.focus)\n\t\t\treturn;\n\t\t\n\t\t// Mouse is exited from map and no selectino was made\n\t\tif(region == null){\n\t\t\tsub.selectAll(\"path\")\n\t\t\t\t.classed(\"highlight\", false);\n\t\t\t\n\t\t\t// Restore mean values of the state TODO: to implement\n\t\t} else {\n\t\t\n\t\t// Select the region\n\t\t\tvar regionName = region.properties.name;\n\n\t\t\tregionSelected.name = regionName.capitalize();\n\t\t\tregionSelected.path = region;\n\t\t\tregionSelected.focus = false;\n\n\t\t\tsub.selectAll(\"path\")\n\t\t\t\t.classed(\"highlight\", regionSelected && function(d){ return d === regionSelected.path; });\n\t\n\t\t\t// Dispatch the stateChane event to update all the charts\n\t\t\tdispatch.regionChange(regionSelected.name);\n\t\t}\n\t};\n\t\n//\tfunction highlight(region){\n//\t\t// Highlight the current region\n//\t\tsub.selectAll(\"path\")\n//\t\t\t.classed(\"active\", function(d){return region;});\n//\t};\n\t\n\tfunction resize (w, h){\n\t\twidth = w * mapDim.ratio,\n\t\theight = width * 3/4;\n\t\t\n\t\tsvg.attr(\"width\", width)\n\t\t\t.attr(\"height\", height);\n\t\t\n\t\tprojection\n\t\t\t.translate([width/2, height/2])\n\t\t\t.scale(height*4);\n\t\t\n\t\tdrawMap();\n\t};\n\t\n\tdrawMap();\n\t\n\tdispatch.on(\"resize.map\", resize);\n}", "function createAccesories() {\n\t\t\tleaflet.marker = L.marker([50, 14]).addTo(leaflet.map);\n\t\t\tleaflet.geoJSON = L.geoJSON(S.level.rawData).addTo(leaflet.map);\n\t\t}", "function drawHitZones() {\r\n\tfill(153, 204, 255);\r\n\trect(5, height - 40, 50, 40);\r\n\trect(60, height - 40, 50, 40);\r\n\trect(115, height - 40, 50, 40);\r\n\trect(170, height - 40, 50, 40);\r\n}", "function updateBounds() {\n\n var crsNamesToLabels = new Object(); // It is not an array!\n crsNamesToLabels[\"EPSG:4326\"] = \"WGS84\";\n crsNamesToLabels[\"CRS:84\"] = \"WGS84\";\n crsNamesToLabels[\"EPSG:3035\"] = \"ETRS-LAEA\";\n crsNamesToLabels[\"EPSG:3034\"] = \"ETRS-LCC\";\n crsNamesToLabels[\"EPSG:4258\"] = \"ETRS89\";\n\n var proj = Ext.getCmp(\"lblProjection\");\n if (proj != undefined) {\n var curProj = map.getProjection();\n if (crsNamesToLabels[curProj] != undefined) {\n curProj = crsNamesToLabels[curProj];\n }\n proj.setText(curProj);\n }\n try {\n var digits = 3;\n if (useProjection == \"Lambert\")\n digits = 0;\n if (useProjection == \"WGS84\")\n digits = 5;\n cX.setValue(mapPanel.map.center.lon.toFixed(digits));\n cY.setValue(mapPanel.map.center.lat.toFixed(digits));\n }catch(ex)\n {\n }\n}", "function drawCountries() {\n\t\t\tvar map = VectorlayerService.getMap();\n\t\t\t\tvm.map = map;\n\t\t\t\tvm.mvtSource = VectorlayerService.getLayer();\n\t\t\t\t$timeout(function() {\n\t\t\t\t\tif ($state.params.countries) {\n\t\t\t\t\t\tvm.mvtSource.options.mutexToggle = false;\n\t\t\t\t\t\tvm.mvtSource.setStyle(invertedStyle);\n\t\t\t\t\t\tvm.mvtSource.layers[vm.mvtCountryLayerGeom].features[vm.current.iso].selected = true;\n\t\t\t\t\t\tvar countries = $state.params.countries.split('-vs-');\n\t\t\t\t\t\tangular.forEach(countries, function(iso) {\n\t\t\t\t\t\t\tvm.mvtSource.layers[vm.mvtCountryLayerGeom].features[iso].selected = true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvm.mvtSource.setStyle(countriesStyle);\n\t\t\t\t\t\tif ($state.params.item) {\n\t\t\t\t\t\t\tvm.mvtSource.layers[vm.mvtCountryLayerGeom].features[$state.params.item].selected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//vm.mvtSource.redraw();\n\t\t\t\t});\n\t\t\t\tvm.mvtSource.options.onClick = function(evt, t) {\n\n\t\t\t\t\tif (!vm.compare.active) {\n\t\t\t\t\t\tvar c = getNationByIso(evt.feature.properties[vm.iso_field]);\n\t\t\t\t\t\tif (typeof c[vm.structure.name] != \"undefined\") {\n\t\t\t\t\t\t\t$mdSidenav('left').open();\n\t\t\t\t\t\t\tvm.current = getNationByIso(evt.feature.properties[vm.iso_field]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttoastr.error('No info about this location!', evt.feature.properties.admin);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar c = getNationByIso(evt.feature.properties[vm.iso_field]);\n\t\t\t\t\t\tif (typeof c[vm.structure.name] != \"undefined\") {\n\t\t\t\t\t\t\tvm.toggleCountrieList(c);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttoastr.error('No info about this location!', evt.feature.properties.admin);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t}", "buildMap() {\n let map = this.make.tilemap({ key: this.key + 'map' });\n let tileset = map.addTilesetImage('tileset', this.key + 'tiles');\n this.mapData = {\n map: map,\n tileset: tileset,\n groundLayer: map.createLayer('ground', tileset),\n wallLayer: map.createLayer('walls', tileset),\n objectsLayer: map.createLayer('objetos', tileset),\n }\n\n this.mapData.wallLayer.setCollisionByProperty({ collides: true });\n this.mapData.objectsLayer.setCollisionByProperty({ collides: true });\n }", "function createMap(earthquakes, faultLines) {\n // Define outdoors, satellite, and darkmap layers\n // Outdoors layer\n var outdoors = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n // Satellite layer\n var satellite = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n // Darkmap layer\n var darkmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/dark-v9/tiles/256/{z}/{x}/{y}?\" +\n \"access_token=pk.eyJ1IjoidGhpc2lzY2MiLCJhIjoiY2poOWd1azk5MGNrZzMwcXA4cGxna3cxMCJ9.KqWFqxzqclQp-3_THGHiUA\");\n\n // Define a baseMaps object to hold base layers\n var baseMaps = {\n \"Outdoors\": outdoors,\n \"Satellite\": satellite,\n \"GrayScale\": darkmap,\n };\n\n // Create overlay object to hold overlay layers\n var overlayMaps = {\n \"Earthquakes\": earthquakes,\n \"Fault Lines\": faultLines\n };\n\n // Create map, default settings: outdoors and faultLines layers display on load\n var map = L.map(\"map\", {\n center: [37.09, -95.71],\n zoom: 4,\n layers: [outdoors, earthquakes],\n scrollWheelZoom: false\n });\n\n // Create a layer control\n // Pass in baseMaps and overlayMaps\n // Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(map);\n\n // Adds Legend\n var legend = L.control({position: 'bottomright'});\n legend.onAdd = function(map) {\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [\"0-1\", \"1-2\", \"2-3\", \"3-4\", \"4-5\", \"5+\"];\n\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML += '<i style=\"background:' + chooseColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n };\n\n return div;\n };\n legend.addTo(map);\n\n }", "set bounds(value) {}", "function filterDefaultLayers(map) {\n return !map.match(/^((lines|points|polygons|relations)(_osm)?|selection|location_bbox)(@.+)?$/)\n}", "createLayers () {\n // zero out x and y, because we start building from top left corner\n const x = 0;\n const y = 0;\n\n // Connecting the Map & Layer Data\n // ---------------------------------------------------------------------------------------- //\n // Creating the level from the tilemap - first pulling the 'Tiled' json from preload\n this.tileMap = this.add.tilemap('lvl-01-map');\n // Then connecting the json map from tiled with the tile-sheet image preloaded in phaser\n this.tileSet = this.tileMap.addTilesetImage('environment-tiles', 'environment-tiles');\n \n // Building the layers\n // ---------------------------------------------------------------------------------------- //\n // Creating our Layers by assigning their keys/names from Tiled editor, starting with the background layer\n this.floorLayer = this.tileMap.createDynamicLayer('ground-walkable', this.tileSet);\n // Then adding additional layers // The X, Y here is starting from the top left corner\n this.wallLayer = this.tileMap.createStaticLayer('ground-impassable', this.tileSet, x, y);\n // placing the collectable items\n this.crateLayer = this.tileMap.createStaticLayer('item-crates', this.tileSet, x, y);\n // placing the obstacles\n this.obstacleLayer = this.tileMap.createDynamicLayer('obstacle-pond', this.tileSet, x, y);\n \n // Adding Physics to the layers\n // ---------------------------------------------------------------------------------------- //\n // Make all tiles on the wallLayer collidable\n this.wallLayer.setCollisionByExclusion([-1]);\n }" ]
[ "0.6935572", "0.6467375", "0.62006646", "0.61611086", "0.61373556", "0.6132955", "0.61213917", "0.6110908", "0.6102509", "0.60612994", "0.6055654", "0.6024656", "0.5932326", "0.5907664", "0.5904399", "0.5863835", "0.5847823", "0.5835571", "0.5830434", "0.5807221", "0.5798253", "0.57980573", "0.5792004", "0.5782395", "0.57335734", "0.5724377", "0.57231975", "0.57169735", "0.56845576", "0.56706715", "0.5667966", "0.5645818", "0.56441224", "0.56373966", "0.56308925", "0.56242806", "0.5617517", "0.5614455", "0.5612566", "0.5608973", "0.56071347", "0.56010956", "0.5597813", "0.5594935", "0.5581988", "0.55811733", "0.5580077", "0.55775994", "0.55706066", "0.55684966", "0.55646724", "0.55604064", "0.55536985", "0.55492663", "0.5535188", "0.5533392", "0.5520299", "0.55201036", "0.5516265", "0.55118966", "0.5508109", "0.5506078", "0.5499598", "0.54973835", "0.54960966", "0.54943126", "0.5492081", "0.547947", "0.54706013", "0.54688466", "0.54667145", "0.54657954", "0.5453326", "0.5452653", "0.5441369", "0.5436675", "0.5436596", "0.54338783", "0.54324824", "0.54310983", "0.5428959", "0.54209375", "0.54197127", "0.54136735", "0.5411993", "0.54053116", "0.5401275", "0.53956246", "0.53915584", "0.5391526", "0.5386846", "0.538522", "0.5378598", "0.53779614", "0.5373399", "0.53717715", "0.53689384", "0.53656083", "0.53636163", "0.5363238", "0.53631043" ]
0.0
-1
buffer function of 1km
function buffer1(geometry) { return geometry.buffer(10000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buffer1(geometry) {\n return geometry.buffer(60).bounds();\n}", "function computeBuffer() {\r\n this._buffer = map.layerPointToLatLng(new L.Point(0,0)).lat -\r\n map.layerPointToLatLng(new L.Point(this.options.snapDistance, 0)).lat;\r\n }", "function buffer2(geometry) {\n return geometry.buffer(5000);\n}", "function buffer2(geometry) {\n return geometry.buffer(5000);\n}", "function buffer(geometry) {\n return geometry.buffer(60).bounds();\n}", "function bufferPoint(point) {\n\n // Clear stuff\n clearGraphics();\n\n // Center on selected point\n view.center = [point.longitude, point.latitude];\n\n // Zoom on selected point\n view.zoom = 10;\n\n // Add Legend to Map\n view.ui.add(legend, \"bottom-left\");\n\n // Add Layers to Map\n map.addMany([bufferLayer, pointLayer, PSPS, SDGE, WF]);\n\n // Set HTML ELments to Default Values \n document.getElementById(\"PowerOutage\").innerHTML = \"No\";\n document.getElementById(\"WildfiresBurning\").innerHTML = \"None\";\n document.getElementById(\"AcresBurned\").innerHTML = \"None\";\n document.getElementById(\"wildfireText\").innerHTML = \"Active Wildfires:\";\n document.getElementById(\"acresBurnedText\").innerHTML = \"Acres Burned:\";\n document.getElementById(\"nearestIncName\").innerHTML = \"\";\n document.getElementById(\"fireMapLink\").href =\n \"https://california.maps.arcgis.com/apps/webappviewer/index.html?id=cc900c7fbed44ce98365a08835cef6cf\";\n\n // Create Symbol\n var polySym = {\n type: \"simple-fill\",\n color: [112, 146, 190, 0.5],\n outline: {\n color: [0, 0, 0, 0.5],\n width: 2\n }\n };\n\n // Create Marker\n var pointSym = {\n type: \"picture-marker\",\n url: \"/Images/location-whte-100.png\",\n width: \"32px\",\n height: \"32px\"\n };\n\n // Add Symbol and Marker\n pointLayer.add(\n new Graphic({\n geometry: point,\n symbol: pointSym\n })\n );\n\n // Build Buffer\n var buffer = geometryEngine.geodesicBuffer(point, 20, \"miles\");\n\n // Add Buffer to Buffer Layer\n bufferLayer.add(\n new Graphic({\n geometry: buffer,\n symbol: polySym\n })\n );\n\n // Create Fire Query\n var fireQuery = new Query();\n fireQuery.geometry = buffer;\n fireQuery.outFields = [\"*\"];\n fireQuery.spatialRelationship = \"intersects\";\n\n // Create Fire Task\n var FireTask = new QueryTask({\n url:\n \"https://services3.arcgis.com/T4QMspbfLg3qTGWY/ArcGIS/rest/services/Public_Wildfire_Perimeters_View/FeatureServer/0\"\n });\n\n // Perform Fire Task\n FireTask.execute(fireQuery).then(function(results) {\n document.getElementById(\"wildfireText\").innerHTML = \"Active Wildfires Near Me:\";\n document.getElementById(\"acresBurnedText\").innerHTML = \"Acres Burned Near Me:\";\n document.getElementById(\"fireMapLink\").href =\n \"https://california.maps.arcgis.com/apps/webappviewer/index.html?id=cc900c7fbed44ce98365a08835cef6cf&marker=\" +\n point.longitude +\n \",\" +\n point.latitude +\n \"&level=12\";\n\n if (results.features) {\n for (x = 0; x < results.features.length; x++) {\n document.getElementById(\"WildfiresBurning\").innerHTML = (results.features.length).toString()\n .replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n document.getElementById(\"AcresBurned\").innerHTML =\n (results.features[x].attributes.GISAcres.toFixed(0)).toString()\n .replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n document.getElementById(\"nearestIncName\").innerHTML =\n \"(\" + results.features[x].attributes.IncidentName + \")\";\n }\n }\n });\n\n // Create AQI Query\n var aqiQuery = new Query();\n aqiQuery.geometry = buffer;\n aqiQuery.outFields = [\"*\"];\n aqiQuery.spatialRelationship = \"intersects\";\n\n // orderByFields\n\n // Create AQI Task\n var AQITask = new QueryTask({\n url:\n \"https://services.arcgis.com/cJ9YHowT8TU7DUyn/ArcGIS/rest/services/Air%20Now%20Current%20Monitor%20Data%20Public/FeatureServer/0\"\n });\n\n // Perform AQI Task\n AQITask.execute(aqiQuery).then(function(results) {\n\n console.log(results);\n\n if (results.features) {\n if (results.features.length > 0) {\n var aqiLevelText = \"\";\n var aqiLevelColor = \"\";\n var aqiLevelForecolor = \"\";\n\n var aqiNumber = results.features[0].attributes.PM_AQI;\n\n if (!(aqiNumber === null)) {\n if ((aqiNumber > -1) & (aqiNumber < 51)) {\n aqiLevelText = \"Good\";\n aqiLevelColor = \"00e400\";\n aqiLevelForecolor = \"000000\";\n } else {\n if ((aqiNumber > 50) & (aqiNumber < 101)) {\n aqiLevelText = \"Moderate\";\n\n aqiLevelColor = \"f1d800\"; //ffff00 e8e800 f6d600\n aqiLevelForecolor = \"000000\";\n } else {\n if ((aqiNumber > 100) & (aqiNumber < 151)) {\n aqiLevelText = \"Unhealthy for Sensitive Groups\";\n aqiLevelColor = \"ff7e00\";\n aqiLevelForecolor = \"FFFFFF\";\n } else {\n if ((aqiNumber > 150) & (aqiNumber < 201)) {\n aqiLevelText = \"Unhealthy\";\n aqiLevelColor = \"ff0000\";\n aqiLevelForecolor = \"FFFFFF\";\n } else {\n if ((aqiNumber > 200) & (aqiNumber < 301)) {\n aqiLevelText = \"Very Unhealthy\";\n aqiLevelColor = \"8f3f97\";\n aqiLevelForecolor = \"FFFFFF\";\n } else {\n aqiLevelText = \"Hazardous\";\n aqiLevelColor = \"7e0023\";\n aqiLevelForecolor = \"FFFFFF\";\n }\n }\n }\n }\n }\n\n document.getElementById(\"aqiText\").innerHTML = \"Air Quality Index:\";\n document.getElementById(\"aqiNumber\").innerHTML = aqiNumber;\n document.getElementById(\"aqiText2\").innerHTML =\n \"<div class=\\\"progress-bar progress-bar-striped progress-bar-animated p-0 m-0\\\" role=\\\"progressbar\\\" style=\\\"width: 100%; border-radius:3px; height:15px; background-color: #\" +\n aqiLevelColor +\n \";\\\" aria-valuenow=\\\"25\\\" aria-valuemin=\\\"0\\\" aria-valuemax=\\\"100\\\"></div>\";\n document.getElementById(\"aqiButton\").innerHTML =\n \"<a class=\\\"h4 btn btn-secondary rounded-50 p-x-md line-height-1-2em\\\" href=\\\"https://www.airnow.gov/aqi/aqi-basics/\\\"><div style=\\\"width:100%; border:3px solid #\" +\n aqiLevelColor +\n \"; padding-top:5px;padding-bottom: 5px;border-radius: 25px;padding-left:10px;padding-right: 10px;\\\">\" +\n aqiLevelText +\n \"</div><div>Learn about Your Air Quailty</div></a>\";\n } else {\n resetAqiFeilds();\n }\n } else {\n resetAqiFeilds();\n }\n } else {\n resetAqiFeilds();\n }\n });\n\n\n // Create PSPS and San Diego Query\n var powerQuery = new Query();\n powerQuery.geometry = buffer;\n powerQuery.outFields = [\"*\"];\n powerQuery.spatialRelationship = \"intersects\";\n powerQuery.where = \"Status='De-Energized'\";\n\n //Create Power Outages Task\n var PowerTask = new QueryTask({\n url:\n \"https://services.arcgis.com/BLN4oKB0N1YSgvY8/ArcGIS/rest/services/Power_Outages_(View)/FeatureServer/1\"\n });\n\n //Perform Power Outages Task\n PowerTask.execute(powerQuer2y).then(function(results) {\n if (results.features.length > 0) {\n document.getElementById(\"PowerOutage\").innerHTML = \"Yes\";\n } else {\n document.getElementById(\"PowerOutage\").innerHTML = \"No\";\n }\n });\n\n/*\n\t // Create San Diego Query\n \tvar query2 = new Query();\n \tquery2.geometry = buffer;\n \tquery2.outFields = [\"*\"];\n \tquery2.spatialRelationship = \"intersects\";\n \tquery2.where = \"'Status='De-Energized'\";\n\n //Create San Diego Task\n var SDGETask = new QueryTask({\n url: \"https://services.arcgis.com/S0EUI1eVapjRPS5e/ArcGIS/rest/services/Event_Outages_PSPS_Public_View/FeatureServer/0\"\n });\n \n \tvar SDGEOut = 0;\n \tvar SDGECust = 0;\n\n //Perform San Diego Task\n SDGETask.execute(query2).then(function (results) {\n if(results.features){\n for (x = 0; x < results.features.length; x++) {\n SDGEOut = results.features.length;\n SDGECust = results.features[x].attributes.TOTALCUST;\n }\n }\n });\n*/\n }", "function bufferPoint(point, distance) {\n\t // Given GeoJSON Point geometry in lon-lat, create circular buffer\n\t // at a given distance in meters\n\t var coords = point.coordinates;\n\n\t function destinationPoint(latdeg, lngdeg, distInMeter, angleDeg) {\n\t function radians(degrees) {\n\t return degrees * Math.PI / 180;\n\t }\n\t function degrees(radians) {\n\t return radians * 180 / Math.PI;\n\t }\n\t function earthRadius(lat) {\n\t var An = 6378137.0 * 6378137.0 * Math.cos(lat);\n\t var Bn = 6356752.3 * 6356752.3 * Math.sin(lat);\n\t var Ad = 6378137.0 * Math.cos(lat);\n\t var Bd = 6356752.3 * Math.sin(lat);\n\n\t return Math.sqrt((An * An + Bn * Bn) / (Ad * Ad + Bd * Bd));\n\t }\n\t // Convert to radians\n\t var θ = radians(angleDeg);\n\t var δ = Number(distInMeter / earthRadius(latdeg));\n\n\t // Covert lat and lon to radians\n\t var φ1 = radians(latdeg);\n\t var λ1 = radians(lngdeg);\n\n\t var φ2 = Math.asin(Math.sin(φ1) * Math.cos(δ) + Math.cos(φ1) * Math.sin(δ) * Math.cos(θ));\n\t var λ2 = λ1 + Math.atan2(Math.sin(θ) * Math.sin(δ) * Math.cos(φ1), Math.cos(δ) - Math.sin(φ1) * Math.sin(φ2));\n\n\t // Normalise to -180..+180°.\n\t λ2 = (λ2 + 3 * Math.PI) % (2 * Math.PI) - Math.PI;\n\n\t return [degrees(φ2), degrees(λ2)];\n\t };\n\n\t var n = 100;\n\t var newCoords = [];\n\t for (var k = 1; k <= n; k++) {\n\t var angle = 360 * (k / n);\n\t var latlon = destinationPoint(coords[1], coords[0], distance, angle);\n\t newCoords.push([latlon[1], latlon[0]]);\n\t }\n\n\t var circle = {\n\t type: 'Polygon',\n\t coordinates: [newCoords]\n\t };\n\n\t return circle;\n\t}", "RMS(buffer) {\n var total = 0;\n for (var i = 0, n = buffer.length; i < n; i++) {\n total += buffer[i] * buffer[i];\n }\n return Math.sqrt(total / n);\n }", "_bufferTransform() {\n if (this.mode === 'buffer') {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.bufferValue / 100;\n return { transform: `scale3d(${scale}, 1, 1)` };\n }\n return null;\n }", "function boom(cfg) {\n\n // a band with two values\n const b = clubber.band({ \n template: [cfg.index, cfg.index], // we want to calculate the gradient so we use the same metric twice \n smooth: [0.1, -0.1], // with different smoothing\n from: cfg.from, // midi note low limit\n to: cfg.to, // midi note high limit\n low: cfg.low, // midi volume filter low limit\n high: cfg.high // midi volume filter high limit\n });\n\n const d = new Float32Array(2);\n let v = 0;\n \n return function () {\n b(d); // compute same metric with different smoothing levels\n\n // diff the smoothed values to get the gradient and scale appropriately\n v = mix(v, smoothstep(0, 0.16, Math.abs(d[0] - d[1])), cfg.smooth || 0.1); \n\n // v is a normalized float to use as a modulator for properties\n return v;\n }\n\n }", "static bounce(k = 0.5) {\n const q = x => (121 / 16) * x * x;\n const w = x => ((121 / 4) * k) * Math.pow(x - (6 / 11), 2) + 1 - k;\n const r = x => 121 * k * k * Math.pow(x - (9 / 11), 2) + 1 - k * k;\n const t = x => 484 * k * k * k * Math.pow(x - (10.5 / 11), 2) + 1 - k * k * k;\n return x => Math.min(q(x), w(x), r(x), t(x));\n }", "function _bufferHandler(event) {\n\t\t\tif (!(event.bufferPercent === null)) {\n\t\t\t\t_currentBuffer = event.bufferPercent;\n\t\t\t}\n\t\t\t\n\t\t\tvar wid = _elements.timeSliderRail.getBoundingClientRect().width;\n\t\t\tvar bufferWidth = isNaN(Math.round(wid * _currentBuffer / 100)) ? 0 : Math.round(wid * _currentBuffer / 100);\n\t\t\t_css(_elements.timeSliderBuffer, {\n\t\t\t\twidth: bufferWidth\n\t\t\t});\n\t\t}", "function buf_switch(buf_button) {\n console.log(buf_button)\n if (buf_button == '1km') {\n init_extent = 1000;\n buf = hopeful_circle (co, 1000, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '0.6';\n document.getElementById('bdb1').style.opacity = '1';\n document.getElementById('bdb15').style.opacity = '0.6';\n document.getElementById('bdb2').style.opacity = '0.6';\n }\n else if (buf_button == '2km') {\n init_extent = 2000;\n buf = hopeful_circle (co, 2000, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '0.6';\n document.getElementById('bdb1').style.opacity = '0.6';\n document.getElementById('bdb15').style.opacity = '0.6';\n document.getElementById('bdb2').style.opacity = '1';\n } else if (buf_button == '1.5km') {\n init_extent = 1500;\n buf = hopeful_circle (co, 1500, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '0.6';\n document.getElementById('bdb1').style.opacity = '0.6';\n document.getElementById('bdb15').style.opacity = '1';\n document.getElementById('bdb2').style.opacity = '0.6';\n } else {\n init_extent = 500;\n buf = hopeful_circle (co, 500, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '1';\n document.getElementById('bdb1').style.opacity = '0.6';\n document.getElementById('bdb15').style.opacity = '0.6';\n document.getElementById('bdb2').style.opacity = '0.6';\n }\n}", "function updateBuffers() {\n \n triangleVerticestop[0] = triangleVerticestop[0] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[3] = triangleVerticestop[3] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[6] = triangleVerticestop[6] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[9] = triangleVerticestop[9] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[12] = triangleVerticestop[12] -0.03*Math.sin(2*Math.PI*((framecount+5)/20)); //repeat vetex, should be the same pace with the bommon fan\n triangleVerticestop[15] = triangleVerticestop[15] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[18] = triangleVerticestop[18] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[21] = triangleVerticestop[21] +0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n \n \n triangleVerticesmid[0] = triangleVerticesmid[0] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[3] = triangleVerticesmid[3] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[6] = triangleVerticesmid[6] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[9] = triangleVerticesmid[9] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[15] = triangleVerticesmid[15] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[12] = triangleVerticesmid[12] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0)); //repeat vetex, should be the same pace with the top fan\n triangleVerticesmid[18] = triangleVerticesmid[18] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[21] = triangleVerticesmid[21] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n //update the top buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffertop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticestop), gl.DYNAMIC_DRAW);\n vertexPositionBuffertop.itemSize = 3;\n vertexPositionBuffertop.numberOfItems = 8;\n //update the bottom buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffermid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticesmid), gl.DYNAMIC_DRAW);\n vertexPositionBuffermid.itemSize = 3;\n vertexPositionBuffermid.numberOfItems = 8;\n}", "getRealObstacleValue(k, x) {\n const exponent = 1 / (1 + Math.exp(-1 * k * x));\n return exponent;\n }", "function updateVelocity(){\r\n\t// ---- ADVECT -------------------------------------------------------------------------------------\r\n\tadvectBuffer.material.uniforms.texInput.value = u.texA;\r\n\tadvectBuffer.material.uniforms.velocity.value = u.texA;\r\n\tadvectBuffer.material.uniforms.dissipation.value = 1.0;\r\n\trenderer.render(advectBuffer.scene, camera, u.texB, true);\t\r\n\tu.swap();\r\n\r\n\tadvectBuffer.material.uniforms.time += 1;\t\r\n\tadvectBuffer.material.uniforms.res.value.x = w();\r\n\tadvectBuffer.material.uniforms.res.value.y = h();\r\n\r\n\t// ---- DIFFUSE -------------------------------------------------------------------------------------\r\n\t// jacobiBuffer.material.uniforms.alpha.value = alpha1();\r\n\t// jacobiBuffer.material.uniforms.rBeta.value = beta1();\r\n\t// for (var i = 0; i < DIFFUSE_ITER_MAX; i++) {\r\n\t// \tjacobiBuffer.material.uniforms.texInput.value = u.texA;\r\n\t// \tjacobiBuffer.material.uniforms.b.value = u.texA;\r\n\t// \trenderer.render(jacobiBuffer.scene, camera, u.texB, true);\t\r\n\t// \tu.swap();\r\n\t// }\t\r\n\r\n\t// jacobiBuffer.material.uniforms.res.value.x = w();\r\n\t// jacobiBuffer.material.uniforms.res.value.y = h();\r\n\t\r\n\t// ---- APPLY FORCES -------------------------------------------------------------------------------------\r\n\tforceBuffer.material.uniforms.texInput.value = u.texA;\r\n\trenderer.render(forceBuffer.scene, camera, u.texB, true);\r\n\tu.swap();\r\n\r\n\t// ---- PROJECT -------------------------------------------------------------------------------------\r\n\t// * ---- COMPUTE PRESSURE \t\r\n\t// * - CALC. div(u)\r\n\tdivBuffer.uniforms.texInput.value = u.texA;\r\n\trenderer.render(divBuffer.scene, camera, div_u.texA, true);\r\n\r\n\t// * - SOLVE POISSONS FOR P\r\n\tjacobiBuffer.material.uniforms.alpha.value = alpha2();\r\n\tjacobiBuffer.material.uniforms.rBeta.value = 1.0/4.0;\r\n\tfor (var i = 0; i < PRESSURE_ITER_MAX; i++) {\r\n\t\tjacobiBuffer.material.uniforms.texInput.value = p.texA;\r\n\t\tjacobiBuffer.material.uniforms.b.value = div_u.texA;\r\n\t\trenderer.render(jacobiBuffer.scene, camera, p.texB, true);\t\r\n\t\tp.swap();\r\n\t}\t\r\n\t\r\n\t// * ---- SUBTRACT grad(p)\r\n\tgradBuffer.uniforms.texInput.value = u.texA;\r\n\tgradBuffer.uniforms.pressure.value = p.texA;\r\n\trenderer.render(gradBuffer.scene, camera, u.texB, true);\r\n\tu.swap();\r\n}", "function bufferData() {\n\tvar mult = (RENDER_DISTANCE-1)/2;\n\n\tlMinR = MinR - (MaxR - MinR)*mult;\n\tlMaxR = MaxR + (MaxR - MinR)*mult;\n\tlMinI = MinI - (MaxI - MinI)*mult;\n\tlMaxI = MaxI + (MaxI - MinI)*mult;\n\n\tvar ref = (lMaxR - lMinR)/(dimX*RENDER_DISTANCE);\n\tvar imf = (lMaxI - lMinI)/(dimY*RENDE:qR_DISTANCE);\n\n\tvar progress = 0;\n\tvar val, z;\n\tvar count;\n\tvar color;\n\n\tfor (var x = 0; x < dimX*RENDER_DISTANCE; x++) {\n\t\tprogress = 100.0 * (x / (dimX * RENDER_DISTANCE));\n\n\t\tfor (var y = 0; y < dimY*RENDER_DISTANCE; y++) {\n\t\t\tval = new complex(lMinR + x*ref, lMaxI - y*imf);\n\t\t\tz = new complex(val.real, val.imaginary);\n\t\t\tcount = 0;\n\n\t\t\twhile (count < iterations && z.real + z.imaginary < rmax) {\n\t\t\t\tvar tmp = z.square();\n\t\t\t\tz.add(val);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\t//This is building the array in a function direction\n\t\t\t//Will correct later\n\t\t\tcolor = (count == iterations)?0:0xFFFFFF*(count/iterations);\n\t\t\ttoSend[x + y*dimX*RENDER_DISTANCE] = color;\n\t\t}\n\t}\n\tconsole.log(toSend[20000]);\n\n\tself.postMessage({\n\t\t'type': 'data',\n\t\t'buffer': toSend.buffer\n\t}, [toSend.buffer]);\n}", "calculateLoudness(buffer) {\n\n // first call or after resetMemory\n if (this.copybuffer == undefined) {\n // how long should the copybuffer be at least? \n // --> at least maxT should fit in and length shall be an integer fraction of buffer length\n let length = Math.floor(this.sampleRate * this.loudnessprops.maxT / buffer.length + 1) * buffer.length;\n this.copybuffer = new CircularAudioBuffer(context, this.nChannels, length, this.sampleRate);\n }\n\n //accumulate buffer to previous call\n this.copybuffer.concat(buffer);\n\n // must be gt nSamplesPerInterval\n // or: wait at least one interval time T to be able to calculate loudness\n if (this.copybuffer.getLength() < this.nSamplesPerInterval) {\n console.log('buffer too small ... have to eat more data');\n return NaN;\n }\n\n // get array of meansquares from buffer of overlapping intervals\n let meanSquares = this.getBufferMeanSquares(this.copybuffer, this.nSamplesPerInterval, this.nStepsize);\n\n // first stage filter\n this.filterBlocks(meanSquares, this.gamma_a);\n\n // second stage filter\n let gamma_r = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n gamma_r += (this.channelWeight[chIdx] * mean);\n }\n gamma_r = -0.691 + 10.0 * Math.log10(gamma_r) - 10.;\n\n this.filterBlocks(meanSquares, gamma_r);\n\n // gated loudness from filtered blocks\n let gatedLoudness = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n\n gatedLoudness += (this.channelWeight[chIdx] * mean);\n }\n gatedLoudness = -0.691 + 10.0 * Math.log10(gatedLoudness);\n\n //console.log(this.id, '- gatedLoudness:', gatedLoudness);\n\n return gatedLoudness;\n }", "Cr(){\n return 0.721 + 0.00725*(this.Lj*12/this.Dj)\n }", "get minBufferPx() { return this._minBufferPx; }", "get minBufferPx() { return this._minBufferPx; }", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n var dlon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n var us, vs;\n var con;\n if (Math.abs(Math.abs(lat) - __WEBPACK_IMPORTED_MODULE_3__constants_values__[\"b\" /* HALF_PI */]) <= __WEBPACK_IMPORTED_MODULE_3__constants_values__[\"a\" /* EPSLN */]) {\n if (lat > 0) {\n con = -1;\n }\n else {\n con = 1;\n }\n vs = this.al / this.bl * Math.log(Math.tan(__WEBPACK_IMPORTED_MODULE_3__constants_values__[\"f\" /* FORTPI */] + con * this.gamma0 * 0.5));\n us = -1 * con * __WEBPACK_IMPORTED_MODULE_3__constants_values__[\"b\" /* HALF_PI */] * this.al / this.bl;\n }\n else {\n var t = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, lat, Math.sin(lat));\n var ql = this.el / Math.pow(t, this.bl);\n var sl = 0.5 * (ql - 1 / ql);\n var tl = 0.5 * (ql + 1 / ql);\n var vl = Math.sin(this.bl * (dlon));\n var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;\n if (Math.abs(Math.abs(ul) - 1) <= __WEBPACK_IMPORTED_MODULE_3__constants_values__[\"a\" /* EPSLN */]) {\n vs = Number.POSITIVE_INFINITY;\n }\n else {\n vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;\n }\n if (Math.abs(Math.cos(this.bl * (dlon))) <= __WEBPACK_IMPORTED_MODULE_3__constants_values__[\"a\" /* EPSLN */]) {\n us = this.al * this.bl * (dlon);\n }\n else {\n us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;\n }\n }\n\n if (this.no_rot) {\n p.x = this.x0 + us;\n p.y = this.y0 + vs;\n }\n else {\n\n us -= this.uc;\n p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);\n p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);\n }\n return p;\n}", "function cahillKeyesRaw(mg) {\n var CK = {\n lengthMG: mg // magic scaling length\n };\n\n preliminaries();\n\n function preliminaries() {\n var pointN, lengthMB, lengthMN, lengthNG, pointU;\n var m = 29, // meridian\n p = 15, // parallel\n p73a,\n lF,\n lT,\n lM,\n l,\n pointV,\n k = sqrt(3);\n\n CK.lengthMA = 940 / 10000 * CK.lengthMG;\n CK.lengthParallel0to73At0 = CK.lengthMG / 100;\n CK.lengthParallel73to90At0 =\n (CK.lengthMG - CK.lengthMA - CK.lengthParallel0to73At0 * 73) / (90 - 73);\n CK.sin60 = k / 2; // √3/2 \n CK.cos60 = 0.5;\n CK.pointM = [0, 0];\n CK.pointG = [CK.lengthMG, 0];\n pointN = [CK.lengthMG, CK.lengthMG * tan(30 * radians)];\n CK.pointA = [CK.lengthMA, 0];\n CK.pointB = lineIntersection(CK.pointM, 30, CK.pointA, 45);\n CK.lengthAG = distance(CK.pointA, CK.pointG);\n CK.lengthAB = distance(CK.pointA, CK.pointB);\n lengthMB = distance(CK.pointM, CK.pointB);\n lengthMN = distance(CK.pointM, pointN);\n lengthNG = distance(pointN, CK.pointG);\n CK.pointD = interpolate(lengthMB, lengthMN, pointN, CK.pointM);\n CK.pointF = [CK.lengthMG, lengthNG - lengthMB];\n CK.pointE = [\n pointN[0] - CK.lengthMA * sin(30 * radians),\n pointN[1] - CK.lengthMA * cos(30 * radians)\n ];\n CK.lengthGF = distance(CK.pointG, CK.pointF);\n CK.lengthBD = distance(CK.pointB, CK.pointD);\n CK.lengthBDE = CK.lengthBD + CK.lengthAB; // lengthAB = lengthDE \n CK.lengthGFE = CK.lengthGF + CK.lengthAB; // lengthAB = lengthFE \n CK.deltaMEq = CK.lengthGFE / 45;\n CK.lengthAP75 = (90 - 75) * CK.lengthParallel73to90At0;\n CK.lengthAP73 = CK.lengthMG - CK.lengthMA - CK.lengthParallel0to73At0 * 73;\n pointU = [\n CK.pointA[0] + CK.lengthAP73 * cos(30 * radians),\n CK.pointA[1] + CK.lengthAP73 * sin(30 * radians)\n ];\n CK.pointT = lineIntersection(pointU, -60, CK.pointB, 30);\n\n p73a = parallel73(m);\n lF = p73a.lengthParallel73;\n lT = lengthTorridSegment(m);\n lM = lengthMiddleSegment(m);\n l = p * (lT + lM + lF) / 73;\n pointV = [0, 0];\n CK.pointC = [0, 0];\n CK.radius = 0;\n\n l = l - lT;\n pointV = interpolate(l, lM, jointT(m), jointF(m));\n CK.pointC[1] =\n (pointV[0] * pointV[0] +\n pointV[1] * pointV[1] -\n CK.pointD[0] * CK.pointD[0] -\n CK.pointD[1] * CK.pointD[1]) /\n (2 * (k * pointV[0] + pointV[1] - k * CK.pointD[0] - CK.pointD[1]));\n CK.pointC[0] = k * CK.pointC[1];\n CK.radius = distance(CK.pointC, CK.pointD);\n\n return CK;\n }\n\n //**** helper functions ****//\n\n // distance between two 2D coordinates\n\n function distance(p1, p2) {\n var deltaX = p1[0] - p2[0],\n deltaY = p1[1] - p2[1];\n return sqrt(deltaX * deltaX + deltaY * deltaY);\n }\n\n // return 2D point at position length/totallength of the line\n // defined by two 2D points, start and end.\n\n function interpolate(length, totalLength, start, end) {\n var xy = [\n start[0] + (end[0] - start[0]) * length / totalLength,\n start[1] + (end[1] - start[1]) * length / totalLength\n ];\n return xy;\n }\n\n // return the 2D point intersection between two lines defined\n // by one 2D point and a slope each.\n\n function lineIntersection(point1, slope1, point2, slope2) {\n // s1/s2 = slope in degrees\n var m1 = tan(slope1 * radians),\n m2 = tan(slope2 * radians),\n p = [0, 0];\n p[0] =\n (m1 * point1[0] - m2 * point2[0] - point1[1] + point2[1]) / (m1 - m2);\n p[1] = m1 * (p[0] - point1[0]) + point1[1];\n return p;\n }\n\n // return the 2D point intercepting a circumference centered\n // at cc and of radius rn and a line defined by 2 points, p1 and p2:\n // First element of the returned array is a flag to state whether there is\n // an intersection, a value of zero (0) means NO INTERSECTION.\n // The following array is the 2D point of the intersection.\n // Equations from \"Intersection of a Line and a Sphere (or circle)/Line Segment\"\n // at http://paulbourke.net/geometry/circlesphere/\n function circleLineIntersection(cc, r, p1, p2) {\n var x1 = p1[0],\n y1 = p1[1],\n x2 = p2[0],\n y2 = p2[1],\n xc = cc[0],\n yc = cc[1],\n a = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1),\n b = 2 * ((x2 - x1) * (x1 - xc) + (y2 - y1) * (y1 - yc)),\n c =\n xc * xc + yc * yc + x1 * x1 + y1 * y1 - 2 * (xc * x1 + yc * y1) - r * r,\n d = b * b - 4 * a * c,\n u1 = 0,\n u2 = 0,\n x = 0,\n y = 0;\n if (a === 0) {\n return [0, [0, 0]];\n } else if (d < 0) {\n return [0, [0, 0]];\n }\n u1 = (-b + sqrt(d)) / (2 * a);\n u2 = (-b - sqrt(d)) / (2 * a);\n if (0 <= u1 && u1 <= 1) {\n x = x1 + u1 * (x2 - x1);\n y = y1 + u1 * (y2 - y1);\n return [1, [x, y]];\n } else if (0 <= u2 && u2 <= 1) {\n x = x1 + u2 * (x2 - x1);\n y = y1 + u2 * (y2 - y1);\n return [1, [x, y]];\n } else {\n return [0, [0, 0]];\n }\n }\n\n // counterclockwise rotate 2D vector, xy, by angle (in degrees)\n // [original CKOG uses clockwise rotation]\n\n function rotate(xy, angle) {\n var xynew = [0, 0];\n\n if (angle === -60) {\n xynew[0] = xy[0] * CK.cos60 + xy[1] * CK.sin60;\n xynew[1] = -xy[0] * CK.sin60 + xy[1] * CK.cos60;\n } else if (angle === -120) {\n xynew[0] = -xy[0] * CK.cos60 + xy[1] * CK.sin60;\n xynew[1] = -xy[0] * CK.sin60 - xy[1] * CK.cos60;\n } else {\n // !!!!! This should not happen for this projection!!!!\n // the general algorith: cos(angle) * xy + sin(angle) * perpendicular(xy)\n // return cos(angle * radians) * xy + sin(angle * radians) * perpendicular(xy);\n //console.log(\"rotate: angle \" + angle + \" different than -60 or -120!\");\n // counterclockwise\n xynew[0] = xy[0] * cos(angle * radians) - xy[1] * sin(angle * radians);\n xynew[1] = xy[0] * sin(angle * radians) + xy[1] * cos(angle * radians);\n }\n\n return xynew;\n }\n\n // truncate towards zero like int() in Perl\n function truncate(n) {\n return Math[n > 0 ? \"floor\" : \"ceil\"](n);\n }\n\n function equator(m) {\n var l = CK.deltaMEq * m,\n jointE = [0, 0];\n if (l <= CK.lengthGF) {\n jointE = [CK.pointG[0], l];\n } else {\n l = l - CK.lengthGF;\n jointE = interpolate(l, CK.lengthAB, CK.pointF, CK.pointE);\n }\n return jointE;\n }\n\n function jointE(m) {\n return equator(m);\n }\n\n function jointT(m) {\n return lineIntersection(CK.pointM, 2 * m / 3, jointE(m), m / 3);\n }\n\n function jointF(m) {\n if (m === 0) {\n return [CK.pointA + CK.lengthAB, 0];\n }\n var xy = lineIntersection(CK.pointA, m, CK.pointM, 2 * m / 3);\n return xy;\n }\n\n function lengthTorridSegment(m) {\n return distance(jointE(m), jointT(m));\n }\n\n function lengthMiddleSegment(m) {\n return distance(jointT(m), jointF(m));\n }\n\n function parallel73(m) {\n var p73 = [0, 0],\n jF = jointF(m),\n lF = 0,\n xy = [0, 0];\n if (m <= 30) {\n p73[0] = CK.pointA[0] + CK.lengthAP73 * cos(m * radians);\n p73[1] = CK.pointA[1] + CK.lengthAP73 * sin(m * radians);\n lF = distance(jF, p73);\n } else {\n p73 = lineIntersection(CK.pointT, -60, jF, m);\n lF = distance(jF, p73);\n if (m > 44) {\n xy = lineIntersection(CK.pointT, -60, jF, 2 / 3 * m);\n if (xy[0] > p73[0]) {\n p73 = xy;\n lF = -distance(jF, p73);\n }\n }\n }\n return {\n parallel73: p73,\n lengthParallel73: lF\n };\n }\n\n function parallel75(m) {\n return [\n CK.pointA[0] + CK.lengthAP75 * cos(m * radians),\n CK.pointA[1] + CK.lengthAP75 * sin(m * radians)\n ];\n }\n\n // special functions to transform lon/lat to x/y\n function ll2mp(lon, lat) {\n var south = [0, 6, 7, 8, 5],\n o = truncate((lon + 180) / 90 + 1),\n p, // parallel\n m = (lon + 720) % 90 - 45, // meridian\n s = sign(m);\n\n m = abs(m);\n if (o === 5) o = 1;\n if (lat < 0) o = south[o];\n p = abs(lat);\n return [m, p, s, o];\n }\n\n function zoneA(m, p) {\n return [CK.pointA[0] + (90 - p) * 104, 0];\n }\n\n function zoneB(m, p) {\n return [CK.pointG[0] - p * 100, 0];\n }\n\n function zoneC(m, p) {\n var l = 104 * (90 - p);\n return [\n CK.pointA[0] + l * cos(m * radians),\n CK.pointA[1] + l * sin(m * radians)\n ];\n }\n\n function zoneD(m /*, p */) {\n // p = p; // just keep it for symmetry in signature\n return equator(m);\n }\n\n function zoneE(m, p) {\n var l = 1560 + (75 - p) * 100;\n return [\n CK.pointA[0] + l * cos(m * radians),\n CK.pointA[1] + l * sin(m * radians)\n ];\n }\n\n function zoneF(m, p) {\n return interpolate(p, 15, CK.pointE, CK.pointD);\n }\n\n function zoneG(m, p) {\n var l = p - 15;\n return interpolate(l, 58, CK.pointD, CK.pointT);\n }\n\n function zoneH(m, p) {\n var p75 = parallel75(45),\n p73a = parallel73(m),\n p73 = p73a.parallel73,\n lF = distance(CK.pointT, CK.pointB),\n lF75 = distance(CK.pointB, p75),\n l = (75 - p) * (lF75 + lF) / 2,\n xy = [0, 0];\n if (l <= lF75) {\n xy = interpolate(l, lF75, p75, CK.pointB);\n } else {\n l = l - lF75;\n xy = interpolate(l, lF, CK.pointB, p73);\n }\n return xy;\n }\n\n function zoneI(m, p) {\n var p73a = parallel73(m),\n lT = lengthTorridSegment(m),\n lM = lengthMiddleSegment(m),\n l = p * (lT + lM + p73a.lengthParallel73) / 73,\n xy;\n if (l <= lT) {\n xy = interpolate(l, lT, jointE(m), jointT(m));\n } else if (l <= lT + lM) {\n l = l - lT;\n xy = interpolate(l, lM, jointT(m), jointF(m));\n } else {\n l = l - lT - lM;\n xy = interpolate(l, p73a.lengthParallel73, jointF(m), p73a.parallel73);\n }\n return xy;\n }\n\n function zoneJ(m, p) {\n var p75 = parallel75(m),\n lF75 = distance(jointF(m), p75),\n p73a = parallel73(m),\n p73 = p73a.parallel73,\n lF = p73a.lengthParallel73,\n l = (75 - p) * (lF75 - lF) / 2,\n xy = [0, 0];\n\n if (l <= lF75) {\n xy = interpolate(l, lF75, p75, jointF(m));\n } else {\n l = l - lF75;\n xy = interpolate(l, -lF, jointF(m), p73);\n }\n return xy;\n }\n\n function zoneK(m, p, l15) {\n var l = p * l15 / 15,\n lT = lengthTorridSegment(m),\n lM = lengthMiddleSegment(m),\n xy = [0, 0];\n if (l <= lT) {\n // point is in torrid segment\n xy = interpolate(l, lT, jointE(m), jointT(m));\n } else {\n // point is in middle segment\n l = l - lT;\n xy = interpolate(l, lM, jointT(m), jointF(m));\n }\n return xy;\n }\n\n function zoneL(m, p, l15) {\n var p73a = parallel73(m),\n p73 = p73a.parallel73,\n lT = lengthTorridSegment(m),\n lM = lengthMiddleSegment(m),\n xy,\n lF = p73a.lengthParallel73,\n l = l15 + (p - 15) * (lT + lM + lF - l15) / 58;\n if (l <= lT) {\n //on torrid segment\n xy = interpolate(l, lT, jointE(m), jointF(m));\n } else if (l <= lT + lM) {\n //on middle segment\n l = l - lT;\n xy = interpolate(l, lM, jointT(m), jointF(m));\n } else {\n //on frigid segment\n l = l - lT - lM;\n xy = interpolate(l, lF, jointF(m), p73);\n }\n return xy;\n }\n\n // convert half-octant meridian,parallel to x,y coordinates.\n // arguments are meridian, parallel\n\n function mp2xy(m, p) {\n var xy = [0, 0],\n lT,\n p15a,\n p15,\n flag15,\n l15;\n\n if (m === 0) {\n // zones (a) and (b)\n if (p >= 75) {\n xy = zoneA(m, p);\n } else {\n xy = zoneB(m, p);\n }\n } else if (p >= 75) {\n xy = zoneC(m, p);\n } else if (p === 0) {\n xy = zoneD(m, p);\n } else if (p >= 73 && m <= 30) {\n xy = zoneE(m, p);\n } else if (m === 45) {\n if (p <= 15) {\n xy = zoneF(m, p);\n } else if (p <= 73) {\n xy = zoneG(m, p);\n } else {\n xy = zoneH(m, p);\n }\n } else {\n if (m <= 29) {\n xy = zoneI(m, p);\n } else {\n // supple zones (j), (k) and (l)\n if (p >= 73) {\n xy = zoneJ(m, p);\n } else {\n //zones (k) and (l)\n p15a = circleLineIntersection(\n CK.pointC,\n CK.radius,\n jointT(m),\n jointF(m)\n );\n flag15 = p15a[0];\n p15 = p15a[1];\n lT = lengthTorridSegment(m);\n if (flag15 === 1) {\n // intersection is in middle segment\n l15 = lT + distance(jointT(m), p15);\n } else {\n // intersection is in torrid segment\n p15a = circleLineIntersection(\n CK.pointC,\n CK.radius,\n jointE(m),\n jointT(m)\n );\n flag15 = p15a[0];\n p15 = p15a[1];\n l15 = lT - distance(jointT(m), p15);\n }\n if (p <= 15) {\n xy = zoneK(m, p, l15);\n } else {\n //zone (l)\n xy = zoneL(m, p, l15);\n }\n }\n }\n }\n return xy;\n }\n\n // from half-octant to megamap (single rotated octant)\n\n function mj2g(xy, octant) {\n var xynew = [0, 0];\n\n if (octant === 0) {\n xynew = rotate(xy, -60);\n } else if (octant === 1) {\n xynew = rotate(xy, -120);\n xynew[0] -= CK.lengthMG;\n } else if (octant === 2) {\n xynew = rotate(xy, -60);\n xynew[0] -= CK.lengthMG;\n } else if (octant === 3) {\n xynew = rotate(xy, -120);\n xynew[0] += CK.lengthMG;\n } else if (octant === 4) {\n xynew = rotate(xy, -60);\n xynew[0] += CK.lengthMG;\n } else if (octant === 5) {\n xynew = rotate([2 * CK.lengthMG - xy[0], xy[1]], -60);\n xynew[0] += CK.lengthMG;\n } else if (octant === 6) {\n xynew = rotate([2 * CK.lengthMG - xy[0], xy[1]], -120);\n xynew[0] -= CK.lengthMG;\n } else if (octant === 7) {\n xynew = rotate([2 * CK.lengthMG - xy[0], xy[1]], -60);\n xynew[0] -= CK.lengthMG;\n } else if (octant === 8) {\n xynew = rotate([2 * CK.lengthMG - xy[0], xy[1]], -120);\n xynew[0] += CK.lengthMG;\n } else {\n // TODO trap this some way.\n // ERROR!\n // print \"Error converting to M-map coordinates; there is no Octant octant!\\n\";\n //console.log(\"mj2g: something weird happened!\");\n return xynew;\n }\n\n return xynew;\n }\n\n // general CK map projection\n\n function forward(lambda, phi) {\n // lambda, phi are in radians.\n var lon = lambda * degrees,\n lat = phi * degrees,\n res = ll2mp(lon, lat),\n m = res[0], // 0 ≤ m ≤ 45\n p = res[1], // 0 ≤ p ≤ 90\n s = res[2], // -1 / 1 = side of m\n o = res[3], // octant\n xy = mp2xy(m, p),\n mm = mj2g([xy[0], s * xy[1]], o);\n\n return mm;\n }\n\n return forward;\n}", "function karaoke(evt) {\n let inputL = evt.inputBuffer.getChannelData(0),\n inputR = evt.inputBuffer.getChannelData(1),\n output = evt.outputBuffer.getChannelData(0),\n len = inputL.length,\n i = 0;\n for (; i < len; i++) {\n output[i] = inputL[i] - inputR[i];\n }\n}", "x1(t) {\n return (\n Math.sin(t / 200) * 125 + Math.sin(t / 20) * 125 + Math.sin(t / 30) * 125\n );\n }", "function mix_buffers(gran = 100) {\n ret_buf = [];\n wt.forEach((weight, index) => {\n for(var i = 0; i < Math.round(weight*gran)/100; i++) {\n ret_buf.push(...buffer_picker[index]); //jesus christ\n }\n });\n return ret_buf; //I hope you like arrays with 50k+ elements\n}", "get_buffer(){\n while(this.current < this.means.length - 2){\n if(this.means[this.current].key == this.parent.year0 - this.parent.window+1){\n this.buffer.push(this.means[this.current])\n this.current = this.current+1\n }else{\n break\n }\n }\n this.buffer = this.buffer.filter(d => d.key < this.parent.year0+1)\n }", "function regen() {\n minp = maxp\n let n, i, j\n for (i = 0; i < width; i++) {\n for (j = 0; j < height; j++) {\n n = grid[i][j]\n if (n>0) { // if this pixel has tally 0 then just ignore it\n if (tah[n]===undefined) { tah[n] = 1 } else { tah[n]++ } \n if (n<minp) minp = n \n }\n }\n }\n let sum = 0\n Object.keys(tah).forEach(i => {\n sum += (calg===2 ? 1 : \n calg===3 ? log(tah[i]) : \n calg===4 ? sqrt(tah[i]) :\n calg===5 ? tah[i] :\n calg===6 ? tah[i]**1.5 :\n calg===7 ? tah[i]**2 :\n calg===8 ? tah[i]**3 : \n 1)\n tah[i] = sum\n })\n const a = tah[minp]\n Object.keys(tah).forEach(i => { tah[i] = (tah[i]-a)/(sum-a) })\n // now tah[minp] is 0 and tah[maxp] is 1\n rx = minx\n}", "function getC0(m, k, b, delta){ return (1-k*delta*delta/(2*m)); }", "function calcBuffer(up, down, target) {\r\n\r\n var upload = up.split(' ');\r\n var download = down.split(' ');\r\n\r\n // convert everything to bytes and find the buffer, then convert back to appropriate units\r\n var buffer_bytes;\r\n if ( toBytes(download) > (toBytes(upload)/target) )\r\n buffer_bytes = toBytes(upload) - (toBytes(download) * target);\r\n else\r\n buffer_bytes = (toBytes(upload) / target) - toBytes(download);\r\n\r\n var buffer = fromBytes(buffer_bytes);\r\n\r\n if (COLOR) {\r\n var color = spanColor(buffer_bytes);\r\n return '<span style=\"color: ' + color + ';\">' + buffer + '</span>';\r\n } else return buffer;\r\n}", "function create_buffer_matrix(road_indices_array){\r\n var buffer_array = [];\r\n\r\n // Create a 30x30 matrix of 0s\r\n for (var i=0; i<matrix_map_size; i++){\r\n buffer_array.push([]);\r\n for (var j=0; j<matrix_map_size; j++){\r\n buffer_array[i].push(0);\r\n }\r\n }\r\n\r\n // Iterate over each road index\r\n for (var road_index=0; road_index<road_indices_array.length; road_index++){\r\n\r\n // Get 'row' value of the road index\r\n var row = road_indices_array[road_index][0];\r\n // Get 'col' value of the road index\r\n var col = road_indices_array[road_index][1];\r\n // Get the value indicating which kernel to use for buffer, 90 deg or\r\n // other\r\n var ker = road_indices_array[road_index][2];\r\n\r\n // Stamp a 1 for the direct road index.\r\n buffer_array[row][col] = 1;\r\n\r\n var kernel_index;\r\n // Iterate over the 3x3 kernel to look for buffer areas\r\n for (kernel_index=0; kernel_index < kern[ker].length; kernel_index++)\r\n {\r\n // x, y are the cells surrounding the road index\r\n var x = kern[ker][kernel_index][0] + row;\r\n var y = kern[ker][kernel_index][1] + col;\r\n\r\n // Make sure we're not out of bounds somewhere\r\n if (x >= 0 && x < matrix_map_size && y >= 0 && y < matrix_map_size){\r\n // Confusing, but basically that potential buffer isn't actually\r\n // another road pixel\r\n if (JSON.stringify(road_indices_array).indexOf(JSON.stringify([x, y, 0])) == -1 &&\r\n JSON.stringify(road_indices_array).indexOf(JSON.stringify([x, y, 1])) == -1)\r\n {\r\n // Make sure that we are NOT buffering on top of our city points\r\n if (JSON.stringify(city_points).indexOf(JSON.stringify([x,y])) == -1){\r\n // Finally set as buffer pixel\r\n buffer_array[x][y] = 2;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return buffer_array;\r\n}", "function main() {\n meter1.update(meter1.val + 0.1);\n}", "function hitungBmi(weight, height) {\n return weight / (height * height);\n}", "getBoneEndDistance(b) {\nreturn this.distance[b];\n}", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n var us, vs;\n var con;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n if (lat > 0) {\n con = -1;\n }\n else {\n con = 1;\n }\n vs = this.al / this.bl * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_3__[\"FORTPI\"] + con * this.gamma0 * 0.5));\n us = -1 * con * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"] * this.al / this.bl;\n }\n else {\n var t = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, lat, Math.sin(lat));\n var ql = this.el / Math.pow(t, this.bl);\n var sl = 0.5 * (ql - 1 / ql);\n var tl = 0.5 * (ql + 1 / ql);\n var vl = Math.sin(this.bl * (dlon));\n var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;\n if (Math.abs(Math.abs(ul) - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n vs = Number.POSITIVE_INFINITY;\n }\n else {\n vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;\n }\n if (Math.abs(Math.cos(this.bl * (dlon))) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n us = this.al * this.bl * (dlon);\n }\n else {\n us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;\n }\n }\n\n if (this.no_rot) {\n p.x = this.x0 + us;\n p.y = this.y0 + vs;\n }\n else {\n\n us -= this.uc;\n p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);\n p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);\n }\n return p;\n}", "pixelSpaceConversion(lat: number, worldSize: number, interpolationT: number): number { // eslint-disable-line\n return 1.0;\n }", "get bufferValue() { return this._bufferValue; }", "function allthere(){\n\n // settings.\n var gridres = 128, totX = 4096,\n totY = 391, pbrtShowrender = true,\n pbrtBounces = 2, pbrtBatch = 1,\n pbrtSamples = Math.floor((parseInt(document.location.hash.slice(1)) || 200) / pbrtBatch);\n var pbrtGrid = { // grid 外框\n bbox: new Float32Array(\n [-16.35320053100586, -3.3039399147033692, -13.719999885559082, 31.68820018768311, 13.706639957427978, 24.6798002243042])\n };\n\n // Shader helpers.\n function createShader(gl, source, type) { var shader=gl.createShader(type); gl.shaderSource(shader, source); gl.compileShader(shader); return shader; }\n function createProgram(gl, vertexShaderSource, fragmentShaderSource) {\n var program = gl.createProgram();\n gl.attachShader(program, createShader(gl, vertexShaderSource, gl.VERTEX_SHADER)); \n gl.attachShader(program, createShader(gl, fragmentShaderSource, gl.FRAGMENT_SHADER));\n gl.linkProgram(program);\n return program;\n };\n\n // Offscreen float buffers.\n function createOffscreen(gl,width,height) {\n var colorTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, colorTexture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, width, height, 0, gl.RGBA, gl.FLOAT, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n var depthBuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);\n gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\n var framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTexture, 0);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n return {\n framebuffer:framebuffer,colorTexture:colorTexture,depthBuffer:depthBuffer,width:width,height:height,gl:gl,\n bind : function() { this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, this.framebuffer); this.gl.viewport(0,0,this.width,this.height); },\n unbind : function() { this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, null); },\n delete : function() { this.gl.deleteRenderbuffer(this.depthBuffer); this.gl.deleteFramebuffer(this.framebuffer); this.gl.deleteTexture(this.colorTexture); }\n }\n }\n\n // setup output canvas, gl context and offscreen.\n var canvas = m(document.body.appendChild(document.createElement('canvas')),{width:800,height:450});\n m(canvas.style,{width:'800px',height:'450px'});\n var gl = canvas.getContext('webgl2'); if (!gl) alert('webGL2 required !');\n var ext1 = gl.getExtension('EXT_color_buffer_float'); if (!ext1) alert('videocard required');\n var ofscreen1 = createOffscreen(gl,canvas.width,canvas.height);\n \n // Shaders for accumulation and tonemap.\n var vs2=`#version 300 es\n #define POSITION_LOCATION 0\n precision lowp float;\n layout(location = POSITION_LOCATION) in vec3 position;\n void main() { gl_Position = vec4(position, 1.0); }`;\n\n var fs2=`#version 300 es\n precision lowp float;\n precision lowp sampler2D;\n uniform sampler2D accum;\n uniform float count; // 采样次数的倒数 相当于除以采样次数\n out vec4 color;\n void main() { color = vec4(sqrt(texelFetch(accum,ivec2(gl_FragCoord.xy),0).rgb*count),1.0); }\n `;\n\n // Actual Path tracing shaders.\n var vs=`#version 300 es\n #define POSITION_LOCATION 0\n precision highp float;\n precision highp int;\n uniform mat4 MVP;\n layout(location = POSITION_LOCATION) in vec3 position;\n out vec3 origin;\n void main()\n {\n origin = (MVP * vec4(0.0,0.0,0.0,1.0)).xyz;\n gl_Position = vec4(position, 1.0);\n }`;\n\n var fs=`#version 300 es\n precision highp float;\n precision highp int;\n precision highp sampler3D;\n precision highp sampler2D;\n\n #define EPSILON 0.000001\n\n uniform vec2 resolution;\n uniform float inseed;\n uniform int incount;\n \n uniform mat4 MVP, proj;\n\n uniform sampler3D grid;\n uniform sampler2D tris;\n uniform vec3 bbina, bbinb;\n\n vec3 bboxA, bboxB;\n\n in vec3 origin;\n out vec4 color;\n \n uint N = ${pbrtSamples}u, i;\n\n float seed;\n float minc(const vec3 x) { return min(x.x,min(x.y,x.z)); }\n \n float random_ofs=0.0;\n vec3 cosWeightedRandomHemisphereDirectionHammersley( const vec3 n ) {\n float x = float(i)/float(N); \n i = (i << 16u) | (i >> 16u);\n i = ((i & 0x55555555u) << 1u) | ((i & 0xAAAAAAAAu) >> 1u);\n i = ((i & 0x33333333u) << 2u) | ((i & 0xCCCCCCCCu) >> 2u);\n i = ((i & 0x0F0F0F0Fu) << 4u) | ((i & 0xF0F0F0F0u) >> 4u);\n i = ((i & 0x00FF00FFu) << 8u) | ((i & 0xFF00FF00u) >> 8u);\n vec2 r = vec2(x,(float(i) * 2.32830643653086963e-10 * 6.2831) + random_ofs);\n vec3 uu=normalize(cross(n, vec3(1.0,1.0,0.0))), vv=cross( uu, n );\n float sqrtx = sqrt(r.x);\n return normalize(vec3( sqrtx*cos(r.y)*uu + sqrtx*sin(r.y)*vv + sqrt(1.0-r.x)*n ));\n }\n\n vec4 trace( inout vec3 realori, const vec3 dir) {\n float len=0.0,l,b,mint=1000.0;\n vec2 minuv, mintri, cpos;\n vec3 scaler=vec3(bbinb/${gridres}.0)/dir,orig=realori,v0,v1,v2;\n for (int i=0;i<150;i++){\n vec3 txc=(orig-bboxA)*bboxB;\n if ( txc != clamp(txc,0.0,1.0)) break;\n vec3 tex=textureLod(grid,txc,0.0).rgb;\n for(int tri=0; tri<512; tri++) { \n if (tex.b<=0.0) break; cpos=tex.rg; tex.rb+=vec2(3.0/4096.0,-1.0); \n v1 = textureLodOffset(tris,cpos,0.0,ivec2(1,0)).rgb;\n v2 = textureLodOffset(tris,cpos,0.0,ivec2(2,0)).rgb;\n vec3 P = cross(dir,v2); float det=dot(v1,P); if (det>-EPSILON) continue;\n v0 = textureLod(tris,cpos,0.0).rgb;\n vec3 T=realori-v0; float invdet=1.0/det; float u=dot(T,P)*invdet; if (u < 0.0 || u > 1.0) continue;\n vec3 Q=cross(T,v1); float v=dot(dir,Q)*invdet; if(v<0.0||u+v>1.0) continue;\n float t=dot(v2, Q)*invdet; if (t>EPSILON && t<mint) { mint=t; mintri=cpos; minuv=vec2(u,v); } \n }\n b=max(0.0,-tex.b-1.0); txc=fract(txc*${gridres}.0);\n l=minc(scaler*mix(b+1.0-txc,-b-txc,vec3(lessThan(dir,vec3(0.0)))))+EPSILON*50.0;\n len += l;\n if (mint <= len) {\n realori += dir*(mint);\n mintri += vec2(0.0,1.0/4.0);\n vec3 n0 = -textureLod(tris,mintri,0.0).rgb;\n vec3 n1 = -textureLodOffset(tris,mintri,0.0,ivec2(1,0)).rgb;\n vec3 n2 = -textureLodOffset(tris,mintri,0.0,ivec2(2,0)).rgb;\n return vec4(normalize(n0*(1.0-minuv.x-minuv.y) + n1*minuv.x + n2*minuv.y),mint); \n } \n orig += dir*l;\n }\n return vec4(0.0); \n }\n \n void main()\n {\n bboxA=bbina; bboxB=1.0/bbinb; i=uint(incount);\n vec2 fc = vec2(gl_FragCoord.xy), fcu=fc/resolution;\n seed = inseed +fcu.x+fcu.y; \n vec2 aa = fract(sin(vec2(seed,seed+0.1))*vec2(43758.5453123,22578.1459123));\n random_ofs = fract(gl_FragCoord.x * gl_FragCoord.y * inseed + aa.x)*6.2831;\n vec4 view = proj * vec4((fc+aa)/(resolution/2.0)-1.0,0.0,1.0);\n view = normalize(MVP*vec4(view.xyz/view.w,0.0));\n vec3 orig=origin,v1=(bboxA-orig)/view.xyz,v2=v1+(bbinb-vec3(0.2))/view.xyz,far=max(v1,v2),near=min(v1,v2);\n float en=max(near.x,max(near.y,near.z)), ex=min(far.x,min(far.y,far.z));\n if (ex < 0.0 || en > ex) { color=vec4(1.0); return; }\n orig += max(0.0,en)*view.xyz;\n vec4 hit=trace(orig,view.xyz);\n if (hit.w <= 0.0) { color.rgb = vec3(1.0); return; }\n hit=trace(orig, -cosWeightedRandomHemisphereDirectionHammersley(hit.xyz));\n if (hit.w <= 0.0) { color.rgb = vec3(0.8); return; }\n }`;\n\n // Upload polygon and acceleration data.\n var texture = gl.createTexture(); // grid\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_3D, texture);\n gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage3D( gl.TEXTURE_3D, 0, gl.RGB32F, gridres, gridres, gridres, 0, gl.RGB, gl.FLOAT, map ); \n\n var texture2 = gl.createTexture(); // trangle\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_2D, texture2);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB32F, totX, totY*4, 0, gl.RGB, gl.FLOAT, polyData ); \n\n // Create the path tracing program, grab the uniforms.\n var program = createProgram(gl, vs, fs);\n var mvpLocation = gl.getUniformLocation(program, 'MVP');\n var pLocation = gl.getUniformLocation(program, 'proj');\n var uniformgridLocation = gl.getUniformLocation(program, 'grid');\n var uniformtrisLocation = gl.getUniformLocation(program, 'tris');\n var uniformSeed = gl.getUniformLocation(program, 'inseed');\n var uniformCount = gl.getUniformLocation(program, 'incount');\n var uniformbbaLocation = gl.getUniformLocation(program, 'bbina');\n var uniformbbbLocation = gl.getUniformLocation(program, 'bbinb');\n var uniformresLocation = gl.getUniformLocation(program, 'resolution');\n\n // Create the accumulation program, grab thos uniforms.\n var program2 = createProgram(gl, vs2, fs2);\n var uniformAccumLocation = gl.getUniformLocation(program2, 'accum');\n var uniformCountLocation = gl.getUniformLocation(program2, 'count');\n\n // Setup the quad that will drive the rendering.\n var vertexPosBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 0, 1, -1, 0, 1, 1, 0, 1, 1, 0, -1, 1, 0, -1, -1, 0]), gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, null); \n\n var vertexArray = gl.createVertexArray();\n gl.bindVertexArray(vertexArray);\n var vertexPosLocation = 0;\n gl.enableVertexAttribArray(vertexPosLocation);\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);\n gl.vertexAttribPointer(vertexPosLocation, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.bindVertexArray(null);\n\n // Setup some matrices (stole values from jimmy|rig)\n //相机矩阵 \n var matrix = new Float32Array(\n [6.123234262925839e-17, 0, 1, 0,\n -0.8660253882408142, 0.5, 5.302876566937394e-17, 0,\n -0.5, -0.8660253882408142, 3.0616171314629196e-17, 0,\n 6.535898208618164, 19.320507049560547, -4.0020835038019837e-16, 1]);\n // 场景矩阵\n var matrix2 = new Float32Array([1.7777777910232544, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -0.49950000643730164, 0, 0, 1, 0.5005000233650208]);\n var viewportMV = new Float32Array(matrix); \n var accum_count=1, diff=true, abort=false;\n\n // frame handler. \n function frame() {\n // Do we need to restart rendering (i.e. viewport change)\n if (diff) { // 如果视角变化,设置新的矩阵,清空framebuffer重新渲染\n matrix.set(viewportMV);\n ofscreen1.bind(); gl.clear(gl.COLOR_BUFFER_BIT); ofscreen1.unbind();\n accum_count=1;\n abort=undefined;\n diff=false;\n }\n\n // Render more samples.\n if (!abort) { \n // Bind the offscreen and render a new sample.\n ofscreen1.bind();\n gl.useProgram(program);\n gl.uniformMatrix4fv(mvpLocation, false, matrix);\n gl.uniformMatrix4fv(pLocation, false, matrix2);\n gl.uniform1i(uniformgridLocation, 0);\n gl.uniform1i(uniformtrisLocation, 1);\n gl.uniform3fv(uniformbbaLocation, pbrtGrid.bbox.slice(0,3));\n gl.uniform3fv(uniformbbbLocation, pbrtGrid.bbox.slice(3,6));\n gl.uniform2fv(uniformresLocation, new Float32Array([canvas.width,canvas.height]));\n gl.uniform1f(uniformSeed,Math.random());\n gl.uniform1i(uniformCount,(accum_count)%pbrtSamples);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_3D, texture); // grid\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_2D, texture2); // trangle\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE,gl.ONE);\n gl.bindVertexArray(vertexArray);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindVertexArray(null);\n gl.disable(gl.BLEND);\n ofscreen1.unbind();\n\n // Display progress (mixdown from float to ldr) \n gl.useProgram(program2);\n gl.uniform1i(uniformAccumLocation, 0);\n gl.uniform1f(uniformCountLocation, 1.0/accum_count);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, ofscreen1.colorTexture);\n\n gl.bindVertexArray(vertexArray);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindVertexArray(null);\n\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n // Stop if we're done.\n if (++accum_count>pbrtSamples) abort =true;\n }\n requestAnimationFrame(frame);\n }\n requestAnimationFrame(frame);\n\n var angle=-Math.PI/2, angle2=Math.PI/3,zoom=0;\n canvas.oncontextmenu =function(e) { e.preventDefault(); e.stopPropagation(); }\n canvas.onmousemove = function(e) {\n if (!e.buttons) return;\n if (e.buttons==1) { angle += e.movementX/100; angle2 += e.movementY/100; } else { zoom += e.movementX/10; }\n viewportMV = t(rX(rY(i(),angle),angle2),[0,4,-20+zoom]);\n diff = true;\n }\n }", "updatePoints( points ){\n if( points == 0 )\n return;\n if( points < 0 )\n points = 0;\n this.points.current = points;\n this.var.ratio = this.points.current / this.points.max;\n this.array.filled = [];\n let k = 1 + Math.sqrt( 2 );\n let t = this.const.a * Math.sqrt( ( k - 1 ) / k ) * 2;\n let vec = null;\n let addVec = null;\n\n switch (this.data.type.num ) {\n case 0:\n vec = createVector( -this.const.a, -this.const.b );\n vec.add( this.center );\n this.array.filled.push( vec );\n vec = createVector( this.const.a * ( 2 * this.var.ratio - 1 ), -this.const.b );\n vec.add( this.center );\n this.array.filled.push( vec );\n vec = createVector( this.const.a * ( 2 * this.var.ratio - 1 ), this.const.b );\n vec.add( this.center );\n this.array.filled.push( vec );\n vec = createVector( -this.const.a, this.const.b );\n vec.add( this.center );\n this.array.filled.push( vec );\n break;\n case 2:\n vec = createVector( -this.const.a, 0 );\n vec.add( this.center );\n this.array.filled.push( vec );\n if( this.var.ratio <= 0.5 ){\n vec = createVector( 2 * this.const.a * ( this.var.ratio - 0.5 ), 0 );\n vec.add( this.center );\n this.array.filled.push( vec );\n vec = this.array.filled[0].copy();\n addVec = createVector( this.const.a, -this.const.a );\n addVec.mult( this.var.ratio * 2 );\n vec.add( addVec );\n this.array.filled.push( vec );\n }\n else {\n vec = createVector( 0, -this.const.a );\n vec.add( this.center );\n this.array.filled.push( vec );\n vec = this.center.copy();\n this.array.filled.push( vec );\n vec = this.array.filled[1].copy();\n addVec = createVector( this.const.a, this.const.a );\n addVec.mult( ( this.var.ratio - 0.5 ) * 2 );\n vec.add( addVec );\n this.array.filled.push( vec );\n vec = createVector( 2 * this.const.a * ( this.var.ratio - 0.5 ), 0 );\n vec.add( this.center );\n this.array.filled.push( vec );\n }\n break;\n case 3:\n vec = createVector( -this.const.a, 0 );\n vec.add( this.center );\n this.array.filled.push( vec );\n if( this.var.ratio <= 0.5 ){\n vec = createVector( 2 * this.const.a * ( this.var.ratio - 0.5 ), 0 );\n vec.add( this.center );\n this.array.filled.push( vec );\n vec = this.array.filled[0].copy();\n addVec = createVector( this.const.a, this.const.a );\n addVec.mult( this.var.ratio * 2 );\n vec.add( addVec );\n this.array.filled.push( vec );\n }\n else {\n vec = createVector( 0, this.const.a );\n vec.add( this.center );\n this.array.filled.push( vec );\n vec = this.center.copy();\n this.array.filled.push( vec );\n vec = this.array.filled[1].copy();\n addVec = createVector( this.const.a, -this.const.a );\n addVec.mult( ( this.var.ratio - 0.5 ) * 2 );\n vec.add( addVec );\n this.array.filled.push( vec );\n vec = createVector( 2 * this.const.a * ( this.var.ratio - 0.5 ), 0 );\n vec.add( this.center );\n this.array.filled.push( vec );\n }\n break;\n case 4:\n if( this.var.ratio > 0.5 ){\n this.array.filled.push( this.array.vertex[0].copy() );\n this.array.filled.push( this.array.vertex[1].copy() );\n vec = this.array.vertex[1].copy();\n let angle = Math.PI * 3 * 5 / 8 ;\n\n addVec = createVector(\n Math.sin( angle ) * t * ( this.var.ratio - 0.5 ),\n Math.cos( angle ) * t * ( this.var.ratio - 0.5 ) );\n vec.add( addVec );\n this.array.filled.push( vec );\n }\n else{\n vec = this.array.vertex[0].copy();\n let angle = Math.PI * 3 * 7 / 8 ;\n addVec = createVector(\n Math.sin( angle ) * t * ( -this.var.ratio ),\n Math.cos( angle ) * t * ( -this.var.ratio ) );\n vec.add( addVec );\n this.array.filled.push( vec );\n this.array.filled.push( this.array.vertex[0].copy() );\n }\n break;\n case 5:\n if( this.var.ratio > 0.5 ){\n this.array.filled.push( this.array.vertex[0].copy() );\n this.array.filled.push( this.array.vertex[1].copy() );\n vec = this.array.vertex[1].copy();\n let angle = -Math.PI * 3 * 5 / 8 ;\n\n addVec = createVector(\n Math.sin( angle ) * t * ( this.var.ratio - 0.5 ),\n Math.cos( angle ) * t * ( this.var.ratio - 0.5 ) );\n vec.add( addVec );\n this.array.filled.push( vec );\n }\n else{\n vec = this.array.vertex[0].copy();\n let angle = -Math.PI * 3 * 7 / 8 ;\n addVec = createVector(\n Math.sin( angle ) * t * ( -this.var.ratio ),\n Math.cos( angle ) * t * ( -this.var.ratio ) );\n vec.add( addVec );\n this.array.filled.push( vec );\n this.array.filled.push( this.array.vertex[0].copy() );\n }\n break;\n case 7:\n case 8:\n if( this.var.ratio < 0.125 ){\n this.array.filled.push( this.array.vertex[3].copy() );\n this.array.filled.push( this.array.vertex[3].copy() );\n this.array.filled.push( this.array.vertex[3].copy() );\n\n let scale = this.var.ratio * this.const.a * 2;\n addVec = createVector( 0, -scale );\n this.array.filled[1].add( addVec );\n\n scale = this.var.ratio / 0.125 * this.const.a / 2;\n let angel = Math.PI * 4 / 3;\n if( this.data.type.num == 8 )\n angel = Math.PI * 2 / 3;\n addVec = createVector( Math.sin( angel ) * scale, Math.cos( angel ) * scale );\n this.array.filled[2].add( addVec );\n }\n else\n if( this.var.ratio < 0.875 ){\n this.array.filled.push( this.array.vertex[2].copy() );\n this.array.filled.push( this.array.vertex[3].copy() );\n this.array.filled.push( this.array.vertex[2].copy() );\n this.array.filled.push( this.array.vertex[3].copy() );\n\n let scale = this.var.ratio * this.const.a * 2;\n addVec = createVector( 0, -scale );\n this.array.filled[1].add( addVec );\n\n scale = ( this.var.ratio - 0.125 ) / 0.75 * this.const.a * 1.5;\n addVec = createVector( 0, -scale );\n this.array.filled[2].add( addVec );\n }\n else{\n this.array.filled.push( this.array.vertex[1].copy() );\n this.array.filled.push( this.array.vertex[3].copy() );\n this.array.filled.push( this.array.vertex[2].copy() );\n this.array.filled.push( this.array.vertex[3].copy() );\n this.array.filled.push( this.array.vertex[0].copy() );\n\n let scale = this.var.ratio * this.const.a * 2;\n addVec = createVector( 0, -scale );\n this.array.filled[3].add( addVec );\n\n scale = ( 1 - ( this.var.ratio - 0.875 ) / 0.125 ) * this.const.a / 2;\n let angel = Math.PI * 5 / 3;\n if( this.data.type.num == 8 )\n angel = Math.PI / 3;\n addVec = createVector( Math.sin( angel ) * scale, Math.cos( angel ) * scale );\n this.array.filled[4].add( addVec );\n }\n break;\n }\n }", "constructor(buf /*:ArrayBuffer*/) {\n super();\n this.box_size = [1, 1, 1];\n this.from_ccp4(buf, false);\n if (this.unit_cell == null) return;\n // unit of the map from dials.rs_mapper is (100A)^-1, we scale it to A^-1\n // We assume the \"unit cell\" is cubic -- as it is in rs_mapper.\n const par = this.unit_cell.parameters;\n this.box_size = [par[0]/ 100, par[1] / 100, par[2] / 100];\n this.unit_cell = null;\n }", "effect(){\n return(player.points.pow(0.25).times(0.5).plus(1))\n }", "function gw(t,e,r,n){var a=4,i=.001,s=1e-7,o=10,u=11,l=1/(u-1),f=typeof Float32Array<\"u\";if(arguments.length!==4)return!1;for(var c=0;c<4;++c)if(typeof arguments[c]!=\"number\"||isNaN(arguments[c])||!isFinite(arguments[c]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var v=f?new Float32Array(u):new Array(u);function h(S,L){return 1-3*L+3*S}function d(S,L){return 3*L-6*S}function g(S){return 3*S}function b(S,L,A){return((h(L,A)*S+d(L,A))*S+g(L))*S}function p(S,L,A){return 3*h(L,A)*S*S+2*d(L,A)*S+g(L)}function m(S,L){for(var A=0;A<a;++A){var O=p(L,t,r);if(O===0)return L;var N=b(L,t,r)-S;L-=N/O}return L}function y(){for(var S=0;S<u;++S)v[S]=b(S*l,t,r)}function E(S,L,A){var O,N,R=0;do N=L+(A-L)/2,O=b(N,t,r)-S,O>0?A=N:L=N;while(Math.abs(O)>s&&++R<o);return N}function C(S){for(var L=0,A=1,O=u-1;A!==O&&v[A]<=S;++A)L+=l;--A;var N=(S-v[A])/(v[A+1]-v[A]),R=L+N*l,I=p(R,t,r);return I>=i?m(S,R):I===0?R:E(S,L,L+l)}var D=!1;function w(){D=!0,(t!==e||r!==n)&&y()}var T=function(L){return D||w(),t===e&&r===n?L:L===0?0:L===1?1:b(C(L),e,n)};T.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var x=\"generateBezier(\"+[t,e,r,n]+\")\";return T.toString=function(){return x},T}", "get minBufferPx() {\n return this._minBufferPx;\n }", "initBuffers() {\n let controlPoints =\n //grau 1 em u e grau 1 em v\n [\n // u=1\n [\n [-0.5, 0, 0.5, 1],\n [-0.5, 0, -0.5, 1]\n\n ],\n //u=2\n [\n [0.5, 0, 0.5, 1],\n [0.5, 0, -0.5, 1]\n\n ],\n\n ];\n\n let surface = new CGFnurbsSurface(1, 1, controlPoints);\n this.object = new CGFnurbsObject(this.scene, this.npartsU, this.npartsV, surface);\n }", "function BufferPreset(){\n\n\tthis.output = audioCtx.createGain();\n\n\tthis.playbackRateInlet = new MyGain(1);\n\n}", "render() {\n this.drawRef.open();\n this.drawRef.newL(this.startLoc.x, this.startLoc.y);\n this.OffsetIterator = 0;\n for (let i = 0; i < this.NeonData.length; i++) {\n //add the offsets here from audio data. Add extra manipulation for \"jittery\" effect aka looks like a lightning stream\n if (i < 10 || (i > 25 && i != 28)) {\n this.mul = Math.random() * 2 < 1 ? 1.5 : -1.5;\n this.drawRef.quadCurveTo(\n this.NeonData[i][0],\n this.NeonData[i][1],\n this.NeonData[i][2] - this.mul,\n this.NeonData[i][3] - this.Offsets[this.OffsetIterator] / 8 + this.mul\n );\n } else if (i != 28) {\n this.mul = Math.random() * 2 < 1 ? 1.25 : -1.25;\n if (i == 10 || i == 12 || i == 14) {\n this.drawRef.quadCurveTo(\n this.NeonData[i][0],\n this.NeonData[i][1],\n this.NeonData[i][2] -\n this.Offsets[this.OffsetIterator] / 6 +\n this.mul, //10 and 26\n this.NeonData[i][3] - this.Offsets[this.OffsetIterator] / 6\n );\n } else if (i == 17 || i == 19 || i == 21 || i == 23 || i == 25) {\n this.drawRef.quadCurveTo(\n this.NeonData[i][0],\n this.NeonData[i][1],\n this.NeonData[i][2] +\n this.Offsets[this.OffsetIterator] / 6 +\n this.mul, //10 and 26\n this.NeonData[i][3] - this.Offsets[this.OffsetIterator] / 6\n );\n } else {\n if (i <= 15) {\n this.drawRef.quadCurveTo(\n this.NeonData[i][0],\n this.NeonData[i][1],\n this.NeonData[i][2] +\n this.Offsets[this.OffsetIterator] / 6 +\n this.mul, //10 and 26\n this.NeonData[i][3] + this.Offsets[this.OffsetIterator] / 6\n );\n } else {\n this.drawRef.quadCurveTo(\n this.NeonData[i][0],\n this.NeonData[i][1],\n this.NeonData[i][2] -\n this.Offsets[this.OffsetIterator] / 6 +\n this.mul, //10 and 26\n this.NeonData[i][3] + this.Offsets[this.OffsetIterator] / 6\n );\n }\n }\n } else {\n this.drawRef.quadCurveTo(\n this.NeonData[i][0],\n this.NeonData[i][1],\n this.NeonData[i][2],\n this.NeonData[i][3]\n );\n }\n this.OffsetIterator += 2;\n }\n this.drawRef.context.lineJoin = \"round\";\n this.drawRef.context.lineWidth = this.lineWidth;\n if (this.interpColor) this.updateColor();\n this.drawRef.strokeColor(this.color);\n this.drawRef.close();\n }", "function loadFrameInBuffer(li, bi) {\n\t \t\n\t \t\n\t \t// determine previous buffer index so we can use it to calculate the heading\n\t \tvar previousBi = bi-1;\n\t \tif (previousBi<0) previousBi += bufferSize;\n\t \t\n\t \tbuffer[bi] = {};\n\t \tbuffer[bi].latlng = latlngs[li];\n\t \tbuffer[bi].traveled = li;\n\t \t\n\t \tlog.append($('<li>', { text: \"<buffer> calculating heading etc: \" + previousBi + \" to \" + bi}));\t \t\n\t \tif (buffer[previousBi]) {\n\t\t \tlog.append($('<li>', { text: \"<buffer> Loading buffer: \" + bi + \" with latlngIndex: \" + li + \" with previous bi: \" + previousBi + \", prev latlngIndex: \" + buffer[previousBi].latlng}));\t \t\n\t \t\tbuffer[bi].heading = google.maps.geometry.spherical.computeHeading(buffer[previousBi].latlng,buffer[bi].latlng); \n\t \t\tbuffer[bi].previousLatlng = buffer[previousBi].latlng;\n\t \t\tbuffer[bi].distance = google.maps.geometry.spherical.computeDistanceBetween (buffer[previousBi].latlng,buffer[bi].latlng);\n\t \t} else {\n\t\t \tlog.append($('<li>', { text: \"<buffer> Loading buffer: \" + bi + \" with latlngIndex: \" + li + \" without previous bi\"}));\t \t\n\t \t\tbuffer[bi].heading = 0; \n\t \t\tbuffer[bi].previousLatlng = 'x';\n\t \t\tbuffer[bi].distance = 0;\n\t \t}\n\t \t\n\t \tbuffer[bi].image = new Image();\n\t \tbuffer[bi].image.onload = function() {\n\t \t\t// when done loading, continue with filling the buffer\n\t\t \tbufferMarker2.setPosition(buffer[bi].latlng);\n\t \t\tfillBuffer();\n\t \t};\n\t \tbuffer[bi].image.src = streetviewUrl(latlngs[li].lat(), latlngs[li].lng(), buffer[bi].heading);\n\t \t\n\t }", "function B0(u)\n{\n var tmp = 1.0 - u;\n return (tmp * tmp * tmp);\n}", "function F() {\n\n // a while loop is smaller than a for loop\n i = 50000;\n while (i--) {\n\n // pick a function randomly\n // ~~ is the same as Math.floor (and faster)\n g = m[4][~~(M.random()*m[4].length)];\n\n // linear equations\n t = g[1] * x + g[2] * y + g[5];\n y = g[3] * x + g[4] * y + g[6];\n // x = t;\n\n // variables for variations\n j = t*t + y*y;\n\n // i tried making these equations part of m, but eval is just\n // sooooo slow that it doesn't work very well. :(\n switch(g[0]) {\n case 0:\n // sinusoidal\n x = M.sin(t);\n y = M.sin(y);\n case 1:\n // spherical\n x = t/j;\n y = y/j;\n }\n\n // scale x and y coordinates to fit in z\n // ~~ is the same as Math.floor (and faster)\n // cache m[3]\n Q = m[3];\n u = ~~((x*w + Q[0])*Q[2]);\n v = ~~((y*h + Q[1])*Q[2]);\n\n // calculate location of pixel in image buffer\n l = u*w + v;\n\n // if not defined, make it 1\n // otherwise add 1\n H[l] = H[l] ? H[l]+1 : 1;\n\n // keep largest hit\n if (H[l] > d)\n d = H[l];\n }\n\n // create image buffer\n z = a.createImageData(w,h);\n Z = z.data;\n\n // prepare image buffer\n i = w*h;\n while (i--) {\n // logarithmic scale\n t = M.log(H[i])/M.log(d);\n\n // cache 4*i\n j=4*i;\n\n // set nicely!\n Z[j] = n(t,0); // red\n Z[j+1] = n(t,1); // green\n Z[j+2] = n(t,2); // blue\n\n // set alpha to full\n Z[j+3] = 255;\n }\n \n // copy buffer to canvas\n a.putImageData(z, 0, 0);\n\n // do it again!\n // (just calling F() here will cause the browser to crash, teehee)\n W.setTimeout(F, 9);\n}", "function BlackScholesBinomialCalibration(T, n, Vol)\n{\n return Math.exp(Vol * Math.sqrt(T/n));\n}", "fRn(){\n return 0.25*this.fm*this.b*this.Lbrg\n }", "function generateAudioBuffer( freq, fn, duration, volume ) {\n var length = duration * sampleRate;\n\n var buffer = audioContext.createBuffer( 1, length, sampleRate );\n var channel = buffer.getChannelData(0);\n for ( var i = 0; i < length; i++ ) {\n channel[i] = fn( freq * i / sampleRate, i / length ) * volume;\n }\n\n return buffer;\n}", "function ky__initB(position,normal){\n //create the buffer for the positions\n var positBuffer=ky__gl.createBuffer();\n //bind the buffer to the top webGL buffer editing interface\n ky__gl.bindBuffer(ky__gl.ARRAY_BUFFER,positBuffer);\n //set the vertices \n //add the positions array data to the positions buffer.\n ky__gl.bufferData(ky__gl.ARRAY_BUFFER,new Float32Array(position),ky__gl.STATIC_DRAW);\n \n return positBuffer;\n}", "function forward$8(p) {\n var lon = p.x;\n var lat = p.y;\n var dlon = adjust_lon(lon - this.long0);\n var us, vs;\n var con;\n if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {\n if (lat > 0) {\n con = -1;\n }\n else {\n con = 1;\n }\n vs = this.al / this.bl * Math.log(Math.tan(FORTPI + con * this.gamma0 * 0.5));\n us = -1 * con * HALF_PI * this.al / this.bl;\n }\n else {\n var t = tsfnz(this.e, lat, Math.sin(lat));\n var ql = this.el / Math.pow(t, this.bl);\n var sl = 0.5 * (ql - 1 / ql);\n var tl = 0.5 * (ql + 1 / ql);\n var vl = Math.sin(this.bl * (dlon));\n var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;\n if (Math.abs(Math.abs(ul) - 1) <= EPSLN) {\n vs = Number.POSITIVE_INFINITY;\n }\n else {\n vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;\n }\n if (Math.abs(Math.cos(this.bl * (dlon))) <= EPSLN) {\n us = this.al * this.bl * (dlon);\n }\n else {\n us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;\n }\n }\n\n if (this.no_rot) {\n p.x = this.x0 + us;\n p.y = this.y0 + vs;\n }\n else {\n\n us -= this.uc;\n p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);\n p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);\n }\n return p;\n}", "get blendDistance() {}", "function x1(t) {\r\n return sin(t / frequency) * amplitude + sin(t / frequency) * amplitude;\r\n}", "applyWindowFuncAndPreemph(type, alpha, buffer, length) {\n\t\t// var length = buffer.length;\n\t\tlet i = 0;\n\t\tthis.alpha = alpha;\n\t\tswitch (type) {\n\t\t\tcase this.myWindow.BARTLETT:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionBartlett(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.BARTLETTHANN:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionBartlettHann(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.BLACKMAN:\n\t\t\t\tthis.alpha = this.alpha || 0.16;\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionBlackman(length, i, alpha);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.COSINE:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionCosine(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.GAUSS:\n\t\t\t\tthis.alpha = this.alpha || 0.25;\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionGauss(length, i, alpha);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.HAMMING:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionHamming(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.HANN:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionHann(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.LANCZOS:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionLanczos(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.RECTANGULAR:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionRectangular(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.myWindow.TRIANGULAR:\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tbuffer[i] = this.applyPreEmph(buffer[i], buffer[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[i] *= this.wFunctionTriangular(length, i);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn buffer;\n\t}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "b2p0(t, p) {\n const k = 1 - t;\n return k * k * p;\n\n }", "function am1(i,x,w,j,c,n) {\n\t while(--n >= 0) {\n\t var v = x*this.data[i++]+w.data[j]+c;\n\t c = Math.floor(v/0x4000000);\n\t w.data[j++] = v&0x3ffffff;\n\t }\n\t return c;\n\t}", "function normalizeEm (z) {return z / (keyFrame - 1) / n;}", "function zoomPitchDependency(z) {\n return 30*Math.tanh((z - 15.7)) + 30\n}", "function km(a,b){km.Z.constructor.call(this,\"\\u00a0\\u00a0\\u00a0\");this.cb=b;this.Ta(a)}", "function precal_loc() {\n buffer_loc.forEach((obj)=>{obj.x = (obj.longitude + 180) * 10; obj.y = (90 - obj.latitude) * 10;});\n}", "static elastic(bounciness: number = 1): (t: number) => number {\n const p = bounciness * Math.PI;\n return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);\n }", "function o0(stdlib,o1,buffer) {\n try {\nthis.o559 = this.o560;\n}catch(e){}\n var o2 = o254 = [].fround;\n //views\n var charCodeAt =new Map.prototype.keys.call(buffer);\n\n function o4(){\n var o5 = 0.5\n var o35 = { writable: false, value: 1, configurable: false, enumerable: false };\n try {\no849 = o6;\n}catch(e){}\n try {\nreturn +(o0[o1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "function b(t){\n\t\t\t\tvar tsquared = t*t;\n\t\t\t\tvar tcubed = t*tsquared;\n\t\t\t\tomtsquared = (1-t)*(1-t);\n\t\t\t\tomtcubed = (1-t)*omtsquared\n\t\t\t\tvar bt = {\t\"x\": p0.x()*omtcubed + 3*p1.x()*t*omtsquared + 3*p2.x()*tsquared*(1-t) + p3.x()*tcubed,\n\t\t\t\t\t\t\t\"y\": p0.y()*omtcubed + 3*p1.y()*t*omtsquared + 3*p2.y()*tsquared*(1-t) + p3.y()*tcubed };\n\t\t\t\t\n\t\t\t\treturn bt;\n\t\t\t}", "static get acceleration() {}", "drawBuffer(){\r\n this.context.drawImage(this.buffer, 0, 0);\r\n }", "y1(t) {\n return (\n Math.cos(t / 10) * -125 + Math.cos(t / 20) * 125 + Math.cos(t / 30) * 125\n );\n }", "function livingVolume(height,width,depth){\n return height*width*depth; \n}", "getMeanSquare(arraybuffer, buffer, idx1, idx2) {\n let meansquare = 0;\n let data = 0;\n\n for (let bufIdx = idx1; bufIdx < idx2; bufIdx++) {\n data = arraybuffer[buffer.getIndex(bufIdx)];\n meansquare += data; //*data; //the squares are already saved\n }\n\n return (meansquare / (idx2 - idx1));\n }", "get Alpha0() {}", "readBufferProcessEvent(e) {\n\t\tlet l = e.outputBuffer.getChannelData(0)\n\t\tlet r = e.outputBuffer.getChannelData(1)\n\t\tconst len = e.inputBuffer.length\n\t\tconst half = this._bufferSize >> 1\n\t\tconst sources = this.targets.lightness\n\t\tconst averages = this.buffers.lightness\n\n\t\tfor (let idx = 0; idx < len; idx++) {\n\t\t\tconst t = this._sample / 44100\n\t\t\t\n\t\t\t// Zero before summing\n\t\t\tl[idx] = 0\n\t\t\tr[idx] = 0\n\n\t\t\t// Iterate through all possible tones, summing\n\t\t\tfor (let tone_idx = 0; tone_idx < half; tone_idx++) {\n\t\t\t\tconst tone = Math.sin(t * this._frequencies[tone_idx])\n\t\t\t\t// Smooth (moving average)\n\t\t\t\taverages[tone_idx] = (sources[this._hilbert[tone_idx]] + averages[tone_idx]) / 2\n\t\t\t\taverages[half+tone_idx] = (sources[this._hilbert[half+tone_idx]] + averages[tone_idx]) / 2\n\n\t\t\t\t// TODO: compression\n\t\t\t\tl[idx] += (tone * averages[tone_idx] )/half\n\t\t\t\tr[idx] += (tone * averages[half + tone_idx] )/half\n\t\t\t}\n\n\t\t\t// Decrease dynamic range\n\t\t\t// Technically we should use abs values here because the output range is [-1 1] but\n\t\t\t// this loop is probably expensive enough already and it will function approximately\n\t\t\t// the same\n\t\t\tif (l[idx] > this.maxLoudness || r[idx] > this.maxLoudness)\n\t\t\t\tthis.maxLoudness += 1e-5\n\n\t\t\tif (this.maxLoudness > 0 && this.compression > 0) {\n\t\t\t\tl[idx] = l[idx] / (this.maxLoudness + (1-this.maxLoudness)*(1-this.compression))\n\t\t\t\tr[idx] = r[idx] / (this.maxLoudness + (1-this.maxLoudness)*(1-this.compression))\n\t\t\t}\n\n\t\t\t// Reduce to effect maximum compression\n\t\t\tthis.maxLoudness -= 1e-6 // will reset back to zero after 10 seconds\n\n\t\t\tthis._sample++\n\t\t}\n\n\t\tconst hues = this.targets.hue\n\t\tconst saturations = this.targets.saturation\n\n\t\tlet average_hueL = 0,\n\t\t average_hueR = 0,\n\t\t count_hueL = 0,\n\t\t\tcount_hueR = 0,\n\t\t\taverage_satL = 0,\n\t\t\taverage_satR = 0\n\t\t// Only look at the central quarter of the image for colour detection\n\t\tfor (let idx = 0; idx < half/4; idx++) {\n\t\t\taverage_satL += saturations[ idx+half/4+half/8]\n\t\t\taverage_satR += saturations[half + idx+half/4+half/8]\n\t\t\tif (!Number.isNaN(hues[idx+half/4+half/8])) {\n\t\t\t\taverage_hueL += hues[idx+half/4+half/8]\n\t\t\t\tcount_hueL++\n\t\t\t}\n\t\t\tif (!Number.isNaN(hues[half+idx+half/4+half/8])) {\n\t\t\t\taverage_hueR += hues[half+idx+half/4+half/8]\n\t\t\t\tcount_hueR++\n\t\t\t}\n\t\t}\n\n\t\t// Modulate frequency for hue\n\t\tif (count_hueL > 0) { \n\t\t\taverage_hueL = average_hueL/count_hueL\n\t\t\tthis.sawtoothNodeL.frequency.value = average_hueL * 1320 + 440\n\t\t}\n\n\t\tif (count_hueR > 0) { \n\t\t\taverage_hueR = average_hueR/count_hueR\n\t\t\tthis.sawtoothNodeR.frequency.value = average_hueR * 1320 + 440\n\t\t}\n\n\t\t// And distortion and amplitude for saturation\n\t\tthis.distortionL.distortion = this.scaleL.max = (average_satL/(half/4)) * this.fmVolume\n\t\tthis.distortionR.distortion = this.scaleR.max = (average_satR/(half/4)) * this.fmVolume\n\t}", "function eventBuffer() {\n clearTimer();\n setInput(event);\n\n buffer = true;\n timer = window.setTimeout(function () {\n buffer = false;\n }, 650);\n }", "function adapt$1(delta, numPoints, firstTime) {\n\t var k = 0;\n\t delta = firstTime ? floor$1(delta / damp$1) : delta >> 1;\n\t delta += floor$1(delta / numPoints);\n\t for ( /* no initialization */ ; delta > baseMinusTMin$1 * tMax$1 >> 1; k += base$2) {\n\t delta = floor$1(delta / baseMinusTMin$1);\n\t }\n\t return floor$1(k + (baseMinusTMin$1 + 1) * delta / (delta + skew$1));\n\t}", "forward(buffer) {\n var n = this.bufferSize,\n spectrum = this.spectrum,\n x = this.trans,\n TWO_PI = 2 * Math.PI,\n sqrt = Math.sqrt,\n i = n >>> 1,\n bSi = 2 / n,\n n2, n4, n8, nn,\n t1, t2, t3, t4,\n i1, i2, i3, i4, i5, i6, i7, i8,\n st1, cc1, ss1, cc3, ss3,\n e,\n a,\n rval, ival, mag;\n\n this.reverseBinPermute(x, buffer);\n\n for (var ix = 0, id = 4; ix < n; id *= 4) {\n for (var i0 = ix; i0 < n; i0 += id) {\n //sumdiff(x[i0], x[i0+1]); // {a, b} <--| {a+b, a-b}\n st1 = x[i0] - x[i0 + 1];\n x[i0] += x[i0 + 1];\n x[i0 + 1] = st1;\n }\n ix = 2 * (id - 1);\n }\n\n n2 = 2;\n nn = n >>> 1;\n\n while ((nn = nn >>> 1)) {\n ix = 0;\n n2 = n2 << 1;\n id = n2 << 1;\n n4 = n2 >>> 2;\n n8 = n2 >>> 3;\n do {\n if (n4 !== 1) {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n\n i1 += n8;\n i2 += n8;\n i3 += n8;\n i4 += n8;\n\n //sumdiff(x[i3], x[i4], t1, t2); // {s, d} <--| {a+b, a-b}\n t1 = x[i3] + x[i4];\n t2 = x[i3] - x[i4];\n\n t1 = -t1 * Math.SQRT1_2;\n t2 *= Math.SQRT1_2;\n\n // sumdiff(t1, x[i2], x[i4], x[i3]); // {s, d} <--| {a+b, a-b}\n st1 = x[i2];\n x[i4] = t1 + st1;\n x[i3] = t1 - st1;\n\n //sumdiff3(x[i1], t2, x[i2]); // {a, b, d} <--| {a+b, b, a-b}\n x[i2] = x[i1] - t2;\n x[i1] += t2;\n }\n } else {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n }\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n } while (ix < n);\n\n e = TWO_PI / n2;\n\n for (var j = 1; j < n8; j++) {\n a = j * e;\n ss1 = Math.sin(a);\n cc1 = Math.cos(a);\n\n //ss3 = sin(3*a); cc3 = cos(3*a);\n cc3 = 4 * cc1 * (cc1 * cc1 - 0.75);\n ss3 = 4 * ss1 * (0.75 - ss1 * ss1);\n\n ix = 0; id = n2 << 1;\n do {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0 + j;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n i5 = i0 + n4 - j;\n i6 = i5 + n4;\n i7 = i6 + n4;\n i8 = i7 + n4;\n\n //cmult(c, s, x, y, &u, &v)\n //cmult(cc1, ss1, x[i7], x[i3], t2, t1); // {u,v} <--| {x*c-y*s, x*s+y*c}\n t2 = x[i7] * cc1 - x[i3] * ss1;\n t1 = x[i7] * ss1 + x[i3] * cc1;\n\n //cmult(cc3, ss3, x[i8], x[i4], t4, t3);\n t4 = x[i8] * cc3 - x[i4] * ss3;\n t3 = x[i8] * ss3 + x[i4] * cc3;\n\n //sumdiff(t2, t4); // {a, b} <--| {a+b, a-b}\n st1 = t2 - t4;\n t2 += t4;\n t4 = st1;\n\n //sumdiff(t2, x[i6], x[i8], x[i3]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i6]; x[i8] = t2 + st1; x[i3] = t2 - st1;\n x[i8] = t2 + x[i6];\n x[i3] = t2 - x[i6];\n\n //sumdiff_r(t1, t3); // {a, b} <--| {a+b, b-a}\n st1 = t3 - t1;\n t1 += t3;\n t3 = st1;\n\n //sumdiff(t3, x[i2], x[i4], x[i7]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i2]; x[i4] = t3 + st1; x[i7] = t3 - st1;\n x[i4] = t3 + x[i2];\n x[i7] = t3 - x[i2];\n\n //sumdiff3(x[i1], t1, x[i6]); // {a, b, d} <--| {a+b, b, a-b}\n x[i6] = x[i1] - t1;\n x[i1] += t1;\n\n //diffsum3_r(t4, x[i5], x[i2]); // {a, b, s} <--| {a, b-a, a+b}\n x[i2] = t4 + x[i5];\n x[i5] -= t4;\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n\n } while (ix < n);\n }\n }\n\n while (--i) {\n rval = x[i];\n ival = x[n - i - 1];\n mag = bSi * sqrt(rval * rval + ival * ival);\n\n if (mag > this.peak) {\n this.peakBand = i;\n this.peak = mag;\n }\n\n spectrum[i] = mag;\n }\n\n spectrum[0] = bSi * x[0];\n\n return spectrum;\n }", "function eventBuffer() {\n clearTimer();\n setInput(event);\n\n buffer = true;\n timer = window.setTimeout(function() {\n buffer = false;\n }, 650);\n }", "function outlineBuckyPoints()\n{\n var offset = [0,1,1,8,-2,-3];\n var count = 0;\n for(var i = 0; i < 240; i+= offset[count])\n {\n vertices.push(buckyBall[i]);\n count++;\n if (count == 6)\n {\n count = 0;\n i+=7;\n } \n }\n}", "adaptPoints(control){\n var buffer = [];\n /*Se pasa al plano XZ*/\n for (var i = 0; i < 7; i++){ //La curva tiene siempre 7 puntos de control\n var point = new Point((control[i].x - 200)/15, 0, (control[i].y - 212)/15);\n buffer.push(point);\n }\n return buffer;\n }", "#calcFilter() {\n const w0 = 2 * Math.PI * this.#f0 / sampleRate;\n const alpha = Math.sin(w0) / (this.#q * 2);\n const cosW0 = Math.cos(w0);\n let b0, b1, b2, a0, a1, a2;\n\n switch (this.#filterType) {\n case 'low-pass': {\n b0 = (1 - cosW0) / 2;\n b1 = 1 - cosW0;\n b2 = (1 - cosW0) / 2;\n a0 = 1 + alpha;\n a1 = -2 * cosW0;\n a2 = 1 - alpha;\n break;\n }\n case 'high-pass': {\n b0 = (1 + cosW0) / 2;\n b1 = -(1 + cosW0);\n b2 = (1 + cosW0) / 2;\n a0 = 1 + alpha;\n a1 = -2 * cosW0;\n a2 = 1 - alpha;\n break;\n }\n case 'band-pass': {\n // This is the \"peak gain = Q\" BPF variant from the Audio EQ\n // Cookbook.\n b0 = this.#q * alpha;\n b1 = 0;\n b2 = -this.#q * alpha;\n a0 = 1 + alpha;\n a1 = -2 * cosW0;\n a2 = 1 - alpha;\n break;\n }\n case 'notch': {\n b0 = 1;\n b1 = -2 * cosW0;\n b2 = 1;\n a0 = 1 + alpha;\n a1 = -2 * cosW0;\n a2 = 1 - alpha;\n break;\n }\n default: {\n // Unknown filter type.\n b0 = b1 = b2 = a0 = a1 = a2 = 0;\n break;\n }\n }\n\n this.#x0Co = b0 / a0;\n this.#x1Co = b1 / a0;\n this.#x2Co = b2 / a0;\n this.#y1Co = -a1 / a0;\n this.#y2Co = -a2 / a0;\n }", "get Acceleration() {}", "function e0fn(x){return(1.0-0.25*x*(1.0+x/16.0*(3.0+1.25*x)));}", "function Bn(e,t,n){var i=e[0];if(i<=0||i>0)return e;// unoptimized: ! isNaN( firstElem )\n// see http://jacksondunstan.com/articles/983\nvar r=t*n,o=Ln[r];if(void 0===o&&(o=new Float32Array(r),Ln[r]=o),0!==t){i.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}// Texture unit allocation", "function init() {\n this.no_off = this.no_off || false;\n this.no_rot = this.no_rot || false;\n\n if (isNaN(this.k0)) {\n this.k0 = 1;\n }\n var sinlat = Math.sin(this.lat0);\n var coslat = Math.cos(this.lat0);\n var con = this.e * sinlat;\n\n this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));\n this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);\n var t0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat0, sinlat);\n var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));\n if (dl * dl < 1) {\n dl = 1;\n }\n var fl;\n var gl;\n if (!isNaN(this.longc)) {\n //Central point and azimuth method\n\n if (this.lat0 >= 0) {\n fl = dl + Math.sqrt(dl * dl - 1);\n }\n else {\n fl = dl - Math.sqrt(dl * dl - 1);\n }\n this.el = fl * Math.pow(t0, this.bl);\n gl = 0.5 * (fl - 1 / fl);\n this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);\n this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;\n\n }\n else {\n //2 points method\n var t1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat1, Math.sin(this.lat1));\n var t2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat2, Math.sin(this.lat2));\n if (this.lat0 >= 0) {\n this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n else {\n this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n var hl = Math.pow(t1, this.bl);\n var ll = Math.pow(t2, this.bl);\n fl = this.el / hl;\n gl = 0.5 * (fl - 1 / fl);\n var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);\n var pl = (ll - hl) / (ll + hl);\n var dlon12 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long1 - this.long2);\n this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * (dlon12)) / pl) / this.bl;\n this.long0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long0);\n var dlon10 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long1 - this.long0);\n this.gamma0 = Math.atan(Math.sin(this.bl * (dlon10)) / gl);\n this.alpha = Math.asin(dl * Math.sin(this.gamma0));\n }\n\n if (this.no_off) {\n this.uc = 0;\n }\n else {\n if (this.lat0 >= 0) {\n this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n else {\n this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n }\n\n}", "linearize() {\n const SCALE = 255;\n const value = this.value / SCALE;\n return value <= 0.03928 ? value / 12.92 : Math.pow((value + 0.055) / 1.055, 2.4);\n }", "computeDrawPathBuffers() {\n const buffer = this._pathBuffer;\n let preview,current,next;\n const cList = $objs.cases_s;\n for (let i=0, l=buffer.length; i<l; i++) {\n const preview = buffer[i-1];\n const current = buffer[i ];\n const next = buffer[i+1];\n const preview_id = preview && cList.indexOf(preview);\n const current_id = current && cList.indexOf(current);\n const next_id = next && cList.indexOf(next);\n //TODO: FIXME: compute distance via global position for Math.hypot\n if(preview){\n current.pathConnexion[String(preview_id)] = Math.hypot(preview.x-current.x, preview.y-current.y);\n };\n if(next){\n current.pathConnexion[String(next_id)] = Math.hypot(next.x-current.x, next.y-current.y);\n };\n };\n console.log0('PathsBuffers: ', buffer);\n this._pathBuffer = [];\n this.refreshPath();\n }", "function kb(a,b,c){F.call(this,c);this.g=a||0;this.f=void 0===b?Infinity:b}", "knotToPoint(u, result) {\n this._bcurve.evaluateBuffersAtKnot(u);\n return Point3dVector3d_1.Point3d.createFrom(this._bcurve.poleBuffer, result);\n }", "function bR(){this.b=this.i=0;this.h=!1;this.buffer=null}" ]
[ "0.67347836", "0.66657174", "0.6660325", "0.6660325", "0.6186504", "0.59790933", "0.5664077", "0.5661304", "0.5626181", "0.5460146", "0.5447599", "0.543933", "0.53866404", "0.5386023", "0.53715533", "0.5347923", "0.53474945", "0.5319464", "0.531812", "0.5299512", "0.5299512", "0.52774036", "0.52703476", "0.5241747", "0.5230766", "0.52084297", "0.5198089", "0.5192474", "0.5191396", "0.51897836", "0.5155232", "0.51374364", "0.51358986", "0.5135174", "0.5131292", "0.5128417", "0.5128358", "0.5104355", "0.51043206", "0.51015", "0.50976783", "0.50959367", "0.5094641", "0.50919634", "0.5091761", "0.5080816", "0.506612", "0.5064232", "0.5034005", "0.5024024", "0.5018095", "0.50012577", "0.5000861", "0.5000714", "0.49956056", "0.49931222", "0.49918008", "0.49893337", "0.49893337", "0.49893337", "0.49893337", "0.49893337", "0.49893337", "0.49893337", "0.49893337", "0.49893337", "0.49879354", "0.49875847", "0.49864784", "0.49722496", "0.49719784", "0.49656823", "0.49620932", "0.4956178", "0.4948264", "0.49474826", "0.49445814", "0.493709", "0.49320057", "0.4926701", "0.49190557", "0.49170154", "0.4916272", "0.4915928", "0.49148548", "0.4906131", "0.4902931", "0.49025375", "0.49006313", "0.48972017", "0.48956984", "0.48953703", "0.48917034", "0.4889764", "0.48885706", "0.48858964", "0.4884405", "0.48840475" ]
0.6917525
2
var die na lekhle eta global variabe hoe jabe; return result; // window.result dielo global variable hoe jabe;
function double(num) { return num * 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function retorno1(){\n var numero = 10;\n return numero;\n}", "function exercicio01() {\n var variavel = \"valor\";\n return variavel;\n}", "getResult() {}", "function suma(){\n resultado= 10 + 5;\n}", "function inicio(){\n return b;\n}", "function test(){\n return a;\n}", "function somme(a,b){\n var resultat = a + b;\n return resultat; // return permet de sortir de la valeur resultat de la fonction :il retourne cette valeur à l'endroit de la fonction.\n}", "function hello(){\n var mundo = 'mundo';\n }", "function calcular() {\n num2 = obtenerResultado();\n resolver();\n}", "function getVardas(){\n var vardas=\"Tomas\";\n return vardas;\n}", "function getResultado() { \r\n return document.getElementById(\"valor\").value; \r\n}", "function fun1(){} //toda a função de js retorna alguma coisa", "function teste() {/// essa bloco esta associada uma funcao.\n var local =123\n console.log(local)\n}", "function test() {\n var status2 = \"casado\";\n console.log(status2); // dentro da mesma podemos sim imprimitar o valor da variavel\n}", "function OperadorNew(){\r\n\tresultado = '';\r\n\treturn ;\r\n}", "function myFunc() {\n var potato = 'spudtactular';\n console.log(potato);\n return potato;\n}", "function a(){ \n console.log(w); // consult Global for x and print 20 from Global\n }", "function bodoAmat(){\r\n console.log(\"Ini result Function Bodo Amat\");\r\n}", "function q3() {\n window.a = \"hello\";\n}", "function test() {\n return 1;\n }", "function result(name){ \n \treturn(myName)\n}", "function get(){\n one = 300;\n// var one = 300;\n console.log(\"함수:\", one);\n}", "function msgar() {\r\n return \"Hellw this is return value function\"; \r\n}", "function Suma(one, two) {\n let resultado = one + two;\n //console.log(suma)\n // return te permite regresar un valor de esa funcion\n return resultado;\n}", "function calculadora(){\n\tconsole.log(\"hola\");\n\tconsole.log(\"buenas\");\n\n\treturn \"hlar\";\n\n}", "get result() { return this._result; }", "function retorno2(num1){\n return num1;\n}", "function obtenerIdVariableByNombre(result, nombreVariable){\n var returnVariableId = null;\n for(index in result.variables){\n if(result.variables[index].name == nombreVariable){\n returnVariableId = result.variables[index].id;\n break;\n }\n }\n console.log(\"returnVariableId\")\n console.log(returnVariableId)\n get_values_callback(returnVariableId, cargarDatosEnGrafico); \n}", "function usingvar (){\n console.log(a); // return undefined\n var a = 10;\n}", "function teste(){\n var local = 123\n console.log(local)\n}", "function myValorA(){\n\t\t\t var inputa = Number(document.getElementById(\"op-one\").value);\n\t\t\t\treturn inputa;\n\t\t\t }", "function return_value(name){\n document.write(\"hello\"+\" \"+name);\n}", "function getVardas(){\n var vardas = \"Tomas\";\n document.querySelector(\"body\").innerHTML += \"vardas \" + vardas + \"<br>\";\n return vardas;\n\n}", "get result() {\n return this._result;\n }", "function varPrueba(){\n var x=70; // se le va valor de 70\n if (true) { // siempre se cumple la funcion por el true\n var x= 50; // se redeclara a 50\n console.log(x);//aqui aparece 50\n }\n console.log(x); // 50\n}", "function salut(){\r\n\treturn \"Salut !\";\r\n}", "function holaMundo () {\n let saludo = \"Estoy aprendiendo js\"\n return saludo;\n}", "function vartest() {\n let variable3 = \"soy la variable 3\"\n var x = 31;\n if (true) {\n var x = 71;\n console.log(x);\n }\n console.log(x);\n \n return x;\n}", "function rghResult(result) {\n // send result back to app\n res.send(result);\n }", "function test(){ // Variables in functions has a local scope\n var x = 222;\n return x;\n}", "function onSuccess(result) {\n var resStr = \"Result: \" + result;\n console.log(resStr);\n //alert(resStr);\n return result;\n }", "function a1(){\n\treturn 1;\n}", "function saludar(){\n return 'hola'\n}", "getResult() {\n return document.getElementById(\"result\").innerText;\n }", "set result(value) {\n this._result = value;\n }", "function useResult() {\n updateFormula(function() {\n return resultDisplay.text();\n }, true);\n }", "function testFunction() {\n return 1;\n }", "function addTwoNum(num1, num2) {\n console.log(num1, num2);\n var total = num1 + num2;\n return total;//it will return to result\n\n}", "function motpasse(){\nreturn motpasse;\n}", "function four() {\n if (true) {\n var a = 4;\n }\n\n alert(a); // alerts '4', not the global value of '1'\n}", "function abc() {\n return 100;\n}", "function a(){\n return param\n}", "function two() {\r\n console.log('work 2');\r\n return 54;\r\n}", "function testlet(){\n\t b=\"abc\";\n\treturn b;\n}", "function f(){\n var z = 'foxes'; // A local variable\n twenty = 20; // Global because keyword var is not used\n return x; // We can use x here because it is global\n}", "function funcion() {\n return numeracion;\n}", "function otkri(sadrzaj){\n var ime_varijable;\n for (var naziv_objekta in window) {\n if (window[naziv_objekta] == sadrzaj) ime_varijable = naziv_objekta;\n }\n console.log(ime_varijable + \": \" + sadrzaj)\n} // kraj otkri", "function getPuesto(p)\r\n{\r\n var result;\r\n $.ajax({\r\n url: 'controller/puente.php',\r\n type: 'POST',\r\n dataType: 'json',\r\n data: {option: 52,persona:p},\r\n async: false ,\r\n cache: false,\r\n })\r\n .done(function(data) {\r\n result = data;\r\n })\r\n .fail(function() {\r\n console.log(\"error\");\r\n });\r\n return result;\r\n}", "function laugh(){\n var lol=\"hahahahahahahahahaha!\";\n return lol;\n}", "function getQualquerCoisa(){\n var sobreNome = 'sobreNome'; //VAR É global dentro do escopo de functions()\n if(FLAG){\n console.log('1 -'+sobreNome);\n }\n}", "function sumar(num1, num2, num3){\r\ndocument.write(\"El resultado es: \" + resultado);\r\n\r\n}", "function myRedReturn(){\n\tvar red = \"red\";\n\treturn red;\n}", "function output(result){ console.log(result); }", "function dummyReturn(){\n}", "function test(){\n\t// how to create a local variable under function local scope\n\tvar v1 = 1; // can only be used in current function\n\n\tv1 = 3; // assignment\n\n\treturn 1;\n}", "function greet () {\nvar hi = \"hello world!\";\nreturn hi;\n}", "function returndemo(){\n\n return \"Hello!!!\";\n\n}", "function changeGlobal() {\n\n // global still = 1\n\n a = 2;\n\n // global now = 2 because you are not creating a new variable\n // just redefining a\n // a instead of var a\n\n return a;\n}", "function get_val( gname )\r\n{\r\n\t//Before calling any LMS function, we will always check for the API.\r\n\tAPI = GetAPI();\r\n\tif( API != null )\r\n\t{\r\n\t\t//\"LMSGetValue\" function will retrive the data from the LMS, for the specified variable. \r\n\t\tret1 = API.LMSGetValue(gname);\t\r\n\t\t\r\n\t\t//Check for LMS communication Errors.\r\n\t\tfnCheckErrors();\r\n\t\t\r\n\t\treturn ret1;\t\t\t\t\r\n\t}\t\r\n}", "function dameChapaFila(nombre) {\n \n var valor = 5;\n\n var datos = \"id_chapa=\" + nombre;\n\n //alert(datos);\n $.ajax({\n type: \"POST\",\n async: false,\n cache: false,\n url: \"../controladores/ControladorClienteAutomovil.php\",\n data: datos,\n success: function (datos) {\n valor = datos;\n }\n });\n\n return valor;\n \n}", "function a() {\n console.log('hello');\n return 15;\n}", "function PerkalianV2 (a, b) {\n //local variabel\n let hasil = a * b\n\n //give return value, spy value dr hasil bisa dipake diluar\n return hasil\n}", "function named(result){\n answer(result,change=1)\n}", "function fn() {\n return \"I am a result. Rarr\";\n}", "function tutu(nombre2){\n\n\tvar nombre1 = nombre2;\n\treturn nombre1;\n\n}", "get UseGlobal() {}", "function showsResult(){\n alert(\"THis is a sample\");\n}", "function sumar() {\n num1 = obtenerResultado();\n operacion = \"+\";\n limpiar();\n}", "function obtenerResultado() {\n return document.getElementById(\"display\").innerHTML;\n}", "function ejemploVar() {\n if (true) {\n var variable = 100;\n console.log(variable);\n }\n console.log(variable);\n }", "function gatherStorage(result) { \r\n API_KEY = result.api_key; //Save in memory\r\n}", "function output( result ) {\n\t\tconsole.log( result );\n\t\treturn result;\n\t}", "function dameChapa(nombre) {\n\n var valor = 5;\n\n var datos = \"nombre_chapa=\" + nombre;\n\n //alert(datos);\n $.ajax({\n type: \"POST\",\n async: false,\n cache: false,\n url: \"../controladores/ControladorClienteAutomovil.php\",\n data: datos,\n success: function (datos) {\n valor = datos;\n }\n });\n\n return valor;\n}", "function myFunction3() {\n var text = \"hello\"\n return text;\n}", "function calc() {\n let a = 10;\n let b = 20 + a;\n console.log(b); // 30 -Получили Значение фун-и\n return b;\n}", "function masti(){\r\n return \" Helo India\";\r\n}", "function unaFuncion(){\n const unValorConstante = 200;\n console.log(unValorConstante);\n}", "function get_tasmota_var(return_id,variable)\r\n{\r\n var id = return_id+\"_\"+variable+\"_JSON\";\r\n var json_div = document.getElementById(id);\r\n if(!json_div)\r\n {\r\n console.log(\"could not get tasmota variable, id \"+id+\" not found\");\r\n return false;\r\n }\r\n var contents = json_div.innerHTML;\r\n parsed = JSON.parse(contents);\r\n return parsed;\r\n}", "function returnObjectValue(obval){\n\t\tconsole.log('d');\n\t\treturn obval;\t\t\n\t}", "function calcularPerimetroCuadrado (){\n const input = document.getElementById(\"inputCuadrado\");\n const value = input.value;\n\n const resultadoPerimetro = perimetroCuadrado(value); \n alert(\"El resultado del perimetro es: \" + resultadoPerimetro)\n }", "function dataReturn (returnValue, result) {\n\t\tif (returnValue === 0) return result;\n\t\tthrow new Error('FALCON error: ' + returnValue);\n\t}", "function getVardas() {\n return \"Tadas\";\n}", "function get_clotureDossier()\n{\n var result = 0,\n dossier_id = $('#dossier').val(),\n lien = Routing.generate('app_cloture_dossier')+'/'+dossier_id;\n $.ajax({\n data: {},\n url: lien,\n async:false,\n contentType: \"application/x-www-form-urlencoded;charset=utf-8\",\n beforeSend: function(jqXHR){\n jqXHR.overrideMimeType('text/html;charset=utf-8');\n },\n dataType: 'html',\n success: function(data){\n test_security(data);\n result = parseInt(data.trim());\n }\n });\n\n return result;\n}", "function calcular(){\n\tvar result = eval(document.fo.valores.value);\n document.fo.valores.value = resultado;\n}", "function returnTwo() {\n\treturn 2;\n}", "function fun1(){\n // Note: Can be set without var, since within a function scoped with the function, since var is not included it is set as global scope, wont work in scrimba, but will work in browsers\n oopsGlobal = 5;\n}", "function helloWord() {\n console.log(\" cette fct hello ne return pas de val , il affiche juste un log !!!! \");\n}", "function changeLocal() {\n\n // global can be used here\n\n var a = 2; // local\n\n // local a now = 2\n\n return a;\n}", "function myFunction() {\n console.log('inside', 123);\n return 123;\n}", "_getResult() {\n\t\treturn null;\n\t}", "function mensaje(){\n\treturn 'Hola Mundo JavaScript';\n}" ]
[ "0.7032477", "0.6846523", "0.6434666", "0.6228347", "0.61696726", "0.61138123", "0.60999286", "0.60820925", "0.607103", "0.60559213", "0.5981996", "0.59591234", "0.59565854", "0.5953085", "0.59427196", "0.59360707", "0.5933767", "0.59320545", "0.59239024", "0.5914561", "0.588268", "0.5861523", "0.5825696", "0.5812418", "0.5782748", "0.57816964", "0.5766968", "0.57351524", "0.572485", "0.5718539", "0.5691581", "0.5688135", "0.5669254", "0.566487", "0.5663583", "0.56584454", "0.5597197", "0.55888027", "0.5586043", "0.55768436", "0.55746824", "0.55617994", "0.5561439", "0.5561192", "0.5556055", "0.5546033", "0.5542872", "0.5509551", "0.55047053", "0.5503354", "0.55021155", "0.5501323", "0.54810256", "0.5475957", "0.5474134", "0.5473177", "0.54720384", "0.54708797", "0.5462135", "0.5460607", "0.5457591", "0.54545194", "0.5454044", "0.54489857", "0.544342", "0.5442053", "0.5441792", "0.54389715", "0.5435001", "0.54318213", "0.5430715", "0.5423846", "0.54228795", "0.541122", "0.5410259", "0.54033625", "0.53995085", "0.5398919", "0.5395251", "0.53928095", "0.53926396", "0.5392231", "0.53916895", "0.53842145", "0.5380792", "0.53785664", "0.5373243", "0.5363074", "0.5361545", "0.53593796", "0.5351497", "0.5346166", "0.5345311", "0.5340761", "0.53317624", "0.53305346", "0.53299963", "0.53269565", "0.5326222", "0.53247845", "0.5323199" ]
0.0
-1
rect(enemiesX, enemiesY, 30, 40); fill(color2); } }
function keyPressed() { if(keyCode === 32){ bulletSpeed = 25; } console.log("here", bulletX, bulletY) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function food() {\n fill(255, 0, 0, alpha);\n rect(foodX, foodY, 15, 15);\n noFill();\n\n}", "function paintEnemies(enemies) {\n enemies.forEach(function (enemy) {\n enemy.y += 5;\n enemy.x += getRandomInt(-15, 15);\n\n // Paint only if not dead\n if (!enemy.isDead) {\n paintTriangle(enemy.x, enemy.y, 20, '#ff0000', 'down');\n }\n\n // Paint enemy shots\n enemy.shots.forEach(function (shot) {\n shot.y += SHOOTING_SPEED; // Enemy shots go down\n paintTriangle(shot.x, shot.y, 5, '#00ffff', 'down');\n });\n });\n}", "function enemyHealthbar() {\n var width = 100;\n var height = 20;\n\n document.getElementById(\"username\");\n // Draw the background\n context.fillStyle = \"#000000\";\n context.fillRect(100, 20, width, height);\n\n // Draw the fill\n context.fillStyle = \"#03a56a\";\n var fillVal = gameobjects[1].health;\n context.fillRect(100, 20, fillVal / 4, height);\n}", "function drawRectBlue() {\n fill(0,0,255);\n rect(width/2,height/2,size*3,size*3);\n\n}//End function drawRectBlue", "function drawBulletEnemies(t_bullet)\n{\n t_bullet.x_pos -= t_bullet.speed; // Decreases x_pos to make Bullet fly across the word.\n \n if (t_bullet.x_pos <= -1300) //Resets Bullet Positioning if has reached the defined boundries.\n {\n t_bullet.x_pos = 3500;\n }\n \n \n x = t_bullet.x_pos;\n y = t_bullet.y_pos;\n size = t_bullet.size;\n push();\n \n if (t_bullet.deadly)\n { \n fill(170, 13, 0);\n }\n else\n { \n fill(0); \n }\n \n \n first_part = {\n x: x,\n y: y,\n width: 25 * size,\n height: 25 * size\n };\n rect(first_part.x, first_part.y, first_part.width, first_part.height, 360, 0, 0, 360);\n\n \n fill(10); \n second_part = {\n x: x + (25 * size),\n y: y + (2.5 * size),\n width: 4 * size,\n height: 20 * size\n };\n rect(second_part.x, second_part.y, second_part.width, second_part.height);\n \n \n fill(0);\n third_part = {\n x: (x + (25 * size) + 4 * size),\n y: y,\n width: 2 * size,\n height: 25 * size\n };\n rect(third_part.x, third_part.y, third_part.width, third_part.height);\n\n \n fill(255);\n eyes_blank = {\n x_pos: x + (8.5 * size),\n y_pos: y + (6.5 * size),\n width: 8 * size,\n height: 9 * size\n }; \n arc(eyes_blank.x_pos, eyes_blank.y_pos, eyes_blank.width,\n eyes_blank.height, -HALF_PI + QUARTER_PI, PI + -QUARTER_PI, CHORD);\n\n eyes_pupil = {\n x_pos: x + (8.5 * size),\n y_pos: y + (6.5 * size),\n width: 3 * size,\n height: 4.5 * size\n };\n \n //Eyes\n fill(0);\n arc(eyes_pupil.x_pos, eyes_pupil.y_pos, eyes_pupil.width,\n eyes_pupil.height, -HALF_PI + QUARTER_PI, PI + -QUARTER_PI, CHORD);\n\n \n //Mouth\n fill(255, 0, 0);\n mouth = {\n x_pos: x * 3,\n y_pos: y * 2.6\n };\n\n beginShape();\n vertex(x + (2.5 * size), y + (20 * size));\n bezierVertex( x + (10 * size), y + (10 * size),\n x + (13 * size), y + (22 * size),\n x + (6 * size), y + (23 * size));\n endShape();\n pop();\n\n //Sets the center x and y properties of bullet object based on full width and height of shapes\n t_bullet.center_x = x + ( (first_part.width + second_part.width + third_part.width) / 2); \n t_bullet.center_y = y + ( first_part.height / 2); \n \n checkBulletEnemies(t_bullet); //Check bullet object collision.\n}", "function createEnemy(x,y) {\nvar enemy = game.createGameItem('enemy',25);\nvar redSquare = draw.rect(50,50,'red');\nredSquare.x = -25;\nredSquare.y = -25;\nenemy.addChild(redSquare);\nenemy.x = x;\nenemy.y = y;\ngame.addGameItem(enemy);\n\nenemy.velocityX = -2;\nenemy.rotationVelocity = 50;\n\nenemy.onPlayerCollision = function() {\n console.log('The enemy has hit Halle');\n game.changeIntegrity(25);\n enemy.fadeOut();\n};\n\nenemy.onProjectileCollision = function() {\n console.log('Halle has hit the enemy');\n game.increaseScore(100);\n enemy.fadeOut();\n};\n}", "function drawEnemies() {\n\n for (i = 0; i < numberOfEnemies; i++) {\n\n fill(enemyFill, enemyHealth);\n ellipse(enemyX[i], enemyY[i], enemyRadius * 2);\n\n }\n}", "function drawEnemy(EnemyX,EnemyY){\n image(Enemy,EnemyX,EnemyY,50,50);\n}", "function rectangle(width, height, fillStyle, strokeStyle, lineWidth, x, y) {\n \n //Create the sprite\n let sprite = new Rectangle(width, height, fillStyle, strokeStyle, lineWidth, x, y)\n \n //Add the sprite to the stage\n //stage.addChild(sprite)\n \n //Return the sprite to the main program\n return sprite\n}", "function drawPlayer () {\r\n rect(player.x, player.y, player.w, player.h, player.col, \"fill\");\r\n}", "function drawShooting(x, y){\n graphics.fillRect(x, y, 10, 5);\n graphics.fillStyle = \"Red\";\n //graphics.fillRect(225, 480, 15, 15);\n //graphics.fillRect(x, y, 15, 15);\n }", "function createEnemy(x,y){\n var enemy = game.createGameItem('enemy',25);\n var redSquare = draw.bitmap('img/dogenemy.png');\n redSquare.x = -25;\n redSquare.y = -25;\n redSquare.scaleX = 0.2;\n redSquare.scaleY = 0.2;\n enemy.addChild(redSquare);\n \n enemy.x = x;\n enemy.y = y;\n \n game.addGameItem(enemy);\n enemy.velocityX = -3;\n enemy.onPlayerCollision = function() {\n console.log('The enemy has hit Halle');\n game.changeIntegrity(-10);\n game.increaseScore(100);\n enemy.fadeOut();\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle has hit the enemy');\n enemy.fadeOut();\n };\n}", "function createEnemy(x, y) {\n var enemy = game.createGameItem('enemy',25);\n enemy.x = x;\n enemy.y = groundY-50;\n game.addGameItem(enemy);\n var enemyImage = draw.bitmap('img/bad guy clock.png');\n enemy.addChild(enemyImage);\n enemyImage.x = -25;\n enemyImage.y = -25;\n enemy.velocityX = -4;\n enemyImage.scaleX=.08;\n enemyImage.scaleY=.08;\n enemy.onPlayerCollision = function() {\n game.changeIntegrity(-30);\n enemy.shrink();\n console.log('Halle got smacked lol');\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle did the smacking lol');\n game.increaseScore(50);\n enemy.fadeOut();\n };\n }", "draw(ctx){\n ctx.save(); \n ctx.beginPath();\n ctx.rect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.closePath();\n ctx.fillStyle = \"blue\";\n ctx.fill();\n ctx.restore();\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(0,570,800 * (this.health/this.originalHealth),30);\n ctx.closePath();\n ctx.fillStyle = \"red\";\n ctx.fill();\n ctx.restore();\n }", "function Enemy(x, y, width, height, health, ms){\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.a = 1;\n this.health = health;\n this.ms = ms;\n}", "function Enemy(x, y, r ,g, b, s, range)\n{\n this.x = x;\n this.y = y;\n this.r = r;\n this.g = g;\n this.b = b;\n this.s = s;\n this.range = range;\n this.currentX = x;\n this.inc = 1;\n \n this.update = function()\n {\n this.currentX += this.inc; \n if(this.currentX >= this.x + this.range)\n {\n this.inc = -1;\n }\n else if(this.currentX < this.x)\n {\n this.inc = 1;\n }\n };\n \n this.draw = function()\n {\n this.update();\n push();\n translate(this.currentX, this.y);\n \n scale(this.s); // Set the scale\n var c = color(this.r, this.g, this.b);\n stroke(c); // Set the body colour\n strokeWeight(70);\n line(0, -35, 0, -65); // Body\n noStroke();\n fill(255 - this.g); //face\n ellipse(-17.5, -65, 35, 35); // Left eye dome\n ellipse(17.5, -65, 35, 35); // Right eye dome\n arc(0, -65, 70, 70, 0, PI); // Chin\n fill(this.g);\n ellipse(-14, -65, 8, 8); // Left eye\n ellipse(14, -65, 8, 8); // Right eye\n quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak\n pop();\n \n };\n this.checkContact = function(gc_x, gc_y)\n {\n var d = dist(gc_x, gc_y, this.currentX, this.y); \n if(d < 20)\n { \n if(lives != 0){\n lives -= 1;\n } \n player.isDead = true;\n deathSound.setVolume(0.1);\n deathSound.play();\n return true;\n } \n return false;\n }\n}", "function drawHealthbar() {\n var width = 100;\n var height = 20;\n\n // Draw the background\n context.fillStyle = \"#000000\";\n\n context.fillRect(360, 250, width, height);\n\n // Draw the fill\n context.fillStyle = \"#03a56a\";\n var fillVal = gameobjects[0].health;\n context.fillRect(360, 250, fillVal / 4, height);\n}", "function city(){ \n fill(170);\n noLoop();\n stroke(0);\n\trect(cityX, cityY, 40, 100*-1);\n rect(cityX+=40, cityY, 30, 70*-1);\n rect(cityX+=30, cityY, 40, 120*-1);\n rect(cityX+=40, cityY, 30, 160*-1);\n rect(cityX+=30, cityY, 30, 90*-1); \n rect(cityX+=30, cityY, 35, 60*-1);\n\trect(cityX+=35, cityY, 40, 80*-1);\n noStroke();\n rect(0, cityY, width, 20*-1);\n \n}", "function Enemy (width, height, color, x, y){\n //set the current active enemy to true\n this.active = true;\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.xVelocity = 1;\n //keep enemies in bounds\n this.inBounds = function(){\n return this.x >= 0 && this.x <= 6656\n && this.y >= 0 && this.y <= 468;\n };\n this.image= './images/enemy.png';\n this.draw = function (){\n const enemyImg = new Image();\n enemyImg.src = this.image;\n ctx.drawImage(enemyImg, this.x, this.y, this.width, this.height)\n },\n this.update = function (){\n //enemy starts at position x which changes negatively\n this.x -= this.xVelocity;\n this.xVelocity = 1; \n this.active = this.active && this.inBounds();\n };\n this.die = function(){\n this.active = false;\n };\n \n }", "function createEnemies(){\r\n enemy1 = new Enemy(42,20);\r\n enemy2 = new Enemy(96,20);\r\n enemy3 = new Enemy(150,20);\r\n enemy4 = new Enemy(204,20);\r\n enemy5 = new Enemy(258,20);\r\n enemy6 = new Enemy(312,20);\r\n enemy7 = new Enemy(366,20);\r\n enemy8 = new Enemy(420,20);\r\n enemy9 = new Enemy(474,20);\r\n enemy10 = new Enemy(528,20);\r\n\r\n enemy11 = new Enemy(42,70);\r\n enemy12 = new Enemy(96,70);\r\n enemy13 = new Enemy(150,70);\r\n enemy14 = new Enemy(204,70);\r\n enemy15 = new Enemy(258,70);\r\n enemy16 = new Enemy(312,70);\r\n enemy17 = new Enemy(366,70);\r\n enemy18 = new Enemy(420,70);\r\n enemy19 = new Enemy(474,70);\r\n enemy20 = new Enemy(528,70);\r\n\r\n enemy21 = new Enemy(42,120);\r\n enemy22 = new Enemy(96,120);\r\n enemy23 = new Enemy(150,120);\r\n enemy24 = new Enemy(204,120);\r\n enemy25 = new Enemy(258,120);\r\n enemy26 = new Enemy(312,120);\r\n enemy27 = new Enemy(366,120);\r\n enemy28 = new Enemy(420,120);\r\n enemy29 = new Enemy(474,120);\r\n enemy30 = new Enemy(528,120);\r\n\r\n lowestY = enemy21.y + enemyHeight;\r\n}", "function drawElements(){\r\n // console.log(\"drawElements CALLED\")\r\n // console.log(`player.x = ${player.x} - - - player Y = ${player.y}`)\r\n \r\n ctx.rect(player.x, player.y, 40, 40);\r\n ctx.stroke()\r\n}", "function rect1(rectX, rectY){\n rect(rectX, rectY, rectXX, rectYY, 20);\n\t}", "function rectangle(x, y, width, height, color){\n ctx.fillStyle = color;\n ctx.fillRect(x, y, width, height);\n }", "function drawRectangle(x,y,width,height,color){\r\n ctx.fillStyle = color;\r\n ctx.fillRect(x,y,width,height);\r\n}", "update() {\n fill(0, 0, this.blue);\n rect (this.x, this.y, this.w, this.h);\n\n // console.log(\"ground is good\");\n\n\n }", "function createEnemy(x, y)\n{\t\n\tvar enemy = enemies.create(x, y, 'enemy');\n\tenemy.animations.add('left', [0, 1, 2, 3, 4, 5], 10, true);\n\tenemy.animations.add('right', [6, 7, 8, 9, 10, 11], 10, true);\n\tenemy.animations.add('stunLeft', [12, 13, 12, 13, 12, 13], 10, true);\n\tenemy.animations.add('stunRight', [14, 15, 14, 15, 14, 15], 10, true);\n\tgame.physics.arcade.enable(enemy);\n\n\t//enemy can't go off world bounds\n\tenemy.body.collideWorldBounds = true;\n\n\tenemy.body.gravity.y = 350;\n\tenemy.direction = game.rnd.integerInRange(0,1) * 2 - 1;\n\t\n\tif(enemy.direction > 0){\n\t\tenemy.animations.play('right');\n\t}\n\telse{\n\t\tenemy.animations.play('left');\n\t}\n\n\tenemy.isStunned = false;\n\tenemy.stunnedTime = 5000;\n\tenemy.spawnTime = 7500;\n\n\t//set animations\n\t\n}", "function monster1(){\n\n ctx.moveTo(150, 80);\n ctx.lineTo(700, 80);\n ctx.lineTo(700, 100);\n ctx.lineTo(150, 100);\n ctx.lineTo(150, 80);\n ctx.moveTo(420, 85);\n ctx.lineTo(425, 85);\n ctx.moveTo(420, 85);\n ctx.lineTo(420, 95);\n ctx.moveTo(200, 100);\n ctx.lineTo(200, 350);\n ctx.lineTo(650, 350);\n ctx.lineTo(650, 100);\n ctx.moveTo(300, 140);\n ctx.lineTo(390, 140);\n ctx.lineTo(390, 195);\n ctx.lineTo(300, 195);\n ctx.lineTo(300, 140);\n ctx.moveTo(550, 140);\n ctx.lineTo(460, 140);\n ctx.lineTo(460, 195);\n ctx.lineTo(550, 195);\n ctx.lineTo(550, 140);\n ctx.moveTo(390, 140);\n ctx.lineTo(390, 100);\n ctx.moveTo(390, 195);\n ctx.lineTo(390, 235);\n ctx.lineTo(460, 235);\n ctx.lineTo(460, 195);\n ctx.moveTo(460, 140);\n ctx.lineTo(460, 100);\n ctx.moveTo(460, 235);\n ctx.lineTo(650, 350);\n ctx.moveTo(390, 235);\n ctx.lineTo(200, 350);\n ctx.moveTo(370, 300);\n ctx.lineTo(480, 300);\n ctx.lineTo(480, 320);\n ctx.lineTo(370, 320);\n ctx.lineTo(370, 300);\n \n}", "function drawHitZones() {\r\n\tfill(153, 204, 255);\r\n\trect(5, height - 40, 50, 40);\r\n\trect(60, height - 40, 50, 40);\r\n\trect(115, height - 40, 50, 40);\r\n\trect(170, height - 40, 50, 40);\r\n}", "function makeRect() { //makes rectangle test\n\tctx.fillRect( 50, 50, 100, 200);\n}", "function rectangle(x,y,wdth,hght) { \n ctx.beginPath(); // tells canvas that you are about to start drawing\n ctx.rect(x,y,wdth,hght);\n ctx.fill();\n ctx.stroke();\n}", "function makeGround() {\n c.beginPath();\n c.rect(0, canvas.height - 100, canvas.width, 50);\n c.fillStyle = \"green\";\n c.fill();\n}", "function Enemy() {\n this.srcX = 131;\n this.srcY = 500;\n this.width = 128;\n this.height = 78;\n this.speed = 2;\n this.drawX = Math.floor(Math.random() * 1000) + gameWidth;\n this.drawY = Math.floor(Math.random() * 422);\n}", "function drawCanyon(t_canyon)\n{\n\n fill(153,27,0)\n rect(t_canyon.x_pos + 80, 430, t_canyon.width - 75,200)\n \n fill (102,178,255)\n rect(t_canyon.x_pos + 105,430, t_canyon.width - 35,200) \n \n fill(153,27,0)\n rect(t_canyon.x_pos + 150,430, t_canyon.width - 75,200) \n \n}", "function rect(x,y,w,h,state,r,c){\n ctx.beginPath();\n ctx.rect(x,y,w,h);\n ctx.closePath();\n if(state=='s'){\n ctx.fillStyle='green';\n ctx.fill();\n }\n else if(state=='f'){\n ctx.fillStyle='red';\n ctx.fill();\n }\n else if(state=='w'){\n ctx.fillStyle='black';\n ctx.fill();\n } \n else if(state=='e'){\n ctx.fillStyle='honeydew';\n ctx.fill();\n }\n else if(state=='p'){\n ctx.fillStyle='cyan';\n ctx.fill();\n }\n else{\n ctx.fillStyle='gold';\n ctx.fill();\n }\n}", "function rect(x, y, w, h) {\n gCtx.beginPath();\n gCtx.rect(x, y, w, h);\n gCtx.closePath();\n gCtx.fill();\n}", "function startCharacter(){\n createRoundRectangle(player[0].color, 40, player[0].x, player[0].y);\n addNumbers(player[0].num, \"#ffffff\", player[0].x+20, player[0].y+20);\n\n createRoundRectangle(player[1].color, 40, player[1].x, player[1].y);\n addNumbers(player[1].num, \"#ffffff\", player[1].x+20, player[1].y+20);\n\n return stage.update();\n}", "addNewEnemy(){\n do{\n this.x = 100*Math.floor(Math.random() * 10) + 10;\n if(this.x <=20) this.x = 20;\n } while (this.x > 1000); \n this.y = 0;\n var enemy=this.enemies.create(this.x,this.y,\"enemy1\");\n \n enemy.setFrame(2);\n enemy.setScale(0.4);\n enemy.checkWorldBounds = true;\n enemy.outOfBoundsKill = true;\n enemy.setVelocityY(100);\n }", "function drawEverything() {\n\tcolorRect(0,0,canvas.width,canvas.height,\"black\"); // background screen size and color\n\tcolorRect(player1X,player1Y,PLAYER_WIDTH,PLAYER_HEIGHT,\"green\"); // player\n\tcolorRect(enemy1X,enemy1Y,ENEMY_1_WIDTH,ENEMY_1_HEIGHT,\"red\"); // enemy 1\n\t\n\tcanvasContext.font=\"26px Helvetica\";\n\tcanvasContext.fillStyle=\"white\";\n\tcanvasContext.fillText((\"Time: \" + time.toString()), 25, 50); \n\n}", "appear()\n {\n\n this.canvas.fillStyle = Fruit.COLORS[Fruit.getRndInteger(0,Fruit.COLORS.length-1)];\n this.canvas.fillRect(this.x,this.y,this.w,this.h);\n\n }", "function drawRectangle() {\n}", "healthBar() {\n noFill();\n strokeWeight(2);\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth, this.healthBarHeight, 10, 10);\n\n if (this.health <= 100 && this.health >= 60) {\n fill(0, 255, 0);\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth - this.healthDisplay, this.healthBarHeight, 10, 10);\n\n }\n else if (this.health < 90 && this.health >= 30) {\n\n fill(\"yellow\");\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth - this.healthDisplay, this.healthBarHeight, 10, 10);\n }\n else if (this.health < 60 && this.health > 0) {\n fill(\"red\");\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth - this.healthDisplay, this.healthBarHeight, 10, 10);\n }\n }", "function drawRect(x,y, width, height, context){\n context.beginPath();\n context.rect(x , y, width , height - 32);\n context.fillStyle = \"0088cc\";\n context.fill();\n context.strokeStyle = 'orange';\n context.stroke();\n}", "function drawPaddle2() {\r\n ctx.beginPath();\r\n ctx.rect(paddle2.x , paddle2.y, paddle2.w, paddle2.h);\r\n ctx.fillStyle = '#333';\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "display(){\r\n \r\n rectMode(CENTER);\r\n fill(\"cyan\");\r\n rect (this.body.position.x, this.body.position.y, this.width, this.height);\r\n \r\n }", "function drawFood(){\r\n\tctx.fillStyle=\"red\";\r\n\tctx.fillRect(food[0].x,food[0].y,snakew,snakeh);\r\n\tctx.fillStyle=\"pink\";\r\n\tctx.strokeRect(food[0].x,food[0].y,snakew,snakeh);\r\n}", "function monster2(){\n targetY = 270;\t\n ctx.moveTo(150, 80);\n ctx.lineTo(700, 80);\n ctx.lineTo(700, 100);\n ctx.lineTo(150, 100);\n ctx.lineTo(150, 80);\n ctx.moveTo(200, 100);\n ctx.lineTo(200, 350);\n ctx.lineTo(650, 350);\n ctx.lineTo(650, 100);\n ctx.moveTo(300, 140);\n ctx.lineTo(390, 140);\n ctx.lineTo(390, 195);\n ctx.lineTo(300, 195);\n ctx.lineTo(300, 140);\n ctx.moveTo(550, 140);\n ctx.lineTo(460, 140);\n ctx.lineTo(460, 195);\n ctx.lineTo(550, 195);\n ctx.lineTo(550, 140);\n ctx.moveTo(390, 140);\n ctx.lineTo(390, 100);\n ctx.moveTo(390, 195);\n ctx.lineTo(390, 235);\n ctx.lineTo(460, 235);\n ctx.lineTo(460, 195);\n ctx.moveTo(460, 140);\n ctx.lineTo(460, 100);\n ctx.moveTo(460, 235);\n ctx.lineTo(650, 350);\n ctx.moveTo(390, 235);\n ctx.lineTo(200, 350);\n ctx.moveTo(370, 300);\n ctx.lineTo(480, 300);\n ctx.lineTo(480, 320);\n ctx.lineTo(370, 320);\n ctx.lineTo(370, 300);\n ctx.moveTo(390, 100);\n ctx.lineTo(425, 235);\n ctx.moveTo(460, 100);\n ctx.lineTo(425, 235);\n ctx.moveTo(345, 140);\n ctx.lineTo(345, 195);\n ctx.moveTo(515, 140);\n ctx.lineTo(515, 195);\n \n}", "function draw() {\n background(0);\n for (let i = 0; i < agents.length; i++) {\n agents[i].update();\n agents[i].display();\n }\n\n for (let i = 1; i < agents.length; i++) {\n\n if (agents[0].collide(agents[i])) {\n agents[0].eat(agents[i]);\n }\n}\n\n}", "function Enemy(x,y,range)\n{\n\n //Local variables for the enemy character. \n this.x = x;\n this.y = y;\n this.range = range;\n this.current_x = x;\n this.incr = 1;\n\n //Constructor function that draws the enemy character.\n\n this.draw = function()\n {\n fill(0);\n ellipse(this.current_x, this.y -25, 50);\n fill(255,0,0);\n ellipse(this.current_x -8,this.y -25, 10);\n ellipse(this.current_x +8,this.y -25, 10);\n rect(this.current_x +5, this.y -50, 5);\n \n }\n\n //Updates position of the enemy character and makes it move on it's own.\n\n this.update = function()\n {\n this.current_x += this.incr;\n if(this.current_x < this.x)\n {\n this.incr = 1.5; \n }\n else if(this.current_x > this.x + this.range)\n {\n this.incr = -1.5;\n }\n\n }\n\n this.isContact = function(gc_x, gc_y)\n {\n //This function will return true if game character makes contact.\n\n var distance = dist(gc_x, gc_y, this.current_x, this.y);\n\n if(distance < 25)\n {\n return true;\n }\n\n return false;\n }\n}", "function drawPaddle1() {\r\n ctx.beginPath();\r\n ctx.rect(paddle.x , paddle.y, paddle.w, paddle.h);\r\n ctx.fillStyle = '#333';\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "function dust() {\n poster.fill(State.Colors.background);\n poster.noStroke();\n\n for (var i = 0; i < rects.length; i++) {\n poster.rect(rects[i].x, rects[i].y, rects[i].w, rects[i].h);\n }\n}", "render() {\n\t\tfill(gameSettings['food_color'][0], gameSettings['food_color'][1], gameSettings['food_color'][2]);\n\t\trect(this.x, this.y, gameSettings['scale'], gameSettings['scale']);\n\t}", "drawLife(x, y, size, health, maxHealth, level) {\n let width = 2*size;\n let height = 7;\n let border = 2;\n let ratio = health / maxHealth;\n let ratioXp = level.xp / level.xpNeeded;\n let X = x - (width / 2);\n let Y = y + size + 20;\n this.context.fillStyle = this.otherColor;\n this.context.fillRect(X-border, Y-border, width+(2*border), height+(2*border));\n this.context.fillStyle = this.lifeColor;\n this.context.fillRect(X, Y, ratio * width, height * (2 / 3));\n this.context.fillStyle = this.redColor;\n this.context.fillRect(X + (ratio * width), Y, (1 - ratio) * width, height * (2 / 3));\n this.context.fillStyle = this.xpColor;\n this.context.fillRect(X, Y+(height*2/3), ratioXp * width, height * (1 / 3));\n this.context.fillStyle = this.emptyXpColor;\n this.context.fillRect(X + (ratioXp * width), Y+(height*2/3), (1-ratioXp) * width, height * (1 / 3));\n }", "function drawRect(gRect, w, h, x, y) { gRect.append(\"rect\").attr(\"fill\", \"red\").attr(\"width\", w).attr(\"height\", h).attr(\"x\", x).attr(\"y\", y); }", "function draw(rectX,rectY){\n //bg\n context.drawImage(maze_img, 0, 0);\n \n //middle/goal\n //context.arc(100, 150, 5, 0, 2 * Math.PI, false);\n context.beginPath();\n context.arc(maze_width/2, maze_height/2, 5, 0, 2 * Math.PI, false);\n context.closePath();\n context.fillStyle = '#00FF00';\n context.fill();\n\n drawRectangle(rectX,rectY,\"purple\");\n }", "function drawRect(x, y, width, height, color=\"black\"){\n\tctx.beginPath();\n\tctx.rect(x, y, width, height);\n\tctx.fillStyle = color;\n\tctx.fill();\n\tctx.closePath();\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 enemys()\r\n {\r\n // potential enemy\r\n fill(300, 150, 100);\r\n // draw the shape\r\n fill(\"red\");\r\n rect(210, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(235, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(225, shapeY, 15, 15);\r\n ellipse(245, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(245, shapeY, 10, 10);\r\n ellipse(225, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 2\r\n fill(\"purple\");\r\n rect(310, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(335, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(325, shapeY, 15, 15);\r\n ellipse(345, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(345, shapeY, 10, 10);\r\n ellipse(325, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 3\r\n fill(\"orange\");\r\n rect(110, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(135, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(125, shapeY, 15, 15);\r\n ellipse(145, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(145, shapeY, 10, 10);\r\n ellipse(125, shapeY, 10, 10);\r\n\r\n // get a random speed when the it first starts\r\n shapeXSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n shapeYSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n\r\n // move the shape\r\n shapeX += shapeXSpeed;\r\n shapeY += shapeYSpeed;\r\n }", "function rectangle() {\n\n}", "function Invasion(){\n \n\t\tfor(var i = AlienToShoot() ; i < Enemyx.length; i++){\n \n\t\t\tif(AlienToShoot() <= 40 ){\n\t\t\t\tEnemyShoot[i] == true\n\t\t\t\n\t\t\t}\n\n\t\t\tif(EnemyShoot[i] == true){\n\n \n\t\t\t\t\tctx.fillStyle = 'red';\n\t\t\t\t\tctx.fillRect(EnemyLx[i] + 13, EnemyLy[i] + 13 , 5, 10);\n\t\t\t\t\tEnemyLy[i] += 15;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460){\n\t\t\t\t\tEnemyShoot[i] = false;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460 && EnemyShoot[i] == false){\n\t\t\t\t\t\tEnemyLy[i] = 300000;\n\t\t\t\t\t\tEnemyLy[i] -= 0;\n\t\t\t\t}\n \n\t\t}\n\t}", "function draw() {\n\tbackground(0);\n\tmove();\n\tchase();\n\tellipse(x, y, w, h);\n\tellipse(x1, y1, 30, 5);\n\tcollision();\n}", "function drawRect(){\n for(y = 0; y < shapePosY.length; y++){\n for(i = 0; i < shapePosX.length; i++){\n noStroke();\n fill(colors[i]);\n rect(shapePosX[i], shapePosY[y], 35, 35);\n }\n }\n}", "function spawnEnemy() {\n r = getRandomInt(1, 25);\n if (r === 1) {\n newenemyY = getRandomInt(-300, -25);\n s = 1;\n new enemy(newenemyY, s);\n } else if (r === 2) {\n newenemyY = getRandomInt(800, 1050);\n s = -1;\n new enemy(newenemyY, s);\n }\n }", "function paddle1(x,y){\n ctx.beginPath();\n ctx.rect(x,y,paddleWidth, paddleHeight);\n ctx.closePath();\n ctx.fill();\n}", "function rect(x, y, w, h, state) {\n //red red green green blue blue\n if (state == 's') {\n ctx.fillStyle = '#00FF00';\n }\n else if (state == 'f') {\n ctx.fillStyle = '#FF0000';\n }\n else if (state == 'e') {\n ctx.fillStyle = '#CCCCCC';\n }\n else if (state == 'w') {\n ctx.fillStyle = '#003366';\n }\n else if (state == 'x') {\n ctx.fillStyle = '#FF9F19';\n }\n else if (state == 'v') {\n ctx.fillStyle = '#89CFF0';\n }\n else {\n ctx.fillStyle = '#CCCCCC';\n }\n\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.closePath();\n ctx.fill();\n}", "function drawFood()\n{\n ctx.fillStyle = 'red';\n ctx.strokestyle = 'red';\n ctx.fillRect(foodX, foodY, 10, 10);\n ctx.strokeRect(foodX, foodY, 10, 10);\n}", "function monster3(){\n targetY = 200;\t\n ctx.moveTo(150, 80);\n ctx.lineTo(700, 80);\n ctx.lineTo(700, 100);\n ctx.lineTo(150, 100);\n ctx.lineTo(150, 80);\n ctx.moveTo(200, 100);\n ctx.lineTo(200, 350);\n ctx.lineTo(650, 350);\n ctx.lineTo(650, 100);\n ctx.moveTo(300, 140);\n ctx.lineTo(390, 140);\n ctx.lineTo(390, 195);\n ctx.lineTo(300, 195);\n ctx.lineTo(300, 140);\n ctx.moveTo(550, 140);\n ctx.lineTo(460, 140);\n ctx.lineTo(460, 195);\n ctx.lineTo(550, 195);\n ctx.lineTo(550, 140);\n ctx.moveTo(390, 140);\n ctx.lineTo(390, 100);\n ctx.moveTo(390, 195);\n ctx.lineTo(390, 235);\n ctx.lineTo(460, 235);\n ctx.lineTo(460, 195);\n ctx.moveTo(460, 140);\n ctx.lineTo(460, 100);\n ctx.moveTo(460, 235);\n ctx.lineTo(650, 350);\n ctx.moveTo(390, 235);\n ctx.lineTo(200, 350);\n ctx.moveTo(370, 300);\n ctx.lineTo(480, 300);\n ctx.lineTo(480, 320);\n ctx.lineTo(370, 320);\n ctx.lineTo(370, 300);\n ctx.moveTo(345, 140);\n ctx.lineTo(345, 195);\n ctx.moveTo(515, 140);\n ctx.lineTo(515, 195); \n ctx.moveTo(315, 280); \n ctx.lineTo(535, 280);\n ctx.moveTo(190, 370); \n ctx.lineTo(190, 350);\n ctx.lineTo(200, 350);\n}", "function draw() { \n flyingSquare();\n background(80, 80, 80);\n rect(a, b, 250, 75);\n}", "function drawHealth() {\n ctx.lineWidth = 1\n // Draw empty health circles\n for (let i = hero.maxhealth; i > 0; i--) {\n circle(20+(30*i), 50, 30, 'white', 'black', 0, 2 * Math.PI, [5, 5])\n }\n // Fill health circles\n for (let i = hero.health; i > 0; i--) {\n circle(20+(30*i), 50, 30, 'hotpink', 'black', 0 - frame, 2 * Math.PI + frame, [5, 5])\n }\n}", "function draw() {\n background(255,0,0)\n rectMode(CENTER)\n rect(250.250,100,100)\n}", "function createEnemies() {\n //\n // Create 10 enemies at varying velocities and\n // positions\n //\n for (var i = 1; i < 11; i++) {\n\tvar newEnemy = new Enemy();\n\t//newEnemy.x = getRandomInt(0,ctx.canvas.width - \n\tnewEnemy.x = getRandomInt(0,505 - \n\t newEnemy.width);\n\t// Center enemy on stone tile.\n\tnewEnemy.y = canvasOffset + getRandomInt(1,4)*tileHeight\n\t + 5;\n\tnewEnemy.velocity_x = getRandomInt(20,50);\n\tallEnemies.push(newEnemy);\n }\n}", "function drawPaddle(){\n gamearea.beginPath();\n gamearea.rect(Paddle.x, Paddle.y, Paddle.w, Paddle.h);\n gamearea.fillStyle = '#e7fc03';\n gamearea.fill();\n gamearea.closePath();\n}", "function drawEnemy(){\n\tfor(let i=0;i<enemyArr.length; i++){\n\n\t\tif(enemyArr[i].name === 'redFregat'){\n\t\t\tif(enemyArr[i].y >= enemyArr[i].yPos){\n\t\t\t\tenemyArr[i].speedY = 0;\n\t\t\t\tif(enemyArr[i].speedX === 0){\n\t\t\t\t\tenemyArr[i].speedX = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tenemyArr[i].x += enemyArr[i].speedX;\n\t\tenemyArr[i].y += enemyArr[i].speedY;\n\t\tif (enemyArr[i].name != 'redFregatBoss'){\n\t\t\tif(enemyArr[i].x + enemyArr[i].width >=500 || enemyArr[i].x <=0){\n\t\t\t\tenemyArr[i].speedX *= -1;\n\t\t\t}\n\t\t}\n\n\t\t//Drawing ship enemy============================\n\t\t\tenemyArr[i].N_x += 0.2;\n\t\t\tship_01()\n\n\t\t//Drawing ship enemy============================\n\n\t\t//Drawing AsteroidRed enemy============================\n\t\t\t\n\t\t\tasteroidDraw()\n\n\t\t//Drawing AsteroidRed enemy============================\n\n\n\t\t//Drawing redShip Freg Lazer enemy============================\n\t\t\t\tif(enemyArr[i].name === 'redShip'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%80 === 0){\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , 0, 3, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif(enemyArr[i].name === 'redFregat'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%160 === 0){\n\n\t\t\t\t\t\tlet firstL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tfirstL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfirstL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , firstL, 2, 10, 15,'enemyLazer', 1)\n\n\t\t\t\t\t\tlet secondL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tsecondL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsecondL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+70, (enemyArr[i].y+enemyArr[i].height) , secondL, 2, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\tredShipFregLazer()\n\t\t//Drawing redShip Freg Lazer enemy============================\n\n\t\t//delete enemy from array===================\n\t\tif( enemyArr[i].y >=300 || enemyArr[i].y < -50 || enemyArr[i].x >=520 || enemyArr[i].x < -10){\n\n\t\t\tenDead = true;\n\t\t\tif(enDead){\n\t\t\t\tenemyArr.splice(i, 1);\n\n\t\t\t}\n\t\t}\n\t\t//delete enemy from array===================\n\t}\n}", "constructor() {\r\n this.w = 15;\r\n this.h = 9;\r\n this.x = Math.random() * width;\r\n \r\n // Make sure enemies are not cut off.\r\n this.x = this.x - this.w / 2 <= 0 ? this.x + this.w / 2 : \r\n this.x + this.w / 2 >= width ? this.x - this.w / 2 : this.x;\r\n this.y = -this.w / 2;\r\n }", "function drawPlayer() {\n fill(250,20,50,playerHealth);\n ellipse(playerX,playerY,playerRadius*2,playerRadius*2);\n}", "function createEnemySheet()\n{\n let sheet = new PIXI.BaseTexture.from(app.loader.resources[\"enemy\"].url);\n let w = 80;\n let h = 80;\n \n enemySheet[\"shoot\"] = [\n new PIXI.Texture(sheet, new PIXI.Rectangle(0, 0, w, h))\n ];\n}", "function Rect (x1, y1, x2, y2) {\n \n \n this.left = x1;\n this.right = x2;\n this.top = y1;\n this.bottom = y2;\n}", "function draw() {\n\tbackground(51);\n\n\tif(s.eat(food)){\n\t\tpickLocation();\n\t}\t\n\n\ts.death();\n\ts.update();\n\ts.show();\n\n\tfill(255, 0 ,100);\n\trect(food.x, food.y, grid, grid);\n}", "function draw() {\n createCanvas(800, 600);\n\n background(50, 50, 50);\n\n\n triangle(265, 320, 400, 500, 535, 320);\n\n rect(250, 30, 15, 270);\n\n rect(535, 30, 15, 270)\n\n fill(100, 200, 300)\n circle(400, 250, 150);\n\n for(var timer = 0; timer < eye_color.length; timer++){\n fill(eye_color[timer])\n circle(400, 250, 100)\n\n }\n}", "function draw() {\n background(\"lightblue\");\n /*Put your main animations and code here*/\n\t \n /*ctx.fillStyle = \"blue\";\n\tt.rect(turt.x, turt.y, 200, 200);*/\n\t\n /*log frame*/\n showFrames();\n}", "function drawCube(){\n ctx.beginPath();\n ctx.rect(x, y, cubeWidth, cubeHeight);\n ctx.fillStyle = \"#5b34eb\";\n ctx.fill();\n ctx.closePath();\n}", "function drawRect(point,color){\n ctx.fillStyle=\"cyan\";\n ctx.strokeStyle=\"gray\";\n ctx.lineWidth=3;\n ctx.beginPath();\n ctx.rect(point.x-13,point.y-8,25,15);\n ctx.fill();\n ctx.stroke();\n }", "function Rectangle(x, y, width, height) {\r\n this.x = (x == null) ? 0 : x;\r\n this.y = (y == null) ? 0 : y;\r\n this.width = (width == null) ? 0 : width;\r\n this.height = (height == null) ? this.width : height;\r\n this.intersects = function (rect) {\r\n if (rect == null) {\r\n window.console.warn('Missing parameters on function intersects');\r\n } else {\r\n return (this.x < rect.x + rect.width &&\r\n this.x + this.width > rect.x &&\r\n this.y < rect.y + rect.height &&\r\n this.y + this.height > rect.y);\r\n }\r\n};\r\n\r\n\r\nthis.fill = function (ctx) {\r\n if (ctx == null) {\r\n window.console.warn('Missing parameters on function fill');\r\n } else {\r\n ctx.fillRect(this.x, this.y, this.width, this.height);\r\n }\r\n};\r\n}", "function createSingleGroundEnemy_1 (index, game, x, y) //test //My version\n\t{\n\t\t//this.enemy = game.add.sprite(x, y, 'ground_enemy_1'); //test\n\t\tthis.enemy = enemies.create(x, y, 'ground_enemy_1'); //test\n\t\tthis.enemy.anchor.setTo(0.5, 0.5);\n\t\tthis.enemy.name = index.toString();\n\t\t//game.physics.enable(this.enemy, Phaser.Physics.ARCADE); //original\n\t\tgame.physics.arcade.enable(this.enemy); //test\n\t\t//this.enemy.body.immovable = true;\n\t\tthis.enemy.body.collideWorldBounds = true;\n\t\t//this.enemy.body.allowGravity = false;\n\t\t\n\t\t//this.enemy.body.checkCollision = true; //test\n\t\t\n\t\t//game.physics.arcade.enable(enemies); //test\n\t\t//game.physics.arcade.collide(this.enemy, layer); //test\n\t\t\n\t\t//game.physics.arcade.collide(this.enemy, layer); //test\n\t\t\n\t\t//test\n\t\tthis.enemy.health = 50; //test\n\t\t//test\n\t\t/*\n\t\tthis.enemyTween = game.add.tween(this.enemy).to( {\n\t\t\tx: this.enemy.x + 800\n\t\t}, 2000, 'Linear', true, 0, 100, true);\n\t\t*/\n\t\tthis.enemyTween = game.add.tween(this.enemy).to( {\n\t\t\tx: this.enemy.x + 100\n\t\t}, 2000, 'Linear', true, 0, 100, true);\n\t}", "function drawRectangle (element, player) {\n element.append('svg')\n .attr('width', 15)\n .attr('height', 16)\n .append('rect')\n .attr('y', 1)\n .attr('width', 15)\n .attr('height', 15)\n .style('fill', color(player))\n .style('stroke', 'black')\n .style('stroke-width', 1)\n }", "show() {\n noStroke();\n if (currentScene === 3) {\n switch(this.quality) {\n case 1:\n fill(\"white\");\n break;\n case 2:\n fill(\"grey\");\n break;\n case 3:\n fill(\"black\");\n break;\n }\n }\n if (currentScene === 4) {\n fill(0)\n this.vel = createVector(-1, 0);\n }\n // changing these numbers makes the collision not work, why?\n rect(this.pos.x, this.pos.y, 10, 10) // try changing the numbers in person collision too\n \n }", "function drawScene3() {\n background(0);\n\n image(gameEnds, 0, 0, width, height);\n fill(21, 200, 0);\n textFont(\"IMPACT\");\n textStyle(ITALIC);\n strokeWeight(30);\n stroke(182, 56, 204);\n textSize(70);\n text(yourScore, 450, 525);\n\n\n fill(182, 56, 204);\n stroke(21, 200, 0);\n strokeWeight(3);\n rect(205, 300, 800, 5);\n\n fill(182, 56, 204);\n stroke(21, 200, 0);\n strokeWeight(5);\n rect(480, 720, 250, 10);\n\n \ttextSize (100)\n \ttext(score, 565,718);\n\n\n}", "function draw () {\n background(120); // light gray background\n strokeWeight(8); // Stroke weight to 8 pixels\n //ellipse(480, 250, 190, 190);\n // The rectangle draws on top of the ellipse\n // because it comes after in the code\n //rect(500, 280, 260, 20);\n //point(240, 60);\n\n//triangle(347, 54, 392, 9, 392, 66);\n\n//quad(158, 55, 199, 14, 392, 66, 351, 107);\n\n//rect(50, 50, 80, 80)\n\n//ellipse( 200, 200, 50, 50);\n//fill(255);\n//text (\"4\", 200,200);\n// black 3 \nfill(0); \n\nrect(300,200,25,80);\nrect (330,168,25,25);\nrect (330,287,90,25);\nrect (428,200,25,80);\nrect (460,287,90,25);\nrect (555,200,25,80);\nrect (525,168,25,25);\n\n//white 5\nstrokeWeight(0);\nfill (255);\nrect (380,100,115,25);\nrect(380,125,25,80);\nrect (380,200,115,25);\nrect(490,225,25,100);\nrect (380,320,115,25);\nrect (355,297,25,25);\n\n//red 1 \n\nfill (255,0,0);\nrect (370,230,160,25);\nrect (370,230,25,50);\n\n\n\n}", "function drawRectAtBoardPos(pos_x, pos_y, player_number){\n if(player_number == 2){\n fill('#95a5a6');\n } else if (player_number == 1){\n fill('#2c3e50');\n }\n\n // array index starts at 1.\n start_rect_x = 90 * (pos_x - 1);\n start_rect_y = 90 * (pos_y - 1);\n\n // Size will always be 90 * 90\n rect(start_rect_x, start_rect_y, 90, 90);\n}", "function draw_rect( ctx, stroke, fill ) \n{\n stroke = 'blue';\n fill = 'grey';\n ctx.save( );\n ctx.strokeStyle = stroke;\n ctx.fillStyle = fill;\n ctx.lineWidth = 5;\n ctx.rect(5, 5, canvas.width - 5, canvas.height - 5);\n ctx.stroke();\n ctx.fill();\n ctx.restore( );\n}", "function drawHealthBar(){\n push();\n rectMode(CORNER);\n //background rectangle of health bar\n fill(64,43,112);\n rect(0,height-50,width/1 + 10,30);\n //The health bar\n fill(153, 153, 255);\n healthBar = map(harryHealth,0,harryMaxHealth, 0, width);\n rect(0, height-50,healthBar,30);\n //Text showing the Energy level\n textFont (\"Helvetica\")\n fill(64,43,112);\n textSize(15);\n textAlign(CENTER,CENTER);\n var energyText = \"ENERGY LEFT\";\n text(energyText,width/2,height-35);\n pop();\n}", "addNewEnemy2(){\n do{\n this.y = 100*Math.floor(Math.random() * 10) + 10;\n if(this.y <=20) this.y = 20; \n } while (this.y > 1300);\n this.opt = 0;\n this.opt = (Math.random() > 0.5 ? 0 : 1000);\n this.x = this.opt;\n var enemy=this.enemies.create(this.x,this.y,\"enemy1\");\n \n if(this.opt == 0){\n enemy.setVelocityX(100);\n enemy.setFrame(3);\n }\n else {\n enemy.setVelocityX(-100);\n enemy.setFrame(1);\n }\n \n enemy.setScale(0.4);\n enemy.checkWorldBounds = true;\n enemy.outOfBoundsKill = true;\n enemy.setVelocityY(0);\n \n }", "function rectangle(){\nforward(60);\nright(90);\nforward(30);\nright(90);\nforward(60);\nright(90);\nforward(30);\nright(90);\nforward(60);\n}", "function draw_rect(X,Y,Z)\n{\n //outer portion in solid color\n c.beginPath();\n c.fillStyle = Z;\n c.fillRect(X-8, Y, 40, 40);\n\n //just inner part part with white color\n c.beginPath();\n c.fillStyle = '#ffffff';\n c.fillRect(X-6, Y+2, 35, 35);\n\n //middle part\n c.beginPath();\n c.fillStyle = Z;\n c.fillRect(X-1, Y+7, 25, 25);\n}", "function drawRectangle(x, y, style) {\n context.drawImage(maze_img, 0, 0);\n \n //middle/goal\n context.beginPath();\n context.arc(maze_width/2, maze_height/2, 5, 0, 2 * Math.PI, false);\n context.closePath();\n context.fillStyle = '#00FF00';\n context.fill();\n\n current_x = x;\n current_y = y;\n context.beginPath();\n context.rect(x, y, 15, 15);\n context.closePath();\n context.fillStyle = style;\n context.fill();\n }", "function rect(width, height, fill) {\n $._rect(width, -height, fill);\n}", "function draw_die(context){\n context.fillStyle = \"#003399\";\n context.beginPath();\n context.moveTo(ball_visual.centre_x, ball_visual.centre_y - 75);\n context.lineTo(ball_visual.centre_x + 70, ball_visual.centre_y + 50);\n context.lineTo(ball_visual.centre_x - 70, ball_visual.centre_y + 50);\n context.fill();\n}", "function drawPaddle(){\r\n ctx.beginPath();\r\n ctx.rect(paddleX, paddleY, paddleWidth, paddleHeight);\r\n ctx.fillStyle = \"#0095DD\";\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "function drawFood() {\n ctx.fillStyle = 'blue';\n ctx.fillRect(food.x, food.y, side, side);\n}", "function draw_rect( ctx, stroke, fill )\r\n{\r\n stroke = stroke || 'lightgrey';\r\n fill = fill || 'dimgrey';\r\n ctx.save( );\r\n ctx.strokeStyle = stroke;\r\n ctx.fillStyle = fill;\r\n ctx.lineWidth = 5;\r\n ctx.rect(75, 50, canvas.width - 150, canvas.height - 100);\r\n ctx.stroke();\r\n ctx.fill();\r\n ctx.restore( );\r\n}", "createRect(position){\r\n\t\tthis.beginFill(0xFF0000);\r\n\t\tthis.lineStyle(1, 0x000000, 1);\r\n\t\tthis.drawRect(-this.size.x / 2, -this.size.y / 2, this.size.x, this.size.y);\r\n this.endFill();\r\n this.beginFill(0x00FF00);\r\n\t\tthis.lineStyle(1, 0x000000, 1);\r\n this.drawRect(-this.size.x / 2, -this.size.y / 2, \r\n this.size.x * this.currentHealth / this.initialHealth, this.size.y * this.currentHealth / this.initialHealth);\r\n\t\tthis.endFill();\r\n\t\tthis.x = position.x;\r\n this.y = position.y;\r\n }", "function drawRect(leftX,topY,width,height,color){\n canvasContext.fillStyle = color;\n canvasContext.fillRect(leftX,topY,width,height);\n}" ]
[ "0.747072", "0.720835", "0.7198266", "0.7083588", "0.704784", "0.69502765", "0.69106334", "0.69009435", "0.68677914", "0.67689973", "0.6768303", "0.6758516", "0.6740612", "0.6720367", "0.6702982", "0.6675754", "0.6654712", "0.6651877", "0.6647239", "0.6612079", "0.6611717", "0.65981495", "0.656153", "0.65538114", "0.6540586", "0.65299606", "0.65212756", "0.65111643", "0.65084845", "0.64979625", "0.6490533", "0.6489228", "0.6479655", "0.6477", "0.6472807", "0.64722294", "0.6468365", "0.6455864", "0.6448548", "0.64276254", "0.6426077", "0.6420908", "0.6419653", "0.6416175", "0.6391549", "0.6388285", "0.6380669", "0.6376247", "0.63661075", "0.6364618", "0.63618547", "0.63525486", "0.6349255", "0.63443047", "0.6334796", "0.63342476", "0.63263786", "0.6321943", "0.6320052", "0.63183236", "0.6315406", "0.63127285", "0.6310189", "0.63100713", "0.6303383", "0.6299583", "0.6295202", "0.6288572", "0.6288555", "0.6280221", "0.6268126", "0.6256124", "0.6254846", "0.624677", "0.6241737", "0.62410516", "0.6234386", "0.6221424", "0.6220609", "0.62169284", "0.6212942", "0.6209044", "0.62078285", "0.620405", "0.6201509", "0.6193813", "0.61867505", "0.6179046", "0.61729175", "0.61707306", "0.6170253", "0.6166119", "0.6162996", "0.61626464", "0.6156904", "0.61543906", "0.6153487", "0.6147596", "0.6136885", "0.613348", "0.61330193" ]
0.0
-1
function to initialize our game
function init() { scores = [0, 0]; activePlayer = 0; roundScore = 0; gamePlaying = true; //hiding the dice image when the page first loads using css display property to none document.querySelector('.dice').style.display = 'none'; document.querySelector('.dice1').style.display = 'none'; //setting the DOM values to zero, here is for the score and current player document.getElementById('score-0').textContent = '0'; document.getElementById('score-1').textContent = '0'; document.getElementById('current-0').textContent = '0'; document.getElementById('current-1').textContent = '0'; document.getElementById('name-0').textContent = 'Player 1'; document.getElementById('name-1').textContent = 'Player 2'; document.querySelector('.player-0-panel').classList.remove('winner'); document.querySelector('.player-1-panel').classList.remove('winner'); document.querySelector('.player-0-panel').classList.remove('active'); document.querySelector('.player-1-panel').classList.remove('active'); document.querySelector('.player-0-panel').classList.add('active'); totalWinning = prompt("Enter Total Winning value"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n initLadrillos();\r\n}", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function initializeGame() {\n createArray();\n initializeArray();\n shipLocator();\n }", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "init(game) {\n\n }", "function init() {\n reset();\n menu = new GameMenu();\n /* Initialize the level */\n initLevel();\n\n lastTime = Date.now();\n main();\n }", "function init () {\r\n initAllVars();\r\n gameLoop();\r\n}", "function initialize() {\n console.log('game initializing...');\n\n document\n .getElementById('game-quit-btn')\n .addEventListener('click', function() {\n network.emit(NetworkIds.DISCONNECT_GAME);\n network.unlistenGameEvents();\n menu.showScreen('main-menu');\n });\n\n //\n // Get the intial viewport settings prepared.\n graphics.viewport.set(\n 0,\n 0,\n 0.5,\n graphics.world.width,\n graphics.world.height\n ); // The buffer can't really be any larger than world.buffer, guess I could protect against that.\n\n //\n // Define the TiledImage model we'll be using for our background.\n background = components.TiledImage({\n pixel: {\n width: assets.background.width,\n height: assets.background.height,\n },\n size: { width: graphics.world.width, height: graphics.world.height },\n tileSize: assets.background.tileSize,\n assetKey: 'background',\n });\n }", "function init() {\n lobby.init();\n game.init();\n}", "function init() {\n gameStart();\n}", "function init() {\n if (game.init())\n game.start();\n}", "function gameInit() {\r\n // disable menu when right click with the mouse.\r\n dissRightClickMenu();\r\n resetValues();\r\n // switch emoji face to normal.\r\n switchEmoji();\r\n gBoard = createBoard(gLevel.SIZE);\r\n renderBoard(gBoard);\r\n}", "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function startGame() {\n init();\n}", "function initializeGame() {\n setupCards();\n playMatchingGame();\n}", "function init()\n\t{\n\t\t\n\t\t\n\t//////////\n\t///STATE VARIABLES\n\tloadMainMenu();\n\t\n\t//////////////////////\n\t///GAME ENGINE START\n\t//\tThis starts your game/program\n\t//\t\"paint is the piece of code that runs over and over again, so put all the stuff you want to draw in here\n\t//\t\"60\" sets how fast things should go\n\t//\tOnce you choose a good speed for your program, you will never need to update this file ever again.\n\n\t//if(typeof game_loop != \"undefined\") clearInterval(game_loop);\n\t//\tgame_loop = setInterval(paint, 60); //old value 130\n\t}", "function initGame() {\n gBoard = buildBoard(gLevel);\n renderBoard();\n}", "function init()\r\n{\r\n\tconsole.log('init');\r\n\tinitView(); \t\r\n OSnext(); \r\n \t \t\t\r\n// \tdeleteGame();\r\n// \tloadGame();\r\n// \t\r\n// \tif (game==null) {\r\n// \t\tstartNewGame();\r\n// \t} else {\r\n// \t UI_clear(); \r\n// \t UI_closeOverlay(); \r\n// \t UI_hideActions();\r\n// \t \tUI_hideCard();\r\n// \t UI_updateFront('Sinai');\r\n// \t UI_updateFront('Mesopotamia');\r\n// \t UI_updateFront('Caucasus');\r\n// \t UI_updateFront('Arab');\r\n// \t UI_updateFront('Gallipoli');\r\n// \t UI_updateFront('Salonika');\r\n// \t UI_updateNarrows();\r\n// \t UI_updateCounters();\t\t\t\r\n// \t\tconsole.log('loaded previous game');\r\n// \t}\r\n\t\t \r\n}", "function initializeGame() {\n console.log(\"initialize Game\");\n fadeIn(\"prestart\"); // start slide shows \n //playIt(song); // start woodstock song\n ramdomize(gameArray); // randomize order of artist names for each game\n roundsMax = 2; // gameArray.length; ******************************************************\n}", "function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}", "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG.audioEl = document.getElementById('audio-player');\n\t\n\t// Start a new game\n\tnewGame(G);\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"gameCanvas\"));\n game = new createjs.Container();\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n // When game begins, current state will be opening menu (MENU_STATE)\n //scoreboard = new objects.scoreBoard(stage, game);\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init() {\n initValues();\n initEngine();\n initLevel();\n initTouchHandlers();\n startTurn();\n initEffects();\n setInterval(tick, 10);\n\t}", "function initGame() {\n players = [];\n teams = [];\n orbs = [];\n bases = [];\n createOrbs(defaultOrbs);\n createBases(defaultBases);\n}", "function initialize(){\n playing=true;\n lhor=false;\n lver=false;\n victory=false;\n turns=0;\n}", "function init() {\n // get a referene to the target <canvas> element.\n if (!(canvas = document.getElementById(\"game-canvas\"))) {\n throw Error(\"Unable to find the required canvas element.\");\n }\n\n // resize the canvas based on the available browser available draw size.\n // this ensures that a full screen window can contain the whole game view.\n canvas.height = (window.screen.availHeight - 100);\n canvas.width = (canvas.height * 0.8);\n\n // get a reference to the 2D drawing context.\n if (!(ctx = canvas.getContext(\"2d\"))) {\n throw Error(\"Unable to get 2D draw context from the canvas.\");\n }\n\n // specify global draw definitions.\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n\n // set the welcome scene as the initial scene.\n setScene(welcomeScene);\n }", "function start()\r\n{\r\ninit();\r\ngame.start();\r\n}", "function init() {\n // quadTree = new QuadTree();\n showCanvas();\n debug.init();\n keyboard.init();\n menuWindow.init();\n // fillboxes(100);\n Game.init();\n}", "init() {\n // Called on scene initialization.\n console.log(\"the-game system init\");\n this.lastCreepReleaseTime = -60000;\n this.creepReleaseFrequency = 20000;\n this.paused = true;\n\n this.startSlots = [0,30,60,90,120,150,180,210,240,270,300,330];\n this._creepCount = 0;\n }", "function initGame() {\r\n\tinitFE();\r\n\tinitGP();\r\n\tsetTimeout(startLoader, 250);\r\n}", "function init()\n{\n game = new Phaser.Game(768, 432, Phaser.CANVAS, '', null, false, false);\n\n\tgame.state.add(\"MainGame\", MainGame);\n\tgame.state.start(\"MainGame\");\n}", "function on_load()\n{\n\tgame.start();\n}", "function init() {\n\tif (logFull) console.log(\"%s(%j)\", arguments.callee.name, Array.prototype.slice.call(arguments).sort());\n\tcanvas = document.getElementById(\"game-canvas\");\n\tctx = canvas.getContext(\"2d\");\n\n\tdocument.body.style.backgroundColor = BACKGROUND_COLOR;\n\n\thandleResize();\n}", "function initGame() {\n first_item_timestamp = Math.round((new Date().getTime()) / 100) / 10;\n initializeSetsOfChoices();\n adjustSlider(set[round][stage][1], set[round][stage][2], set[round][stage][3], set[round][stage][4], set[round][stage][5], set[round][stage][6]);\n\n // we store some data\n itemLowvalYou[stage] = set[round][stage][1];\n itemHighvalYou[stage] = set[round][stage][2];\n itemDescYou[stage] = set[round][stage][3];\n itemLowvalOther[stage] = set[round][stage][4];\n itemHighvalOther[stage] = set[round][stage][5];\n itemDescOther[stage] = set[round][stage][6];\n itemID[stage] = set[round][stage][7];\n\n initSlider();\n if (storeSearchPath == 1) {\n trackTicks();\n }\n gameMsg = '';\n dispGame();\n }", "init() {\n\t\tif (this.isStart) {\n\t\t\tthis.world = new World(this.ctx);\n\t\t\tthis.world.init();\n\n\t\t\tthis.ctx.drawImage(flappyBird, 69, 100, FLAPPY_BIRD_WIDTH, FLAPPY_BIRD_HEIGHT);\n\t\t\tthis.ctx.drawImage(birdNormal, 120, 145, BIRD_WIDTH, BIRD_HEIGHT);\n\t\t\tthis.ctx.drawImage(getReady, 72, 220, GET_READY_WIDTH, GET_READY_HEIGHT);\n\t\t\tthis.ctx.drawImage(tap, 72, 300, TAP_WIDTH, TAP_HEIGHT);\n\n\t\t\tthis.ctx.font = '500 30px Noto Sans JP';\n\t\t\tthis.ctx.fillStyle = 'white';\n\t\t\tthis.ctx.fillText('Click To Start', 60, 450);\n\n\t\t\tthis.getHighScore();\n\t\t\tthis.drawScore();\n\n\t\t\tthis.container.addEventListener('click', this.playGame);\n\t\t}\n\t}", "function init() {\n gameData = {\n emeraldValue: gemValue(1, 12),\n jewelValue: gemValue(1, 12),\n rubyValue: gemValue(1, 12),\n topazValue: gemValue(1, 12),\n randomTarget: targetScore(19, 120),\n scoreCounter: null,\n }\n targetScore();\n displayAll();\n }", "initGame() {\n\t\t//gameservices hangmnGuessWord\n\t\t//gameServices placeHodlerGenerator\n\t}", "function initialiseGame() {\n enableAnswerBtns();\n hideGameSummaryModal();\n showGameIntroModal();\n selectedStories = [];\n score = 0;\n round = 1;\n resetGameStats();\n}", "function initGame()\n{\n\tturn = 0;\n\tgame_started = 0;\n player = 0;\n}", "init() {\r\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\r\n //console.log(result);\r\n\r\n this.assignPlayer();\r\n gameView.init();\r\n }", "function initGame(){\n // Bind the keys for the title screen\n bindTitleKeys();\n\n // Initialize the audio helper\n audioHelper = new AudioHelper(audioHelper ? audioHelper.isMuted() : false);\n\n audioHelper.stopGameMusic();\n // Play the intro music\n audioHelper.startIntroMusic();\n\n // Setup the title screen\n titleScene.visible = true;\n gameScene.visible = false;\n gameOverScene.visible = false;\n renderer.backgroundColor = GAME_TITLE_BACKGROUND_COLOR;\n\n // Set the game state\n gameState = title;\n}", "function init() {\r\n\t/* Globals initialisation */\r\n\tset_globals();\r\n\t\r\n\t/* Retrieving top scores from database */\r\n\tretrieves_top_scores();\r\n\t\r\n\t/* Loading musics */\r\n\tload_musics()\r\n\t\r\n\t/* Drawing menu */\r\n\tdraw_menu_background();\r\n\t\r\n\t/* Images loading */\r\n\tset_images();\r\n\t\r\n\t/* A boom is heard when the mainSquare dies */\r\n\tset_boom_sound();\r\n\t\r\n\t/* Buttons creation */\r\n\tset_buttons();\r\n}", "function startGame(){\n\tvar game = new Game();\n\tgame.init();\n}", "function startGame(){\n initialiseGame();\n}", "function initialize() {\n // to initialize game \n setupSquares(numberOfSquares); // calls and sets up the colors & logic of game\n}", "function initialiseGame() {\n // Hides start panel and GitHub icon, shows direction buttons, plays audio\n document.getElementById(\"start-panel\").classList.toggle(\"hidden\");\n document.getElementById(\"bottom-banner\").classList.toggle(\"hidden\");\n document.getElementById(\"github\").classList.toggle(\"hidden\");\n document.getElementById(\"start\").play();\n document.getElementById(\"music\").play();\n\n // Generates new Sprite object per array iteration and maintains Sprite numbers to numberOfSprites\n for (var i = 0; i < numberOfSprites; i++) {\n spritesArray[i] = new Sprite(\n centreOfX,\n centreOfY,\n Math.random() * cnvsWidth\n );\n }\n\n // Triggers main loop animations\n update();\n}", "function init() {\n STAGE_WIDTH = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"width\"));\n STAGE_HEIGHT = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"height\"));\n\n // init state object\n stage.mouseEventsEnabled = true;\n stage.enableMouseOver(); // Default, checks the mouse 20 times/second for hovering cursor changes\n\n setupManifest(); // preloadJS\n startPreload();\n\n score = 0; // reset game score\n gameStarted = false;\n\n stage.update();\n\n muted = false;\n}", "function init() {\n\t\tclearBoard();\n\t\tprintBoard(board);\n\t\ttopPlayerText.innerHTML = `- ${game.currentPlayer.name}'s turn -`;\n\t\tgame.currentPlayer = game.playerOne;\n\t\tgame.squaresRemaining = 9;\n\t\tgame.winner = false;\n\t\tclickSquares();\n\t}", "constructor() { \n \n Game.initialize(this);\n }", "function init() {\n \"use strict\";\n \n resizeCanvas();\n \n background = new CreateBackground();\n Player = new CreatePlayer();\n \n if (window.innerHeight <= 768) {\n background.setup(resources.get(imgFileBackground_small));\n } else {\n background.setup(resources.get(imgFileBackground));\n }\n\n gameArray.splice(0,gameArray.length);\n \n // HTML Components\n htmlBody.addEventListener('keydown', function() {\n uniKeyCode(event);\n });\n \n btnNewGame.addEventListener('click', function() {\n setGameControls(btnNewGame, 'new');\n }); \n \n btnPauseResume.addEventListener('click', function() {\n setGameControls(btnPauseResume, 'pauseResume');\n }); \n \n btnEndGame.addEventListener('click', function() {\n setGameControls(btnEndGame, 'askEnd');\n }); \n \n btnOptions.addEventListener('click', function() {\n setGameControls(btnOptions, 'options');\n });\n \n btnJournal.addEventListener('click', function() {\n setGameControls(btnJournal, 'journal');\n }); \n \n btnAbout.addEventListener('click', function() {\n setGameControls(btnAbout, 'about');\n });\n \n window.addEventListener('resize', resizeCanvas);\n \n setGameControls(btnNewGame, \"init\");\n \n }", "init() { \n this.ecs.set(this, \"Game\", \"game\", \"scene\")\n }", "function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}", "function initialiseGame()\n{\n\tclear();\n\tmainText.draw();\n\tscoreText.draw();\n\t\n\tstartButtonDraw();\n\tdifficultyButtonDraw();\n}", "function init()\n{\n\t// get a reference to the game canvas\n\tgame = document.getElementById(\"gameCanvas\");\n\t\n\t// load and build the spritesheet\n\tbuildSpriteSheet();\n}", "function init() {\r\n var levelData = document.querySelector('input[name=\"level\"]:checked')\r\n gLevel.size = levelData.getAttribute('data-inside');\r\n gLevel.mines = levelData.getAttribute('data-mines');\r\n gLevel.lives = levelData.getAttribute('data-lives');\r\n var elHints = document.querySelector('.hints')\r\n elHints.innerText = 'hints: ' + HINT.repeat(3)\r\n var elButton = document.querySelector('.start-button')\r\n elButton.innerText = NORMAL\r\n document.querySelector('.timer').innerHTML = 'Time: 00:00:000'\r\n gBoard = createBoard()\r\n clearInterval(gTimerInterval);\r\n gGame = { isOn: false, shownCount: 0, markedCount: 0, isFirstClick: true, isHintOn: false }\r\n renderBoard()\r\n renderLives()\r\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n //set the current game staate to MENU_STATE\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init() {\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.width = canvasWidth;\n\t\tcanvas.height = canvasHeight;\n\t\tcanvas.style.border = \"15px groove gray\";\n\t\tcanvas.style.margin = \"25px auto\";\n\t\tcanvas.style.display = \"block\";\n\t\tcanvas.style.background = \"#ddd\";\n\t\tdocument.body.appendChild(canvas);\n\t\tctx = canvas.getContext('2d');\n\t\tnewGame()\n\t}", "function init() {\n\tdocument.getElementById(\"play\").blur();\n\t//call function inside the object to start the game\n\tmyGame.start();\n}", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function init() {\n\t\tscore = 0;\n\t\tdirection = \"right\";\n\t\tsnake_array = [];\n\t\tcreate_snake();\n\t\tmake_food();\n\t\tactiveKeyboard();\n\t\t$(\"#message\").css(\"display\",\"none\");\n\t\tgame_loop = setInterval(paint,100);\n\t}", "init()\n {\n // Unblock the menu messaging and activate needed trees\n menuManager.allowEventHandling = true;\n menuManager.activateTree( ['pause_tree', 'base_game_tree'] );\n \n // Do any strategy inits mostly for fonts\n spriteStrategyManager.init();\n \n // Get the win meter\n this.winMeter = menuManager.getMenuControl( 'base_game_ui', 'win_meter' );\n this.winMeter.clear();\n \n // Create the multiplier\n this.multiIndexPos = genFunc.randomInt(0, this.multiXPosAllAry.length-1);\n this.strawberryData.pos.x = this.multiXPosAllAry[this.multiIndexPos];\n this.spriteStrategy.create( 'strawberry', STRAWBERRY );\n \n // Reset the elapsed time before entering the render loop\n highResTimer.calcElapsedTime();\n \n requestAnimationFrame( this.callback );\n }", "function init() {\n setCircleVisibility(false);\n isPlayingGame = false;\n id(\"start-button\").addEventListener(\"click\", () => {\n isPlayingGame = !isPlayingGame;\n if (isPlayingGame) {\n startGame();\n } else {\n endGame();\n }\n });\n id(\"game-frame\").style.borderWidth = FRAME_BORDER_PIXELS + \"px\";\n }", "function initialiseGame() {\r\n // Hides start panel and GitHub icon, shows direction buttons, plays audio\r\n document.getElementById(\"start-panel\").classList.toggle(\"hidden\");\r\n document.getElementById(\"bottom-banner\").classList.toggle(\"hidden\");\r\n document.getElementById(\"github\").classList.toggle(\"hidden\");\r\n document.getElementById(\"start\").play();\r\n document.getElementById(\"music\").play();\r\n\r\n // Generates new Sprite object per array iteration and maintains Sprite numbers to numberOfSprites\r\n for (var i = 0; i < numberOfSprites; i++) {\r\n spritesArray[i] = new Sprite(\r\n centreOfX,\r\n centreOfY,\r\n Math.random() * cnvsWidth\r\n );\r\n }\r\n\r\n // Triggers main loop animations\r\n update();\r\n}", "function init() {\n\t\tscore = 0;\n\t\tclearScreen();\n\t\tspeed = DEFAULT_SPEED;\n\t\twell = new gameWell();\n\t\tactBlock = newActBlock();\n\t\tactBlock.draw();\n\t\tnextBlock.draw();\n\t}", "function init() {\n cookies = new Cookies();\n ui = new UI();\n game = new Game();\n}", "function initGame() {\n return new Phaser.Game(defaultConfiguration());\n}", "initGame() {\n\n //--setup user input--//\n this._player.initControl();\n\n //--add players to array--//\n this._players.push(this._player, this._opponent);\n\n //--position both players--//\n this._player.x = -Game.view.width * 0.5 + this._player.width;\n this._opponent.x = Game.view.width * 0.5 - this._opponent.width;\n }", "function init(){\n console.log(\"init game\");\n resizeCanvas();//scale canvas \n gameInterval = self.setInterval(function(){mainGameLoop();},16);//call mainGameLoop() evry 16 ms\n \n /**************\n * Create eventlisener for when there is clicked on the screen\n * It also checks if it has touchscreen like iPad, that makes it work better on those devices\n * 1f u c4n r34d th1s u r34lly n33d t0 g37 l41d\n ************/\n if ('ontouchstart' in document.documentElement) {\n c.addEventListener(\"touchstart\", mainMouseDown, false);\n }\n else {\n c.addEventListener(\"click\", mainMouseDown, false);\n }\n}", "function initializeGame()\r\n{\r\n\tintroducing=false;\r\n\t\r\n\tinitializeLevels();\r\n\tinitializePlayer();\r\n\t\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'custom', immediate : true});\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'secondary', immediate : true});\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'tertiary', immediate : true});\r\n\t\r\n\tsetInterval(draw, 1000/FPS);\r\n}", "function init() {\n\n\t// initial global variables\n\ttime = 0;\n\ttotalPlay = 0;\n\tplayed = [];\n\tstop = false;\n\tstarted = true;\n\tnumLife = 3;\n\n\t// set contents and start the timer\n\tsetScenario();\n\ttimer.text(time);\n\tlife.text(numLife);\n\tcountTime();\n}", "function __initGame() {\n\n __HUDContext = canvasModalWidget.getHUDContext();\n\n __showTitleScreen();\n __bindKeyEvents();\n\n // reset the FPS meter\n canvasModalWidget.setFPSVal(0);\n\n __resetGame();\n\n return __game;\n }", "function init(){\n\tconsole.log('Running');\n\trenderer = new RenderManager(\"game_canvas\");\n\tgl = renderer.gl;\n\tkeyboard = new KeyBoard();\n\n\tshaderName = 'triangle';\n\tvar triangleShader = new CreateShader(gl);\n\ttextureName = 'blue_sky';\n\ttextureObj = new Texture('bluecloud_bk.jpg', gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.LINEAR, gl.LINEAR);\n\ttextureObj.loadTexture();\n\ttriangleShader.makeProgram(\"vertShader.txt\", \"fragShader.txt\");\n\tvar delay = 150;\n\tif(navigator.userAgent.indexOf(\"Firefox\") != -1){\n\t\tdelay = 450;\n\t}\n\tsetTimeout(start, delay);\n}", "init() {\n\t\tthis.mousePos = {x: 0, y: 0};\n\t\tthis.gameWidth = Math.max(screen.width, window.innerWidth);\n\t\tthis.gameHeight = Math.max(screen.height, window.innerHeight);\n\t\tthis.skier.init();\n\t\tthis.yeti.init();\n\t\tthis.lift.init();\n\t\tthis.slalom.init();\n\t\tthis.isPaused = false;\n\t\tthis.yDist = 0;\n\t\tthis.timestampFire = this.util.timestamp();\n\t\tthis.skierTrail = [];\n\t\tthis.currentTreeFireImg = this.tree_bare_fire1;\n\t\tthis.stylePointsToAwardOnLanding = 0;\n\t\tthis.style = 0;\n\t\tsocket.emit('new_point', 0);\n\t\tthis.logo = { x: -50, y: -40 };\n\t\tthis.gameInfoBtn.title = 'Pause';\n\t}", "init() {\n\n this.assignPlayer();\n gameView.init(this);\n gameView.hide();\n scoreBoardView.init(this);\n registerView.init(this);\n this.registerSW();\n }", "init() {\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\n //console.log(result);\n\n this.assignPlayer();\n gameView.init(this);\n registerView.init(this);\n }", "static initialize()\n {\n RPM.songsManager = new SongsManager();\n RPM.settings = new Settings();\n RPM.datasGame = new DatasGame();\n RPM.gameStack = new GameStack();\n RPM.loadingDelay = 0;\n RPM.clearHUD();\n }", "function init() {\n STAGE_WIDTH = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"width\"));\n STAGE_HEIGHT = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"height\"));\n\n // init state object\n stage = new createjs.Stage(\"gameCanvas\"); // canvas id is gameCanvas\n stage.mouseEventsEnabled = true;\n stage.enableMouseOver(); // Default, checks the mouse 20 times/second for hovering cursor changes\n\n setupManifest(); // preloadJS\n startPreload();\n\n stage.update();\n}", "function CoreGame(){\n\t\t//console.log(this);\n\t\tthis.initialize();\n\t}", "function init() {\n gameView = VIEW_GAME;\n\n score = 0;\n lives = startingLives;\n\n //Clear out all arrays\n floatingTexts = [];\n particles = [];\n explosions = [];\n\n\n //EXAMPLE\n spawnNodes();\n //===\n\n}", "function init() {\n let query1 = URL_POKE + \"?pokedex=all\";\n fetch(query1)\n .then(checkStatus)\n .then((resp) => resp.text())\n .then(makeSprites)\n .catch(console.error);\n id(\"start-btn\").addEventListener(\"click\", startGame);\n id(\"flee-btn\").addEventListener(\"click\", resultMove);\n id(\"endgame\").addEventListener(\"click\", goBack);\n }", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init() {\n\tplayer.x = WIDTH/2;\n\tplayer.y = (HEIGHT*1.5 - player.height)/2;\n\tenemies = [];\n\tbullets = [];\n\tscore = 0;\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n this.soundtrack = createjs.Sound.play('soundtrack', createjs.Sound.INTERRUPT_NONE, 0, 0, -1, 1, 0);\n optimizeForMobile();\n\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "initialize() {\n // vai pegar todas as funcoes da classe screen, coloca todos os herois na screen\n this.screen.updateImages(this.initialHeroes)\n\n // força a screen a usar o THIS de MemoryGame\n this.screen.configurePlayButton(this.play.bind(this))\n this.screen.configureCheckSelectionButton(this.checkSelection.bind(this))\n this.screen.configureButtonShowAll(this.showHiddenHeroes.bind(this))\n }", "function setupGame(){\n //Build the stage\n stage=new Stage(15,15,\"stage\");\n stage.initialize();\n console.log('stage built');\n}", "function init()\n{\n\t// Load entire map data for Map 1 and display it on the screen\n\t\n\tgame.loadMap(\"map1.json\");\n\t\n\t// Place the player at the map entrance\n\t\n\tplayer.place(24, 4);\n\t\n\t// Load a troll character and place it near the player\n\t\n\tvar troll = new Character(\"troll.json\");\n\ttroll.place(24, 10);\n\t\n\t// Add a talk action to the troll\n\t\n\ttroll.action(talk_to_troll);\n\t\n\t// Once this function is finished, the player is free to run around\n\t// and trigger script actions!\n}", "function init() {\n enablePlayAgain(reset);\n reset();\n lastTime = Date.now();\n main();\n }", "function initGame()\n{\n //This is run in the beginning. Draws Space, sets settings etc\n \n //Update JSON\n}", "function init() {\n // Initialize all base variables and preload assets. Once assets are loaded it will call init. \n\n // Canvas info\n canvas = document.getElementById(\"canvas\"); \n fullScreenCanvas(canvas); // Sets width and height to fill screen\n // Stage info\n stage = new createjs.Stage(canvas); // Creates a EaselJS Stage for drawing\n stage.addChild(backgroundLayer, midLayer, foregroundLayer, overlayLayer); // Add layers\n // Detection\n createjs.Touch.enable(stage); \n\n // Initialize global variables for layout and sizing\n initializeVariables(canvas.width, canvas.height);\n\n // Preload all assets (crucial for first rendering)\n preload.loadManifest(manifest);\n}", "function init(difficulty) {\r\n\r\n // set stat fields\r\n setTowerStatFields();\r\n\r\n // Model\r\n game = new Game(difficulty);\r\n \r\n // update all game pieces\r\n update();\r\n // draw all updated piecesw\r\n draw();\r\n\r\n pausePanel.setPanel('pause');\r\n\r\n gameboard.style.display = 'flex';\r\n\r\n}", "function startgame() {\t\r\n\tloadImages();\r\nsetupKeyboardListeners();\r\nmain();\r\n}", "function init_game() {\r\n // init canvas for drawing\r\n canvas = document.getElementById('canvas');\r\n canvas.focus(); \r\n ctx = canvas.getContext('2d');\r\n\r\n // reset game elements, including hiscore (reset_hiscore=true)\r\n reset_game(true);\r\n\r\n // init start status, we ar enot playing yet, but haning in the welcome screen\r\n playing = false;\r\n\r\n var message1 = new Message(\"Welcome to Kunterbunt's Flappy!\",160,100,0,'24px serif'); // setting TTL ndless\r\n var message2 = new Message(\"Press <RETURN> key to start\",160,130,0,'12px serif');\r\n messageMgr.add(message1);\r\n messageMgr.add(message2);\r\n\r\n // add event handlers\r\n canvas.addEventListener('mouseover', canvas_on_mouseover);\r\n canvas.addEventListener('mouseout', canvas_on_mouseout);\r\n canvas.addEventListener('keydown', canvas_on_keydown);\r\n\r\n // draw it for the first time\r\n draw_scene();\r\n}", "function init() {\n createWorld();\n createSnake();\n createCoin();\n}", "function init(){\n\n\t\t$('small').text(\"Snake v1.3 | @driverInside\"); // lol\n\n\t\td = \"right\"; // default direction\n\t\tcreateSnake();\n\t\tcreateFood();\n\t\tscore = 0; \n\t\tlevel = 1;\n\n\t\tif(typeof gameLoop != \"undefined\"){\n\t\t\tclearInterval(gameLoop);\n\t\t}\n\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 2)));\n\t} // end init function", "function startGame() { }", "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}", "function init() {\n // physics engine\n engine = Matter.Engine.create();\n\n // setup game world \n world = engine.world;\n world.bounds = {\n min: { x: 0, y: 0 },\n max: { x: WINDOWWIDTH, y: WINDOWHEIGHT }\n };\n world.gravity.y = GRAVITY;\n\n // setup render\n render = Matter.Render.create({\n element: document.body,\n engine: engine,\n canvas: canvas,\n options: {\n width: WINDOWWIDTH,\n height: WINDOWHEIGHT,\n wireframes: false,\n background: 'transparent'\n }\n });\n Matter.Render.run(render);\n\n // setup game runner\n let runner = Matter.Runner.create();\n Matter.Runner.run(runner, engine);\n\n // starting values\n updateScore(0);\n\n //handle device rotation\n window.addEventListener('orientationchange', function () {\n //TODO: DJC\n });\n }", "function init() {\n stage = new createjs.Stage(canvas); // reference to the stage\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60); // framerate 60 fps for the game\n // event listener triggers 60 times every second\n createjs.Ticker.on(\"tick\", gameLoop);\n optimizeForMobile();\n // calling main game function\n main();\n}", "function initGame (){\n\n resetData();\n \n //Update content\n\n \n //Pick a new country and display info\n pickCountry();\n getcountryText();\n UpdateContent();\n\n //hide background image\n\n dispGame.classList.add(\"gameStarted\");\n dispGame.style.display = \"block\";\n dispGame.style.visibility = \"visible\";\n \n //hide start button\n startGame.style.display = \"none\";\n\n //Set isGameOver to false\n isgameOver = false;\n\n}", "function init() {\n reset();\n\n //create some enemies\n allEnemies.push(new Enemy());\n allEnemies.push(new Enemy());\n allEnemies.push(new Enemy());\n allEnemies.push(new Enemy());\n\n //create the player\n player = new Player();\n\n // This listens for key presses and sends the keys to your\n // Player.handleInput() method. You don't need to modify this.\n document.addEventListener('keyup', function(e) {\n var allowedKeys = {\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 89: 'y'\n };\n\n player.handleInput(allowedKeys[e.keyCode]);\n });\n\n running = true;\n\n lastTime = Date.now();\n main();\n }" ]
[ "0.82882", "0.81579024", "0.8085838", "0.80758095", "0.803133", "0.8004256", "0.79349345", "0.7932349", "0.79317266", "0.7929272", "0.7920643", "0.78910893", "0.7882733", "0.78514594", "0.7845285", "0.7774829", "0.7763958", "0.77402776", "0.7721561", "0.77022564", "0.76888716", "0.7670782", "0.767065", "0.7669", "0.7636591", "0.7633863", "0.7626968", "0.76229626", "0.7613283", "0.7605615", "0.7604184", "0.758902", "0.75829226", "0.7568047", "0.7566497", "0.7560319", "0.7556831", "0.753771", "0.75374526", "0.7533414", "0.75256264", "0.75191826", "0.75110984", "0.7507556", "0.7500192", "0.74865335", "0.74828106", "0.7473665", "0.74635607", "0.74630237", "0.7462856", "0.7458016", "0.74554914", "0.7440007", "0.74373084", "0.74345374", "0.7431727", "0.7429071", "0.742779", "0.7394814", "0.7389088", "0.73653007", "0.73635256", "0.7359894", "0.73553056", "0.7354463", "0.7349987", "0.73436767", "0.7337872", "0.73220074", "0.73170197", "0.7315152", "0.73113173", "0.73030835", "0.7301383", "0.72987217", "0.7297161", "0.7294452", "0.7273209", "0.726684", "0.72520494", "0.72418374", "0.7240032", "0.7237455", "0.7227695", "0.72270614", "0.72197753", "0.72182393", "0.71978384", "0.71899563", "0.7189279", "0.71823347", "0.71761215", "0.71749777", "0.7170432", "0.71685", "0.71661365", "0.71649325", "0.7164233", "0.71609294", "0.7160788" ]
0.0
-1
! Chart.js v4.2.0 (c) 2023 Chart.js Contributors Released under the MIT License
function Oo(){}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderChart() {\n const labels = Object.keys(this.props.data).sort();\n const values = labels.map(label => this.props.data[label]);\n const node = document.getElementById('chart');\n this.chart = new Chart(node, {\n type: 'line',\n data: {\n labels: labels,\n datasets: [\n {\n label: 'Bitcoin (BTC)',\n data: values,\n backgroundColor: ['rgba(255, 99, 132, 0.2)'],\n borderColor: ['rgba(255,99,132,1)'],\n borderWidth: 1,\n },\n ],\n },\n });\n }", "function BuildChart() {\n vm.ctx = document.getElementById('myChart').getContext('2d');\n vm.salesProgress = new Chart(vm.ctx, {\n type: 'bar',\n data: {\n labels: vm.labels,\n datasets: [{\n label: 'goal',\n data: vm.goals,\n backgroundColor: [\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(255, 206, 86, 0.6)'\n ],\n borderColor: [\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(255, 206, 86, 1)'\n ],\n borderWidth: 1\n },\n {\n label: 'written',\n data: vm.territoryWritten,\n\n backgroundColor: [\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(255, 99, 132, 0.6)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(255, 99, 132, 1)'\n ],\n borderWidth: 1\n },\n {\n label: 'delivered',\n data: vm.territoryDelivered,\n backgroundColor: [\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(54, 162, 235, 0.6)'\n ],\n borderColor: [\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)'\n ],\n borderWidth: 1\n }\n ]\n },\n options: {\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n //xAxes: [{\n\n // gridLines: {\n // lineWidth: 1.5,\n // //color: 'rgba(25, 25, 25, 0.4)',\n // drawBorder: true\n // }\n //}]\n\n }\n //animation: {\n // onProgress: function (animation) {\n // progress.value = animation.animationObject.currentStep / animation.animationObject.numSteps;\n // }\n //}\n\n }\n });\n }", "function graph(){\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: lablesArr,\n datasets: [{\n label: '# of Votes',\n data: clicksArr,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function createChart(name, type, title, datasetLabel, labels, values) {\n let cntx = document.getElementById(name).getContext('2d')\n\n let chart = new Chart(cntx, {\n type: type,\n data: {\n labels: labels,\n datasets: [{\n label: datasetLabel,\n backgroundColor: [\n 'rgba(255, 99, 132, 1)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)'\n ],\n data: values\n }]\n },\n options: {\n title: {\n display: true,\n text: title\n }\n }\n })\n}", "function chartMake(){\n var ctx= document.getElementById('Chart');\n\n var finishedChart= new Chart(ctx, {\n type: 'bar',\n data: {\n labels: [images[0].id, images[1].id, images[2].id, images[3].id, images[4].id, images[5].id, images[6].id, images[7].id, images[8].id, images[9].id, images[10].id, images[11].id, images[12].id, images[13].id, images[14].id, images[15].id, images[16].id, images[17].id, images[18].id, images[19].id],\n datasets: [{\n label: '# of Votes',\n data: [images[0].clicks, images[1].clicks, images[2].clicks, images[3].clicks, images[4].clicks, images[5].clicks, images[6].clicks, images[7].clicks, images[8].clicks, images[9].clicks, images[10].clicks, images[11].clicks, images[12].clicks, images[13].clicks, images[14].clicks, images[15].clicks, images[16].clicks, images[17].clicks, images[18].clicks, images[19].clicks],\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n console.log(ctx);\n}", "function chartRender() {\n ctx = document.getElementById('myChart').getContext('2d');\n let myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: productsNames,\n datasets: [{\n label: '# of Votes',\n data: votesArr,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)'\n ],\n borderWidth: 1\n }, {\n label: '# of views',\n data: viewsArr,\n backgroundColor: [\n 'rgba(54, 162, 235, 0.2)'\n ],\n borderColor: [\n 'rgba(54, 162, 235, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n });\n}", "function cryptic_line_chart_btc_eth() {\n var config2b = {\n type: 'line',\n data: {\n labels: [\"2016\", \"2016\", \"2016\", \"2017\", \"2017\", \"2018\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.green,\n backgroundColor: window.chartColors.green,\n data: [0, 1.5, 2.5, 2, 3, 5]\n }, {\n label: \"Ethereum\",\n fill: false,\n borderColor: window.chartColors.red,\n backgroundColor: window.chartColors.red,\n data: [0, 0.75, 1, 1.75, 2.5, 3]\n }]\n }\n };\n var ctx2b = document.getElementById(\"bitcoin_ethereum\").getContext(\"2d\");\n window.chart2b = new Chart(ctx2b, config2b);\n}", "function cryptic_line_chart_btc_eth_mp() {\n var config2e = {\n type: 'line',\n data: {\n labels: [\"2016\", \"2016\", \"2016\", \"2017\", \"2017\", \"2018\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.green,\n backgroundColor: window.chartColors.green,\n data: [0, 1.5, 2.5, 2, 3, 5]\n }, {\n label: \"Ethereum\",\n fill: false,\n borderColor: window.chartColors.red,\n backgroundColor: window.chartColors.red,\n data: [0, 0.75, 1, 1.75, 2.5, 3]\n }]\n }\n };\n var ctx2e = document.getElementById(\"bitcoin_ethereum_mp\").getContext(\"2d\");\n window.chart2e = new Chart(ctx2e, config2e);\n}", "function createChart(chartName, labelsArray, dataArray, element) {\n var chartName = new Chart(element, {\n type: 'line',\n data: {\n labels: labelsArray,\n datasets: [{\n data: dataArray,\n borderWidth: 1,\n lineTension: 0,\n pointBorderWidth: 2,\n pointBackgroundColor: 'white',\n pointBorderColor: '#7477bf',\n pointRadius: 5,\n backgroundColor: 'rgba(226,227,246,0.75)',\n borderColor: '#7477bf'\n }]\n },\n options: {\n animation: {\n duration: 500\n },\n maintainAspectRatio: false,\n legend: {\n display: false\n },\n tooltips: {\n backgroundColor: 'rgba(101,101,101,.8)',\n displayColors: false,\n xPadding: 16,\n yPadding: 8,\n bodyFontColor: '#e2e3f6'\n },\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n stepSize: 500,\n suggestedMax: 2500,\n fontColor: '#b2b2b2'\n }\n }],\n xAxes: [{\n ticks: {\n fontColor: '#b2b2b2'\n }\n }]\n }\n }\n });\n}", "function createChartToDisplay() {\n var ctx = document.getElementById('results-chart').getContext('2d');\n new Chart(ctx, { // eslint-disable-line\n type: 'horizontalBar',\n data: {\n labels: pictureNames,\n datasets: [{\n label: 'Number of Votes',\n data: totalPictureVotes,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)'\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function fifoChart(data, labels) {\r\n var ctx = document.getElementById(\"fifoChart\").getContext('2d');\r\n var myChart = new Chart(ctx, {\r\n type: 'line',\r\n data: {\r\n labels: labels,\r\n datasets: [{\r\n label: 'FIFO',\r\n data: data,\r\n }]\r\n },\r\n });\r\n}", "function createChartKD (labels, values){\n var ctx = document.getElementById('kdChart').getContext('2d');\n var kdChart = new Chart(ctx, {\n type: 'bar',\n data: { \n labels: labels,\n datasets: [{\n label: 'Stats',\n data: values,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(150, 92, 132, 0.2)',\n 'rgba(105, 176, 11, 0.2)',\n 'rgba(221, 170, 102, 0.2)',\n 'rgba(255, 204, 204, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)', \n 'rgba(255, 159, 64, 1)',\n 'rgba(150, 92, 132, 1)',\n 'rgba(105, 176, 11, 1)',\n 'rgba(221, 170, 102, 1)',\n 'rgba(255, 204, 204, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n plugins: {\n legend: {\n display:false\n }\n },\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n });\n}", "function drawChart(fiveDaysHours, fiveDaysTemp) {\n const ctx = document.getElementById(\"chart\");\n const chart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: fiveDaysHours,\n datasets: [{\n data: fiveDaysTemp,\n backgroundColor: 'rgba(64,196,255, .3)',\n borderColor: 'rgba(64,196,255, 1)',\n borderWidth: 2,\n pointRadius: 2,\n pointBorderColor: 'rgba(0,188,212, 1)',\n pointBackgroundColor: 'rgba(0,188,212, 1)',\n pointHoverRadius: 2\n }]\n },\n options: {\n maintainAspectRatio: false,\n layout: {\n padding: {\n top: 30\n }\n },\n scales: {\n yAxes: [{\n ticks: {\n display: false,\n },\n gridLines: {\n display:false,\n drawBorder: false\n }\n }],\n xAxes: [{\n ticks: {\n autoSkip: false,\n maxRotation: 0,\n minRotation: 0\n },\n gridLines: {\n display:false\n }\n }]\n },\n legend:{\n display: false\n },\n tooltips: {\n enabled: false\n }\n },\n plugins: [{\n afterDatasetsDraw: function(chart) {\n const ctx = chart.ctx;\n chart.data.datasets.forEach(function(dataset, index) {\n const datasetMeta = chart.getDatasetMeta(index);\n if (datasetMeta.hidden) return;\n datasetMeta.data.forEach(function(point, index) {\n const value = dataset.data[index],\n x = point.getCenterPoint().x,\n y = point.getCenterPoint().y,\n radius = point._model.radius,\n fontSize = 12,\n fontFamily = 'Roboto',\n fontColor = '#455A64',\n fontStyle = 'normal';\n ctx.save();\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center';\n ctx.font = fontStyle + ' ' + fontSize + 'px' + ' ' + fontFamily;\n ctx.fillStyle = fontColor;\n ctx.fillText(value, x, y - radius - fontSize);\n ctx.restore();\n });\n });\n }\n }]\n });\n}", "function load_chart1() {\n var myChart1 = new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: [],\n datasets: [{\n // responsive: true,\n label: \"Calls Executed\",\n data: [],\n backgroundColor: [\n \"rgba(255, 99, 132, 0.2)\",\n \"rgba(54, 162, 235, 0.2)\",\n \"rgba(255, 206, 86, 0.2)\",\n \"rgba(75, 192, 192, 0.2)\",\n \"rgba(153, 102, 255, 0.2)\",\n \"rgba(255, 159, 64, 0.2)\"\n ],\n borderColor: [\n \"rgba(255, 99, 132, 1)\",\n \"rgba(54, 162, 235, 1)\",\n \"rgba(255, 206, 86, 1)\",\n \"rgba(75, 192, 192, 1)\",\n \"rgba(153, 102, 255, 1)\",\n \"rgba(255, 159, 64, 1)\"\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n for (i = 0; i < $(\"tbody tr\").length; i++) {\n callCounts.push(parseInt($(\"#callCount\" + i).html()));\n }\n // for (i = 0; i < $(\"tbody tr\").length; i++) {\n // userNames.push($(\"#userName\" + i).html());\n // }\n myChart1.data.datasets[0].data = callCounts;\n myChart1.data.labels = userNames;\n myChart1.update();\n}", "function dailyTrafficBarChart() {\n const ctx = document.getElementById('barChart');\n barChart = new Chart(ctx, {\n type: 'bar', \n data: {\n labels: [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n datasets: [{ \n data: [ 50, 100, 150, 125, 210, 200, 75],\n backgroundColor: \n 'rgba(100, 100, 200, 1)', \n }]\n },\n options: {\n animation: {duration: 0},\n layout: {\n padding:50,\n },\n legend: {\n display: false\n },\n title: {\n display: false,\n },\n scales: {\n scaleLabel:{\n align: 'right'\n },\n xAxes: [{\n gridLines:{\n tickMarkLength: 0,\n gridOffsetGridLines: true,\n },\n ticks: {\n beginAtZero: false,\n labelOffset: 0,\n padding: 10\n }\n }],\n yAxes: [{\n gridLines:{\n tickMarkLength: 0,\n },\n ticks: {\n beginAtZero: false,\n stepSize: 100,\n padding: 10\n }\n }]\n }\n }\n });\n \n}", "function loadChart() {\n new Chart(document.getElementById('line-chart'), {\n type: 'line',\n data: {\n labels: myPeriod,\n datasets: [{\n label: year,\n borderColor: '#9e0606',\n pointBackgroundColor: '#9e0606',\n pointBorderColor: 'black',\n backgroundColor: '#9e0606',\n fill: false,\n\n data: myValues\n },\n {\n label: 'Benchmark',\n borderColor: 'orange',\n pointBackgroundColor: 'orange',\n pointBorderColor: 'black',\n backgroundColor: 'orange',\n fill: false,\n\n data: myBenchmark\n }\n ]\n },\n options: {\n responsive: true,\n title: {\n display: true,\n text: textName + ' (' + year + ')'\n },\n\n tooltips: {\n mode: 'index',\n intersect: false\n },\n\n hover: {\n mode: 'nearest',\n intersect: true\n },\n\n scales: {\n xAxes: [{\n display: true,\n scaleLabel: {\n display: true,\n labelString: 'Period: ' + prefs.getString(\"period\")\n }\n }],\n yAxes: [{\n display: true,\n scaleLabel: {\n display: true,\n labelString: fieldName\n }\n }]\n }\n }\n });\n}", "function chartCreator(){\r\n chartData();\r\n var ctx = document.getElementById('myChart').getContext('2d');\r\n var myChart = new Chart(ctx, {\r\n type: 'bar',\r\n data: {\r\n labels: Product.namesData,\r\n datasets: [{\r\n label: '# of Votes',\r\n data: Product.votesData,\r\n backgroundColor: [\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n 'rgba(255,0,0,1)',\r\n 'rgba(0,128,0,1)',\r\n ],\r\n borderColor: [\r\n // 'rgba(255, 99, 132, 1)',\r\n // 'rgba(54, 162, 235, 1)',\r\n // 'rgba(255, 206, 86, 1)',\r\n // 'rgba(75, 192, 192, 1)',\r\n // 'rgba(153, 102, 255, 1)',\r\n // 'rgba(255, 159, 64, 1)'\r\n ],\r\n borderWidth: 1\r\n }]\r\n },\r\n options: {\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n beginAtZero: true\r\n }\r\n }]\r\n }\r\n }\r\n });\r\n}", "function mobileUsersChart () {\n\n var ctx = document.getElementById(\"mobileUsersChart\");\n var myChart = new Chart(ctx, {\n type: 'doughnut',\n data: {\n labels: ['Phones', 'Tablets', 'Desktop'],\n datasets: [{\n\n data: [15,15, 70],\n borderWidth: 1,\n // tension: 0,\n backgroundColor: [\n phone_color,\n traffic_button_tablets_color,\n primary_bar_desktop_color\n ]\n\n\n }]\n },\n options: {\n\n legend: {display: true,\n position: 'right',\n labels: {boxWidth: 15,}\n },\n // circumference: 2.5 * Math.PI,\n cutoutPercentage: 60,\n responsive: true,\n mainAspectRatio:false,\n }\n });\n\n}", "function initChartStatus() {\n chartStatus = new Chart(document.getElementById(\"doughnut-chart\"), {\n type: 'doughnut',\n data: {\n labels: [\"Completed 1\", \"Running\", \"Failed\",\"Not started\"],\n datasets: [\n {\n label: [\"Completed 2\", \"Running\", \"Failed\", \"Not started\"],\n backgroundColor: [\"#28a745\", \"#ffc107\", \"#dc3545\", \"#C0C0C0\"],\n data: [0,0,0,0]\n }\n ]\n },\n responsive: true,\n maintainAspectRatio: false,\n options: {\n showAllTooltips: true,\n title: {\n display: false,\n text: 'STATUS'\n },\n tooltips: {\n enabled: true\n }\n }\n });\n drawSegmentValues(chartStatus);\n}", "function make_graph() {\n $.get(\"/user_progress_analytics\",function (data, status) {\n let pc = document.getElementById('progressBarGraph').getContext('2d');\n let myChart = new Chart(pc, {\n type: 'bar',\n data: {\n labels: [\"Completed\", \"Uncompleted\"],\n datasets: [{\n label: '# of Tasks',\n data: data,\n backgroundColor: [\n 'rgba(75, 192, 192, 0.2)', // GREEN\n 'rgba(255, 99, 132, 0.2)', // RED\n\n // 'rgba(54, 162, 235, 0.2)', // BLUE\n // 'rgba(255, 206, 86, 0.2)', // YELLOW\n // 'rgba(153, 102, 255, 0.2)', // PURPLE\n // 'rgba(255, 159, 64, 0.2)' // Orange\n ],\n borderColor: [\n 'rgba(75, 192, 192, 1)',\n 'rgba(255,99,132,1)',\n //\n // 'rgba(54, 162, 235, 1)',\n // 'rgba(255, 206, 86, 1)',\n // 'rgba(153, 102, 255, 1)',\n // 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n },\n title: {\n display: true,\n text: 'Overall Project Progress Based On Tasks Completed To Tasks Uncompleted'\n }\n }\n });\n });\n}", "function initIOperSecChart() {\n const ctx = document.getElementById(\"ioPerSecChart\");\n return new Chart(ctx, {\n type: 'line',\n data: {\n labels: [],\n datasets: [\n {\n label: \"Read [Bytes/s]\",\n data: [],\n backgroundColor: colors.dark,\n borderColor: colors.dark,\n fill: false,\n datalabels: {\n display: false,\n }\n },\n {\n label: \"Write [Bytes/s]\",\n data: [],\n backgroundColor: colors.danger,\n borderColor: colors.danger,\n fill: false,\n datalabels: {\n display: false,\n }\n },\n {\n label: \"Total [Bytes/s]\",\n data: [],\n backgroundColor: colors.warning,\n borderColor: colors.warning,\n fill: false,\n datalabels: {\n display: false,\n }\n },\n ]\n },\n options: {\n // title: {\n // text: \"I/O per Sec\".toUpperCase(),\n // display: true,\n // fontSize: 20,\n // fontStyle: \"normal\",\n // fontColor: \"black\",\n // },\n scales: {\n yAxes: [{\n display: true,\n ticks: {\n min: 0,\n // callback: (value, index, values) => {\n // return value + \" Bytes/s\";\n // }\n }\n }],\n xAxes: [{\n display: true,\n }],\n },\n legend: {\n display: true,\n position: \"bottom\"\n },\n }\n });\n}", "validateChart() {\n var used = this.container.getUsedVolume();\n var total = this.container.getTotalVolume();\n var a = parseInt(used / total * 100);\n var b = 100 - a;\n var ctx = document.getElementById(\"current-load\").getContext(\"2d\");\n var myChart = new Chart(ctx, {\n type: \"doughnut\",\n data: {\n labels: [\"Genutzes Volumen %\", \"Freiräume %\"],\n datasets: [{\n label: \"Anteil\",\n data: [a, b],\n backgroundColor: [\n \"rgba(170, 255, 51, .6)\",\n \"rgba(150, 150, 150, .6)\"\n ],\n borderColor: [\n \"rgb(126, 205, 16)\",\n \"rgb(150, 150, 150)\"\n ]\n }]\n },\n options: {\n legend: {\n position: \"bottom\"\n },\n borderWidth: 0\n }\n });\n }", "function drawChart() {\n var ctx = document.getElementById(\"myChart\").getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'horizontalBar',\n data: {\n labels: productNameArray,\n datasets: [{\n label: '# of Votes',\n data: chartDataVotes,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n //Local storage. checks if user has been to site. If so starts them where they were before. If not. starts them at the beginning.\n if (localStorage.productsArray) {\n productsArray = JSON.parse(localStorage.productsArray);\n } else {\n for (var i = 0; i < Product.name.length; i++) {\n new Product(Product.name[i]);\n }\n }\n}", "function drawChart() {\n var ctx = canvas.getContext('2d');\n var myBarChart = new Chart(ctx, {\n type: 'bar',\n data: data,\n // options: {\n // responsive: false\n // }\n });\n}", "function chartRender(){\nlet ctx = document.getElementById('myChart').getContext('2d');\nlet chart = new Chart(ctx, { //Object\n \n type: 'bar',\n\n // The data for our dataset\n data: {\n labels: Names, //horizontally\n datasets: [{\n label: 'Buss-Mall',\n backgroundColor: '#c64756',\n borderColor: 'rgb(255, 99, 132)',\n data: vote, //column\n },\n //we creat anoother obj inside database\n { \n label: 'Buss-Mall',\n backgroundColor: 'black',\n borderColor: 'rgb(255, 99, 132)',\n data: view , // other column\n \n } ]\n },\n\n \n options: {}\n});\n}", "function mobileUsersDonutChart() {\n \n const ctx = document.getElementById('donutChart');\n \n donutChart = new Chart(ctx, {\n \n type: 'doughnut', \n data: {\n labels: [ 'Phones', 'Tablets', 'Desktop',],\n datasets: [{ \n data: [ 15, 15, 70,],\n backgroundColor: [ \n 'rgba(80, 220, 220, 1)', \n 'rgba(100, 255, 200, 1)', \n 'rgba(2, 100, 200, 1)',\n ],\n borderWidth: 0,\n \n }]\n },\n options: {\n \n layout: {\n padding:50,\n },\n legend: {\n display: true,\n position: 'right',\n \n labels:{\n boxWidth: 10,\n fontSize: 10,\n }\n },\n title: {\n display: false\n },\n \n }\n });\n \n}", "function buildChart(data){\r\n\r\nvar ctx = document.getElementById('myChart').getContext('2d');\r\nthis.myChart = new Chart(ctx, {\r\n // The type of chart we want to create\r\n type: 'bar',\r\n\r\n // The data for our dataset\r\n data: {\r\n labels: data.map((obj)=>{return obj.state}),\r\n datasets: [\r\n {\r\n label: 'Gun deaths',\r\n backgroundColor: 'rgb(255, 99, 132)',\r\n borderColor: 'rgb(255, 99, 132)',\r\n data: data.map((obj)=>{return obj.n_killed_per_mil})\r\n },\r\n {\r\n label: 'Gun injuries',\r\n backgroundColor: 'rgb(54, 162, 235)',\r\n borderColor: 'rgb(54, 162, 235)',\r\n data: data.map((obj)=>{return obj.n_injured_per_mil})\r\n }\r\n ]\r\n },\r\n\r\n // Configuration options go here\r\n options: {\r\n title:{\r\n display:true,\r\n text:'Gun Violence by State(Per Million Residents)'\r\n }\r\n }\r\n});\r\n}", "function genChartResults() {\n var chartLabels = [];\n var chartValues = [];\n for (var i = 0; i < imgArr.length; i++) {\n chartLabels[i] = imgArr[i].name;\n chartValues[i] = imgArr[i].votes;\n }\n\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: chartLabels,\n datasets: [{\n label: '# of Votes',\n data: chartValues,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.4)',\n 'rgba(54, 162, 235, 0.4)',\n 'rgba(255, 206, 86, 0.4)',\n 'rgba(75, 192, 192, 0.4)',\n 'rgba(153, 102, 255, 0.4)',\n 'rgba(255, 159, 64, 0.4)',\n 'rgba(255, 99, 132, 0.4)',\n 'rgba(54, 162, 235, 0.4)',\n 'rgba(255, 206, 86, 0.4)',\n 'rgba(75, 192, 192, 0.4)',\n 'rgba(153, 102, 255, 0.4)',\n 'rgba(255, 159, 64, 0.4)',\n 'rgba(255, 99, 132, 0.4)',\n 'rgba(54, 162, 235, 0.4)',\n 'rgba(255, 206, 86, 0.4)',\n 'rgba(75, 192, 192, 0.4)',\n 'rgba(153, 102, 255, 0.4)',\n 'rgba(255, 159, 64, 0.4)',\n 'rgba(255, 99, 132, 0.4)',\n 'rgba(54, 162, 235, 0.4)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)'\n ],\n borderWidth: 1\n }]\n },\n });\n}", "function letsDrawChart(){\n var ctx = document.getElementById('productChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: productPicsDisplay,\n datasets: [{\n label: 'Number of Votes',\n data: countedVotes,\n backgroundColor: [\n 'red', 'green', 'blue', 'yellow', 'purple',\n 'red', 'green', 'blue', 'yellow', 'purple',\n 'red', 'green', 'blue', 'yellow', 'purple',\n 'red', 'green', 'blue', 'yellow', 'purple',\n ],\n borderColor: [\n 'red', 'green', 'blue', 'yellow', 'purple',\n 'red', 'green', 'blue', 'yellow', 'purple',\n 'red', 'green', 'blue', 'yellow', 'purple',\n 'red', 'green', 'blue', 'yellow', 'purple',\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function graph(speedData) {\n \n var canvas = document.getElementById(\"graph-canvas\").getContext('2d');\n Chart.defaults.global.defaultFontFamily = \"Maple\";\n var labelsIn = new Array(speedData.length);\n var dataIn = new Array(speedData.length);\n \n for(i = 0; i < speedData.length; i++) {\n labelsIn[i] = (speedData[i].time);\n dataIn[i] = (parseFloat(speedData[i].amount));\n }\n \n var myChart = new Chart(canvas, {\n type: 'line',\n data: {\n labels: labelsIn,\n datasets: [{\n label: 'Speed During Trip',\n data: dataIn,\n backgroundColor: 'rgba(255, 255, 255, 0.35)',\n borderColor: '#000',\n pointBackgroundColor: '#000',\n pointRadius: 4,\n borderWidth: 3,\n cubicInterpolationMode: 'default',\n }]\n },\n options: {\n maintainAspectRatio: false,\n layout: {\n padding: {\n right: 8\n }\n },\n legend: {\n display: false\n },\n scales: {\n xAxes: [{\n display: false, //minimalism\n gridLines: {\n display: false\n },\n scaleLabel: {\n display: true,\n fontColor: '#000',\n labelString: 'Time'\n }\n }],\n yAxes: [{\n ticks: {\n beginAtZero: true,\n fontColor: \"#000\"\n },\n gridLines: {\n display: false\n },\n scaleLabel: {\n display: true,\n labelString: 'Speed (km/h)',\n fontColor: '#000'\n }\n }],\n }\n }\n });\n \n}", "function renderMainChart(){\n let ctx = document.getElementById('chart').getContext('2d');\n new Chart(ctx, {\n type: 'bar',\n data: {\n labels: getItemNames(),\n datasets: [{\n label: '# of Clicks',\n data: getItemClicks(),\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n },{\n label: '# of Views',\n data: getItemViews(),\n backgroundColor: [\n 'rgba(255, 99, 132, 0.8)',\n 'rgba(54, 162, 235, 0.8)',\n 'rgba(255, 206, 86, 0.8)',\n 'rgba(75, 192, 192, 0.8)',\n 'rgba(153, 102, 255, 0.8)',\n 'rgba(255, 159, 64, 0.8)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n });\n}", "function initCanvasChartStatus() {\n console.log('in canvas chart');\n var chart = new CanvasJS.Chart(\"chartContainer\", {\n\n title: {\n text: \"STATUS\",\n horizontalAlign: \"left\"\n },\n data: [{\n type: \"doughnut\",\n startAngle: 60,\n //innerRadius: 60,\n indexLabelFontSize: 11,\n indexLabel: \"{label} \\n #percent%\",\n toolTipContent: \"<b>{label}:</b> {y} (#percent%)\",\n dataPoints: [\n { y: 67, label: \"Finished\" },\n { y: 28, label: \"Running\" },\n { y: 10, label: \"Failed\" }\n ]\n }]\n });\n chart.render();\n}", "static initChartsChartJS() {\n // Set Global Chart.js configuration\n Chart.defaults.global.defaultFontColor = '#555555';\n Chart.defaults.scale.gridLines.color = \"rgba(0,0,0,.04)\";\n Chart.defaults.scale.gridLines.zeroLineColor = \"rgba(0,0,0,.1)\";\n Chart.defaults.scale.ticks.beginAtZero = true;\n Chart.defaults.global.elements.line.borderWidth = 2;\n Chart.defaults.global.elements.point.radius = 5;\n Chart.defaults.global.elements.point.hoverRadius = 7;\n Chart.defaults.global.tooltips.cornerRadius = 3;\n Chart.defaults.global.legend.labels.boxWidth = 12;\n\n // Get Chart Containers\n let chartLinesCon = jQuery('.js-chartjs-lines');\n let chartBarsCon = jQuery('.js-chartjs-bars');\n let chartRadarCon = jQuery('.js-chartjs-radar');\n let chartPolarCon = jQuery('.js-chartjs-polar');\n let chartPieCon = jQuery('.js-chartjs-pie');\n let chartDonutCon = jQuery('.js-chartjs-donut');\n\n // Lines/Bar/Radar Chart Data\n let chartLinesBarsRadarData = {\n labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],\n datasets: [\n {\n label: 'This Week',\n fill: true,\n backgroundColor: 'rgba(66,165,245,.75)',\n borderColor: 'rgba(66,165,245,1)',\n pointBackgroundColor: 'rgba(66,165,245,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(66,165,245,1)',\n data: [25, 38, 62, 45, 90, 115, 130]\n },\n {\n label: 'Last Week',\n fill: true,\n backgroundColor: 'rgba(66,165,245,.25)',\n borderColor: 'rgba(66,165,245,1)',\n pointBackgroundColor: 'rgba(66,165,245,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(66,165,245,1)',\n data: [112, 90, 142, 130, 170, 188, 196]\n }\n ]\n };\n\n // Polar/Pie/Donut Data\n let chartPolarPieDonutData = {\n labels: [\n 'Earnings',\n 'Sales',\n 'Tickets'\n ],\n datasets: [{\n data: [\n 50,\n 25,\n 25\n ],\n backgroundColor: [\n 'rgba(156,204,101,1)',\n 'rgba(255,202,40,1)',\n 'rgba(239,83,80,1)'\n ],\n hoverBackgroundColor: [\n 'rgba(156,204,101,.5)',\n 'rgba(255,202,40,.5)',\n 'rgba(239,83,80,.5)'\n ]\n }]\n };\n\n // Init Charts\n let chartLines, chartBars, chartRadar, chartPolar, chartPie, chartDonut;\n\n if (chartLinesCon.length) {\n chartLines = new Chart(chartLinesCon, { type: 'line', data: chartLinesBarsRadarData });\n }\n\n if (chartBarsCon.length) {\n chartBars = new Chart(chartBarsCon, { type: 'bar', data: chartLinesBarsRadarData });\n }\n\n if (chartRadarCon.length) {\n chartRadar = new Chart(chartRadarCon, { type: 'radar', data: chartLinesBarsRadarData });\n }\n\n if (chartPolarCon.length) {\n chartPolar = new Chart(chartPolarCon, { type: 'polarArea', data: chartPolarPieDonutData });\n }\n\n if (chartPieCon.length) {\n chartPie = new Chart(chartPieCon, { type: 'pie', data: chartPolarPieDonutData });\n }\n\n if (chartDonutCon.length) {\n chartDonut = new Chart(chartDonutCon, { type: 'doughnut', data: chartPolarPieDonutData });\n }\n }", "function makeChart(data, detailedData){\n\n if(window.myChart != undefined) {\n window.myChart.destroy();\n }\n else {\n var canvas = document.createElement('canvas');\n canvas.id = \"myChart\";\n var parent=document.getElementById(\"chartContainer\");\n parent.appendChild(canvas);\n }\n\n var ctx = document.getElementById('myChart').getContext('2d');\n window.myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: ['00h', '01h', '02h', '03h', '04h', '05h', '06h', '07h', '08h', '09h', '10h',\n '11h', '12h', '13h', '14h', '15h', '16h', '17h', '18h', '19h', '20h', '21h', '22h', '23h'],\n datasets: [{\n label: 'Time spent using the phone',\n data: data,\n backgroundColor: 'rgba(54, 162, 235, 0.2)',\n borderColor: 'rgba(54, 162, 235, 1)',\n borderWidth: 1\n }]\n },\n options: {\n maintainAspectRatio: false,\n legend: {\n display: false\n },\n tooltips: {\n callbacks: {\n label: function(tooltipItem, data) {\n var result=\"Time spent using the phone: \"+\n data['datasets'][0]['data'][tooltipItem['index']]+\" min\";\n return result;\n },\n afterLabel: function(tooltipItem, data) {\n var d=detailedData[tooltipItem.index];\n var result=\"\\n\";\n for (var i=0;i<d.length;i++) {\n if (d[i]!=0){\n var t=parseInt(d[i][1]);\n if (t>59){\n var s=t-Math.floor(t/60)*60;\n if (s<10){\n result+=d[i][0]+\" \"+Math.floor(t/60)+\" min 0\"+s+\" sec\\n\";\n }\n else {\n result+=d[i][0]+\" \"+Math.floor(t/60)+\" min \"+s+\" sec\\n\";\n }\n }\n else {\n var sec=\"\";\n if (parseInt(d[i][1])<10) sec=\"0\"+d[i][1]+\" sec\\n\";\n else sec=d[i][1]+\" sec\\n\";\n result+=d[i][0]+\" \"+sec;\n }\n }\n }\n return result;\n }\n }\n },\n scales: {\n yAxes: [{\n ticks: {\n suggestedMax:60,\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function makeMyChart(){\n // goatsArray === [\n // 0: {liveClicks: 2, imageName: 'Smiling 'Goat'},\n // 1: {liveClicks: 1, imageName: 'Floating Goat}\n // ]\n // GOAL 1 : make a label array\n // var labelArray = [goatsArray[0].imageName, goatsArray[1].imageName, goatsArray[2].imageName, goatsArray[3].imageName];\n var labelArray = [];\n\n for(var goatIndex = 0; goatIndex < goatsArray.length; goatIndex++){\n labelArray.push(goatsArray[goatIndex].imageName);\n }\n\n\n var goatDataArray = [];\n\n for(var i = 0; i < goatsArray.length; i++){\n goatDataArray.push(goatsArray[i].liveClicks);\n }\n\n\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: labelArray,\n datasets: [{\n label: '# of Goat Votes',\n data: goatDataArray,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n\n}", "function createTrafficChart(chartData, chartOptions){\n let myChart = new Chart(trafficChart, {\n type: 'line',\n data: chartData,\n options: chartOptions, \n })\n}", "function displayChartCanvas(labels, data) {\n // chart parameters (Charts.JS)\n let statsChart = new Chart(ctx, {\n type: 'doughnut',\n data: {\n labels: labels,\n datasets: [\n {\n label: 'Status Codes Total',\n backgroundColor: ['#3e95cd', '#3cba9f', '#8e5ea2',],\n data: data,\n }\n ]\n },\n options: {\n legend: { display: true },\n title: {\n display: true,\n text: 'Status Codes Responses Within The Last 5 Minutes'\n },\n }\n });\n}", "async function chartIt(){\r\n const data = await getData().catch((error) => {\r\n console.log(error);\r\n console.log(\"error\");\r\n }); //charIt is going to wait till the the getData() function is completed.\r\n \r\n var ctx = document.querySelector(\".chart\").getContext('2d');\r\n var myChart = new Chart(ctx, {\r\n type: 'line',\r\n data: {\r\n labels: data.xs,\r\n datasets: [{\r\n label: 'Combined Land-Surface Air and Sea-Surface Water Temperature in °C',\r\n data: data.ys,\r\n fill: false,\r\n backgroundColor: [\r\n 'rgba(255, 0, 0, 0.2)',\r\n ],\r\n borderColor: [\r\n 'rgba(255, 0, 0, 1)',\r\n ],\r\n borderWidth: 1\r\n },\r\n {\r\n label: 'Northern Hemisphere Temperature in °C',\r\n data: data.ns,\r\n fill: false,\r\n borderColor: 'rgba(0, 0, 255, 1)',\r\n backgroundColor: 'rgba(0, 0, 255, 0.2)',\r\n borderWidth: 1\r\n },\r\n {\r\n label: \"Southern Hemisphere in °C\",\r\n data: data.ss,\r\n fill: false,\r\n borderColor: 'rgba(100, 255, 0, 1)',\r\n backgroundColor: 'rgba(100, 255, 0, 0.2)',\r\n borderWidth: 1\r\n }\r\n ]\r\n },\r\n animation: {\r\n onProgress: function (animation) {\r\n progress.value = animation.animationObject.currentStep / animation.animationObject.numSteps;\r\n }\r\n },\r\n options: {\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n // Include a dollar sign in the ticks\r\n callback: function (value, index, values) {\r\n return value + \"°\";\r\n }\r\n }\r\n }]\r\n }\r\n }\r\n });\r\n}", "function cryptic_line_chart_btc_cir() {\n var config2d = {\n type: 'line',\n data: {\n labels: [\"2016\", \"2016\", \"2016\", \"2017\", \"2017\", \"2018\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.green,\n backgroundColor: window.chartColors.green,\n data: [0, 1.5, 2.5, 2, 3, 5]\n }]\n }\n };\n var ctx2d = document.getElementById(\"bitcoin_cir\").getContext(\"2d\");\n window.chart2d = new Chart(ctx2d, config2d);\n}", "function cryptic_line_chart_btc_pot() {\n var config2a = {\n type: 'line',\n data: {\n labels: [\"2016\", \"2016\", \"2016\", \"2017\", \"2017\", \"2018\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.green,\n backgroundColor: window.chartColors.green,\n data: [0, 1.5, 2.5, 2, 3, 5]\n }]\n }\n };\n var ctx2a = document.getElementById(\"bitcoin_potential\").getContext(\"2d\");\n window.chart2a = new Chart(ctx2a, config2a);\n}", "function chart() {\n\n var data = [];\n var labels = [];\n\n for (var i = 0; i < imgArray.length; i++) {\n data[i] = imgArray[i].votes;\n labels[i] = imgArray[i].name;\n }\n\n //this is the name for each product\n var colors = ['red', 'blue', 'yellow', 'hotpink', 'purple', 'orange' , 'white' , 'cyan' , 'magenta' , 'salmon', 'gold' , 'greenyellow' , 'magenta' , 'silver' , 'black' , 'skyblue' , 'maroon' , 'pink' , 'limegreen' , 'violet'];\n\n var ctx = document.getElementById('chart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: '# of Votes',\n data: data,\n backgroundColor: colors,\n borderColor: 'black',\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function cryptic_line_chart_exc() {\n var config2f = {\n type: 'line',\n data: {\n labels: [\"2016\", \"2016\", \"2016\", \"2017\", \"2017\", \"2018\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.green,\n backgroundColor: window.chartColors.green,\n data: [0, 1.5, 2.5, 2, 3, 5]\n }, {\n label: \"Ethereum\",\n fill: false,\n borderColor: window.chartColors.red,\n backgroundColor: window.chartColors.red,\n data: [0, 0.75, 1, 1.75, 2.5, 3]\n }, {\n label: \"NEO\",\n fill: false,\n borderColor: window.chartColors.blue,\n backgroundColor: window.chartColors.blue,\n data: [0, 2, 0.75, 1.5, 2, 4]\n }]\n }\n };\n var ctx2f = document.getElementById(\"exchange_trade\").getContext(\"2d\");\n window.chart2f = new Chart(ctx2f, config2f);\n}", "function createGraph(dataValues, dataTimes){\n var options = {\n type: 'line',\n data: {\n labels: dataTimes,//Passing the array to be the labels\n datasets: [{\n\t label: 'Humidity Readings',\n\t data: dataValues,//Passing the array to be the data set\n borderColor: \"#3e95cd\",\n backgroundColor: \"rgba(62, 149, 205, 0.4)\",\n fill: true\n \t}]\n },\n options: {\n responsive: true,\n tooltips: {\n mode: 'label',\n },\n hover: {\n mode: 'nearest',\n intersect: true\n },\n scales: {\n xAxes: [{\n display: true,\n scaleLabel: {\n display: true,\n labelString: 'Time'\n }\n }],\n yAxes: [{\n display: true,\n scaleLabel: {\n display: true,\n labelString: 'Humidity'\n }\n }]\n }\n }\n}\n var ctx = document.getElementById(\"humidityReadings\").getContext('2d');\n new Chart(ctx, options);\n}", "function cryptic_line_chart_btc_eth_neo() {\n var config2c = {\n type: 'line',\n data: {\n labels: [\"2016\", \"2016\", \"2016\", \"2017\", \"2017\", \"2018\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.green,\n backgroundColor: window.chartColors.green,\n data: [0, 1.5, 2.5, 2, 3, 5]\n }, {\n label: \"Ethereum\",\n fill: false,\n borderColor: window.chartColors.red,\n backgroundColor: window.chartColors.red,\n data: [0, 0.75, 1, 1.75, 2.5, 3]\n }, {\n label: \"NEO \",\n fill: false,\n borderColor: window.chartColors.blue,\n backgroundColor: window.chartColors.blue,\n data: [0, 2, 0.75, 1.5, 2, 4]\n }]\n }\n };\n var ctx2c = document.getElementById(\"btn_etn_neo\").getContext(\"2d\");\n window.chart2c = new Chart(ctx2c, config2c);\n}", "updateChart () {\n \n }", "function createRadarChart(){\n // Chart.js Radar chart\n if(ctx.length > 0){\n prepareChartData().then((chartData)=> {\n \n \n var myRadarChart = new Chart(ctx, {\n\n type: 'radar',\n data: {\n labels: ['Goalkeeping', 'Defending', 'Movement', 'Passing', 'Finishing'],\n datasets: [{\n data: chartData,\n backgroundColor: 'rgba(35, 230, 35, 0.3)',\n borderColor: 'rgba(35, 230, 35, 0.9)'\n }]\n },\n options: {\n legend: {\n display: false,\n },\n title: {\n display: false,\n },\n scale: {\n ticks: {\n beginAtZero: true,\n max: 10,\n stepSize: 2,\n display: false\n }\n }\n }\n }); \n }) \n }\n}", "function dailyBarChart () {\n\n var ctx = document.getElementById(\"dailyTrafficChart\");\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: ['S', 'M', 'T', 'W', 'T','F','S'],\n datasets: [{\n\n data: [75, 100, 175,125,225, 200, 100],\n\n // tension: 0,\n backgroundColor: 'rgba(123, 104, 238, 1)',\n\n }]\n },\n options: {\n bar: {\n barPercentage:10\n },\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n },\n legend: {\n display: false\n },\n responsive: true,\n mainAspectRatio:false\n }\n });\n\n}", "function stampaChart(id, tipoGrafico, labels, data){\r\n var ctx = $(\"#\" + id );\r\n var id = new Chart(ctx, {\r\n type: tipoGrafico,\r\n data: {\r\n labels: labels,\r\n datasets: [{\r\n label: 'VENDITE',\r\n data: data,\r\n backgroundColor: [\r\n 'rgba(255, 99, 132, 0.7)',\r\n 'rgba(54, 162, 235, 0.7)',\r\n 'rgba(255, 206, 86, 0.7)',\r\n 'rgba(75, 192, 192, 0.7)',\r\n 'rgba(153, 102, 255, 0.7)',\r\n 'rgba(255, 159, 64, 0.7)',\r\n 'rgba(213, 42, 24, 0.7)',\r\n 'rgba(164, 74, 28, 0.7)',\r\n 'rgba(231, 28, 75, 0.7)',\r\n 'rgba(185, 85, 36, 0.7)',\r\n 'rgba(153, 217, 225, 0.7)',\r\n 'rgba(217, 185, 185, 0.7)',\r\n 'rgba(53, 194, 153, 0.7)',\r\n\r\n ],\r\n borderColor: [\r\n 'rgba(255, 99, 132, 1)',\r\n 'rgba(54, 162, 235, 1)',\r\n 'rgba(255, 206, 86, 1)',\r\n 'rgba(75, 192, 192, 1)',\r\n 'rgba(153, 102, 255, 1)',\r\n 'rgba(255, 159, 64, 1)',\r\n 'rgba(213, 42, 24, 1)',\r\n 'rgba(164, 74, 28, 1)',\r\n 'rgba(231, 28, 75, 1)',\r\n 'rgba(185, 85, 36, 1)',\r\n 'rgba(153, 217, 225, 1)',\r\n 'rgba(217, 185, 185, 1)',\r\n 'rgba(53, 194, 153, 1)',\r\n ],\r\n borderWidth: 2\r\n }]\r\n },\r\n options: {\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n beginAtZero: true\r\n }\r\n }]\r\n }\r\n }\r\n\r\n }); //fine mychart\r\n\r\n} //FINE FUNZIONE STAMPACHART", "function scanChart(data, labels) {\r\n var ctx = document.getElementById(\"scanChart\").getContext('2d');\r\n var myChart = new Chart(ctx, {\r\n type: 'line',\r\n data: {\r\n labels: labels,\r\n datasets: [{\r\n label: 'SCAN',\r\n data: data,\r\n }]\r\n },\r\n });\r\n}", "function provChart(date, cases, fatal, hosp, crit, prov, chart) {\n var ctx = document.getElementById(chart).getContext('2d');\n\n let mychart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: date,\n datasets: [\n {\n label: ' Daily Cases',\n data: cases,\n borderColor: 'rgba(146, 207, 211, 1)',\n fill: false,\n },\n {\n label: 'Fatalities',\n data: fatal,\n borderColor: 'rgba(247, 29, 29, 1)',\n fill: false,\n },\n {\n label: 'Hospitalizations',\n data: hosp,\n borderColor: 'rgba(29, 61, 247, 1)',\n fill: false,\n },\n {\n label: 'Critical',\n data: crit,\n borderColor: 'rgba(249, 231, 26, 1)',\n fill: false,\n },\n ],\n },\n options: {\n scales: {\n yAxes: [\n {\n scaleLabel: {\n display: true,\n labelString: 'Number of People',\n },\n },\n ],\n xAxes: [\n {\n scaleLabel: {\n display: true,\n labelString: 'Date(DD/MM/YYYY)',\n },\n },\n ],\n },\n title: {\n display: true,\n fontSize: 24,\n text: prov ,\n },\n },\n });\n}", "function loadGraph(title,data,dataTitles){\r\n var ctx = document.getElementById(\"Chart\").getContext('2d');\r\n var logChart = new Chart(ctx, {\r\n type: 'bar',\r\n data: {\r\n labels: dataTitles,\r\n datasets: [{\r\n label: title,\r\n data: data,\r\n backgroundColor: [\r\n 'rgba(255, 99, 132, 0.8)',\r\n 'rgba(54, 162, 235, 0.8)',\r\n 'rgba(255, 206, 86, 0.8)',\r\n 'rgba(75, 192, 192, 0.8)',\r\n 'rgba(153, 102, 255, 0.8)',\r\n 'rgba(255, 159, 64, 0.8)'\r\n ],\r\n borderColor: [\r\n 'rgba(255,99,132,1)',\r\n 'rgba(54, 162, 235, 1)',\r\n 'rgba(255, 206, 86, 1)',\r\n 'rgba(75, 192, 192, 1)',\r\n 'rgba(153, 102, 255, 1)',\r\n 'rgba(255, 159, 64, 1)'\r\n ],\r\n borderWidth: 1\r\n }]\r\n },\r\n options: {\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n beginAtZero:true\r\n }\r\n }]\r\n }\r\n }\r\n });\r\n}", "function weeklyChart () {\n\n var ctx = document.getElementById(\"myChart\");\n var myChart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: ['16-22', '23-29', '30-5', '6-12', '13-19', '20-26', '27-3', '4-10','11-17', '18-24','25-31'],\n datasets: [{\n\n data: [750, 1250, 1000,1250, 1750, 1500, 1750, 1250, 1000, 2250, 1250, 750],\n borderWidth: 1,\n tension: 0,\n backgroundColor: 'rgba(151, 145, 222, 0.3)',\n responsive: true,\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n },\n legend: {display: false}\n }\n\n });\n}", "function renderChart() {\n let labelData = [];\n for (let i = 0; i < Product.allProducts.length; i++){\n labelData.push(Product.allProducts[i].name);\n }\n let voteData = [];\n for (let i = 0; i < Product.allProducts.length; i++){\n voteData.push(Product.allProducts[i].clicks);\n }\n\n let timesShownData = [];\n for (let i = 0;i < Product.allProducts.length; i++) {\n timesShownData.push(Product.allProducts[i].timesShown)\n }\n\n\n// Create chart storing all data shown on the side, but in a visual format\nvar ctx = document.getElementById('productChart').getContext('2d');\nvar myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: labelData,\n datasets: [{\n label: '# of Votes',\n data: voteData,\n backgroundColor: [\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)'\n ],\n borderColor: [\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple',\n 'purple'\n ],\n borderWidth: 1\n },\n \n {\n label: '# of Times Shown',\n data: timesShownData,\n backgroundColor: [\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange',\n 'orange'\n ],\n borderWidth: 1\n }\n \n \n ]\n\n\n\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n});\n\n\n}", "function CreateProblemChart(labels, values) {\n var ctx = document.getElementById('myOtherChart').getContext('2d');\n \n var data = {\n labels: labels,\n datasets: [{\n label: \"Number of Incidents\",\n axis: 'y',\n data: values,\n backgroundColor: 'rgba(255, 140, 0, 0.5)',\n borderColor: 'rgba(232, 17, 35, 0.75)',\n borderWidth: 1\n }]};\n \n var config = {\n type: 'bar', data,\n options: {\n plugins: {\n title: {\n display: true,\n text: 'Problem Type'\n }\n },\n maintainAspectRatio: false,\n indexAxis: 'y',\n scales: {\n y: [{\n stacked: false, \n beginAtZero: true, \n ticks: {stepSize: 0, min: 0, autoSkip: false}\n \n }]\n }\n } \n };\n \n return new Chart(ctx, config);\n\n}", "function renderChart() {\n let datasets = [];\n\n if (funcionPoints.length > 0) {\n datasets.push({\n label: funcion,\n data: funcionPoints,\n borderColor: \"purple\",\n borderWidth: 2,\n fill: false,\n showLine: true,\n pointBackgroundColor: \"purple\",\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para la funcion.\");\n }\n\n if (areaPoints.length > 0) {\n datasets.push({\n label: \"Area\",\n data: areaPoints,\n borderColor: \"blue\",\n borderWidth: 2,\n fill: true,\n showLine: true,\n pointBackgroundColor: \"blue\",\n tension: 0,\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para el area.\");\n }\n\n if (insidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por debajo de la función\",\n data: insidePoints,\n borderColor: \"green\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"green\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n if (outsidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por arriba de la función\",\n data: outsidePoints,\n borderColor: \"red\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"red\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n data = { datasets };\n\n if (chart) {\n chart.data = data;\n chart.update();\n }\n }", "function displayChart () {\n var canvas = document.getElementById('chart');\n var paint = canvas.getContext('2d');\n displayArrays();\n\n var myChart = new Chart(paint, {\n type: 'bar',\n\n data: {\n labels: names, // named for the array to display the info\n datasets: [{\n label: 'Times product was shown',\n backgroundColor: 'rgb(255, 99, 132)',\n borderColor: 'rgb(255, 99, 132)',\n data: shown,\n },{\n label: 'Times product was clicked',\n backgroundColor: 'rgb(168, 15, 224)',\n borderColor: 'rgb(168, 15, 224)',\n data: clicks,\n }]\n },\n\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function getTimeChart(data) {\n console.log('Time chart bike data', data);\n \n var ctx = document.getElementById(\"timeChart\").getContext('2d');\n\n var timeChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: data.map(function (trip) {\n return trip.month;\n }),\n datasets: [\n {\n label: \"Time\",\n borderColor: \"#666\",\n data: data.map(function (trip) {\n return parseFloat(trip.duration);\n })\n }\n ]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function sstfChart(data, labels, ) {\r\n var ctx = document.getElementById(\"sstfChart\").getContext('2d');\r\n var myChart = new Chart(ctx, {\r\n type: 'line',\r\n data: {\r\n labels: labels,\r\n datasets: [{\r\n label: 'sstf',\r\n data: data,\r\n }]\r\n },\r\n });\r\n}", "function cscanChart(data, labels, ) {\r\n var ctx = document.getElementById(\"cscanChart\").getContext('2d');\r\n var myChart = new Chart(ctx, {\r\n type: 'line',\r\n data: {\r\n labels: labels,\r\n datasets: [{\r\n label: 'CSCAN',\r\n data: data,\r\n }]\r\n },\r\n });\r\n}", "getChartData() {\n this.setState({\n chartData:{\n labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],\n datasets: [\n {\n label: 'Movie 1',\n data: [\n 65,\n 60,\n 40,\n 50,\n 36,\n 27,\n 40\n ],\n backgroundColor: 'rgb(211, 211, 211, 0.8)'\n }, {\n label: 'Movie 2',\n data: [\n 49,\n 51,\n 62,\n 35,\n 55,\n 32,\n 27\n ],\n backgroundColor: 'rgb(21, 193, 193, 0.8)'\n }\n ]\n }\n })\n }", "_setChartOptions() {\n /**\n * the animated loader\n */\n const _loader = this.loader\n /**\n * chart default options\n */\n let _options = {\n hoverOffset: 8,\n layout: {},\n chartArea: {\n backgroundColor: \"transparent\"\n },\n elements: {},\n spanGaps: true,\n plugins: {\n title: {},\n tooltip: {},\n legend: {\n display: CT_SHOWLEGEND.includes(this.chart_type) || false\n }\n },\n animation: {\n onComplete: function () {\n if (_loader) _loader.style.display = \"none\"\n }\n }\n }\n /**\n * check enable gradient colors for state charts or\n */\n if (this.graphData.config.gradient === true && this.graphData.config.mode === \"simple\") {\n _options.gradientcolor = {\n color: true,\n type: this.chart_type\n }\n }\n /**\n * check enable gradient colors for data series chart\n */\n if (plugin_gradient && this.graphData.config.gradient) {\n _options.plugins = {\n plugin_gradient\n }\n }\n /**\n * check secondary axis\n * this.graphData.config holds the configruation data\n * this.graphData.data.datasets data per series\n */\n if (this.graphData.config.secondaryAxis && this.graphData && this.graphData.data && this.graphData.data.datasets) {\n let _scaleOptions = {}\n this.graphData.data.datasets.forEach((dataset) => {\n if (dataset.yAxisID) {\n _scaleOptions[dataset.yAxisID] = {}\n _scaleOptions[dataset.yAxisID].id = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].type = \"linear\"\n _scaleOptions[dataset.yAxisID].position = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].display = true\n if (dataset.yAxisID.toLowerCase() == \"right\") {\n _scaleOptions[dataset.yAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n if (dataset.xAxisID) {\n _scaleOptions[dataset.xAxisID] = {}\n _scaleOptions[dataset.xAxisID].id = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].type = \"linear\"\n _scaleOptions[dataset.xAxisID].position = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].display = true\n if (dataset.xAxisID.toLowerCase() == \"top\") {\n _scaleOptions[dataset.xAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n })\n if (_scaleOptions) {\n _options.scales = _scaleOptions\n }\n }\n /**\n * bubble axis label based on the data settings\n *\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n const _itemlist = this.entity_items.getEntitieslist()\n let labelX = _itemlist[0].name\n labelX += _itemlist[0].unit ? \" (\" + _itemlist[0].unit + \")\" : \"\"\n let labelY = _itemlist[1].name\n labelY += _itemlist[1].unit ? \" (\" + _itemlist[1].unit + \")\" : \"\"\n _options.scales = {\n x: {\n id: \"x\",\n title: {\n display: true,\n text: labelX\n }\n },\n y: {\n id: \"y\",\n title: {\n display: true,\n text: labelY\n }\n }\n }\n /**\n * scale bubble (optional)\n */\n if (this.graphData.config.bubbleScale) {\n _options.elements = {\n point: {\n radius: (context) => {\n const value = context.dataset.data[context.dataIndex]\n return value._r * this.graphData.config.bubbleScale\n }\n }\n }\n }\n }\n /**\n * special case for timescales to translate the date format\n */\n if (this.graphData.config.timescale && this.graphData.config.datascales) {\n _options.scales = _options.scales || {}\n _options.scales.x = _options.scales.x || {}\n _options.scales.x.maxRotation = 0\n _options.scales.x.autoSkip = true\n _options.scales.x.major = true\n _options.scales.x.type = \"time\"\n _options.scales.x.time = {\n unit: this.graphData.config.datascales.unit,\n format: this.graphData.config.datascales.format,\n isoWeekday: this.graphData.config.datascales.isoWeekday\n }\n _options.scales.x.ticks = {\n callback: xAxisFormat\n }\n }\n /**\n * case barchart segment\n * TODO: better use a plugin for this feature.\n * set bar as stacked, hide the legend for the segmentbar,\n * hide the tooltip item for the segmentbar.\n */\n if (this.graphData.config.segmentbar === true) {\n _options.scales = {\n x: {\n id: \"x\",\n stacked: true\n },\n y: {\n id: \"y\",\n stacked: true\n }\n }\n _options.plugins.legend = {\n labels: {\n filter: (legendItem, data) => {\n return data.datasets[legendItem.datasetIndex].tooltip !== false\n }\n },\n display: false\n }\n _options.plugins.tooltip.callbacks = {\n label: (chart) => {\n if (chart.dataset.tooltip === false || !chart.dataset.label) {\n return null\n }\n return `${chart.formattedValue} ${chart.dataset.unit || \"\"}`\n }\n }\n _options.interaction = {\n intersect: false,\n mode: \"index\"\n }\n } else {\n /**\n * callbacks for tooltip\n */\n _options.plugins.tooltip = {\n callbacks: {\n label: formatToolTipLabel,\n title: formatToolTipTitle\n }\n }\n _options.interaction = {\n intersect: true,\n mode: \"point\"\n }\n }\n /**\n * disable bubble legend\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n _options.plugins.legend = {\n display: false\n }\n }\n /**\n * multiseries for pie and doughnut charts\n */\n if (this.graphData.config.multiseries === true) {\n _options.plugins.legend = {\n labels: {\n generateLabels: function (chart) {\n const original = Chart.overrides.pie.plugins.legend.labels.generateLabels,\n labelsOriginal = original.call(this, chart)\n let datasetColors = chart.data.datasets.map(function (e) {\n return e.backgroundColor\n })\n datasetColors = datasetColors.flat()\n labelsOriginal.forEach((label) => {\n label.datasetIndex = label.index\n label.hidden = !chart.isDatasetVisible(label.datasetIndex)\n label.fillStyle = datasetColors[label.index]\n })\n return labelsOriginal\n }\n },\n onClick: function (mouseEvent, legendItem, legend) {\n legend.chart.getDatasetMeta(legendItem.datasetIndex).hidden = legend.chart.isDatasetVisible(\n legendItem.datasetIndex\n )\n legend.chart.update()\n }\n }\n _options.plugins.tooltip = {\n callbacks: {\n label: function (context) {\n const labelIndex = context.datasetIndex\n return `${context.chart.data.labels[labelIndex]}: ${context.formattedValue} ${context.dataset.unit || \"\"}`\n }\n }\n }\n }\n /**\n * preset cart current config\n */\n let chartCurrentConfig = {\n type: this.chart_type,\n data: {\n datasets: []\n },\n options: _options\n }\n /**\n * merge default with chart config options\n * this.chartconfig.options see yaml config\n * - chart\n * - options:\n */\n if (this.chartconfig.options) {\n chartCurrentConfig.options = deepMerge(_options, this.chartconfig.options)\n } else {\n chartCurrentConfig.options = _options\n }\n return chartCurrentConfig\n }", "function createChart(id, title, dataArray) {\n let chart = new CanvasJS.Chart(id, {\n title: {\n text: title\n },\n axisX: {\n title: \"Value of n\",\n valueFormatString: \"#,###\"\n },\n axisY: {\n title: \"Average runtime (ms)\"\n },\n toolTip: {\n shared: true\n },\n legend: {\n cursor: \"pointer\",\n verticalAlign: \"top\",\n horizontalAlign: \"center\",\n dockInsidePlotArea: true,\n },\n data: dataArray\n });\n return chart;\n}", "function drawDoughnutChart(label, data) {\n var ctx2 = document.getElementById(\"doughnutChart\").getContext(\"2d\");\n var doughnutChart = new Chart(ctx2, {\n type: 'doughnut',\n data: {\n labels: label,\n datasets: [{\n data: data,\n backgroundColor: [\"#f1c40f\", \"#2ecc71\", \"#3498db\", \"#e74c3c\"]\n }]\n },\n options: {\n title: {\n display: true,\n text: \"Vendite per singoli venditori nel 2017\"\n }\n }\n });\n}", "init() {\n this._sys\n .fsSize()\n .then(info => {\n const disks = info;\n const datasets = [];\n const unit = this._useGb ? 'GB' : 'GiB';\n\n const diskUsagePerDisk = disks.map(disk => {\n return {\n name: disk.fs,\n used: disk.used,\n size: disk.size\n };\n });\n\n diskUsagePerDisk.forEach(disk => {\n const dataset = {\n data: [\n this.convert(disk.size - disk.used),\n this.convert(disk.used)\n ],\n backgroundColor: ['rgb(32, 191, 107)', 'rgb(252, 92, 101)'],\n label: disk.name\n };\n\n datasets.push(dataset);\n });\n\n this._chart = new Chart(this._ctx, {\n plugins: [this._chartDataLabels],\n type: 'pie',\n data: {\n datasets: datasets,\n labels: [`Free in ${unit}`, `Used in ${unit}`]\n },\n options: {\n plugins: {\n datalabels: {\n formatter: (value, context) => {\n const name = diskUsagePerDisk[context.datasetIndex].name;\n const index = context.dataIndex;\n\n if (index === 0) {\n return name;\n } else {\n return '';\n }\n }\n }\n },\n responsive: true,\n legend: {\n position: 'top'\n },\n title: {\n display: true,\n text: 'Disk usage per disk'\n },\n animation: {\n animateScale: this._animations,\n animateRotate: this._animations\n }\n }\n });\n })\n .catch(err => console.error(err));\n }", "barChart(dataArr, LabelsArr) {\n var ctx = 'genreChart';\n\n var dataArr = [4, 12, 52, 2, 12];\n var labelsArr = [\"Rock\", \"Hip hop\", \"Blues\", \"Metal\", \"Jazz\"];\n var colorsArr = [\"#3e95cd\", \"#8e5ea2\",\"#3cba9f\",\"#e8c3b9\",\"#c45850\"];\n var options = {\n title: {\n display: true,\n text: 'My big ol bar chart'\n },\n legend: { display: false },\n scales: {\n xAxes: [{\n gridLines: {\n offsetGridLines: true\n }\n }]\n }\n };\n\n\n var myBarChart = new Chart(ctx, {\n type: 'bar',\n data: {\n\n labels: labelsArr,\n datasets: [{\n backgroundColor: colorsArr,\n data: dataArr\n }]\n },\n options: options\n });\n }", "function configCharts() {\n Chart.defaults.global.tooltips.titleFontSize = 16;\n Chart.defaults.global.tooltips.bodyFontSize = 14;\n Chart.defaults.global.showLines = false;\n\n Chart.defaults.global.plugins.datalabels = {\n color: \"#fff\",\n anchor: \"start\",\n align: \"middle\",\n backgroundColor: (context) => {\n return context.dataset.backgroundColor;\n },\n font: {\n weight: 'bold',\n },\n padding: {\n top: \"8\",\n right: \"8\",\n left: \"8\",\n bottom: \"8\",\n },\n borderRadius: 25,\n borderWidth: 2,\n borderColor: \"white\",\n }\n}", "function createChart() {\n var percentages = [];\n for (var i =0; i < lengthOfObjects; i++) {\n percentages.push(Math.round((arrayOfPictures[i].clickCounter / arrayOfPictures[i].timeShown) * 100));\n }\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: arrayOfFileNames,\n datasets: [{\n label: '# of Votes',\n data: percentages,\n backgroundColor: [\n 'rgba(255, 99, 132, 255)',\n 'rgba(54, 162, 235, 150)',\n 'rgba(255, 206, 86, 200)',\n 'rgba(75, 192, 192, 235)',\n 'rgba(153, 102, 255, 150)',\n 'rgba(255, 159, 64, 245)',\n 'rgba(255, 255, 255, 250)',\n 'rgba(54, 250, 235, 150)',\n 'rgba(255, 126, 86, 200)',\n 'rgba(75, 245, 192, 235)',\n 'rgba(153, 145, 255, 150)',\n 'rgba(255, 255, 164, 245)',\n 'rgba(255, 255, 255, 250)',\n 'rgba(15, 155, 255, 20)',\n 'rgba(54, 250, 235, 150)',\n 'rgba(255, 126, 86, 200)',\n 'rgba(75, 245, 192, 235)',\n 'rgba(153, 145, 255, 150)',\n 'rgba(255, 255, 164, 245)',\n 'rgba(255, 255, 255, 250)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function buildChart (data3) {\n\n let worldEvol = data3\n \n let casesDays = Object.keys(worldEvol.cases); console.log(casesDays)\n let casesNum = Object.values(worldEvol.cases); console.log(casesNum)\n \n \n let ctx = document.getElementById('Chart').getContext('2d');\n let chartWorld = new Chart(ctx, {\n type: 'line',\n data: {\n labels: casesDays,\n datasets: [ {\n label: 'Casos',\n data: casesNum,\n pointBackgroundColor: 'rgba(244, 247, 76, 0.5)',\n pointBorderColor: 'rgba(244, 247, 76, 1)',\n pointBorderWidth: 1,\n backgroundColor: 'rgba(244, 247, 76, 0.6)'\n \n \n }]\n \n },\n options: {\n \n legend: {\n display: true,\n labels: {\n fontColor: '#3f3e3e',\n fontStyle: 'bold'\n }\n }\n }\n })}", "function messagesChartBar(mData) {\n var ctx = $('#messages-bar');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: mData.months,\n datasets: [{\n label: 'Messaggi',\n data: mData.messages_count_data,\n backgroundColor: [\n '#62CB76',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n '#62CB76',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function PlotLineChart(ctx){\r\n var myChart = new Chart(ctx, {\r\n type: 'radar',\r\n data: {\r\n labels: [\"Red\", \"Blue\", \"Yellow\", \"Green\", \"Purple\", \"Orange\"],\r\n datasets: [{\r\n label: 'Number of Votes',\r\n data: [12, 19, 13, 15, 20, 17],\r\n data: [22, 15, 10, 11, 14, 13],\r\n backgroundColor: [\r\n 'rgba(255, 99, 132, 0.2)',\r\n 'rgba(54, 162, 235, 0.2)', \r\n ],\r\n borderColor: [\r\n 'rgba(255,99,132,1)',\r\n 'rgba(54, 162, 235, 1)', \r\n ],\r\n borderWidth: 1\r\n }]\r\n },\r\n options: {\r\n scales: {\r\n display: false\r\n }\r\n }\r\n });\r\n}", "function updateMainBarChart() {\n console.log(\"Bar chart started\");\n\n // variable\n let xValues = [];\n let yValues = [];\n\n // to get total number of selections for each skill for x-axis and y-axis values\n for (let i = 0; i < total_list.length; i++){\n xValues.push(total_list[i][0]);\n yValues.push(total_list[i][1]);\n\n }\n\n var ChartOptions = {\n title: {\n display: true\n }\n },\n ChartData = {\n labels: xValues,\n datasets: [\n {\n label: \"Number of selections\",\n data: yValues,\n backgroundColor: chartColors,\n borderColor: colors.borderColor\n }]\n }\n var barChartjs = document.getElementById(\"skillBarChartjs\");\n barChartjs && new Chart(barChartjs, {\n type: \"bar\",\n data: ChartData,\n options: ChartOptions\n });\n}", "function WorkingNonworkingReport(workingNonWorkingReport)\n{\n\n var options = {\n legend: false,\n responsive: false\n };\n\n chartWorkNon = new Chart(document.getElementById(\"canvas1\"), {\n type: 'doughnut',\n tooltipFillColor: \"rgba(51, 51, 51, 0.55)\",\n data: {\n labels: [\n \"Working\",\n \"Non-Working\"\n ],\n datasets: [{\n data: workingNonWorkingReport,\n backgroundColor: [\n \"#9B59B6\",\n \"#3498DB\"\n ],\n hoverBackgroundColor: [\n \"#CFD4D8\",\n \"#36CAAB\",\n ]\n }]\n },\n options: options\n });\n}", "function plotChart(labels, data) {\n var chartData = {\n labels: labels,\n datasets : [\n {\n fillColor: \"rgba(151,187,205,0.2)\",\n strokeColor: \"rgba(151,187,205,1)\",\n pointColor: \"rgba(151,187,205,1)\",\n pointStrokeColor: \"#fff\",\n pointHighlightFill: \"#fff\",\n pointHighlightStroke: \"rgba(151,187,205,1)\",\n data : data\n }\n ]\n };\n\n var charts = document.getElementsByClassName(\"js-chart\");\n var chartLength = charts.length;\n\n for(var i = 0; i < chartLength; i++) {\n var ctx = charts[i].getContext(\"2d\");\n ctx.canvas.width = 300;\n ctx.canvas.height = 300;\n window.myLine = new Chart(ctx).Line(chartData);\n }\n }", "function tvToolDispChart(tvDispData,tvDispLabels) {\r\n var ctx = document.getElementById('tvDispChart');\r\n var tvDispChart = new Chart(ctx, {\r\n type: 'line',\r\n data: {\r\n labels: tvDispLabels,\r\n datasets: [{\r\n backgroundColor: 'rgba(65,135,165,0.3)',\r\n borderColor: 'rgba(25,60,130,0.3)',\r\n borderWidth: '3',\r\n data: tvDispData,\r\n }]\r\n },\r\n options: {\r\n // responsive: true,\r\n // maintainAspectRatio: false,\r\n legend: {\r\n display: false,\r\n labels: {\r\n // fontColor: 'rgb(255,99,132)',\r\n boxWidth: 60,\r\n fontSize: 18,\r\n }\r\n },\r\n title: {\r\n display: true,\r\n text: 'TV Disp Amplitude',\r\n fontSize: '18',\r\n },\r\n scales: {\r\n xAxes: [{\r\n // type: 'linear',\r\n position: 'bottom',\r\n scaleLabel: {\r\n display: 'true',\r\n labelString: 'Cycles'\r\n }\r\n }],\r\n yAxes: [{\r\n scaleLabel: {\r\n display: 'true',\r\n labelString: 'Amplitude [°]'\r\n }\r\n }],\r\n }\r\n }\r\n });\r\n }", "function Alarms(alarms)\n{\n var options = {\n legend: false,\n responsive: false\n };\n chartAlarms = new Chart(document.getElementById(\"canvas2\"), {\n type: 'doughnut',\n tooltipFillColor: \"rgba(51, 51, 51, 0.55)\",\n data: {\n labels: [\n \"Major\",\n \"Minor\",\n \"Critical\"\n ],\n datasets: [{\n data: alarms,\n backgroundColor: [\n \"violet\",\n \"#3498DB\",\n \"red\"\n ],\n hoverBackgroundColor: [\n \"#CFD4D8\",\n \"#36CAAB\",\n \"#E95E4F\"\n ]\n }]\n },\n options: options\n });\n}", "function myGraphChart() {\n getChartData(); \n \n // var chartArray = [SkyMallArray[0].imageName, 'Dragon', 'Bubblegum', 'Dog Duck', 'Boots', 'Chair', 'Bathroom'];\n var ctx = document.getElementById('myChart').getContext('2d');\n ctx.canvas.width = 100;\n ctx.canvas.height = 100;\n var myChart = new Chart(ctx, {\n type: 'horizontalBar',\n data: {\n labels: ['Dragon', 'Bubblegum', 'Dog Duck', 'Boots', 'Chair', 'Bathroom', 'Bag', 'Banana', 'Breakfast', 'Cthulhu', 'Pen', 'Pet-Sweep', 'Scissors'],\n datasets: [{\n label: '# of click',\n data: clickArray, // input where you will put clickArray\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n\n\n var ctx2 = document.getElementById('myChart2').getContext('2d');\n ctx2.canvas.width = 100;\n ctx2.canvas.height = 100;\n var myChart = new Chart(ctx2, {\n type: 'horizontalBar',\n data: {\n labels: ['Dragon', 'Bubblegum', 'Dog Duck', 'Boots', 'Chair', 'Bathroom', 'Bag', 'Banana', 'Breakfast', 'Cthulhu', 'Pen', 'Pet-Sweep', 'Scissors'],\n datasets: [{\n label: '# of Vote',\n data: productShownArray,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n\n}", "componentDidMount() {\n this.initializeChart({\n // Invokes initializeChart which creates new chart using these options:\n //\n data: this.data,\n options: {\n title: {\n display: true,\n text: 'Acceleration Data',\n fontSize: 25\n },\n legend: {\n labels: {\n fontSize: 16\n },\n position: 'bottom'\n },\n scales: {\n xAxes: [\n {\n scaleLabel: {\n display: true,\n labelString: 'Time (milliseconds)',\n fontSize: 20\n },\n ticks: {\n beginAtZero: true,\n fontSize: 20\n }\n }\n ],\n yAxes: [\n {\n type: 'linear',\n scaleLabel: {\n display: true,\n labelString: 'Acceleration (gravity)',\n fontSize: 20\n },\n ticks: {\n beginAtZero: true,\n fontSize: 20\n }\n }\n ]\n }\n },\n responsive: true,\n maintainAspectRatio: false,\n type: 'line',\n legend: {display: false},\n tooltips: {\n enabled: false\n }\n })\n }", "function updateChart(){\n var ctx = document.getElementById(\"myPieChart\");\n var myPieChart = new Chart(ctx, {\n type: 'doughnut',\n data: {\n labels: [\"Falta de Piso Tatil\", \"Rampas Inadequadas\", \"Buracos na via\",\"Calçadas irregulares\",\"Outros\"],\n datasets: [{\n data: [tipos.FALTA_DE_PISO_TATIL, tipos.RAMPA_INADEQUADA, tipos.BURACO,tipos.CALCADA_IRREGULAR,tipos.OUTRO_PROBLEMA],\n backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc','#ff4c8c','#1fddca'],\n hoverBackgroundColor: ['#2e59d9', '#17a673', '#2c9faf'],\n hoverBorderColor: \"rgba(234, 236, 244, 1)\",\n }],\n },\n options: {\n maintainAspectRatio: false,\n tooltips: {\n backgroundColor: \"rgb(255,255,255)\",\n bodyFontColor: \"#858796\",\n borderColor: '#dddfeb',\n borderWidth: 1,\n xPadding: 15,\n yPadding: 15,\n displayColors: false,\n caretPadding: 10,\n },\n legend: {\n display: false\n },\n cutoutPercentage: 80,\n },\n });\n }", "function drawBarChart(label, data) {\n var ctx3 = document.getElementById(\"barChart\").getContext(\"2d\");\n var barChart = new Chart(ctx3, {\n type: 'bar',\n data: {\n labels: label,\n datasets: [{\n label: [\"Trimestre\"],\n data: data,\n backgroundColor: [\"#f1c40f\", \"#2ecc71\", \"#3498db\", \"#e74c3c\"]\n }]\n },\n options: {\n title: {\n display: true,\n text: \"Vendite per trimestri\"\n }\n }\n });\n}", "function siteTurnaroundTimeChart(input_) {\n let ctx = document.getElementById('TATchart').getContext('2d');\n let siteLabel = [];\n let siteData = [];\n for (data of input_.TAT_list) {\n siteLabel.push(data.site_id);\n siteData.push(data.TAT);\n }\n let TATchart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: siteLabel,\n datasets: [{\n label: 'Average Turnaround Time (Days)',\n data: siteData,\n backgroundColor: [\n '#56afbd',\n '#56afbd',\n '#56afbd',\n ],\n borderColor: [\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(54, 162, 235, 1)',\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n fontColor: 'white'\n },\n // gridLines: {\n // color: \"#FFFFFF\"\n // }\n\n }],\n xAxes: [{\n ticks: {\n fontColor: 'white'\n }\n }],\n\n\n },\n legend: {\n labels: {\n // This more specific font property overrides the global property\n fontColor: 'white'\n }\n }\n }\n});\n}", "generateChart(){\n var ctx = document.getElementById(\"lineChart\");\n var lineChart = new Chart(ctx, {\n type: this._type,\n data: {\n labels: this._labelsArray,\n datasets: this._datasetJsonArray\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n return lineChart;\n }", "function engineCountChart(input_) {\n let ctx = document.getElementById('totalEngineChart').getContext('2d');\n let siteLabel = [];\n let siteData = [];\n for (data of input_.TAT_list) {\n siteLabel.push(data.site_id);\n siteData.push(data.TAT);\n }\n\n engineChartDataDict = {\n datasets: [{\n data: [input_.service_count, input_.repairing_count, \n input_.RD_count, input_.transit_count],\n backgroundColor: [\n '#56afbd',\n '#d99477',\n '#ebe854',\n '#88f07a'\n ],\n }],\n\n // These labels appear in the legend and in the tooltips when hovering different arcs\n labels: [\n '# In Service',\n '# Repairing',\n '# R&D',\n '# In transit'\n ]\n};\n\nengineChartOptions = {\n elements: {\n center: {\n text: `#Engines: ${input_.engine_count}`,\n color: 'white', // Default is #000000\n fontStyle: 'Arial', // Default is Arial\n sidePadding: 20, // Default is 20 (as a percentage)\n minFontSize: 10, // Default is 20 (in px), set to false and text will not wrap.\n lineHeight: 10 // Default is 25 (in px), used for when text wraps\n }\n },\n legend: {\n labels: {\n // This more specific font property overrides the global property\n fontColor: 'white'\n },\n position: 'left'\n}\n}\n\nlet countChart = new Chart(ctx, {\n type: 'doughnut',\n data: engineChartDataDict,\n options: engineChartOptions\n});\n}", "function visualData() {\n $(\"#chart\").remove();\n $(\".containerChart\").append('<canvas id=\"chart\">');\n var canvas = document.getElementById(\"chart\");\n var ctx = canvas.getContext(\"2d\");\n\n Chart.defaults.global.defaultFontColor = \"black\";\n var myChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: weeklyDate, //what is listed as the x axis value\n datasets: [\n {\n label: currentCompany,\n data: weeklyValue,\n backgroundColor: \"rgba(0, 0, 0, 1)\",\n borderColor: \"rgba(0, 0, 0, 1)\",\n borderWidth: 3,\n fill: false,\n },\n ],\n },\n options: {\n scales: {\n yAxes: [\n {\n ticks: {\n // beginAtZero: true\n callback: function (value, index, values) {\n return \"$\" + value;\n },\n },\n },\n ],\n },\n },\n });\n }", "function displayChart() {\r\n\tvar chart = new CanvasJS.Chart(\"chartContainer\", {\r\n\t\tanimationEnabled: true,\r\n\t\ttheme: \"light2\", // \"light1\", \"light2\", \"dark1\", \"dark2\"\r\n\t\ttitle: {\r\n\t\t\ttext: \"Typing Speeds\"\r\n\t\t},\r\n\t\taxisY: {\r\n\t\t\ttitle: \"Percentage of Population\",\r\n\t\t\tsuffix: \"%\",\r\n\t\t\tincludeZero: false\r\n\t\t},\r\n\t\taxisX: {\r\n\t\t\ttitle: \"Typing Speeds (Words Per Minute)\"\r\n\t\t},\r\n\t\tdata: [{\r\n\t\t\ttype: \"column\",\r\n\t\t\tdataPoints: [\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"0-10\",\r\n\t\t\t\t\ty: 9\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"10-20\",\r\n\t\t\t\t\ty: 11\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"20-30\",\r\n\t\t\t\t\ty: 12\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"30-40\",\r\n\t\t\t\t\ty: 15\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"40-50\",\r\n\t\t\t\t\ty: 12\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"50-60\",\r\n\t\t\t\t\ty: 11\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"60-70\",\r\n\t\t\t\t\ty: 10\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: \"70+\",\r\n\t\t\t\t\ty: 5\r\n\t\t\t\t}\r\n\t\t]\r\n\t}]\r\n\t});\r\n\tchart.render();\r\n}", "function renderChart(){\n\n let ctx = document.getElementById('myChart').getContext('2d');\n\n // eslint-disable-next-line no-undef\n new Chart(ctx, {\n type: 'bar',\n data: {\n labels:productsLabels,\n datasets: [{\n label: '# of Votes',\n data: JSON.parse(localStorage.getItem('productsClickedNum')),\n backgroundColor: [\n 'rgb(255, 99, 132)',\n ],\n // borderColor: [\n // 'rgba(0, 99, 132, 1)',\n // 'rgba(0, 162, 235, 1)',\n // 'rgba(0, 206, 86, 1)',\n // 'rgba(0, 192, 192, 1)',\n // 'rgba(0, 102, 255, 1)',\n // 'rgba(0, 159, 64, 1)'\n // ],\n borderWidth: 2\n },{\n label: '# of Viewed',\n data: JSON.parse(localStorage.getItem('productsViewedNum')),\n backgroundColor: [\n 'rgb(54, 162, 235)',\n ],\n // borderColor: [\n // 'rgba(0, 99, 132, 1)',\n // 'rgba(0, 162, 235, 1)',\n // 'rgba(0, 206, 86, 1)',\n // 'rgba(0, 192, 192, 1)',\n // 'rgba(0, 102, 255, 1)',\n // 'rgba(0, 159, 64, 1)'\n // ],\n borderWidth: 2\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n });\n}", "function fnGetChart(arrX, arrY){\n var ctx = document.getElementById(\"myChart\").getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: arrX,//doublTotal\n datasets: [{\n label: '# IMC',\n data: arrY,//Dates\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n }", "function initiateChart() {\r\n\tchart = new Chart(eggMarketChart, {\r\n\t // The type of chart we want to create\r\n\t type: 'line',\r\n\r\n\t // The data for our dataset\r\n\t data: {\r\n\t labels: [\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\r\n\t \t\t \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\r\n\t \t\t \" \", \" \", \" \", \" \", \" \"\r\n\t ],\r\n\t datasets: [{\r\n\t label: \"EGM\",\r\n\t borderColor: 'rgb(255, 99, 132)',\r\n\t data: [baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice,\r\n\t \t baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice,\r\n\t \t baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice,\r\n\t \t baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice,\r\n\t \t baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice, baseEggPrice\r\n\t ],\r\n\t }]\r\n\t },\r\n\r\n\t \r\n\r\n\t // Configuration options go here\r\n\t options: {\r\n\t \tmaintainAspectRatio: false,\r\n\t \tresponsive: true,\r\n\t \tlegend: {\r\n\t \t\tdisplay: false\r\n\t \t},\r\n\t \t\r\n\t \tconfiguration: {\r\n\t \t\tresponsiveAnimationDuration: true\r\n\t \t},\r\n\r\n\t\t\tscales: {\r\n\t\t\t\tyAxes: [{\r\n\t\t\t\t\tdisplay: true,\r\n\t\t\t\t\tticks: {\r\n\t\t\t\t\t\tcallback: function(label, index, labels) {\r\n\t\t\t\t\t\t\treturn numeral(label).format('0.00a');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}]\r\n\t\t\t}\r\n\t }\r\n\r\n\r\n\r\n\t});\r\n}", "function getDistanceChart(data) {\n\n var ctx = document.getElementById(\"distanceChart\").getContext('2d');\n\n var distanceChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: data.map(function (trip) {\n return trip.month + ' ' + trip.day + ', ' + trip.year;\n }),\n datasets: [\n {\n label: \"Distance\",\n borderColor: \"rgb(255,99,132)\",\n data: data.map(function (trip) {\n return trip.distance;\n })\n }\n ]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function CreateTimeSeries(labels, values) {\n var ctx = document.getElementById('myBestChart').getContext('2d');\n const config = {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: \"Number of Incidents\",\n data: values,\n backgroundColor: 'rgba(0, 188, 242, 0.5)',\n borderColor: 'rgba(0, 158, 73, .75)',\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n },\n plugins: {\n title: {\n display: true,\n text: 'Police Use of Force Incidents by Year'\n }\n }\n }\n }\n \n return new Chart(ctx, config);\n\n}", "function initNWperSecChart() {\n const ctx = document.getElementById(\"nwPerSecChart\");\n return new Chart(ctx, {\n type: 'line',\n data: {\n labels: [],\n datasets: [\n {\n label: \"Received [Bytes/s]\",\n data: [],\n backgroundColor: colors.info,\n borderColor: colors.info,\n fill: false,\n datalabels: {\n display: false,\n }\n },\n {\n label: \"Transferred [Bytes/s]\",\n data: [],\n backgroundColor: colors.secondary,\n borderColor: colors.secondary,\n fill: false,\n datalabels: {\n display: false,\n }\n },\n ]\n },\n options: {\n title: {\n text: \"\",\n display: true,\n fontSize: 20,\n fontStyle: \"normal\",\n fontColor: \"black\",\n },\n scales: {\n yAxes: [{\n display: true,\n ticks: {\n min: 0,\n // callback: (value, index, values) => {\n // return value + \" Bytes/s\";\n // }\n },\n gridLines: {\n display: true,\n },\n }],\n xAxes: [{\n gridLines: {\n display: true,\n },\n display: true,\n }],\n },\n legend: {\n display: true,\n position: \"bottom\"\n },\n }\n });\n}", "_showChart() {\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n\n // destroy existing chart if any\n this._destroyChart();\n\n // create and show the chart\n try {\n // get chart constructor options from properties and create the chart\n // TODO: tooltip as property\n const supportedProps = ['type', 'datasets', 'series', 'overrides', 'legend', 'style'];\n const props = this.getProperties(supportedProps);\n const definition = this.getWithDefault('definition', {});\n\n // Iterate over properties\n for (let prop in props) {\n // if the value contained in the prop is not undefined\n if (props.hasOwnProperty(prop) && props[prop] !== undefined) {\n // override the definition val with the prop val\n definition[prop] = props[prop];\n }\n }\n if (Object.keys(definition).length === 0) {\n // no properties have been set\n return;\n }\n\n // create the chart and attach it to the dom\n this.chart = new Chart(this.elementId, definition);\n\n // TODO: events aren't supported yet\n // wire up event handlers\n // const supportedEvents = ['Click', 'Mouseover', 'Mouseout', 'Mousemove', 'UpdateStart', 'UpdateEnd'];\n // supportedEvents.forEach(eventName => {\n // const attrName = `on${eventName}`;\n // if (typeof this[attrName] === 'function') {\n // const cedarEventName = eventName.toLowerCase().replace('update', 'update-');\n // this.chart.on(cedarEventName, this[attrName]);\n // }\n // });\n\n // TODO: show options aren't supported yet (are they even needed?)\n // get render options from properties but use elementId from component\n // const options = this.get('options') || {};\n // options.elementId = '#' + this.elementId;\n\n // autolabels will throw an error on pie charts\n // see https://github.com/Esri/cedar/issues/173\n // if (this.chart.type === 'pie') {\n // options.autolabels = false;\n // }\n } catch (err) {\n // an error occurred while creating the cart\n this._handleErr(err);\n return;\n }\n\n // ensure cedar dependencies are loaded before rendering the chart\n this.get('cedarLoader').loadDependencies().then(() => {\n if (this.get('isDestroyed') || this.get('isDestroying')) {\n return;\n }\n // call update start action (if any)\n const onUpdateStart = this.onUpdateStart;\n if (typeof onUpdateStart === 'function') {\n this.onUpdateStart()\n }\n // query the data and show the chart\n const timeout = this.get('timeout');\n let queryPromise;\n if (timeout) {\n // reject if the query results don't return before the timeout\n const timeoutPromise = rejectAfter(timeout, this.get('timeoutErrorMessage'));\n queryPromise = Promise.race([timeoutPromise, this.chart.query()]);\n } else {\n queryPromise = this.chart.query();\n }\n return queryPromise.then(response => {\n if (this.get('isDestroyed') || this.get('isDestroying')) {\n return;\n }\n const transform = this.get('transform');\n if (typeof transform === 'function') {\n // call transform closure action on each response\n for (const datasetName in response) {\n if (response.hasOwnProperty(datasetName)) {\n const dataset = this.chart.dataset(datasetName);\n response[datasetName] = transform(response[datasetName], dataset);\n }\n }\n }\n // render the chart\n this.chart.updateData(response).render();\n // call update end action (if any)\n const onUpdateEnd = this.onUpdateEnd;\n if (typeof onUpdateEnd === 'function') {\n onUpdateEnd(this.chart);\n }\n });\n }).catch(err => {\n // an error occurred while loading dependencies\n // or fetching, transforming or rendering data\n this._handleErr(err);\n });\n }", "function barChartData(){\n barChartConfig = {\n\ttype: 'bar',\n\n\tdata: {\n\t\tlabels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n\t\tdatasets: [{\n\t\t\tlabel: 'Orders',\n\t\t\tbackgroundColor: window.chartColors.green,\n\t\t\tborderColor: window.chartColors.green,\n\t\t\tborderWidth: 1,\n\t\t\tmaxBarThickness: 16,\n\t\t\t\n\t\t\tdata: [\n\t\t\t\tview2[0],\n\t\t\t\tview2[1],\n\t\t\t\tview2[2],\n\t\t\t\tview2[3],\n\t\t\t\tview2[4],\n\t\t\t\tview2[5],\n\t\t\t\tview2[6]\n\t\t\t]\n\t\t}]\n\t},\n\toptions: {\n\t\tresponsive: true,\n\t\taspectRatio: 1.5,\n\t\tlegend: {\n\t\t\tposition: 'bottom',\n\t\t\talign: 'end',\n\t\t},\n\t\ttitle: {\n\t\t\tdisplay: true,\n\t\t\ttext: 'View Bar'\n\t\t},\n\t\ttooltips: {\n\t\t\tmode: 'index',\n\t\t\tintersect: false,\n\t\t\ttitleMarginBottom: 10,\n\t\t\tbodySpacing: 10,\n\t\t\txPadding: 16,\n\t\t\tyPadding: 16,\n\t\t\tborderColor: window.chartColors.border,\n\t\t\tborderWidth: 1,\n\t\t\tbackgroundColor: '#fff',\n\t\t\tbodyFontColor: window.chartColors.text,\n\t\t\ttitleFontColor: window.chartColors.text,\n\n\t\t},\n\t\tscales: {\n\t\t\txAxes: [{\n\t\t\t\tdisplay: true,\n\t\t\t\tgridLines: {\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t\tcolor: window.chartColors.border,\n\t\t\t\t},\n\n\t\t\t}],\n\t\t\tyAxes: [{\n\t\t\t\tdisplay: true,\n\t\t\t\tgridLines: {\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t\tcolor: window.chartColors.borders,\n\t\t\t\t},\n\n\t\t\t\t\n\t\t\t}]\n\t\t}\n\t\t\n\t}\n}\n}", "function renderChart (confirmed, recovered, deaths){\n\tvar chartType = $(\"#chart-type option:selected\" ).text();\n\t\n\t\t\n\tvar barChartData ={\n\t\ttype: chartType, //bar, horizontalBar, pie, line, donut, radar, polarArea , doughnut\n\t\tdata: {\n\t\tlabels: labels,\n\t\tdatasets: [{\n\t\t\tdata: [confirmed, recovered, deaths ],\n\t\t\tbackgroundColor: [\"blue\" , \"green\", \"red\"],\n\t\t\tborderColor: [\"black\" , \"black\" , \"black\" ],\n\t\t\tborderWidth: 1.5,\n\t\t\thoverOffset: 4,\n\t\t\tlabel: 'Confirmed',\n\t\t\t}]\n\t\t\t\t \n\t\t},\n\t\t\t//Configutation options\n\t\t\toptions: {\t\t\t\t\t\n\t\t\t\t\tlegend: {\t\t\t\t\t\t\n\t\t\t\t\t\tdisplay: true,\n\t\t\t\t\t\tposition:'right',\t\n\t\t\t\t\t\tpadding:500,\t\t\t\t\t\t\n\t\t\t\t\t\tlabels:{\n\t\t\t\t\t\t\tcolor: 'rgb(255, 99, 132)',\n\t\t\t\t\t\t\tfont : {size:24},\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tsubtitle: {\n\t\t\t\t\t\tdisplay: false,\n\t\t\t\t\t\ttext: 'Confirmed Recovered Deaths '\n\t\t\t\t\t},\n\t\t\t\t\tanimation : {\n\t\t\t\t\t\tonComplete : downloadChart()\n\t\t\t\t\t},\n\t\t\t\t\tscales: {\n\t\t\t\t\t\tyAxes: [{\n\t\t\t\t\t\t ticks: {\n\t\t\t\t\t\t\tbeginAtZero: true\n\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 title: {\n\t\t\t\t\t\tdisplay: true,\n\t\t\t\t\t\ttext: 'COVID-19 API'\n\t\t\t\t\t},\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t};\n\tvar myChart = document.getElementById('myChart').getContext('2d');\t\n\tcovidDataChart = new Chart(myChart, barChartData);\t\n\t\n\n\tif( chartType == \"pie\" || chartType ==\"doughnut\" || chartType ==\"polarArea\" ){\n\t\tcovidDataChart.canvas.parentNode.style.height = '550px';\n\t\tcovidDataChart.canvas.parentNode.style.width = '550px';\n\t}\n\n\tif( chartType == \"bar\" ){\n\t\tcovidDataChart.canvas.parentNode.style.height = '700px';\n\t\tcovidDataChart.canvas.parentNode.style.width = '700px';\n\t}\n}", "start() {\n this.canvas = document.querySelector(\"#temp_widget\").getContext(\"2d\");\n let highs = this.getValues(this.temps).highsArray;\n let lows = this.getValues(this.temps).lowsArray;\n // console.log(this.getLabels());\n\n this.chart = new Chart(this.canvas, {\n // The type of chart we want to create\n type: 'line',\n\n // The data for our dataset\n data: {\n labels: this.getLabels(),\n datasets: [{\n label: 'Highs',\n fill: false,\n backgroundColor: '#F8444E',\n borderColor: '#F8444E',\n data: highs,\n yAxisId: \"temps\"\n },\n {\n label: 'Lows',\n fill: false,\n backgroundColor: '#FFEBDB',\n borderColor: '#FFEBDB',\n data: lows,\n yAxisId: \"temps\"\n }\n ]\n },\n // Configuration options go here\n options: {\n tooltips: {\n enabled: true,\n mode: 'single',\n },\n scales: {\n yAxes: [{\n id: 'temps',\n type: 'linear',\n position: 'left',\n ticks: {\n // Include a '°C' before the ticks\n callback: function(value, index, values) {\n return value + \"°C\";\n }\n }\n }]\n }\n }\n });\n }", "makeChart() {\n setTimeout(() => {\n this.chart = this._renderChart();\n }, 100);\n }", "function renderPlotsType1() {\n\n new Chart(document.getElementById(\"line-chart\"), {\n type: 'line',\n data: {\n labels: [1500,1600,1700,1750,1800,1850,1900,1950,1999,2050],\n datasets: [{ \n data: [86,114,106,106,107,111,133,221,783,2478],\n label: \"Africa\",\n borderColor: \"#3e95cd\",\n fill: false\n }\n ]\n },\n options: {\n title: {\n display: true,\n text: 'World population per region (in millions)'\n }\n }\n})\n}", "async function renderGraph(){\n var config = {\n type: 'line',\n data: {\n labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n datasets: [{\n label: '',\n backgroundColor: \"rgba(240, 114, 41, 0.2)\",\n borderColor: \"rgba(240, 114, 41, 1)\",\n data: [\n await getFromStorage(\"month_january_count\", 0),\n await getFromStorage(\"month_february_count\", 0),\n await getFromStorage(\"month_march_count\", 0),\n await getFromStorage(\"month_april_count\", 0),\n await getFromStorage(\"month_may_count\", 0),\n await getFromStorage(\"month_june_count\", 0),\n await getFromStorage(\"month_july_count\", 0),\n await getFromStorage(\"month_august_count\", 0),\n await getFromStorage(\"month_september_count\", 0),\n await getFromStorage(\"month_october_count\", 0),\n await getFromStorage(\"month_november_count\", 0),\n await getFromStorage(\"month_december_count\", 0)\n ],\n fill: true,\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n title: {\n display: false,\n },\n tooltips: {\n mode: 'index',\n intersect: false,\n },\n hover: {\n mode: 'nearest',\n intersect: true\n },\n scales: {\n xAxes: [{\n display: false,\n scaleLabel: {\n display: false,\n labelString: 'Month'\n }\n }],\n yAxes: [{\n display: false,\n scaleLabel: {\n display: false,\n },\n ticks: {\n padding: 10,\n },\n }]\n },\n legend: { \n display: false \n },\n elements: {\n point:{\n radius: 0\n }\n },\n layout: {\n padding: {\n left: 0,\n right: 0,\n top: 5,\n bottom: 2\n }\n }\n }\n };\n\n var ctx = document.getElementById('canvas').getContext('2d');\n ctx.height = 90;\n window.myLine = new Chart(ctx, config);\n}", "function chartOps() {\n const mainChartOpts = {\n tooltips: {\n enabled: false,\n custom: CustomTooltips,\n intersect: true,\n mode: 'index',\n position: 'nearest',\n callbacks: {\n labelColor: function(tooltipItem, chart) {\n return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor }\n }\n }\n },\n maintainAspectRatio: false,\n legend: {\n display: false,\n },\n scales: {\n xAxes: [\n {\n gridLines: {\n drawOnChartArea: false,\n },\n }],\n yAxes: [\n {\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n stepSize: Math.ceil(250 / 5),\n max: 250,\n },\n }],\n },\n elements: {\n point: {\n radius: 0,\n hitRadius: 10,\n hoverRadius: 4,\n hoverBorderWidth: 3,\n },\n },\n };\n return mainChartOpts;\n}", "function initProcessesByStateChart() {\n const ctx = document.getElementById(\"processesByStateChart\");\n return new Chart(ctx, {\n type: 'doughnut',\n data: {\n labels: [\"Running\", \"Sleeping\", \"Blocked\", \"Unknown\"],\n datasets: [{\n data: [0, 0, 0, 0],\n backgroundColor: [colors.success, colors.danger, colors.warning, colors.secondary],\n }],\n },\n options: {\n // title: {\n // text: \"Processes By State\".toUpperCase(),\n // display: true,\n // fontSize: 20,\n // fontStyle: \"normal\",\n // fontColor: \"black\",\n // },\n scales: {\n yAxes: [{\n display: false,\n // ticks: {\n // min: 0,\n // max: 100,\n // }\n }]\n },\n legend: {\n display: true,\n position: \"bottom\"\n },\n }\n });\n}", "function cryptic_line_chart() {\n var config = {\n type: 'line',\n data: {\n labels: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.red,\n backgroundColor: window.chartColors.red,\n data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]\n }, {\n label: \"Litecoin \",\n fill: false,\n borderColor: window.chartColors.blue,\n backgroundColor: window.chartColors.blue,\n data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]\n }]\n },\n options: {\n title: {\n display: true,\n text: \"Currecies Line Chart\"\n }\n }\n };\n window.onload = function() {\n var ctx = document.getElementById(\"line_chart\").getContext(\"2d\");\n window.myLine = new Chart(ctx, config);\n };\n}", "createChartData() {\n /**\n * entities : all entities data and options\n * entityOptions : global entities options\n */\n if (!this.entity_items.isValid()) return null\n // const _data = this.entity_items.getData()\n\n const _data = this.entity_items.getChartLabelAndData()\n\n if (_data.length === 0) {\n console.error(\"Create Chart Data, no Data present !\")\n return null\n }\n\n let _defaultDatasetConfig = {\n mode: \"current\",\n unit: \"\"\n }\n\n let _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"simple\"\n\n /**\n * merge entity options\n */\n if (this.entity_options) {\n _defaultDatasetConfig = {\n ..._defaultDatasetConfig,\n ...this.entity_options\n }\n }\n\n /**\n * merge dataset_config\n * all entity labels\n * add dataset entities\n */\n _graphData.data.labels = _data.labels //this.entity_items.getNames()\n _graphData.data.datasets[0] = _defaultDatasetConfig\n _graphData.data.datasets[0].label = this.card_config.title || \"\"\n /**\n * add the unit\n */\n if (this.entity_options && this.entity_options.unit) {\n _graphData.data.datasets[0].unit = this.entity_options.unit || \"\"\n } else {\n _graphData.data.datasets[0].units = this.entity_items.getEntitieslist().map((item) => item.unit)\n }\n\n /**\n * case horizontal bar\n */\n\n if (this.card_config.chart.isChartType(\"horizontalbar\")) {\n _graphData.data.datasets[0].indexAxis = \"y\"\n }\n\n /**\n * custom colors from the entities\n */\n let entityColors = _data.colors //this.entity_items.getColors()\n\n if (this.entity_options && this.entity_options.gradient != undefined) {\n _graphData.config.gradient = true\n }\n\n if (entityColors.length === _graphData.data.labels.length) {\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].showLine = false\n } else {\n if (this.card_config.chart.isChartType(\"radar\")) {\n _graphData.data.datasets[0].backgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderWidth = 1\n _graphData.data.datasets[0].pointBorderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].pointBackgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].tooltip = true\n _graphData.config.gradient = false\n } else {\n /**\n * get backgroundcolor from DEFAULT_COLORS\n */\n entityColors = DEFAULT_COLORS.slice(1, _data.data.length + 1)\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].borderWidth = 0\n _graphData.data.datasets[0].showLine = false\n }\n }\n _graphData.data.datasets[0].data = _data.data\n _graphData.config.segmentbar = false\n\n /**\n * add the data series and return the new graph data\n */\n if (this.card_config.chart.isChartType(\"bar\") && this.card_config.chartOptions && this.card_config.chartOptions.segmented) {\n const newData = this.createSimpleBarSegmentedData(_graphData.data.datasets[0])\n if (newData) {\n _graphData.data.datasets[1] = {}\n _graphData.data.datasets[1].data = newData.data\n _graphData.data.datasets[1].tooltip = false\n _graphData.data.datasets[1].backgroundColor = newData.backgroundColors\n _graphData.data.datasets[1].borderWidth = 0\n _graphData.data.datasets[1].showLine = false\n _graphData.config.segmentbar = newData.data.length !== 0\n }\n }\n return _graphData\n }" ]
[ "0.70855707", "0.700121", "0.69221365", "0.6788588", "0.67832", "0.67777795", "0.676865", "0.6755704", "0.6742473", "0.67413217", "0.67340744", "0.6711278", "0.670268", "0.67015827", "0.669669", "0.66966295", "0.6685293", "0.66786045", "0.6661944", "0.6650581", "0.66422", "0.6634737", "0.6628027", "0.6608331", "0.6589195", "0.65724707", "0.65538055", "0.6541979", "0.654161", "0.6531221", "0.65284467", "0.6527866", "0.64963067", "0.64899105", "0.6469032", "0.6464747", "0.64552355", "0.64508486", "0.6442345", "0.643867", "0.64267963", "0.64220196", "0.64213467", "0.6416789", "0.6412783", "0.64064", "0.6405692", "0.6399362", "0.6394513", "0.63908744", "0.6390333", "0.6389648", "0.63755655", "0.6371523", "0.6371107", "0.6369184", "0.63680446", "0.63630843", "0.63626224", "0.6352033", "0.6350933", "0.6350621", "0.63428056", "0.63381934", "0.6333066", "0.63326997", "0.6332172", "0.6316692", "0.6312422", "0.63122946", "0.6303831", "0.6302614", "0.6295287", "0.6287482", "0.6282835", "0.62818885", "0.627288", "0.62651855", "0.62649107", "0.62587", "0.62570065", "0.62527245", "0.6250838", "0.6248426", "0.6245724", "0.6238894", "0.6237134", "0.6236744", "0.62366396", "0.6230375", "0.6229954", "0.62243843", "0.62235636", "0.6222575", "0.62220645", "0.6219622", "0.6214919", "0.620605", "0.6203968", "0.62022305", "0.6198641" ]
0.0
-1
End of button assignment Start of numbers logic
function calcNumbers (num) { if (calcState.numFlag) { output.innerHTML = num; calcState.numFlag = false; return; } if (output.innerHTML === '0' && num === '.') { output.innerHTML = output.innerHTML + num; return; } if (output.innerHTML === '0') { output.innerHTML = num; return; } output.innerHTML = output.innerHTML + num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function button1Clicked()\n{\n if (powerState == 1)\n {\n batteryCheck()\n console.log(\"number button 1 pressed\")\n \n if (operatorClicked == false && number1.length <= 8)\n {\n number1 += 1; \n document.getElementById(\"screenTextBottom\").textContent = number1;\n }\n\n else if (operatorClicked == true && number2.length <= 8)\n {\n number2 += 1; \n document.getElementById(\"screenTextBottom\").textContent = number2;\n }\n\n }\n}", "function numberButtons(input) {\n // 1) Check if equal button was just clicked\n if (operationArray.length == 3) {\n // if so clear\n display.textContent = 0;\n topLine.textContent = \"\";\n outputNum = \"\";\n operationArray = [];\n storedOperator = \"\";\n decimalBtn.disabled = false;\n\n // and add first number to output\n outputNum += input;\n display.textContent = outputNum;\n disableDecimal(outputNum);\n\n // 2) Check if calculation is ongoing...\n } else if (storedOperator != \"\") {\n \n console.log(outputNum);\n\n // on first click...\n if (topLine.textContent == \"\") {\n // add calculated number and stored operator to topline\n topLine.textContent = `${outputNum} ${storedOperator}`;\n \n // reset input counter\n outputNum = \"\";\n }\n\n // grow input number until operator is selected\n outputNum += input;\n display.textContent = outputNum;\n disableDecimal(outputNum);\n\n // 3) Otherwise begin entering number...\n } else {\n // grow input number until operator is selected\n outputNum += input;\n display.textContent = outputNum;\n disableDecimal(outputNum);\n }\n}", "function numberPressed() {\n\n //all of my values that I am getting from the button pressing I am storing in an array (inputs[]).\n //the variable totalInt1 is used as a snapshot of what the current index in the array is at that time.\n if($(this).text() == '.'){\n if(inputs[i].includes(\".\")){\n return;\n }\n }\n if(num1 == null) {\n var val = $(this).text();\n inputs[i] += val;\n totalInt1 = inputs[i];\n $(\"#displayScreen p\").text(totalInt1);\n }\n else if(num1 != null && num2 !=null){\n var ogOperator = inputs[inputs.length-3];\n num1 = doMath(num1 , num2 , ogOperator);\n num2 = null;\n ++i;\n ogOperator = operator;\n }\n else if(num2 == null) {\n var val = $(this).text();\n if(inputs[i] == null){\n inputs[i] = \"\";\n }\n inputs[i] += val;\n totalInt2 = inputs[i];\n $(\"#displayScreen p\").text(totalInt2);\n }\n equalFire = false;\n}", "function updateStart() {\n\n\tpush();\n\t\ttranslate(screen.w/2,screen.h/2-cellwidth);\n\t\tfill(TEXTCOLOR);\n\t\tnoStroke();\n\t\ttextSize(cellwidth/2);\n\t\ttextAlign(CENTER,CENTER);\n\t\ttext(\"Enter your bingo numbers below\\n(1 to \" + highestNumber + \")\",0,0);\n\tpop();\n\tpush();\n\t\tfill(BUTTONCOLOR);\n\t\ttranslate(screen.w-cellwidth,screen.h-cellwidth/2-cellwidth/4);\n\t\trect(-cellwidth/2,-cellwidth/4,cellwidth,cellwidth/2,5,5);\n\t\tfill(BUTTONTEXTCOLOR);\n\t\ttextSize(cellwidth/4);\n\t\ttextAlign(CENTER,CENTER);\n\t\ttext(\"START\",0,0);\n\tpop();\n\tpush();\n\t\tfill(BUTTONCOLOR);\n\t\ttranslate(screen.w-cellwidth,screen.h-cellwidth-cellwidth/2);\n\t\trect(-cellwidth/2,-cellwidth/4,cellwidth,cellwidth/2,5,5);\n\t\tfill(BUTTONTEXTCOLOR);\n\t\ttextSize(cellwidth/4);\n\t\ttextAlign(CENTER,CENTER);\n\t\ttext(\"RAN\",0,0);\n\tpop();\n\tgrid.drawAll();\n\n}", "function Continue(){\n operatorCheck = false;\n displayCheck = false;\n equalButton = true;\n displayNumbers.pop();\n displayNumbers[0] = display.textContent;\n}", "function ButtonClick(btn) {\n\n var num = 0;\n var isNum = false;\n var isOperation = false;\n var isEqual = false;\n var isClear = false;\n var isSign = false;\n\n /*\n Check the button type:\n -Clear\n -Number\n -Operation\n */\n switch (btn) {\n case \"BtnClear\":\n case \"BtnDel\":\n isClear = true;\n break;\n case \"BtnDot\":\n num = \".\";\n isNum = true;\n break;\n case \"BtnSign\":\n isSign = true;\n break;\n case \"BtnOne\":\n num = 1;\n isNum = true;\n break;\n case \"BtnTwo\":\n num = 2;\n isNum = true;\n break;\n case \"BtnThree\":\n num = 3;\n isNum = true;\n break;\n case \"BtnFour\":\n num = 4;\n isNum = true;\n break;\n case \"BtnFive\":\n num = 5;\n isNum = true;\n break;\n case \"BtnSix\":\n num = 6;\n isNum = true;\n break;\n case \"BtnSeven\":\n num = 7;\n isNum = true;\n break;\n case \"BtnEight\":\n num = 8;\n isNum = true;\n break;\n case \"BtnNine\":\n num = 9;\n isNum = true;\n break;\n case \"BtnZero\":\n num = 0;\n isNum = true;\n break;\n\n case \"BtnDivide\":\n operation = \"/\";\n isOperation = true;\n break;\n case \"BtnTimes\":\n operation = \"*\";\n isOperation = true;\n break;\n case \"BtnMinus\":\n operation = \"-\";\n isOperation = true;\n break;\n case \"BtnPlus\":\n operation = \"+\";\n isOperation = true;\n break;\n\n case \"BtnEqual\":\n isEqual = true;\n break;\n\n }\n\n if (isNum) {\n if (numDisplay1 == \"\" || isDone) {\n debugger;\n if (num == '.' && numString1.includes(\".\")) {\n \n } else {\n //Display first number\n numString1 = numString1 + num;\n document.getElementById(\"rowOne\").innerHTML = numString1;\n }\n } else {\n if (num == '.' && numString2.includes(\".\")) {} else\n\n {\n //Display second number\n numString2 = numString2 + num;\n document.getElementById(\"rowOne\").innerHTML = numString2\n }\n }\n isDone = false;\n } else if (isOperation) {\n if (numDisplay1 == \"\" && numString1 == \"\") {\n //Display number 0 and Operator in first line\n numDisplay1 = 0 + \" \" + operation;\n operationFinal = operation;\n document.getElementById(\"rowTwo\").innerHTML = numDisplay1;\n document.getElementById(\"rowOne\").innerHTML = \"\";\n } else if (numDisplay1 == \"\" || (numString1 != \"\" && numString2 == \"\" && hasOperation)) {\n //Display number and Operator in first line\n numDisplay1 = numString1 + \" \" + operation;\n document.getElementById(\"rowTwo\").innerHTML = numDisplay1;\n document.getElementById(\"rowOne\").innerHTML = \"\";\n hasOperation = true;\n operationFinal = operation;\n } else {\n //Perform operation and display result in first line then add new operation\n var result\n switch (operationFinal) {\n case \"+\":\n result = Number(numString1) + Number(numString2);\n break;\n case \"/\":\n result = Number(numString1) / Number(numString2);\n break;\n case \"-\":\n result = Number(numString1) - Number(numString2);\n break;\n case \"*\":\n result = Number(numString1) * Number(numString2);\n break;\n }\n\n operationFinal = operation;\n\n document.getElementById(\"rowTwo\").innerHTML = result + \" \" + operationFinal;\n document.getElementById(\"rowOne\").innerHTML = \"\";\n numString1 = result;\n numDisplay1 = result + \" \" + operationFinal;\n numString2 = \"\";\n numDisplay2 = \"\";\n isDone = false;\n\n }\n\n isDone = false;\n\n } else if (isClear) {\n if (btn == \"BtnClear\") {\n //Perform clear all\n document.getElementById(\"rowTwo\").innerHTML = \"\";\n document.getElementById(\"rowOne\").innerHTML = \"\";\n numString1 = \"\";\n numDisplay1 = \"\";\n numString2 = \"\";\n numDisplay2 = \"\";\n operation = \"\";\n operationFinal = \"\";\n isDone = false;\n } else {\n //Delete last digit of the number on first line.\n if (numString1 != \"\" && numString2 == \"\") {\n numString1 = deleteLast(numString1);\n document.getElementById(\"rowOne\").innerHTML = numString1;\n } else if (numString2 != \"\") {\n numString2 = deleteLast(numString2);\n document.getElementById(\"rowOne\").innerHTML = numString2;\n }\n }\n\n } else if (isSign) {\n //Perform change of positive to negative or vise versa\n if (numString1 != \"\" && numString2 == \"\") {\n numString1 = isNegative(numString1);\n document.getElementById(\"rowOne\").innerHTML = numString1;\n } else if (numString2 != \"\") {\n numString2 = isNegative(numString2);\n document.getElementById(\"rowOne\").innerHTML = numString2;\n }\n } else {\n if (numString1 != \"\" && numString2 != \"\") {\n //Perform operation to 2 numbers\n switch (operationFinal) {\n case \"+\":\n result = Number(numString1) + Number(numString2);\n break;\n case \"/\":\n result = Number(numString1) / Number(numString2);\n break;\n case \"-\":\n result = Number(numString1) - Number(numString2);\n break;\n case \"*\":\n result = Number(numString1) * Number(numString2);\n break;\n }\n\n document.getElementById(\"rowTwo\").innerHTML = \"\";\n document.getElementById(\"rowOne\").innerHTML = result;\n\n numDisplay1 = \"\";\n numString1 = result.toString();\n numDisplay2 = \"\";\n numString2 = \"\";\n operationFinal = \"\";\n operation = \"\";\n hasOperation = false;\n isDone = true;\n } else {\n //No Operation\n document.getElementById(\"rowTwo\").innerHTML = \"\";\n document.getElementById(\"rowOne\").innerHTML = numString1;\n }\n\n }\n\n //Function for changing from positive to negative or vice versa\n function isNegative(numStr) {\n isNegative = numStr.startsWith(\"-\");\n if (isNegative) {\n numStr = numStr.substring(1);\n } else {\n numStr = \"-\" + numStr;\n }\n return numStr;\n }\n\n //Function fo remove last number\n function deleteLast(numStr) {\n\n if (numStr.length == 1) {\n return \"\";\n } else {\n numStr = numStr.slice(0, -1);\n return numStr;\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 equal_button_clicked() {\n operate(current_operation, previous_number, display);\n current_operation = \"\";\n operator_pressed = false;\n}", "function next_button(number){\r\n show(number);\r\n sound_color(setOf[number]);\r\n\r\n}", "function ceClicked(){\n\t$display.val('');\n\tneedNewNum = true;\n\tnumEntered = false;\n}", "function processButtonClick() {\n let buttonValue = this.innerText\n // check if decimal is being used AND is enabled\n if (buttonValue === \".\" && !decimalEnabled) {\n console.log('cannot use decimal again');\n return;\n }\n // check which variable we are working on AND\n // concatenate calculator data to correct variable\n if (isFirstNumSet) {;\n num2 += buttonValue;\n }\n else {\n num1 += buttonValue;\n }\n // display data on the DOM calculator display\n updateCalculatorDisplay();\n}", "function onNumberButtonClicked(value)\n {\n if(!hasPressedOperator)\n {\n //They've pressed a button, and they haven't pressed an operator yet.. so this is the left number.\n //..\n \n //If they've just pressed the equals symbol, overwrite the number that is in the display.\n if(hasPressedEquals)\n runningTotal = parseInt(value);\n \n //Otherwise, append the number to the running total as a string, and convert back to an int.\n //e.g. int(\"1\" + \"2\") = 12.\n else\n runningTotal = parseInt(runningTotal + value);\n }\n else\n {\n //They've pressed a button, and an operator hasn't been pressed yet.. so this is the right number.\n //..\n \n //If it's 0, overwrite the total with the value that was pressed.\n if(currentOperand == 0)\n currentOperand = value;\n \n //Otherwise, append the number and cast back to an int.\n else\n currentOperand = parseInt(currentOperand + value);\n\n //And this is the right hand number which has been pressed, so they have given an operand!\n hasPressedOperand = true;\n }\n \n hasPressedEquals = false;\n \n //Finally, update the display to show the new changes.\n updateDisplay();\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 main(e) {\n if (e.target.matches('#resetbtn')) {\n counter = startpointin.value;\n if (counter === '') counter = 0;\n }\n else {\n e.preventDefault();\n startpointin.blur();\n resetbtn.blur();\n if (e.target.matches('#modebtn')) {\n mode++;\n if (mode === 2) {\n minusdiv.classList.remove('none');\n plusdiv.classList.remove('none');\n }\n else {\n minusdiv.classList.add('none');\n plusdiv.classList.add('none');\n }\n if (mode > 2) mode = 0;\n modebtn.textContent = modes[mode];\n }\n else if (e.target.matches('#startpointin')) {\n startpointin.focus(); //yes, this is a weird-ass way to do it.\n }\n else {\n //for some reason counts on touchstart and touchend without this\n if (mode === 0) counter++; //up\n else if (mode === 1) counter--; //down\n else if (mode === 2) { //up/down\n let clientY = e.type.includes('touch') ? e.touches[0].clientY : e.clientY;\n let clientX = e.type.includes('touch') ? e.touches[0].clientX : e.clientX;\n if (window.innerHeight > window.innerWidth) { //portrait\n clientY <= window.innerHeight/2 ? counter++ : counter--;\n }\n else { //landscape and square\n clientX <= window.innerWidth/2 ? counter-- : counter++;\n }\n }\n }\n }\n number.textContent = counter;\n}", "function NumRecButtons_setValue(numRecs)\r\n{ /*\r\n if (numRecs == \"all\")\r\n {\r\n this.updateUI(\"allButton\");\r\n }\r\n else if (numRecs && (parseInt(numRecs) == numRecs) && (numRecs > -1))\r\n {\r\n this.updateUI(\"countButton\");\r\n this.textFieldObj.value = numRecs;\r\n this.updateUI(\"numRecField\");\r\n }*/\r\n}", "function displayOnScreen() {\n $('.number-button').click(function() {\n\n if ($(this).val() == 0) {\n if (currentNum === 0 && storedNum == 0) {\n return null;\n };\n };\n\n if (currentSetting === 2) {\n\n currentNum = 0;\n storedNum = 0;\n currentSetting = 0;\n };\n\n if (currentNum === 0) {\n currentNum = $(this).val();\n } else {\n currentNum += $(this).val();\n };\n\n if (currentNum.length >= 11) {\n currentNum = currentNum.slice(0, 11)\n };\n\n screen.textContent = currentNum;\n currentIterator = currentNum;\n clickCounter = 0;\n });\n }", "function number(a){\n if(end){\n calc.input.value+=a;\n } else {\n reset();\n calc.input.value+= a;\n }\n}", "function acClicked(){\n\tfirstMemory = 0;\n\tsecondMemory = 0;\n\tshowOnDisplay('');\n\tneedNewNum = true;\n\tchain = false;\n\tnumEntered = false;\n}", "function operatorPressed(){\n if(num1 == this){\n return;\n }\n if(num1 == null){\n ++i;\n num1 = totalInt1;\n }\n if(num2 == null) {\n num2 = totalInt2;\n var val = $(this).text();\n inputs.push(val);\n $(\"#displayScreen p\").text(val);\n ++i;\n // inputs[i] = val;\n }else{\n var val = $(this).text();\n inputs.push(val);\n $(\"#displayScreen p\").text(val);\n\n }\n if(inputs[0] == \"\"){\n inputs = [\"\"];\n i = 0;\n return;\n }\n operator = $(this).text();\n}", "function finalFrame(curr, currVal, prevVal){\n var tenthFirstRoll = parseInt($('#1').text(), 10);\n if(curr.attr(\"id\") == \"3\") {\n if (currVal + prevVal == 10 || currVal + prevVal == 20 || tenthFirstRoll == 10) {\n return true;\n } else {\n curr.text(null);\n return false;\n }\n } else {\n return true;\n }\n }", "function handleNumbers(event){\n var clickedNum = event.target.innerHTML;\n\n if (calculated === true && operating === false){\n outPut.innerHTML = \"Press an operator to continue calculating\"\n }\n else if (calculated === false && operating === false ){\n if (num1 === 0){\n num1 = clickedNum;\n } else {\n num1 += clickedNum;\n }\n outPut.innerHTML = num1;\n }\n else if (calculated === false && operating === true ){\n if (num2 === 0){\n num2 = clickedNum;\n } else {\n num2 += clickedNum;\n }\n outPut.innerHTML = num2;\n } else {\n outPut.innerHTML = \"Error. Press '=' to continue, or Clear.\"\n }\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}", "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 clearEntry() {\r\r\n if (lastButton === \"num\") {\r\r\n currentNum = \"\";\r\r\n $(\".viewport\").html(currentNum);\r\r\n lastButton = \"\";\r\r\n isPercentage = false;\r\r\n isDecimal = false;\r\r\n }\r\r\n}", "function operations(idbutton) {\n $(idbutton).click(() => {\n contpoint = 0;\n console.log($(idbutton).attr('id'));\n if($(idbutton).attr('id') == 'minus') {\n //Manejo del boton menos para diferenciar entre negativo y menos\n if(entry.val() == \"\") {\n entry.val(\"-\");\n console.log(\"Aqui andamos brother\");\n }\n else {\n console.log(\"Aqui no deberiamos de andar brother\");\n firstoperand = entry.val();\n entry.val(\"\");\n operation.val(firstoperand + idbutton.val());\n operator = idbutton.val();\n }\n } else {\n //Operacion del resto de botones\n firstoperand = entry.val();\n entry.val(\"\");\n operation.val(firstoperand + idbutton.val());\n operator = idbutton.val();\n }\n //Animacion\n $(idbutton).addClass(\"animated pulse\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', () => {\n $(idbutton).removeClass(\"animated pulse\");\n });\n });\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 }", "function buttonHandler(){\n if (expression === 0 || expression === \"0\" || done){\n expression = \"\";\n done = false;\n }\n // get value of clicked button\n var char = $(this).attr(\"value\");\n // add value to expression\n expression += String(char);\n if (expression == \".\"){\n expression = \"0.\";\n }\n drawResult();\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 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 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 button1(button) {\n\tflag = \"0\";\n\tif (document.calc.view.value == \"0\") {\n\t\tdocument.calc.view.value = button;\n\t\tif (document.calc.view.value == \".\") {\n\t\t\tdocument.calc.view.value = document.calc.view.value.replace(\".\",\"0.\");\n\t\t\tflag = \"1\";\n\t\t}\n\t} else {\n\t\tif (flag == \"1\") {\n\t\t\tif (button == \".\") {\n\t\t\t\tbutton = \"\";\n\t\t\t}\n\t\t}\n\t\tif (document.calc.view.value.indexOf(\"√(\") != \"-1\") {\n\t\t\tif (document.calc.view.value[document.calc.view.value.indexOf(\"√(\")-1] != \")\") {\n\t\t\t\tdocument.calc.view.value = document.calc.view.value.replace(/\\s/g,\"\");\n\t\t\t\tdocument.calc.view.value = document.calc.view.value.slice(0,document.calc.view.value.indexOf(\"√(\"));\n\t\t\t\tdocument.calc.view.value += button + \"√(\";\n\t\t\t} else {\n\t\t\t\tbutton2(button);\n\t\t\t}\n\t\t} else {\n\t\t\tbutton2(button);\n\t\t}\n\t}\n\tif (button == \".\") {\n\t\tflag = \"1\";\n\t}\n\telse if (isNaN(button)) {\n\t\tflag = \"0\";\n\t}\n}", "function onOperatorButtonClicked(value)\n {\n //Current value doesn't equal zero and we can do stuff with it\n if(!runningTotal == 0){\n\n switch(value){\n case \"+\":\n //Set operator to clicked button\n currentOperator = \"+\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"-\":\n //Set operator to clicked button\n currentOperator = \"-\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"x\":\n //Set operator to clicked button\n currentOperator = \"*\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"/\":\n //Set operator to clicked button\n currentOperator = \"/\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"=\":\n //Check for a number and operator \n if(hasPressedOperand && hasPressedOperator){ \n //Set it so that we know they have just pressed the equals symbol\n hasPressedEquals = true;\n\n //Check currentOperator\n if(currentOperator == \"+\"){\n runningTotal += parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else if (currentOperator == \"-\"){\n runningTotal -= parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else if (currentOperator == \"*\"){\n runningTotal *= parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else if (currentOperator == \"/\"){\n runningTotal /= parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else {\n // runningTotal /= parseInt(currentOperand);\n }\n } else {\n\n }\n // -------\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}", "get buttonNumber() {\n return this.button + 1;\n }", "function showNumbers () {\n\t\t_this.disable(true);\n\t\tbuttons.reset();\n\t\tfade(yesnos, false);\n\t\tfade(buttons, true).eventCallback('onComplete', _this.disable, false, _this);\n\n\t\tlizard.followPointer(true);\n\t\tif (_this.agent.visible) { _this.agent.eyesFollowPointer(); }\n\t}", "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 start() {\n $(\"button\").hide()\n intervalId = setInterval(decrement, 1000);\n next();\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 onButtonClickEvent(btn){\n var value = btn.dataset.value;\n\n if(value == '='){ // Equals sign\n $('#answer-display').value = calculate.getAnswer();\n }\n else{\n var results = calculate.insert(value);\n\n $('#number-display').value += results.value;\n $('#calc-btn-3-1').disabled = !results.decimalEnabled;\n\n // Set cursor to end\n setCursorToEnd($('#number-display'));\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 pressed(num){\n\tif (num == 1) {\n\t\teensButton.style.background = \"green\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = true;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse if (num == 2) {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"green\";\n\t\thuidig = false;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = null;\n\t\tsubmitButton.style.display = \"none\"\n\t}\n}", "function numPushed(btnInt) {\n btnIntId = btnInt.id;\n if (equalPushed === 'true') {\n return array1 = [],\n equalPushed = 'true';\n } else {\n //Inputs the first number of the equation.\n if (operand === '' || string1 === '') {\n\n //Checks if there is already a decimal point.\n if (btnIntId === '.' && decimal1Pushed === 'true') {\n \n return string1, decimal1Pushed = 'true';\n } else {\n \n array1.push(btnInt.id); \n string1 = array1.join('');\n num1Display();\n\n //Prevents mutliple decimal points.\n if (btnIntId === '.') {\n return string1, decimal1Pushed = 'true';\n } else {\n return string1;\n }} } else {\n\n //Checks if there is already a decimal point.\n if (btnIntId === '.' && decimal2Pushed === 'true') {\n return string1, decimal2Pushed = 'true';\n } else if (operand !='') {\n \n //Inputs the second number of the equation. \n array2.push(btnInt.id);\n string2 = array2.join('');\n num2Display();\n if (btnIntId === '.') {\n return string2, decimal2Pushed = 'true';\n } else {\n return string2; }\n } }}\n}", "function endGame() {\n\tconsole.log(\"endgame\");\n\tgameNumber = Math.floor((Math.random() * 100) + 1);\n\tuserNumber = 0;\n\tallNumbers = [];\n\tallJewels = [];\n\n\tfor (i = 0; i < 4; i++) {\n\t\t\tx = document.getElementById(\"btn\" + i);\n\t\t\tx.id = \"jewel-value\";\n\t\t}\n\n\tgameStart();\n\n}", "function update() {\n if (oldNum == 0) {\n dispLastText.textContent = ``;\n dispCurrentText.textContent = `${newNum}`;\n } else {\n dispLastText.textContent = `${oldNum} ${operator}`;\n dispCurrentText.textContent = `${newNum}`;\n }\n}", "function equalClicked(){\n\tsecondMemory = Number($display.val());\n\tif(operator === \"+\"){\n\t\tfirstMemory = add(firstMemory, secondMemory);\n\t} else if(operator === \"-\"){\n\t\tfirstMemory = substract(firstMemory, secondMemory);\n\t} else if(operator === \"×\"){\n\t\tfirstMemory = multiply(firstMemory, secondMemory);\n\t} else if(operator === \"÷\"){\n\t\tfirstMemory = divide(firstMemory, secondMemory);\t\n\t}\n\tshowOnDisplay(firstMemory);\n\tsecondMemory = 0;\n\tneedNewNum = true;\n\tisThereDot = false;\n\tchain = false;\n\tnumEntered = false;\n}", "function startCount() {\n if(numberValue.value > 1) {\n numberValue.value--;\n } else{\n clearInterval(intervalHandle);\n alert(\"Reset\");\n startUp();\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! <br> You have ' + incorrectPoint + ' incorrect scorrect point! <br> You have ' + unansewerPoint + ' unansewer!<br>');\n // Start over, do not reload the page, just reset the game\n var restbtn = $('<button>');\n restbtn.text('Reset');\n restbtn.attr('class', 'btn btn-secondary btn-block mt-4');\n $('#currQuestion').append(restbtn);\n //click the reset function make variable reset\n $('.btn').on('click', reset);\n}", "NumberButtonSelect(number){\n this.refHolder.getComponent('AudioController').PlayTap();\n console.log(\"number \"+number);\n\n if(this.prevID !== 10){\n\n if(this.inputButs[this.prevID].getComponent(\"InputButScript\").GetValue() !== 0){\n this.numberButs[this.inputButs[this.prevID].getComponent(\"InputButScript\").GetValue()].getComponent(\"NumberButScript\").DeSelectNumber();\n }\n this.inputButs[this.prevID].getComponent(\"InputButScript\").SetValue(number);\n\n }\n\n\n }", "function operatorUsed(operatorButtonPressed)\n{ //first if statement doesn't allow an operator to be pressed without a number pressed first\n if (number1 != \"\")\n \n //switch statement to take the operator button pressed\n //on the calculator and change the operator variable accordingly\n if (number2 == \"\")\n {\n switch(operatorButtonPressed){\n case \"+\":\n operator = \"+\";\n break;\n\n case \"-\":\n operator = \"-\";\n break;\n\n case \"*\":\n operator = \"*\";\n break;\n\n case \"/\":\n operator = \"/\";\n break;\n }\n console.log(\"this is the first section\")\n operatorClicked = true;\n document.getElementById(\"screenTextTop\").textContent = number1 + \" \" + operator + \" \" + number2;\n } \n\n if (number2 != \"\")\n {\n switch(operatorButtonPressed){\n case \"+\":\n operator = \"+\";\n break;\n\n case \"-\":\n operator = \"-\";\n break;\n\n case \"*\":\n operator = \"*\";\n break;\n\n case \"/\":\n operator = \"/\";\n break;\n }\n\n \n console.log(\"this is the second section\")\n number1 = number3;\n number3 = \"\";\n number2 = \"\";\n\n document.getElementById(\"screenTextTop\").textContent = number1 + \" \" + operator + \" \" + number2;\n document.getElementById(\"screenTextBottom\").textContent = \"\"; \n }\n\n \n}", "function minus() {\n _runningTotal += Number.parseInt($scope.previousButton) - Number.parseInt($scope.currentButton);\n }", "function finalCountdown(){\n if (num4===0){\n num4 = 9;\n $(\"#number4\").html(num4);\n if (num3===0){\n num3 = 5;\n $(\"#number3\").html(num3);\n if (num2===0){\n num2 = 9;\n $(\"#number2\").html(num2);\n if (num1===0){\n switchStates(); \n }\n else{\n num1--;\n $(\"#number1\").html(num1);\n }\n }\n else{\n num2 --;\n $(\"#number2\").html(num2);\n }\n }\n else{\n num3 --;\n $(\"#number3\").html(num3);\n } \n }\n else{\n num4--;\n $(\"#number4\").html(num4);\n } \n }", "function control() {\n if (done !== total) {\n document.querySelector(\"#other-buttons .butt\").textContent = \"Next\";\n document.querySelector(\"#answer-buttons\").classList.remove('hide');\n loadNewQuestion();\n } else {\n message = \"You're all done! Thanks for playing!\";\n }\n document.querySelector(\"#other-buttons\").classList.add('hide');\n writeResults();\n}", "function clickButton(e) {\n click++;\n for(let i=0; i<buttonArray.length; i++) {\n if (buttonArray[i].name == e.target.id){\n let tBut = buttonArray[i];\n\n // IS IT RIGHT\n if (tBut == pattern[click-1]){\n tBut.highlight(true);\n } else {\n tBut.highlight(false);\n if (useStrict) {\n gameOver();\n } else {\n showPattern();\n turn() \n }\n }\n \n // Is It End\n if (click == pattern.length && gameOn == true) {\n if(pattern.length >= 5) {\n gameWin();\n }\n console.log(pattern);\n document.getElementById('counter').innerText = pattern.length;\n whoseTurn = \"cpu\";\n turn();\n }\n }\n }\n}", "checkNumber(clickBtnNum) {\n if (clickBtnNum == this.checkCounter) {\n // Clear button color\n this.$set(this.colors, clickBtnNum, BUTTON_SUCCESS);\n this.checkCounter++;\n // Stop the timer when finished\n if (this.checkCounter == 25) {\n this.stopTimer();\n this.isShow = true;\n }\n }\n }", "function reset() {\n\tvar firstNumber, secondNumber, operator = null;\n\tdisplayText(0);\n}", "function reset(){\n\t\t\tnumber1 = Number.MAX_SAFE_INTEGER;\n\t\t\tnumber2 = Number.MAX_SAFE_INTEGER;\n\t\t\topcode=\"\";\n\t\t\tlastPressed=\"\";\n\t\t}", "function checkSecond() {\n //hides button\n button.hide();\n const guess = input.value();\n //this adds the value in a pattern (Not addition)\n var rightNum = num1 + '' + num2 + ''+num3 + '' + num4 + '' + num5 + '' + num6;\n \n if(guess == rightNum)\n {\n playSound.play();\n background(0,255,0);\n\n\tstroke(0);\n\tstrokeWeight(2);\n\tfill('white');\n\trect(50,35, 1050, 100, 20);\n textSize(75);\n fill(0,0,0);\n text('Correct!', 395, 110);\n button = createButton('Next!');\n button.size(100,40);\n button.style(\"font-size\", \"30px\");\n button.position((w2 + 720), (h2 + 400));\n button.mousePressed(screenFive);\n }else\n {\n resetButton();\n \n\tstroke(0);\n\tstrokeWeight(2);\n\tfill('white');\n\trect(50,35, 1050, 100, 20);\n\ttextSize(60);\n\tfill(0,0,0,);\n\ttext('The pattern was '+rightNum, 250, 290);\n \n \tstroke(0);\n\tstrokeWeight(2);\n\tfill('white');\n\trect(50,35, 1050, 100, 20);\n\ttextSize(75); \n\tfill(0,0,0);\n\ttext('INCORRECT!', 325, 110);\n }\n}", "function setValue(number){\n //clears the display if a we alrady solved a problem\n if(equalTo === true){\n clearButton();\n }\n\n //if we haven't used an operator we add the number to the end of num1\n if(flag === false){\n num1 += number;\n display.innerHTML = num1;\n }\n\n else{\n num2 += number;\n display.innerHTML += number;\n }\n\n //stops overflow of numbers onto the screen\n if(num1.length > 10 || num2.length > 10){\n display.innerHTML = \"Max limit of digits reached\"\n alert(\"Stop\")\n }\n}", "function clearButton() {\n display.textContent = 0;\n topLine.textContent = \"\";\n outputNum = \"\";\n operationArray = [];\n storedOperator = \"\";\n decimalBtn.disabled = false;\n}", "function next_button() {\n clear_answer();\n clear_question_result();\n round++;\n document.getElementById(\"submitter\").style.visibility=\"visible\";\n if (is_game_over() === true) {\n final_total();\n } else {\n next_question();\n }\n}", "function clickedDec() {\n if (state.result !== undefined) {\n clear();\n }\n\n if (state.operation === undefined) {\n if (state.operandOne.includes(\".\")) return; // do nothing\n state.operandOne += \".\";\n panel.textContent = state.operandOne;\n } else {\n if (state.operandTwo.includes(\".\")) return; // do nothing\n state.operandTwo += \".\";\n panel.textContent = state.operandTwo;\n }\n }", "function endingScreen(STORE, questionNumber, totalQuestions, score) {\r\n $('.results').on('click', '.restartButton', function (event) {\r\n let questionNumberDisp = 1;\r\n\r\n updateAnswerList(STORE, questionNumber, totalQuestions, questionNumberDisp, score);\r\n\r\n $('.results').css('display', 'none');\r\n $('.quizQuestions').css('display', 'block'); \r\n });\r\n\r\n return questionNumber;\r\n}", "function answerButton(num){\n countPress++;\n consoleController.readAnswer(queNum, num); \n document.querySelector('#btn-' + num).style.display = 'none';\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 setUp() {\n //generate a random number between 1 - 100\n numberToGuess = Math.floor(Math.random() * (100)) + 1;\n //set count to 0\n count = 0;\n //set color of output to white\n txtOutput.setAttribute(\"class\", \"white\");\n //clear all the text from output\n txtOutput.innerText = \"\";\n //clear and focus on the number field\n txtNumber.value = \"\";\n txtNumber.focus();\n //enable button and number field\n btnGuess.setAttribute(\"class\", \"btn\");\n txtNumber.disabled = false;\n btnGuess.disabled = false;\n //focus number box\n txtNumber.focus();\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 handleSymbol(symbol){\n// if(symbol === 'C') {\n// buffer = '0';\n// runningTotal = 0;\n// }instead of doing a bunch of if-else statements for buttons, do switch as below for each case-with break after each switch case\n switch (symbol) {\n case 'C':\n buffer = '0';\n runningTotal = 0;\n break; \n case '=':\n if (previousOperator === null) {\n //so above is user hasn't entered anything yet - so screen is null\n //you need two numbers to do math\n return;\n }\n flushOperation(parseInt(buffer)); //this does the math part of equal\n previousOperator = null; //clear the button out after\n buffer = runningTotal;\n runningTotal = 0; //after math is done reassign to zero\n break;\n case '←': //tip copy and paste symbols from the DOM\n if(buffer.length === 1){ //backspace 1 character\n buffer = '0';\n }else {\n buffer = buffer.substring(0, buffer.length - 1); //-1 is stop 1 short of going all the way to the end\n }\n break;\n case '+': //note these need to be the signs not the &plus that is in the html\n case '−':\n case '×':\n case '÷':\n handleMath(symbol);\n break;\n }\n}", "function operatorClicked(operator) {\r\n display_number = document.getElementById(\"display\").value;\r\n backup_number = document.getElementById(\"hidden_number\").value;\r\n backup_operator = document.getElementById(\"hidden_operator\").value;\r\n disableDecimalPoint(false);\r\n disableNumbers(false);\r\n\r\n addText(operator);\r\n\r\n // multiple pressing of operators without pressing =\r\n if (backup_operator != '' \r\n && backup_number != '' \r\n && display_number != '' \r\n && display_number != backup_number) {\r\n calculateResult();\r\n display_number = document.getElementById(\"display\").value;\r\n backup_number = document.getElementById(\"hidden_number\").value;\r\n backup_operator = document.getElementById(\"hidden_operator\").value;\r\n\r\n document.getElementById(\"hidden_operator\").value = operator;\r\n document.getElementById(\"hidden_number\").value = display_number;\r\n //document.getElementById(\"display\").value = '';\r\n document.getElementById(\"hidden_status\").value ='operator';\r\n disableDecimalPoint(false);\r\n disableNumbers(false);\r\n }\r\n\r\n\r\n // some value is displayed\r\n else if (display_number != '') {\r\n document.getElementById(\"hidden_operator\").value = operator;\r\n document.getElementById(\"hidden_number\").value = display_number;\r\n //document.getElementById(\"display\").value = '';\r\n document.getElementById(\"hidden_status\").value ='operator'; \r\n }\r\n\r\n // operator change\r\n else if (display_number == backup_number) {\r\n document.getElementById(\"hidden_operator\").value = operator;\r\n }\r\n\r\n}", "function endRound()\n{\n //@TODO: Hier coderen we alles om een ronde te beëindigen\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 }", "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 nxtBtnClick() {\n hideError()\n if (Number(billAmt.value) > 0) {\n\n nextBtn.style.display = \"none\";\n cashGivenDiv.style.display = \"block\";\n } else {\n showError(\"Enter valid bill amount\");\n }\n}", "function numberClicked(eventData) {\n let buttonInformation = eventData;\n let numberClicked = buttonInformation.target.textContent;\n insertDisplay(numberClicked);\n}", "function setNumsVal(e) {\n if (calDisplay.value == '' || calDisplay.value == 0) {\n //setting the number value in the calculator screen\n //if the calscreen vaule is an empty string OR 0 (meaning as long as one of these are true)\n //then do this v\n calDisplay.value = e.target.value\n //target the calculator screen and now show the number button the user click's object value in the screen\n } else {\n //if EITHER of the conditions are true then do this v\n calDisplay.value = calDisplay.value + e.target.value;\n //target the calculator screen and show the what is already there plus the new number button the user clicked\n }\n}", "function myFunction(event) {\n var x = event.target;\n // console.log(\"current element clicked = \" + x.id);\n\n if (x.className == 'value-button') {\n //console.log(\"clicked a value-button class\");\n var idEvt = x.id;\n // start letter is to know if we perform a decrease or an increase\n var start = idEvt[0];\n // num is to search for the id to which the increase/decrease operation will be performed\n // the last character in the number(n)/decrease(n)\n // var num = idEvt[idEvt.length - 1];\n var num = idEvt.substring(idEvt.length - 4);\n var val = parseInt(document.getElementById('number' + num).value, 10);\n\n console.log(\"id = \" + x.id + \" last digit = \" + num + \" start = \" + start);\n\n // is id-name start is 'i', we are increasng the current value\n if (start == 'i') {\n //console.log(\"val before = \" + val);\n val = isNaN(val) ? 0 : val;\n val++;\n //console.log(\"val after = \" + val);\n document.getElementById('number' + num).value = val;\n }\n // else, it starts with 'd' then we are decreasing the current value\n else {\n console.log(\"val before = \" + val);\n val = isNaN(val) ? 0 : val;\n val < 1 ? value = 1 : '';\n // check if current value is equal to 0\n // if so, the value shall remain 0 as it cannot be negative\n if (val == 0) {\n document.getElementById('number' + num).value = val;\n }\n // else, decrease the current value by 1\n else {\n val--;\n //console.log(\"val after = \" + val);\n document.getElementById('number' + num).value = val;\n }\n }\n }\n // else if (x.className == 'btn btn-save') {\n // //document.getElementById(\"demo\").innerHTML = \"NOT CLASSNAME\";\n // //console.log(x.id);\n // var table = document.getElementsByTagName(tbody);\n // var rowNb = table.length;\n\n // console.log(\"nb of row in body = \" + rowNb);\n\n // // console.log(\"before = \" + rows.length);\n // // console.log(\"to be deleted = \" + currRow);\n\n // //x.closest('tr').remove();\n // }\n}", "function endEarlyButton() {\n endEarlyDetails();\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 startNewRound(r) {\n $('#actionButton').text(\"NEXT ROUND >>\");\n isReady = false;\n}", "function userNumber(i) {\r\n if (i <= 0) {\r\n $('button#modal-prev').hide();\r\n } else if (i >= 11) {\r\n $('button#modal-next').hide();\r\n }\r\n\r\n}", "function tagNumberOne(number){\n if ( currentOperationScreen.textContent === '0' || clearDisplay == true) {\n clearScreen();\n } \n currentOperationScreen.textContent += number; \n}", "function checkNext(event)\n{\n let element = document.getElementById(event.target.id)\n if (event.target.id != \"q6\")\n {\n if (event.target.id != \"q4\")\n {\n if (element.value == \"Yes\")\n {\n let nextNumber = parseInt(event.target.id.substring(1,2)) + 1\n let nextItem = event.target.id.substring(0,1) + nextNumber.toString()\n document.getElementById(nextItem).disabled = false;\n console.log(nextItem)\n }\n else\n {\n let nextNumber = parseInt(event.target.id.substring(1,2)) + 1\n let nextItem = event.target.id.substring(0,1) + nextNumber.toString()\n document.getElementById(nextItem).disabled = true;\n console.log(nextItem)\n }\n }\n else\n {\n if(document.getElementById(event.target.id).value != \"\")\n {\n let nextNumber = parseInt(event.target.id.substring(1,2)) + 1\n let nextItem = event.target.id.substring(0,1) + nextNumber.toString()\n document.getElementById(nextItem).disabled = false;\n console.log(nextItem)\n }\n else\n {\n let nextNumber = parseInt(event.target.id.substring(1,2)) + 1\n let nextItem = event.target.id.substring(0,1) + nextNumber.toString()\n document.getElementById(nextItem).disabled = true;\n console.log(nextItem)\n }\n }\n }\n else\n {\n document.getElementById(\"business-next-button\").disabled = false;\n }\n}", "pressEnd () {\n if (this.buttonHasFocus) {\n this.index = this.length - 1;\n this.focus();\n }\n }", "function changeNumber(num){\n let displayValue = calculator.displayValue;\n let waitingForSecondOperand = calculator.waitingForSecondOperand\n if(waitingForSecondOperand===true){\n calculator.waitingForSecondOperand=false;\n } \n calculator.displayValue = displayValue === '0' ? num : displayValue+num;\n }", "function endOfExpression(){\n if(btnPressed == 'C'){\n\n //this clears the storedclicked when pressed\n storedClicked = [];\n numbers = [];\n operator = [];\n array = [];\n n = 0;\n $('.input-field').html('');\n clear();\n\n }\n else if(btnPressed == '='){\n\n //if equals is pressed evaluate expression is ran\n //evaluateExpression(storedClicked);\n checkForOperator(storedClicked);\n }\n}", "function execute() {\n // jika kondisi terpenuhi\n if (num1.value && parseInt(num1.value) > 0) {\n // Clear\n executeClear();\n\n // Enable speed option\n enableSpeed();\n\n // Enable button play, nextmove, clear\n enableButton(0);\n enableButton(2);\n enableButton(3);\n\n // Disable button pause\n disableButton(1);\n\n // Menambah blank symbol di awal\n tapeCells.push(new Cell(\"B\"));\n tapeCells.push(new Cell(\"B\"));\n tmTape.childNodes[1].className += \" active\";\n it = 2; // Awal head\n state = 0; // Awal state\n \n // Memasukkan 0 sejumlah num1\n for (i = 0; i < num1.value; i++) {\n tapeCells.push(new Cell(\"0\"));\n }\n tapeCells.push(new Cell(\"B\"));\n tapeCells.push(new Cell(\"B\"));\n }\n}", "function equalButton() {\n // reset checker\n doubleOperatorCheck = \"\";\n \n // check if a number has been entered\n if (outputNum != \"\") {\n\n // loop operation if = button is repeatedly pressed\n if (operationArray.length == 3) {\n operationArray[0] = display.textContent;\n display.textContent = round(operate(operationArray));\n console.log(operationArray);\n return;\n }\n \n // push entered number to array\n operationArray.push(outputNum);\n \n // clear topline text\n topLine.textContent = '';\n\n console.log(round(operate(operationArray)));\n\n // calculate and display answer\n outputNum = round(operate(operationArray));\n // if not NaN (div by 0 err msg) return the message\n if (isNaN(outputNum)) { \n display.textContent = \"error.gif\";\n } else {\n display.textContent = round(operate(operationArray));\n }\n\n } else {\n return;\n }\n}", "function distractionButtonFunc() {\n distractions = distractions + 1;\n}", "static submittedNumber() {\n let enteredNum = document.querySelector(\"#startNumber\").value;\n enteredNum = parseInt(enteredNum);\n if (isNaN(enteredNum)) {\n document.querySelector(\n \"#displayTotalSteps\"\n ).innerHTML = `Please enter a postive integer`;\n } else if (enteredNum < 1) {\n document.querySelector(\n \"#displayTotalSteps\"\n ).innerHTML = `Please enter a postive integer`;\n } else {\n UI.equation(enteredNum);\n }\n //Resets input.value to empty\n document.querySelector(\"#startNumber\").value = \" \";\n }", "function handleOperator(operator) {\r\n if (!calculator.waitimgForSecondNumber) {\r\n calculator.operator = operator;\r\n calculator.waitimgForSecondNumber = true;\r\n calculator.firstNumber = calculator.displayNumber;\r\n\r\n // mengatur ulang nilai display number supaya tombol selanjutnya dimulai dari angka pertama lagi\r\n calculator.displayNumber = '0'\r\n } else {\r\n alert('Operator sudah ditetapkan')\r\n }\r\n}", "function nextButton() {\n \n next.innerHTML = `<button id=\"next-button\" class=\"next-button hvr-grow\" draggable=\"false\">NEXT</button>`;\n next.addEventListener(\"click\", function (){\n endTrial();\n });\n }", "function btnPress() {\n if (result > 0) {\n clear();\n }\n currentVal += this.value;\n updateDisplay();\n}", "function NextClick()\n{\n\tstate = [parent.topframe.top_index, parent.topframe.bottom_index];\n\t// if (parent.topframe.bottom_index>8)\n\t// \t{alert(state);}\n\tif (equal(state, [20,9])) //displays 'NEXT' button on final screen of tutorial. //Use 12,5 for version w/o familiarization.\n\t{\n\t\tparent.topframe.document.getElementById(\"nextbutton\").style.display=\"block\";\n\t}\n\tif (equal(state, [21,10])) // moves us from tutorial to real game. // Use [21,10] for familiarization version,\n //[12,6] for w/o familiarization version, and [1,1] for straight-to-task version.\n\t{\n\t\t//parent.window.location.href = \"http://198.61.169.95/pedro/js/index.html\";\n\t\t// parent.topframe.location.href = 'file:///Users/pedro/Desktop/js%20sandbox/find_the_number.html';\n\t\tparent.topframe.document.getElementById(\"tutorial\").innerHTML=\"<p>Find the number!</p>\";\n\t\tparent.topframe.document.getElementById(\"nextbutton\").style.display=\"none\";\n\t\t//blicket server location \"http://198.61.169.95/pedro/js/index.html\";\n\t\t//scripts.mit.edu location\n\t\t// parent.bottomframe.location.href = \"http://tsividis.scripts.mit.edu/js/index.html\";\n\t\tparent.bottomframe.location.href = \"http://lookit.mit.edu/numbers/index.html\";\n\t\t// parent.bottomframe.location.href = \"http://198.61.169.95/numbers/index.html\";\n\t}\n\telse if (ChangeBoth(state))\n\t{\t\n\t\t//increment top and bottom windows\n\t\tparent.topframe.top_index++;\n\t\tparent.topframe.bottom_index++;\n\t\t// alert('changed top/bottom to '+parent.topframe.top_index.toString()+', '+parent.topframe.bottom_index.toString());\n\t\tparent.topframe.document.getElementById(\"tutorial\").innerHTML=instructions[parent.topframe.top_index];\n\t\tparent.bottomframe.location = \"instructions\"+parent.topframe.bottom_index.toString()+\".html\";\n\n\t}\n\n}", "function end(){\n alert('Game over \\nYou reached level '+counter);\n bord.hidden = true;\n cumputerTurn = true;\n buttonDisplay = 0;\n userClicked = false;\n randomData=[];\n userCounter = 0;\n counter = 1;\n gameStart.hidden = false;\n bord.hidden = true;\n start = false;\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 setLineNum(num)\r\n{\r\n var box1 = document.getElementById('lineBox1');\r\n var box2 = document.getElementById('lineBox2');\r\n if(box1 == null || box2 == null)\r\n return;\r\n if(lastPick == null)\r\n {\r\n box1.value = num;\r\n }\r\n else if(lastPick >= num)\r\n {\r\n box1.value = num;\r\n box2.value = lastPick;\r\n }\r\n else if(lastPick < num)\r\n {\r\n box1.value = lastPick;\r\n box2.value = num;\r\n }\r\n lastPick = num;\r\n addButtonEnable();\r\n}", "function numberClicked() {\n console.log('number button clicked');\n calcDisplay = $('#calc-display-text')\n //alert displayed if number button is clicked while a prior calculation total is still in calulator display\n if (currentTotal == calcDisplay.text() && operator == '') {\n alert('Either click \"C\" to clear or an operator button to continue.')\n }\n //if calculator display is clear or an operator has been set the clicked number button will append to display\n else {\n inputNumberButton = $(this).text();\n calcDisplay.append(inputNumberButton);\n //each click concatenates and stores into the variable 'inputNumberConcatenate'\n inputNumberConcatenate += inputNumberButton;\n console.log(inputNumberConcatenate);\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}", "function addNum(someNum) {\r\r\n if (currentNum.length < 7) {\r\r\n if (isDecimal === true && someNum === \".\") {\r\r\n return;\r\r\n }\r\r\n currentNum = currentNum + someNum;\r\r\n $(\".viewport\").html(currentNum);\r\r\n lastButton = \"num\";\r\r\n lastNum = currentNum;\r\r\n if (someNum === \".\") {\r\r\n isDecimal = true;\r\r\n }\r\r\n }\r\r\n}", "function changeNumber () {\n let num = 0;\nadd.forEach(function(addbutton){\n addbutton.addEventListener(\"click\", () => {\n //store book number update\n if(addbutton.value === \"Add\") {\n num++\n numofbook.innerText = num;\n addbutton.value = \"Delete\"\n } else {\n num--\n numofbook.innerText = num;\n addbutton.value = \"Add\"\n }\n //end of store book number update\n })\n})\n}", "function operation(e) {\n if (!equalPressed) {\n // is equal is not pressed, every time operant is pressed, do calculation\n calculate();\n }\n equalPressed = false;\n // when operant is pressed, save operant (only remembers the operant last pressed)\n operant = e.target.id;\n // record current number on screen to previous\n previous = viewer.textContent;\n // set rePrint to true\n rePrint = true;\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}" ]
[ "0.65758437", "0.6554112", "0.6450468", "0.63544744", "0.6280753", "0.62525535", "0.6251711", "0.62029934", "0.6183051", "0.6173324", "0.6140532", "0.6119348", "0.6111421", "0.61008346", "0.6096863", "0.60785323", "0.60282135", "0.59929127", "0.5972412", "0.5968983", "0.59622914", "0.5959983", "0.59565216", "0.5954939", "0.59474427", "0.5944443", "0.5944177", "0.5941282", "0.5936233", "0.59297526", "0.59230775", "0.5918796", "0.5914332", "0.5909043", "0.5902269", "0.58967257", "0.58934265", "0.58688587", "0.5862114", "0.5856615", "0.5854721", "0.5848999", "0.5840532", "0.5839161", "0.5827306", "0.58268833", "0.5825508", "0.5824469", "0.58159643", "0.58142155", "0.5814097", "0.5805837", "0.580373", "0.5800734", "0.57985616", "0.5795841", "0.5794927", "0.5793104", "0.5788939", "0.578248", "0.5773579", "0.5769254", "0.5767911", "0.57669413", "0.5762802", "0.5748491", "0.5740819", "0.57396096", "0.57346743", "0.57298464", "0.572473", "0.57242364", "0.57191414", "0.5717151", "0.5714739", "0.57097816", "0.5708365", "0.5690433", "0.56890684", "0.5682269", "0.5675428", "0.56727046", "0.567183", "0.56697613", "0.56680065", "0.56643045", "0.565573", "0.5650925", "0.56494004", "0.5637417", "0.5636423", "0.56346047", "0.56337416", "0.563362", "0.5628846", "0.5616581", "0.5615196", "0.5607605", "0.5607255", "0.56039226", "0.5599972" ]
0.0
-1
End of numbers logic Start of operator logic
function calcFunctions (func) { switch(func) { case 'backspace': case 'DEL': output.innerHTML = output.innerHTML.substring(0, output.innerHTML.length - 1); if (output.innerHTML === '') { output.innerHTML = '0'; } if (output.innerHTML === 'Infinit') { output.innerHTML = '0'; } if (output.innerHTML === 'Na') { output.innerHTML = '0'; } break; case '.': if (!output.innerHTML.includes('.')) { calcNumbers(func); } break; case '+': console.log('Addition!'); firstNum = output.innerHTML; calcState.numFlag = true; calcState.arithmetic = addition; break; case 'enter': case '=': equalsFn(calcState.arithmetic); break; case '\u002a': case 'x': console.log('Multiply!') firstNum = output.innerHTML; calcState.numFlag = true; calcState.arithmetic = multiplication; break; case '/': case '\u00F7': console.log('Division!') firstNum = output.innerHTML; calcState.numFlag = true; calcState.arithmetic = division; break; case '-': console.log('Minus') firstNum = output.innerHTML; calcState.numFlag = true; calcState.arithmetic = subtraction; break; case '%': console.log('Percentage') firstNum = output.innerHTML; calcState.numFlag = true; output.innerHTML = firstNum / 100; break; case '\u221a': firstNum = output.innerHTML; calcState.numFlag = true; output.innerHTML = Math.sqrt(firstNum); break; case 'RND': firstNum = output.innerHTML; calcState.numFlag = true; output.innerHTML = Math.round(firstNum); default: break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOperator()\n\t{\n\t\t// handle 2 consecutive operators\n\t\t\n\t\tif(acc == \"\" && this.value == \"-\")\n\t\t{\n\t\t\t// Here - is the sign of the number and not op\n\t\t\tacc = acc + this.value;\n\t\t\tdocument.getElementById(\"output\").value = acc;\n\t\t\treturn;\n\t\t}\n\t\telse if(acc == \"-\")\n\t\t{\n\t\t\t// Invalid input. Number expected after - operator\n\t\t\treturn;\n\t\t}\n\t\telse if(acc == \"\")\n\t\t{\n\t\t\t// consecutive operator.\n\t\t\t// consider the current one\n\t\t\tcurrOp = this.value;\n\t\t}\n\t\telse // normal case\n\t\t{\n\t\t\tcurrVal = applyOperator(currVal, acc, currOp);\n\t\t}\n\t\t\n\t\t// to display o/p for transaction chaining\n\t\tdocument.getElementById(\"output\").value = currVal;\n\t\t\n\t\tif(currVal == \"Undefined\")\n\t\t{\t\n\t\t\tresetValues(false);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tacc = \"\";\n\t\tcurrOp = this.value;\n\t}", "function handleOtherOperator(operator) {\n switch (operator) {\n case 'C':\n buffer = '0';\n runningTotal = 0;\n break;\n case '=':\n if (previousOperator === null) {\n //do nothing\n return;\n }\n flushOperation(parseInt(buffer));\n previousOperator = null;\n buffer = runningTotal;\n runningTotal = 0;\n break;\n case '←':\n if (buffer.length === 1) {\n buffer = '0';\n } else {\n buffer = buffer.substring(0, buffer.length - 1);\n }\n break;\n }\n\n}", "function operators(){\n return /\\d/g;\n }", "function reverseOperator(content) {\n\tif (content === \"==\") return \"!=\";\n\telse if (content === '!=') return \"==\";\n\telse if (content === '<=') return \">\";\n\telse if (content === '>=') return \"<\";\n\telse if (content === '<') return \">=\";\n\telse if (content === '>') return \"<=\";\n\telse {\n\t\terror(\"Cannot reverse operator \"+content);\n\t}\n}", "function operator(nextOp) {\n const { firstNumber, display, operator } = calculate\n const input = parseFloat(display);\n\n if (operator && calculate.waitSecondNumber) {\n calculate.operator = nextOp;\n return;\n }\n\n if (firstNumber == null) {\n calculate.firstNumber = input;\n } else if (operator) {\n const current = firstNumber || 0;\n const result = calculation[operator](current, input) || calculation[operator](input) ;\n calculate.display = String(result);\n calculate.firstNumber = result;\n }\n\n calculate.waitSecondNumber = true;\n calculate.operator = nextOp;\n}", "function operator(op)\n{\n if(op=='+' || op=='-' || op=='^' || op=='*' || op=='/' || op=='(' || op==')')\n {\n return true;\n }\n else\n return false;\n}", "function isOperator(value){\n return value === \"÷\" || value === \"x\" || value === \"+\" || value === \"-\"\n}", "function displayOperator(operator) {\r\n const displayMainText = displayMain.textContent; \r\n if(regexDigits.test(displayMainText[displayMainText.length - 1])) {\r\n displayChain.textContent += displayMainText;\r\n displayMain.textContent = operator; \r\n }\r\n const displayChainText = displayChain.textContent;\r\n if(regexDigits.test(displayChainText[displayChainText.length - 1])) {\r\n displayMain.textContent = operator; \r\n }\r\n}", "function operation(operator) {\n var position = (resultScreen.innerText).indexOf(operator);\n var operandTwo = parseInt((resultScreen.innerText).substr(position+1), 2);\n return operandTwo;\n }", "recognizeOperator(){\r\n console.log(\"in recognizeOperator()\");\r\n let character = this.input.charAt(this.position);\r\n\r\n if(CharUtils.isComparisonOperator(character)){\r\n return this.recognizeComparisonOperator();\r\n }\r\n\r\n if(CharUtils.isArithmeticOperator(character)){\r\n return this.recognizeArithmeticOperator();\r\n }\r\n }", "handleOperator(e) {\n let prevVal = this.state.prevVal;\n\n if (prevVal === \"\") {\n this.setState({\n prevVal: this.state.curVal + e.target.value,\n curVal: \"0\"\n });\n } else if (this.state.curVal === \"0\" && /[+\\-*/]$/.test(prevVal)) {\n this.setState({\n prevVal: prevVal.replace(/[+\\-*/]$/, e.target.value),\n curVal: \"0\"\n });\n } else if (prevVal.includes(\"=\")) {\n this.setState({\n prevVal: this.state.curVal + e.target.value,\n curVal: \"0\"\n });\n } else {\n this.setState({\n prevVal: prevVal + this.state.curVal + e.target.value,\n curVal: \"0\"\n });\n }\n }", "function operation(operator){\n let numberOne = parseInt(document.getElementById(\"numberOne\").value);\n let numberTwo = parseInt(document.getElementById(\"numberTwo\").value);\n let resultOp;\n if (operator === \"plus\"){\n resultOp = numberOne+numberTwo;\n }\n else if (operator === \"minus\"){\n resultOp = numberOne-numberTwo;\n }\n else if (operator === \"multiplier\"){\n resultOp = numberOne*numberTwo;\n }\n else if (operator===\"divider\"){\n resultOp = numberOne/numberTwo;\n }\n else {\n console.log(\"trace: problem\");\n }\n document.getElementById(\"result\").value = resultOp;\n}", "equalsClick(){\n let state = this.state.arithmetic;\n let startOperators = ['/','*'];\n let endOperators = ['+','/','*','-'];\n if(startOperators.includes(state[0]) || endOperators.includes(state[state.length - 1])){\n this.setState({\n answer: \"Invalid Arithmetic\",\n arithmetic: state\n });\n }else{\n let solved = eval(this.state.arithmetic);\n this.setState({\n answer: solved,\n arithmetic: state\n });\n }\n }", "function actionOperators() {\n if (this.id == \"clear\") {\n setCalculation(\"\");\n setOutput(\"\");\n }\n else if (this.id == \"CE\") {\n outputData = unformatNum(getOutput()).toString(); //remove commas and convert back to string\n outputData = outputData.substring(0, outputData.length-1);\n if(isNaN(outputData)) { // lines to remove initial emoji value etc\n outputData = 0;\n setCalculation(\"\");\n }\n setOutput(outputData);\n }\n else {\n outputData = unformatNum(getOutput())\n if(isNaN(outputData)) { // lines to remove initial emoji value etc\n setCalculation(\"0\"+this.id);\n output.innerText = \"\";\n }\n else {\n if (this.id == \"=\") {\n calcData = getCalculation() + outputData;\n let result = eval(calcData);\n setOutput(result);\n setCalculation(\"\");\n sumDone = true;\n }\n else {\n calcData = getCalculation() + outputData + this.id;\n setCalculation(calcData);\n output.innerText = \"\";\n }\n }\n }\n}", "function getRangOperation(t) {\n\t\tswitch (t) {\n\t\tcase '>':\n\t\tcase '<':\n\t\tcase '!':\n\t\tcase '==':\n\t\tcase '!=':\n\t\tcase '<=':\n\t\tcase '>=':\n\t\tcase '?':\n\t\tcase ':':\n\t\t\treturn 1;\n\t\tcase '|':\n\t\tcase '&':\n\t\tcase '^':\n\t\t\treturn 2;\n\t\tcase '+':\n\t\tcase '-':\n\t\t\treturn 3;\n\t\tcase '*':\n\t\tcase '/':\n\t\tcase '%':\n\t\t\treturn 4;\n\t\t}\n\t\treturn 0;\n\t}", "function checkOperand(operator) {\n if (operand && operatorCount <= 1) {\n $('.equation').append(operator);\n }\n else {\n $('.equation').append(\"\");\n }\n }", "function clickOperator(operator) {\n console.log(\"Operator:\" + operator)\n\n // If user does not evaluate an expression and continues with calculation \n if (expression.charAt((expression.length) - 1) == operator) {\n alert(\"Click on '=' to evaluate, and then proceed with further calculations\")\n }\n //Adding the operator sign in intermediate steps\n else if (expression != \"\") {\n expression += operator\n }\n //If user starts with an operation,i.e when expression is empty\n else {\n let op1 = parseInt(document.querySelector(\"#lower\").value)\n answer += op1;\n expression += answer + operator;\n }\n\n //Updating the xpression on upper-half of display container\n expressionSection = document.querySelector(\".upper\")\n expressionSection.innerHTML = expression\n inputSection.value = \"\";\n}", "lastOutputCharHasOperator() {\n const { output } = this.state;\n if (/[/+\\-x]/.test(output.charAt(output.length - 1))) {\n return true;\n }\n return false;\n }", "isOperator(op) {\n if( isNaN(op) ) { //If it is not a number\n if( op == \"+\" || op == \"-\" || op == \"*\" || op == \"/\") { //and is one of the defined operators //TODO add more operators\n return true;\n } else { return false; } //not a defined operator\n } else { return false; } //is a number\n }", "function checkOperator()\n{\n if (operator === `+`)\n { \n additionValue = inputArray.join(``);\n additionValue = parseFloat(additionValue);\n\n addition(additionValue);\n\n updateDisplay(total);\n resetArray();\n }\n else if (operator === `-`)\n {\n subtractionValue = inputArray.join(``);\n subtractionValue = parseFloat(subtractionValue);\n\n subtraction(subtractionValue);\n\n updateDisplay(total);\n resetArray();\n }\n else if (operator === `X`)\n {\n multiplicationValue = inputArray.join(``);\n multiplicationValue = parseFloat(multiplicationValue);\n\n multiplication(multiplicationValue);\n\n updateDisplay(total);\n resetArray();\n }\n else if (operator === `/`)\n {\n divisionValue = inputArray.join(``);\n divisionValue = parseFloat(divisionValue);\n\n division(divisionValue);\n\n updateDisplay(total);\n resetArray();\n }\n}", "function operator(val, oper) {\r\n\tif (val !== '') {\r\n\t\tcalculator.smalldisplay.value+= val;\r\n\t\tcalculator.smalldisplay.value+= oper;\r\n\t\tcalculator.display.value = '';\r\n\t}\r\n\t\r\n}", "function checkOperator(lastChar){\n\t\tif(lastChar === \"+\" || lastChar === \"-\" || lastChar === \"/\" || lastChar === \"*\")\n\t\t\treturn true;\n\t\treturn false;\n\t}", "function operator(op) {\n if (op == '+' || op == '-' ||\n op == '^' || op == '*' ||\n op == '/' || op == '(' ||\n op == ')') {\n return true;\n }\n else\n return false;\n}", "function operatorPress() {\n\n determineNumber();\n determineOperation(this);\n}", "next() {\n return (\n this.eos() || this.num() || this.operator() || this.brace() || this.fail()\n )\n }", "function Handle_Operator(Next_Operator) {\n const { First_Operand, Display_Value, operator } = Calculator;\n const Value_of_Input = parseFloat(Display_Value);\n if (operator && Calculator.Wait_Second_Operand) {\n Calculator.operator = Next_Operator;\n return;\n }\n if (First_Operand == null) {\n Calculator.First_Operand = Value_of_Input;\n } else if (operator) {\n const Value_Now = First_Operand || 0;\n let result = Perform_Calculation[operator](Value_Now, Value_of_Input);\n result = Number(result).toFixed(9);\n result = (result * 1).toString();\n Calculator.Display_Value = parseFloat(result);\n Calculator.First_Operand = parseFloat(result);\n }\n Calculator.Wait_Second_Operand = true;\n Calculator.operator = Next_Operator;\n}", "function checkIfLastOperator() {\n var lastChar = screenContent.substr(screenContent.length - 1);\n var operator = [\"+\", \"-\", \"*\", \"/\", \".\"];\n for (i = 0; i < operator.length; i++) {\n if (operator[i] === lastChar) {\n return true;\n }\n }\n return false;\n }", "function operations(typeOperator) {\n\t\n\tif(typeOperator=='comma' && v!='v'){\n\t\tresText=resText+\".\";\n\t\tv='v';\n\t\tdv=1;\n\t\tanimateButtons('comma');\n\t}else if(typeOperator!='comma'){\n\t\tv='f';\n\t}\n\n\tif(typeOperator==\"sum\"){\n\t\tresText=resText+\"+\";\n\t\tanimateButtons('sum');\t \n\t}else if(typeOperator==\"minus\"){\n\t\tresText=resText+\"-\";\n\t\tanimateButtons('minus');\n\n\n\t}else if(typeOperator==\"times\"){\n\t\tresText=\"ans\"+\"×\";\n\t\tanimateButtons('times');\n\n\n\t}else if(typeOperator==\"divided\"){\n\t\tresText=\"ans\"+\"÷\";\n\t\tanimateButtons('divided');\n\n\t}\n\n\n\tif(typeOperator!='comma'){\n\n\t\tif(prevTypeOperator=='sum'){\n\t\t\tresNum=numberInstMemo+resNum;\n\t\t\tnumberInstMemo=0;\n\n\t\t}else if(prevTypeOperator=='minus'){\n\t\t\tresNum=resNum-numberInstMemo;\n\t\t\tnumberInstMemo=0;\n\n\t\t}else if(prevTypeOperator=='times' && d!=0){\n\t\t\tresNum=resNum*numberInstMemo;\n\t\t\tnumberInstMemo=0; \n\n\t\t}else if(prevTypeOperator=='divided' && d!=0){\n\t\t\tresNum=resNum/numberInstMemo;\n\t\t\tnumberInstMemo=0; \n\n\t\t}\n\n\t\tprevTypeOperator=typeOperator;\n\t\t\n\t}\n\t\n\t\n\tif(typeOperator=='equal'){\n\n\t\tresText='ans';\n\t\tanimateButtons('equal');\n\t\t\n\t}\n\n\tdocument.getElementById(\"resText\").innerHTML = resText;\n\tdocument.getElementById(\"resNum\").innerHTML = resNum;\n\t\n\td=0;\n\n\n}", "function checkOp(){\r\n if(op==\"+\"){\r\n realAnswer=num1+num2;\r\n }else if(op==\"-\"){\r\n realAnswer=num1-num2;\r\n }else if(op==\"*\"){\r\n realAnswer=num1*num2;\r\n }else{\r\n if(num1%num2!==0){\r\n numbers();\r\n }\r\n\r\n realAnswer=num1/num2;\r\n }\r\n}", "function operator(x)\r\n{\r\n form.display.value=form.display.value+x;\r\n var y=form.display.value;\r\n \r\n for(var i=1;i<y.length;i++)\r\n {\r\n if(y[i]==\"/\" || y[i]==\"*\")\r\n {\r\n if(y[i-1]==\"/\" || y[i-1]==\"+\" || y[i-1]==\"-\")\r\n {\r\n alert(\"sorry not possible :)\");\r\n form.display.value=\"\";\r\n }\r\n }\r\n }\r\n for(var j=0;j<y.length-1;j++)\r\n {\r\n if(y[j]==\".\")\r\n {\r\n if(y[j+1]==\"+\" || y[j+1]==\"-\" || y[j+1]==\"/\" || y[j+1]==\"*\")\r\n {\r\n alert(\"INVALID EXPRESSION\");\r\n form.display.value=\"\";\r\n break;\r\n }\r\n }\r\n } \r\n}", "function handleOperator(operator) {\r\n if (!calculator.waitimgForSecondNumber) {\r\n calculator.operator = operator;\r\n calculator.waitimgForSecondNumber = true;\r\n calculator.firstNumber = calculator.displayNumber;\r\n\r\n // mengatur ulang nilai display number supaya tombol selanjutnya dimulai dari angka pertama lagi\r\n calculator.displayNumber = '0'\r\n } else {\r\n alert('Operator sudah ditetapkan')\r\n }\r\n}", "function searchOperator() {\r\n //If there is a space at the end of the expression then there are more operators then numbers, thus error\r\n if (expressionHidden.charAt(expressionHidden.length - 1) == \" \") {\r\n console.log(\"reached\");\r\n errorMessage();\r\n return;\r\n }\r\n\r\n //Turn the expression into an array\r\n let arrayExpression = expressionHidden.split(\" \");\r\n let numbers = [];\r\n let operators = [];\r\n let countN = 0;\r\n let countO = 0;\r\n\r\n //sort numbers(odd) and operators(even)\r\n for (let j = 0; j < arrayExpression.length; j++) {\r\n if (arrayExpression[j] === \"\") {\r\n //If element equals empty string error\r\n errorMessage();\r\n return;\r\n }\r\n if (j % 2 == 0) {\r\n //should be all numbers\r\n numbers[countN] = arrayExpression[j];\r\n countN++;\r\n } else {\r\n //should be all operators\r\n operators[countO] = arrayExpression[j];\r\n countO++;\r\n }\r\n }\r\n // console.log(numbers + \"<<<\" + numbers.length);\r\n // console.log(operators + \" : op list\");\r\n\r\n if (operators.length >= numbers.length) {\r\n //If there are more operators then numbers, error\r\n errorMessage();\r\n return;\r\n } else {\r\n let tempAnswer = Number(numbers[0]), //set the temp answer to the first element\r\n nextNumIndex = 1; // Set the next number index at 1\r\n\r\n // loop through operators and perform the neccessary math. If the next number isn't defined end loop\r\n for (let l = 0; l < operators.length; l++) {\r\n // console.log(operators[l]);\r\n if (operators[l] == \"+\" && numbers[nextNumIndex] != undefined) {\r\n tempAnswer += Number(numbers[nextNumIndex]);\r\n } else if (operators[l] == \"-\" && numbers[nextNumIndex] != undefined) {\r\n tempAnswer -= Number(numbers[nextNumIndex]);\r\n } else if (operators[l] == \"*\" && numbers[nextNumIndex] != undefined) {\r\n tempAnswer *= Number(numbers[nextNumIndex]);\r\n } else if (operators[l] == \"/\" && numbers[nextNumIndex] != undefined) {\r\n tempAnswer /= Number(numbers[nextNumIndex]);\r\n } else if (operators[l] == \"%\" && numbers[nextNumIndex] != undefined) {\r\n tempAnswer %= Number(numbers[nextNumIndex]);\r\n } else {\r\n break;\r\n }\r\n nextNumIndex++;\r\n }\r\n answer = tempAnswer;\r\n\r\n //If temp answer is greater than 15 change to exponential form and change font size\r\n if (tempAnswer.toString().length > 15) {\r\n answer = answer.toExponential();\r\n document.getElementById(\"calcScreen\").style.fontSize = \"3.8em\";\r\n } else if (answer == NaN) {\r\n errorMessage();\r\n return;\r\n }\r\n\r\n SCREEN_RESULTS.innerHTML = answer.toString(); //show answer on calc screen\r\n }\r\n // console.log(expressionHidden);\r\n // console.log(arrayExpression);\r\n}", "function getOp() {\r\n let op = prompt(\"Bitte +|-|*|/ eingeben.\")\r\n \r\n while (!isOpValid(op)) { // solange falsche eingabe ---> schleife\r\n op = prompt(\"Bitte einen korrekten Operator eingeben\")\r\n }\r\n \r\n return op ;\r\n \r\n}", "isOperator() {\n return \"+-/\".indexOf(this.char) !== -1\n // return \"+-/\".includes(this.char)\n }", "function operate(operator, num1, num2) {\n num1 = parseFloat(prevNum, 10);\n num2 = parseFloat(currentNum, 10);\n if (operator == 'add') {\n return add(num1, num2);\n } if (operator == 'subtract') {\n return subtract(num1, num2);\n } if (operator == 'multiply') {\n return multiply(num1, num2);\n } if (operator == 'divide') {\n return divide(num1, num2);\n } if (operator == '') {\n displayNum.textContent = '';\n }\n}", "function checkForOperator(expression){\n console.log(expression);\n var expressionSymbol = ['-', '+','x', '/'];\n var integer = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n var decimal = '.';\n var equals = '=';\n \n for(var e in expression){\n console.log(expression[e]);\n\n console.log('Integer indexof: ' + integer.indexOf(expression[e]));\n\n if(integer.indexOf(expression[e]) !== -1){\n numbers.push(Number(expression[e])); \n }\n if(decimal.indexOf(expression[e]) !== -1){\n numbers.push(expression[e]);\n }\n console.log('exprssionsymbol indexof: ' + expressionSymbol.indexOf(expression[e]));\n if(expressionSymbol.indexOf(expression[e]) !== -1){\n break;\n \n }\n numbers.join('');\n console.log('numbers ');\n console.log(numbers.join(''));\n finalNum = numbers.join('');\n }\n numbers = [];\n console.log(finalNum);\n\n expression.splice(0,e);\n operator.push(expression[0]);\n console.log(operator);\n expression.splice(0,1);\n console.log(expression);\n\n storeNumbers(finalNum, n);\n n++;\n while(expression.length > 0){\n checkForOperator(expression);\n }\n\n }", "function thumb2_logic_op(/* int */ op)\n{\n return (op < 8);\n}", "calc(){\n let lastIndex =\"\";\n //armazenando o ultimo operador\n this._lastOperator = this.getLastItem(true);\n\n if(this._operation.length < 3){\n let firstNumber = this._operation[0];\n this._operation =[];\n this._operation = [firstNumber, this._lastOperator, this._lastNumber];\n }\n\n //arrumando para quando o método for chamado pelo sinal de igual =\n if(this._operation.length > 3){\n\n lastIndex = this._operation.pop();\n //armazenando o ultimo número digitado na calcl\n this._lastNumber = this.getResult();\n\n }else if(this._operation.length == 3){\n //armazenando o ultimo número digitado na calcl\n this._lastNumber = this.getLastItem(false);\n }\n\n //transforma um vetor em uma string, usando um separador, qo separador é definido pelo parametro passado no método\n let result = this.getResult();\n\n if(lastIndex == \"%\"){\n result /= 100;\n this._operation = [result];\n }else{\n this._operation =[result];\n //se o ultimo index for diferente de vazio, então adiciona ele no vetor\n if(lastIndex){\n this._operation.push(lastIndex);\n }\n \n }\n this.setLastNumberToDisplay();\n \n }", "function operatorClick(event) {\n\tif (ansPressed)\n\t\tansPressed = false;\n var o = event.target.textContent.trim(); \n document.getElementById(\"back1\").disabled = false;\n // replace the immediate operator \nif ((disp.textContent.substr(disp.textContent.length - 1,1) === '+') ||\n\t(disp.textContent.substr(disp.textContent.length - 1,1) === '/') ||\n\t(disp.textContent.substr(disp.textContent.length - 1,1) === '*') ||\n\t(disp.textContent.substr(disp.textContent.length - 1,1) === '-') ||\n\t(disp.textContent.substr(disp.textContent.length - 1,1) === '.')\n\t)\n\t{\n\t\tdisp.textContent = disp.textContent.substr(0, disp.textContent.length - 1);\n\t}\n\n switch (o)\n{\n\tcase '.':\n\t // flag to check for a decimal. Only allow 1 decimal point per number\n\t\tdecPressed++;\n\t\tif (decPressed == 1)\n\t\t{\n\t\tdisp.textContent += o;\n\t\t}\n\t\tbreak;\n\tcase '\\u00f7':\n\t\t o = '/';\n\t\t disp.textContent += o;\n\t\t decPressed=0;\n\t\t break;\n\tcase 'x':\n\t\to = '*';\n\t\tdisp.textContent += o;\n\t\tdecPressed=0;\n\t\tbreak;\n\tcase '+':\n\tcase '-':\n\t\tdecPressed=0;\n\tdefault:\n\t\tdisp.textContent += o;\n\t\tbreak;\n}\n}", "isOperator(value) {\n return [\"+\", \"-\", \"*\", \"/\", \"%\", \"x²\", \"√\"].indexOf(value) > -1;\n }", "function getOp() {\n let op = prompt(\"Bitte + | - | * | / eingeben.\")\n while (!isOpValid(op)) { // solange falsche eingabe --> schleife\n op = prompt(\"Bitte einen korrekten Operator eingeben!\")\n }\n return op ; \n}", "function handleMath(operator) {\n if (buffer === '0') {\n //do nothing\n return;\n }\n //Converting to int to do math\n const intBuffer = parseInt(buffer);\n\n if (runningTotal === 0) {\n runningTotal = intBuffer;\n } else {\n flushOperation(intBuffer);\n\n }\n\n previousOperator = operator;\n buffer = \"0\";\n}", "function calcByFollowingOper(operator, inpArr) {\n let res = inpArr[0];\n switch (operator) {\n case \"+\":\n for (let i = 1; i < inpArr.length; i++) {\n res += inpArr[i];\n }\n return res;\n case \"-\":\n for (let i = 1; i < inpArr.length; i++) {\n res -= inpArr[i];\n }\n return res;\n case \"/\":\n for (let i = 1; i < inpArr.length; i++) {\n res /= inpArr[i];\n }\n return res;\n case \"*\":\n for (let i = 1; i < inpArr.length; i++) {\n res *= inpArr[i];\n }\n return res;\n }\n}", "function setOperator(number){\n operator = number;\n var opString = \"\";\n flag = true;\n if(operator === 4){\n display.innerHTML += \" / \";\n opString = \" / \";\n }\n else if(operator === 3){\n display.innerHTML += \" * \";\n opString = \" * \";\n }\n else if(operator === 2){\n display.innerHTML += \" - \";\n opString = \" - \";\n }\n else{\n display.innerHTML += \" + \";\n opString = \" + \";\n }\n //for getting rid of multiple operators\n if(flag === true){\n display.innerHTML = num1 + opString;\n }\n //does not let us do an operation before entering a num1\n if(flag === true && num1 === \"\"){\n clearButton();\n }\n if(equalTo === true){\n clearButton();\n }\n}", "function logicalCalc(array, op) {\n\t//your code here\n\t// primam niz boolean-a to je arrayy\n\t// primam operator - to je op\n\t// treba da vratim rezultat koga dobijem tako sto na sve elemente niza primenim ovaj operator i rez ce biti ili true ili false\n\tlet res = array[0];\n\n\tfor (i = 1; i < array.length; i++) {\n\t\tif (op === 'AND') {\n\t\t\t// res = array[i] && array[i + 1];\n\t\t\tres = res && array[i];\n\t\t}\n\t\tif (op === 'OR') {\n\t\t\tconsole.log('elemnt', array[i] || array[i + 1]);\n\t\t\t// res = array[i] || array[i + 1];\n\t\t\tres = res || array[i];\n\t\t}\n\t\tif (op === 'XOR') {\n\t\t\t// res = !(array[i] == array[i + 1]);\n\t\t\tres = res != array[i];\n\t\t}\n\t}\n\tif (typeof res === 'number') {\n\t\tres = 1 ? true : false;\n\t}\n\treturn res;\n}", "function operate(operator){\n \n if (input===\"\"){\n //nothing \n \n }\n else if(hasNum1){\n \n compute();\n }\n else{\n \n num1Val = parseFloat(input);\n hasNum1 = true;\n \n }\n \n opp=operator;\n\n input=\"\";\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}", "function operate(num1, num2, operator)\n{\n let ans;\n if(operator == '+')\n ans = add(num1,num2);\n else if (operator == '-')\n ans = sub(num1,num2);\n else if ( operator == \"/\")\n ans = div(num1,num2);\n else \n ans = mul(num1,num2);\n return ans;\n}", "function OperatorHandler()\n{\n\tif(this.id == \"clear\")\n\t{\n\t\tprintHistory(\"\");\n\t\tprintOutput(\"\");\n\t}\n\telse if(this.id == \"backspace\"){\n\t\tvar output = getOutput().toString();\n\t\tif(output)\n\t\t{\n\t\t\toutput= output.substr(0,output.length-1);\n\t\t\tprintOutput(output);\n\t\t}\n\t}\n\telse\n\t{\n\t\tvar output = getOutput();\n\t\tvar history = getHistory();\n\t\thistory = history + output;\n\t\tif( this.id == \"=\") \n\t\t{\n\t\t\tvar result = eval(history);\n\t\t\tprintOutput(result);\n\t\t\tprintHistory(\"\");\n\t\t}\n\t\telse if( this.id == \"sqrt\") \n\t\t{\n\t\t\tvar result = Math.sqrt(Number(history));\n\t\t\tprintOutput(result);\n\t\t\tprintHistory(\"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\thistory = history + this.id;\n\t\t\tprintHistory(history);\n\t\t\tprintOutput(\"\");\n\t\t}\n\t}\n}", "function handleOperator(event) {\n if (prevOperand.length > 0) {\n evaluate(event);\n }\n\n if (display.innerHTML === OVERFLOW) {\n return;\n }\n\n resetOperation();\n event.target.classList.add('selected');\n operation = event.target.innerHTML;\n prevOperand = display.innerHTML;\n isLastInputOperation = true;\n isResult = false;\n}", "function checkOper (oper) {\n if((lastOperator == \"add\" || lastOperator == \"subtr\")&&(oper == \"multi\" || oper == \"div\")) {\n //trzeba pokombinować\n console.log(\"Order of operation warning\");\n warning.innerHTML = \"Calculator does not include order of operations!\";\n }\n \n operator = lastOperator;\n displayResult();\n lastNum = result;\n result = \"\";\n theNum = \"\";\n lastOperator = oper;\n operator = oper;\n \n }", "function Expression() {\n AddExpression();\n if (currentClass() == RELATIONAL_OPERATOR || currentClass() == LOGICAL_OPERATOR) {\n nextToken();\n Expression();\n return;\n }\n return;\n }", "function input_operator(op){\n console.log(\"Handling operator\");\n const {curr_display} = calculator;\n\n let display_length = curr_display.length;\n let last_input = curr_display.charAt(display_length-1);\n let operator_str = \"+-/*\";\n // i reset the current number back to nothing\n calculator.curr_num = \"\";\n\n console.log(\"Checking prev val and curr display ---\", calculator.prev_val, calculator.curr_display);\n // Case where I previously did a calculation, and want to continue operating on the answer\n if((calculator.prev_val !== \"\") && (calculator.curr_display === \"0\")){\n console.log(\"Continuing previous calculation\");\n calculator.curr_display = calculator.prev_val + op;\n }else{\n // if the last input is already an operator, I will replace it. This is my calculator design, I don't want error\n if(operator_str.includes(last_input)){\n calculator.curr_display = curr_display.substring(0, display_length-1) + op;\n }else{\n //if the last one wasn't an operator already, then continue as usual\n calculator.curr_display += op;\n }\n }\n\n}", "function isOperator(value) {\r\n if (value == \"\") {\r\n return false;\r\n }\r\n\r\n switch (value) {\r\n case \"/\": \r\n return true;\r\n break;\r\n case \"x\": \r\n return true;\r\n break;\r\n case \"+\": \r\n return true;\r\n break;\r\n case \"-\": \r\n return true;\r\n break;\r\n \r\n default:\r\n return false;\r\n break;\r\n }\r\n}", "function processEquation (curEq, input, setter, dcmCount, dcmSetter, minusCount, minusSetter) {\n // Catch last number (before input is added do currentEquation)\n const lastNumberExpression = getLastNumber(curEq + input)\n // evaluate the value of current number (2nd condition) and if it's zero you just can't type more than one zero consecutively\n // 1st condition allows for a zero to be passed\n // console.log('lastNum: ' + lastNumberExpression)\n console.log(minusCount)\n if(lastNumberExpression.length > 1 && parseInt(lastNumberExpression) === 0) {\n return\n } else if(lastNumberExpression[0] === '0') {\n setter(prevStr => {\n const lastNumBeforeInput = getLastNumber(curEq)\n if(lastNumBeforeInput === '0') {\n // cut out the whole substring without the zero at the end (so transform 123+3221*0 to 123+3221*) and then add input to it and return it\n return curEq.substr(0, curEq.length - 1) + input\n } else {\n // just perform standard concatenation\n return curEq + input\n }\n })\n } else if(/[\\/+*\\-]/.test(curEq[curEq.length - 1]) && /[\\/+*]/.test(input)) {\n // cut out the whole substring without the operator and replace it with the new one (ie. input) - except the minus operator\n setter(curEq.substr(0, curEq.length - 1) + input) \n } \n// else if (/[0-9.]/.test(input)) {\n// // reset the minusCount after the number or decimal point\n// minusSetter(0)\n// setter(prevStr => prevStr + input) \n// // } \n// else if (/[\\/*+]/.test(input)) {\n// // reset the minusCount after every other operator\n// minusSetter(0)\n// setter(prevStr => prevStr + input) \n// } \n// else if(input === '-') {\n// if(minusCount > 0) {\n// return\n// }\n// minusSetter(1)\n// setter(prevStr => prevStr + input) \n// } \n else if(/[\\/+*\\-]/.test(input)) {\n // reset count after each operator (so in every new number)\n dcmSetter(0)\n setter(prevStr => prevStr + input) \n } else if(input === '.') {\n if(dcmCount > 0) {\n return\n }\n dcmSetter(prevCount => prevCount + 1)\n setter(prevStr => prevStr + input) \n } else {\n setter(prevStr => prevStr + input) \n }\n}", "function operate(operator,a,b) {\n\n if (operator == \"+\"){\n let results = addNums(a,b);\n return results;\n } else if (operator == \"-\"){\n let results = subtractNums(a,b);\n return results;\n } else if (operator == \"*\"){\n let results = multiplyNums(a,b);\n return results;\n } else if (operator == \"/\"){\n let results = divideNums(a,b);\n return results;\n }\n\n \n\n}", "function checkForOpperand(char){\n if(char == \"+\"){\n return false;\n }else if(char == \"-\"){\n return false;\n }else if(char == \"/\"){\n return false;\n }else if(char == \"=\"){\n return false;\n }else if(char == \"*\"){\n return false;\n }else if(char == \"%\"){\n return false;\n }else if(char == \".\"){\n return false;\n }else{\n return true;\n }\n}", "isAcceptingOperand() {return this.operandCount < 2 }", "parseExpressionOR () {\n let exp1 = this.parseExpressionAND();\n while (this.getToken().type === this.lexerClass.OR_OPERATOR) {\n const opToken = this.getToken();\n this.pos++;\n const or = convertFromString('or');\n this.consumeNewLines();\n const exp2 = this.parseExpressionAND();\n const finalExp = new Expressions.InfixApp(or, exp1, exp2);\n finalExp.sourceInfo = SourceInfo.createSourceInfo(opToken);\n exp1 = finalExp\n }\n return exp1;\n }", "function binaryCal(bin1, bin2, operator) {\n bin1 = convertBinary(bin1);\n bin2 = convertBinary(bin2);\n\n if(operator === \"/\"){\n return convertDecimal(Math.round(bin1 / bin2));\n } else if(operator === \"+\"){\n return convertDecimal(bin1 + bin2);\n } else if(operator === \"*\"){\n return convertDecimal(bin1 * bin2);\n } else if (operator === \"-\"){\n return convertDecimal(bin1 - bin2);\n } else {\n console.log(\"operator not supported\");\n }\n\n}", "function evaluate(operator) {\n let op2 = document.getElementById(\"lower\").value\n\n //Evaluating the expression \n let ch = expression.charAt((expression.length) - 1)\n if (ch == \"+\" || ch == \"-\" || ch == \"*\" || ch == \"/\") {\n //If user has clicked to evluate without the value of second operand,then add 0 automatically to complete it\n if (op2 == \"\") {\n op2 = 0\n }\n expression += op2;\n answer = calculate(parseInt(answer), parseInt(op2), operator)\n }\n\n //Updating the expression and displaying the result\n expressionSection.innerHTML = expression;\n inputSection.value = answer;\n}", "function handleBinary(op) {\n return pseudocode('D = y; M = x') +\n `M=${op}\\n` +\n pseudocode('SP--')\n}", "calc() {\n if (this.operation.length < 2) return;\n let result;\n\n //calculation if the operation is less than 2 operators\n if (this.operation.length == 2) {\n //calculation if the last operator is raised to power\n if (this.getLastPosition() == 'x²') {\n this.raisedPower(this.getLastPosition(false));\n return;\n }\n //calculation if the last operator is square root\n if (this.getLastPosition() == '√') {\n this.squareRoot(this.getLastPosition(false));\n return;\n }\n\n let firstNumber = this.operation[0];\n if (!this.lastOperator) this.lastOperator = this.getLastPosition();\n if (!this.lastNumber) this.pushOperator(firstNumber);\n if (this.lastNumber) this.pushOperator(this.lastNumber);;\n }\n\n //calculation if the operation is 3 or more operators\n if (this.operation.length > 3) {\n this.lastOperator = this.destroyLastOperator();\n } else if (this.operation.length == 3) {\n this.lastNumber = this.getLastPosition(false);\n this.lastOperator = this.getLastPosition();\n }\n\n //execute the of operation\n result = this.getResult();\n //validates of the last operator\n if (this.lastOperator == '%') {\n result /= 100;\n this.operation = [result];\n } else if (this.lastOperator == 'x²') {\n result *= result;\n this.operation = [result];\n } else {\n this._operation = [result, this.lastOperator];\n }\n\n this.updateDisplay(); \n }", "function testLogicalOr(val) {\r\n if (val<10 || val>20) {\r\n document.write (\"Outside <br><br>\");\r\n }\r\n else{\r\n document.write (\"Inside <br><br>\");\r\n }\r\n }", "function isOperator(str) {\n if (str == \"(\" || str == \")\" || str == \"+\" || str == \"-\" || str == \"*\" || str == \"/\" || str == \".\")return true;\n return false;\n}", "function checkOperator(){\n let op = calculator.operator;\n if (op === '%' || op === '÷' || op === '×' || op === '-' || op === '+'){\n return calculator.operator;\n }\n else {\n return false;\n }\n}", "function testLogicalOr(val) {\n\tif (val < 10 || val > 20) {\n\t\treturn \"OutSide\";\n\t}\n\treturn \"Inside\";\n}", "function LogicEvaluator() {}", "function operatorMethod (inputOperator)\n{\n\tif (operator) {\n\t\tequal();\n\t}\n\telement.push(number);\n\tnumber = \"\";\n\toperator = inputOperator;\n}", "function evalComplexOperator(el) {\n switch (el.value) {\n case \"LOG\":\n display = eval(\"Math.log(\" + lastDigitClicked + \")\")\n if(!isNaN(display)){\n evaluationString = eval(\"Math.log(\" + lastDigitClicked + \")\")\n }else{\n display = evaluationString =0;\n }\n lastDigitClicked = display\n break\n case \"SQRT\":\n display = eval(\"Math.sqrt(\" + lastDigitClicked + \")\")\n if(!isNaN(display)){\n evaluationString = eval(\"Math.sqrt(\" + lastDigitClicked + \")\")\n }else{\n display = evaluationString =0;\n }\n lastDigitClicked = display\n break\n case \"CUBRT\":\n display = eval(\"Math.cbrt(\" + lastDigitClicked + \")\")\n evaluationString = eval(\"Math.cbrt(\" + lastDigitClicked + \")\")\n lastDigitClicked = display\n break\n case \"TAN\":\n display = eval(\"Math.tan(\" + lastDigitClicked + \")\")\n evaluationString = eval(\"Math.tan(\" + lastDigitClicked + \")\")\n lastDigitClicked = display\n break\n case \"COS\":\n display = eval(\"Math.cos(\" + lastDigitClicked + \")\")\n evaluationString = eval(\"Math.cos(\" + lastDigitClicked + \")\")\n lastDigitClicked = display\n break\n case \"SIN\":\n display = eval(\"Math.sin(\" + lastDigitClicked + \")\")\n evaluationString = eval(\"Math.sin(\" + lastDigitClicked + \")\")\n lastDigitClicked = display\n break\n default:\n return false\n }\n console.log(evaluationString)\n return true\n\n}", "eoi() { return this.pos==this.end }", "function setOper() { \n warning.innerHTML = \"\";\n operator = this.getAttribute(\"data-op\");\n if(!lastOperator){\n lastNum = theNum;\n theNum = \"\";\n lastOperator = operator;\n console.log(\"There is not setted operator before. Operator: \" + operator); \n } else if (theNum === \"\") {\n lastOperator = operator;\n console.log(\"There is not setted theNum. Last separator is exchange for operator: \" + operator); \n } else {\n console.log(\"There is setted operator. CheckOper\");\n checkOper(operator);\n } \n }", "function keyPressOperator(key) {\n if (!num1) {\n alert(\"Need a first number\");\n } else {\n if (!operatorActive) {\n operator = key;\n operatorActive = true;\n display.value = \"\";\n }\n if (num1 && num2 && !calculationDone) {\n if (decimal) {\n display.value = parseFloat(calculate(num1, operator, num2)).toFixed(2);\n decimal = true;\n } else {\n parseFloat(calculate(num1, operator, num2));\n }\n }\n if (calculationDone) {\n operator = key;\n }\n }\n}", "function handleOperator(operator){\n\n\t// Prevent user from trying to pass '=' as first operator (e.g. 1=)\n\tif (calculation['operator'] == \"=\"){\n\t\tcalculation['operator'] = '';\t\n\t}\n\t\n\t\n\t// Triggers when there are two numbers and first operator (e.g. 1+1)\n\t// Call operate function which get result and displays it\n\tif (calculation['operand'] && calculation['operator'] && calculation['operand2']){\n\t\tcalculation['operator2'] = operator\n\t\t\n\t\toperate()\n\t\n\t// Triggers when there are one number and first operator (e.g 1+)\n\t// Changing the actual operator \n\t}else if (calculation['operand'] && calculation['operator']){\n\t\tcalculation['operator'] = operator;\n\t\n\t// Triggers when there is one number (e.g. 1)\n\t// Setting operator\n\t// This and above case could be in one line but are divided for clarity\n\t}else if (calculation['operand']){\n\t\tcalculation['operator'] = operator;\n\t}\n}", "function evaluate(indexStart, indexEnd, operators, operands) {\r\n\r\n for (var index = indexStart; index < indexEnd; index++) {\r\n\r\n var indexFirstOperand = index\r\n var indexNextOperand = index + 1\r\n var indexNextOperator = index\r\n\r\n if (operators[indexNextOperator] == null) {\r\n for (var indexNext = indexNextOperator + 1; indexNext < operators.length; indexNext++) {\r\n if (operators[indexNext] != null) {\r\n indexNextOperator = indexNext\r\n indexFirstOperand = indexNext\r\n indexNextOperand = indexNext + 1\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n if (operands[indexNextOperand] == null) {\r\n for (var indexNext = indexNextOperand + 1; indexNext < operands.length; indexNext++) {\r\n if (operands[indexNext] != null) {\r\n indexNextOperand = indexNext\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n // MULTIPLICATION \r\n if (operators[indexNextOperator] == '*') {\r\n result = operands[indexFirstOperand] * operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n // DIVISION\r\n else if (operators[indexNextOperator] == '/') {\r\n result = operands[indexFirstOperand] / operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n }\r\n\r\n // ADDITION and SUBSTRACTION\r\n for (var index = indexStart; index < indexEnd; index++) {\r\n\r\n var indexFirstOperand = index\r\n var indexNextOperand = index + 1\r\n var indexNextOperator = index\r\n\r\n if (operators[indexNextOperator] == null) {\r\n for (var indexNext = indexNextOperator + 1; indexNext < operators.length; indexNext++) {\r\n if (operators[indexNext] != null) {\r\n indexNextOperator = indexNext\r\n indexFirstOperand = indexNext\r\n indexNextOperand = indexNext + 1\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n if (operands[indexNextOperand] == null) {\r\n for (var indexNext = indexNextOperand + 1; indexNext < operands.length; indexNext++) {\r\n if (operands[indexNext] != null) {\r\n indexNextOperand = indexNext\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n // ADDITION \r\n if (operators[indexNextOperator] == '+') {\r\n result = operands[indexFirstOperand] + operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n // SUBSTRACTION\r\n else if (operators[indexNextOperator] == '-') {\r\n result = operands[indexFirstOperand] - operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n }\r\n return finalResult\r\n}", "function operatorPressed(currentOperator) {\n document.getElementById(\"display\").innerText = currentOperator;\n document.getElementById(\"calculation-display\").innerText += currentOperator; // Add operator to current calculation\n display = true; // new number has to be entered = true\n equalPressed = false; // equal is not pressed last\n document.getElementById(\"calculation-display\").innerText = document.getElementById(\"calculation-display\").innerText.replace(/(\\D)\\1/, currentOperator) // To prevent doubling the same operator\n document.getElementById(\"calculation-display\").innerText = document.getElementById(\"calculation-display\").innerText.replace(/\\D{3}/, currentOperator) // Prevent from entering operator more than 2 at a time after another\n}", "function isOp(){\n\t//variable to return\n\tvar ret;\n\tvar inputScreen = document.querySelector('.screen');\n\t//ret is true if there are any operators in the display excluding -\n\tif((inputScreen.innerHTML.contains(\"+\") || inputScreen.innerHTML.contains(\"*\") || inputScreen.innerHTML.contains(\"/\") || inputScreen.innerHTML.contains(\"%\") || inputScreen.innerHTML.contains(\"^\"))){\n\t\tret = true;\n\t}\n\t//ret is false if there are not any operators in the display excluding -\n\tif((!inputScreen.innerHTML.contains(\"+\") && !inputScreen.innerHTML.contains(\"*\") && !inputScreen.innerHTML.contains(\"/\") && !inputScreen.innerHTML.contains(\"%\") && !inputScreen.innerHTML.contains(\"^\"))){\n\t\tret = false;\n\t}\n\treturn ret;\n}", "_receiveOperator(currentOperator) {\n const previousOperator = this.operators.peek();\n const previousPlusMinus = isPlusMinus(previousOperator);\n const previousMultiplyDivide = isMultiplyDivide(previousOperator);\n const currentPlusMinus = isPlusMinus(currentOperator);\n const currentMultiplyDivide = isMultiplyDivide(currentOperator);\n\n // 5 + + --> stay at 5\n // 5 + 1 + --> evaluate\n const invokedByOperator = {plusMinus: currentPlusMinus};\n if (previousPlusMinus && this.lastInputType !== 'operator') {\n if (currentPlusMinus) {\n this._evaluate(invokedByOperator);\n } else if (currentMultiplyDivide) {\n // no action: only store\n }\n } else if (previousMultiplyDivide) {\n if (currentPlusMinus) {\n this._evaluate(invokedByOperator);\n } else if (currentMultiplyDivide) {\n this._evaluate(invokedByOperator);\n }\n }\n\n if (this.lastInputType == 'operator') {\n const remainPlusMinus = isPlusMinus(this.operators.peek());\n if (remainPlusMinus && currentMultiplyDivide) {\n // do nothing:\n // [1, '+', 5, '*', 2, '/', 2, '='] --> 6\n } else {\n this.operators.pop();\n }\n }\n\n this.operators.push(currentOperator);\n this.lastInputType = 'operator';\n }", "function operate(num1, num2, operator){\n if(operator === '+') return add(num1, num2)\n if(operator === '-') return subtract(num1, num2)\n if(operator === '*') return multiply(num1, num2)\n if(operator === '/') return divide(num1, num2)\n}", "function testLogicalOR(val){\n if (val < 10 || val > 20){\n return \"Outside\";\n }\n return \"Inside\";\n}", "function operate(num1, num2, operator){\n if (operator == \"+\") return add(num1, num2);\n if (operator == \"-\") return subtract(num1, num2);\n if (operator == \"*\") return multiply(num1, num2);\n if (operator == \"/\") return divide(num1, num2);\n return \"wrong operator\";\n}", "function calculate() {\r\n if (operator) {\r\n if (!result) return; //To prevent errors when there's no operand\r\n nextVal = result;\r\n result = calculation();\r\n prevVal = result;\r\n } else if(result){\r\n prevVal = result;\r\n }\r\n displayResult();\r\n result = ''; //To empty the display for new operand\r\n}", "function otrosops (a){\n console.log(\"Veamos que pasa con ++a: \", ++a) // hace a+1 e imprime a+1\n console.log(\"Veamos que pasa con ++a: \", --a) // toma (a+1) le resta 1 e imprime a\n console.log(\"Esto es el inverso add. de a: \", -a)\n console.log(\"le sumare a a, un true: \", a+true)\n console.log(\"esto es a^a: \", a**a)\n\n}", "static test02() {\n let cal = new Calc();\n cal.receiveInput(2);\n cal.receiveInput(Calc.OP.MINUS);\n cal.receiveInput(7);\n cal.receiveInput(Calc.OP.EQ);\n return cal.getDisplayedNumber() === 2 - 7;\n }", "function testLogicalOr(val) {\n\tif(val >= 50 || val <= 25) {\n\t\treturn \"Out\";\n\t}\n\treturn \"In\";\n}", "function operation(operator) {\n\n document.getElementById('oper').innerHTML = operator;\n console.log(previousVal);\n if (opt == '+') { var reducer = (previousVal, displayVal) => previousVal + displayVal; }\n else if (opt == '-') { var reducer = (previousVal, displayVal) => previousVal - displayVal; }\n else if (opt == '*') { var reducer = (previousVal, displayVal) => previousVal * displayVal; }\n else if (opt == '/') { var reducer = (previousVal, displayVal) => previousVal / displayVal; }\n else if (opt == '=') { var reducer = (previousVal, displayVal) => previousVal + \" \"; }\n result = reducer((+previousVal), (+displayVal));\n document.getElementById('result').value = result;\n previousVal = result;\n opt = operator;\n displayVal = \" \";\n}", "function chooseOperation(op){\n if(currentOperand === '') return; //if no number exists in currentOperand do nothing just return\n if(previousOperand !== ''){ // if some number \n doComputation();\n }\n operation=op;\n previousOperand=currentOperand;\n currentOperand='';\n}", "function testLogicalOr(val) {\n // Only change code below this line\n\n if (val<10 || val >20) {\n   return \"Outside\";\n }\n\n // Only change code above this line\n return \"Inside\";\n}", "function operator(char) {\n\tlet c\n\tswitch(char) {\n\t\tcase \"+\": c = Plus\n\t\t\tbreak;\n\t\tcase \"-\": c = Minus\n\t\t\tbreak;\n\t\tcase \"*\": c = Times\n\t\t\tbreak;\n\t\tcase \"/\": c = Div\n\t\t\tbreak;\t\n\t}\n\treturn c\t\n}", "function isOperator(ch){\n return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '%');\n }", "function operatorTrigger(operator, screen)\n{\n\tlastValue = parseFloat(screen.text);\n\toperation = operator;\n\tscreen.text = \"0\";\n}", "function areOperatorsOk(arr){\r\n\r\n //first element cannot be a restricted Operator\r\n if(restrictedOperators.indexOf(arr[0])!=-1) {\r\n console.log('First character cannot be ' + arr[0]);\r\n return 0;\r\n }\r\n //last element cannot be an operator\r\n if(operators.indexOf(arr[arr.length-1])!=-1){\r\n console.log('last character cannot be ' + arr[0]);\r\n return 0;\r\n }\r\n\r\n for (var i=1;i<arr.length;i++){\r\n //impossible to have two signs next to each other\r\n if((operators.indexOf(arr[i]))!=-1 && (operators.indexOf(arr[i-1]))!=-1){\r\n console.log('Two operators cannot be next to each other');\r\n return 0;\r\n }\r\n //impossible to have a closing bracket just after an operator\r\n if((arr[i])==')' && (operators.indexOf(arr[i-1]))!=-1){\r\n console.log('impossible to have a closing bracket just after an operator');\r\n return 0;\r\n }\r\n }\r\n return 1;\r\n}", "function testOperator(c, d) {\n\t\t'use strict';\n\n\t\tif (c === EQ && d === EQ) {\n\t\t\treturn [EQOP, 2, 30];\n\t\t}\n\t\tif (c === EXCLAIM) {\n\t\t\tif (d === EQ) {\n\t\t\t\treturn [NEOP, 2, 30];\n\t\t\t}\n\t\t\treturn [NOTOP, 1, 50];\n\t\t}\n\t\tif (c === LT) {\n\t\t\tif (d === EQ) {\n\t\t\t\treturn [LEOP, 2, 40];\n\t\t\t}\n\t\t\treturn [LTOP, 1, 40];\n\t\t}\n\t\tif (c === GT) {\n\t\t\tif (d === EQ) {\n\t\t\t\treturn [GEOP, 2, 40];\n\t\t\t}\n\t\t\treturn [GTOP, 1, 40];\n\t\t}\n\n\t\tif (c === AND && d === AND) {\n\t\t\treturn [ANDOP, 2, 20];\n\t\t}\n\t\tif (c === OR && d === OR) {\n\t\t\treturn [OROP, 2, 10];\n\t\t}\n\n\t\tif (c === LBRACK) {\n\t\t\treturn [LBRACKOP, 1, 5];\n\t\t}\n\t\tif (c === RBRACK) {\n\t\t\treturn [RBRACKOP, 1, 0];\n\t\t}\n\t\tif (c === LPAREN) {\n\t\t\treturn [LPARENOP, 1, 5];\n\t\t}\n\t\tif (c === RPAREN) {\n\t\t\treturn [RPARENOP, 1, 0];\n\t\t}\n\t}", "function operator(op) {\n var val = parseFloat(display.innerHTML);\n if(val) {\n array.push(val);\n array.push(op);\n display.innerHTML = '';\n } else if (typeof array[array.length -1] !== 'number' && array.length !== 0) { // change previous operator to current operator\n array.pop();\n array.push(op);\n }\n }", "function logicCalculator(n){\n if(operator == \"\"){\n setFirstNumber(parseInt(firstNumber.toString() + n.toString()));\n setStringCalculation(parseInt(firstNumber.toString() + n.toString()));\n }\n\n if((n == \"/\" || n == \"*\" || n == \"+\" || n == \"-\") && secondNumber == 0){\n setStringCalculation(firstNumber.toString() + n);\n setOperator(n);\n }\n\n if(operator != \"\"){\n setSecondNumber(parseInt(secondNumber.toString() + n.toString()));\n setStringCalculation(firstNumber + operator + parseInt(secondNumber.toString() + n.toString()))\n }\n\n if(n == \"=\"){\n let result= 0;\n if(operator == \"+\"){\n result = firstNumber + secondNumber;\n } else if(operator == \"-\"){\n result = firstNumber - secondNumber;\n } else if(operator == \"/\"){\n result = firstNumber / secondNumber;\n } else if(operator == \"*\"){\n result = firstNumber * secondNumber;\n }\n setStringCalculation(result);\n setOperator(result);\n setFirstNumber(result);\n setSecondNumber(0);\n }\n\n }", "function arithmaticOpration(){\n\taddition();\n\tSubstration();\n\tMultiplication();\n\tDivision();\n\tModulus();\n\tIncrementPost();\n\tDecrementPre();\n\tPostPre();\n\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}", "function testLogicalOR(val) {\n /*if (val < 10) {\n return \"Outside\";\n }\n\n if (val > 20) {\n return \"Outside\";\n }*/\n\n // Different way to write the commented code above:\n\n if ((val < 10) || (val > 20)) {\n return \"Outside\";\n }\n\n return \"Inside\";\n}", "function evaluate() {\n var operand = resultdiv.innerHTML.split(operator);\n resultdiv.innerHTML = Math.floor(eval(parseInt(operand[0],2)\n + operator + parseInt(operand[1],2)\n )).toString(2);\n operator = '';\n}", "function checkIfLastOperatorforMinus() {\n var lastChar = screenContent.substr(screenContent.length - 1);\n var operator = [\"+\", \"-\"];\n for (i = 0; i < operator.length; i++) {\n if (operator[i] === lastChar) {\n return true;\n }\n }\n return false;\n }", "function setOperators(number){\n operator = number;\n flag = true;\n\n //a bunch of ifs and if elses to place the correct operator\n if(operator === 4){\n display.innerHTML += \" / \";\n opString = \" / \";\n }else if(operator === 3){\n display.innerHTML += \" * \";\n opString = \" * \";\n }else if(operator === 2){\n display.innerHTML += \" - \";\n opString = \" - \";\n }else if(operator === 1){\n display.innerHTML += \" + \";\n opString = \" + \";\n }\n\n //only allows for one operator at a time\n if(flag === true){\n display.innerHTML = num1 + opString;\n num2 = \"\";\n }\n\n //if we pressed an operator and there is no num1, clear everything\n if(flag===true && num1 === \"\"){\n clearButton();\n }\n\n //if we have already solved the math problem clear everything\n if(equalTo === true){\n clearButton()\n }\n}" ]
[ "0.6438895", "0.642005", "0.6313619", "0.62660766", "0.6227004", "0.6225525", "0.6188781", "0.6183561", "0.6156366", "0.6130344", "0.61180115", "0.61111593", "0.6096394", "0.60957605", "0.6085068", "0.60707194", "0.60658646", "0.6021382", "0.601934", "0.601841", "0.60129464", "0.6003427", "0.59970653", "0.5946814", "0.5938626", "0.5935574", "0.59270614", "0.59258485", "0.59248555", "0.591522", "0.5904308", "0.5903395", "0.5895786", "0.5872097", "0.5868282", "0.58626467", "0.5859999", "0.58547276", "0.585401", "0.5850326", "0.5827828", "0.58249086", "0.5815566", "0.58015674", "0.5797426", "0.5796514", "0.57962483", "0.579375", "0.5792238", "0.5791063", "0.57906884", "0.5784781", "0.57841754", "0.5783227", "0.57806623", "0.57802385", "0.57798684", "0.57778394", "0.5769706", "0.57652855", "0.5761473", "0.5760175", "0.57557553", "0.57463753", "0.57454985", "0.57445496", "0.5734647", "0.573406", "0.57279193", "0.5715555", "0.5704601", "0.5704437", "0.56916183", "0.56901264", "0.56895185", "0.5688108", "0.5685264", "0.5678796", "0.56777954", "0.5674782", "0.56747264", "0.56714404", "0.5660792", "0.5657747", "0.56568295", "0.56538785", "0.5653099", "0.5648848", "0.56470346", "0.5645879", "0.5642936", "0.5636639", "0.56226087", "0.56188864", "0.56123304", "0.56078297", "0.5601106", "0.55948484", "0.5590531", "0.55903614", "0.55889535" ]
0.0
-1
End of operator logic Start of equals function
function equalsFn (arithmetic) { output.innerHTML = arithmetic(Number(firstNum), Number(output.innerHTML)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "equals() {\n return false;\n }", "equals() {\n return false;\n }", "Equals() {\n\n }", "Equals() {\n\n }", "function eq(a, b) {\n return a === b;\n }", "function equals(){\n switch(savedOperation) {\n case '/':\n value = divide(savedValue, value);\n break;\n case '*':\n value = mult(savedValue, value);\n break;\n case '-':\n value = sub(savedValue,value);\n break;\n case '+':\n value = add(savedValue, value);\n break;\n }\n savedOperation = 'none';\n savedValue = 0;\n draw();\n}", "function handleEquals() {\n if (previousOperator === null) {\n // you need 2 numbers to do math\n } else {\n // finish the math sum, reset to defaults\n flushOperation(parseInt(calcDisplay));\n previousOperator = null;\n calcDisplay = runningTotal;\n runningTotal = 0;\n }\n}", "eq_(one, another) {\n return one === another;\n }", "function BOT_wordIsEqu(word) {\r\n\tif(word == \"eq\") return(true) \r\n}", "equalValue(rhs) {\n return this.l === rhs.l && this.a === rhs.a && this.b === rhs.b;\n }", "function equal (lhs, rhs) {\n return lhs === rhs;\n }", "eq(other) { return this == other; }", "function checkEquality(a, b) {\n return a === b;\n }", "function equals() {\n\tlet lastEntry = equation[equation.length - 1];\n\tlet isAnOperator = /[+-/*]/;\n\n\tif (entry.length === 0 && isAnOperator.test(lastEntry) === true) {\n\t\tequation.pop();\n\t}\n\tif (entry.length - 1 === \".\") {\n\t\tentry.pop();\n\t} else if (equation.length < 2) {\n\t\tequation.push(entry.join(\"\"));\n\t\toutput.textContent = \"error\";\n\t\tformula.textContent = equation.join(\" \"); //show user the faulty formula\n\n\t\tequation = [];\n\t\tentry = [];\n\t\tresult = 0;\n\t\tdecimal = null;\n\t\treturn;\n\t}\n\tif (entry.length === 1) equation.push(Number(entry));\n\tif (entry.length > 1) equation.push(Number(entry.join(\"\")));\n\n\tlet final = equation.join(\" \").toString();\n\tresult = eval(final);\n\n\toutput.textContent = result.toString().slice(0, 10);\n\tformula.textContent = (equation.join(\" \") + \" = \" + result)\n\t\t.toString()\n\t\t.slice(0, 50);\n\tequation = [];\n\tentry = [];\n\tdecimal = null;\n\tresult = 0;\n}", "function funcInEqualOperator(val){\r\n if(val != '12'){\r\n return \"It is not Equal\";\r\n }\r\n return \"Equal\";\r\n}", "function matchEqual() {\n\t\tvar pattern = /^=/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function equal() {\n\t// check if inuse operator is not undefined to prevent running equal() when\n\t// there's no operator in use\n\tif (inuseOperator !== undefined) {\n\t\t// Testing: for checking if display is NaN\n\t\tif (isNaN(parseInt(display.innerHTML))) {\n\t\t\tconsole.log(display.innerHTML);\n\t\t\tdisplay.innerHTML = \"Syntax Error\";\n\t\t}\n\t\t// check if current no. is undefined\n\t\t// to indicate whether the operation should be repeated\n\t\tif (currentNum === undefined) {\n\t\t\tdisplay.innerHTML = parseFloat(prevNum) + parseFloat(prevNum);\n\t\t} else {\n\t\t\tdisplay.innerHTML = parseFloat(prevNum) + parseFloat(currentNum);\n\t\t}\n\n\t\t// Change \"delete\" button (x) to (=)\n\t\tvar x = document.querySelector('.clear-entry');\n\t\tx.innerHTML = \"=\";\n\t\tx.className += \" no-border\";\n\n\t\tprevNum = display.innerHTML;\n\t\tconsole.log(prevNum);\n\t} else {\n\t\tconsole.log(\"Can't perform anything, operator is undefined\");\n\t}\n}", "function isEqual(a, b) {\r\n return eq(a, b);\r\n }", "equals(...equalsArgs) {\n return equals_.apply(env, equalsArgs);\n }", "equals(secondQ) {\n\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function isEqual(a, b) {\n return eq(a, b);\n }", "function equalsSign() {\n if (isSign === false || x === undefined || y === undefined) {;\n return;\n }\n number.length = 0;\n getTotal();\n lastEquals = true;\n}", "function equalityExpr(stream, a) { return binaryL(relationalExpr, stream, a, ['=','!=']); }", "function equalityExpr(stream, a) { return binaryL(relationalExpr, stream, a, ['=','!=']); }", "equals(equals , dependentVal){\n if(dependentVal == equals){\n return true;\n }else{\n return false;\n }\n}", "EqualityExpression() {\n return this._BinaryExpression('RelationalExpression', 'EQUALITY_OPERATOR');\n }", "AssignmentOperator() {\n if (this._lookahead.type === 'SIMPLE_ASSIGN') {\n return this._eat('SIMPLE_ASSIGN');\n }\n return this._eat('COMPLEX_ASSIGN');\n }", "_equal(a, b) {\n return a === b;\n }", "get defaultOperator() {\n return OperatorType.equal;\n }", "get defaultOperator() {\n return OperatorType.equal;\n }", "get defaultOperator() {\n return OperatorType.equal;\n }", "function looseEqual(a, b) {\n return true;\n }", "_isAssignmentOperator(tokenType) {\n return tokenType === 'SIMPLE_ASSIGN' || tokenType === 'COMPLEX_ASSIGN';\n }", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n }", "function visitPlusEquals(node) {\n node.operator = '=';\n node.right = b.callExpression(\n b.memberExpression(node.left, b.identifier('concat'), false),\n [node.right]\n );\n}", "function _equals(_x4, _x5) {\n var _again = true;\n\n _function: while (_again) {\n var a = _x4,\n b = _x5;\n _again = false;\n\n if (a === b || a !== a && b !== b) {\n // true for NaNs\n return true;\n }\n\n if (!a || !b) {\n return false;\n }\n\n // There is probably a cleaner way to do this check\n // Blame TDD :)\n if (a && typeof a.constructor === 'function' && a.constructor.unionFactory === Union) {\n if (!(b && typeof b.constructor === 'function' && b.constructor.unionFactory === Union)) {\n return false;\n }\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (a.name !== b.name) {\n return false;\n }\n _x4 = a.payload;\n _x5 = b.payload;\n _again = true;\n continue _function;\n }\n\n // I hate this block. Blame immutablejs :)\n if (typeof a.valueOf === 'function' && typeof b.valueOf === 'function') {\n a = a.valueOf();\n b = b.valueOf();\n if (a === b || a !== a && b !== b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n }\n if (typeof a.equals === 'function' && typeof b.equals === 'function') {\n return a.equals(b);\n }\n return false;\n }\n}", "function compareEquality(a, b) {\n\tif (a === b) { // Change this line\n\t return \"Equal\";\n\t}\n\treturn \"Not Equal\";\n }", "equals() {\n //add current display number to previous display \n this.previousOperand.innerText = this.previousOperand.innerText + this.currentOperand.innerText.toString();\n\n //make current display be the result of previous display calculations\n this.currentOperand.innerText = eval(this.previousOperand.innerText);\n\n //clear previous display \n this.previousOperand.innerText = '';\n\n console.log(this.previousOperand.innerText);\n }", "function Equal(left, right) {\r\n return equal_1.ValueEqual.Equal(left, right);\r\n }", "function Function$prototype$equals(other) {\n return other === this;\n }", "function Function$prototype$equals(other) {\n return other === this;\n }", "equals(value1, value2, message, prev){\n\t\tif (message == undefined) message=\"\";\n\t\tif (prev == undefined) prev=null;\n\t}", "function eq(x, y) {\n return util.inspect(x, true, null) === util.inspect(y, true, null);\n }", "function equals(num1, num2) {\n if (num1===num2) {\n return 'EQUAL'\n } else {\n return 'UNEQUAL'\n }\n\n}", "function AssignmentOperator(){\nequalAssOP();\naddAssigOp();\nsubAssigOp();\n}", "function checkEqual(a, b) {\n /*if(a == b) {\n return true;\n }\n else {\n return false;\n }\n}*/\n return a === b ? true : false;\n}", "function checkAssignmentExpression(node) {\n if (node.operator !== '=') {\n // the other operators can make sense\n return;\n }\n\n if (areExpressionsEquivalent(node.left, node.right)) {\n // TODO: good way to get the lhs and provide better error message\n context.report(node, \"A variable is set to itself, which may be a logic bug or a typo.\");\n }\n }", "function testEqual(val) {\n if (val == 12) { // equality operator compares two values and returns true if value is equal or false if not equal\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function compareEquality(a, b) {\n if (a === b) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function compareEquality(a, b) {\n if (a === b) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function compareEquality (a , b) {\r\n if (a === b) {\r\n return \"it's equal\";\r\n }\r\n return \"not equal\";\r\n }", "function equal(value1, value2) {\n return value1 === value2;\n}", "eq(other) { return false; }", "function true_tripe_equal() { \r\nA = \"Magnus\";\r\nB = \"Magnus\";\r\ndocument.write(A === B); //true\r\n}", "function isEqual(a,b){\n return a === b\n}", "function equal_func() {\n var a = 50 == 50\n var b = 2 == 10\n document.getElementById(\"equal\").innerHTML = a + \"<br>\" + b;\n}", "function sc_isEq(o1, o2) {\n return (o1 === o2);\n}", "function equal (a,b,c) {\n\tif (a === b && b === c) {\n\t\treturn true;\n\t}\n\telse \n\t\treturn false;\n}", "function _equals(a, b) {\n if (a === b || (a !== a && b !== b)) { // true for NaNs\n return true;\n }\n\n if (!a || !b) {\n return false;\n }\n\n // There is probably a cleaner way to do this check\n // Blame TDD :)\n if (a && typeof a.constructor === 'function' &&\n a.constructor.unionFactory === Union) {\n if (!(b && typeof b.constructor === 'function' &&\n b.constructor.unionFactory === Union)) {\n return false;\n }\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (a.name !== b.name) {\n return false;\n }\n return _equals(a.payload, b.payload);\n }\n\n // I hate this block. Blame immutablejs :)\n if (typeof a.valueOf === 'function' &&\n typeof b.valueOf === 'function') {\n a = a.valueOf();\n b = b.valueOf();\n if (a === b || (a !== a && b !== b)) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n }\n if (typeof a.equals === 'function' &&\n typeof b.equals === 'function') {\n return a.equals(b);\n }\n return false;\n}", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function clickEquals() {\n let result\n\n if (operator === '+') {\n result = Number(firstOperand) + Number(secondOperand)\n }\n\n if (operator === '-') {\n result = Number(firstOperand) - Number(secondOperand)\n }\n\n if (operator === '*') {\n result = Number(firstOperand) * Number(secondOperand)\n }\n\n if (operator === '/') {\n result = Number(firstOperand) / Number(secondOperand)\n }\n\n setDisplay(parseFloat(result.toFixed(8)).toString())\n }", "function eq(value,condition) {\n return value === condition;\n }", "function eq(value,condition) {\n return value === condition;\n }", "isChainable() {\r\n\t\t\t\t\tvar ref1;\r\n\t\t\t\t\treturn (ref1 = this.operator) === '<' || ref1 === '>' || ref1 === '>=' || ref1 === '<=' || ref1 === '===' || ref1 === '!==';\r\n\t\t\t\t}", "function checkEqual (a,b){\n return a==b? true : false ;\n}", "equals(other) {\n // If both literals were created by this library,\n // equality can be computed through ids\n if (other instanceof Literal) return this.id === other.id; // Otherwise, compare term type, value, language, and datatype\n\n return !!other && !!other.datatype && this.termType === other.termType && this.value === other.value && this.language === other.language && this.datatype.value === other.datatype.value;\n }", "function equalClicked(){\n\tsecondMemory = Number($display.val());\n\tif(operator === \"+\"){\n\t\tfirstMemory = add(firstMemory, secondMemory);\n\t} else if(operator === \"-\"){\n\t\tfirstMemory = substract(firstMemory, secondMemory);\n\t} else if(operator === \"×\"){\n\t\tfirstMemory = multiply(firstMemory, secondMemory);\n\t} else if(operator === \"÷\"){\n\t\tfirstMemory = divide(firstMemory, secondMemory);\t\n\t}\n\tshowOnDisplay(firstMemory);\n\tsecondMemory = 0;\n\tneedNewNum = true;\n\tisThereDot = false;\n\tchain = false;\n\tnumEntered = false;\n}", "isEqual(x, y) {\n return this.x === x && this.y === y;\n }", "function equals() {\n if (!$('.equation').text() == \"\") {\n del = false;\n $('.delete').find('span').text('CLR');\n $('.equation').hide();\n $('.result').css('font-size', 'x-large');\n }\n }", "function Boolean$prototype$equals(other) {\n return typeof this === 'object' ?\n equals (this.valueOf (), other.valueOf ()) :\n this === other;\n }", "equals(other) {\n // If both literals were created by this library,\n // equality can be computed through ids\n if (other instanceof Literal) return this.id === other.id;\n // Otherwise, compare term type, value, language, and datatype\n return !!other && !!other.datatype && this.termType === other.termType && this.value === other.value && this.language === other.language && this.datatype.value === other.datatype.value;\n }", "function compareEquality(a, b){\n if (a === b){ // change the operator to equality operator to see diff result\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function equal ()\n{\n\tif (operator) {\n\t\telement.push(number)\n\t}\n\tswitch(operator)\n\t{\n\tcase \"+\":\n\tresult = Number(element[element.length -2]) + Number(element[element.length - 1]);\n\tbreak;\n\n\tcase \"-\":\n\tresult = Number(element[element.length -2]) - Number(element[element.length - 1]);\n\tbreak;\n\n\tcase \"/\":\n\tresult = Number(element[element.length -2]) / Number(element[element.length - 1]);\n\tbreak;\n\n\tcase \"*\":\n\tresult = Number(element[element.length -2]) * Number(element[element.length - 1]);\n\tbreak;\n\t}\n\tnumber = result;\n\telement = [];\n\toperator = \"\";\n\tdisplayF(result);\n}", "function dwscripts_getEqualsStatement(left, right)\n{\n var retVal = null;\n var serverObj = dwscripts.getServerImplObject();\n\n if (serverObj != null && serverObj.getEqualsStatement != null)\n {\n retVal = serverObj.getEqualsStatement(left, right);\n }\n\n return retVal;\n}", "function eq3(a, b, c) {\n\tconsole.log(a, b, c)\n\tif (a === b && a === c) {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}", "function equals3(a, b, c) {\n return a == b && b == c && a != '';\n }", "function testEqual(val) {\n if (val == 12) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function compareEquality1(a, b) {\n\tif(a == b) {\n\t\treturn \"Equal\";\n\t}\n\treturn \"Not Equal\";\n}", "equalsTo(operand){\r\n return (this.hours === operand.hours && this.minutes === operand.minutes);\r\n }", "function isEquals() {\n return reponse == nb2;\n}", "function equals(){\n if(calculator.enabled){\n calculator.history = calculator.displayValue;\n calculator.result = parseFloat(eval(calculator.displayValue).toFixed(5));\n if(calculator.result == calculator.displayValue){\n clearInput();\n }else{\n calculator.resultReady = true;\n //Arranging how the result should be displayed\n if((calculator.history.length+calculator.result.length)>=20){\n calculator.displayValue =`${calculator.displayValue}=`+`<br>`+`${calculator.result}`; \n }else{\n calculator.displayValue =`${calculator.displayValue}=${calculator.result}`; \n }\n //Displaying \"Error\" if the result in not a number\n if(isNaN(calculator.result)){\n calculator.displayValue = `Error`;\n }\n }\n }\n}", "function isEqualFormula_(formula) {\n return formula.length > 0 && formula[0] == \"=\";\n}", "get d812() { return this.c1.same(this.c8) && this.c2.same(this.c8) }", "eq(other) {\n return this.search == other.search && this.replace == other.replace &&\n this.caseSensitive == other.caseSensitive && this.regexp == other.regexp &&\n this.wholeWord == other.wholeWord;\n }", "function areTheseTheSame( thing1, thing2 ){\n if( thing1 == thing2 ){\n console.log( 'the same with ==' );\n }\n else{\n console.log( 'different with ==' );\n }\n if( thing1 === thing2 ){\n console.log( 'the same with ===' );\n }\n else{\n console.log( 'different with ===' );\n }\n} // end isTheTruth", "function String$prototype$equals(other) {\n return typeof this === 'object' ?\n equals (this.valueOf (), other.valueOf ()) :\n this === other;\n }", "function defaultEqualityCheck(a, b) {\n return !a && !b || a === b;\n }", "function testEqual(val) {\n if (val == 12) {\n return \"equal\";\n }\n return \"not equal\";\n}", "equals(other) {\n return !!other && this.subject.equals(other.subject) && this.predicate.equals(other.predicate) && this.object.equals(other.object) && this.graph.equals(other.graph);\n }", "function matchAssign() {\n var op;\n \n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }", "eq(other) {\n return this.content.eq(other.content) && this.openStart == other.openStart && this.openEnd == other.openEnd;\n }", "function equalityTest(myVal) {\n if (myVal == 10) {\n return \"Equal\";\n }\n return \"Not Equal\";\n}" ]
[ "0.70117974", "0.70117974", "0.6799219", "0.6799219", "0.67574215", "0.6714422", "0.6670991", "0.6650868", "0.6635945", "0.6469188", "0.6423914", "0.6328103", "0.6318331", "0.6314965", "0.63020474", "0.6276517", "0.6268106", "0.62232924", "0.6181875", "0.61738473", "0.61647874", "0.61647874", "0.61647874", "0.61647874", "0.61647874", "0.61647874", "0.61647874", "0.61647874", "0.61647874", "0.6133439", "0.61169976", "0.61169976", "0.61115295", "0.60930055", "0.6081204", "0.6074526", "0.6021478", "0.6021478", "0.6021478", "0.5987418", "0.59782726", "0.59755033", "0.59645224", "0.5962938", "0.5959229", "0.5957438", "0.5939508", "0.59382063", "0.59382063", "0.59379077", "0.59330547", "0.5928692", "0.5924924", "0.592255", "0.59137696", "0.5906317", "0.588779", "0.588779", "0.58783966", "0.586131", "0.5849628", "0.5844738", "0.5844156", "0.5843733", "0.5834094", "0.5832855", "0.5824173", "0.58111995", "0.58111995", "0.5802968", "0.5800834", "0.5800834", "0.5795103", "0.57945234", "0.5791494", "0.57888263", "0.57871", "0.57865876", "0.57836765", "0.57815766", "0.57811284", "0.5778676", "0.5774792", "0.5767868", "0.5752261", "0.5746288", "0.5739875", "0.57307714", "0.57295406", "0.57237697", "0.5722141", "0.57145214", "0.57129717", "0.5711499", "0.5707212", "0.56953293", "0.56921446", "0.5691133", "0.5688118", "0.56861913", "0.5679373" ]
0.0
-1
Creating useState and useEffect
function FetchData() { const [items, setItems] = useState([]); useEffect(() => { fetchItems(); }, []); //fetch items from api/json file "http://jsonplaceholder.typicode.com/photos" //send error if bad http status //usin ?albumId=1 to get data only from album 1 from http://jsonplaceholder.typicode.com/photos const fetchItems = async () => { const data = await fetch( "https://jsonplaceholder.typicode.com/photos?albumId=1" ); if (!data.ok) { const message = `Something went wrong: ${data.status}`; throw new Error(message); } const items = await data.json(); console.log(items); setItems(items); const itemToString = JSON.stringify(data); console.log(itemToString); }; //Using map to handle each items ---> //using Link to select page ---> return ( <div className="container"> <h1>Photo Browser</h1> <div className="images"> {items.map((item) => ( <Link key={item.id} to={`/PhotoPage/${item.id}`}> <img className="image" loading="lazy" src={item.thumbnailUrl} alt={item.title} /> </Link> ))} </div> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function YourBooking() {\n const [Allbooking, setAllBooking] = useState([]);\n const history = useHistory();\n const Auth = localStorage.getItem(\"current\") === \"true\";\n useEffect(function () {\n // when anything changes this is what you should use to update?? but y do i need this when usestate also rerenders and update the\n if (Auth !== true) {\n history.push(\"/signin\");\n } else {\n // when does useeffect run?? thought hooks also renders page,so if useffect runs only one time and set hook renders then, it should also result in infinite loop but it doesn't y?\n axios.post(\"/yourbooking\").then(function (res) {\n setAllBooking(res.data.booking);\n });\n }\n }, []);\n return (\n <section id=\"yourbookings\">\n <h3 className=\"booking-header\">Your Reservation</h3>\n <ul className=\"list-group\">\n {Allbooking.length !== 0 ? (\n Allbooking.map((props, index) => (\n <YourBookingItem key={index} userinfo={props} index={index} />\n ))\n ) : (\n <p>Your Reservation does not exist</p>\n )}\n </ul>\n </section>\n );\n}", "function App() {\n // const [count, setCount] = useState(0);\n // const [languge, setLanguge] = useState('THAI');\n // const [users, setUsers] = useState([\n // {\n // id: 0,\n // name: 'John',\n // username: 'johndoe',\n // phone: 1234567890,\n // },\n // ]);\n // Don't Have Dependency\n // useEffect(() => {\n // console.log(i);\n // console.log('Effect Call');\n // i++;\n // document.title = `You Click ${count} time`;\n // });\n // // ถ้าไม่ใส่ Dependency Array ทุกครั้งที่มีการ rerender จะเรียกใช้ useEffect ที่ไม่ใส่ Dependency Array\n // For Watch Dependency\n // useEffect(() => {\n // console.log(i);\n // console.log('Effect Call');\n // i++;\n // document.title = languge === 'THAI' ? 'สวัสดี รีแอค' : 'Hello React ';\n // // const getPost = async url =>{\n // // try{\n // // const res = await axios.get(url)\n // // console.log(res.data)\n // // }catch (err){\n // // console.log(err)\n // // }\n // // }\n // // getPost('https://jsonplaceholder.typicode.com/posts')\n // }, [count, languge]); // ถ้าใส่ dependency List เป็น Array เปล่า Effect จะทำงานแค่ครั้งแรกครั้งเดียว ที่ render Component\n // // ถ้าใส่เป็น Count เมื่อ Count เกิดการเปลี่ยนแปลง Effect จะทำงาน ค่า ที่อยู่ใน Depemdency Array จะเป็นตัวที่ useEffect สังเกตุว่า ตัวไหนเปลี่ยนแปลงปล้วจะทำงาน\n // // For Call API\n // useEffect(() => {\n // const fetchUsers = async () => {\n // try {\n // const res = await axios.get(\n // 'https://jsonplaceholder.typicode.com/users'\n // );\n // setUsers(res.data);\n // // console.log(res.data);\n // } catch (err) {\n // console.log(err);\n // }\n // };\n // fetchUsers();\n // }, []);\n // return (\n // <div>\n // {/* <h1>Hello useEffect</h1>\n // <button onClick={() => setCount(current => current + 1)}>Click</button>\n // <button\n // onClick={() =>\n // setLanguge(current => (current === 'THAI' ? 'ENG' : 'THAI'))\n // }\n // >\n // Change Languge\n // </button> */}\n // <ul>\n // {users.map(item => (\n // <li key={item.id}>\n // <p>{item.name}</p>\n // <p>{item.username}</p>\n // <p>{item.phone}</p>\n // </li>\n // ))}\n // </ul>\n // </div>\n // );\n\n // const [secound, setSecound] = useState(0);\n\n // useEffect(() => {\n // setInterval(() => {\n // setSecound(current => current + 1);\n // }, 1000);\n // });\n\n const [show, setShow] = useState(true);\n\n return (\n <>\n <button onClick={() => setShow(current => !current)}>\n Toggle Counter\n </button>\n {show && <Counter />}\n </>\n );\n}", "function Infinite() {\n console.log('render');\n // useEffect(() => {\n // console.log('useEffect');\n // let num = Math.random() * 100;\n // setCount(num);\n // })\n // Example if data is getting from api so make useEffect as componentDidMount\n useEffect(() => {\n console.log('useEffect');\n let num = Math.random() * 100;\n // Here avoid change in statte in useEffect\n setCount(num);\n }, [])\n const [count, setCount] = useState(0);\n return (\n <div>\n <h1>{count}</h1>\n <button onClick={() => setCount(count + 1)}>Click</button>\n </div>\n )\n}", "function App() {\n // console.log(useState()); // Vemos la Array [value, function]\n // ********* State Values ************\n // Array destructure Para alojar Valores de Hook --->\n const [expenses, setExpenses] = useState(initialExpenses);\n // console.log(expenses); // Vemos que funciona!\n // Single Expense: (State Value)\n const [charge, setCharge] = useState(''); // Damos Valor inicial al State: EMPTY\n // Single Amount: (State Value)\n const [amount, setAmount] = useState(''); // Damos Valor inicial al State: EMPTY\n // ---> Luego iremos Alojando Valores al State <---\n // Alert:\n const [alert, setAlert] = useState({ show: false });\n // ---> Usaremos dicha alert en la Function\n // For Edit Functionality:\n const [edit, setEdit] = useState(false);\n const [id, setId] = useState(0);\n //\n //********* USE EFFECT **********/\n // USE EFFECT, PARA LOCAL STORAGE:\n // Usamos el HOOK --->\n useEffect(() => {\n // A EVITAR:\n // console.log('Use Effect');\n // Vemos que se USA TODO EL TIEMPO\n // por la cualidad de react de actualizar todo por separado.\n // ---\n // Local Storage.\n localStorage.setItem('expenses', JSON.stringify(expenses));\n // Pasamos--> key: \"expenses\" value: Array Expenses\n }, [expenses]);\n //[expenses] --> Hara que cargue SOLO CUANDO HAY UN CAMBIO EN EL STATE EXPENSES\n // [] --> Hara que cargue solo UNA VEZ AL CARGAR LA PAGE,\n // pero queremos que se actualize cuando hay cambio en nuestro state\n\n // ********* Functionality ***********\n // Dichas Functions las tendremos que pasar en el FORM <----------------\n // Handle Charge --> Pasaremos los valores escritos de input directamente al State Empty\n const handleCharge = (e) => {\n setCharge(e.target.value);\n };\n const handleAmount = (e) => {\n setAmount(e.target.value);\n };\n const handleSubmit = (e) => {\n e.preventDefault();\n // console.log(charge, amount); // Vemos que Tenemos Ambos Valores\n // Entonces ---> Deberiamos pasar dichos valores al Expenses Array.\n //\n // IF NOT EMPTY VALUES:\n if (charge !== '' && amount > 0) {\n //********** EDIT ************/\n if (edit) {\n // Edit: True\n let tempExpenses = expenses.map((item) => {\n // SI MATCHEA: Cambiamos charge y amount de lo que tenga ...item\n // SI NO MATCHEA: devolvemos Item normal.\n return item.id === id ? { ...item, charge, amount } : item;\n });\n setExpenses(tempExpenses); // Pasamos New Array\n setEdit(false); // Devolvemos Edit:False\n handleAlert({ type: 'success', text: 'Item Edited' }); // Alert de Success\n } else {\n //********* Submit Normal **********/\n // Creamos un Objeto para alojarlo en el Array:\n const singleExpense = { id: uuidv4(), charge, amount };\n // Initial State: NO PODEMOS PASAR OBJECT, tenemos que pasar el Array que contengan Objects\n // Ademas: Deberá contener lo anterior: Spread operator\n setExpenses([...expenses, singleExpense]);\n // Alert ------> SI hay valores pasados (charge y amount)\n handleAlert({ type: 'success', text: 'Item Added' });\n }\n // Limpiamos los Values de los Inputs:\n setCharge('');\n setAmount('');\n } else {\n //Handle Alert -----> SI NO HAY VALORES\n handleAlert({ type: 'danger', text: `Cannot be Empty` });\n }\n };\n const handleAlert = ({ type, text }) => {\n setAlert({ show: true, type, text });\n\n // Que desaparezca a los 2.5s --> Mostrando False nuevamente\n setTimeout(() => {\n setAlert({ show: false });\n }, 2500);\n };\n\n //*************** Btns *******************\n // Clear All:\n const clearItems = () => {\n // console.log('Item CLEAR'); // Funciona\n setExpenses([]); // On Click pasamos un Empty Array. al State Inicial.\n handleAlert({ type: 'danger', text: 'List Cleared' });\n };\n // Delete Item:\n const handleDelete = (id) => {\n // Iteramos Array, devolvemos los que NO match el ID clickeado.\n // console.log(`Deleted: ${id}`); // Vemos que funciona\n let tempExpenses = expenses.filter((item) => item.id !== id);\n // console.log(tempExpenses); // Vemos que funciona\n setExpenses(tempExpenses); // NO PONEMOS ARRAY, YA QUE FILTER DEVUELVE ARRAY\n handleAlert({ type: 'danger', text: 'Item Deleted' });\n };\n\n // Edit Item:\n const handleEdit = (id) => {\n // console.log(`Edit: ${id}`); // Funciona\n // Debemos agregar dos Hooks mas. Vemos Arriba (Edit y ID)\n let expense = expenses.find((item) => item.id === id); // Si item en Array comparte ID clickeada\n // console.log(expense); // Vemos el Object: ID, charge, amount\n // 1) Destructuramos EXPENSE y pasamos dichos valores a los INPUTS\n let { charge, amount } = expense;\n setCharge(charge);\n setAmount(amount);\n // 2) Edit TRUE\n setEdit(true);\n // 3) Usar el ID para re-editar el mismo Object (Se hace en HANDLE SUBMIT)\n setId(id);\n };\n\n // ********** Return ***************\n return (\n <React.Fragment>\n {alert.show && <Alert type={alert.type} text={alert.text}></Alert>}\n <Alert></Alert>\n <h1>Budget calculator</h1>\n <main className='App'>\n <ExpenseForm\n charge={charge}\n amount={amount}\n handleCharge={handleCharge}\n handleAmount={handleAmount}\n handleSubmit={handleSubmit}\n edit={edit}\n ></ExpenseForm>\n <ExpenseList\n expenses={expenses}\n handleDelete={handleDelete}\n handleEdit={handleEdit}\n clearItems={clearItems}\n ></ExpenseList>\n </main>\n <h1>\n total spending:{' '}\n <span className='total'>\n $\n {expenses.reduce((acc, curr) => {\n return (acc += parseInt(curr.amount));\n }, 0)}\n </span>\n </h1>\n </React.Fragment>\n );\n}", "function fixGestureHandler() {\n const [, set] = useState(0);\n\n useEffect(() => {\n set((v) => v + 1);\n }, []);\n}", "function Ue3() {\n const [cnt, setCnt] = useState(0);\n\n useEffect(() => {\n console.log(\"Log at the time of initial render only\");\n },[]);\n\n return (\n <React.Fragment>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n onClick={() => {\n setCnt((x) => x + 1);\n }}\n >\n {cnt}\n </Button>\n </React.Fragment>\n );\n}", "function EffectHookTwo() {\n const [count, setCount] = useState(0);\n const [time, setTime] = useState(new Date());\n\n const ticks = () => {\n setTime(new Date());\n };\n\n useEffect(() => {\n document.title = `Count ${count} Times`;\n }, [count]);\n\n useEffect(() => {\n let interval = setInterval(ticks, 1000);\n return () => {\n clearInterval(interval);\n };\n }, []);\n\n return (\n <div>\n <h2>Times: {time.toLocaleTimeString()} </h2>\n <button\n onClick={() => {\n setCount(count + 1);\n }}\n >\n Click : {count}\n </button>\n </div>\n );\n}", "function EffectOnlyOnce() {\n\n const [x, setX] = useState(0)\n const [y, setY] = useState(0)\n\n const logMousePosition = (e)=>{\n // console.log(\"Mouse Event\")\n setX(e.clientX)\n setY(e.clientY)\n }\n\n //To execute only once, just pass an empty array as second param\n useEffect(() => {\n console.log(\"useEffect Called from EffectOnlyOnce.js\")\n //this is a JavaScript specific function\n window.addEventListener(\"mousemove\", logMousePosition)\n }, [])\n\n return (\n <div>\n <p>Execute UseEffect only once when page loads to make it be componentDidMount()</p>\n <p>Mouse Position: X - {x} Y - {y}</p>\n </div>\n )\n}", "function useStateSafely(initialValue) {\n const [value, setValue] = useState(initialValue);\n const isSafe = useRef(true);\n\n useEffect(() => {\n return () => {\n isSafe.current = false;\n };\n }, []);\n\n const setValueSafely = (newValue) => {\n if (isSafe.current) {\n setValue(newValue);\n }\n };\n\n return [value, setValueSafely];\n}", "function App() {\n \nconst [values, setValues] = useState({\n firstName:\"\",\n email:\"\",\n password:\"\"\n});\n// const [showHello, setShowHello]= useState(true);\n\n//We will learn that useeffect (depends on State change as well as component mount) is used to for useEffect fn be called lesser by adding an array of dependency and do cleanup after loading of components\n// By default useEffect depends on all the states value changes but we can add an array of dependecies to call useEffect only on change of specific value in a state/ ex: [values.password, values.firstName]\n// or complete state like [values] so that useffect is not called on change of other states\n// useEffect is used to replace the old way of componentDidMount and ComponentDidUnmount\n// dependacy [] means dependacy is none that call useEffect only when it mounts wheras dependancy not mentioned means depends on all states\n// cleanup fn is return function of useeffect, and is called when a conponent is unmounted or old value of a state is cleaned which happens everytime we set a new value to a state\n// useEffect is triggered when state of anything in app changes, component is mounted and unmounted(clean up fn calleld), and when event listeners(mouseOver) are called inside useEffect\n// Till now all was basic now lets learn some use cases and make regular apps using it \n// 1. Events\n// 2. Having multiple useEffect on a component and they fireoff in order\n// 3. Fetch from an API url along \n// 4. to change data when API url changes\n// 5. useeffect can be called infinite times if we mistakly call a dependency to be changed in useeffect fn\n// 6. Local Storage localStorage.setItem('itemname', itemvalue); and localStorage.getItem(itemName);\n\n// useEffect(() => {\n// console.log(\"render\");\n// return () => {\n// console.log(\"unmount\");\n// }; \n// }, [values.password, values.firstName]);\n\n // useEffect(() => {\n // function onMouseOver(e){\n // console.log(e);\n // }\n // window.addEventListener(\"mouseover\",onMouseOver);\n // console.log(\"mounted\");\n // //control will stay here until component is unmounted and keep listening for event\n // return ()=> {\n // window.removeEventListener(\"mouseover\",onMouseOver);\n // };\n // },[]);\n\n // useEffect(() => {\n // console.log(\"useEffect 2 called\"); \n // return () => {\n // console.log(\"unmounted\");\n // }\n // },[]);\n\n const [count, setCount]= useState(() => JSON.parse(localStorage.getItem(\"count\")));\n const {data, loading}= useFetch('http://numberapi.com/'+count+'/trivia/');\n \n useEffect(() => {\n localStorage.setItem(\"count\", JSON.stringify(count));\n },[count]);\n\n function changeValues(event){\n const {name ,value}= event.target;\n setValues((prevValues) => {\n return({\n ...prevValues,[name]:value \n }) });\n }; \n \n return (\n <div className=\"App\">\n <header>\n <h1>Learn Useeffect</h1>\n </header>\n <div> {loading ? <h4>\"data is loading\"</h4> : <h4>{data}</h4> } </div>\n <button onClick={() => setCount(count+1)}>Increase</button>\n <button onClick={() => setCount(count-1)}>Decrease</button>\n {/* <button onClick={ () => setShowHello(!showHello)} >Toggle</button>\n {showHello && <Hello />} */}\n <input type=\"text\" placeholder=\"firstName\" name=\"firstName\" value={values.firstName} onChange={changeValues} /> \n <input type=\"text\" placeholder=\"email\" name=\"email\" value={values.email} onChange={changeValues} />\n <input type=\"text\" placeholder=\"password\" name=\"password\" value={values.password} onChange={changeValues} />\n </div>\n );\n}", "function App() {\n const [apod, setApod] = useState({});\n \n // take this out\n // const [startDate, setStartDate] = useState(new Date());\n //\n\n let d = new Date();\n d.setDate(new Date().getDate() -1);\n\n const [date, setDate] = useState(d.toISOString().split('T')[0]);\n\n\n console.log (date);\n \n\n \n \n\n useEffect (() => {\n axios\n .get (`https://api.nasa.gov/planetary/apod?api_key=Vt4TbPCdgZCtspljyw7mBqcfAzbD9lahFePuGdbV`)\n // .get (`https://api.nasa.gov/planetary/apod?api_key=Vt4TbPCdgZCtspljyw7mBqcfAzbD9lahFePuGdbV&date=2020-08-18`)\n \n .then ((res) => {\n console.log ('Results: ', res);\n setApod (res.data);\n })\n .catch ((err) => {\n console.log ('Error occured: ', err);\n })\n\n }, []); \n\n useEffect (() => {\n // used to handle obnoxious info returned from react date picker, probably a cleaner way\n // but html date picker works fine and returns a simple, usable result\n\n // const stringStuff = JSON.stringify({date});\n // const stringArray = (stringStuff.split(\":\"));\n // console.log (stringStuff);\n // console.log (stringArray[1].substr(1,10));\n // let dateChange = stringArray[1].substr(1,10);\n // console.log (dateChange);\n axios\n .get (`https://api.nasa.gov/planetary/apod?api_key=Vt4TbPCdgZCtspljyw7mBqcfAzbD9lahFePuGdbV&date=${date}`)\n \n .then ((res) => {\n console.log ('Results: ', res);\n setApod (res.data);\n \n })\n .catch ((err) => {\n console.log ('Error occured: ', err);\n })\n\n }, [date]); \n \n console.log (apod)\n console.log (apod.date, apod.title);\n\n return (\n <div className=\"App\">\n <Header\n // data = {apod}\n title = {apod.title}\n date = {apod.date} \n />\n <DateSelector \n setDate = {setDate}\n date = {date} />\n <Photo \n type = {apod.media_type}\n headline = {apod.title}\n imgUrl = {apod.url} \n text = {apod.explanation}/>\n <Footer \n source = {apod.url}\n copyright = {apod.copyright}/>\n \n \n {/* below was used with React DatePicker, since removed\n <DatePicker \n selected={date} \n dateFormat = \"yyyy-MM-dd\"\n onChange={date => setDate(date)} /> */}\n \n \n </div>\n );\n}", "function Example() {\n // State Hook\n // React assumes that if you call useState many times, you do it in the same order during every render.\n const [count, setCount] = useState(0);\n\n // Effects:data fetching, subscriptions, or manually changing the DOM\n // It serves the same purpose as componentDidMount, componentDidUpdate, and componentWillUnmount in React classes, but unified into a single API.\n // Effects are declared inside the component so they have access to its props and state.\n // React guarantees the DOM has been updated by the time it runs the effects.\n\n useEffect(() => {\n // By default, React runs the effects after every render — including the first render.\n console.log('called');\n // Update the document title using the browser API\n document.title = `You clicked ${count} times`;\n });\n // }, [count]);\n // }, []);//the props and state inside the effect will always have their initial values.it never needs to re-run\n // While passing [] as the second argument is closer to the familiar componentDidMount and componentWillUnmount mental model,\n return (\n <div>\n <p>You clicked {count} times</p>\n <button onClick={() => setCount(count < 5 ? count + 1 : 100)}>\n Click me\n </button>\n </div>\n );\n}", "function Example2(){\r\n const [age, setAge] = useState(18)\r\n\r\n // React Hooks 不能出现在条件判断语句中,因为它必须有完全一样的渲染顺序\r\n // 下面的代码会报错: React Hook \"useState\" is called conditionally. React Hooks must be called in the exact same order in every component render \r\n /* if(showSex) {\r\n const [ sex, setSex ] = useState('男')\r\n showSex = false\r\n } */\r\n\r\n const [sex, setSex] = useState('男')\r\n const [work, setWork] = useState('前端程序员')\r\n return (\r\n <div>\r\n <p>张三 年龄: { age } 岁</p>\r\n <p>性别: { sex }</p>\r\n <p>工作: { work }</p>\r\n </div>\r\n )\r\n}", "function MygtukasFunkcinis() {\n const [x, set3X] = useState(3);\n const [z, set7Z] = useState(7);\n // const x = 3;\n // const set3X = set3X\n const do3 = () => {\n const newX = x + 3;\n set3X(newX);\n }\n const do7 = () => {\n const newZ = z+7;\n set7Z(newZ)\n }\n return (\n <>\n <button className=\"baton\" id=\"baton\" onClick={do3} >\n {x}\n </button> \n <button className=\"baton\" id=\"baton\" onClick={do7} >\n {z}\n </button> \n </>\n )\n\n}", "function App() {\n\n // const [animalToDraw, setAnimalToDraw] = useState(null)\n // set[animalToDraw] = animal\n \n\n // const animals = [\"whale\", \"snake\", \"cat\", \"monkey\", \"camel\", \"rabbit\", \"pig\", \"bird\", \"lion\", \"duck\"]\n // let animal = animals[Math.floor(Math.random()*animals.length)];\n\n // useEffect(() => {\n // axios.get(\"www.googlequickdrawword\").then((response) => {\n // setAnimalToDraw(response.data)\n // })\n // }, [])\n\n useEffect(() => {\n fetch('/api').then(\n response => response.json()\n ).then(data => console.log(data))\n }); \n \n return (\n <div className=\"App\">\n <Canvas/>\n </div>\n );\n}", "function Results() {\n //const [NEED TO GET STATE NAMES] = useState([]);\n useEffect(() => {\n //SET RESULTS HERE\n }, []);\n return (\n <div id=\"resultsDiv\">\n <h1 is=\"resultsHeading\">Results</h1>\n //MAP RESULTS HERE\n </div>\n );\n}", "function NavItemContainer(){\n \n // 게시판 목록 상태저장중\n const [boardList, setBoardList] = useState([]);\n\n //axios 게시판 목록 get\n const onRequestBoardList = async() => {\n try{\n console.log(\"ononReq\");\n\n const response = await axios(axiosOptions.get('/board', {}));\n let tempBoardLists = [];\n \n // console.log(response.data);\n //response.data boardNo boardName boardDesc boardProposer boardStatus\n response.data.map((boardInfo, index) =>{\n // console.log(boardInfo, index);\n const data = {\n boardNo : boardInfo.boardNo,\n boardName : boardInfo.boardName,\n boardDesc : boardInfo.boardDesc\n }\n tempBoardLists.push(data);\n });\n setBoardList(tempBoardLists);\n \n \n }catch(e){\n console.log(e);\n }\n }\n\n \n // variables in [] means \"hey run only if variables is changed\"\n\n // run this code only 1 time\n useEffect( () => {\n onRequestBoardList();\n }, []);\n\n\n\n\n return(\n <NavItem \n boardList = {boardList}\n />\n );\n\n}", "function App(props) {\n // useState allows you to have a state variable into a functional component\n // useEffect will mimic componentDidMount, componentDidUpdate, componentWillUnmount\n\n const [name, setName] = useState('Stefano')\n const [counter, setCounter] = useState(100)\n\n // this is the componentDidMount shape\n useEffect(\n () => {\n console.log('just like componentDidMount')\n // you want to do here fetches, expensive operations\n },\n []\n // every value you put in the dependency array will be checked\n // every time one of the values you put here changes, the function will be re-executed\n )\n\n // this is the componentDidUpdate shape\n useEffect(() => {\n console.log('re-executed every time the name changes')\n setCounter(counter + 1)\n }, [name, props.murilo])\n // this will execute every time name changes\n\n useEffect(() => {\n console.log('this will be called EVERY time a change is detected, in the state or in the props')\n })\n\n // this is the componentWillUnmount shape\n useEffect(() => {\n // for launching some code just on component unmounting, return a function\n return () => {\n // this is like componentWillUnmount\n console.log('about to be unmounted')\n }\n }, [])\n\n // const strivers = ['Raissa', 'Magdalena', 'Luna']\n\n // const [name1, name2, name3] = strivers\n\n // console.log(name1)\n\n // useState is a function returning an array with two elements:\n // 1st -> the state variable you can use in your code\n // 2nd -> the function in charge of UPDATING this state variable\n\n // const arrayOfUseState = useState(100)\n // useState returns an array!\n // arrayOfUseState[0] --> this is the state variable\n // arrayOfUseState[1] --> this is the function in charge of updating the first element\n\n // state = {\n // name: 'Stefano'\n // }\n\n //\n\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n {/* <h1 onClick={() => this.setState({name: 'Marcelo'})}>{name}</h1> */}\n {/* <h1 onClick={() => setName((oldName) => oldName + '_new')}>{name}</h1> */}\n <h1 onClick={() => setName('Sarath')}>{name}</h1>\n {name === 'Stefano' && <Unmount />}\n </header>\n </div>\n )\n}", "function fixGestureHandler() {\n const [, set] = (0, _react.useState)(0);\n (0, _react.useEffect)(() => {\n set(v => v + 1);\n }, []);\n}", "function ReactHooks() {\n const [count, setCount] = useState(0);\n const myRef = useRef();\n //setTimeout(() => {\n // although to get dom menupulation results by setTimeout is not good i Can use useEffect\n // console.log(myRef.current.innerText); // if I log useRef I showed it undefined because it rendered before jsx rendered to define it i can use useState or setimeout or another method i can follow\n // }, 10);\n console.log(\"This is going to undefined\", myRef); // it is going to render before jsx render thats why I can't Manupulate DOM to Menupulate DOM I have to render myRef after jsx render\n\n //\n\n // uses of useEffect Hook\n // without second aurgument useEffect is going to run for mount the component and react it is going to run for every time after jsx rendered . as like props chage state changes\n useEffect(() => {\n // console.log(myRef); // it print with every rendering with jsx\n });\n\n // but when It has second argument I can define when useEfect will run for different element I can defin it in second argument and useEffect is run that particular element // or if second argument is empty it going to work as component mount\n useEffect(() => {\n // example of uses of useEffect\n // for example Fetching Course information => when the URL chang .\n // console.log(myRef); // it run only for one time when second argument is empty\n }, []); // like this its related with DidMount\n useEffect(() => {\n console.log(myRef);\n }, [count]); // now useEffect is run for specific component here is for count\n\n return (\n <>\n {console.log(\"rerendered\")}\n <h2>Count is : {count}</h2>\n <button ref={myRef} onClick={() => setCount(count + 1)}>\n Increment\n </button>\n <button ref={myRef} onClick={() => setCount(count - 1)}>\n Decrement\n </button>\n <h1>\n <a>Welcome To Home</a>\n </h1>\n </>\n );\n}", "function App(){\n const [ count, setCount ] = useState(0);\n const [ color, setColor ] = useState(\"\")\n\n // \n\n //function increment(){\n // setCount(prevCount => prevCount + 1);\n //}\n\n //function decrement(){\n // setCount(prevCount => prevCount - 1);\n //}\n\n useEffect(() => {\n //setColor(prevColor => prevColor = randomColor());\n const intervalId = setInterval(() => { \n setCount(prevCount => prevCount + 1)}\n , 1000)\n\n return () => {\n clearInterval(intervalId);\n }\n }, [])\n\n useEffect(() => {\n setColor(() => randomColor());\n }, [count])\n\n return(\n <div>COURSE DONE!\n {/* <h1 style={{color:color}}>{count}</h1> */}\n {/*<button onClick={increment}>Increment</button>*/}\n {/*<button onClick={decrement}>Decrement</button>*/}\n </div>\n )\n}", "function UseEffectFetchTxt() {\n const [yazi, setYazi] = useState(\"\");\n useEffect(() => {\n fetch(textDosya)\n .then((cevap) => cevap.text())\n .then((data) => setYazi(data));\n }, []);\n console.log(yazi);\n return (\n <div>\n <h1>{yazi}</h1>\n </div>\n );\n}", "function AsEffect(props) {\n const [derived, setDerived] = useState(null);\n useEffect(() => {\n setDerived(makeList(props.counter));\n }, [props.counter]);\n\n return (\n <div className=\"container\">\n <div>Created Derived Data in a useEffect</div>\n <div>List Length: {derived && derived.length}</div>\n {!!props.speed && <SlowComponent name=\"AsEffect\" ms={props.speed} />}\n <RenderCounter />\n </div>\n )\n}", "function Candidateslist({candidates,companyid, backend_url}) {\n let history = useHistory();\n\n const [candidate_type,setcandidate_type] = useState(false);\n const [def,setdef] = useState(true);\n const [iswithd, setiswithd] = useState(false);\n\n const [isfree, setisfree] = useState(false);\n\n const [count, setcount] = useState(0);\n\n let nrml = candidates.filter((val)=>(val.short === false && val.reject === false && val.select === false)||(val.short === true && val.reject === true && val.select === true));\n let shortlisted = candidates.filter((val)=>(val.short === true && val.reject === false && val.select === false));\n let rejected = candidates.filter((val)=>((val.short === false && val.select === false) && val.reject === true));\n let selected = candidates.filter((val)=>(val.short === false && val.reject === false && val.select === true));\n\n useEffect(() => {\n candidate_type && def?setcount(selected.length):def?setcount(nrml.length):candidate_type?setcount(shortlisted.length):setcount(rejected.length);\n }, [selected,def,candidate_type,nrml,rejected,shortlisted]);\n\n useEffect(()=>{\n if(companyid !== \"\" ){\n fetch(backend_url + '/company/find', {\n method:'POST',\n headers:{'Content-Type':'application/json'},\n body: JSON.stringify({\n _id:companyid,\n }) \n }).then(response=>response.json())\n .then(data => {\n if(data.success){\n if(data.result.category === \"Free\"){\n setisfree(true);\n }\n }\n }).catch(()=>console.log(\"error fetching data\"))\n }\n },[backend_url,companyid]);\n\n const defaultfunc = () =>{\n setcandidate_type(false);\n setdef(true);\n setiswithd(false);\n }\n\n const shortlist = () =>{\n setcandidate_type(true);\n setdef(false);\n setiswithd(false);\n }\n\n const reject = () =>{\n setcandidate_type(false);\n setdef(false);\n setiswithd(false);\n }\n\n const selectfun = () =>{\n setcandidate_type(true);\n setdef(true);\n setiswithd(false);\n }\n\n // const selectwith = () =>{\n // setcandidate_type(false);\n // setdef(false);\n // setiswithd(true);\n // }\n\n //console.log(def,candidate_type)\n return (\n <div style={{background:\"#eef2f5\"}} className='flex-1 w-100 pa4-l pa3'>\n <div className='w-80-l w-100 center flex flex-column'>\n {/* job info */}\n <div className='flex'>\n <ChevronLeftTwoToneIcon onClick={() => history.push(\"/Dashboard\")} className='self-center dim pointer'/>\n <div className='flex flex-column items-start'>\n <p className='ma0 f4-l f5-m f7 pb2 tc'>(Senior) Software Engineer - Python</p>\n <p className='ma0 pl2 f6-l f7-m f8 gray tc'>New Delhi, India</p>\n </div>\n </div>\n <div className={`${isfree?'':'hide'}`}>\n <FreeBanner/>\n </div>\n {/* <Filter/> */}\n <div style={{borderColor:\"rgb(249, 246, 246)\"}}className='flex self-start w-100 justify-start-l justify-center pt4 ml2-l pb1'>\n <Button onClick={defaultfunc} variant=\"contained\" className={`cbtn ${def && !candidate_type && !iswithd?'cbtn-active':''}`}>Candidates</Button>\n <Button onClick={shortlist} variant=\"contained\" className={`cbtn ${candidate_type && !def && !iswithd?'cbtn-active':''}`}>Shortlisted</Button>\n <Button onClick={reject} variant=\"contained\" className={`cbtn ${!candidate_type && !def && !iswithd?'cbtn-active':''}`}>Rejected</Button>\n <Button onClick={selectfun} variant=\"contained\" className={`cbtn ${candidate_type && def && !iswithd?'cbtn-active':''}`}>Hired</Button>\n {/* <Button onClick={selectwith} variant=\"contained\" className={`cbtn ${iswithd && !def && !candidate_type?'cbtn-active':''}`}>Withdrawal</Button> */}\n </div>\n <div className='mv3'>\n <p className='ma0 gray mr2 f6-l f7-m f8-mo tr'>{'All Candidates'}({count})</p>\n </div>\n <div className='w-100 flex center flex-column'>\n {\n candidates.length<=0 || candidates === undefined ?<div className='mt4 flex justify-center items-center'><p className='ma0 f3-l f4-m f6 gray tc'>No, Candidate matched with your job Profile</p></div>\n :def && candidate_type?\n selected.length<=0? <div className='flex mt4 justify-center items-center'><p className='ma0 f3-l f4-m f6 gray tc'>No candidates selected!!</p></div>: selected.map((data,id) =><Selected candidate={data} key={id}/>)\n :def?\n nrml.length<=0?<div className='flex mt4 justify-center items-center'><p className='ma0 f3-l f4-m f6 gray tc'>Sorry, no candidate's were found!</p></div>:nrml.map((data,id) =><Candidate candidate={data} key={id}/>)\n :candidate_type?\n shortlisted.length<=0?<div className='flex mt4 justify-center items-center'><p className='ma0 f3-l f4-m f6 gray tc'>No, candidate's were shortlisted yet!</p></div>:shortlisted.map((data,id) =><Shortlist candidate={data} key={id}/>)\n :\n rejected.length<=0?<div className='flex mt4 justify-center items-center'><p className='ma0 f3-l f4-m f6 gray tc'>No, candidate's were rejected yet!</p></div>:rejected.map((data,id) =><Rejected candidate={data} key={id}/>)\n }\n </div>\n </div>\n </div>\n )\n}", "function App() {\n const [name, setName] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [count, setCount] = useState(0);\n const [address, setAddress] = useState({\n country: \"India\",\n city: \"bangalore\"\n });\n\n const [phno, setPhno] = useState([123, 12342, 123432, 1234]);\n const inputRef = useRef(null);\n\n useLayoutEffect(() => {\n console.log(\n \"The function passed to useLayoutEffect will be run before the browser updates the screen.\"\n );\n });\n\n useEffect(() => {\n console.log(\"Logging when only name change\");\n return () => {\n //cleanup, the code you write in componentWillUnmount\n };\n }, [name]);\n\n useEffect(() => {\n console.log(\"inside ref\");\n document.title = email; // write title only when count is changed\n });\n\n let testCallBackHooks = useCallback(() => {\n console.log(\"callback hools\", name);\n }, [name]);\n\n let isEven = useMemo(() => {\n console.log(\"inside use memo\");\n if (email.length % 2 === 0) return \"Even\";\n else return \"Odd\";\n }, [email]);\n\n return (\n <DemoContext.Provider value={55}>\n <div style={{ margin: \"50px 50px\" }}>\n <form>\n <label htmlFor=\"\"></label>\n <input\n placeholder=\"Name\"\n type=\"text\"\n value={name}\n onChange={() => setName(prev => prev + \"done\")} // update state based on previous state value\n />\n {name}\n <br />\n <br />\n <input\n placeholder=\"Email\"\n type=\"text\"\n value={email}\n onChange={event => setEmail(event.target.value)}\n />{\" \"}\n {email}\n </form>\n <br />\n <br />\n <div>{JSON.stringify(address)}</div>\n <button\n type=\"button\"\n onClick={() => setAddress({ ...address, city: \"kanpur\" })}\n >\n Change Address\n </button>\n <br />\n <br />\n <div>{JSON.stringify(phno)}</div>\n <button\n type=\"button\"\n onClick={() => setPhno([...phno, 1234, 1234, 1234, 1234])}\n >\n Change Phno\n </button>\n <br />\n <br />\n <button type=\"button\" onClick={() => setCount(prev => prev + 1)}>\n Increment Count and Write email to Title\n </button>\n {count}\n <br />\n <br />\n <HooksMouse />\n <br />\n <HooksReducer />\n <br />\n <input\n type=\"text\"\n name=\"name\"\n id=\"name\"\n placeholder=\"focus\"\n ref={inputRef}\n />\n <Random callme={() => testCallBackHooks()}>{testCallBackHooks}</Random>\n {isEven} :Email length\n </div>\n </DemoContext.Provider>\n );\n}", "function HookMouseFour() {\n\n const [x, setX] = useState(0)\n const [y, setY] = useState(0)\n\n\n\n const logMousemove=(e)=>{\n setX(e.clientX)\n setY(e.clientY)\n }\n\n useEffect(() => {\n console.log('useEffect is called')\n window.addEventListener('mousemove',logMousemove)\n return ()=>{\n console.log('clean up code... ')\n window.removeEventListener('mousemove',logMousemove)\n }\n },[])\n\n return (\n <div>\n Hooks- X- {x} ,Y -{y} \n </div>\n )\n}", "function useForceUpdate() {\n const [value, setValue] = useState(0); // integer state\n return () => setValue((value) => ++value); // update the state to force render\n}", "function useForceUpdate() {\n const [value, setValue] = useState(0); // integer state\n return () => setValue(value => value + 1); // update the state to force render\n}", "function Test() {\r\n const [resourceType, setResourceType] = useState(\"posts\");\r\n const [items, setItems] = useState([]);\r\n\r\n useEffect(() => {\r\n fetch(\"https://jsonplaceholder.typicode.com/\" + resourceType)\r\n .then((res) => res.json())\r\n .then((res) => {\r\n console.log(res);\r\n setItems(res);\r\n });\r\n }, [resourceType]);\r\n\r\n return (\r\n <div className=\"d-flex m-3\">\r\n <div className=\"d-flex m-2 flex-column\">\r\n <button onClick={() => setResourceType(\"posts\")}>Posts</button>\r\n <button onClick={() => setResourceType(\"comments\")}>Comments</button>\r\n <button onClick={() => setResourceType(\"todos\")}>Todos</button>\r\n </div>\r\n </div>\r\n );\r\n}", "function Foo() {\n if (condition) {\n useEffect(() => {});\n }\n}", "function User() {\n const [user, setUser] = useState({});\n const [attendingEvents, setAttendingEvents] = useState(\"\")\n let { Username } = useParams();\n\n\n useEffect(() => {\n API.getUsers().then(res => {\n\n setUser(res.data[0]);\n console.log(\"effect rendered\")\n \n })\n }, [])\n\n console.log(user)\n\n return (\n <div id=\"userPage\" className=\"d-flex justify-content-center\">\n <Container fluid>\n <div className=\"Row d-flex justify-content-center\">\n <div className=\"col-md-4 d-flex justify-content\">\n <img src=\"https://cdn.icon-icons.com/icons2/1378/PNG/512/avatardefault_92824.png\" id=\"profileImage\"></img>\n </div>\n\n <div className=\"col-md-8 d-flex justify-content\">\n <div className=\"Row d-flex justify-content\">\n <div className=\"col-md-12 d-flex justify-content-center\">\n <div>\n <h3>FIRST NAME</h3>\n <h3>LAST NAME</h3>\n <h3>ABOUT ME</h3>\n <p>Neque ornare aenean euismod elementum nisi quis eleifend quam adipiscing. Sed pulvinar proin gravida hendrerit lectus. Et netus et malesuada fames ac. Risus nullam eget felis eget nunc lobortis. Congue nisi vitae suscipit tellus mauris a diam</p>\n </div>\n </div>\n </div>\n\n </div>\n </div>\n <div className=\"Row d-flex justify-content\">\n <div className=\"col-md-12 d-flex justify-content-center\">\n <div>\n <h1>MY EVENTS</h1>\n </div>\n </div>\n </div>\n <div className=\"Row d-flex justify-content\">\n <div className=\"col-md-12 d-flex justify-content\">\n <div>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum neque egestas congue quisque egestas diam in arcu. Vel elit scelerisque mauris pellentesque pulvinar pellentesque. Id volutpat lacus laoreet non curabitur gravida arcu ac tortor. Lobortis feugiat vivamus at augue eget arcu dictum varius. Quis commodo odio aenean sed adipiscing diam donec adipiscing tristique. Imperdiet dui accumsan sit amet nulla facilisi morbi. Ipsum consequat nisl vel pretium lectus quam. Morbi tristique senectus et netus et malesuada fames ac. Nam aliquam sem et tortor consequat id porta nibh.</p>\n </div>\n </div>\n </div>\n <div className=\"Row d-flex justify-content\">\n <div className=\"col-md-6 d-flex justify-content\">\n <div>\n <h1>CALENDER</h1>\n </div>\n </div>\n <div className=\"col-md-6 d-flex justify-content\">\n <div>\n <h1>EVENTS ATTENDING</h1>\n </div>\n </div>\n </div>\n <div className=\"Row d-flex justify-content\">\n <div className=\"col-md-6 d-flex justify-content\">\n <div>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum neque egestas congue quisque egestas diam in arcu. Vel elit scelerisque mauris pellentesque pulvinar pellentesque. Id volutpat lacus laoreet non curabitur gravida arcu ac tortor. Lobortis feugiat vivamus at augue eget arcu dictum varius. Quis commodo odio aenean sed adipiscing diam donec adipiscing tristique. Imperdiet dui accumsan sit amet nulla facilisi morbi. Ipsum consequat nisl vel pretium lectus quam. Morbi tristique senectus et netus et malesuada fames ac. Nam aliquam sem et tortor consequat id porta nibh.</p>\n </div>\n </div>\n <div className=\"col-md-6 d-flex justify-content\">\n <div>\n <ul>\n <li>\n <h3>EVENT 1</h3>\n </li>\n <li>\n <h3>EVENT 2</h3>\n </li>\n <li>\n <h3>EVENT 3</h3>\n </li>\n </ul>\n </div>\n </div>\n </div>\n\n </Container>\n </div>\n );\n}", "function useStateValue(){\n return useContext(StateContext);\n }", "static usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n }", "function HookCounterThree() {\n const [name, setName] = useState({firstName: '', lastName: ''})\n\n //setState function from Class will merge the state\n //When using hooks the setFunction(setName in this case) will not merge the state, \n //so is necessary to do manually using the spread operator...field\n\n return (\n <div>\n <form>\n {/*...name = copy everything from the object name and just update the firstName */}\n <input type=\"text\" value={name.firstName} onChange={e => setName({...name, firstName: e.target.value })} />\n {/*...name = copy everything from the object name and just update the lastName */}\n <input type=\"text\" value={name.lastName} onChange={e => setName({...name, lastName: e.target.value})} />\n <h2>Your first name is - {name.firstName}</h2>\n <h2>Your last name is - {name.lastName}</h2>\n <h2>{JSON.stringify(name)}</h2>\n </form>\n </div>\n )\n}", "function HttpWithUseState() {\n\n const [loading, setLoading] = useState(true)\n const [post, setPost] = useState({})\n const [error, setError] = useState(\"\")\n\n useEffect(() => {\n axios.get('http://jsonplaceholder.typicode.com/posts/1')\n .then((res) => {\n setLoading(false)\n //set the result gotten to the state\n setPost(res.data)\n setError('')\n })\n .catch((err) => {\n setLoading(false)\n setPost('')\n //set error message to the state\n setError(\"An HTTP error occured\")\n })\n }, [])\n\n return (\n <div>\n <p>HTTP call with useState</p>\n <p>{loading ? 'Loading' : post.title}</p>\n <p>{error ? error : null}</p>\n </div>\n )\n}", "function ComposerWorks(props) {\n console.log(\"pls id\", props.id);\n\n const [works, setWorks] = useState([]);\n\n //id: data.composer[x].id\n //works: data.works = obj.title\n\n useEffect(() => {\n //setWorks(['butt', '1', '3']);\n fetchData();\n }, []);\n\n const fetchData = () => {\n axios\n .get(\n `https://api.openopus.org/work/list/composer/${props.id}/genre/all.json`\n )\n .then((response) => {\n console.log(\"now what\", response.data.works);\n const allWorks = response.data.works;\n setWorks(allWorks);\n });\n };\n\n // async function fetchData() {\n // const {data} = await axios.get(\n // 'https://api.openopus.org/work/list/composer/149/genre/all.json'\n // );\n // console.log('mama mia', data.works);\n // }\n\n // useEffect(() => {\n // async function fetchData() {\n // const {data} = await axios.get('https://api.openopus.org/work/list/composer/149/genre/all.json');\n // //console.log('composer works data', data.works.forEach((work) => {console.log(work.title)}));\n\n // let workTitlesArr = [];\n\n // let workTitles = data.works.forEach((work) => (workTitlesArr.push(work.title)));\n\n // console.log('girl pls', workTitlesArr)\n\n // setWorks(workTitlesArr);\n\n // //setWorks(data.works);\n\n // console.log('excuse me ', works)\n // };\n // fetchData();\n // }, []);\n\n // useEffect(() => {\n // const fetchData = async () => {\n // const data = await axios('https://api.openopus.org/work/list/composer/149/genre/all.json');\n // console.log(data)\n // setWorks(data.works);\n // console.log('try again', works)\n // };\n // fetchData();\n // }, [works]);\n\n return (\n <div className=\"composer-card\">\n <ul>\n {console.log(\"haw\", works)}\n\n {works.map((piece) => {\n return (\n <div>\n <p>{piece.title}</p>\n <FavButton handleFavoriteAdd = {props.handleFavoriteAdd} pieceInfo={piece} />\n </div>\n );\n })}\n\n {/* {(works.map((work) => {\n return <p>{work}</p>\n }))} */}\n </ul>\n </div>\n );\n}", "function App() {\n const [students, setStudents] = useState([]);\n \n // set state on initial component mount\n useEffect( function udpateStudentsOnRender() {\n async function updateStudents() {\n const studentsResp = await HatchwayAPI.getStudents();\n setStudents(() => [...studentsResp]);\n }\n updateStudents();\n }, []);\n\n return (\n <div className=\"App\">\n <Main students={students} />\n </div>\n );\n}", "function ProfileSettings({ setLocal }) {\n let location = useLocation()\n\n useEffect(\n () => {\n setLocal(location.pathname) \n // eslint-disable-next-line react-hooks/exhaustive-deps\n },[])\n\n const [user, setUser] = useState(null)\n const [userDbData, setUserDbData] = useState(null)\n const [userDataUpdate, setUserDataUpdate] = useState(false)\n \n const [loading, setLoading] = useState(false);\n const [progress, setProgress] = useState(0);\n\n const [chatRooms, setChatrooms] = useState(['azazaz'])\n\n // taking auth and db user data\n useEffect(() => {\n const unsubscribe = auth.onAuthStateChanged((authUser) => {\n if (authUser) {\n // user logged in\n console.log(authUser);\n setUser(authUser);\n\n db.collection('users').doc(authUser.uid).get().then(function(doc) {\n if (doc.exists) {\n console.log(\"Document data:\", doc.data());\n setUserDbData(doc.data());\n\n // import data to hooks\n setNewusername(authUser.displayName)\n setNewemail(authUser.email)\n setChatrooms(doc.data().chatRooms)\n\n if (doc.data().fullName !== undefined) {\n setNewfullname(doc.data().fullName)\n }\n if (doc.data().webpage !== undefined) {\n setNewpage(doc.data().webpage)\n }\n if (doc.data().bio !== undefined) {\n setNewbio(doc.data().bio)\n }\n if (doc.data().phoneNumber !== undefined) {\n setNewphone(doc.data().phoneNumber)\n }\n if (doc.data().gender !== undefined) {\n setNewgender(doc.data().gender)\n }\n\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n })\n .catch(function(error) {\n console.log(\"Error getting document:\", error);\n });\n\n } else {\n // user logged out\n setUser(null);\n }\n })\n return () => {\n // cleanup actions\n unsubscribe();\n }\n }, [userDataUpdate]);\n\n const [newUsername, setNewusername] = useState('');\n const [newfullname, setNewfullname] = useState('');\n const [newpage, setNewpage] = useState('');\n const [newbio, setNewbio] = useState('');\n const [newemail, setNewemail] = useState('');\n const [newphone, setNewphone] = useState('');\n const [newgender, setNewgender] = useState('');\n\n const [oldpass, setOldpass] = useState('');\n const [newpass, setNewpass] = useState('');\n const [checkNewpass, setCheckNewpass] = useState('');\n\n const classes = useStyles();\n const [modalStyle] = useState(getModalStyle);\n const [openDel, setOpenDel] = useState(false);\n \n const [changingPass, setChangingPass] = useState(false);\n const [openChange, setOpenChange] = useState(false);\n const [changingProfile, setChangingProfile] = useState(false);\n const [profileDone, setProfileDone] = useState(false);\n\n const changeProfile = (event) => {\n event.preventDefault();\n setChangingProfile(true);\n\n // checking difference between new and old data\n let oldData = [user.displayName, userDbData.fullName, userDbData.webpage, userDbData.bio, user.email, userDbData.phoneNumber, userDbData.gender];\n let newData = [newUsername, newfullname, newpage, newbio, newemail, newphone, newgender];\n let paramData = ['displayName', 'fullName', 'webpage', 'bio', 'email', 'phoneNumber', 'gender'];\n if (chatRooms) {\n oldData.push(userDbData.chatRooms)\n newData.push(chatRooms)\n paramData.push('chatRooms')\n }\n let objChange = {};\n let continueChange = false;\n\n var i;\n for (i = 0; i < newData.length; i++) {\n if (newData[i] === null || newData[i] === '') { \n continue;\n } else {\n // push data to new array if so \n objChange = {...objChange, ...Object.fromEntries([[paramData[i], newData[i]]]) } \n } \n }\n \n for (i = 0; i < newData.length; i++) {\n if (newData[i] !== oldData[i]) {\n continueChange = true;\n }\n }\n\n // if there is no data to change => stop function\n if (continueChange === false) {\n alert('There is no new data for a change! Fill something first!');\n setChangingProfile(false);\n return false\n }\n console.log(objChange)\n\n // [displayName, email] we need to jande not just in db, but on auth server\n // check if we need to work with auth server\n if (objChange.displayName !== undefined || objChange.email !== undefined) {\n // console.log('Working with auth')\n user.updateProfile(objChange).then(function() {\n // Update successful.\n console.log('Auth data was updated')\n }).catch(function(error) {\n // An error happened.\n console.log('Error with auth data updating', error)\n });\n }\n \n let closeDone = () => {\n setProfileDone(false)\n }\n\n // changing data in db now\n db.collection(\"users\").doc(user.uid).set(objChange)\n .then(() => {\n console.log('Data in DB was updated')\n setChangingProfile(false)\n setProfileDone(true)\n setUserDataUpdate(!userDataUpdate)\n setTimeout(closeDone, 2000)\n\n })\n .catch((error) => {\n // console.error(\"Error removing document: \", error);\n alert('Something wrong happened, please try again...');\n return false\n });\n } \n \n const cleanPass = () => {\n setOldpass('');\n setNewpass('');\n setCheckNewpass('');\n }\n\n const changePass = (event) => {\n event.preventDefault();\n\n // check that all forms are filled\n if (oldpass === '' || newpass === '' || checkNewpass === '') {\n alert('Fill all passwords first!');\n } else {\n setChangingPass(true);\n // check new passwords first\n if (newpass !== checkNewpass) {\n alert('New passwords are different. Please, retype it again!');\n setNewpass('');\n setCheckNewpass('');\n setChangingPass(false);\n } else {\n // checking reauthentication here (old password)\n\n // receiving credentials for reauthentication\n let credential = firebase.auth.EmailAuthProvider.credential(\n user.email, \n oldpass\n );\n\n // asking server for reauthentication\n user.reauthenticateWithCredential(credential).then((res) => {\n // console.log('Thats works!', res);\n \n // old pass works => continue to change pass\n // console.log(user)\n user.updatePassword(newpass).then(() => {\n // Update successful.\n console.log('Password chanched!');\n cleanPass();\n setChangingPass(false);\n setOpenChange(true);\n }).catch(function(error) {\n console.log('Some error happened', error);\n cleanPass()\n });\n }).catch((error) => {\n if (error.code === 'auth/wrong-password') {\n alert('Old password is incorrect. Please, try again!');\n setOldpass('');\n setChangingPass(false);\n return false\n } else {\n alert('Some trouble is happened. Please, try again later.');\n setChangingPass(false);\n // console.log(error)\n return false \n }\n // console.log('Some error', error);\n });\n }\n }\n }\n\n // file verification block\n const fileMaxSize = 512000; // half of megabyte\n const fileTypes = 'image/x-png, image/png, image/jpg, image/jpeg';\n const fileTypesArr = fileTypes.split(',').map((type) => {return type.trim()});\n\n const verifyFile = (file) => {\n if (file) {\n if (file.size > fileMaxSize) {\n alert('This file is not allowed. ' + file.size + 'bytes is too large.')\n return false\n }\n if (!fileTypesArr.includes(file.type)) {\n alert('This file is not allowed. Only images are allowed.')\n return false\n }\n return true\n }\n }\n\n const avaUploading = (avaImage) => {\n // console.log(avaImage)\n setLoading(true)\n\n let fileExtension = avaImage.name.substr((avaImage.name.lastIndexOf('.') + 1));\n const avaName = (user.uid + '.' + fileExtension);\n\n const uploadTask = storage.ref(`users/${avaName}`).put(avaImage);\n\n uploadTask.on(\n 'state_changed',\n (snapshot) => {\n // progress function\n const progress = Math.round(\n (snapshot.bytesTransferred / snapshot.totalBytes) * 100\n );\n setProgress(progress);\n },\n (error) => {\n // error function\n console.log(error);\n alert(error.message);\n },\n () => {\n // complete function\n storage\n .ref('users')\n .child(avaName)\n .getDownloadURL()\n .then(url => {\n // post image inside the DB\n user.updateProfile({\n photoURL: url\n }).then(function() {\n console.log('Avatar updated')\n }).catch(function(error) {\n console.log('Error uploading of new avatar', error)\n })\n .then(() => {\n setUserDataUpdate(!userDataUpdate)\n })\n // cleaning load form after process\n setLoading(false);\n })\n }\n )\n\n }\n\n const avaHandleChange = (e) => {\n\n // making verification and putting image to the hook\n let avaImage = e.target.files[0]\n if (verifyFile(avaImage) === false) {\n return false\n } else\n if (avaImage) {\n // console.log('Avatar received', avaImage)\n }\n\n // cheking that user can have previous uploaded avatar\n if (user.photoURL) {\n // removing old avatar from the storage\n let fileExtensionAlt = user.photoURL.replace(/^.*\\./, '');\n var extSplit = fileExtensionAlt.split('?', 2);\n let storagePath = (user.uid + '.' + extSplit[0]) // we need to know file type from storage before removing\n\n const oldAvatar = storage.ref(`users/${storagePath}`);\n\n oldAvatar.delete().then(() => {\n // File deleted successfully\n console.log('Old avatar was removed')\n // uploading new avatar\n avaUploading(avaImage)\n }).catch((error) => {\n console.log('Error removing old avatar from storage', error)\n });\n } else {\n avaUploading(avaImage)\n }\n\n }\n\n return (\n <div className=\"profileSet\">\n\n {user === null ? (\n <div className=\"profileSet__comments\">\n <CircularProgress size={100} />\n </div>\n ): (\n <Grid container spacing={2}>\n <Grid className=\"profileSet__header\" item xs={12}>\n <div>\n {loading === false ? (\n <></>\n ): (\n <CircularProgress className=\"profileSet__avaUploading\" size={20} value={progress} />\n )}\n {user.photoURL === null ? (\n <img src={noAvatar} className=\"profileSet__userImage\" alt=\"User avatar\"/>\n ): (\n <img src={user.photoURL} className=\"profileSet__userImage\" alt=\"User avatar\"/>\n )}\n </div>\n <div>\n <h2>{user.displayName}</h2>\n <label htmlFor=\"upload-photo\">\n <input type=\"file\" \n style={{ display: 'none' }}\n id=\"upload-photo\" \n accept=\"image/*\"\n onChange={avaHandleChange} \n />\n <Button size=\"small\" component=\"span\">Change user avatar</Button>\n </label>\n </div>\n </Grid>\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>User name</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <div className=\"profileSet__rightBlock\">\n <input\n placeholder={user.displayName}\n type=\"text\"\n value={newUsername}\n onChange={(e) => setNewusername(e.target.value)}\n />\n </div>\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Full name</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <div className=\"profileSet__rightBlock\">\n {userDbData === null ? (\n <input\n placeholder=\"Username\"\n type=\"text\"\n value={newfullname}\n onChange={(e) => setNewfullname(e.target.value)}\n />\n ): (\n <input\n placeholder={userDbData.fullName}\n type=\"text\"\n value={newfullname}\n onChange={(e) => setNewfullname(e.target.value)}\n />\n )}\n <p>Help people discover your account by using the name you're known.</p>\n </div>\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Webpage</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n {userDbData === null ? (\n <input\n placeholder=\"Your personal page\"\n type=\"text\"\n value={newpage}\n onChange={(e) => setNewpage(e.target.value)}\n />\n ): (\n <input\n placeholder={userDbData.webpage}\n type=\"text\"\n value={newpage}\n onChange={(e) => setNewpage(e.target.value)}\n />\n )}\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Bio</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <div className=\"profileSet__rightBlock\">\n {userDbData === null ? (\n <textarea\n placeholder=\"Few words about you\"\n type=\"text\"\n value={newbio}\n onChange={(e) => setNewbio(e.target.value)}\n rows=\"3\"\n />\n ): (\n <textarea\n placeholder={userDbData.bio}\n type=\"text\"\n value={newbio}\n onChange={(e) => setNewbio(e.target.value)}\n rows=\"3\"\n />\n )}\n <strong>Personal Information</strong>\n </div>\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Email</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <input\n placeholder={user.email}\n type=\"email\"\n value={newemail}\n onChange={(e) => setNewemail(e.target.value)}\n />\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Phone number</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n {userDbData === null ? (\n <input\n placeholder=\"Your personal phone\"\n type=\"text\"\n value={newphone}\n onChange={(e) => setNewphone(e.target.value)}\n />\n ): (\n <input\n placeholder={userDbData.phoneNumber}\n type=\"text\"\n value={newphone}\n onChange={(e) => setNewphone(e.target.value)}\n />\n )}\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Gender</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}> \n {userDbData === null ? (\n <input\n placeholder=\"Any gender\"\n type=\"text\"\n value={newgender}\n onChange={(e) => setNewgender(e.target.value)}\n />\n ): (\n <input\n placeholder={userDbData.gender}\n type=\"text\"\n value={newgender}\n onChange={(e) => setNewgender(e.target.value)}\n />\n )}\n </Grid>\n <Grid className=\"profileSet__leftColumn\" item xs={5} />\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <div className='profileSet__changePass'>\n {changingProfile ? (\n <div className=\"profileSet__loaderChangePass\">\n <CircularProgress size={20} />\n </div>\n ): (\n <button onClick={changeProfile} className=\"mainBtn\">Submit</button>\n )}\n {profileDone ? (\n <div className=\"profileSet__doneMessage\">\n <FaCheckCircle size={20}/>\n <strong>Data updated!</strong>\n </div> \n ): (\n <></>\n )}\n </div>\n </Grid>\n\n\n\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Old password</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <input\n type=\"password\"\n value={oldpass}\n onChange={(e) => setOldpass(e.target.value)}\n />\n </Grid>\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>New password</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <input\n type=\"password\"\n value={newpass}\n onChange={(e) => setNewpass(e.target.value)}\n />\n </Grid>\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Confirm new password</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <input\n type=\"password\"\n value={checkNewpass}\n onChange={(e) => setCheckNewpass(e.target.value)}\n />\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5} />\n <Grid className=\"profileSet__rightColumn\" item xs={7}> \n <div className=\"profileSet__changePass\">\n\n {changingPass ? (\n <div className=\"profileSet__loaderChangePass\">\n <CircularProgress size={20} />\n </div>\n ): (\n <button className=\"mainBtn\" type=\"submit\" onClick={changePass}>Change</button> \n )}\n\n <button>Forgot password?</button> \n </div>\n </Grid>\n\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <div className=\"profileSet__rightBlock\">\n <strong>Account removal</strong>\n <p>You can delete it and nobody will get your personal data anymore.</p>\n </div>\n </Grid>\n <Grid className=\"profileSet__leftColumn\" item xs={5}>\n <label>Delete your account</label>\n </Grid>\n <Grid className=\"profileSet__rightColumn\" item xs={7}>\n <button className=\"secBtn\" onClick={() => {setOpenDel(true)}}>Delete</button> \n </Grid>\n\n <ModalChangepass openChange={openChange} setOpenChange={setOpenChange} modalStyle={modalStyle} classesStyle={classes.paper} />\n <ModalDelUser user={user} openDel={openDel} setOpenDel={setOpenDel} modalStyle={modalStyle} classesStyle={classes.paper} />\n </Grid>\n )}\n\n \n \n </div>\n )\n}", "function CustomHook() { //this is not a compnent its is hook.\n const [count, setcount] = useState(0)\n const countHnadler = () =>{\n setcount(count+1)\n };\n\n return {\n \n count,\n countHnadler\n};\n \n \n}", "function useSafeState(defaultValue) {\n var destroyRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_0__.useState(defaultValue),\n _React$useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__/* [\"default\"] */ .Z)(_React$useState, 2),\n value = _React$useState2[0],\n setValue = _React$useState2[1];\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () {\n destroyRef.current = false;\n return function () {\n destroyRef.current = true;\n };\n }, []);\n function safeSetState(updater, ignoreDestroy) {\n if (ignoreDestroy && destroyRef.current) {\n return;\n }\n setValue(updater);\n }\n return [value, safeSetState];\n}", "function ScoreMetadata(props) {\n const fieldSet = new Set(props.scores ? props.scores.map(score => score.field) : {})\n const fieldArray = Array.from(fieldSet)\n const [chart, setChart] = useState(fieldArray[0])\n const [xAxisData, setXAxisData] = useState()\n\n useEffect(()=>{\n console.log(\"PROPS.SCORES\", props.scores)\n console.log(\"FIELD SET\", fieldSet)\n console.log(\"FIELD ARRAY\", fieldArray)\n }, [props.scores, fieldSet, fieldArray])\n\n // CALCULATING METADATA\n let scoreArray = []\n let name = \"\"\n let tempArray = []\n\n // this is an immediately invoked function expression (IIFE)\n const calculateMetadata = (function () {\n if (props.scores) {\n for (let fieldName of fieldArray) {\n // console.log(typeof fieldName)\n name = fieldName\n let sum = 0\n let counter = 0\n for (let score of props.scores) {\n if (fieldName === score.field) {\n sum += score.scoreNumber\n counter += 1\n tempArray.push(score.scoreNumber)\n }\n }\n // add other metadata calculations to this section\n let obj = {}\n obj[\"field\"] = name\n obj[\"average\"] = Number(sum / counter).toFixed(2)\n obj[\"standard_deviation\"] = std(tempArray).toFixed(2)\n scoreArray.push(obj)\n }\n\n return scoreArray\n } else {\n return null\n }\n }\n )()\n\n // CREATING HISTOGRAM DATA\n useEffect(() => {\n let scoreDistribution = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n for (let score of props.scores) {\n if(score.field === chart) {\n scoreDistribution[`${score.scoreNumber - 1}`] += 1\n }\n }\n setXAxisData(scoreDistribution)\n }, [chart, props.scores])\n\n\n const dropdownOptions = []\n fieldArray.map(field =>\n dropdownOptions.push(\n {\n key: `${field}`,\n value: `${field}`,\n text: field ? titleize(`${field}`) : \"\"\n }\n )\n )\n\n //\n // useEffect(()=>{\n // console.log(\"This is the x axis data\", xAxisData)\n // }, [xAxisData])\n\n\n if (xAxisData){\n return (\n <div>\n <div className={styles.barChartWrapper} style={{}}>\n <div className={styles.wrapperBox}>\n <div className={\"dropdownWrapper\"}>\n <div>\n <Dropdown\n options={dropdownOptions}\n selection\n onChange={(data, { value }) => setChart(value)}\n placeholder={chart ? titleize(chart) : \"\"}\n />\n </div>\n <div className={styles.horizontalFlex}/>\n <div className={styles.metaData}>\n {calculateMetadata.map(function ({field, average, standard_deviation}, index) {\n if (field === chart) {\n return (\n <div key={index}>\n <p className={styles.metadataText}><b>Mean:</b> {average}</p>\n <p className={styles.metadataText}><b>STD:</b> {standard_deviation}</p>\n </div>)\n }\n }\n )}\n </div>\n\n </div>\n <Divider/>\n <VerticalBarChart\n xAxisData={xAxisData}\n />\n {props.scores.length === 0 &&\n <p className={styles.noScoresText}>There are no annotations with scores</p>\n }\n </div>\n </div>\n </div>\n )\n }\n return (\n <div/>\n )\n}", "function VerMaterial() {\n\n // variaables\n // ----------\n const { setDocenteTemporal, docente } = useContext(docenteContext);\n const [linkIncorrecto, setLinkIncorrecto] = useState(false);\n const [materialActual, setMaterialActual] = useState();\n const [linkMaterial, setLinkMaterial] = useState(\"\");\n const [docenteX, setDocenteX] = useState();\n const history = useHistory();\n let id_material_param = null\n let id_docente_param = null\n\n useEffect(() => {\n\n // Se valida si ingreso con la url externa\n // ---------------------------------------\n const parametros = window.location.search\n const urlParams = new URLSearchParams(parametros)\n id_docente_param = urlParams.get(\"id_docente\")\n id_material_param = urlParams.get(\"id_material\")\n\n if (id_docente_param && id_material_param) {\n const auxDocente = async () => {\n const { data } = await getDocente({ id_docente: id_docente_param })\n if (data) {\n setDocenteX(data)\n } else {\n setLinkIncorrecto(true)\n }\n }\n auxDocente();\n\n const auxMaterial = async () => {\n const { data } = await getMaterial({ id_material: id_material_param })\n if (data) {\n setMaterialActual(data)\n setLinkMaterial(`${API_URL}/api/material/documento/${data.link_archivo_material.split(\"/\")[data.link_archivo_material.split(\"/\").length - 1]}`)\n } else {\n setLinkIncorrecto(true)\n }\n\n }\n auxMaterial()\n }\n\n }, []);\n\n // Se hace una copia temporal de un docente\n // para visualizar su perfil\n // ----------------------------------------\n const verDocente = () => {\n setDocenteTemporal(docenteX)\n history.push(\"/Docente/Perfil docente\")\n }\n\n return (\n <>\n {docente ? <NavbarDocente /> : <Navbar />}\n\n {linkIncorrecto ?\n <>\n Ups :( algo no anda bien con este material...\n </>\n :\n <>\n <div className=\"row padre-verMateriales\">\n <div className=\"col s12\">\n <div className=\"card\">\n\n {/* Contenido de la carta */}\n <div className=\"card-content\">\n\n <div className=\"row\">\n\n <div className=\"col s4\">\n <div className=\"infoDocente\">\n\n <h3>DOCENTE</h3>\n <p><strong>Nombre:</strong> <a href={`/Docente/Perfil docente/?id_docente=${docenteX ? docenteX.id_docente : \"\"}`} className=\"linkDocente\" onClick={verDocente}> {docenteX ? docenteX.nombre_completo : \"Cargando...\"}</a></p>\n <p><strong>Areas del conocimiento:</strong> {docenteX ? docenteX.areas_conocimiento : \"Cargando...\"}</p>\n <p><strong>Materias:</strong> {docenteX ? docenteX.materia : \"Cargando...\"}</p>\n <p><strong>Correo:</strong> {docenteX ? docenteX.correo : \"Cargando...\"}</p>\n\n </div>\n </div>\n\n <div className=\"col s4\">\n <div className=\"infoMaterial\">\n\n <h3>MATERIAL</h3>\n <p><strong>Titulo:</strong> {materialActual ? materialActual.titulo_material : \"Cargando...\"}</p>\n <p><strong>Fecha:</strong> {materialActual ? materialActual.fecha_material.split(\"T\")[0] : \"Cargando...\"}</p>\n <p><strong>Link de este material</strong></p>\n <p>{materialActual ? <a href={`/ver material/?id_docente=${materialActual.DOCENTES_id_docente}&id_material=${materialActual.id}`}>\n {`${ACTUAL_HOTS}/?id_docente=${materialActual.DOCENTES_id_docente}&id_material=${materialActual.id}`}\n </a> : \"Cargando...\"}</p>\n\n </div>\n </div>\n\n {/* Acciones de la carta */}\n\n <div className=\"col s4\">\n <div className=\"padre-btn-descargar-verMaterial\">\n {materialActual ? <a className=\"btn btn-descargar-verMaterial\"\n href={linkMaterial}>Descargar</a> : \"\"}\n\n </div>\n </div>\n\n </div>\n\n </div>\n\n {/* Aqui se muestra el pdf */}\n <div className=\"card-image\">\n <>\n {/* aqui se hace la peticion para pedir el archivo */}\n {materialActual ? <iframe src={materialActual ? \"http://docs.google.com/gview?url=\"\n + linkMaterial\n + \"&embedded=true\" : \"\"} width=\"100%\" height=\"700px\" frameBorder=\"0\" ></iframe> : \"\"}\n </>\n\n <span className=\"card-title pie-de-pdf\">Vista previa MATERIAL GESTOR ©</span>\n </div>\n\n </div>\n </div>\n </div>\n </>}\n\n </>\n );\n}", "function App() {\n // const name = \"Kevin\";\n // const isMale = true;\n\n // const [count, setCount] = useState(0);\n\n // const increment = () => {\n // setCount(count + 1);\n // };\n // const decrement = () => {\n // setCount(count - 1);\n // };\n\n const [todos, setTodos] = useState([]);\n const [input, setInput] = useState(\"\");\n\n const addTodo = (e) => {\n e.preventDefault(); // prevents refresh on page when submitting\n console.log(`this is the input: ${input}`);\n setTodos([...todos, input]);\n setInput(\"\");\n };\n\n useEffect(() => {\n console.log(\"rerender!\")\n\n return () => {\n console.log(\"unmouanting\")\n }\n\n }) // Second argument is optional, dependency array []\n /*\n Runs every rerender when there is no []\n When there is an empty [], then it runs once the first time\n Renders when state or prop changes\n */\n \n useEffect(() => {\n console.log(\"mounted once!!\")\n }, [])\n\n useEffect(() => {\n console.log(\"input updated!!\" + input)\n\n return () => {\n // Cleanup function\n console.log('clean up!')\n }\n\n }, [input])\n\n return (\n <div className=\"app\">\n {/* <Header />\n <h1 className=\"app__title\">Hello {name}!</h1>\n <h2 className=\"app__title app__title--large\">\n You are a {isMale ? \"Male\" : \"Female\"}\n </h2>\n {isMale && <h3 className=\"app__title app__title--small\">Bruh</h3>}\n <h1>My counter</h1>\n <p>The count is: {count}</p>\n <button onClick={decrement}>-</button>\n <button onClick={increment}>+</button> */}\n\n {/* <h2 className=\"error\">An error occured</h2>\n <h1>Products</h1>\n <Product\n name=\"Amazon Echo\"\n description=\"Your AI asstitant\"\n price={59.99}\n />\n <Product\n name=\"iPhone 12 Pro Max\"\n description=\"the best iPhone\"\n price={1200}\n />\n <Product\n name=\"Macbook Pro\"\n description=\"Your favorite computer\"\n price={2500}\n /> */}\n\n <h1>Welcome to my todo list</h1>\n <form>\n <input\n value={input}\n onChange={(e) => setInput(e.target.value)}\n type=\"text\"\n />\n <button type=\"submit\" onClick={addTodo}>Add todo</button>\n </form>\n\n <h2>List of Todos</h2>\n {todos.map((todo) => (\n <p>{todo}</p>\n ))}\n\n <Joke />\n </div>\n );\n}", "function App(props) {\n\n let [className, setClassName] = useState(\"App gradient\");\n\n useEffect(() => {console.log('Classname: ', className)}, [className]); \n\n const changeGradient = (props) => {\n setClassName(\"App gradient \" + props);\n }\n\n const resetGradient = () => {\n setClassName(\"App gradient\");\n }\n\n return (\n <div className={className}>\n <h1>Meme Aesthetics</h1>\n <ImageContainer onGuess={changeGradient} onGenerate={resetGradient}/>\n </div>\n );\n}", "function getCount3() {\n const [count3] = useState(3); // eslint-disable-line react-hooks/rules-of-hooks\n return count3;\n }", "function usePrevious(value) {\n var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(); // Store current value in ref\n\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n}", "function App() {\n\n const [Items, setItems] = useState([]);\n const [filterList, setfilterList] = useState([]);\n const [Country, setCountry] = useState(\"\");\n const [Capital, setCapital] = useState(\"\");\n const [Currency, setCurrency] = useState(\"\");\n const [Language, setLanguage] = useState(\"\");\n const [SearchString, setSearchString] = useState(\"\");\n\n\n useEffect(() => {\n console.log(\"INSIDE USEEFFECT\");\n fetch(\"https://restcountries.eu/rest/v2/all\")\n .then(response => response.json())\n .then(data =>\n setItems(data) //Changes state\n // console.log(data)\n );\n }, []);\n\n function onMouseOverHandler(item) {\n console.log(item);\n setCountry(item.name);\n setCapital(item.capital);\n setCurrency(item.currencies[0].name);\n setLanguage(item.languages[0].name);\n }\n\n useEffect(() => {\n setfilterList(Items.filter(checkSubStringMatch));\n }, [SearchString, Items]);\n\n // If I dont add Items, initially it gives No Data. Data appears only on Search. After adding Items we get data initially as well. Weird.\n // Found a possible explanation to this. \n // Initially on first render, Items is empty. Both UseEffects on first render are called. But the filterList useEffect doesn't have Item data on the first time, so the filterList array stays empty and only pops up data when we fill the Search String. This is when Items is not added as 2nd parameter to this useEffect. Now we add Items to it. So now on 1st render Items fills with data and as soon as that happens, the Filter useEffect again causes Re-render - now with full Items data and SearchString as \"\". Note that str.includes(\"\") returns true and hence we get full data.\n\n function checkSubStringMatch(item) {\n return item.name.toLowerCase().includes(SearchString.toLowerCase());\n }\n\n\n\n return (\n <div className=\"App\">\n <h1>Flags and Countries</h1>\n <p><mark>&nbsp;Hover over icons or search for a country.&nbsp;</mark></p>\n\n <div id=\"searchWrapper\">\n <input\n type=\"text\"\n name=\"searchBar\"\n onChange={(event) => setSearchString(event.target.value)}\n id=\"searchBar\"\n placeholder=\"Search for a country\"\n />\n </div>\n\n <div id=\"flag-container\">\n {(filterList.map((item) =>\n <Tippy\n animation=\"scale-subtle\"\n theme=\"translucent\"\n content={<span>\n <strong>Country</strong>: {Country}<br />\n <strong>Capital</strong>: {Capital}<br />\n <strong>Currency</strong>: {Currency}<br />\n <strong>Language</strong>: {Language}\n </span>}>\n <img\n className=\"grow\"\n src={item.flag}\n onMouseOver={() => onMouseOverHandler(item)}\n />\n </Tippy>\n ))}\n </div>\n\n </div>\n );\n}", "function App() {\n const [flag,setFlag] = useState(true);\n const [id,setId] = useState(1);\n \n return (\n <div className=\"App\">\n {/* <button onClick={()=>{setFlag(false)}}>显示/隐藏</button> */}\n {/* <DragDemo></DragDemo> */}\n {/* <DragOrder></DragOrder> */}\n {/* <CrossArea /> */}\n {/* 拖拽排序 */}\n {/* <CanvasSignature /> */}\n\n {/* 企业签章 */}\n {/* <Signature /> */}\n {/* redux demo */}\n {/* <ReduxDemo></ReduxDemo> */}\n {/* <AsyncRedux></AsyncRedux> */}\n {/* <ClickCount></ClickCount> */}\n {\n // flag && <LifeCycles />\n }\n {/* <FriendStatusClass /> */}\n\n\n {/* <div>\n <button onClick={()=>{setFlag(false)}}>flag = false</button>\n <button onClick={()=>{setId(id+1)}}>id++</button>\n </div> */}\n {/* {\n flag && <FriendStatusFn friendId={id} />\n }\n <FriendStatusFn /> */}\n\n {/* <UseRefDemo /> */}\n {/* <UseContextDemo /> */}\n {/* <UseReducerDemo /> */}\n {/* <UseMemoDemo /> */}\n <CustomHookUse />\n {/* <UseStateTrap /> */}\n {/* <UseEffectChangeState /> */}\n </div>\n );\n}", "function CookNow(props) {\n const [userRecipes, setUserRecipes] = useState([])\n const [recipesCookNow, setRecipesCookNow] = useState([]);\n const [allIngs, setAllIngs] = useState([]);\n const [finishedLoading, setFinishedLoading] = useState(false);\n const user = props.user;\n console.log(props)\n\n const handleRecipe = async (e, recipe) => {\n props.history.push({\n pathname: '/recipe', \n state: {\n meal: recipe,\n user: user }\n })\n }\n\n useEffect(async ()=>{\n const recipeResponse = await axios.get(`${REACT_APP_SERVER_URL}/api/users/recipes`);\n const recipeList = recipeResponse.data;\n console.log(\"user recipes\",recipeList);\n setUserRecipes(recipeList)\n\n const allIngResponse = await axios.get(`${REACT_APP_SERVER_URL}/api/ingredients`);\n const allIngData = allIngResponse.data.theIngredients;\n console.log('allIngData',allIngData)\n setAllIngs(allIngData);\n\n const pantryResponse = await axios.get(`${REACT_APP_SERVER_URL}/api/users/pantries`);\n const pantId = pantryResponse.data.pantryList[0]._id;\n console.log(\"pantId\",pantId);\n const payload = {\n id: pantId\n }\n const ingListResponse = await axios.put(`${REACT_APP_SERVER_URL}/api/pantries/ingredients`, payload);\n const ingListData = ingListResponse.data.ingredientList;\n const ingList = []\n ingListData.forEach(ing=>ingList.push(ing.toLowerCase()))\n console.log(\"pantry ingredients\",ingList);\n let cookRecipeList = [];\n\n recipeList.forEach((oneRecipe) => {\n let haveIngredients = true;\n oneRecipe.ingredients.forEach((recipeIngredient) => {\n console.log(recipeIngredient)\n if (!ingList.includes(recipeIngredient.name.toLowerCase())) {\n haveIngredients = false;\n }\n })\n if (haveIngredients) {\n cookRecipeList.push(oneRecipe);\n }\n })\n console.log(\"Recipe cook list\", cookRecipeList)\n setRecipesCookNow(cookRecipeList);\n setFinishedLoading(true);\n\n },[])\n if (!finishedLoading) {\n return (<p>...Loading</p>)\n }\n if (recipesCookNow) {\n var recipeList = recipesCookNow.map((meal, index) => {\n let location = {\n pathname: '/recipe',\n state: {\n meal: meal,\n user: user\n }\n };\n return(\n <article className=\"meal\" key={index}>\n <div className=\"img-container\">\n <img src={meal.thumbnail} alt={meal.name} />\n </div>\n <div className=\"meal-footer\"> \n <h3>{meal.name}</h3>\n <p>{meal.category}</p>\n <Link to={location} user={user} className=\"btn btn-primary btn-details\"> Details </Link>\n </div>\n </article>\n );\n })\n } else {\n return <p>You do not have enough ingredients for any of your favorite meals!</p>\n }\n\n return (\n <section>\n <h2 className='section-title'>Cook Now</h2>\n <div className='meals-center'>\n {recipesCookNow.length ? recipeList : <p> You do not have enough ingredients for any of your favorite meals! </p>}\n </div>\n </section>\n )\n}", "function usePrevious(values) {\n const ref = useRef();\n useEffect(() => {\n ref.current = values;\n });\n return ref.current;\n }", "function Rents() {\n const [rent, setRent] = useState([]);\n\n const action = \"06\";\n\n useEffect(() => {\n if (action) {\n const data = {\n action: \"06\",\n apptoken: \"ZC20AD91QR\",\n };\n\n axios\n .get(\"http://api.abulesowo.ng\", {\n params: data,\n })\n .then((res) => {\n setRent(res.data);\n // console.log(res.data);\n });\n }\n });\n\n // useEffect(() => {\n // axios.get(\"https://jsonplaceholder.typicode.com/posts\");\n\n // })\n\n return (\n <div className=\"property-container\">\n <Header />\n <div className=\"mainContainer search-form\">\n <SearchProperties />\n <div className=\"view-container\">\n <div className=\"left\">\n <p className=\"redText boldText\">Houses for rent</p>\n </div>\n\n <div className=\"right\">\n <a href=\"#\" className=\"redText\">\n View all houses for rent <img src={next} />\n </a>\n </div>\n </div>\n </div>\n <section className=\"mainContainer property-style\">\n {rent.map((item) => (\n <Property item={item} />\n ))}\n </section>\n\n <div className=\"row rent\">\n <div className=\"cols\">\n <a href=\"/property\">\n <img src={prev} alt=\"prev\" />\n </a>\n\n <a href=\"/property\">\n <img src={next} alt=\"next\" />\n </a>\n </div>\n </div>\n </div>\n );\n}", "function useEffect(create, deps) {\n var hooks = getHooksContextOrThrow();\n var effect = useMemoLike('useEffect', function () {\n return {\n create: create\n };\n }, deps);\n\n if (!hooks.currentEffects.includes(effect)) {\n hooks.currentEffects.push(effect);\n }\n}", "function useEffect(create, deps) {\n var hooks = getHooksContextOrThrow();\n var effect = useMemoLike('useEffect', function () {\n return {\n create: create\n };\n }, deps);\n\n if (!hooks.currentEffects.includes(effect)) {\n hooks.currentEffects.push(effect);\n }\n}", "function usePrevious(value) {\n var ref = Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useRef\"])(null);\n Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useEffect\"])(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n}", "function CounterExample(){\n\n const [count,setCount]=useState(0);\n\n useEffect(()=>{\n document.title=`You Clicked ${count} times`;\n });\n\n\n return(\n\n <div>\n <h1>You Clicked {count}</h1>\n\n <button onClick={()=>setCount(count+1)}>Click Me!</button>\n </div>\n\n );\n}", "function usePrevious(value) {\n var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n ref.current = value;\n });\n return ref.current;\n}", "function usePrevious(value) {\n var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n ref.current = value;\n });\n return ref.current;\n}", "function Home({ data }) {\n\t// state.\n\t// const [img, setImg] = useState([]);\n\n\t// useEffect(() => {\n\t// \tgetValue();\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [img]);\n\t// console.log(img);\n\n\t// var query = \"Thor\";\n\t// const getValue = async () => {\n\t// \tconst apiCall = await fetch(\n\t// \t\t// theMovieDB API\n\t// \t\t`https://api.themoviedb.org/3/search/movie?api_key=d9e5042ea73fb5a2c1855ec63cd94f3a&language=en-US&query=${query}&page=1&include_adult=false`\n\t// \t);\n\t// \tconst data = await apiCall.json();\n\t// \tvar posterPath = data.results.map(poster => {\n\t// \t\treturn poster.poster_path;\n\t// \t});\n\t// \tconsole.log(data);\n\t// \t// console.log(posterPath[0]);\n\t// \tsetImg(posterPath);\n\t// };\n\n\t//\thttp://placehold.jp/1600x450.jpg // placeholder image\n\n\treturn (\n\t\t<div className=\"\">\n\t\t\t<Hero heroBg={img} />\n\t\t\t<div className=\"container\">\n\t\t\t\t{data.map(value => (\n\t\t\t\t\t<CardHolder\n\t\t\t\t\t\tkey={value.id}\n\t\t\t\t\t\ttitle={value.title}\n\t\t\t\t\t\tdata={value.cardInfo}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t{/* <CardHolder title=\"Popular \" />\n\t\t\t\t<CardHolder title=\"Trending \" />\n\t\t\t\t<CardHolder title=\"Top Rated \" />\n\t\t\t\t<CardHolder title=\"Upcoming \" /> */}\n\t\t\t</div>\n\n\t\t\t{/* {img.map(img => (\n\t\t\t\t<img\n\t\t\t\t\tsrc={\n\t\t\t\t\t\timg\n\t\t\t\t\t\t\t? \"https://image.tmdb.org/t/p/original\" + img\n\t\t\t\t\t\t\t: \"http://via.placeholder.com/640x360\"\n\t\t\t\t\t}\n\t\t\t\t\talt=\"Movie Poster\"\n\t\t\t\t/>\n\t\t\t))} */}\n\t\t</div>\n\t);\n}", "function App() {\n\t// count how many times the app was rendered\n\t// -- Infinity loop\n\t//const [renderCount, setRenderCount] = useState(1);\n\tconst [value, setValue] = useState('initial');\n\tconst renderCount = useRef(1); // object\n\tconst inputRef = useRef(null);\n\tconst prevValue = useRef('');\n\n\tuseEffect(() => {\n\t\t//setRenderCount(prev => prev + 1);\n\t\trenderCount.current++;\n\t\t//console.log(inputRef.current.value);\n\t});\n\n\tuseEffect(() => {\n\t\tprevValue.current = value\n\t}, [value]);\n\n\tconst focus = () => inputRef.current.focus();\n\n\treturn (\n\t\t<div>\n\t\t\t{/* <h1>Quantity of renders: {renderCount}</h1> */}\n\t\t\t<h1>Quantity of renders: {renderCount.current}</h1>\n\t\t\t<h2>Previous state: {prevValue.current}</h2>\n\t\t\t<input ref={inputRef} type='text' onChange={e => setValue(e.target.value)} value={value} />\n\t\t\t<button className='btn btn-success' onClick={focus}>Focus</button>\n\t\t</div>\n\t);\n}", "function useSafeSetState(initialState) {\n const [state, setState] = useSetState(initialState)\n\n const isMountedRef = useRef()\n\n useEffect(() => {\n isMountedRef.current = true\n\n return () => (isMountedRef.current = false)\n }, [])\n\n const setStateSafely = (...args) => isMountedRef.current && setState(...args)\n\n return [state, setStateSafely]\n}", "function useUpdateEffect(effect, deps) {\n var mounted = React.useRef(false);\n React.useEffect(function () {\n if (mounted.current) {\n effect();\n } else {\n mounted.current = true;\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, deps);\n}", "function App() {\n const [classifieds,\n setClassifieds] = React.useState([])\n\n React.useEffect(() => {\n\n async function getClassifieds() {\n let classifieds\n try {\n classifieds = await get(url.classifiedsUrl)\n console.log(\"app classsifieds\", classifieds)\n setClassifieds(classifieds)\n } catch (e) {\n console.log(e)\n }\n }\n getClassifieds()\n }, [])\n\n const [images,\n setImages] = React.useState([])\n React.useEffect(() => {\n async function getImages() {\n let images\n try {\n images = await get(url.imagesUrl)\n setImages(images)\n } catch (e) {\n console.log(e)\n }\n }\n\n getImages()\n }, [])\n\n return (\n <div >\n <CustomNavbar/>\n\n \n <div className=\"uk-container\">\n <ClassifiedsPanel title=\"Marketplace\" classifieds={classifieds}></ClassifiedsPanel>\n <GalleryPanel title=\"Local Pictures\" images={images}/>\n </div>\n <CustomFooter/>\n </div>\n\n );\n}", "function App() {\n // portions of state based off lecture code\n\n const [state, setState] = useState({\n guesses: [],\n results: [],\n disabled: false,\n warnings: \"Welcome. Please enter 4 digits to begin\",\n });\n\n useEffect(() => {\n ch_join(setState);\n });\n\n function guess(text) {\n // Inner function isn't a render function\n ch_push({guess: text});\n }\n \n function reset() {\n ch_reset();\n }\n \n // based off lecture code\n let body = (\n <div>\n <SetTitle text={\"4Digits Game\"}/>\n <div className=\"row\">\n <div className=\"column\">\n <h1>4Digits!</h1>\n <Controls reset={reset} guess={guess} disabled={state.disabled}/>\n </div>\n <div className=\"column\">\n <p>{\"\\n\"}</p>\n <p className=\"userMessages\">{state.warnings}</p>\n </div>\n </div>\n <PrevGuesses guesses={state.guesses} results={state.results}/>\n </div>\n );\n return (\n <div className=\"container\">\n {body}\n </div>\n );\n}", "function ForageablesContainer() {\n const [forageables, setForageables] = useState([]);\n const [forageablesCount, setForageablesCount] = useState(-1);\n \n\n //useEffect hook to setForageables and setForageablesCount whenever forageables or forageablesCount changes\n useEffect(() => {\n if (forageables.length === forageablesCount) return;\n fetch(\"http://localhost:3004/forageables\")\n .then (r => r.json())\n .then (data => setForageables(data))\n setForageablesCount(forageables.length);\n },[forageables, forageablesCount]);\n \n //returns a div with the ForageablesCollection component. \n //Passes down props and callback functions to ForageablesCollection \n return (\n <div>\n <ForageablesCollection onChange={setForageables} setForageables={setForageables} forageables={forageables} forageablesCount={forageablesCount} setForageablesCount={setForageablesCount} />\n </div>\n )\n}", "function usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;}", "function Home() {\n const [count, setCount] = useState(0)\n // const test = false\n // if (test) {\n const [age, setAge] = useState(20)\n // }\n // 相当于 componentDidMount 和 componentDidUpdate:\n useEffect(() => {\n // 使用浏览器的 API 更新页面标题\n document.title = `You clicked ${count} times`\n return () => {\n console.log('unmount')\n }\n }, [age])\n\n useEffect(() => {\n const timer = setInterval(() => {\n setCount(count + 1)\n }, 50)\n return () => {\n clearInterval(timer)\n }\n })\n return (\n <div>\n <h2>Home{count}</h2>\n <button\n onClick={() => {\n setCount(count + 1)\n }}\n >\n add\n </button>\n </div>\n )\n}", "function home(str) {\r\n const [state, setState] = useState({ left: 0, top: 0, width: 100, height: 100 });\r\n const [dataList, getList] = useState([]);\r\n const [videoCategoryList, getVideo] = useState([]);\r\n const [num, setNum] = useState(10);\r\n const store = useContext(AppContext);\r\n useEffect(() => {\r\n let obj = { page: 2, count: 2, type: 'video' };\r\n loadData(obj);\r\n }, []);\r\n useEffect(() => {\r\n videoData();\r\n }, []);\r\n const position = useWindowPosition();\r\n const [size, setSize] = useState({ width: 100, height: 100 });\r\n useEffect(()=>{\r\n \r\n },[])\r\n // useEffect(() => { \r\n // // 注意:这是个简化版的实现\r\n // window.addEventListener('mousemove', handleWindowMouseMove);\r\n // return () => window.removeEventListener('mousemove', handleWindowMouseMove);\r\n // }, [state]);\r\n const loadData = async (obj)=> {\r\n let res = await Api.getJoke(obj);\r\n getList(res.result);\r\n store.saveObj(res)\r\n }\r\n const handleWindowMouseMove =(e)=> {\r\n console.log(state)\r\n // 展开 「...state」 以确保我们没有 「丢失」 width 和 height\r\n setState(state => ({ ...state, left: e.pageX, top: e.pageY }));\r\n }\r\n const videoData = async ()=> {\r\n let res = await Api.videoCategory();\r\n getVideo(res.result);\r\n }\r\n return (\r\n <>\r\n <Carousel autoplay>\r\n {\r\n dataList.map((item, index) => {\r\n let sectionStyle = {\r\n width: \"100%\",\r\n height: \"300px\",\r\n background: `url(${item.thumbnail})`\r\n };\r\n return (\r\n <div\r\n key={index}\r\n >\r\n <div style={sectionStyle}></div>\r\n </div>\r\n )\r\n })\r\n }\r\n </Carousel>\r\n <li><Link to=\"/my\">34545</Link></li>\r\n <p>num: {num}</p>\r\n <button onClick={() => setNum(num + 1)}>set num</button>\r\n\r\n {/* 深度监听 store 变化并进行重渲染,导致下面两行结果相同 */}\r\n <p>Count: {store.getCount}</p>\r\n <Observer>{() => <p>Count2: {store.getCount}</p>}</Observer>\r\n <button onClick={() => store.handleCount()}>Counter Add</button>\r\n </>\r\n );\r\n}", "function Header() {\n // state = variable in react.. \n const [countries, setCountries] = useState([]);\n const [mapCountries, setMapCountries] = useState([]);\n // end point = https://disease.sh/v3/covid-19/countries\n // useEffect => runs a piece of code based on a given condition\n useEffect(() => {\n // code inside here will run once one the component loads (if [] is empty), and will not run again after.. \n // if there was a variable in [], it will run when the variable changes..\n\n // async => send req, wait for it, do something.. \n // useEffect write internal function\n const getCountriesData = async() => {\n const url = 'https://disease.sh/v3/covid-19/countries'\n await fetch(url)\n .then(res => res.json())\n .then(data => {\n const countries = data.map(country => ({\n name: country.country,\n value: country.countryInfo.iso2\n }));\n setCountries(countries);\n setMapCountries(data)\n });\n }\n // call the function\n getCountriesData();\n }, []); // [] is the condition\n\n // to remember which one we selected\n const [country, setCountry] = useState('worldwide');\n const [countryInfo, setCountryInfo] = useState({});\n\n const [center, setCenter] = useState({lat: 34.80746, lng:-40.4796});\n const [zoom, setZoom] = useState(3);\n\n\n const onCountryChange = async (e) => {\n console.log('e ==> ', e.target.value)\n const code = e.target.value; \n setCountry(code);\n const url = code === 'worldwide' ? 'https://disease.sh/v3/covid-19/all'\n : `https://disease.sh/v3/covid-19/countries/${code}`\n\n // make the call - async\n await fetch(url)\n .then(res => res.json())\n .then(data => {\n setCountry(code)\n setCountryInfo(data);\n if(data.countryInfo.lat && data.countryInfo.lon) {\n setCenter([data.countryInfo.lat, data.countryInfo.long]);\n }\n setZoom(4);\n })\n }\n\n useEffect(() => {\n fetch('https://disease.sh/v3/covid-19/all')\n .then(res => res.json())\n .then(data => setCountryInfo(data))\n },[]);\n\n\n return (\n <>\n <div className=\"header\">\n <div className=\"logo\">\n <h2>COVID-19</h2>\n <img src={virus} width=\"6%\"/> <img src={mask} width=\"6%\"/>\n </div>\n <FormControl className=\"app-dropdown\">\n <Select\n id=\"select\"\n variant=\"outlined\"\n value={country}\n onChange={e => onCountryChange(e)}\n >\n <MenuItem value=\"worldwide\">Worldwide</MenuItem>\n {/* LOOP THROUGH all countries .. with state */}\n {countries.map(country => \n <MenuItem value={country.value}>{country.name}</MenuItem> \n )}\n </Select>\n </FormControl>\n </div>\n <div id=\"title\">\n <h1 id=\"total\">Total</h1>\n <div id=\"empty\"></div>\n </div>\n <div className=\"app-stats\">\n <div>\n <div id=\"stats\">\n <Stats \n title=\"Current\"\n dailyCases={countryInfo.todayCases} \n total={countryInfo.cases}\n />\n <Stats \n title=\"Recovered\"\n dailyCases={countryInfo.todayRecovered}\n total={countryInfo.recovered}\n />\n <Stats \n title=\"Deaths\"\n dailyCases={countryInfo.todayDeaths}\n total={countryInfo.deaths}\n /> \n </div>\n <div className=\"line-chart\">\n <Line />\n </div >\n </div> \n <Table />\n </div>\n </>\n )\n}", "function App() {\n /** useState()\n * [state, setState] = useState(estado inicial);\n */\n const [repositorio, setRepositorio] = useState([]);\n\n //Equivale ao ComponentDidMount - executado apenas uma vez, na criação do componente\n //Muito utilizado para carregar dados de uma api\n useEffect(() => {\n\n const fetchData = async () => {\n const response = await fetch('https://api.github.com/users/Iann-rst/repos');\n const data = await response.json();\n \n setRepositorio(data);\n }\n fetchData();\n\n }, []);\n\n //Equivale ao ComponentDidUpdate - disparar toda vez que a variável 'repositorio' mudar\n useEffect(()=>{\n const filtered = repositorio.filter(repo => repo.favorite);\n\n document.title = `Você tem ${filtered.length} favoritos`;\n }, [repositorio]);\n\n\n\n\n function handleFavorite(id){\n const novoRepositorio = repositorio.map(repo => {\n return repo.id === id ? {...repo, favorite: !repo.favorite} : repo\n })\n setRepositorio(novoRepositorio);\n }\n\n return (\n <> \n <ul>\n {repositorio.map(repo => (\n <li key = {repo.id}>{repo.name}\n {repo.favorite && <span> (Favorito) </span>}\n <button onClick={() => handleFavorite(repo.id)}>Tornar Favorito</button>\n </li>\n ))}\n </ul>\n </>\n );\n}", "function useState (initialState) {\n let state = initialState\n const listeners = new Set()\n const get = () => state\n const set = (callback) => {\n state = callback(state)\n listeners.forEach((cb) => cb(state))\n return state\n }\n const on = (callback) => {\n listeners.add(callback)\n callback(state)\n return () => {\n listeners.delete(callback)\n }\n }\n const clear = () => {\n listeners.clear()\n }\n return { get, set, on, clear }\n}", "function AllAboutTeam(props) {\n console.log(\"AllAboutTeam\");\n const [players, setPlayers] = useState([]);\n\n let char;\n let winnerArray = props.teamMatches.map(element => {\n if(element.winner == \"DRAW\"){\n char = \"D\"\n return char\n }\n else if(element.awayCity == props.teamName.teamName){\n return element.winner == \"AWAY_TEAM\" ? char=\"W\" : char=\"L\"\n }\n else if(element.homeCity == props.teamName.teamName){\n return element.winner == \"HOME_TEAM\" ? char=\"W\" : char=\"L\"\n }\n element.char = char;\n return element;\n \n })\n\n console.log(winnerArray + \"winnerArray er her\")\n console.log(\"AllAboutTeam - Players\", players);\n console.log(\"AllAboutTeam - teamMatches\", props.teamMatches);\n console.log(\"props.teamName.teamName\" + props.teamName.teamName)\n\n useEffect(() => {\n console.log(\"AllAboutTeam - useEffect\");\n\n console.log(\"AllAboutTeam - teams\");\n {\n console.log(props.teamID.teamID);\n console.log(\"Hvis du er her, så er props.teamID.teamID IKKE undefined\");\n let urlPlayers = URL + \"/api/fb/teammembers/\" + props.teamID.teamID;\n console.log(\"AllAboutTeam - useEffect - urlPlayers\", urlPlayers);\n\n fetch(urlPlayers)\n .then(handleHttpErrors)\n .then(data => {\n console.log(\"AllAboutTeam - fetch - data\", data);\n console.log(JSON.stringify(data));\n setPlayers(data);\n })\n .catch(console.log.bind(console));\n }\n }, [props.teamID.teamID]);\n console.log(\"TeamID AllAboutTeam \" + JSON.stringify(props.teamID.teamID));\n if (props.teamID.teamID == null) {\n return (\n <div>\n <p></p>\n </div>\n );\n } else {\n return (\n <div>\n <br/>\n <b>{props.teamName.teamName}</b>'s latest performance in all competitions.\n <p>{winnerArray.join(\"-\")}</p>\n <br/>\n <div>\n <table className=\"Table\">\n <thead>\n <tr>\n <th></th>\n <th>Position</th>\n <th>Name</th>\n <th>Date of birth </th>\n <th>Nationality</th>\n </tr>\n </thead>\n <tbody>\n {players.map(element => (\n <tr key={uuid()}>\n <td>{element.position === \"Goalkeeper\" && <img src={require(\"../../images/goalkeeper.png\")} className=\"thumbnailFootball\" alt=\"\"></img>}\n {element.position === \"Defender\" && <img src={require(\"../../images/defender.png\")} className=\"thumbnailFootball\" alt=\"\"></img>}\n {element.position === \"Midfielder\" && <img src={require(\"../../images/midtfielder.jpg\")} className=\"thumbnailFootball\" alt=\"\"></img>}\n {element.position === \"Attacker\" && <img src={require(\"../../images/attacker.png\")} className=\"thumbnailFootball\" alt=\"\"></img>}\n {element.role === \"COACH\" && <img src={require(\"../../images/coach.png\")} className=\"thumbnailFootball\" alt=\"\"></img>}\n {element.role === \"ASSISTANT_COACH\" && <img src={require(\"../../images/coach.png\")} className=\"thumbnailFootball\" alt=\"\"></img>}\n </td>\n {element.role === \"ASSISTANT_COACH\" && <td> {\"Ass. Coach\"} </td>}\n {element.role === \"COACH\" ? <td>{\"Coach\"}</td> : element.position}\n <td>{element.name}</td>\n <td>{element.dateOfBirth}</td>\n <td>{element.nationality}</td>\n </tr>\n ))}\n <div>\n </div>\n </tbody>\n </table>\n </div>\n </div>\n );\n }\n}", "function StarWars() {\n\n let [people, setPeople] = useState([])\n let [planet, setPlanet] = useState([])\n let [films, setFilms] = useState([])\n let [species, setSpecies] = useState([])\n let [vehicles, setVehicles] = useState([])\n let [starship, setStarship] = useState([])\n\n\n let [displayThing, setDisplayThing] = useState({ name: '' })\n\n let [display, setDisplay] = useState('')\n let [loaded, setLoaded] = useState(false)\n\n console.log(starship)\n useEffect(() => {\n\n let promise = new Promise(function (resolve, reject) {\n setTimeout(function () {\n resolve('my promise is resolved')\n }, 5000)\n })\n\n let promises = [\n Axios?.get('https://swapi.dev/api/people/'),\n Axios?.get('https://swapi.dev/api/planets/'),\n Axios?.get('https://swapi.dev/api/films/'),\n Axios?.get('https://swapi.dev/api/species/'),\n Axios?.get('https://swapi.dev/api/vehicles/'),\n Axios?.get('https://swapi.dev/api/starships/'),\n\n\n\n\n ]\n Promise.all(promises).then(res => {\n console.log(res)\n setPeople(res[0].data?.results)\n setPlanet(res[1].data?.results)\n setFilms(res[2].data?.results)\n setSpecies(res[3].data?.results)\n setVehicles(res[4].data?.results)\n setStarship(res[5].data?.results)\n setLoaded(true)\n })\n\n }, [])\n\n const showCharacter = () => {\n let person = people[Math.floor(Math.random() * people.length)]\n console.log(person)\n\n setDisplayThing(person)\n setDisplay('character')\n }\n\n const showPlanet = () => {\n let singlePlanet = planet[Math.floor(Math.random() * planet.length)]\n console.log(planet)\n console.log(singlePlanet)\n setDisplayThing(singlePlanet)\n setDisplay('planet')\n }\n const showFilms = () => {\n let singleFilm = films[Math.floor(Math.random() * films.length)]\n console.log(films)\n console.log(singleFilm)\n setDisplayThing(singleFilm)\n setDisplay('films')\n }\n\n const showSpecies = () => {\n let singleSpecie = species[Math.floor(Math.random() * species.length)]\n console.log(species)\n console.log(singleSpecie)\n setDisplayThing(singleSpecie)\n setDisplay('species')\n\n }\n\n const showVehicles = () => {\n let singleVehicle = vehicles[Math.floor(Math.random() * vehicles.length)]\n console.log(vehicles)\n console.log(singleVehicle)\n setDisplayThing(singleVehicle)\n setDisplay('vehicles')\n }\n\n const showStarship = () => {\n let singleStarship = starship[Math.floor(Math.random() * starship.length)]\n console.log(starship)\n console.log(singleStarship)\n setDisplayThing(singleStarship)\n setDisplay('starship')\n }\n\n\n\n return (\n // style={{ backgroundImage: 'url(' + require('src/Components/star.jpg') + ')' }}\n // style={{ backgroundImage: 'url(' + require(vader) + ')' }}\n <body id='starBody'>\n\n\n <div >\n {!loaded ? <FadeLoader /> :\n <div>\n <button onClick={showCharacter}>Get Character</button>\n <button onClick={showPlanet}>Get Planet</button>\n <button onClick={showFilms}>Get Films</button>\n <button onClick={showSpecies}>Get Species</button>\n <button onClick={showVehicles}>Get Vehicles</button>\n <button onClick={showStarship}>Get Starship!</button>\n\n {display == 'character' ?\n <div>\n <h2 className=\"swTitle\" >{displayThing.name.toUpperCase()}</h2>\n <p>Born on: {displayThing.birth_year} </p>\n <p>Eye color: {displayThing.eye_color} </p>\n <p>Gender: {displayThing.gender} </p>\n <p>Hair color: {displayThing.hair_color} </p>\n <p>Height: {displayThing.height} </p>\n <p>Weight: {displayThing.mass} </p>\n <p>Skin color: {displayThing.skin_color} </p>\n </div> : null}\n\n {display == 'planet' ?\n <div>\n <h2 className=\"swTitle\"> {displayThing.name.toUpperCase()}</h2>\n <p>Diameter: {displayThing.diameter} </p>\n <p>Gravity: {displayThing.gravity} </p>\n <p>Population: {displayThing.population} </p>\n <p>Rotational period: {displayThing.rotation_period} </p>\n <p>Terrain type: {displayThing.terrain} </p>\n </div> : null}\n\n {display == 'films' ?\n <div>\n <h2 className=\"swTitle\"> {displayThing.title.toUpperCase()}</h2>\n <p>Director: {displayThing.director} </p>\n <p>Producer(s): {displayThing.producer} </p>\n <p>Opening Crawl:\n <p>{displayThing.opening_crawl}</p> </p>\n </div> : null}\n\n {display == 'species' ?\n <div>\n <h2 className=\"swTitle\">{displayThing.name.toUpperCase()}</h2>\n <p>Average height: {displayThing.average_height} </p>\n <p>Average fifespan:{displayThing.average_lifespan} </p>\n <p>Classification: {displayThing.classification} </p>\n <p>Designation: {displayThing.designation} </p>\n <p>Eye colors: {displayThing.eye_colors} </p>\n <p>Hair colors: {displayThing.hair_colors} </p>\n <p>Languages: {displayThing.language} </p>\n <p>Skin colors: {displayThing.skin_colors} </p>\n </div> : null}\n\n {display == 'vehicles' ?\n <div>\n <h2 className=\"swTitle\">{displayThing.name.toUpperCase()}</h2>\n <p>Manufacturer: {displayThing.manufacturer} </p>\n <p>Model: {displayThing.model} </p>\n <p>Purchase price: {displayThing.cost_in_credits} credits </p>\n <p>Vehicle class: {displayThing.vehicle_class} </p>\n <p>Vehicle length: {displayThing.length}M </p>\n <p>Max atmospheric speed: {displayThing.max_atmosphering_speed} </p>\n <p>Cargo capacity: {displayThing.cargo_capacity} </p>\n <p>Passengers: {displayThing.passengers} </p>\n <p>Operational crew: {displayThing.crew} personel(s) </p>\n <p>Model: {displayThing.model} </p>\n </div> : null}\n\n {display == 'starship' ?\n <div>\n <h2 className=\"swTitle\"> {displayThing.name.toUpperCase()}</h2>\n <p>Manufacturer: {displayThing.manufacturer}</p>\n <p>Model: {displayThing.model} </p>\n <p>Purchace price: {displayThing.cost_in_credits} credits</p>\n <p>Starship Class: {displayThing.starship_class} </p>\n <p>Starship length: {displayThing.length}M</p>\n <p>Max atmospheric speed: {displayThing.max_atmosphering_speed} </p>\n <p>Cargo capacity: {displayThing.cargo_capacity}</p>\n <p>Passengers: {displayThing.passengers} </p>\n <p>Operational Crew: {displayThing.crew} personel(s)</p>\n <p>MGLT: {displayThing.MGLT}</p>\n <p>Consumables: {displayThing.consumables}</p>\n <p>Hyperdrive Rating: {displayThing.hyperdrive_rating}</p>\n\n </div> : null}\n <p><ReactAudioPlayer src=\"imperial.mp3\" autoPlay /></p>\n <div>\n\n\n\n\n\n\n\n </div>\n\n </div>}\n\n </div>\n </body>\n )\n}", "function useUpdateEffect(effect, deps) {\n var mounted = Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useRef\"])(false);\n Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useEffect\"])(function () {\n if (mounted.current) {\n effect();\n } else {\n mounted.current = true;\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, deps);\n}", "function Admin({ name }) {\n\n // State\n const [users, setUsers] = useState([]);\n const [newUser, setNewUser] = useState(false);\n // const [newTask, setNewTask] = useState(false);\n\n useEffect(() => {\n const getUsersfromDateBase = async () => {\n try {\n const response = await axios({\n method: 'get',\n url: '/api/v1/users',\n headers: { 'Content-Type': 'application/json;charset=utf-8' },\n })\n setUsers(response.data);\n console.log(response.data);\n } catch (err) {\n console.log(\"\\n Error while signing of Login Section\", err.message);\n return 0;\n }\n }\n\n getUsersfromDateBase();\n\n }, [newUser]);\n\n useEffect(() => {\n console.log(\"Use effect 2 test\")\n }, [newUser])\n\n\n\n\n // Function to update state\n const getUsers = async () => {\n\n // remove new user registration tab\n\n setNewUser(false);\n // setNewTask(true);\n\n // try {\n // const response = await axios({\n // method: 'get',\n // url: '/api/v1/users',\n // headers: { 'Content-Type': 'application/json;charset=utf-8' },\n // })\n\n // setUsers(response.data);\n\n // console.log(response.data);\n\n // } catch (err) {\n // console.log(\"\\n Error while signing of Login Section\", err.message);\n // return 0;\n // }\n\n }\n\n\n const addUser = () => {\n\n // newUser ? setNewUser(false) : setNewUser(true);\n setNewUser(true);\n\n }\n\n //Finale components that gets rendered\n return (\n <div className=\"admin\">\n {/* <h1>HELLO : {name.toUpperCase()}</h1> */}\n <div className=\"admin__admin__controls\">\n {/* <h1>HELLO : {name.toUpperCase()}</h1> */}\n <div className=\"admin__buttons\">\n <div className=\"lh-copy mt3\">\n <button onClick={getUsers} className=\"center b ph3 pv2 input-reset ba b--black bg-transparent grow pointer f6\">\n Users\n </button>\n </div>\n <div className=\"lh-copy mt3\">\n <button onClick={addUser} className=\"center b ph3 pv2 input-reset ba b--black bg-transparent grow pointer f6\">\n Add User\n </button>\n </div>\n </div>\n <div className=\"admin__scroll\">\n\n {/* Display users from database */}\n <div className=\"admin__users\">\n {!newUser && users.map((user, i) => {\n const { _id, name, role, email, createdOn } = user;\n return (<UserInfo key={_id} id={_id} name={name} role={role} email={email} createdOn={createdOn} />)\n })\n }\n </div>\n\n {/* Assign Task to the user */}\n {/* <div className=\"admin__add__task\">\n { newTask ? <AddTask /> : null}\n </div> */}\n\n {/* Register New User */}\n <div className=\"admin__newUser\">\n {newUser ? <RegisterAdmin /> : null}\n </div>\n </div>\n </div>\n {/* <div className=\"admin__scheduler\">\n <Demo_2 />\n </div> */}\n\n </div >\n\n )\n}", "handleClickMakeEffect() {\n this.setState(state => ({\n words: [...state.words, 'marklar']\n }));\n }", "function MemoryGame({options, setOptions}) {\n // Declaring state variables\n const [game, setGame] = useState([])\n const [flippedCount, setFlippedCount] = useState(0)\n const [flippedIndexes, setFlippedIndexes] = useState([])\n\n // The Effect Hook lets you perform side effects in function components\n // The useEffect hook runs here when the component renders and randomly \n // assigns options / 2 images out to all the cards.\n useEffect(() => {\n const newGame = []\n // Looping through the array of options which are the images\n // There are 8 images and we have set the options to 16 so every image is duplicated\n // The imageId will be the same for matching images\n // The id will be different for each image\n for (let i = 0; i < options / 2; i++) {\n const firstOption = {\n id: 2 * i,\n imageId: i,\n image: Images[i],\n flipped: false,\n }\n const secondOption = {\n id: 2 * i + 1,\n imageId: i,\n image: Images[i],\n flipped: false,\n }\n // Pushing the options to the newGame array\n newGame.push(firstOption)\n newGame.push(secondOption)\n }\n \n // Shuffle the array with sort() and Math.random() to mix up the images/cards\n const shuffledGame = newGame.sort(() => Math.random() - 0.5)\n // Setting the game state to the shuffled game\n setGame(shuffledGame)\n }, []) // Passing an empty array so the props and state inside the effect will always have their initial values\n \n // Here we use the Effect hook to set options to null when the game is finished\n // We will then return to initial state after 1 sec. as set in setTimeout\n useEffect(() => {\n const finished = !game.some(card => !card.flipped)\n if (finished && game.length > 0) {\n setTimeout(() => {\n setOptions(null)\n }, 1000)\n }\n }, [game]) // Pass an array as an optional second argument to tell React \n // to skip applying an effect if certain values haven’t changed between re-renders.\n \n // If two cards have been flipped\n if (flippedIndexes.length === 2) {\n // Declare it a match when both flipped indexes have the same imageId\n const match = game[flippedIndexes[0]].imageId === game[flippedIndexes[1]].imageId\n // If they match \n if (match) {\n // We clone the game board to update the flipped values of those cards in the game array\n const newGame = [...game]\n // Setting the flipped indexes to true\n newGame[flippedIndexes[0]].flipped = true\n newGame[flippedIndexes[1]].flipped = true\n // And setting the game state to newGame\n setGame(newGame)\n\n // Then we update the game and set the third flippedIndexes value to be false, preventing a flip reset\n const newIndexes = [...flippedIndexes]\n newIndexes.push(false)\n setFlippedIndexes(newIndexes)\n // If not a match we leave the game board alone and add true to the flippedIndexes array,\n // triggering a flip reset.\n } else {\n const newIndexes = [...flippedIndexes]\n newIndexes.push(true)\n setFlippedIndexes(newIndexes)\n }\n }\n // This is what the function returns to the DOM\n return (\n <div id=\"cards\">\n {/* Mapping the game array to render out the cards. Also passing down id, \n image, game and both flipped hooks to each of the cards to use in the click handlers */}\n {game.map((card, index) => (\n <div className=\"card\" key={index}>\n <Card\n id={index}\n image={card.image}\n game={game}\n flippedCount={flippedCount}\n setFlippedCount={setFlippedCount}\n flippedIndexes={flippedIndexes}\n setFlippedIndexes={setFlippedIndexes}\n />\n </div>\n ))}\n </div>\n )\n \n}", "function App (){\n const [jokes,setJokes] = useState();\n \n \n useEffect(()=> {\n function myrequest (){\n const response =fetch(\"https://icanhazdadjoke.com\",{ headers:{accept:\"application/json\"}})\n .then(response => response.json())\n .then(response =>console.log (response.data.joke));\n setJokes(response.data.joke);\n };\n \n myrequest();\n },[]);\n \n \n return(\n\n <div>\n <joke jokes={jokes}/>\n </div>\n )\n}", "function FollowUnfollow(props) {\n\n\n\n const { userInfo, currentUsername, setFollowers } = props\n\n const [isFollowing, setIsFollowing] = useState(false)\n\n useEffect(() => {\n \n const followerList = userInfo.connections.followers.map(follower => follower.follower)\n if (followerList.includes(currentUsername)) {\n setIsFollowing(true)\n } else {\n setIsFollowing(false)\n }\n\n }, [currentUsername, userInfo.connections.followers])\n\n\n //hiddenText, buttonColor\n\n const [[, , isFollowError,], setFollowData]\n = useApi(operations.FOLLOW, {})\n const [[, , isUnfollowError,], setUnfollowData]\n = useApi(operations.UNFOLLOW, {})\n\n const handleOnClick = e => {\n e.preventDefault()\n if (isFollowing) {\n setUnfollowData({\n urlVariables: [userInfo.username]\n })\n setFollowers(prevFollowers => {\n const newFollowers = [...prevFollowers]\n return newFollowers.filter(follower => follower.follower !== currentUsername)\n })\n setIsFollowing(false)\n\n } else {\n setFollowData({\n payload: {\n followee: userInfo.username,\n }\n })\n setFollowers(prevFollowers => {\n const newFollowers = [{\n follower: currentUsername,\n since: new Date().getFullYear(),\n }]\n return newFollowers.concat(prevFollowers)\n })\n setIsFollowing(true)\n }\n }\n\n // useEffect(() => {\n\n // console.log(\"useEffect 2 executed\")\n\n // if (isFollowing) {\n\n // visibleText = \"Following\"\n // hiddenText = \"Unfollow\"\n // buttonColor = \"green\"\n // } else {\n\n // visibleText = \"Follow\"\n // hiddenText = \"Follow\"\n // buttonColor = \"blue\"\n // }\n // }, [isFollowing])\n\n // console.log(\"visibleText:\", visibleText, \"Hidden Text:\", hiddenText, \"buutoncolor:\", buttonColor)\n\n\n return (\n\n <Card.Content extra>\n\n {/* <Button disabled={isFollowLoading || isUnfollowLoading}\n //primary\n animated='fade'\n onClick={handleOnClick}\n color={isFollowLoading || isUnfollowLoading\n ? 'grey'\n : buttonColor}\n > */}\n {\n isFollowing ?\n <Button animated='fade' color=\"green\" onClick={handleOnClick}>\n <Button.Content visible>Following</Button.Content>\n <Button.Content hidden>Unfollow</Button.Content>\n </Button>\n :\n <Button animated='fade' color=\"blue\" onClick={handleOnClick}>\n <Button.Content visible>Follow</Button.Content>\n <Button.Content hidden>Follow</Button.Content>\n </Button>\n }\n\n\n {isFollowError || isUnfollowError ? <div>Operation Unsuccessfull. Try again</div> : null}\n </Card.Content>\n )\n}", "function Button() {\n const [counter, setCounter] = useState(5); //counter is getter, while setCounter is setter, useState() is called hook. \n const handleClick = () => setCounter(counter * 2);\n return (\n <button onClick={handleClick}>\n {counter}\n </button>\n );\n}", "function Button() {\n const [counter, setCounter] = useState(5); //counter is getter, while setCounter is setter, useState() is called hook. \n const handleClick = () => setCounter(counter * 2);\n return (\n <button onClick={handleClick}>\n {counter}\n </button>\n );\n}", "function Button() {\n const [counter, setCounter] = useState(5); //counter is getter, while setCounter is setter, useState() is called hook. \n const handleClick = () => setCounter(counter * 2);\n return (\n <button onClick={handleClick}>\n {counter}\n </button>\n );\n}", "function useSafeState(initialState) {\r\n var isMounted = useIsMounted();\r\n\r\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_2___default().useState(initialState),\r\n state = _React$useState[0],\r\n setState = _React$useState[1];\r\n\r\n var safeSetState = react__WEBPACK_IMPORTED_MODULE_2___default().useCallback(function (value) {\r\n scheduleMicrotask(function () {\r\n if (isMounted()) {\r\n setState(value);\r\n }\r\n });\r\n }, [isMounted]);\r\n return [state, safeSetState];\r\n}", "function VenueForm({serviceType, pagex, setModalEdit,editModal}) {\n const {getServiceDetailsVenue, addServiceDetailsVenue} = useContext(AddServiceContext);\n const [harga, setharga] = useState(0);\n const [hargaDiscount, sethargaDiscount] = useState(0);\n const [discount, setdiscount] = useState(0);\n const [lokasi, setlokasi] = useState({});\n const [alamatPenuh, setalamatPenuh] = useState('')\n const [waktuOperasi, setwaktuOperasi] = useState('');\n\n useEffect(() =>{\n setharga(() => {\n let harg = getServiceDetailsVenue.harga\n console.log(harg)\n document.querySelector('.harga').value = harg;\n return harg\n })\n setlokasi(getServiceDetailsVenue.lokasi)\n setwaktuOperasi(getServiceDetailsVenue.waktuOperasi)\n setalamatPenuh(() => {\n let al = getServiceDetailsVenue.alamatPenuh\n document.querySelector('.auto').value = al;\n return al;\n })\n setdiscount(getServiceDetailsVenue.discount)\n sethargaDiscount(getServiceDetailsVenue.hargaDiscount)\n console.log(getServiceDetailsVenue)\n },[getServiceDetailsVenue])\n\n useEffect(() => {\n console.log(alamatPenuh)\n }, [alamatPenuh])\n\n const submitServiceDetails = () => {\n addServiceDetailsVenue(harga , lokasi, waktuOperasi, alamatPenuh, discount, hargaDiscount)\n Router.push(`/${pagex}/upload`);\n }\n\n const submitServiceDetails2 = () => {\n addServiceDetailsVenue(harga , lokasi, waktuOperasi, alamatPenuh, discount, hargaDiscount)\n setModalEdit(false)\n }\n\n const addAlamat = () => {\n let x = document.querySelector('.auto').value;\n setalamatPenuh(x)\n }\n\n return (\n <div className=\"form-service\">\n <div className=\"form-section\">\n <h4>Harga (RM)</h4>\n <Input className=\"form-custom harga\" href=\"#\" id=\"UncontrolledTooltipExample\" type=\"number\" onChange={(e) => {\n sethargaDiscount(e.target.value)\n setharga(e.target.value)}} value={harga}/>\n <UncontrolledTooltip placement=\"left\" target=\"UncontrolledTooltipExample\">\n Harga Lumpsump termasuk penginapan (sekiranya ada). Jika anda turut menyediakan servis katering dan lain-lain, anda boleh sekalikan produk/servis anda yang lain dalam ruangan 'Pakej' dan menetapkan harga mengikut pakej anda\n </UncontrolledTooltip>\n </div>\n <div className=\"form-section\">\n <h4>Diskaun (%)</h4>\n <Input className=\"form-custom harga\" type=\"number\" value={discount} onChange={(e) => {\n let x = e.target.value;\n let har = harga;\n x = x / 100;\n har = har - (har * x);\n sethargaDiscount(har);\n setdiscount(e.target.value)\n }}\n />\n </div>\n <div className=\"form-section\">\n <h4>Harga selepas Diskaun (RM)</h4>\n <Input className=\"form-custom harga\" type=\"number\" disabled value={hargaDiscount} />\n </div>\n <div className=\"form-section\">\n <h4>Nama Lokasi</h4>\n <Autocomplete\n className=\"auto\"\n placeholder=\"Isikan lokasi anda\"\n style={{width: '100%', borderRadius:'4px', fontWeight:'400', fontSize:'14px', color:'#3e3e3e', padding: '.375rem .75rem', border: '1px solid #ced4da'}}\n onPlaceSelected={(place) => {\n console.log(place)\n setlokasi(place)\n }}\n types={[]}\n componentRestrictions={{country: \"my\"}}\n />\n </div>\n <div className=\"form-section\">\n <h4>Waktu operasi</h4>\n <Input className=\"form-custom\" href=\"#\" id=\"tooltipTerma\" onFocus={() => addAlamat()} type=\"textarea\" placeholder=\"Nyatakan Waktu Operasi Lokasi\" value={waktuOperasi} onChange={(e) => {setwaktuOperasi(e.target.value)}} />\n <UncontrolledTooltip placement=\"left\" target=\"tooltipTerma\">\n Tetapkan sebarang syarat yang dikenakan ke atas dewan/lokasi tersebut seperti; waktu operasi, lokasi parkir, jumlah tetamu maksimum dan sebagainya\n </UncontrolledTooltip>\n </div>\n {\n !editModal ? \n <div className=\"form-button\">\n <Button className=\"btn-cancel\" onClick={() => Router.push(`/${pagex}/about`)}>Back</Button>{' '}\n <Button className=\"btn-next\" onClick={() => submitServiceDetails()}>Next</Button>{' '}\n </div>\n :\n <div className=\"form-button\">\n <Button className=\"btn-cancel\" onClick={() => setModalEdit(false)}>Cancel</Button>{' '}\n <Button className=\"btn-next\" onClick={() => submitServiceDetails2()}>Confirm</Button>{' '}\n </div>\n\n }\n \n <style jsx>{`\n .form-button { display: flex; justify-content: space-between; }\n .checkbox-type { display: flex; justify-content:space-around; align-item: center; }\n p {font-weight:400; color: #3e3e3e; font-size: 14px; margin-bottom: 5px;}\n .form-section { margin: 20px 0; }\n h4 { text-align: center; font-weight: 400; color: #75848E; font-size: 16px; margin-bottom: 10px; }\n .area-covered-div { display: inline-block; margin-right: 10px; }\n .area-covered-div > label { font-weight: 400; color: #3E3E3E; font-size: 14px;}\n .area-covered-div > label > input { margin-right: 5px; }\n `}</style>\n </div>\n )\n}", "function useDidUpdateEffect(fn, inputs) {\n const didMountRef = React.useRef(false);\n React.useEffect(() => {\n if (didMountRef.current) fn();else didMountRef.current = true;\n }, inputs);\n}", "function EditTeam(props) {\n // //console.log(props)\n \n const[onviewc,setonviewc]=useState(true);\n const[onviewb,setonviewb]=useState(true);\n const[onviewp,setonviewp]=useState(true);\n const[onviewv,setonviewv]=useState(true);\n const [leads,setLeads]=useState({\"1\":false,\"2\":false,\"3\":false,\"4\":false});\n const [camp,setCamp]=useState({\"1\":false,\"2\":false,\"3\":false,\"4\":false});\n const [buy,setBuy]=useState({\"1\":false,\"2\":false,\"3\":false,\"4\":false});\n const [pub,setPub]=useState({\"1\":false,\"2\":false,\"3\":false,\"4\":false});\n const [vert,setVert]=useState({\"1\":false,\"2\":false,\"3\":false,\"4\":false});\n const [refresh,setRefresh]=useState({});\n useEffect(()=>{\n let user=(props.user);\n // //console.log(user,\"myuser*************************************************************************************\")\n setonviewb(true)\n setonviewc(true)\n setonviewp(true)\n setonviewv(true)\n\n let data=user.permission_ids;\n let leads3=leads\n let camp3=camp\n let buy3=buy\n let pub3=pub\n let vert3=vert\n // //console.log(data,\"data\")\n // //console.log(\"leads\",leads3)\n // //console.log(\"camp\",camp3)\n // //console.log(\"buy\",buy3)\n // //console.log(\"pub\",pub3)\n // //console.log(\"vert\",vert3)\n let leads1=Object.assign({},{\"1\":false,\"2\":false,\"3\":false,\"4\":false}) \n setLeads(leads1)\n let camp1=Object.assign({},{\"1\":false,\"2\":false,\"3\":false,\"4\":false})\n setCamp(camp1)\n let buy1=Object.assign({},{\"1\":false,\"2\":false,\"3\":false,\"4\":false})\n setBuy(buy1)\n let pub1=Object.assign({},{\"1\":false,\"2\":false,\"3\":false,\"4\":false})\n setPub(pub1)\n let vert1=Object.assign({},{\"1\":false,\"2\":false,\"3\":false,\"4\":false})\n setVert(vert1)\n // //console.log(data,\"data\")\n // //console.log(\"leads\",leads1)\n // //console.log(\"camp\",camp1)\n // //console.log(\"buy\",buy1)\n // //console.log(\"pub\",pub1)\n // //console.log(\"vert\",vert1)\n if(data){\n \n // //console.log(user,\"myuser####################################################################################*\")\n if(data.length>0 && user!={}){\n data=JSON.parse(data)\n // //console.log(data,\"data#####################################\")\n data.forEach(element => {\n // //console.log(element,\"ele\")\n if(element.module_id==2){\n // //console.log(element.module_id,\"element.module_id\")\n const canTick = (element) => element===1;\n if(element.actions.some(canTick)){\n \n element.actions.forEach(ele =>{\n \n \n // //console.log(ele,\" element.actions\")\n // leads1 = Object.assign({}, leads1, {\n // ele: true,\n // });\n leads1[ele]=true\n })\n }\n }\n if(element.module_id==3){\n const canTick = (element) => element===1;\n if(element.actions.some(canTick)){\n setonviewc(false)\n element.actions.forEach(ele =>{\n camp1[ele]=true\n // camp1 = Object.assign({}, camp1, {\n // ele: true,\n // });\n })\n }\n }\n if(element.module_id==4){\n const canTick = (element) => element===1;\n if(element.actions.some(canTick)){\n setonviewb(false)\n element.actions.forEach(ele =>{\n buy1[ele]=true\n // buy1 = Object.assign({}, buy1, {\n // ele: true,\n // });\n })\n }\n }\n if(element.module_id==5){\n const canTick = (element) => element===1;\n if(element.actions.some(canTick)){\n setonviewp(false)\n element.actions.forEach(ele =>{\n pub1[ele]=true\n // pub1 = Object.assign({}, pub1, {\n // ele: true,\n // });\n })\n }\n }\n if(element.module_id==6){\n const canTick = (element) => element===1;\n if(element.actions.some(canTick)){\n setonviewv(false)\n element.actions.forEach(ele =>{\n vert1[ele]=true\n // vert1 = Object.assign({}, vert1, {\n // ele: true,\n // });\n })\n }\n }\n \n });\n }}\n let leads2=Object.assign({},leads1)\n setLeads(leads2)\n let camp2=Object.assign({},camp1)\n setCamp(camp2)\n let buy2=Object.assign({},buy1)\n setBuy(buy2)\n let pub2=Object.assign({},pub1)\n setPub(pub2)\n let vert2=Object.assign({},vert1)\n setVert(vert2)\n // //console.log(\"AFTER C H A N G I N G\")\n // //console.log(\"leads\",leads1)\n // //console.log(\"camp\",camp1)\n // //console.log(\"buy\",buy1)\n // //console.log(\"pub\",pub1)\n // //console.log(\"vert\",vert1)\n \n },[props.user,props.id,props.show])\n \n return(\n <Modal\n id=\"main_modal\"\n {...props}\n size=\"md\"\n aria-labelledby=\"contained-modal-title-vcenter\"\n centered\n >\n <Modal.Header id=\"modal_head\">\n <div id=\"close_img2\" onClick={()=>{\n let leads2=Object.assign({},{})\n setLeads(leads2)\n let camp2=Object.assign({},{})\n setCamp(camp2)\n let buy2=Object.assign({},{})\n setBuy(buy2)\n let pub2=Object.assign({},{})\n setPub(pub2)\n let vert2=Object.assign({},{})\n setVert(vert2)\n \n let obj1=Object.assign({},{})\n setRefresh(obj1)\n setonviewb(true)\n setonviewc(true)\n setonviewp(true)\n setonviewv(true)\n props.onHide()\n }\n }>\n <IoIosClose />\n </div>\n </Modal.Header>\n <Modal.Body>\n {/* <p>{props.user.email}</p> */}\n <table\n id=\"dtBasicExample\"\n class=\"table table-striped table-sm\"\n cellspacing=\"0\"\n >\n <tr>\n {/* leads-2 \n camp-3\n buyers-4\n publishers-5\n verticals-6\n\n view-1\n create-2\n update-3\n delete-4\n \n */}\n <td></td>\n <th scope=\"col\">Lead</th>\n <th scope=\"col\">Campaign</th>\n \n <th scope=\"col\">Buyer</th>\n <th scope=\"col\">Publisher</th>\n <th scope=\"col\">Vertical</th>\n </tr>\n <tr>\n <th scope=\"row\">View</th>\n {/* 111111111 */}\n <td>\n {\" \"}\n {/* leads 222222 */}\n <input type=\"checkbox\" \n checked={leads[\"1\"]}\n onChange={(event) => {\n let temp=leads[\"1\"]\n let jk=Object.assign({},leads,{\"1\":!temp})\n setLeads(jk)\n }} />\n </td>\n <td>\n {\" \"}\n {/* Campaign 33333333 */}\n <input type=\"checkbox\" \n checked={camp[\"1\"]}\n onChange={() =>{\n let temp=camp[\"1\"]\n let jk=Object.assign({},camp,{\"1\":!temp})\n setCamp(jk)\n setonviewc(temp)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* buyer 44444444*/}\n <input type=\"checkbox\" \n checked={buy[\"1\"]}\n onChange={() =>{\n let temp=buy[\"1\"]\n let jk=Object.assign({},buy,{\"1\":!temp})\n setBuy(jk)\n setonviewb(temp)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* publisher 5555555 */}\n <input type=\"checkbox\" \n checked={pub[\"1\"]}\n onChange={() =>{\n let temp=pub[\"1\"]\n let jk=Object.assign({},pub,{\"1\":!temp})\n setPub(jk)\n setonviewp(temp)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* vertical 6666666*/}\n <input type=\"checkbox\" \n checked={vert[\"1\"]}\n onChange={() =>{\n let temp=vert[\"1\"]\n let jk=Object.assign({},vert,{\"1\":!temp})\n setVert(jk)\n setonviewv(temp)\n } }/>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">Create</th>\n {/* 222222222222 */}\n <td>\n {\" \"}\n {/* <input type=\"checkbox\" onChange={() => handlelead(2)} /> */}\n </td>\n <td>\n {\" \"}\n {/* campaigns 33333333333*/}\n <input type=\"checkbox\" \n checked={camp[\"2\"]}\n disabled={onviewc} \n onChange={() =>{\n let temp=camp[\"2\"]\n let jk=Object.assign({},camp,{\"2\":!temp})\n setCamp(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* buyers 4444444444444*/}\n <input type=\"checkbox\" \n checked={buy[\"2\"]}\n disabled={onviewb} \n onChange={() =>{\n let temp=buy[\"2\"]\n let jk=Object.assign({},buy,{\"2\":!temp})\n setBuy(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* publishers 5555555555*/}\n <input type=\"checkbox\" \n checked={pub[\"2\"]}\n disabled={onviewp} \n onChange={() =>{\n let temp=pub[\"2\"]\n let jk=Object.assign({},pub,{\"2\":!temp})\n setPub(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* verticals 666666666*/}\n <input type=\"checkbox\" \n checked={vert[\"2\"]}\n disabled={onviewv} \n onChange={() =>{\n let temp=vert[\"2\"]\n let jk=Object.assign({},vert,{\"2\":!temp})\n setVert(jk)\n } }/>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">Update</th>\n {/* 3333333333333333 */}\n <td>\n {\" \"}\n {/* <input type=\"checkbox\" onChange={() => handlelead(3)} /> */}\n </td>\n <td>\n {\" \"}\n {/* campaigns 3333333 */}\n <input type=\"checkbox\" \n checked={camp[\"3\"]}\n disabled={onviewc} \n onChange={() =>{\n let temp=camp[\"3\"]\n let jk=Object.assign({},camp,{\"3\":!temp})\n setCamp(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* buyers 44444444 */}\n <input type=\"checkbox\" \n checked={buy[\"3\"]}\n disabled={onviewb} \n onChange={() =>{\n let temp=buy[\"3\"]\n let jk=Object.assign({},buy,{\"3\":!temp})\n setBuy(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* publishers 555555555*/}\n <input type=\"checkbox\" \n checked={pub[\"3\"]}\n disabled={onviewp} \n onChange={() =>{\n let temp=pub[\"3\"]\n let jk=Object.assign({},pub,{\"3\":!temp})\n setPub(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* verticals 6666666666 */}\n <input type=\"checkbox\" \n checked={vert[\"3\"]}\n disabled={onviewv} \n onChange={() =>{\n let temp=vert[\"3\"]\n let jk=Object.assign({},vert,{\"3\":!temp})\n setVert(jk)\n } }/>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">Delete</th>\n {/* 44444444444444444 */}\n <td>\n {\" \"}\n {/* <input type=\"checkbox\" onChange={() => handlelead(4)} /> */}\n </td>\n <td>\n {\" \"}\n {/* campaigns 3333333333 */}\n <input type=\"checkbox\" \n checked={camp[\"4\"]}\n disabled={onviewc} \n onChange={() =>{\n let temp=camp[\"4\"]\n let jk=Object.assign({},camp,{\"4\":!temp})\n setCamp(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* buyers 44444444444 */}\n <input type=\"checkbox\" \n checked={buy[\"4\"]}\n disabled={onviewb} \n onChange={() =>{\n let temp=buy[\"4\"]\n let jk=Object.assign({},buy,{\"4\":!temp})\n setBuy(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* publishers 5555555555 */}\n <input type=\"checkbox\" \n checked={pub[\"4\"]}\n disabled={onviewp} \n onChange={() =>{\n let temp=pub[\"4\"]\n let jk=Object.assign({},pub,{\"4\":!temp})\n setPub(jk)\n } }/>\n </td>\n <td>\n {\" \"}\n {/* verticals 66666666 */}\n <input type=\"checkbox\" \n checked={vert[\"4\"]}\n disabled={onviewv} \n onChange={() =>{\n let temp=vert[\"4\"]\n let jk=Object.assign({},vert,{\"4\":!temp})\n setVert(jk)\n } }/>\n </td>\n </tr>\n </table>\n <Button onClick={()=>{\n //update roles for invited member\n let leadper=[]\n if(leads[\"1\"]==true)\n leadper.push(1)\n let campper=[]\n if(camp[\"1\"]==true){\n campper.push(1)\n if(camp[\"2\"]==true)\n campper.push(2)\n if(camp[\"3\"]==true)\n campper.push(3)\n if(camp[\"4\"]==true)\n campper.push(4)\n }\n let buyerper=[]\n if(buy[\"1\"]==true){\n buyerper.push(1)\n if(buy[\"2\"]==true)\n buyerper.push(2)\n if(buy[\"3\"]==true)\n buyerper.push(3)\n if(buy[\"4\"]==true)\n buyerper.push(4)\n }\n let pubper=[]\n if(pub[\"1\"]==true){\n pubper.push(1)\n if(pub[\"2\"]==true)\n pubper.push(2)\n if(pub[\"3\"]==true)\n pubper.push(3)\n if(pub[\"4\"]==true)\n pubper.push(4)\n }\n let vertiper=[]\n if(vert[\"1\"]==true){\n vertiper.push(1)\n if(vert[\"2\"]==true)\n vertiper.push(2)\n if(vert[\"3\"]==true)\n vertiper.push(3)\n if(vert[\"4\"]==true)\n vertiper.push(4)\n }\n const data = {\n usertype:1,\n user_id:props.user.id,\n permission_ids: [\n {\n module_id: 2,\n actions: leadper,\n },\n {\n module_id: 3,\n actions: campper,\n\n },\n {\n module_id: 4,\n actions: buyerper,\n\n },\n {\n module_id: 5,\n actions: pubper,\n\n },\n {\n module_id: 6,\n actions: vertiper,\n\n }\n \n ]\n };\n // //console.log(\"dataofinvite\",data)\n const updateinviteteammate = {\n url:\n API_URL+\"/user/save-permissions\",\n data: data,\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + localStorage.getItem(\"access_token\"),\n },\n };\n axios(updateinviteteammate)\n .then(response => {\n if (response.status == 200) {\n \n let leads2=Object.assign({},{})\n setLeads(leads2)\n let camp2=Object.assign({},{})\n setCamp(camp2)\n let buy2=Object.assign({},{})\n setBuy(buy2)\n let pub2=Object.assign({},{})\n setPub(pub2)\n let vert2=Object.assign({},{})\n setVert(vert2)\n \n let obj1=Object.assign({},{})\n setRefresh(obj1)\n setonviewb(true)\n setonviewc(true)\n setonviewp(true)\n setonviewv(true)\n props.getteamlistdata()\n props.onHide()\n ////console.log(response,\"success upadting roles of team member\")\n\n //props.onHide\n \n }\n\n })\n .catch(error => {\n \n if (error.response.status === 500) {\n // //console.log(\"error\",error)\n ////console.log(error.response,\"error upadting roles of team member\")\n alert(\"error\")\n //seterrormessage(\"Email Already exist\")\n } else {\n }\n });\n\n }}>UPDATE</Button>\n\n </Modal.Body>\n </Modal>\n );\n}", "function usePreviousValue(value) {\n const ref = React.useRef();\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}", "function HookIntervalCounter() {\n\n const [count, setCount] = useState(0)\n\n // both of the solutions below will work with setInterval() UNTIL we keep track of the previous state of count. Either in the dependency array or in the setState method.\n\n // const tick = () => {\n // setCount(count + 1)\n // }\n\n // useEffect(() => {\n // const interval = setInterval(tick, 1000)\n // return () => {\n // clearInterval(interval)\n // }\n // }, [count])\n\n const tick = () => {\n setCount(prevCount => prevCount + 1)\n }\n\n useEffect(() => {\n const interval = setInterval(tick, 1000)\n return () => {\n clearInterval(interval)\n }\n }, [])\n\n return (\n <div>\n {count}\n </div>\n )\n}", "function HomeView() {\n const [movies, setMovies] = useState(null);\n\n useEffect(() => {\n //console.log(movies);\n moviesAPI\n .fetchTrendingToday()\n .then(data => setMovies(data.results))\n .catch(error => console.log(error));\n }, []);\n console.log(movies);\n\n return (\n <>\n <h1>TRENDING TODAY</h1>\n <MovieList movies={movies}> </MovieList>\n </>\n );\n}", "function ThemeSwitch(prop) {\n let [theme, setTheme] = React.useState(\"light\");\n\n React.useEffect(() => {\n console.log(\"EFFECT called\");\n document.body.className = \"bg-\" + theme;\n });\n\n if (theme === \"light\") {\n return (\n <button\n onClick={() => {\n setTheme(\"dark\");\n prop.changeTheme(\"dark\");\n }}\n >\n Dark\n </button>\n );\n }\n return (\n <button\n onClick={() => {\n setTheme(\"light\");\n prop.changeTheme(\"light\");\n }}\n >\n Light\n </button>\n );\n}", "function App({ getAllCategories, allQuestionData }) {\n\n useEffect(() => {\n getAllCategories();\n }, []);\n\n let [ allValuesAreSet, setAllValuesAreSet ] = useState(false);\n let [ categories, setCategories ] = useState({});\n let [ quizGrid, setQuizGrid ] = useState({});\n let [ scorecard, setScorecard ] = useState({});\n let [ numPlayers, setNumPlayers ] = useState(0);\n let [ gutsyWager, setGutsyWager ] = useState({});\n\n const setAllValues = (obj) => {\n if (obj) {\n let temp = getAllQuestions(allQuestionData, parseInt(obj.settings.categories));\n setNumPlayers(parseInt(obj.settings.numPlayers));\n setCategories(temp);\n setQuizGrid(writeQuizGrid(temp));\n setScorecard(createScoreCard(obj.players));\n setGutsyWager(getGutsyWagerQuestions(temp));\n setAllValuesAreSet(true);\n }\n };\n\n const gamePlayContainer = () => {\n // TODO: Uncomment this and comment below when working on new feature\n return <NewCategoryOrAnswer />\n //\n // return allValuesAreSet\n // ?\n // <GamePlay categories={categories} quizGrid={quizGrid} scorecard={scorecard} numPlayers={numPlayers} gutsyWager={gutsyWager} />\n // :\n // <SetGamePlayValues setValues={setAllValues}/>\n };\n\n const showSettingsPage = () => {\n return <SettingsPage />;\n };\n\n return (\n <>\n {\n gamePlayContainer()\n }\n <FixedSidebar />\n </>\n );\n}", "function WMQuiz({ type, points, setNotifyText, setNotifyTextHeader, setIntroAlert, setIntroAlertText, setIntroAlertHeader, setPoints }) {\n const [propFoodScraps, handleChange] = React.useState(\"\");\n const [foodScraps, setFoodScraps] = React.useState(0);\n const [threeRs, setThreeRs] = React.useState(\"\");\n const [isComplete, setComplete] = React.useState(false);\n const [progress, setProgress] = React.useState(false);\n // const [answers, updateAnswers] = React.useState(DATA.answers);\n // const [questions, setQuestion] = React.useState(DATA.questions);\n React.useEffect(() => {\n let result = 0;\n if(propFoodScraps!== \"\") result++;\n if(foodScraps!== 0) result++;\n if(threeRs!== \"\") result++;\n setProgress(parseFloat(result/3));\n }, [propFoodScraps, foodScraps, threeRs]);\n React.useEffect(() => {\n if(isComplete === true) {\n setNotifyText(\"<p>Thanks for completing the <strong>Managing Waste Quiz</strong>.</p><p>Go to the <a href='/rewards'>Rewards page</a> to redeem your points. </p>\")\n setNotifyTextHeader(\"You've just won 200 points! CONGRATULATIONS :)\")\n setIntroAlert(true)\n setIntroAlertText(\"<p>Thanks for completing the <strong>Managing Waste Quiz!</strong>. </p><p>Go to the <a href='/rewards'>Rewards page</a> to redeem your 200 points. </p>\")\n setIntroAlertHeader(\"CONGRATULATIONS! You've just won 200 points! \")\n setPoints(1200);\n }\n }, [isComplete]);\n\n return (\n <div className=\"Quiz\">\n <ProgressBar stripes={false} value={progress} />\n {isComplete && <Complete points={points} isHidden={!isComplete} />}\n <h1>{type} Quiz</h1>\n <p>Complete quiz for {points} points. Begin...</p>\n <div className=\"bottomSpace\" />\n {/* {questions.map((question, idx) => {\n if (question.type === \"radio\") {\n const options = question.answers.map(answer => <Radio label={answer.label} value={answer.label} />)\n\n return (\n <>\n <RadioGroup\n inline=\"inline\"\n label={`${idx + 1}. ${question.label}`}\n name=\"group\"\n onChange={(value) => {\n const newAnswers = [\n ...answers,\n {\n [idx]: {\n value\n }\n }\n ];\n \n updateAnswers(newAnswers);\n }}\n selectedValue={answers[idx].value}\n >\n {options}\n </RadioGroup>\n <div className=\"bottomSpace\" />\n </>\n )\n}\n })} */}\n <RadioGroup\n label=\"What do the 3 R's in waste disposal stand for?\"\n name=\"group\"\n onChange={(event) => {\n setThreeRs(event.currentTarget.value)\n }}\n selectedValue={threeRs}\n >\n <Radio label=\"Reorganise, Reuse, Recycle\" value=\"one\" />\n <Radio label=\"Reduce, Reuse, Recycle\" value=\"two\" />\n <Radio label=\"Reduce, Remake, Recycle\" value=\"three\" />\n </RadioGroup>\n <FormGroup\n label=\"Food scraps in one week?\"\n labelFor=\"text-input\"\n labelInfo=\"(cups)\"\n helperText=\"These are used to determine your average food waste.\"\n >\n <Slider\n min={0}\n max={20}\n stepSize={1}\n labelStepSize={5}\n onChange={(event) => {\n setFoodScraps(event)\n }}\n labelRenderer={(value) => value}\n value={foodScraps}\n />\n </FormGroup>\n\n <RadioGroup\n label=\"Biggest proportion of food scraps?\"\n name=\"group\"\n onChange={(event) => {\n handleChange(event.currentTarget.value)\n }}\n selectedValue={propFoodScraps}\n >\n <Radio label=\"Fruit and veggies\" value=\"one\" />\n <Radio label=\"Processed foods\" value=\"two\" />\n <Radio label=\"Other\" value=\"three\" />\n </RadioGroup>\n <div className=\"bottomSpace\" />\n <Button disabled={progress !== 1} intent=\"success\" onClick={() => setComplete(true)} type=\"submit\" title=\"Submit\">Submit for {points} Green Points!</Button>\n </div >\n );\n}", "function Homescreen(){\n\n const [products, setProducts] = useState([]) // first param - what we call this state // second param - function to manipulate the state\n\n useEffect(() =>{ // useEffect hook is called after render() i.e. after DOM updates to request data from backend\n const fetchProducts = async() => { // asnychronous function\n const {data} = await axios.get('/api/products') // 'data' variable is destrucutured so we can use it directly\n\n setProducts(data)\n }\n fetchProducts()\n }, [])\n return(\n <>\n <h1>Latest Products</h1>\n <Row>\n {/*creating a list*/}\n {products.map(product =>(\n <Col key = {product._id}>\n <Product product = {product} />\n </Col>\n ))}\n </Row>\n </>\n )\n}", "function Counter() {\n const [count, setCount] = useState(() => {\n console.log('helpSomeFunc');\n return 1;\n });\n\n console.log('render');\n\n return (\n <div>\n Счёт: {count}\n <button onClick={() => setCount(0)}>Сбросить</button>\n <button onClick={() => setCount(count - 1)}>-</button>\n <button onClick={() => setCount(count + 1)}>+</button>\n </div>\n );\n}", "function Teams() {\n const [_teams, setTeams] = useState([]);\n const [_teamsCopy, setTeamsCopy] = useState([]);\n const { user , dispatch} = useUserContext();\n\n // get values from state\n // const [{ user }, dispatch] = useStateValue();\n console.log('user:', user)\n\n useEffect(() => {\n fetch(\"http://localhost:3000/teams/list\")\n .then((response) => {\n return response.json(); //Parses to JSON\n }).then(data => {\n console.log(data);\n setTeams(data);\n // console.log(data); ENDLESS RUNNING BUG!?\n })\n .catch(err => {\n console.log('GET FAILED', err);\n })\n }, []);\n\n // const colors = [\n // ['#ff4b1f', '#ff9068'],\n // ['#16BFFD', '#CB3066'],\n // ['#1D4350', '#A43931'],\n // ['#a80077', '#66ff00'],\n // ['#ff4b1f', '#1fddff'],\n // ['#0D0D0D', '#434343'],\n // ['#4B79A1', '#283E51'],\n // ['#834d9b', '#d04ed6'],\n // ['#0099F7', '#F11712'],\n // ['#B24592', '#F15F79'],\n // ['#673AB7', '#512DA8'],\n // ['#005C97', '#363795']\n // ]\n // function colorPicker() {\n // return Math.floor(Math.random() * colors.length);\n // }\n\n const joinTeam = (teamID) => {\n console.log(teamID);\n const updatedUser = JSON.parse(JSON.stringify(user));\n updatedUser.teamsList.push(teamID);\n\n dispatch({\n type: 'JOIN_TEAM',\n item: updatedUser,\n })\n\n // Add to mongoDB database \n fetch(\"http://localhost:3000/teams/join\", {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(updatedUser),\n })\n .then((res) => res.json())\n .then(res => {\n console.log(res);\n console.log(res.teamsList);\n }).catch(err => {\n console.log('UPDATING TEAM FAILED', err);\n })\n \n\n }\n\n // const onSearch = async (value) => {\n // const searchedTeams = _teams.filter(team => team.name.toLowerCase().includes(value.toLowerCase()) || team.description.toLowerCase().includes(value.toLowerCase()))\n // setTeams(searchedTeams);\n // }\n\n // const onClearSearch = () => {\n // setTeams(_teamsCopy);\n // }\n\n return (\n <div className=\"wrapper\">\n\n {/* MAIN LAYOUT COMPONENT */}\n\t\t<div className=\"main\">\n\n {/* TOP NAVBAR COMPONENT */}\n\t\t\t<nav className=\"navbar navbar-expand navbar-light navbar-bg\">\n\t\t\t\t<a className=\"sidebar-toggle\">\n {/* <i className=\"hamburger align-self-center\"></i> */}\n <i className='bx bx-menu-alt-left hamburger'></i>\n </a>\n\n\t\t\t\t<form className=\"d-none d-sm-inline-block\">\n\t\t\t\t\t<div className=\"input-group input-group-navbar\">\n\t\t\t\t\t\t<input type=\"text\" className=\"form-control\" placeholder=\"Search…\" aria-label=\"Search\" />\n\t\t\t\t\t\t<div className=\"input-group-append\">\n\t\t\t\t\t\t\t<button className=\"btn\" type=\"button\">\n <i className='bx bx-search-alt-2'></i>\n </button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\n\t\t\t\t<div className=\"navbar-collapse collapse\">\n\t\t\t\t\t<ul className=\"navbar-nav navbar-align\">\n\t\t\t\t\t\t<li className=\"nav-item dropdown\">\n\t\t\t\t\t\t\t<a className=\"nav-icon dropdown-toggle d-inline-block d-sm-none\" href=\"#\" data-toggle=\"dropdown\">\n <i className=\"align-middle\" data-feather=\"settings\"></i>\n </a>\n\n\t\t\t\t\t\t\t<a className=\"nav-link dropdown-toggle d-none d-sm-inline-block\" href=\"#\" data-toggle=\"dropdown\">\n <i className='bx bx-user-circle' ></i> <span className=\"text-dark\">{user.firstName} {user.lastName}</span>\n {/* <img src={avatar} className=\"avatar img-fluid rounded-circle mr-1\" alt=\"Chris Wood\" /> <span className=\"text-dark\">Chris Wood</span> */}\n </a>\n\t\t\t\t\t\t\t<div className=\"dropdown-menu dropdown-menu-right\">\n\t\t\t\t\t\t\t\t<a className=\"dropdown-item\" href=\"pages-profile.html\"> \n <i className='bx bx-user' ></i> Profile\n </a>\n <a className=\"dropdown-item\" href=\"pages-settings.html\">\n <i className='bx bx-cog' ></i> Settings\n </a>\n\t\t\t\t\t\t\t\t<div className=\"dropdown-divider\"></div>\n\t\t\t\t\t\t\t\t<a className=\"dropdown-item\" href=\"#\">Sign out</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</nav>\n\n {/* CONTENT CONTAINER COMPONENT */}\n\t\t\t<main className=\"content\">\n\t\t\t\t<div className=\"container-fluid p-0\">\n {/* <Link to=\"/CreateTeam\" className=\"btn btn-success\">Create Team</Link> */}\n\t\t\t\t\t<a href=\"/CreateTeam\" className=\"btn btn-primary float-right mt-n1\">Create a Team</a>\n\t\t\t\t\t<h1 className=\"h3 mb-3\">Teams</h1>\n\n {/* Chart Visualization Container */}\n <Container>\n <Row>\n <Col xs=\"6\">\n <div style={{ width: 400, height: 300 }}>\n <CategoriesTagsSunBurst />\n </div>\n </Col>\n <Col xs=\"6\">\n <PopularResourcesBarChart />\n </Col>\n </Row>\n </Container>\n\n <div className=\"searchContainer\">\n {/* <SearchField\n placeholder=\"Search teams...\"\n onSearchClick={(value) => onSearch(value)}\n /> */}\n {/* <button type=\"button\" onClick={onClearSearch} style=\"margin-left:15px\">Clear Search</button> */}\n </div>\n\n\t\t\t\t\t<div className=\"row\">\n\n {/* CARD COMPONENT (team) */}\n {user.user.isLoggedIn && _teams.map(team =>\n <div key={team._id} className=\"col-12 col-md-6 col-lg-4\">\n <div className=\"card\">\n <img className=\"card-img-top\" src={team?.profilePic ?? \"https://blogs.sas.com/content/sastraining/files/2015/03/black_background.png\"} alt=\"Unsplash\" />\n <div className=\"card-header px-4 pt-4\">\n <h5 className=\"card-title mb-0\">{team.name}</h5>\n <div className=\"meta\">\n {console.log(team?.categoriesList)}\n <div className=\"badge badge-secondary my-2\">{team?.categoriesList[0] ? team?.categoriesList[0]?.name : \"General\"}</div>\n <div><i className='bx bx-merge'></i>{team.resourcesCount}</div>\n <div><i className='bx bxs-user-account'></i> {team.usersCount}</div>\n </div>\n </div>\n <div className=\"card-body px-4 pt-2\">\n <p>{team.description}</p>\n </div>\n <div className=\"card-body px-4 pt-2 actions\">\n <Link className=\"btn btn-info\" to={\"/teams/\" + team._id}>View</Link>\n { user.user.teamsList.indexOf(team._id) !== -1 && <button type=\"button\" className=\"btn btn-sucess\" onClick={() => leaveTeam(team)}>Leave Team</button>}\n {/* { user.isLoggedIn && user.teamsList.indexOf(team._id) === -1 && <button type=\"button\" onClick={() => joinTeam(team._id)}>Join</button>}\n { user.isLoggedIn && user.teamsList.indexOf(team._id) !== -1 && <p>Joined</p> } */}\n </div>\n </div>\n </div>\n )}\n {/* {_teams.map(team =>\n <div key={team._id} className=\"col-12 col-md-6 col-lg-4\">\n\t\t\t\t\t\t\t<div className=\"card\">\n\t\t\t\t\t\t\t\t<img className=\"card-img-top\" src=\"img/photos/unsplash-1.jpg\" alt=\"Unsplash\" />\n\t\t\t\t\t\t\t\t<div className=\"card-header px-4 pt-4\">\n\t\t\t\t\t\t\t\t\t<h5 className=\"card-title mb-0\">{team.name}</h5>\n <div className=\"meta\">\n <div className=\"badge badge-secondary my-2\">{team.categoriesList[0] ? team.categoriesList[0].name : \"General\"}</div>\n <div><i className='bx bx-merge'></i>{team.resourcesCount}</div>\n <div><i className='bx bxs-user-account'></i> {team.usersCount}</div>\n </div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className=\"card-body px-4 pt-2\">\n\t\t\t\t\t\t\t\t\t<p>{team.description}</p>\n\t\t\t\t\t\t\t\t</div>\n <div className=\"card-body px-4 pt-2 actions\">\n <Link className=\"btn btn-info\" to={\"/teams/\" + team._id}>View</Link>\n { user.isLoggedIn && user.teamsList.indexOf(team._id) === -1 && <button type=\"button\" onClick={() => joinTeam(team._id)}>Join</button>}\n { user.isLoggedIn && user.teamsList.indexOf(team._id) !== -1 && <p>Joined</p> }\n </div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>)} */}\n\n </div>\n </div> \n </main>\n </div> \n\n {/* <div className=\"cardContainer\">\n {_teams.map(team =>\n <div className=\"teamCard\" key={team.name}>\n <header>\n <img src=\"https://images.unsplash.com/photo-1612392166886-ee8475b03af2?ixid=MXwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2102&q=80\" />\n <div className=\"mask\" style={{ background: `linear-gradient(${colors[colorPicker()][0]}, ${colors[colorPicker()][1]})` }}></div>\n <h1>{team.name}</h1>\n </header>\n <section>\n <div className=\"meta\">\n <div>{team.categoriesList[0]?.name ?? \"Category\"}</div>\n <div><i className='bx bx-merge'></i>{team.resourcesCount}</div>\n <div><i className='bx bxs-user-account'></i> {team.usersCount}</div>\n </div>\n <article>\n <p>{team.description}</p>\n </article>\n <div className=\"actions\">\n <div>\n { user.isLoggedIn && user.teamsList.indexOf(team._id) === -1 && <button type=\"button\" onClick={() => joinTeam(team._id)}>Join</button>}\n { user.isLoggedIn && user.teamsList.indexOf(team._id) !== -1 && <p>Joined</p> }\n {/* <Link className=\"btn btn-primary\" to={\"/teams/\" + team.name.toLowerCase().trim().replace(/\\s/g, \"-\")} team={team}>View</Link> */}\n {/* <Link className=\"btn btn-primary\" to={\"/teams/\" + team._id}>View</Link>\n </div>\n </div>\n </section>\n </div>\n )}\n </div> */}\n\t\t</div>\n );\n}", "function useState(initialState) {\n return useStateLike('useState', initialState);\n}", "function useState(initialState) {\n return useStateLike('useState', initialState);\n}", "function FishState() {\n\n // const [tasks, setTasks] = useState({});\n\n // useEffect(() => {\n \n // }, []);\n\n return (\n <>\n <Box\n height=\"medium\">\n <img src={fish} alt=\"One Fish\" height={300} width={300}/>\n {/* <img src={fisho} alt=\"Two Fish\" height={300} width={300}/> */}\n </Box>\n </>\n );\n\n}", "function Cart({ currentUser, products, cart, updateCart }) {\n\tconst [ cartProducts, setCartProducts ] = useState([]);\n\tconst [ totalamt, setTotalamt ] = useState(0);\n\tconst [ taxamt, setTaxamt ] = useState(0);\n\tconst [ grandTotal, setGrandTotal ] = useState(0);\n\n\tlet subTotal = 0,\n\t\ttax,\n\t\ttotal;\n\n\tuseEffect(\n\t\t() => {\n\t\t\tif (currentUser === undefined) {\n\t\t\t\tconsole.log(cart);\n\t\t\t\tconst tempCartProducts = [];\n\t\t\t\tconst sessionProducts = cart;\n\n\t\t\t\tconsole.log('products', products);\n\t\t\t\tsessionProducts.forEach((sp) => {\n\t\t\t\t\tproducts.forEach((p) => {\n\t\t\t\t\t\tif (sp.id === p.id) {\n\t\t\t\t\t\t\tp.size = sp.qty;\n\t\t\t\t\t\t\tp.product_id_id = p.id;\n\t\t\t\t\t\t\tp.name = p.title;\n\t\t\t\t\t\t\tp.image = p.imgUrl;\n\t\t\t\t\t\t\ttempCartProducts.push(p);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tconsole.log(tempCartProducts);\n\n\t\t\t\tsetCartProducts(tempCartProducts);\n\t\t\t} else {\n\t\t\t\tconst getCartProducts = async () => {\n\t\t\t\t\tawait fetch('https://testecmr.herokuapp.com/cart/', {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t\t// 'Authorization': '858f0d32c05f88b6375b0d8dbd36b2e10f518738'\n\t\t\t\t\t\t\t// 'Authorization': TOKEN\n\t\t\t\t\t\t\tAuthorization: authHeader()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// data: JSON.stringify({user_name: 'madhu'})\n\t\t\t\t\t})\n\t\t\t\t\t\t.then((res) => res.json())\n\t\t\t\t\t\t// .then(data => console.log(data))\n\t\t\t\t\t\t.then((data) => setCartProducts(data))\n\t\t\t\t\t\t// .then(data => calcTotal())\n\t\t\t\t\t\t.catch((err) => console.log(err));\n\t\t\t\t};\n\n\t\t\t\tgetCartProducts();\n\t\t\t}\n\n\t\t\t// const calcTotal = () => {\n\t\t\t// // total = 0, subTotal = 0, tax = 0;\n\t\t\t// cartProducts.forEach((prod) => {\n\t\t\t// subTotal = subTotal + (prod.size * prod.price)\n\t\t\t// console.log(prod.size, prod.price);\n\t\t\t// })\n\t\t\t// tax = 5 / 100 * subTotal;\n\t\t\t// total = subTotal + tax;\n\t\t\t// console.log(subTotal);\n\t\t\t// }\n\t\t\t// calcTotal();\n\t\t},\n\t\t[ cart, products, currentUser ]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\tconst calcTotal = () => {\n\t\t\t\t// total = 0, subTotal = 0, tax = 0;\n\t\t\t\tcartProducts.forEach((prod) => {\n\t\t\t\t\tsubTotal = subTotal + prod.size * prod.price;\n\t\t\t\t\tconsole.log(prod.size, prod.price);\n\t\t\t\t});\n\t\t\t\ttax = parseInt(5 / 100 * subTotal);\n\t\t\t\ttotal = parseInt(subTotal + tax);\n\t\t\t\t// console.log(subTotal, tax, total);\n\t\t\t\tsetTotalamt(subTotal);\n\t\t\t\tsetTaxamt(tax);\n\t\t\t\tsetGrandTotal(total);\n\t\t\t};\n\n\t\t\tcalcTotal();\n\t\t},\n\t\t[ cartProducts ]\n\t);\n\n\treturn (\n\t\t<Container style={{ marginBottom: '20px' }}>\n\t\t\t<Grid container>\n\t\t\t\t{cartProducts.length > 0 ? (\n\t\t\t\t\tcartProducts.map((product) => (\n\t\t\t\t\t\t<CartItem key={product.id} cartProduct={product} updateCart={updateCart} />\n\t\t\t\t\t))\n\t\t\t\t) : (\n\t\t\t\t\t<h3>Your Shopping Cart is Empty</h3>\n\t\t\t\t)}\n\t\t\t</Grid>\n\n\t\t\t{cartProducts.length > 0 ? (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<Grid container direction=\"column\" spacing={2} style={{ marginTop: '10px' }}>\n\t\t\t\t\t\t<Grid item container spacing={6} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>SubTotal</Grid>\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\tRs.<span>{totalamt}</span>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t</Grid>\n\n\t\t\t\t\t\t<Grid item container spacing={6} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>Tax 5%</Grid>\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\tRs.<span>{taxamt}</span>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t</Grid>\n\n\t\t\t\t\t\t<Grid item container spacing={6} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>Shipping</Grid>\n\t\t\t\t\t\t\t<Grid item>Free</Grid>\n\t\t\t\t\t\t</Grid>\n\n\t\t\t\t\t\t<Grid item container spacing={4} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\t<Typography variant=\"h5\" color=\"primary\">\n\t\t\t\t\t\t\t\t\tTotal\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\t<Typography variant=\"h5\" color=\"primary\">\n\t\t\t\t\t\t\t\t\tRs.<span>{grandTotal}</span>\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t</Grid>\n\t\t\t\t\t</Grid>\n\n\t\t\t\t\t<Grid container justify=\"flex-end\">\n\t\t\t\t\t\t<Box mt={4}>\n\t\t\t\t\t\t\t<Link to=\"/checkout/cart?prevPage=cart\" style={{ textDecoration: 'none' }}>\n\t\t\t\t\t\t\t\t<Button variant=\"contained\" color=\"primary\">\n\t\t\t\t\t\t\t\t\tProceed to checkout\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</Grid>\n\t\t\t\t</Fragment>\n\t\t\t) : null}\n\t\t</Container>\n\t);\n}", "function usePrevious (value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n }", "function usePrevious(value) {\n // The ref object is a generic container whose current property is mutable ...\n // ... and can hold any value, similar to an instance property on a class\n const ref = useRef();\n // Store current value in ref\n useEffect(() => {\n ref.current = value;\n }, [value]); // Only re-run if value changes\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}", "function useWorkPlacesList() {\n const [workPlacesList , setWorkPlacesList] = useState({\n workPlaces : [<WorkPlace key={uuidv4()}/>],\n indexOfLastPlace : 0, \n });\n return [workPlacesList , setWorkPlacesList]\n}" ]
[ "0.67669904", "0.6462928", "0.642774", "0.62593836", "0.6222612", "0.61465394", "0.6135801", "0.60916144", "0.6068124", "0.59664667", "0.5961886", "0.5926755", "0.58576447", "0.58495355", "0.58310616", "0.58195156", "0.5814152", "0.58067816", "0.5803149", "0.58014494", "0.57995975", "0.57979983", "0.57793987", "0.5761045", "0.5746483", "0.5723087", "0.57230425", "0.57117724", "0.5709226", "0.5674959", "0.5674763", "0.5668396", "0.5650583", "0.5631408", "0.56295407", "0.5626868", "0.5626812", "0.5615105", "0.55851895", "0.5575781", "0.55706286", "0.55688006", "0.555935", "0.5549214", "0.5546313", "0.5544776", "0.55309445", "0.5530593", "0.5529739", "0.5521427", "0.55174905", "0.5510199", "0.5510199", "0.55076617", "0.5502407", "0.5500346", "0.5500346", "0.5497682", "0.5492369", "0.5489312", "0.5488016", "0.54766184", "0.547637", "0.5473278", "0.54730237", "0.54719037", "0.54654336", "0.545518", "0.5448883", "0.5448281", "0.54427594", "0.5439662", "0.5434971", "0.5432728", "0.54318565", "0.54318494", "0.54308015", "0.5429264", "0.5427566", "0.5427566", "0.5427566", "0.5412153", "0.5404094", "0.53937817", "0.5379497", "0.5378757", "0.53767055", "0.5376088", "0.5374174", "0.5374081", "0.5360171", "0.5346955", "0.5346914", "0.53457856", "0.5344469", "0.5344469", "0.53421336", "0.53384984", "0.5332481", "0.5319311", "0.5302898" ]
0.0
-1
IEEE 80 bit extended float
readFloat80 (littleEndian) { this.read(10, littleEndian) return float80() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeFloat( buf, v, offset, dirn ) {\n var norm, word, sign = 0;\n if (v < 0) { sign = 0x80000000; v = -v; }\n\n if (! (v && v < Infinity)) {\n if (v === 0) { // -0, +0\n word = (1/v < 0) ? 0x80000000 : 0x00000000;\n }\n else if (v === Infinity) { // -Infinity, +Infinity\n word = sign | 0x7F800000;\n }\n else { // NaN - positive, non-signaling\n word = 0x7FC00000;\n }\n writeWord(buf, word, offset, dirn);\n }\n else {\n norm = normalize(v); // separate exponent and mantissa\n norm.exp += 127; // bias exponent\n\n if (norm.exp <= 0) { // denormalized number\n if (norm.exp <= -25) { // too small, underflow to zero. -24 might round up though.\n norm.mant = 0;\n norm.exp = 0;\n } else { // denormalize\n norm.mant = roundMantissa(norm.mant, pow2(22 + norm.exp));\n norm.exp = 0; // rounding can carry out and re-normalize the number\n if (norm.mant >= 0x800000) { norm.mant -= 0x800000; norm.exp += 1 }\n }\n } else {\n norm.mant = roundMantissa(norm.mant - 1, 0x800000);\n // if rounding overflowed into the hidden 1s place, hide it and adjust the exponent\n if (norm.mant >= 0x800000) { norm.mant -= 0x800000; norm.exp += 1 }\n if (norm.exp > 254) { // overflow to Infinity\n norm.mant = 0;\n norm.exp = 255;\n }\n }\n\n word = sign | (norm.exp << 23) | norm.mant;\n writeWord(buf, word, offset, dirn);\n }\n}", "function writeFloat( buf, v, offset, dirn ) {\n var norm, word, sign = 0;\n if (v < 0) { sign = 0x80000000; v = -v; }\n\n if (! (v && v < Infinity)) {\n if (v === 0) { // -0, +0\n word = (1/v < 0) ? 0x80000000 : 0x00000000;\n }\n else if (v === Infinity) { // -Infinity, +Infinity\n word = sign | 0x7F800000;\n }\n else { // NaN - positive, non-signaling\n word = 0x7FC00000;\n }\n writeWord(buf, word, offset, dirn);\n }\n else {\n norm = normalize(v); // separate exponent and mantissa\n norm.exp += 127; // bias exponent\n\n if (norm.exp <= 0) { // denormalized number\n if (norm.exp <= -25) { // too small, underflow to zero. -24 might round up though.\n norm.mant = 0;\n norm.exp = 0;\n } else { // denormalize\n norm.mant = roundMantissa(norm.mant, pow2(22 + norm.exp));\n norm.exp = 0; // rounding can carry out and re-normalize the number\n if (norm.mant >= 0x800000) { norm.mant -= 0x800000; norm.exp += 1 }\n }\n } else {\n norm.mant = roundMantissa(norm.mant - 1, 0x800000);\n // if rounding overflowed into the hidden 1s place, hide it and adjust the exponent\n if (norm.mant >= 0x800000) { norm.mant -= 0x800000; norm.exp += 1 }\n if (norm.exp > 254) { // overflow to Infinity\n norm.mant = 0;\n norm.exp = 255;\n }\n }\n\n word = sign | (norm.exp << 23) | norm.mant;\n writeWord(buf, word, offset, dirn);\n }\n}", "writeBinaryFloat(n) {\n this.writeUInt8(4);\n const buf = this.reserveBytes(4);\n buf.writeFloatBE(n);\n if ((buf[0] & 0x80) === 0) {\n buf[0] |= 0x80;\n } else {\n // We complement the bits for a negative number\n buf[0] ^= 0xff;\n buf[1] ^= 0xff;\n buf[2] ^= 0xff;\n buf[3] ^= 0xff;\n }\n }", "function float_to_bits(num) {\n fltbuf[0] = num;\n return intbuf[0];\n}", "function bits_to_float(bits) {\n intbuf[0] = bits;\n return fltbuf[0];\n}", "function toIEEE754(v, ebits, fbits) {\n \n var bias = (1 << (ebits - 1)) - 1;\n \n // Compute sign, exponent, fraction\n var s, e, f;\n if (isNaN(v)) {\n e = (1 << bias) - 1; f = 1; s = 0;\n }\n else if (v === Infinity || v === -Infinity) {\n e = (1 << bias) - 1; f = 0; s = (v < 0) ? 1 : 0;\n }\n else if (v === 0) {\n e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0;\n }\n else {\n s = v < 0;\n v = Math.abs(v);\n \n if (v >= Math.pow(2, 1 - bias)) {\n var ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias);\n e = ln + bias;\n f = v * Math.pow(2, fbits - ln) - Math.pow(2, fbits);\n }\n else {\n e = 0;\n f = v / Math.pow(2, 1 - bias - fbits);\n }\n }\n \n // Pack sign, exponent, fraction\n var i, bits = [];\n for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = Math.floor(f / 2); }\n for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = Math.floor(e / 2); }\n bits.push(s ? 1 : 0);\n bits.reverse();\n var str = bits.join('');\n \n // Bits to bytes\n var bytes = [];\n while (str.length) {\n bytes.push(parseInt(str.substring(0, 8), 2));\n str = str.substring(8);\n }\n return bytes;\n}", "function encodeFloat(number) {\n var n = +number,\n status = (n !== n) || n == -Infinity || n == +Infinity ? n : 0,\n exp = 0,\n len = 281, // 2 * 127 + 1 + 23 + 3,\n bin = new Array(len),\n signal = (n = status !== 0 ? 0 : n) < 0,\n n = Math.abs(n),\n intPart = Math.floor(n),\n floatPart = n - intPart,\n i, lastBit, rounded, j, exponent;\n\n if (status !== 0) {\n if (n !== n) {\n return 0x7fc00000;\n }\n if (n === Infinity) {\n return 0x7f800000;\n }\n if (n === -Infinity) {\n return 0xff800000\n }\n }\n\n i = len;\n while (i) {\n bin[--i] = 0;\n }\n\n i = 129;\n while (intPart && i) {\n bin[--i] = intPart % 2;\n intPart = Math.floor(intPart / 2);\n }\n\n i = 128;\n while (floatPart > 0 && i) {\n (bin[++i] = ((floatPart *= 2) >= 1) - 0) && --floatPart;\n }\n\n i = -1;\n while (++i < len && !bin[i]);\n\n if (bin[(lastBit = 22 + (i = (exp = 128 - i) >= -126 && exp <= 127 ? i + 1 : 128 - (exp = -127))) + 1]) {\n if (!(rounded = bin[lastBit])) {\n j = lastBit + 2;\n while (!rounded && j < len) {\n rounded = bin[j++];\n }\n }\n\n j = lastBit + 1;\n while (rounded && --j >= 0) {\n (bin[j] = !bin[j] - 0) && (rounded = 0);\n }\n }\n i = i - 2 < 0 ? -1 : i - 3;\n while(++i < len && !bin[i]);\n (exp = 128 - i) >= -126 && exp <= 127 ? ++i : exp < -126 && (i = 255, exp = -127);\n (intPart || status !== 0) && (exp = 128, i = 129, status == -Infinity ? signal = 1 : (status !== status) && (bin[i] = 1));\n\n n = Math.abs(exp + 127);\n exponent = 0;\n j = 0;\n while (j < 8) {\n exponent += (n % 2) << j;\n n >>= 1;\n j++;\n }\n\n var mantissa = 0;\n n = i + 23;\n for (; i < n; i++) {\n mantissa = (mantissa << 1) + bin[i];\n }\n return ((signal ? 0x80000000 : 0) + (exponent << 23) + mantissa) | 0;\n}", "function toFloat32(value) {\n var bytes = 0;\n switch (value) {\n case Number.POSITIVE_INFINITY: bytes = 0x7F800000; break;\n case Number.NEGATIVE_INFINITY: bytes = 0xFF800000; break;\n case +0.0: bytes = 0x40000000; break;\n case -0.0: bytes = 0xC0000000; break;\n default:\n if (Number.isNaN(value)) { bytes = 0x7FC00000; break; }\n\n if (value <= -0.0) {\n bytes = 0x80000000;\n value = -value;\n }\n\n var exponent = Math.floor(Math.log(value) / Math.log(2));\n var significand = ((value / Math.pow(2, exponent)) * 0x00800000) | 0;\n\n exponent += 127;\n if (exponent >= 0xFF) {\n exponent = 0xFF;\n significand = 0;\n } else if (exponent < 0) exponent = 0;\n\n bytes = bytes | (exponent << 23);\n bytes = bytes | (significand & ~(-1 << 23));\n break;\n }\n return bytes;\n}", "parseBinaryFloat(buf) {\n buf = Buffer.from(buf);\n if (buf[0] & 0x80) {\n buf[0] &= 0x7f;\n } else {\n // complement the bits for a negative number\n buf[0] ^= 0xff;\n buf[1] ^= 0xff;\n buf[2] ^= 0xff;\n buf[3] ^= 0xff;\n }\n return buf.readFloatBE();\n }", "function SimpleFloat(significand, exponent) {\n this.significand = significand;\n this.exponent = exponent;\n}", "get floatValue() {}", "function CtoF(C) {\n return (C * 1.8 + 32);\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value); // eslint-disable-next-line no-self-compare\n\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\n buffer[--i] |= s * 128;\n return buffer;\n }", "_calculateExponentAndMantissa(float){\n let integral2 = toBinaryX(parseInt(float, 10), EXP, '0');//on prends uniquement le chiffre avant la virgule en base 2\n let fractional10 = this._getDecimal(float);//on prends uniquement les chiffres après la virgule en base 10\n let fractional2 = ''; //contient les chiffres apres la virgule en base 2\n\n //la fraction est multiplié par 2 tant qu'elle n'est pas egal à 0 et que 23 itération ne se sont pas écoulé\n // si la fraction est plus grande que 1 on enleve le chiffre avant la virgule\n let i = 0;\n //127 + 23 permet de ne perdre aucune précision, en effet si on prends le cas extreme qui serait un nombre entre -1 et 1 tres tres petit, le nombre de décalage maximum\n //serait de 127 etant donné que l'exposant = 127 + décalge, apres 127 décalge il faut encore récupérer la valeur de mantisse donc 23 bit.\n //(cette exemple est pour la version 32 bit mais marche avec les autres version)\n while(fractional10 != 0 && i < D_ + MAN)\n {\n fractional10 = fractional10 * 2;\n if(fractional10 >= 1)\n {\n fractional2 += '1';\n }\n else\n {\n fractional2 += '0';\n }\n fractional10 = this._getDecimal(fractional10);\n i++;\n }\n\n let number2 = (integral2 + '.' + fractional2).split('');//nombre en binaire avec la notation scientifique mais non somplifié (2^0)\n\n let pointIndex = integral2.length;//index du point dans le chiffre\n\n //on itere dans le nombre jusqu'a trouver un 1, on effectue encore une fois j++ pour se placer juste apres le 1, car c'est ici que l'on veut placer la virgule\n let j = 0;\n while(number2[j] != 1)\n {\n j++;\n }\n j++;\n\n let power = 0;\n this.mantissa = (integral2 + fractional2).split('');\n //si le nombre n'est pas compris entre -1 et 1, on regarde de combien on a décalé la virgule,\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n if(float <= -1 || float >= 1)\n {\n power = pointIndex - j;\n this.mantissa.splice(0,j);\n }\n //si le nombre est compris entre -1 et 1, on regarde de combien on a decalé la virgule\n //(+1 car si le nombre est comrpis entre - 1 et 1 on a compté la virgule dans le calcul et il faut enlever)\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n else\n {\n power = pointIndex - j + 1;\n this.mantissa.splice(0, j - 1);\n }\n this.exponent = toBinaryX(D_ + power, EXP, '0');//on calcule l'exposant qu'on converti en binaire\n this.mantissa = fillWithX(this.mantissa.splice(0, MAN).join(\"\"), '0');//on prends les 23 premier bit de la mantisse[splice()], on converti le tableau en string[join()], on remplie la droite de la mantisse avec des 0[fillWith0()]\n }", "function from11f(v) {\n\t var e = v >> 6;\n\t var m = v & 0x2F;\n\t if (e === 0) {\n\t if (m === 0) {\n\t return 0;\n\t } else {\n\t return Math.pow(2, -14) * (m / 64);\n\t }\n\t } else {\n\t if (e < 31) {\n\t return Math.pow(2, e - 15) * (1 + m / 64);\n\t } else {\n\t if (m === 0) {\n\t return 0; // Inf\n\t } else {\n\t return 0; // Nan\n\t }\n\t }\n\t }\n\t }", "function float(num) {\n return num * 0.1 * 10;\n}", "function toHalf( val ) {\n\n\t\t\tfloatView[ 0 ] = val;\n\t\t\tvar x = int32View[ 0 ];\n\n\t\t\tvar bits = ( x >> 16 ) & 0x8000; /* Get the sign */\n\t\t\tvar m = ( x >> 12 ) & 0x07ff; /* Keep one extra bit for rounding */\n\t\t\tvar e = ( x >> 23 ) & 0xff; /* Using int is faster here */\n\n\t\t\t/* If zero, or denormal, or exponent underflows too much for a denormal\n\t\t\t * half, return signed zero. */\n\t\t\tif ( e < 103 ) return bits;\n\n\t\t\t/* If NaN, return NaN. If Inf or exponent overflow, return Inf. */\n\t\t\tif ( e > 142 ) {\n\n\t\t\t\tbits |= 0x7c00;\n\t\t\t\t/* If exponent was 0xff and one mantissa bit was set, it means NaN,\n\t\t\t\t\t\t * not Inf, so make sure we set one mantissa bit too. */\n\t\t\t\tbits |= ( ( e == 255 ) ? 0 : 1 ) && ( x & 0x007fffff );\n\t\t\t\treturn bits;\n\n\t\t\t}\n\n\t\t\t/* If exponent underflows but not too much, return a denormal */\n\t\t\tif ( e < 113 ) {\n\n\t\t\t\tm |= 0x0800;\n\t\t\t\t/* Extra rounding may overflow and set mantissa to 0 and exponent\n\t\t\t\t * to 1, which is OK. */\n\t\t\t\tbits |= ( m >> ( 114 - e ) ) + ( ( m >> ( 113 - e ) ) & 1 );\n\t\t\t\treturn bits;\n\n\t\t\t}\n\n\t\t\tbits |= ( ( e - 112 ) << 10 ) | ( m >> 1 );\n\t\t\t/* Extra rounding. An overflow will set mantissa to 0 and increment\n\t\t\t * the exponent, which is OK. */\n\t\t\tbits += m & 1;\n\t\t\treturn bits;\n\n\t\t}", "function readFloat(){\n checkLen(4);\n var flt = buf.readFloatLE(pos);\n pos += 4;\n return formSinglePrecision(flt);\n }", "function caml_log10_float (x) { return Math.LOG10E * Math.log(x); }", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {}\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {}\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t }", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {}\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {}\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t }", "function convertCtoF(cTemp)\n{\n var fTemp = cTemp * 1.8 + 32;\n return fTemp;\n}", "convertToF (celTemp) {\n return (celTemp * (9 / 5)) + 32;\n }", "f64() {\n this._convo.u8.set(this.buffer.subarray(this.at, this.at += 8));\n return this._convo.f64[0];\n }", "function caml_int64_of_float (x) {\n if (x < 0) x = Math.ceil(x);\n return [255,\n x & 0xffffff,\n Math.floor(x * caml_int64_offset) & 0xffffff,\n Math.floor(x * caml_int64_offset * caml_int64_offset) & 0xffff];\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {}\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {}\n buffer[--i] |= s * 128;\n return buffer;\n }", "function parseXSDFloat(value) {\n const numb = Number(value);\n if (isNaN(numb)) {\n if (value === 'NaN') {\n return NaN;\n }\n if (value === 'INF') {\n return Infinity;\n }\n if (value === '-INF') {\n return -Infinity;\n }\n return undefined;\n }\n return numb;\n}", "function bytesToFloat(bytes) {\n // JavaScript bitwise operators yield a 32 bits integer, not a float.\n // Assume LSB (least significant byte first).\n var bits = bytes[3]<<24 | bytes[2]<<16 | bytes[1]<<8 | bytes[0];\n var sign = (bits>>>31 === 0) ? 1.0 : -1.0;\n var e = bits>>>23 & 0xff;\n var m = (e === 0) ? (bits & 0x7fffff)<<1 : (bits & 0x7fffff) | 0x800000;\n var f = sign * m * Math.pow(2, e - 150);\n return f;\n }", "function substringEnergyToFloat(value) {\n\tif (value != null) {\n\t\tvar grab = parseFloat(\n\t\t\t\tvalue.substring(value.indexOf('=') + 1, value.indexOf('H') - 1))\n\t\t\t\t.toPrecision(12); // Energy = -5499.5123027313 Hartree\n\t\tgrab = grab * 2625.50;\n\t\tgrab = Math.round(grab * 1000000000000) / 1000000000000;\n\t}\n\treturn grab;\n}", "static get floatingPointNumber() {\n return /([+-]?(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))(?:[eE]([+-]?\\d+))?/;\n }", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value); // eslint-disable-next-line no-self-compare\n\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value); // eslint-disable-next-line no-self-compare\n\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {\n ;\n }\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {\n ;\n }\n\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value); // eslint-disable-next-line no-self-compare\n\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {\n ;\n }\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {\n ;\n }\n\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value); // eslint-disable-next-line no-self-compare\n\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {\n ;\n }\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {\n ;\n }\n\n buffer[--i] |= s * 128;\n return buffer;\n}", "function from10f(v) {\n\t var e = v >> 5;\n\t var m = v & 0x1F;\n\t if (e === 0) {\n\t if (m === 0) {\n\t return 0;\n\t } else {\n\t return Math.pow(2, -14) * (m / 32);\n\t }\n\t } else {\n\t if (e < 31) {\n\t return Math.pow(2, e - 15) * (1 + m / 32);\n\t } else {\n\t if (m === 0) {\n\t return 0; // Inf\n\t } else {\n\t return 0; // Nan\n\t }\n\t }\n\t }\n\t }", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}" ]
[ "0.6808168", "0.6808168", "0.64386445", "0.6378993", "0.63424796", "0.63230914", "0.622323", "0.61889064", "0.61809254", "0.6088265", "0.60630894", "0.60406524", "0.60131747", "0.6010828", "0.60093445", "0.59962416", "0.5969833", "0.5946727", "0.59460145", "0.5944585", "0.5937336", "0.59268516", "0.59069955", "0.58996826", "0.5897209", "0.58675927", "0.58654845", "0.5842235", "0.58420527", "0.58241564", "0.5796337", "0.5779374", "0.5779374", "0.5779374", "0.57758397", "0.57739854", "0.57739854", "0.57739854", "0.57739854", "0.57739854", "0.57739854", "0.57739854", "0.57739854", "0.57671905", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887", "0.57671887" ]
0.7223796
0
End of public functions
function _DoRender(timeStamp) { var doRender = true; try { thingload.DoRender(timeStamp); } catch (err) { console.log("Javascript caught exception "+ err); doRender = false; } if (doRender) requestAnimationFrame(_DoRender); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "function _____SHARED_functions_____(){}", "transient private protected public internal function m181() {}", "static private internal function m121() {}", "transient final private protected internal function m167() {}", "obtain(){}", "static private protected internal function m118() {}", "transient final private internal function m170() {}", "static transient final private internal function m43() {}", "static transient final protected public internal function m46() {}", "static transient final protected internal function m47() {}", "transient private public function m183() {}", "static final private internal function m106() {}", "transient final private protected public internal function m166() {}", "__previnit(){}", "static transient final private protected internal function m40() {}", "function _construct()\n\t\t{;\n\t\t}", "constructor () {\r\n\t\t\r\n\t}", "function priv () {\n\t\t\t\n\t\t}", "static transient private protected internal function m55() {}", "init() {\n }", "static private protected public internal function m117() {}", "static final private protected public internal function m102() {}", "static transient private protected public internal function m54() {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "function init() {\n\t \t\n\t }", "static final private protected internal function m103() {}", "function comportement (){\n\t }", "initialize()\n {\n }", "initialize() {\n //\n }", "init () {\n\t\treturn null;\n\t}", "transient final private public function m168() {}", "function Scdr() {\r\n}", "function kp() {\n $log.debug(\"TODO\");\n }", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "static transient final protected function m44() {}", "function fm(){}", "function init() {\r\n\r\n }", "static final private public function m104() {}", "init () {}", "init () {}", "static transient private internal function m58() {}", "constructor() {\n\n\t}", "static transient private public function m56() {}", "function Utils(){}", "consructor() {\n }", "function DWRUtil() { }", "initialize() {\n // Needs to be implemented by derived classes.\n }", "function accessesingData2() {\n\n}" ]
[ "0.7327302", "0.7083428", "0.7075803", "0.7044941", "0.6938982", "0.6893427", "0.6765804", "0.658856", "0.65667045", "0.6405944", "0.6346305", "0.63282895", "0.6294781", "0.6285552", "0.6281922", "0.6281631", "0.6279803", "0.6203529", "0.6193417", "0.61609524", "0.61343634", "0.61178225", "0.60907274", "0.6035213", "0.6015906", "0.6012707", "0.60041213", "0.59883094", "0.5978335", "0.5957649", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5942741", "0.5920366", "0.5920366", "0.5920366", "0.5920366", "0.5920366", "0.5920366", "0.59169346", "0.58683825", "0.5864254", "0.58566314", "0.582076", "0.5809451", "0.58074534", "0.5802107", "0.57893836", "0.5763186", "0.5763186", "0.5763186", "0.5763186", "0.5763186", "0.5751332", "0.57295305", "0.5726649", "0.570662", "0.5705768", "0.5705768", "0.5701945", "0.5689702", "0.56865776", "0.5682177", "0.5677833", "0.56752914", "0.56449145", "0.564306" ]
0.0
-1
three.ex.js + sparks approach
function create_sparks_particles(){ var sparks = new THREEx.Sparks({ maxParticles : 50, counter : new SPARKS.SteadyCounter(20), //texture : THREE.ImageUtils.loadTexture("./images/tremulous/damage/blood.jpg"), //texture : THREE.ImageUtils.loadTexture("./images/tremulous/lcannon/primary_4.jpg"), //texture : THREE.ImageUtils.loadTexture("./images/tremulous/marks/burn_mrk.jpg"), //texture : THREE.ImageUtils.loadTexture("./images/tremulous/blaster/orange_particle.jpg"), }); sparks.initializer = { color : function(value){ sparks.emitter().addInitializer(new THREEx.SparksPlugins.InitColor(value)); return sparks.initializer; }, size : function(value){ sparks.emitter().addInitializer(new THREEx.SparksPlugins.InitSize(value)); return sparks.initializer; }, lifeTime: function(minValue, maxValue){ sparks.emitter().addInitializer(new SPARKS.Lifetime(minValue, maxValue)); return sparks.initializer; } }; // setup the emitter var emitter = sparks.emitter(); var originalColor = new THREE.Color().setRGB(0.5,0.3,0); var originalSize = 20; sparks.initializer.color(originalColor).size(originalSize).lifeTime(0.4, 1); emitter.addInitializer(new SPARKS.Position( new SPARKS.PointZone( new THREE.Vector3(0,0,0) ) ) ); emitter.addInitializer(new SPARKS.Velocity(new SPARKS.PointZone(new THREE.Vector3(0,3,0)))); emitter.addAction(new SPARKS.Age()); emitter.addAction(new SPARKS.Move()); emitter.addAction(new THREEx.SparksPlugins.ActionLinearColor(originalColor, new THREE.Color().setRGB(0,0,0.6), 1)); emitter.addAction(new THREEx.SparksPlugins.ActionLinearSize(originalSize, originalSize/4, 1)); emitter.addAction(new SPARKS.RandomDrift(5,0,5)); return sparks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_scene() {\n spheres = new Array();\n spheres[0] = {\n center: {\n x: -2.0,\n y: 0.0,\n z: -3.5\n },\n radius: 0.5\n };\n spheres[1] = {\n center: {\n x: -0.5,\n y: 0.0,\n z: -3.0\n },\n radius: 0.5\n };\n spheres[2] = {\n center: {\n x: 1.0,\n y: 0.0,\n z: -2.2\n },\n radius: 0.5\n };\n plane = {\n p: {\n x: 0.0,\n y: -0.5,\n z: 0.0\n },\n n: {\n x: 0.0,\n y: 1.0,\n z: 0.0\n }\n };\n rands1 = new Array(0.1352356830611825, 0.288015044759959, 0.7678821850568056, 0.2686317905317992,\n 0.3331136927008629, 0.8684257145505399, 0.781927386065945, 0.5896540696267039,\n 0.44623699225485325, 0.9686877066269517, 0.07219804194755852, 0.32867410429753363,\n 0.25455036014318466, 0.6900878311134875, 0.32115139183588326, 0.8623794671148062,\n 0.41069260938093066, 0.999176808167249, 0.31144002149812877, 0.21190544497221708,\n 0.589751492254436, 0.618399447761476, 0.7838233797810972, 0.22662024036981165,\n 0.5274769144598395, 0.8913978524506092, 0.2461202829144895, 0.575232774252072,\n 0.20723191439174116, 0.15211533522233367, 0.5140219402965158, 0.695398824987933,\n 0.7201623972505331, 0.1737971710972488, 0.3138047114480287, 0.09142904286272824,\n 0.15824169223196805, 0.11588017432950437, 0.4076798539608717, 0.06385629274882376,\n 0.9907234299462289, 0.1742915315553546, 0.9236432255711406, 0.8344372694846243,\n 0.05793144227936864, 0.35464465571567416, 0.3937969475518912, 0.8209003841038793,\n 0.6443945677019656, 0.15443599177524447, 0.8957053178455681, 0.4145913925021887,\n 0.4667414356954396, 0.42764953384175897, 0.03486692951992154, 0.13391495239920914,\n 0.6122364429756999, 0.7934473238419741, 0.13505113637074828, 0.7279673060402274,\n 0.3638722419273108, 0.30750402715057135, 0.8705337035935372, 0.3060465627349913);\n\n rands2 = new Array(0.6100146626122296, 0.8141843967605382, 0.7538463387172669, 0.538857217412442,\n 0.7884696905966848, 0.2656198723707348, 0.3280213042162359, 0.25133296218700707,\n 0.18718935316428542, 0.7374026740435511, 0.8333564973436296, 0.22081619454547763,\n 0.08140448946505785, 0.7737920694053173, 0.9531879865098745, 0.385226191021502,\n 0.8437968089710921, 0.45293551217764616, 0.11351405014283955, 0.6402874339837581,\n 0.9657228307332844, 0.5241556512191892, 0.9501411342062056, 0.7991736396215856,\n 0.7572617880068719, 0.6777111298870295, 0.19950113398954272, 0.09956562682054937,\n 0.03746219468303025, 0.18719390942715108, 0.1519025124143809, 0.8241845818702132,\n 0.9609565436840057, 0.7231316142715514, 0.26712060417048633, 0.7414182834327221,\n 0.4706993775907904, 0.9619642498437315, 0.14598079677671194, 0.1517641346435994,\n 0.5583144023548812, 0.7664180144201964, 0.8109071112703532, 0.4008640209212899,\n 0.10891564912162721, 0.8558103002142161, 0.03816548571921885, 0.4263107746373862,\n 0.280488790711388, 0.915016517508775, 0.8379701666999608, 0.5821647725533694,\n 0.3671900019980967, 0.6120628621429205, 0.5861144624650478, 0.5639409353025258,\n 0.4884668991435319, 0.9718172331340611, 0.4438377188052982, 0.9853541473858058,\n 0.021908782655373216,0.6144221667200327, 0.11301262397319078, 0.17565111187286675);\n isect0 = {\n t: 0.7907924036719444,\n hit: 1,\n p: {\n x: 0.3484251968503937,\n y: -0.49999999999999994,\n z: -0.5039370078740157\n },\n n: {\n x: 0,\n y: 1,\n z: 0\n }\n };\n }", "function SphereSubdiv (s) {\r\n this.name = \"sphere\";\r\n\r\n var vertices = [\r\n 1.0, 0.0, 0.0,\r\n 0.0, 1.0, 0.0,\r\n -1.0, 0.0, 0.0,\r\n 0.0, -1.0, 0.0,\r\n 0.0, 0.0, 1.0,\r\n 0.0, 0.0, -1.0\r\n ];\r\n var indices = [\r\n /* 0, 1, 4,\r\n 0, 1, 5,\r\n 1, 2, 4,\r\n 1, 2, 5,\r\n 2, 3, 4,\r\n 2, 3, 5,\r\n 3, 0, 4,//*/\r\n 3, 0, 5\r\n ];\r\n\r\n for (var i = 0; i<s; i++){\r\n var newIndices = []\r\n\r\n let vertexCount = vertices.length/3;\r\n\r\n var midpoints = new Array(vertexCount).fill(0).map(row => new Array(vertexCount).fill(-1)); \r\n for (var face = 0; face<indices.length/3; face++){\r\n let f = face*3;\r\n let a = indices[f];\r\n let b = indices[f+1];\r\n let c = indices[f+2];\r\n let ax = vertices[a*3];\r\n let ay = vertices[a*3+1];\r\n let az = vertices[a*3+2];\r\n let bx = vertices[b*3];\r\n let by = vertices[b*3+1];\r\n let bz = vertices[b*3+2];\r\n let cx = vertices[c*3];\r\n let cy = vertices[c*3+1];\r\n let cz = vertices[c*3+2];\r\n\r\n // Find (mx, my, mz), (nx, ny, nz), (px, py, pz) -- centers of segments\r\n var m = midpoints[a][b];\r\n if(m==-1){\r\n var x = (ax+bx)/2;\r\n var y = (ay+by)/2;\r\n var z = (az+bz)/2;\r\n let l = Math.sqrt(x*x + y*y + z*z);\r\n x/=l;\r\n y/=l;\r\n z/=l;\r\n m = vertices.length/3; // The index of the new point\r\n vertices = vertices.concat([x, y, z]);\r\n midpoints[a][b] = m;\r\n midpoints[b][a] = m;\r\n }\r\n var n = midpoints[a][c];\r\n if(n==-1){\r\n var x = (ax+cx)/2;\r\n var y = (ay+cy)/2;\r\n var z = (az+cz)/2;\r\n let l = Math.sqrt(x*x + y*y + z*z);\r\n x/=l;\r\n y/=l;\r\n z/=l;\r\n n = vertices.length/3; // The index of the new point\r\n vertices = vertices.concat([x, y, z]);\r\n midpoints[a][c] = n;\r\n midpoints[c][a] = n;\r\n }\r\n var p = midpoints[c][b];\r\n if(p==-1){\r\n var x = (cx+bx)/2;\r\n var y = (cy+by)/2;\r\n var z = (cz+bz)/2;\r\n let l = Math.sqrt(x*x + y*y + z*z);\r\n x/=l;\r\n y/=l;\r\n z/=l;\r\n p = vertices.length/3; // The index of the new point\r\n vertices = vertices.concat([x, y, z]);\r\n midpoints[c][b] = p;\r\n midpoints[b][c] = p;\r\n }\r\n\r\n newIndices = newIndices.concat([\r\n m, a, n,\r\n m, b, p,\r\n n, c, p,\r\n m, n, p\r\n ]);\r\n }\r\n indices = newIndices;\r\n }\r\n\r\n // Mirror around x\r\n var mirrorStart = vertices.length;\r\n vertices = vertices.concat(vertices);\r\n for(var i = mirrorStart; i<vertices.length; i+=3){\r\n vertices[i] = -vertices[i];\r\n }\r\n var mirrorFacesStart = indices.length;\r\n indices = indices.concat(indices);\r\n for (var i = mirrorFacesStart; i<indices.length; i++){\r\n indices[i]+=mirrorStart/3;\r\n }\r\n // Mirror around y\r\n mirrorStart = vertices.length;\r\n vertices = vertices.concat(vertices);\r\n for(var i = mirrorStart+1; i<vertices.length; i+=3){\r\n vertices[i] = -vertices[i];\r\n }\r\n mirrorFacesStart = indices.length;\r\n indices = indices.concat(indices);\r\n for (var i = mirrorFacesStart; i<indices.length; i++){\r\n indices[i]+=mirrorStart/3;\r\n }\r\n // Mirror around z\r\n mirrorStart = vertices.length;\r\n vertices = vertices.concat(vertices);\r\n for(var i = mirrorStart+2; i<vertices.length; i+=3){\r\n vertices[i] = -vertices[i];\r\n }\r\n mirrorFacesStart = indices.length;\r\n indices = indices.concat(indices);\r\n for (var i = mirrorFacesStart; i<indices.length; i++){\r\n indices[i]+=mirrorStart/3;\r\n }\r\n this.vertices = new Float32Array(vertices);\r\n this.triangleIndices = new Uint16Array(indices);\r\n\r\n this.numVertices = this.vertices.length/3;\r\n this.numTriangles = this.triangleIndices.length/3;\r\n\r\n}", "function drawScene(){\n\n\tvar radius = params.size*Math.sqrt(2)/4.\n\n\t//draw the full spheres (this should be from an input file)\n\t//corners\n\tvar p1 = new THREE.Vector3(0, \t\t\t\t0, \t\t\t\t0);\n\tvar p2 = new THREE.Vector3(params.size, \t0, \t\t\t\t0);\n\tvar p3 = new THREE.Vector3(0, \t\t\t\tparams.size, \t0);\n\tvar p4 = new THREE.Vector3(params.size, \tparams.size, \t0);\n\tvar p5 = new THREE.Vector3(0, \t\t\t\t0,\t\t\t\tparams.size);\n\tvar p6 = new THREE.Vector3(params.size, \t0, \t\t\t\tparams.size);\n\tvar p7 = new THREE.Vector3(0, \t\t\t\tparams.size, \tparams.size);\n\tvar p8 = new THREE.Vector3(params.size,\t\tparams.size, \tparams.size);\n\t//centers on planes\n\tvar p9 = new THREE.Vector3(0,\t\t\t\tparams.size/2.,\tparams.size/2.);\n\tvar p10 = new THREE.Vector3(params.size/2.,\t0,\t\t\t\tparams.size/2.);\n\tvar p11 = new THREE.Vector3(params.size/2.,\tparams.size/2.,\t0);\n\tvar p12 = new THREE.Vector3(params.size,\tparams.size/2.,\tparams.size/2.);\n\tvar p13 = new THREE.Vector3(params.size/2.,\tparams.size,\tparams.size/2.);\n\tvar p14 = new THREE.Vector3(params.size/2.,\tparams.size/2.,\tparams.size);\n\n\tvar allP = [p1,p2,p3,p4,p5,p6,p7,p8, p9,p10,p11,p12,p13,p14]\n\tallP.forEach(function(p){\n\t\tvar mesh = drawSphere(radius, params.sphereSegments, params.sphereSegments, params.defaultOuterOpacity, params.sphereColor, p);\n\t\tparams.spheres.push(mesh);\n\t})\n\t\n\t//half spheres\n\tvar r9 = new THREE.Vector3(0,\t\t\t\tMath.PI/2.,\t\t0);\n\tvar r10 = new THREE.Vector3(-Math.PI/2.,\t0,\t\t\t\t0);\n\tvar r11 = new THREE.Vector3(0, \t\t\t\t0,\t\t\t\t0);\n\tvar r12 = new THREE.Vector3(0, \t\t\t\t-Math.PI/2.,\t0);\n\tvar r13 = new THREE.Vector3(Math.PI/2., \t0, \t\t\t\t0);\n\tvar r14 = new THREE.Vector3(Math.PI,\t\t0,\t\t\t0);\n\n\tallP = [p9,p10,p11,p12,p13,p14]\n\tvar allR = [r9,r10,r11,r12,r13,r14]\n\tallP.forEach(function(p, i){\n\t\tvar mesh = drawHalfSphere(radius, params.sphereSegments, params.sphereSegments, params.defaultInnerOpacity, params.sphereColor, p, allR[i]);\n\t\tparams.hemiSpheres.push(mesh);\n\t})\n\n\n\tvar r1 = new THREE.Vector3(0,\t\t\t\tMath.PI/2.,\t\t0); \n\tvar r2 = new THREE.Vector3(0,\t\t\t\t0,\t\t\t\t0); \n\tvar r3 = new THREE.Vector3(Math.PI/2.,\t\tMath.PI/2.,\t\t0); \n\tvar r4 = new THREE.Vector3(Math.PI/2.,\t\t0,\t\t\t\t0);\n\tvar r5 = new THREE.Vector3(0,\t\t\t\tMath.PI/2.,\t\t-Math.PI/2.); \n\tvar r6 = new THREE.Vector3(0,\t\t\t\t-Math.PI/2.,\t0);\n\tvar r7 = new THREE.Vector3(Math.PI/2.,\t\t0,\t\t\t\tMath.PI); \n\tvar r8 = new THREE.Vector3(Math.PI,\t\t0,\t\t\t\t0); \n\tallP = [p1,p2,p3,p4,p5,p6,p7,p8]\n\tallR = [r1,r2,r3,r4,r5,r6,r7,r8]\n\tallP.forEach(function(p, i){\n\t\tvar mesh = drawQuarterSphere(radius, params.sphereSegments, params.sphereSegments, params.defaultInnerOpacity, params.sphereColor, p, allR[i]);\n\t\tparams.hemiSpheres.push(mesh);\n\t})\n\n\n\t//draw slice\n\tvar p = new THREE.Vector3(params.size,\tparams.size/2.,\tparams.size/2.); \n\tvar r = new THREE.Vector3(0,\t\t\tMath.PI/2.,\t\t0); \n\n\tvar slice = drawSlice(2.*params.size, p, r, params.sliceOpacity, params.sliceColor);\n\tparams.sliceMesh.push(slice.plane);\n\tparams.sliceMesh.push(slice.mesh);\n\n\n\t//draw the box\n\tdrawBox();\n\n\n\n\t//lights\n\taddLights()\n\n\n}", "function _init() {\n /** SCENE */\n scene = new THREE.Scene();\n\n\n /** CAMERA */\n var SCREEN_WIDTH = window.innerWidth, SCREEN_HEIGHT = window.innerHeight;\n var VIEW_ANGLE = 45, ASPECT = SCREEN_WIDTH / SCREEN_HEIGHT, NEAR = 0.1, FAR = 20000;\n camera = new THREE.PerspectiveCamera(VIEW_ANGLE, ASPECT, NEAR, FAR);\n camera.position.x = 250;\n camera.position.y = 350;\n camera.position.z = 500;\n scene.add(camera);\n\n\n /** RENDERER */\n renderer = new THREE.WebGLRenderer({antialias: true});\n renderer.setPixelRatio( window.devicePixelRatio );\n renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);\n renderer.setClearColor( 0xaaaaaa );\n\n\n container = document.createElement( 'div' );\n document.body.appendChild( container );\n container.appendChild(renderer.domElement);\n\n\n /** CONTROLS */\n controls = new THREE.OrbitControls( camera, renderer.domElement );\n\n controls.maxPolarAngle = Math.PI/2; //ground limit\n\n controls.enableDamping = true;\n controls.dampingFactor = 0.25;\n controls.enableZoom = true;\n\n\n /** LIGHT */\n var ambient = new THREE.AmbientLight( 0xffffff );\n scene.add( ambient );\n\n var directionalLight = new THREE.DirectionalLight( 0xffeedd );\n directionalLight.position.set( 0, 0, 1 );\n scene.add( directionalLight );\n\n\n /** SKYBOX/FOG */\n var materialArray = [];\n materialArray.push(new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture('3d/test/dawnmountain-xpos.png')}));\n materialArray.push(new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture('3d/test/dawnmountain-xneg.png')}));\n materialArray.push(new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture('3d/test/dawnmountain-ypos.png')}));\n materialArray.push(new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture('3d/test/dawnmountain-yneg.png')}));\n materialArray.push(new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture('3d/test/dawnmountain-zpos.png')}));\n materialArray.push(new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture('3d/test/dawnmountain-zneg.png')}));\n for (var i = 0; i < 6; i++)\n materialArray[i].side = THREE.BackSide;\n var skyboxMaterial = new THREE.MeshFaceMaterial(materialArray);\n\n var skyboxGeom = new THREE.CubeGeometry(5000, 5000, 5000, 1, 1, 1);\n\n skybox = new THREE.Mesh(skyboxGeom, skyboxMaterial);\n skybox.position.y = 2469;\n //scene.add(skybox);\n\n\n manager.onProgress = function ( item, loaded, total ) {\n console.log( item, loaded, total );\n };\n\n window.addEventListener( 'resize', onWindowResize, false );\n\n\n /** TEXTURE (__helper__) */\n var loader = new THREE.ImageLoader( manager );\n loader.load( '3d/textures/texture.jpg', function ( image ) {\n texture.image = image;\n texture.needsUpdate = true;\n } );\n\n\n /** STATS (__helper__) */\n stats = new Stats();\n stats.domElement.style.position = 'absolute';\n stats.domElement.style.bottom = '10px';\n stats.domElement.style.right = '10px';\n stats.domElement.style.zIndex = 100;\n container.appendChild( stats.domElement );\n\n\n /** AXES (__helpers__) */\n var axes = new THREE.AxisHelper( 200 );\n //axes.position.y = -30;\n scene.add(axes);\n var planeGeometry = new THREE.PlaneGeometry(400,400);\n var planeMaterial = new THREE.MeshBasicMaterial(\n {color: 0x457f32, wireframe: true });\n plane = new THREE.Mesh(planeGeometry,planeMaterial);\n plane.rotation.x = -0.5*Math.PI;\n //plane.position.x = 0;\n //plane.position.y = -30;\n //plane.position.z = 0;\n scene.add(plane);\n}", "function setup(container) {\n setupCanvas();\n\n const startTime = performance.now() * 0.001;\n\n const scene = new THREE.Scene();\n const camera = new THREE.PerspectiveCamera(\n 75,\n window.innerWidth / window.innerHeight,\n 0.1,\n 1000\n );\n\n const renderer = new THREE.WebGLRenderer({ alpha: true });\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setClearColor(0x000000, 0);\n container.appendChild(renderer.domElement);\n\n // this basically constitutes the bg color\n scene.fog = new THREE.FogExp2(0x333333, 0.001);\n\n const geometry = new THREE.BufferGeometry();\n const positions = new Float32Array(numParticles * 3);\n const scales = new Float32Array(numParticles);\n\n // initial randomization, positioning is more of a seed\n // for random / noise positioning in the shaders\n const randomRange = 400;\n for (let i = 0; i < numParticles * 3; i += 3) {\n const x = randomRange * Math.random() - randomRange * 0.5;\n const y = randomRange * Math.random() - randomRange * 0.5;\n const z = randomRange * Math.random() - randomRange * 0.5;\n\n positions[i + 0] = x;\n positions[i + 1] = y;\n positions[i + 2] = z;\n scales[i / 3] = 0.5;\n }\n\n geometry.setAttribute(\"position\", new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute(\"scale\", new THREE.BufferAttribute(scales, 1));\n\n const rotationMatrix = new THREE.Matrix4();\n\n material = new THREE.ShaderMaterial({\n uniforms: {\n uColor: { value: new THREE.Color(0xfff3bf) },\n uTime: { value: 0 },\n uRotationMatrix: { value: rotationMatrix },\n uTexture: { type: \"t\", value: starTexture },\n uShapeTex: { type: \"t\", value: canvasTexture },\n uExtent: { type: \"f\", value: 400 },\n uResolution: { value: new THREE.Vector2() },\n uZoffset: { value: 0 },\n },\n transparent: true,\n alphaTest: 0,\n blending: THREE.AdditiveBlending,\n depthTest: false,\n vertexShader: starFieldVertexShader,\n fragmentShader: starFieldFragmentShader,\n });\n\n const particles = new THREE.Points(geometry, material);\n scene.add(particles);\n\n // Background\n bgMaterial = new THREE.ShaderMaterial({\n uniforms: {\n uTexture: { type: \"t\", value: canvasTexture },\n uEnabled: { value: false },\n uResolution: { value: new THREE.Vector2() },\n },\n vertexShader: backgroundVertexShader,\n fragmentShader: backgroundFragmentShader,\n depthWrite: false,\n depthTest: false,\n alphaTest: 0,\n blending: THREE.AdditiveBlending,\n });\n\n const quad = new THREE.Mesh(\n new THREE.PlaneGeometry(2, 2),\n bgMaterial\n \n );\n scene.add(quad);\n\n \n camera.position.z = 100;\n\n function animate() {\n requestAnimationFrame(animate);\n\n const time = performance.now() * 0.001 - startTime;\n\n TWEEN.update(performance.now());\n\n updateCanvas();\n\n camera.position.x = Math.cos(time * 0.01);\n //rotationMatrix.makeRotationAxis(UP, rotAngle);\n\n material.uniforms.uTime.value = time - startTime;\n // material.uniforms.uZoffset.value += 0.1;\n material.uniforms.uResolution.value.set(\n window.innerWidth,\n window.innerHeight\n );\n\n bgMaterial.uniforms.uResolution.value.set(\n window.innerWidth * 8,\n window.innerHeight * 8\n );\n\n\n renderer.render(scene, camera);\n }\n animate();\n\n window.addEventListener(\n \"resize\",\n function () {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\n },\n false\n );\n \n}", "function setupBuffers() {\n setupSphereBuffers(); \n}", "function setupBuffers() {\n setupSphereBuffers(); \n}", "function drawSphere() {\r\n // console.log(xindex + \" \" + yindex + \" \" +xthumb + \" \" + ythumb);\r\n //console.log(handMeshes[userId])\r\n var xs = xindex - xthumb;\r\n var ys = yindex - ythumb;\r\n var r = (Math.sqrt( xs*xs + ys*ys )-10);\r\n //console.log(r)\r\n var obj1 = new THREE.Object3D();\r\n \r\n var sfera = new THREE.SphereGeometry(r);\r\n var matsfe = new THREE.MeshNormalMaterial();\r\n var mesh1 = new THREE.Mesh(sfera, matsfe);\r\n \r\n obj1.position.x = xthumb;\r\n obj1.position.y = ythumb;\r\n \r\n obj1.add(mesh1);\r\n scene.add(obj1);\r\n }", "function updateSceneThree() {\n sphere.theta += 0.01;\n star.theta += 0.02;\n}", "function initSweeping( scene ) {\n\tvar oracle_geometry = new THREE.BoxBufferGeometry( 0.5, 0.5, 0.5 );\n\tfor(var curve in splines){\n\t\tvar obj = splines[curve];\n\t\tvar point = obj.getPoint(t);\n\t\tvar oracle_object = new THREE.Mesh( oracle_geometry, new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff } ) );\n\t\toracle_object.position.copy(point);\n\t\tscene.add(oracle_object);\n\t\toracles[curve] = oracle_object;\n\t}\n\tfor(var plot in plots){\n\t\tvar obj = plots[plot];\n\t\tvar point = obj.getPoint(t_index);\n\t\tvar oracle_object = new THREE.Mesh( oracle_geometry, new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff } ) );\n\t\toracle_object.position.copy(point);\n\t\tscene.add(oracle_object);\n\t\toracles[plot] = oracle_object;\n\t}\n}", "function ParaGeometry(parameter,scale)\n{\n var x = parameter.x*UnitOf(parameter.lunit)*scale; \n\tvar y = parameter.y*UnitOf(parameter.lunit)*scale; \n\tvar z = parameter.z*UnitOf(parameter.lunit)*scale; \n\tvar alpha = parameter.alpha*UnitOf(parameter.aunit)/UnitOf('deg');\n\tvar theta = parameter.theta*UnitOf(parameter.aunit)/UnitOf('deg');\n\tvar phi = parameter.phi*UnitOf(parameter.aunit)/UnitOf('deg'); \n\n var fDx = x/2;\n var fDy = y/2;\n var fDz = z/2;\n \n alpha=Math.min(alpha,360);\n alpha=Math.PI*alpha/180;\n\n theta=Math.min(theta,360);\n theta=Math.PI*theta/180;\n\n phi=Math.min(phi,180);\n phi=Math.PI*phi/180;\n\n var fTalpha = Math.tan(alpha);\n var fTthetaCphi = Math.tan(theta)*Math.cos(phi);\n var fTthetaSphi = Math.tan(theta)*Math.sin(phi);\n\n \tvar geometry = new THREE.Geometry();\n\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi-fDy*fTalpha-fDx, -fDz*fTthetaSphi-fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi-fDy*fTalpha+fDx, -fDz*fTthetaSphi-fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi+fDy*fTalpha-fDx, -fDz*fTthetaSphi+fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi+fDy*fTalpha+fDx, -fDz*fTthetaSphi+fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi-fDy*fTalpha-fDx, +fDz*fTthetaSphi-fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi-fDy*fTalpha+fDx, +fDz*fTthetaSphi-fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi+fDy*fTalpha-fDx, +fDz*fTthetaSphi+fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi+fDy*fTalpha+fDx, +fDz*fTthetaSphi+fDy, +fDz));\n\n geometry.faces.push( new THREE.Face3(0,2,1) );\n geometry.faces.push( new THREE.Face3(2,3,1) );\n\n geometry.faces.push( new THREE.Face3(4,5,6) );\n geometry.faces.push( new THREE.Face3(5,7,6) );\n\n geometry.faces.push( new THREE.Face3(0,1,4) );\n geometry.faces.push( new THREE.Face3(1,5,4) );\n\n geometry.faces.push( new THREE.Face3(2,6,7) );\n geometry.faces.push( new THREE.Face3(7,3,2) );\n\n geometry.faces.push( new THREE.Face3(0,4,2) );\n geometry.faces.push( new THREE.Face3(4,6,2) );\n\n geometry.faces.push( new THREE.Face3(1,3,7) );\n geometry.faces.push( new THREE.Face3(7,5,1) );\n\n return geometry;\n\n}", "constructor({\n width,\n height,\n sides = 3,\n }: {\n width: number,\n height: number,\n sides: number,\n }) {\n this.width = width;\n this.height = height;\n this.renderer = new WebGLRenderer();\n this.renderer.setSize(width, height);\n\n this.camera = new PerspectiveCamera(75, width / height, 0.1, 1000);\n this.camera.position.z = 6;\n this.camera.position.y = 3;\n this.camera.position.x = 3;\n this.camera.lookAt(new Vector3(0,0,0));\n new OrbitControls(this.camera, this.renderer.domElement);\n\n this.cubeContainer = new Object3D();\n this.cubes = buildCubePositions(sides).map((position, i) =>\n // TODO: don't remember the meaning behind name `front`...\n // why not just do `cubeColorsAt(i)`?\n buildBox(position, cubeColorsAt(i, front(CUBE_COLORS)))\n );\n\n this.cubes.forEach((cube) => {\n this.cubeContainer.add(cube)\n });\n\n this.scene = new Scene();\n this.scene.add(this.cubeContainer);\n\n // rotation stuff, see\n // https://github.com/jwhitfieldseed/rubik-js/blob/master/rubik.js#L261\n this.pivot = new Object3D();\n this.animateTurn = () => {};\n this.finishAnimatingTurn = () => {};\n\n setTimeout(() => {\n [\n \"B2\", \"D'\", \"L\", \"B'\", \"D\", \"R'\", \"B\", \"D2\", \"R'\", \"B'\", \"L'\", \"U'\",\n \"F'\", \"R'\", \"U2\", \"B\", \"L2\", \"B2\", \"L'\", \"U'\", \"F2\", \"U2\", \"B'\", \"U2\", \"F'\"\n ].reduce((promise, move) => {\n return promise\n .then(() => this.turn(move))\n .then(() => delay(250));\n }, Promise.resolve());\n }, 1000);\n }", "function init() {\n\n scene = new THREE.Scene();\n\n var f = .5;\n //camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );\n //camera = new THREE.OrthographicCamera( window.innerWidth / - 16, window.innerWidth / 16, window.innerHeight / 16, window.innerHeight / - 16, -200, 1000 );\n camera = new THREE.OrthographicCamera( window.innerWidth /( - 16*f), window.innerWidth / (16*f), window.innerHeight / (16*f), window.innerHeight / - (16*f), -200, 1000 );\n\n\n var w = 100;\n var h = 100;\n\n var i;\n for ( i=1; i<numPlanes; i++ ) {\n pArr.push( {p:newPlane( w, h, -i*planeSeparation ), rspeed:(Math.random()*0.01-0.005)} );\n }\n\n var geometry = new THREE.BoxGeometry( 400, 0.15, 600 );\n var material = new THREE.MeshPhongMaterial( {\n color: 0xa0adaf,\n shininess: 150,\n specular: 0xffffff,\n shading: THREE.SmoothShading\n } );\n\n ground = new THREE.Mesh( geometry, material );\n //ground.scale.multiplyScalar( 1 );\n ground.position.set(0,-100,-i*planeSeparation/2);\n ground.castShadow = false;\n ground.receiveShadow = true;\n scene.add( ground );\n\n // geometry = new THREE.PlaneGeometry( 200, 200 );\n // material = new THREE.MeshLambertMaterial( { color: 0xff0000, wireframe: false, side: THREE.DoubleSide } );\n //\n // mesh = new THREE.Mesh( geometry, material );\n // scene.add( mesh );\n //\n // //console.log('plane vertices');\n // var count = 0;\n // geometry.vertices.forEach( function(e) {\n // //console.log(e);\n // var nx = e.x + Math.random()*100-50;\n // var ny = e.y + Math.random()*100-50;\n // var nz = e.z + Math.random()*100-50;\n // geometry.vertices[count].set(nx, ny, nz);\n // count++;\n // });\n // geometry.verticesNeedUpdate = true;\n\n\n var sphere = new THREE.SphereGeometry( 10, 16, 8 );\n\n //light1 = new THREE.DirectionalLight( 0xffffff, 2 );\n\n var smf = 1;\n light1 = new THREE.PointLight( 0xffffff, 1, 1000 );\n light1.castShadow = true;\n light1.shadowCameraNear = 1;\n light1.shadowCameraFar = 1000;\n light1.shadowMapWidth = 1024*smf;\n light1.shadowMapHeight = 1024*smf;\n light1.target = ground;\n // light1.shadowBias = 0.01;\n // light1.shadowDarkness = 0.5;\n\n //light1.shadowCameraNear = 2;\n //light1.shadowCameraFar = 1000;\n //light1.shadowCameraLeft = -50;\n //light1.shadowCameraRight = 50;\n //light1.shadowCameraTop = 50;\n //light1.shadowCameraBottom = -50;\n //light1.shadowCameraVisible = true;\n\n\n light1.add( new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffffff } ) ) );\n light1.position.set(0,100,50);\n scene.add( light1 );\n //scene.add( new THREE.CameraHelper( light1.shadow.camera ) );\n\n var light = new THREE.AmbientLight( 0x202020 ); // soft white light\n //var light = new THREE.AmbientLight( 0x000000 ); // soft white light\n scene.add( light );\n\n //x=-309.1\n //y=25.134\n //z=-446.843\n camera.position.set(-309.1, 25.134, -446.843);\n // camera.zoom = 0.5133420832795047;\n camera.zoom = 0.46767497911552943;\n camera.aspect = 2.7195467422096318;\n //camera.position.z = 100;\n //camera.position.y = 0;\n\n camera.lookAt( lookAtVec );\n\n controlAttr = new function () {\n // this.cameraHeight = camera.position.y;\n // this.cameraZ = camera.position.z;\n //this.lightHeight = light1.position.y;\n this.rotateSpeed = 22;\n //this.cameraFromLight = false;\n // this.cameraPerspective = CAMERA_AUTO;\n this.cameraPerspective = CAMERA_MANUAL;\n\n };\n\n var gui = new dat.GUI();\n //gui.add( controlAttr, 'lightHeight', 100, 1000);\n gui.add( controlAttr, 'rotateSpeed', 1, 50);\n //gui.add( controlAttr, 'cameraFromLight' );\n gui.add( controlAttr, 'cameraPerspective', [CAMERA_MANUAL, CAMERA_LIGHT, CAMERA_AUTO] );\n // gui.add(controlAttr, 'cameraHeight', -300, 1000);\n // gui.add(controlAttr, 'cameraZ', -400, 1000);\n\n\n renderer = new THREE.WebGLRenderer();\n renderer.setSize( window.innerWidth, window.innerHeight );\n renderer.setClearColor( 0x000000 );\n renderer.shadowMap.enabled = true;\n //renderer.shadowMap.type = THREE.BasicShadowMap;\n renderer.shadowMap.needsUpdate = true;\n\n\n\n document.body.appendChild( renderer.domElement );\n\n // the TrackballControls must be after renderer.domElement is added to the HTML\n // controls = new THREE.TrackballControls( camera, renderer.domElement );\n // controls.rotateSpeed = 1.0;\n // controls.zoomSpeed = 1.2;\n // controls.panSpeed = 0.8;\n // controls.noZoom = false;\n // controls.noPan = false;\n // controls.staticMoving = true;\n // controls.dynamicDampingFactor = 0.3;\n // controls.keys = [ 65, 83, 68 ];\n // controls.addEventListener( 'change', render );\n\n // Mouse control\n controls = new THREE.OrbitControls( camera, renderer.domElement );\n controls.target.set( 0, 0, -numPlanes*planeSeparation/2 );\n controls.update();\n\n\n\n clock = new THREE.Clock();\n\n stats = new Stats();\n stats.domElement.style.position = 'absolute';\n stats.domElement.style.left = '0px';\n stats.domElement.style.top = '0px';\n document.body.appendChild( stats.domElement );\n\n window.addEventListener( 'resize', onWindowResize, false );\n\n}", "function build() {\n materials.LambertRed = new THREE.MeshLambertMaterial({ color: 0xFF0000 });\n \n /*\n materials.room = new THREE.MeshBasicMaterial( { map: textures.room } );\n meshes.room = new THREE.Mesh( new THREE.SphereBufferGeometry( 500, 32, 16 ), materials.room );\n meshes.room.scale.x = -1;\n scene.add( meshes.room );\n */\n\n\n var path = \"assets/textures/nebula_03/\";\n var urls = [\n path + 'neb_px.jpg',\n path + 'neb_nx.jpg',\n path + 'neb_py.jpg',\n path + 'neb_ny.jpg',\n path + 'neb_pz.jpg',\n path + 'neb_nz.jpg'\n ];\n var textureCube = new THREE.CubeTextureLoader().load(urls);\n //textureCube.format = THREE.RGBFormat;\n //textureCube.mapping = THREE.CubeReflectionMapping;\n\n var cubeShader = THREE.ShaderLib[\"cube\"];\n var cubeMaterial = new THREE.ShaderMaterial({\n fragmentShader: cubeShader.fragmentShader,\n vertexShader: cubeShader.vertexShader,\n uniforms: cubeShader.uniforms,\n depthWrite: false,\n side: THREE.BackSide\n });\n \n\n\n var textureEquirec = textures.room;\n textureEquirec.mapping = THREE.EquirectangularReflectionMapping;\n textureEquirec.magFilter = THREE.LinearFilter;\n textureEquirec.minFilter = THREE.LinearMipMapLinearFilter;\n\n var equirectShader = THREE.ShaderLib[\"equirect\"];\n var equirectMaterial = new THREE.ShaderMaterial({\n fragmentShader: equirectShader.fragmentShader,\n vertexShader: equirectShader.vertexShader,\n uniforms: equirectShader.uniforms,\n depthWrite: false,\n side: THREE.BackSide\n });\n equirectMaterial.uniforms[\"tEquirect\"].value = textureEquirec;\n\n\n var ref1 = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ); \n\n\n \n // Skybox (WARNING - cubeMaterial doesnt show untill its used on sphereMaterial with textureCube)\n var cubeMesh = new THREE.Mesh(new THREE.BoxBufferGeometry(50, 50, 50), cubeMaterial);\n scene.add(cubeMesh);\n\n var geometry = new THREE.SphereBufferGeometry(2, 32, 32);\n sphereMaterial = new THREE.MeshLambertMaterial({ emissive: 0xFFFFFF, envMap: textureCube });\n sphereMesh = new THREE.Mesh(geometry, sphereMaterial);\n sphereMesh.position.y -= 6;\n scene.add(sphereMesh);\n\n\n // Aurora Text\n meshes.auroraText = new THREE.Mesh(geometries.auroraText, sphereMaterial);\n meshes.auroraText.scale.x = meshes.auroraText.scale.y = meshes.auroraText.scale.z = scale;\n //meshes.auroraText.translation = THREE.GeometryUtils.center(geometry); // Translate the rotation origin to center (DEP)\n meshes.auroraText.translation = geometries.auroraText.center(); // Translate the rotation origin to center\n meshes.auroraText.flipSided = true;\n group.add(meshes.auroraText);\n\n \n \n // Spheres\n var geometry = new THREE.SphereBufferGeometry(3, 32, 32);\n sphereMaterial1 = new THREE.MeshLambertMaterial({ emissive: 0xFFFF00, envMap: textureEquirec });\n sphereMaterial1.needsUpdate = true;\n\n\n var sphere1 = new THREE.Mesh(geometry, ref1);\n sphere1.position.x += 5;\n sphere1.position.y -= 6;\n scene.add(sphere1);\n\n var sphere2 = new THREE.Mesh(geometry, sphereMaterial1);\n sphere2.position.x += -5;\n sphere2.position.y -= 6;\n scene.add(sphere2);\n\n\n /*\n var path = \"assets/textures/nebula_03/\";\n var urls = [\n path + 'neb_px.jpg',\n path + 'neb_nx.jpg',\n path + 'neb_py.jpg',\n path + 'neb_ny.jpg',\n path + 'neb_pz.jpg',\n path + 'neb_nz.jpg'\n ];\n var textureCube = new THREE.CubeTextureLoader().load(urls);\n textureCube.format = THREE.RGBFormat;\n textureCube.mapping = THREE.CubeReflectionMapping;\n\n var textureSphere = textureLoader.load(\"assets/textures/metal.jpg\");\n textureSphere.mapping = THREE.SphericalReflectionMapping;\n\n var cubeShader = THREE.ShaderLib[\"cube\"];\n var cubeMaterial = new THREE.ShaderMaterial({\n fragmentShader: cubeShader.fragmentShader,\n vertexShader: cubeShader.vertexShader,\n uniforms: cubeShader.uniforms,\n depthWrite: false,\n side: THREE.BackSide\n });\n\n // Skybox\n var cubeMesh = new THREE.Mesh(new THREE.BoxBufferGeometry(50, 50, 50), cubeMaterial);\n scene.add(cubeMesh);\n\n\n var geometry = new THREE.SphereBufferGeometry(8, 32, 32);\n sphereMaterial = new THREE.MeshLambertMaterial({ emissive: 0xFFFF00, envMap: textureCube });\n sphereMesh = new THREE.Mesh(geometry, sphereMaterial);\n scene.add(sphereMesh);\n */\n\n\n function rend() {\n //renderer.render(sceneCube,cubeCamera);\n }\n requestAnimationFrame(rend);\n\n\n // meshes.cube = new THREE.Mesh( new THREE.BoxBufferGeometry( 4, 4, 4 ), materials.mat2 );\n // group.add( meshes.cube );\n\n\n /*\n // Works\n var cubemap = new THREE.CubeTextureLoader()\n .setPath( 'assets/textures/nebula_03/' )\n .load( [\n 'neb_px.jpg',\n 'neb_nx.jpg',\n 'neb_py.jpg',\n 'neb_ny.jpg',\n 'neb_pz.jpg',\n 'neb_nz.jpg'\n ] );\n scene.background = cubemap;\n var reflectionMaterial = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: scene.background } ); // Works\n var reflectionMaterial = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ); // Works\n meshes.cube = new THREE.Mesh( new THREE.BoxBufferGeometry( 4, 4, 4 ), reflectionMaterial );\n group.add( meshes.cube );\n */\n\n\n\n\n //var reflectionMaterial1 = new THREE.MeshPhongMaterial({color: 0xFFFFFF,envMap: cubemap});\n\n //var reflectionMaterial3 = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: materials.mat2 } );\n\n\n\n\n\n // cameras.cube1 = new THREE.CubeCamera( 1, 1000, 256 );\n // cameras.cube1.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter;\n // scene.add( cameras.cube1 );\n\n // cameras.cube2 = new THREE.CubeCamera( 1, 1000, 256 );\n // cameras.cube2.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter;\n // scene.add( cameras.cube2 );\n\n\n\n // var chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cameras.cube2.renderTarget } );\n\n\n // materials.mat2 = new THREE.MeshBasicMaterial( {\n // envMap: cameras.cube2.renderTarget.texture\n // } );\n\n\n\n\n\n\n }", "function Waves(n,t){function f(n,t){for(var i in t)n[i]=typeof t[i]==\"object\"?f(n[i],t[i]):t[i];return n}function s(n,t,i){n!=null&&n!=undefined&&(n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent?n.attachEvent(\"on\"+t,i):n[\"on\"+t]=i)}function h(){var n=1;return window.screen.systemXDPI!==undefined&&window.screen.logicalXDPI!==undefined&&window.screen.systemXDPI>window.screen.logicalXDPI?n=window.screen.systemXDPI/window.screen.logicalXDPI:window.devicePixelRatio!==undefined&&(n=window.devicePixelRatio),n}function e(){var n=1/h();i.camera.aspect=window.innerWidth/window.innerHeight;i.camera.updateProjectionMatrix();i.renderer.setSize(window.innerWidth*n*i.options.accuracy,window.innerHeight*n*i.options.accuracy,!1)}function c(){if(i.options=f(i.defaults,t),!!!window.WebGLRenderingContext)return!1;try{i.renderer=new THREE.WebGLRenderer({canvas:n,antialias:!0});i.renderer.setClearColor(i.options.bgColor);i.scene=new THREE.Scene;i.options.fog.enabled&&(i.scene.fog=new THREE.FogExp2(i.options.bgColor,i.options.fog.density));i.camera=new THREE.PerspectiveCamera(i.options.camera.perspective,window.innerWidth/window.innerHeight,1,1e4);i.camera.position.set(i.options.camera.position.x,i.options.camera.position.y,i.options.camera.position.z);i.lookAt=new THREE.Vector3(i.options.camera.lookAt.x,i.options.camera.lookAt.y,i.options.camera.lookAt.z);i.camera.lookAt(i.lookAt);i.scene.add(i.camera);s(window,\"resize\",e);e();var r=new THREE.MeshBasicMaterial({color:i.options.color,wireframe:!0}),u=new THREE.PlaneGeometry(i.options.size,i.options.size*2,i.options.segments,i.options.segments*2);i.mesh=new THREE.Mesh(u,r);i.mesh.rotation.x=Math.PI/2;i.scene.add(i.mesh)}catch(o){return!1}return!0}function o(){u=requestAnimationFrame(o);l(Date.now()/1e3);i.options.renderCallback(i);i.renderer.render(i.scene,i.camera)}function l(n){for(var r=i.mesh.geometry.vertices,t=0,u=r.length;t<u;t++)r[t].z=Math.sin(r[t].x*Math.PI/i.options.offset+n*i.options.speed)*Math.cos(r[t].y*Math.PI/i.options.offset+n*i.options.speed)*i.options.height;i.mesh.geometry.verticesNeedUpdate=!0}var i=this,r=!0,u;i.isOK=!1;i.defaults={accuracy:1,speed:.16,offset:246,height:30,color:16777215,bgColor:1644825,size:1e3,segments:40,camera:{perspective:70,position:{x:450,y:40,z:0},lookAt:{x:0,y:140,z:50}},fog:{enabled:!0,density:.005},renderCallback:function(){}};i.isPaused=function(){return r};i.dots=[];i.isOK=c();i.toggle=function(n){return i.isOK?(n===undefined?i.toggle(!r):!!n&&r?(r=!1,o()):!!n||(r=!0,cancelAnimationFrame(u)),!0):!1}}", "function setup(){\n entorno = new Environment();\n camara = new THREE.PerspectiveCamera();\n camara.position.z = 30;\n \n entorno.add( new Pared(1,7,0) );\n entorno.add( new Pared(1,-7,0) );\n entorno.add( new Pared(1,7,1) );\n entorno.add( new Pared(1,-7,1) );\n entorno.add( new Pared(1,7,-1) );\n entorno.add( new Pared(1,-7,-1));\n entorno.add( new Pelota(0.5) );\n entorno.add(camara);\n \n \n renderer = new THREE.WebGLRenderer();\n renderer.setSize(window.innerHeight*.95, window.innerHeight*.95);\n document.body.appendChild ( renderer.domElement );\n }", "function init() {\n camera.position.z = 40;\n\n $.getJSON('http://starmap.whitten.org/api/stars?xmin=-40&xmax=40&ymin=-60&ymax=60&zmin=-20&zmax=20', function (data) {\n var t = data.data;\n var start = window.performance.now();\n for(var i = 0; i < data.length; i++) {\n var x = -t[i].Y;\n var y = t[i].X;\n var z = t[i].Z;\n var m = t[i].AbsMag;\n var spec = t[i].Spectrum.trim();\n for (var s = '', j = 0; j < 4 && (s == '' || s == 'D'); j++) {\n s = spec.substring(j,j+1).toUpperCase();\n }\n if(0 && s == '' && m > 8) {\n s = 'M'; // FIXME: probably a red dwarf, but it might be a white dwarf that will make Sirius look weird\n }\n\n var id = t[i].StarId;\n\n addStar(x,y,z,m,s,id);\n }\n var end = window.performance.now();\n var time = end - start;\n console.log(\"Added \" + i + \" stars in \" + time + \" ms\");\n });\n\n//var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );\n//var cube = new THREE.Mesh( geometry, material );\n//scene.add( cube );\n\n var target_material = new THREE.LineBasicMaterial( { color: 0x009999 } );\n var target_geometry = new THREE.CircleGeometry( 2, 16, 0, Math.PI/2 );\n var target_geometry_2 = new THREE.CircleGeometry( 2, 16, Math.PI, Math.PI/2 );\n target_geometry.vertices.shift();\n target_geometry_2.vertices.shift();\n target = new THREE.Line( target_geometry, target_material );\n target_2 = new THREE.Line( target_geometry_2, target_material );\n target.visible = false;\n scene.add( target );\n target.add( target_2 );\n\n updateHUD();\n}", "function main(dat){\n camera = new THREE.PerspectiveCamera(70,dat.width/dat.height,0.1,500);\n scene = new THREE.Scene();\n renderer = new THREE.WebGLRenderer({canvas:dat.canvas});\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.autoUpdate = false;\n renderer.shadowMap.type = THREE.PCFSoftShadowMap;\n renderer.setSize(dat.width,dat.height,false);//req.false\n controls = new PointerLockControls(camera);\n clock = new THREE.Clock();\n camera.position.set(1,128,1);//1 for inner chunk\n var ambient = new THREE.AmbientLight(0xffffff,0.2);\n scene.add(ambient);//ambient light\n shadows = new CSM({\n maxFar:camera.far,\n cascades:4,\n mode:'practical',\n shadowMapSize:128,//low res shadows\n lightDirection:new THREE.Vector3(-1,-1,1).normalize(),\n parent:scene,\n camera:camera,\n lightIntensity:.001,\n });\n playerHand = new THREE.Mesh(new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:\"green\"}));\n scene.add(playerHand);\n playerHand.scale.set(.1,.1,.1)\n pointerBlock = new THREE.Mesh(new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({wireframe:true,color:\"white\"}));\n pointerBlock.scale.set(1.01,1.01,1.01);//to fix outlines not showing\n scene.add(pointerBlock)\n\n sunSphere = new THREEx.DayNight.SunSphere();\n scene.add(sunSphere.object3d);\n sunLight = new THREEx.DayNight.SunLight();\n sunLight.object3d.renderOrder = 2;\n scene.add(sunLight.object3d);\n\n \n// initParticles();//particle\n render();\n getFPS.framerate();//start fps counter\n}", "function render_3D_S() {\n stats_3D_S.update();\n requestAnimationFrame(render_3D_S);\n if (!renderer_3D_S.autoClear) renderer_3D_S.clear();\n controller_3D_S.update();\n renderer_3D_S.render(scene_3D_S,camera_3DS);\n}", "function init() {\n // Create the scene and set the scene size.\n scene = new THREE.Scene();\n var WIDTH = window.innerWidth,\n HEIGHT = window.innerHeight;\n\n // Create a renderer and add it to the DOM.\n renderer = new THREE.WebGLRenderer({antialias:true});\n renderer.setSize(WIDTH, HEIGHT);\n document.body.appendChild(renderer.domElement);\n\n // Create a camera, zoom it out from the model a bit, and add it to the scene.\n camera = new THREE.PerspectiveCamera(45, WIDTH / HEIGHT, 0.1, 20000);\n camera.position.set(50,150,100);\n scene.add(camera);\n\n // Create an event listener that resizes the renderer with the browser window.\n window.addEventListener('resize', function() {\n var WIDTH = window.innerWidth,\n HEIGHT = window.innerHeight;\n renderer.setSize(WIDTH, HEIGHT);\n camera.aspect = WIDTH / HEIGHT;\n camera.updateProjectionMatrix();\n });\n\n scene = new THREE.Scene();\n var WIDTH = window.innerWidth,\n HEIGHT = window.innerHeight;\n\n renderer = new THREE.WebGLRenderer({antialias:true});\n renderer.setSize(WIDTH, HEIGHT);\n document.body.appendChild(renderer.domElement);\n\n camera = new THREE.PerspectiveCamera(45, WIDTH / HEIGHT, 0.1, 10000);\n camera.position.set(50,150,100);\n scene.add(camera);\n\n window.addEventListener('resize', function() {\n var WIDTH = window.innerWidth,\n HEIGHT = window.innerHeight;\n renderer.setSize(WIDTH, HEIGHT);\n camera.aspect = WIDTH / HEIGHT;\n camera.updateProjectionMatrix();\n });\n\n controls = new THREE.OrbitControls(camera, renderer.domElement);\n\n var light = new THREE.PointLight(0xfffff3, 0.8);\n light.position.set(-100,200,100);\n scene.add(light);\n\n var sphereSize = 1; \n var pointLightHelper = new THREE.PointLightHelper( light, sphereSize ); \n scene.add( pointLightHelper );\n\n var light2 = new THREE.PointLight(0xd7f0ff, 0.2);\n light2.position.set(200,200,100);\n scene.add(light2);\n\n var sphereSize = 1; \n var pointLightHelper2 = new THREE.PointLightHelper( light2, sphereSize ); \n scene.add( pointLightHelper2 );\n\n var light3 = new THREE.PointLight(0xFFFFFF, 0.5);\n light3.position.set(150,200,-100);\n scene.add(light3);\n\n var sphereSize = 1; \n var pointLightHelper3 = new THREE.PointLightHelper( light3, sphereSize ); \n scene.add( pointLightHelper3 );\n\n\n var loader = new THREE.ColladaLoader();\n loader.options.convertUpAxis = true;\n loader.load( 'static/js/webgl/models/dummy1.dae', function ( collada ) {\n //dummy1.dae\n var dae = collada.scene;\n var skin = collada.skins[ 0 ];\n dae.position.set(0,0,0);//x,z,y- if you think in blender dimensions ;)\n dae.scale.set(1.5,1.5,1.5);\n scene.add(dae);\n });\n \n}", "function addFlatParallelepiped(obj, x, y, z, s) {\n 'use strict';\n\n geometry = new THREE.CubeGeometry(3 * s, 6 * s, 0.5);\n mesh= new THREE.Mesh(geometry, material);\n\n mesh.position.set(x, y, z);\n obj.add(mesh);\n}", "function onCreate() {\n /***************************** SETUP SCENE *****************************/\n // Create the scene\n scene = new THREE.Scene();\n // scene.fog = new THREE.FogExp2( 0xffffff, 0.015 )\n\n /***************************** SETUP CAMERA *****************************/\n\n camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.00001, 1000);\n camera.lat = Math.random();\n camera.lng = Math.random();\n camera.position.set(0,0,0);\n camera.lookAt(new THREE.Vector3(0,0,1));\n // camera.lookAt(new THREE.Vector3(0,2,0));\n // camera.lookAt(new THREE.Vector3(0,0,1));\n // console.log(camera.position)\n scene.add(camera);\n\n /**************************** SETUP PLANE ****************************/\n // var positions = [{x:0, y:0, z:100},\n // {x:100, y:0, z:100},\n // {x:-100, y:0, z:100},\n //\n // {x:0, y:0, z:0},\n // {x:100, y:0, z:0},\n // {x:-100, y:0, z:0},\n //\n // {x:0, y:0, z:-100},\n // {x:100, y:0, z:-100},\n // {x:-100, y:0, z:-100}];\n //\n // for (var i = 0; i < 9; i++) {\n // var aPlane = new THREE.Mesh(new THREE.PlaneGeometry( 100, 100 ),\n // new THREE.MeshBasicMaterial(\n // {color: colors[i],\n // side: THREE.DoubleSide} )\n // );\n // aPlane.position.set(\n // positions[i].x,\n // positions[i].y,\n // positions[i].z\n // );\n // aPlane.rotation.x = Math.PI/2; //angles[i];\n // scene.add( aPlane );\n // }\n\n /***************************** SETUP IMAGE(S) *****************************/\n // material\n THREE.ImageUtils.crossOrigin = \"anonymous\";\n\n graffitiArray.forEach(function(graffiti) {\n var pos = {\n x: (loc.coords.longitude - parseFloat(graffiti.lng)),\n y: 0,\n z: (loc.coords.latitude - parseFloat(graffiti.lat))};\n var theta = Math.random();\n console.log(pos, theta);\n var name = './pics/' + graffiti.id + \".jpg\"\n\n var material = new THREE.MeshBasicMaterial({\n map: THREE.ImageUtils.loadTexture(name),\n side: THREE.DoubleSide});\n\n // image\n var img = new THREE.Mesh(new THREE.PlaneGeometry(0.0001, 0.0001), material);\n // img.overdraw = true;\n img.needsUpdate = true;\n img.position.x = pos.x;\n img.position.y = pos.y;\n img.position.z = pos.z;\n img.rotation.y = theta;\n\n img.graffiti = { lat: graffiti.lat, lng: graffiti.lng }\n images.push(img);\n\n })\n\n images.forEach(function(img) {\n scene.add(img);\n })\n\n\n /***************************** SETUP PointLight *****************************/\n var pointLight = new THREE.PointLight( 0xFFFFFF );\n\n // set its position\n pointLight.position.x = 0;\n pointLight.position.y = 100;\n pointLight.position.z = 0;\n scene.add(pointLight);\n\n /***************************** SETUP RENDERER *****************************/\n // Check whether the browser supports WebGL\n\n // if(Detector.webgl){\n // renderer = new THREE.WebGLRenderer({antialias:true});\n // // alert(\"In WebGL mode!!\");\n // // If its not supported, instantiate the canvas renderer to support all non WebGL browsers\n // } else {\n // renderer = new THREE.CanvasRenderer();\n // // alert(\"In Canvas mode!!\");\n // }\n renderer = new THREE.CanvasRenderer();\n\n // Set the background color of the renderer to black, with full opacity\n renderer.setClearColor(0x000000, 1);\n\n // start the renderer\n renderer.setSize(window.innerWidth, window.innerHeight);\n\n // get the DOM element to attach to - assume we've got jQuery to handle this\n var container = $('#container');\n\n // attach the render-supplied DOM element\n window.addEventListener('keydown', checkKey, false);\n window.addEventListener( 'resize', onWindowResize, false );\n\n container.append(renderer.domElement);\n\n $(window).load(renderScene);\n\n onFrame();\n}", "function init(){\n\n // -------------------------------------------------\n // SCENE SETUP\n // -------------------------------------------------\n\n //Setup three.js WebGL renderer\n renderer = new THREE.WebGLRenderer({ antialias: true });\n renderer.setPixelRatio(window.devicePixelRatio);\n\n // Enable shadows\n // renderer.shadowMapEnabled = true;\n // renderer.shadowMapType = THREE.PCFShadowMap;\n\n // Append the canvas element created by the renderer to document body element.\n document.body.appendChild(renderer.domElement);\n\n // Create a three.js scene.\n scene = new THREE.Scene();\n scene.fog = new THREE.Fog( 0xCCCCCC, drawingDistance / 5 , drawingDistance );\n\n // Create a three.js camera.\n cameraPivot = new THREE.Object3D();\n cameraPivot.position.y = 2000;\n cameraPivot.rotation.x = -Math.PI / 2;\n camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 10 * drawingDistance);\n cameraPivot.add(camera);\n scene.add(cameraPivot);\n\n // Apply VR headset positional data to camera.\n controls = new THREE.VRControls(camera);\n\n // Apply VR stereo rendering to renderer.\n effect = new THREE.VREffect(renderer);\n effect.setSize(window.innerWidth, window.innerHeight);\n\n // Create a VR manager helper to enter and exit VR mode.\n manager = new WebVRManager(renderer, effect);\n\n\n // -------------------------------------------------\n // LIGHTS\n // -------------------------------------------------\n\n // Lights\n light = new THREE.AmbientLight( 0xffffff, 0.1 );\n scene.add( light );\n\n dirLight = new THREE.DirectionalLight( 0xfff5c4, 0.9 );\n dirLight.castShadow = true;\n dirLight.shadowCameraVisible = true;\n dirLight.shadowMapWidth = 1024;\n dirLight.shadowMapHeight = 1024;\n dirLight.shadowCameraFar = drawingDistance * 3;\n dirLight.position.set( drawingDistance, drawingDistance, 0 );\n scene.add( dirLight );\n\n // -------------------------------------------------\n // MATERIALS\n // -------------------------------------------------\n\n // Materials\n greenMat = new THREE.MeshLambertMaterial({ \n color: 0xd8de3f,\n shading: THREE.FlatShading,\n // wireframe: true\n });\n\n blackMat = new THREE.MeshLambertMaterial({ \n color: 0x030303, \n shading: THREE.FlatShading\n });\n\n blackWFMat = new THREE.MeshLambertMaterial({ \n color: 0x030303, \n shading: THREE.FlatShading,\n wireframe: true\n });\n\n whiteWFMat = new THREE.MeshLambertMaterial({ \n color: 0xFFFFFF, \n shading: THREE.FlatShading,\n wireframe: true\n });\n\n whiteMat = new THREE.MeshLambertMaterial({\n color: 0xFFFFFF,\n shading: THREE.FlatShading,\n specular: 0xFFFFFF\n });\n\n\n // -------------------------------------------------\n // OBJECTS\n // -------------------------------------------------\n\n // Terrain\n terrain = generateTerrain(\"heightmap\", blackWFMat, drawingDistance * 2, 1500, drawingDistance * 2);\n // terrain.receiveShadow = true;\n scene.add( terrain );\n\n // Cubes\n var radius = 60;\n var size = 10;\n cubesCenter = new THREE.Object3D();\n cubesCenter.position.set(0, 0, 0);\n for(var i = 0; i < amount; i++) {\n var geometry = new THREE.BoxGeometry(size, size, size);\n geometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, size / 2, 0 ));\n // geometry.castShadow = true;\n\n cubes[i] = new THREE.Mesh(geometry, whiteMat); \n cubes[i].position.x = -radius * Math.cos(i / amount * Math.PI * 2);\n cubes[i].position.z = radius * Math.sin(i / amount * Math.PI * 2);\n //cubes[i].rotation.y = -i / amount * Math.PI * 2;\n\n cubesCenter.add(cubes[i]);\n }\n scene.add(cubesCenter);\n\n // Selector\n var geometry = new THREE.CircleGeometry(10, 16);\n selector = new THREE.Mesh(geometry, whiteWFMat);\n var vec = new THREE.Vector3( 0, 0, -selectorRadius );\n vec.applyQuaternion( camera.quaternion );\n selector.position.x = vec.x;\n selector.position.z = vec.z;\n selector.rotation.x = -Math.PI / 2;\n //scene.add(selector);\n\n var cube = new THREE.Mesh(new THREE.CubeGeometry(8, 8, 8), whiteMat);\n cube.position.z = -selectorRadius;\n //scene.add(cube); \n}", "function getSTLFromScene(params) {\n var root = params.root;\n var matrix = params.matrix || new THREE.Matrix4();\n var strbuf = [];\n strbuf.push(\"solid object\");\n\n function addFace(v0, v1, v2) {\n strbuf.push(\"facet normal 0 0 0\");\n strbuf.push(\" outer loop\");\n strbuf.push(\" vertex \" + v0.x + \" \" + v0.y + \" \" + v0.z);\n strbuf.push(\" vertex \" + v1.x + \" \" + v1.y + \" \" + v1.z);\n strbuf.push(\" vertex \" + v2.x + \" \" + v2.y + \" \" + v2.z);\n strbuf.push(\" endloop\");\n strbuf.push(\"endfacet\");\n }\n function addGeometry(geometry, matrix) {\n if (!geometry) {\n return;\n }\n var vertices = geometry.vertices;\n var faces = geometry.faces;\n if (!geometry.isBufferGeometry) {\n if (!vertices || !vertices.length || !faces || !faces.length) {\n return;\n }\n }\n if (geometry.isBufferGeometry) {\n var position = geometry.getAttribute(\"position\").array || [];\n var indices;\n if (geometry.index && geometry.index.array) {\n indices = geometry.index.array || [];\n }\n var v0 = new THREE.Vector3();\n var v1 = new THREE.Vector3();\n var v2 = new THREE.Vector3();\n var a = 0;\n var b = 0;\n var c = 0;\n if (indices) {\n for (var i = 0; i < indices.length; i += 3) {\n var a = indices[i] * 3;\n var b = indices[i + 1] * 3;\n var c = indices[i + 2] * 3;\n v0.set(position[a], position[a + 1], position[a + 2]).applyMatrix4(matrix);\n v1.set(position[b], position[b + 1], position[b + 2]).applyMatrix4(matrix);\n v2.set(position[c], position[c + 1], position[c + 2]).applyMatrix4(matrix);\n addFace(v0, v1, v2);\n }\n } else {\n for (var i = 0; i < position.length; i += 9) {\n var a = i;\n var b = i + 3;\n var c = i + 6;\n v0.set(position[a], position[a + 1], position[a + 2]).applyMatrix4(matrix);\n v1.set(position[b], position[b + 1], position[b + 2]).applyMatrix4(matrix);\n v2.set(position[c], position[c + 1], position[c + 2]).applyMatrix4(matrix);\n addFace(v0, v1, v2);\n }\n }\n } else {\n var i3 = 0;\n var a = 0;\n var b = 0;\n var c = 0;\n for (var i = 0; i < faces.length; i++) {\n var face = faces[i];\n a = face.a;\n b = face.b;\n c = face.c;\n var v0 = vertices[a].clone().applyMatrix4(matrix);\n var v1 = vertices[b].clone().applyMatrix4(matrix);\n var v2 = vertices[c].clone().applyMatrix4(matrix);\n addFace(v0, v1, v2);\n }\n }\n }\n strbuf.push(\"endsolid insole\");\n\n function _doIt(iter, matrix) {\n matrix = matrix.clone().multiply(iter.matrix);\n if (iter.geometry) {\n addGeometry(iter.geometry, matrix);\n }\n for (var i = 0; i < iter.children.length; i++) {\n var child = iter.children[i];\n if (!child) {\n return;\n }\n _doIt(child, matrix);\n }\n }\n _doIt(root, matrix);\n\n return strbuf;\n}", "constructor(shedWidth, shedDepth, style = tools.URBAN_BARN) {\n super();\n\n const WALL_MAP_WIDTH = tools.ft2cm(5);\n const WALL_MAP_DEPTH = WALL_MAP_WIDTH;\n\n let textureLoader = new THREE.TextureLoader();\n\n let boxTexture = textureLoader.load(assets.img.just_wood);\n boxTexture.wrapS = boxTexture.wrapT = THREE.RepeatWrapping;\n boxTexture.repeat.x = shedWidth / WALL_MAP_WIDTH;\n\n let box = new THREE.Object3D();\n let boxMaterial = new THREE.MeshPhongMaterial({\n map: boxTexture\n });\n\n let front = new THREE.Mesh(new THREE.PlaneGeometry(shedWidth - 2, tools.in2cm(5.5)), boxMaterial);\n let back = new THREE.Mesh(new THREE.PlaneGeometry(shedWidth - 2, tools.in2cm(5.5)), boxMaterial);\n let left = new THREE.Mesh(new ClipGeometry(new THREE.PlaneGeometry(shedDepth - 2, tools.in2cm(5.5))), boxMaterial);\n let right = new THREE.Mesh(new ClipGeometry(new THREE.PlaneGeometry(shedDepth - 2, tools.in2cm(5.5))), boxMaterial);\n\n front.position.setZ(shedDepth * 0.5 - 1);\n back.position.setZ(-shedDepth * 0.5 + 1);\n left.position.setX(shedWidth * 0.5 - 1);\n right.position.setX(-shedWidth * 0.5 + 1);\n\n back.rotation.fromArray([0, Math.PI, 0]);\n left.rotation.fromArray([0, Math.PI * 0.5, 0]);\n right.rotation.fromArray([0, -Math.PI * 0.5, 0]);\n\n box.add(front);\n box.add(back);\n box.add(left);\n box.add(right);\n\n box.position.y = tools.in2cm(7.25) + 1;\n\n box.receiveShadow = box.castShadow = true;\n\n let skidGeometry = new THREE.BufferGeometry();\n let skidDepth = shedDepth - 1;\n let skidWidth = tools.in2cm(3.5);\n let skidHeight = tools.in2cm(5);\n let skidVertices = [\n skidWidth * 0.5, skidHeight, -skidDepth * 0.5, //0\n skidWidth * 0.5, skidHeight - tools.in2cm(1.5), -skidDepth * 0.5, //1\n skidWidth * 0.5, 0, -skidDepth * 0.5 + tools.in2cm(4), //2\n skidWidth * 0.5, 0, skidDepth * 0.5 - tools.in2cm(4), //3\n skidWidth * 0.5, skidHeight - tools.in2cm(1.5), skidDepth * 0.5, //4\n skidWidth * 0.5, skidHeight, skidDepth * 0.5, //5\n ];\n\n _.times(18, (i)=> {\n if (i % 3 == 0) {\n skidVertices.push(-skidVertices[i]);\n } else {\n skidVertices.push(skidVertices[i]);\n }\n });\n\n let skidIndices = [\n 0, 7, 6,\n 0, 1, 7,\n 1, 8, 7,\n 1, 2, 8,\n 2, 9, 8,\n 2, 3, 9,\n 4, 10, 3,\n 10, 9, 3,\n 5, 11, 4,\n 11, 10, 4,\n\n 0, 5, 1,\n 1, 5, 4,\n 1, 4, 2,\n 2, 4, 3,\n 6, 7, 11,\n 7, 10, 11,\n 7, 8, 10,\n 8, 9, 10,\n\n 0, 6, 5,\n 5, 6, 11\n ];\n\n skidGeometry.addAttribute('position', new THREE.BufferAttribute(new Float32Array(skidVertices), 3));\n skidGeometry.setIndex(new THREE.BufferAttribute(new Uint32Array(skidIndices), 1));\n skidGeometry.computeVertexNormals();\n\n let skidMap = {};\n let skidHalf = skidWidth * 0.5;\n skidMap[tools.URBAN_BARN] = {\n 8: [\n -tools.in2cm(64) * 0.5 + skidHalf,\n tools.in2cm(64) * 0.5 - skidHalf\n ],\n 10: [\n -tools.in2cm(64) * 0.5 + skidHalf,\n tools.in2cm(64) * 0.5 - skidHalf,\n -tools.in2cm(117) * 0.5 + skidHalf,\n tools.in2cm(117) * 0.5 - skidHalf\n ],\n 12: [\n -tools.in2cm(64) * 0.5 + skidHalf,\n tools.in2cm(64) * 0.5 - skidHalf,\n -tools.in2cm(124) * 0.5 + skidHalf,\n tools.in2cm(124) * 0.5 - skidHalf\n ],\n };\n\n skidMap[tools.LEAN_TO] = skidMap[tools.URBAN_SHACK] = skidMap[tools.URBAN_BARN];\n\n skidMap[tools.A_FRAME] = {\n 6: [\n -tools.ft2cm(5) * 0.5 - skidHalf,\n tools.ft2cm(5) * 0.5 + skidHalf\n ],\n 8: [\n -tools.ft2cm(5.4166) * 0.5 - skidHalf,\n tools.ft2cm(5.4166) * 0.5 + skidHalf\n ],\n 10: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth\n ],\n 12: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(27.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(27.5 + 30.75 + 3.5) + skidWidth\n ],\n 14: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth,\n -tools.in2cm(20.5 + 18.5 + 30.75 + 7) - skidWidth,\n tools.in2cm(20.5 + 18.5 + 30.75 + 7) + skidWidth\n ],\n 16: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(30.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(30.5 + 30.75 + 3.5) + skidWidth,\n -tools.in2cm(17.5 + 30.5 + 30.75 + 7) - skidWidth,\n tools.in2cm(17.5 + 30.5 + 30.75 + 7) + skidWidth\n ]\n };\n\n skidMap[tools.DOUBLE_WIDE] = {\n 20: [\n -tools.in2cm(2) - skidHalf,\n tools.in2cm(2) + skidHalf,\n -tools.in2cm(18.5 + 2 + 3.5) - skidHalf,\n tools.in2cm(18.5 + 2 + 3.5) + skidHalf,\n -tools.in2cm(30.75 + 18.5 + 2 + 7) - skidHalf,\n tools.in2cm(30.75 + 18.5 + 2 + 7) + skidHalf,\n -tools.in2cm(30.75 + 30.75 + 18.5 + 2 + 10.5) - skidHalf,\n tools.in2cm(30.75 + 30.75 + 18.5 + 2 + 10.5) + skidHalf,\n -tools.in2cm(18.5 + 30.75 + 30.75 + 18.5 + 2 + 14) - skidHalf,\n tools.in2cm(18.5 + 30.75 + 30.75 + 18.5 + 2 + 14) + skidHalf\n ],\n 24: [\n -tools.in2cm(2) - skidHalf,\n tools.in2cm(2) + skidHalf,\n -tools.in2cm(30.5 + 2 + 3.5) - skidHalf,\n tools.in2cm(30.5 + 2 + 3.5) + skidHalf,\n -tools.in2cm(30.75 + 30.5 + 2 + 7) - skidHalf,\n tools.in2cm(30.75 + 30.5 + 2 + 7) + skidHalf,\n -tools.in2cm(30.75 + 30.75 + 30.5 + 2 + 10.5) - skidHalf,\n tools.in2cm(30.75 + 30.75 + 30.5 + 2 + 10.5) + skidHalf,\n -tools.in2cm(30.5 + 30.75 + 30.75 + 30.5 + 2 + 14) - skidHalf,\n tools.in2cm(30.5 + 30.75 + 30.75 + 30.5 + 2 + 14) + skidHalf\n ],\n 28: [\n -tools.in2cm(2) - skidHalf,\n tools.in2cm(2) + skidHalf,\n -tools.in2cm(20.5 + 2 + 3.5) - skidHalf,\n tools.in2cm(20.5 + 2 + 3.5) + skidHalf,\n -tools.in2cm(18.5 + 20.5 + 2 + 7) - skidHalf,\n tools.in2cm(18.5 + 20.5 + 2 + 7) + skidHalf,\n -tools.in2cm(30.75 + 18.5 + 20.5 + 2 + 10.5) - skidHalf,\n tools.in2cm(30.75 + 18.5 + 20.5 + 2 + 10.5) + skidHalf,\n -tools.in2cm(30.75 + 30.75 + 18.5 + 20.5 + 2 + 14) - skidHalf,\n tools.in2cm(30.75 + 30.75 + 18.5 + 20.5 + 2 + 14) + skidHalf,\n -tools.in2cm(18.5 + 30.75 + 30.75 + 18.5 + 20.5 + 2 + 17.5) - skidHalf,\n tools.in2cm(18.5 + 30.75 + 30.75 + 18.5 + 20.5 + 2 + 17.5) + skidHalf,\n -tools.in2cm(20.5 + 18.5 + 30.75 + 30.75 + 18.5 + 20.5 + 2 + 21) - skidHalf,\n tools.in2cm(20.5 + 18.5 + 30.75 + 30.75 + 18.5 + 20.5 + 2 + 21) + skidHalf\n ],\n 32: [\n -tools.in2cm(2) - skidHalf,\n tools.in2cm(2) + skidHalf,\n -tools.in2cm(20.5 + 2 + 3.5) - skidHalf,\n tools.in2cm(20.5 + 2 + 3.5) + skidHalf,\n -tools.in2cm(30.5 + 20.5 + 2 + 7) - skidHalf,\n tools.in2cm(30.5 + 20.5 + 2 + 7) + skidHalf,\n -tools.in2cm(30.75 + 30.5 + 20.5 + 2 + 10.5) - skidHalf,\n tools.in2cm(30.75 + 30.5 + 20.5 + 2 + 10.5) + skidHalf,\n -tools.in2cm(30.75 + 30.75 + 30.5 + 20.5 + 2 + 14) - skidHalf,\n tools.in2cm(30.75 + 30.75 + 30.5 + 20.5 + 2 + 14) + skidHalf,\n -tools.in2cm(30.5 + 30.75 + 30.75 + 30.5 + 20.5 + 2 + 17.5) - skidHalf,\n tools.in2cm(30.5 + 30.75 + 30.75 + 30.5 + 20.5 + 2 + 17.5) + skidHalf,\n -tools.in2cm(20.5 + 30.5 + 30.75 + 30.75 + 30.5 + 20.5 + 2 + 21) - skidHalf,\n tools.in2cm(20.5 + 30.5 + 30.75 + 30.75 + 30.5 + 20.5 + 2 + 21) + skidHalf\n ],\n };\n\n skidMap[tools.ECO] = {\n 6: [\n -tools.in2cm(61) * 0.5 - skidHalf,\n tools.in2cm(61) * 0.5 + skidHalf\n ],\n 8: [\n -tools.in2cm(65) * 0.5 - skidHalf,\n tools.in2cm(65) * 0.5 + skidHalf\n ],\n 10: [\n -tools.in2cm(65) * 0.5 - skidHalf,\n tools.in2cm(65) * 0.5 + skidHalf\n ],\n 12: [\n -tools.in2cm(65) * 0.5 - skidHalf,\n tools.in2cm(65) * 0.5 + skidHalf\n ]\n };\n\n skidMap[tools.CASTLE_MOUNTAIN] = {\n 8: [\n -tools.in2cm(61) * 0.5 - skidHalf,\n tools.in2cm(61) * 0.5 + skidHalf\n ],\n 10: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth\n ],\n 12: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(28 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(28 + 30.75 + 3.5) + skidWidth\n ],\n 14: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth,\n -tools.in2cm(20.5 + 18.5 + 30.75 + 7) - skidWidth,\n tools.in2cm(20.5 + 18.5 + 30.75 + 7) + skidWidth\n ],\n 16: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(30.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(30.5 + 30.75 + 3.5) + skidWidth,\n -tools.in2cm(18 + 30.5 + 30.75 + 7) - skidWidth,\n tools.in2cm(18 + 30.5 + 30.75 + 7) + skidWidth\n ]\n };\n\n skidMap[tools.QUAKER] = {\n 6: [\n -tools.in2cm(61) * 0.5 - skidHalf,\n tools.in2cm(61) * 0.5 + skidHalf\n ],\n 8: [\n -tools.in2cm(65) * 0.5 - skidHalf,\n tools.in2cm(65) * 0.5 + skidHalf\n ],\n 10: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth\n ],\n 12: [\n 0,\n -tools.in2cm(28.75) - skidWidth,\n tools.in2cm(28.75) + skidWidth,\n -tools.in2cm(32.5 + 28.75 + 3.5) - skidWidth,\n tools.in2cm(32.5 + 28.75 + 3.5) + skidWidth\n ],\n 14: [\n 0,\n -tools.in2cm(28.75) - skidWidth,\n tools.in2cm(28.75) + skidWidth,\n -tools.in2cm(20.5 + 28.75 + 3.5) - skidWidth,\n tools.in2cm(20.5 + 28.75 + 3.5) + skidWidth,\n -tools.in2cm(20.5 + 20.5 + 28.75 + 7) - skidWidth,\n tools.in2cm(20.5 + 20.5 + 28.75 + 7) + skidWidth\n ],\n };\n\n skidMap[tools.MINI_BARN] = {\n 6: [\n -tools.in2cm(60) * 0.5 - skidHalf,\n tools.in2cm(60) * 0.5 + skidHalf\n ],\n 8: [\n -tools.in2cm(65) * 0.5 - skidHalf,\n tools.in2cm(65) * 0.5 + skidHalf\n ],\n 10: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth\n ],\n 12: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(30.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(30.5 + 30.75 + 3.5) + skidWidth\n ],\n };\n\n skidMap[tools.HI_BARN] = {\n 6: [\n -tools.in2cm(60) * 0.5 - skidHalf,\n tools.in2cm(60) * 0.5 + skidHalf\n ],\n 8: [\n -tools.in2cm(65) * 0.5 - skidHalf,\n tools.in2cm(65) * 0.5 + skidHalf\n ],\n 10: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth\n ],\n 12: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(30.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(30.5 + 30.75 + 3.5) + skidWidth\n ],\n 14: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth,\n -tools.in2cm(20.5 + 18.5 + 30.75 + 7) - skidWidth,\n tools.in2cm(20.5 + 18.5 + 30.75 + 7) + skidWidth\n ],\n 16: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(30.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(30.5 + 30.75 + 3.5) + skidWidth,\n -tools.in2cm(20.5 + 30.5 + 30.75 + 7) - skidWidth,\n tools.in2cm(20.5 + 30.5 + 30.75 + 7) + skidWidth\n ]\n };\n\n skidMap[tools.SINGLE_SLOPE] = {\n 8: [\n -tools.in2cm(65) * 0.5 - skidHalf,\n tools.in2cm(65) * 0.5 + skidHalf\n ],\n 10: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth\n ],\n 12: [\n 0,\n -tools.in2cm(31.5) - skidWidth,\n tools.in2cm(31.5) + skidWidth,\n -tools.in2cm(28 + 31.5 + 3.5) - skidWidth,\n tools.in2cm(28 + 31.5 + 3.5) + skidWidth\n ],\n 14: [\n 0,\n -tools.in2cm(30.75) - skidWidth,\n tools.in2cm(30.75) + skidWidth,\n -tools.in2cm(18.5 + 30.75 + 3.5) - skidWidth,\n tools.in2cm(18.5 + 30.75 + 3.5) + skidWidth,\n -tools.in2cm(20.5 + 18.5 + 30.75 + 7) - skidWidth,\n tools.in2cm(20.5 + 18.5 + 30.75 + 7) + skidWidth\n ],\n }\n\n let ftWidth = shedWidth / tools.ft2cm(1);\n let xPositions;\n if (skidMap[style] && skidMap[style][ftWidth]) {\n xPositions = skidMap[style][ftWidth];\n } else {\n if (!skidMap[style]) {\n style = tools.URBAN_BARN;\n }\n\n //find the closest size\n let values = _.keys(skidMap[style]);\n let min, max = 0;\n let i, n;\n for (i = 0, n = values.length - 1; i < n; i++) {\n if (values[i + 1] > ftWidth) {\n min = values[i];\n max = values[i + 1];\n break;\n }\n }\n\n if (i == values.length - 1) {\n min = max = values[values.length - 1];\n }\n\n let closest = min;\n if (Math.abs(max - ftWidth) < Math.abs(min - ftWidth)) {\n closest = max;\n }\n\n xPositions = skidMap[style][closest];\n }\n\n let skidMaterial = new THREE.MeshPhongMaterial({\n map: boxTexture,\n shading: THREE.FlatShading\n });\n _.each(xPositions, (xPosition)=> {\n let skid = new THREE.Mesh(skidGeometry, skidMaterial);\n skid.castShadow = skid.receiveShadow = true;\n skid.position.setX(xPosition);\n this.add(skid);\n });\n\n let texture = textureLoader.load(assets.img.floor);\n let bump = textureLoader.load(assets.img.floor_b);\n\n texture.wrapS = texture.wrapT =\n bump.wrapS = bump.wrapT = THREE.RepeatWrapping;\n texture.repeat.y = bump.repeat.y = shedWidth / WALL_MAP_WIDTH;\n texture.repeat.x = bump.repeat.x = shedDepth / WALL_MAP_DEPTH;\n\n let floorMaterial = new THREE.MeshPhongMaterial({\n map: texture,\n bumpMap: bump,\n specular: 0\n });\n\n let floorSurface = new THREE.Mesh(new ClipGeometry(new THREE.PlaneGeometry(shedDepth - 1, shedWidth - 1)), floorMaterial);\n\n floorSurface.receiveShadow = floorSurface.castShadow = true;\n\n floorSurface.rotateX(-Math.PI * 0.5);\n floorSurface.rotateZ(Math.PI * 0.5);\n floorSurface.position.setY(tools.in2cm(10.5));\n\n let floorShadow = new THREE.Mesh(new ClipGeometry(new THREE.PlaneGeometry(shedDepth - 4, shedWidth - 4)), floorMaterial);\n floorShadow.rotation.fromArray(floorSurface.rotation.toArray());\n floorShadow.rotateY(Math.PI);\n floorShadow.castShadow = true;\n\n floorShadow.position.y = tools.in2cm(5);\n\n this.add(floorSurface);\n this.add(floorShadow);\n this.add(box);\n\n let removedLeft = false;\n\n Object.defineProperties(this, {\n clip: {\n get: ()=> {\n let clip = {};\n\n\n clip.push = (minZ, maxZ)=> {\n floorSurface.geometry.clip.push(minZ, maxZ);\n if (removedLeft > 0) {\n left.geometry.clip.push(minZ + tools.ft2cm(1), maxZ - tools.ft2cm(1));\n } else {\n right.geometry.clip.push(-maxZ + tools.ft2cm(1), -minZ - tools.ft2cm(1));\n }\n };\n\n clip.pop = ()=> {\n if (removedLeft) {\n left.geometry.clip.pop();\n } else {\n right.geometry.clip.pop();\n }\n return floorSurface.geometry.clip.pop();\n };\n\n Object.defineProperties(clip, {\n areas: {\n get: ()=> {\n return floorSurface.geometry.clip.areas;\n }\n },\n angle: {\n set: (value)=> {\n removedLeft = value > 0;\n }\n }\n });\n\n return clip;\n }\n }\n });\n }", "function onLoad(framework) {\n var scene = framework.scene;\n var camera = framework.camera;\n var renderer = framework.renderer;\n var gui = framework.gui;\n var stats = framework.stats;\n var data= framework.data; // per frame audio data\n var aud= framework.aud; // audio object to control play/pause\n\n var {scene, camera, renderer, gui, stats, data, aud} = framework;\n\n // initialize an icosahedron and material\n //var icosh = new THREE.IcosahedronBufferGeometry(1, 5);\n //var icosh = new THREE.Mesh(icosh, icoshMaterial);\n\n //var material = new THREE.PointCloudMaterial({\tcolor: 0xffffcc });\n\n/*\t// PARTICLE VISUALIZER:\n\tvar x, y, z;\n\tfor(var i=0;i<10240*2;i++)\n\t{\n\t x = (Math.random() * 1000) - 500;\n\t y = 0;//(Math.random() * 800) - 400;\n\t z = (Math.random() * 1000) - 500;\n\t var vert = new THREE.Vector3(x, y, z);\n\t vertList.push(vert);\n\t geometry.vertices.push(vert);\n\t geometry.colors.push(new THREE.Color(0,0,0));//(Math.random(), Math.random(), Math.random()));\n\t}\n\n scene.add(pointCloud);\n*/\n\n\t// 12 NOTES VISUALIZER\n\tvar x, y, z;\n\tfor(var i=0;i<12*3;i++)\n\t{\n\t x = i-6*3;\n\t y = 0;//(Math.random() * 800) - 400;\n\t z = 0;\n\n\t // if(i%12==0)\n\t // \t\tz=0;\n\t // else if(i%12==1 || i%12==2)\n\t // \t\tz=1;\n\t\t// else if(i%12==3 || i%12==4)\n // \t \t\tz=2;\n\t\t// else if(i%12==5 || i%12==6)\n // \t \t\tz=3;\n\t\t// else if(i%12==7)\n // \t \t\tz=4;\n\t\t// else if(i%12==8 || i%12==9)\n // \t \t\tz=5;\n\t\t// else if(i%12==10 || i%12==11)\n // \t \t\tz=6;\n\t\t// z*=2;\n\n \t\tif(i%12==1 || i%12==3 || i%12==6 || i%12==8 || i%12==10)\n\t \t\tz=-2;\n\n\t\tvar vert = new THREE.Vector3(x, y, z);\n\t\tvertList.push(vert);\n\t\tgeometry.vertices.push(vert);\n\n\t\tvar col;\n\t \tif(i<12)\n\t \t\tcol = new THREE.Color(1,0,0);//(Math.random(), Math.random(), Math.random()));\n\t\telse if(i<24)\n\t\t\tcol = new THREE.Color(0,1,0);\n\t\telse\n\t\t\tcol = new THREE.Color(0,0,1);\n\n\t\tif(z==-2)\n\t \t\tcol.multiplyScalar(0.5);\n\n\t\tgeometry.colors.push(col);\n\t}\n\tscene.add(pointCloud);\n\n\n/*\nvar synth = new Tone.Synth({\n\t\t\t\"oscillator\" : {\n\t\t\t\t\"type\" : \"square\"\n\t\t\t},\n\t\t\t\"envelope\" : {\n\t\t\t\t\"attack\" : 0.01,\n\t\t\t\t\"decay\" : 0.2,\n\t\t\t\t\"sustain\" : 0.2,\n\t\t\t\t\"release\" : 0.2,\n\t\t\t}\n\t\t}).toMaster();\n\t\t// GUI //\n\t\tvar keyboard = Interface.Keyboard();\n\t\tkeyboard.keyDown = function (note) {\n\t\t synth.triggerAttack(note);\n\t\t};\n\t\tkeyboard.keyUp = function () {\n\t\t synth.triggerRelease();\n\t\t};\n*/\n\n\n // set camera position\n camera.position.set(0,10,20);\n camera.lookAt(new THREE.Vector3(0,0,0));\n\n // add icosh to the scene\n //scene.add(icosh);\n\n // Elements for the GUI:\n gui.add(camera, 'fov', 0, 180).onChange(function(newVal) {\n camera.updateProjectionMatrix();\n });\n var update= new GUIoptions();\n // gui.add(update,'Red', 0.0, 1.0,0.05).onChange(function(newVal) {\n // r=newVal;\n // });\n // gui.add(update,'Green', 0.0, 1.0,0.05).onChange(function(newVal) {\n // g=newVal;\n // });\n // gui.add(update,'Blue', 0.0, 1.0,0.05).onChange(function(newVal) {\n // b=newVal;\n // });\n\tgui.add(update,'Music').onChange(function(newVal) {\n\t\tif(newVal===false) aud.pause();\n\t\telse aud.play();\n\t});\n\tgui.add(update,'Audio').onChange(function(newVal) {\n\t\tmmaker.on = newVal;\n\t\tif(mmaker.on===true)\n\t\t{\n\t\t//\tmmaker = new MusicMaker();\n\t\t\tTone.Transport.start();\n\t\t}\n\t\telse {\n\t\t\t//mmaker = undefined;\n\t\t\tTone.Transport.stop();\n\t\t}\n\t});\n\t//gui.add(update,'MusicSource').onclick;\n\tgui.add(update,'Start').onclick;\n}", "function render_3D_S() {\n requestAnimationFrame(render_3D_S);\n if (!renderer_3D_S.autoClear) renderer_3D_S.clear();\n controller_3D_S.update();\n renderer_3D_S.render(scene_3D_S,camera_3DS);\n}", "function Simulation() { // A constructor.\n var that = {}; // The object returned by this constructor.\n var worker = null; // Will contain a reference to a fast number-chrunching worker thread that runs outside of this UR/animation thread.\n var requestAnimationFrameID = null; // Used to cancel a prior requestAnimationFrame request.\n var gl = {}; // Will contain WebGL related items.\n\n gl.viewportWidth = 800; // The width of the Three.js viewport.\n gl.viewportHeight = 600; // The height of the Three.js viewport.\n\n gl.cameraSpecs = {\n aspectRatio: gl.viewportWidth / gl.viewportHeight, // Camera frustum aspect ratio.\n viewAngle: 50 // Camera frustum vertical field of view, in degrees.\n };\n\n gl.clippingPlane = {\n near: 0.1, // The distance of the near clipping plane (which always coincides with the monitor).\n far: 1000 // The distance of the far clipping plane (note that you get a negative far clipping plane for free, which occurs at the negative of this value).\n };\n\n gl.quads = 32; // Represents both the number of vertical segments and the number of horizontal rings for each mass's sphere wireframe.\n\n gl.renderer = window.WebGLRenderingContext ? new THREE.WebGLRenderer({alpha: true}) : new THREE.CanvasRenderer({alpha: true}); // If WebGL isn't supported, fallback to using the canvas-based renderer (which most browsers support). Note that passing in \"{ antialias: true }\" is unnecessary in that this is the default behavior. However, we pass in \"{ alpha: true }\" in order to let the background PNG image shine through.\n gl.renderer.setClearColor(0x000000, 0); // Make the background completely transparent (the actual color, black in this case, does not matter) so that the PNG background image can shine through.\n gl.renderer.setSize(gl.viewportWidth, gl.viewportHeight); // Set the size of the renderer.\n\n gl.scene = new THREE.Scene(); // Create a Three.js scene.\n\n gl.camera = new THREE.PerspectiveCamera(gl.cameraSpecs.viewAngle, gl.cameraSpecs.aspectRatio, gl.clippingPlane.near, gl.clippingPlane.far); // Set up the viewer's eye position.\n gl.camera.position.set(0, 95, 450); // The camera starts at the origin, so move it to a good position.\n gl.camera.lookAt(gl.scene.position); // Make the camera look at the origin of the xyz-coordinate system.\n\n gl.controls = new THREE.OrbitControls(gl.camera, gl.renderer.domElement); // Allows for orbiting, panning, and zooming via OrbitsControls.js by http://threejs.org. For an example, see http://threejs.org/examples/misc_controls_orbit.html.\n\n gl.pointLight = new THREE.PointLight(0xFFFFFF); // Set the color of the light source (white).\n gl.pointLight.position.set(0, 250, 250); // Position the light source at (x, y, z).\n gl.scene.add(gl.pointLight); // Add the light source to the scene.\n\n gl.spheres = []; // Will contain WebGL sphere mesh objects representing the point masses.\n\n var init = function (initialConditions) { // Public method, resets everything when called.\n if (requestAnimationFrameID) {\n cancelAnimationFrame(requestAnimationFrameID); // Cancel the previous requestAnimationFrame request.\n }\n\n if (worker) {\n worker.terminate(); // Terminate the previously running worker thread to ensure a responsive UI.\n }\n worker = new Worker('js/3BodyWorker.js'); // Spawn a fast number-chrunching thread that runs outside of this UR/animation thread.\n\n document.getElementById('WebGLCanvasElementContainer').style.backgroundImage = \"url('images/starField.png')\"; // Switch back to the non-opaque PNG background image.\n// document.getElementsByTagName('article')[0].style.display = \"none\"; // Remove from page-flow the one (and only) article element (along with all of its content).\n document.getElementById('WebGLCanvasElementContainer').appendChild(gl.renderer.domElement); // Append renderer element to DOM.\n\n while (gl.spheres.length) { // Remove any prior spheres from the scene and empty the gl.spheres array:\n gl.scene.remove(gl.spheres.pop());\n } // while\n\n for (var i = 0; i < initialConditions.length; i++) { // Set the sphere objects in gl.spheres to initial conditions.\n initializeMesh(initialConditions[i]); // This call sets the gl.spheres array.\n } // for\n\n worker.postMessage({\n cmd: 'init', // Pass the initialization command to the web worker.\n initialConditions: initialConditions // Send a copy of the initial conditions to the web worker, so it can initialize its persistent global variables.\n }); // worker.postMessage\n\n worker.onmessage = function (evt) { // Process the results of the \"crunch\" command sent to the web worker (via this UI thread).\n for (var i = 0; i < evt.data.length; i++) {\n gl.spheres[i].position.x = evt.data[i].p.x;\n gl.spheres[i].position.z = evt.data[i].p.y;\n gl.spheres[i].position.y = 0; // 3BodyWorker.js is 2D (i.e., the physics are constrained to a plane).\n gl.spheres[i].rotation.y += initialConditions[i].rotation; // Place worker.onmessage in the init method in order to access its initialConditions array.\n }\n gl.renderer.render(gl.scene, gl.camera); // Update the positions of the masses (sphere meshes) onscreen based on the data returned by 3BodyWorker.js.\n }; // worker.onmessage\n\n function initializeMesh(initialCondition) {\n var texture = THREE.ImageUtils.loadTexture(initialCondition.bitmap); // Create texture object based on the given bitmap path.\n var material = new THREE.MeshPhongMaterial({map: texture}); // Create a material (for the spherical mesh) that reflects light, potentially causing sphere surface shadows.\n var geometry = new THREE.SphereGeometry(initialCondition.radius, gl.quads, gl.quads); // Radius size, number of vertical segments, number of horizontal rings.\n var mesh = new THREE.Mesh(geometry, material); // A mesh represents the object (typically composed of many tiny triangles) to be displayed - in this case a hollow sphere with a bitmap on its surface.\n\n mesh.position.x = initialCondition.position.x;\n mesh.position.z = initialCondition.position.y; // Convert from 2D to \"3D\".\n mesh.position.y = 0; // The physics are constrained to the xz-plane (i.e., the xy-plane in 3BodyWorker.js).\n\n gl.scene.add(mesh); // Add the sphere to the Three.js scene.\n gl.spheres.push(mesh); // Make the Three.js mesh sphere objects accessible outside of this helper function.\n } // initializeMesh\n } // init\n that.init = init; // This is what makes the method public.\n\n var run = function () { // Public method.\n worker.postMessage({\n cmd: 'crunch' // This processing occurs between animation frames and, therefore, is assumed to take a relatively small amount of time (as compared to current frame rates).\n }); // worker.postMessage\n gl.controls.update(); // Allows for orbiting, panning, and zooming.\n requestAnimationFrameID = requestAnimationFrame(run); // Allow for the cancellation of this requestAnimationFrame request.\n }; // run()\n that.run = run;\n\n return that; // The object returned by the constructor.\n} // Simulation", "function buildScene() {\n var hemLight,\n axisHelper,\n spotLight,\n sphere;\n\n scene = new THREE.Scene();\n camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 9999999999);\n pointLight = new THREE.PointLight(0xfffff, 1, 300);\n hemLight = new THREE.HemisphereLight(0xffffff, 0xffffff, 1);\n renderer = new THREE.WebGLRenderer();\n controls = new THREE.OrbitControls(camera, renderer.domElement);\n axisHelper = new THREE.GridHelper(100000, 100);\n sphere = new THREE.SphereGeometry(10, 16, 8);\n\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.setClearColor(0xBBBBBBB);\n document.body.appendChild(renderer.domElement);\n\n pointLight.add(new THREE.Mesh(sphere,\n new THREE.MeshBasicMaterial({\n color: 0xff0040\n })));\n\n spritey = makeTextSprite(Math.floor(graphYPoint).toString() + '%', {\n fontsize: 24,\n borderColor: {\n r: 255,\n g: 0,\n b: 0,\n a: 1.0\n },\n backgroundColor: {\n r: 255,\n g: 100,\n b: 100,\n a: 0.8\n }\n });\n\n spritey.position.set(graphXPoint + 50, graphYPoint, 0);\n scene.add(spritey);\n scene.add(axisHelper);\n scene.add(hemLight);\n\n camera.position.z = 200;\n camera.position.y = 100;\n camera.position.x = 100;\n camera.rotation.x = 0;\n camera.rotation.y = -100;\n\n //Adds a pointlight to the camera so the light is always relative to where\n //the camera is\n scene.add(camera);\n camera.add(pointLight);\n}", "@autobind\n setup() {\n if ( !Detector.webgl ) {\n Detector.addGetWebGLMessage();\n return false;\n }\n\n this.renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });\n this.renderer.setClearColor( 0x222d33, 1 );\n\n if ( this.renderer.extensions.get( 'ANGLE_instanced_arrays' ) === false ) {\n document.getElementById( \"notSupported\" ).style.display = \"\";\n return false;\n }\n\n this.container = document.querySelector( '.js-visuals' );\n\n this.camera = new THREE.PerspectiveCamera(90, this.windowWidth / this.windowHeight, 1, 1500000 );\n this.cameraTarget = new THREE.Object3D();\n\n this.camera.position.z = 1000;\n\n this.scene = new THREE.Scene();\n\n this.scene.add(this.cameraTarget)\n\n\n this.geometry = new THREE.InstancedBufferGeometry();\n this.geometry.copy( new THREE.CircleBufferGeometry( 1, 6 ) );\n\n this.geometry2 = new THREE.InstancedBufferGeometry();\n this.geometry2.copy( new THREE.CircleBufferGeometry( 1, 6 ) );\n\n this.geometry.addAttribute( \"opacity\", new THREE.InstancedBufferAttribute( this.opacityArray, 1, 1 ).setDynamic( true ) );\n this.geometry.addAttribute( \"scale\", new THREE.InstancedBufferAttribute( this.scaleArray, 1, 1 ).setDynamic( true ) );\n this.geometry.addAttribute( \"attracttarget\", new THREE.InstancedBufferAttribute( this.attractTargetArray, 1, 1 ).setDynamic( true ) );\n this.geometry.addAttribute( \"mode\", new THREE.InstancedBufferAttribute( this.modesArray, 1, 1 ).setDynamic( true ));\n this.geometry.addAttribute( \"time\", new THREE.InstancedBufferAttribute( this.timesArray, 1, 1 ).setDynamic( true ));\n\n this.geometry2.addAttribute( \"opacity\", new THREE.InstancedBufferAttribute( this.opacityArray2, 1, 1 ).setDynamic( true ) );\n this.geometry2.addAttribute( \"scale\", new THREE.InstancedBufferAttribute( this.scaleArray2, 1, 1 ).setDynamic( true ) );\n this.geometry2.addAttribute( \"attracttarget\", new THREE.InstancedBufferAttribute( this.attractTargetArray2, 1, 1 ).setDynamic( true ) );\n this.geometry2.addAttribute( \"mode\", new THREE.InstancedBufferAttribute( this.modesArray2, 1, 1 ).setDynamic( true ));\n this.geometry2.addAttribute( \"time\", new THREE.InstancedBufferAttribute( this.timesArray2, 1, 1 ).setDynamic( true ));\n\n this.scales = this.geometry.getAttribute( 'scale' );\n this.scalesArray = this.scales.array;\n\n this.modes = this.geometry.getAttribute ( 'mode' );\n this.modesArray = this.modes.array;\n\n this.times = this.geometry.getAttribute ( 'time' );\n this.timesArray = this.times.array;\n\n\n this.scales2 = this.geometry2.getAttribute( 'scale' );\n this.scalesArray2 = this.scales2.array;\n\n this.modes2 = this.geometry2.getAttribute ( 'mode' );\n this.modesArray2 = this.modes2.array;\n\n this.times2 = this.geometry2.getAttribute ( 'time' );\n this.timesArray2 = this.times2.array;\n\n\n /*\n * This loop created 4 groups of particles aranched into irregular cubes based on the parX, parY and parZ values\n * using space as the distance between each other and place in the stack buffer\n */\n\n for (var i = 0, i3 = 0, l = this.particleCount2; i < l; i++, i3 += 3) {\n this.scalesArray2[ i ] = 0;//0; //set initial scale\n this.opacityArray2[ i ] = 1;\n\n this.massArray2[ i ] = 0.5 + (Math.random()*50);\n\n this.attractTargetArray2[ i ] = 0;\n\n this.velocityArray2[ i3 + 0 ] = 0;\n this.velocityArray2[ i3 + 1 ] = 0;\n this.velocityArray2[ i3 + 2 ] = 0;\n\n this.accelerationArray2[ i3 + 0 ] = 0;\n this.accelerationArray2[ i3 + 1 ] = 0;\n this.accelerationArray2[ i3 + 2 ] = 0;\n\n this.modesArray2[ i ] = 1;\n\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][0].length);\n this.colorsArray2[ i3 + 0 ] = this.colors[this.colorSet][0][this.a][0];\n this.colorsArray2[ i3 + 1 ] = this.colors[this.colorSet][0][this.a][1];\n this.colorsArray2[ i3 + 2 ] = this.colors[this.colorSet][0][this.a][2];\n\n this.xx = i;\n\n this.stackArray2[ i3 + 0 ] = this.xx * this.space;\n this.stackArray2[ i3 + 1 ] = 0;\n this.stackArray2[ i3 + 2 ] = 0;\n\n this.translateArray2 [ i3 + 0 ] = this.stackArray2[ i3 + 0 ];\n this.translateArray2 [ i3 + 1 ] = this.stackArray2[ i3 + 1 ];\n this.translateArray2 [ i3 + 2 ] = this.stackArray2[ i3 + 2 ];\n\n }\n\n this.geometry2.addAttribute( \"stack\", new THREE.InstancedBufferAttribute( this.stackArray2, 3, 1 ) );\n this.geometry2.addAttribute( \"attractTarget\", new THREE.InstancedBufferAttribute( this.attractTarget2, 3, 1 ) );\n this.geometry2.addAttribute( \"target\", new THREE.InstancedBufferAttribute( this.targetArray2, 3, 1 ).setDynamic( true ) );\n\n this.geometry2.addAttribute( \"translate\", new THREE.InstancedBufferAttribute( this.translateArray2, 3, 1 ).setDynamic( true ) );\n this.geometry2.addAttribute( \"color\", new THREE.InstancedBufferAttribute( this.colorsArray2, 3, 1 ).setDynamic( true ) );\n this.geometry2.addAttribute( \"colortarget\", new THREE.InstancedBufferAttribute( this.colorsArray2, 3, 1 ).setDynamic( true ) );\n this.geometry2.addAttribute( \"colorStart\", new THREE.InstancedBufferAttribute( this.colorsArray2, 3, 1 ) );\n\n\n for (var i = 0, i3 = 0, l = this.particleCount; i < l; i ++, i3 += 3 ) {\n\n this.scalesArray[ i ] = 0;\n this.opacityArray[ i ] = 1;\n\n this.massArray[ i ] = 0.5 + (Math.random()*50);\n\n this.attractTargetArray[ i ] = 0;\n\n this.velocityArray[ i3 + 0 ] = 0;\n this.velocityArray[ i3 + 1 ] = 0;\n this.velocityArray[ i3 + 2 ] = 0;\n\n this.accelerationArray[ i3 + 0 ] = 0;\n this.accelerationArray[ i3 + 1 ] = 0;\n this.accelerationArray[ i3 + 2 ] = 0;\n this.modesArray[ i ] = 1;\n\n if( i / l < 0.25 ) { //reds\n\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][0].length);\n this.colorsArray[ i3 + 0 ] = this.colors[this.colorSet][0][this.a][0];\n this.colorsArray[ i3 + 1 ] = this.colors[this.colorSet][0][this.a][1];\n this.colorsArray[ i3 + 2 ] = this.colors[this.colorSet][0][this.a][2];\n\n this.ti = i;\n\n this.xx = this.ti % (this.parX);\n this.yy = this.yinc;\n\n if (this.xx === this.parX - 1) {\n this.yinc++;\n }\n\n this.zz = this.zinc;\n\n if (this.yy === this.parY - 1 && this.xx == this.parX-1) {\n this.zinc++;\n }\n\n if (this.ti % (this.parX * this.parY) === 0) {\n this.yinc = 0;\n }\n\n this.stackArray[ i3 + 0 ] = (-1 * this.space * this.parX * 2) + this.xx * this.space;\n this.stackArray[ i3 + 1 ] = (this.space * this.yy) - (this.space * this.parY) * 0.5;\n this.stackArray[ i3 + 2 ] = (this.space * this.zz) - (this.space * this.parZ) * 0.5;\n\n } else if ( i / l < 0.5 ) { //greens\n\n if (i / l === 0.25) {\n this.yinc = 0;\n this.zinc = 0;\n }\n\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][1].length);\n this.colorsArray[ i3 + 0 ] = this.colors[this.colorSet][1][this.a][0];\n this.colorsArray[ i3 + 1 ] = this.colors[this.colorSet][1][this.a][1];\n this.colorsArray[ i3 + 2 ] = this.colors[this.colorSet][1][this.a][2];\n\n this.ti = i - (l * 0.25);\n\n this.xx = this.ti % (this.parX);\n this.yy = this.yinc;\n\n if (this.xx === this.parX - 1) {\n this.yinc++;\n }\n\n this.zz = this.zinc;\n\n if (this.yy === this.parY - 1 && this.xx == this.parX - 1) {\n this.zinc++;\n }\n\n if (this.ti % (this.parX*this.parY) === 0) {\n this.yinc = 0;\n }\n\n this.stackArray[ i3 + 0 ] = (-1 * this.space * this.parX) + (this.xx) * this.space;\n this.stackArray[ i3 + 1 ] = (this.space * this.yy) - (this.space * this.parY) * 0.5;\n this.stackArray[ i3 + 2 ] = (this.space * this.zz) - (this.space * this.parZ) * 0.5;\n\n } else if (i / l < 0.75 ) { //blue\n\n if (i / l === 0.5) {\n this.yinc = 0;\n this.zinc = 0;\n }\n\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][2].length);\n this.colorsArray[ i3 + 0 ] = this.colors[this.colorSet][2][this.a][0];\n this.colorsArray[ i3 + 1 ] = this.colors[this.colorSet][2][this.a][1];\n this.colorsArray[ i3 + 2 ] = this.colors[this.colorSet][2][this.a][2];\n\n this.ti = i - (l * 0.5);\n\n this.xx = this.ti % (this.parX);\n this.yy = this.yinc;\n\n if (this.xx === this.parX - 1) {\n this.yinc++;\n }\n\n this.zz = this.zinc;\n\n if (this.yy === this.parY - 1 && this.xx == this.parX-1) {\n this.zinc++;\n }\n\n if (this.ti % (this.parX * this.parY) === 0) {\n this.yinc = 0;\n }\n\n this.stackArray[ i3 + 0 ] = this.xx * this.space;\n this.stackArray[ i3 + 1 ] = (this.space * this.yy) - (this.space * this.parY)* 0.5;\n this.stackArray[ i3 + 2 ] = (this.space * this.zz) - (this.space * this.parZ) * 0.5;\n\n } else { //yellow\n\n if (i / l === 0.75) {\n this.yinc = 0;\n this.zinc = 0;\n }\n\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][3].length);\n this.colorsArray[ i3 + 0 ] = this.colors[this.colorSet][3][this.a][0];\n this.colorsArray[ i3 + 1 ] = this.colors[this.colorSet][3][this.a][1];\n this.colorsArray[ i3 + 2 ] = this.colors[this.colorSet][3][this.a][2];\n\n this.ti = i - (l * 0.75);\n\n this.xx = this.ti%(this.parX);\n this.yy = this.yinc;\n\n if (this.xx === this.parX - 1) {\n this.yinc++;\n }\n\n this.zz = this.zinc;\n\n if (this.yy === this.parY - 1 && this.xx == this.parX - 1) {\n this.zinc++;\n }\n\n if (this.ti % (this.parX * this.parY) === 0) {\n this.yinc = 0;\n }\n\n this.stackArray[ i3 + 0 ] = (this.space * this.parX) + (this.xx) * this.space;\n this.stackArray[ i3 + 1 ] = (this.space * this.yy) - (this.space * this.parY)*0.5;\n this.stackArray[ i3 + 2 ] = (this.space * this.zz) - (this.space * this.parZ)*0.5;\n }\n this.colorsTargetArray[i3 + 0] = this.colorsArray[i3 + 0];\n this.colorsTargetArray[i3 + 1] = this.colorsArray[i3 + 1];\n this.colorsTargetArray[i3 + 2] = this.colorsArray[i3 + 2];\n\n this.translateArray [ i3 + 0 ] = this.stackArray[ i3 + 0 ];\n this.translateArray [ i3 + 1 ] = this.stackArray[ i3 + 1 ];\n this.translateArray [ i3 + 2 ] = this.stackArray[ i3 + 2 ];\n }\n\n this.geometry.addAttribute( \"stack\", new THREE.InstancedBufferAttribute( this.stackArray, 3, 1 ) );\n\n this.geometry.addAttribute( \"shufflestack\", new THREE.InstancedBufferAttribute( this.shuffledStackArray, 3, 1 ));\n\n this.geometry.addAttribute( \"attractTarget\", new THREE.InstancedBufferAttribute( this.attractTarget, 3, 1 ) );\n this.geometry.addAttribute( \"target\", new THREE.InstancedBufferAttribute( this.targetArray, 3, 1 ).setDynamic( true ) );\n\n this.geometry.addAttribute( \"translate\", new THREE.InstancedBufferAttribute( this.translateArray, 3, 1 ).setDynamic( true ) );\n this.geometry.addAttribute( \"velocity\", new THREE.InstancedBufferAttribute( this.velocityArray, 3, 1 ));\n this.geometry.addAttribute( \"color\", new THREE.InstancedBufferAttribute( this.colorsArray, 3, 1 ).setDynamic( true ) );\n this.geometry.addAttribute( \"colortarget\", new THREE.InstancedBufferAttribute( this.colorsArray, 3, 1 ).setDynamic( true ) );\n this.geometry.addAttribute( \"colorStart\", new THREE.InstancedBufferAttribute( this.colorsArray, 3, 1 ) );\n\n this.material = this.material2 = new THREE.RawShaderMaterial( {\n uniforms: {\n map: { type: \"t\", value: THREE.ImageUtils.loadTexture( \"viz/textures/sprites/circleFlat2.png\" ) },\n //map: { type: \"t\", value: THREE.ImageUtils.loadTexture( \"viz/textures/sprites/circle.png\" ) },\n time: { type: \"f\", value: 0.0},\n mode: { type: \"f\", value: 0.0},\n colortime: { type: \"f\", value: 0.0}\n },\n vertexShader: this.vs,\n fragmentShader: this.fs,\n transparent: true,\n depthTest: true,\n depthWrite: true\n } );\n\n this.material.uniforms[ 'colortime' ].value = 1;\n this.material2.uniforms[ 'colortime' ].value = 1;\n\n this.material.uniforms[ 'mode' ].value = 3.0; // question display\n this.material2.uniforms[ 'mode' ].value = 1.0;\n\n this.mesh2 = new THREE.Mesh( this.geometry2, this.material2 );\n this.mesh2.scale.set( 500, 500, 500 );\n\n this.scene.add( this.mesh2 );\n this.mesh2.position.z = -100;\n\n this.initShuffleIndexes();\n\n this.mesh = new THREE.Mesh( this.geometry, this.material );\n\n this.mesh.scale.set( 500, 500, 500 );\n this.mesh.matrixAutoUpdate = true;\n\n this.scene.add( this.mesh );\n\n this.renderer.setPixelRatio( window.devicePixelRatio );\n this.renderer.setSize( this.windowWidth, this.windowHeight );\n this.container.appendChild( this.renderer.domElement );\n\n this.overlay = document.createElement(\"div\");\n this.overlay.classList.add(\"viz-overlay\");\n this.overlay.classList.add(\"js-viz-overlay\");\n this.container.appendChild( this.overlay );\n\n this.composer = new THREE.EffectComposer( this.renderer );\n this.composer.addPass( new THREE.RenderPass( this.scene, this.camera ) );\n\n this.effect = new THREE.ShaderPass ( THREE.FXAAShader );\n this.effect.enabled = true;\n this.effect.uniforms.resolution.value = new THREE.Vector2(1 / this.windowWidth, 1 / this.windowHeight);\n this.composer.addPass(this.effect);\n\n\n var effectCopy = new THREE.ShaderPass(THREE.CopyShader);\n effectCopy.renderToScreen = true;\n this.composer.addPass (effectCopy);\n\n //Uncomment this to view stats again.\n // this.stats = new Stats();\n // this.stats.domElement.style.position = 'absolute';\n // this.stats.domElement.style.top = '0px';\n // this.container.appendChild( this.stats.domElement );\n\n this.triggerIntroEffect(\"blue\");\n\n this.translates = this.geometry.getAttribute( 'translate' );\n this.translatesArray = this.translates.array;\n\n this.scales = this.geometry.getAttribute( 'scale' );\n this.scalesArray = this.scales.array;\n\n this.colorsAttr = this.geometry.getAttribute( 'color' );\n this.colorsArray = this.colorsAttr.array;\n\n this.colorTargets = this.geometry.getAttribute( 'colortarget' );\n this.colorTargetsArray = this.colorTargets.array;\n\n this.opacitys = this.geometry.getAttribute( 'opacity' );\n this.opacityArray = this.opacitys.array;\n\n this.translates2 = this.geometry2.getAttribute( 'translate' );\n this.translatesArray2 = this.translates2.array;\n\n this.scales2 = this.geometry2.getAttribute( 'scale' );\n this.scalesArray2 = this.scales2.array;\n\n this.colors2 = this.geometry2.getAttribute( 'color' );\n this.colorsArray2 = this.colors2.array;\n\n this.opacitys2 = this.geometry2.getAttribute( 'opacity' );\n this.opacityArray2 = this.opacitys2.array;\n\n window.addEventListener( 'resize', this.onWindowResize, false );\n\n this.animate();\n return true;\n }", "function showSphereLighted(model) {\n //code from http://learningwebgl.com/cookbook/index.php/How_to_draw_a_sphere & http://learningwebgl.com/blog/?p=1253\n const latitudeBands = 30;\n const longitudeBands = 30;\n const radius = 100;\n\n const vertexPositionData = [];\n const normalData = [];\n const textureCoordData = [];\n\n for (let latNumber = 0; latNumber <= latitudeBands; latNumber++) {\n const theta = latNumber * Math.PI / latitudeBands;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n\n for (let longNumber = 0; longNumber <= longitudeBands; longNumber++) {\n const phi = longNumber * 2 * Math.PI / longitudeBands;\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const x = cosPhi * sinTheta;\n const y = cosTheta;\n const z = sinPhi * sinTheta;\n const u = 1 - (longNumber / longitudeBands);\n const v = latNumber / latitudeBands;\n\n normalData.push(x);\n normalData.push(-y); //y-inversion\n normalData.push(z);\n\n textureCoordData.push(u);\n textureCoordData.push(1. - v); //y-inversion\n\n vertexPositionData.push(radius * x);\n vertexPositionData.push(- radius * y); //y-inversion\n vertexPositionData.push(radius * z);\n }\n }\n\n const indexData = [];\n\n for (let latNumber = 0; latNumber < latitudeBands; latNumber++) {\n for (let longNumber = 0; longNumber < longitudeBands; longNumber++) {\n const first = (latNumber * (longitudeBands + 1)) + longNumber;\n const second = first + longitudeBands + 1;\n\n indexData.push(first);\n indexData.push(second);\n indexData.push(first + 1);\n\n indexData.push(second);\n indexData.push(second + 1);\n indexData.push(first + 1);\n }\n }\n\n //setup model\n model.vertices(vertexPositionData);\n model.indices(indexData);\n model.normals(normalData);\n model.uvs(textureCoordData);\n\n const w = 2 * radius;\n const h = w;\n\n model.x(w).y(h);\n\n //texture (http://planetpixelemporium.com/earth.html)\n model.src(path.join(__dirname, 'sphere/moonmap1k.jpg'));\n //model.src(path.join(__dirname, 'sphere/earthmap1k.jpg'));\n\n //animate\n model.rx.anim().from(0).to(360).dur(5000).loop(-1).start();\n model.ry.anim().from(0).to(360).dur(5000).loop(-1).start();\n}", "async function setup()\n{\n camera = new THREE.PerspectiveCamera( 55, window.innerWidth / window.innerHeight, 45, 30000 );\n camera.position.set( -900, 300, 0 );\n\n infos = document.getElementById(\"info\");\n canvas = document.getElementById(\"canvas\");\n\n renderer = new THREE.WebGLRenderer({ canvas:canvas, precision: \"mediump\", antialias:antialias });\n renderer.setSize( window.innerWidth, window.innerHeight );\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.type = THREE.PCFShadowMap;\n renderer.outputEncoding = THREE.sRGBEncoding;\n\n controls = new OrbitControls( camera, canvas );\n controls.update();\n controls.maxDistance = 300;\n\n light = lightSetup();\n\n scene = new THREE.Scene();\n scene.add(new THREE.AmbientLight(0x3D4143));\n scene.add(light);\n createSkyBox(scene);\n\n var oimoObj = oimoObjects(); world = oimoObj[0]; box = oimoObj[1]; sphere = oimoObj[2];\n bodys.push(box);\n bodys.push(sphere);\n \n CamTarget = new THREE.Vector3(sphere.position.x, sphere.position.y, sphere.position.z);\n\n geos['sphere'] = new THREE.BufferGeometry().fromGeometry( new THREE.SphereGeometry(20,30,10));\n geos['box'] = new THREE.BufferGeometry().fromGeometry( new THREE.BoxGeometry(1000,1,1000));\n mats['sph'] = new THREE[materialType]( {shininess: 10, map: basicTexture(0), name:'sph' } );\n mats['box'] = new THREE[materialType]( {shininess: 10, map: basicTexture(2), name:'box' } );\n\n meshes = await createGroundMesh(scene);\n let ground = meshes[0];\n ground.position.set(0,0,0);\n ground.scale.set(125,1,125);\n console.log(\"GROUND:\", ground);\n var bbox = new THREE.Box3().setFromObject(ground.children[0]);\n console.log(bbox);\n var size = bbox.getSize(new THREE.Vector3());\n console.log(size);\n meshes.push (new THREE.Mesh( geos.sphere, mats.sph ));\n\n meshes[1].position.set(0,50,0);\n meshes[0].receiveShadow = true;\n meshes[0].castShadow = true;\n meshes[1].receiveShadow = true;\n meshes[1].castShadow = true;\n\n scene.add( meshes[1]);\n scene.add(meshes[0]);\n\n movingGroup.add(ground);\n console.log(\"GROUP\",movingGroup);\n var retVal = createBananaArray(scene,movingGroup);\n bananaArray = retVal[0];\n BananaCoords = retVal[1];\n scene.add(movingGroup);\n console.log(\"GROUP\",movingGroup);\n console.log(\"BANANA ARRAY: \", bananaArray);\n\n window.addEventListener( 'resize', onWindowResize, false );\n\n GamepadSetup();\n\n loop();\n}", "function skybox(){\r\n\tvar materialArray = [];\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_px.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_nx.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_py.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_ny.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_pz.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_nz.jpg' ) }));\r\n\r\n\tfor (var i = 0; i < 6; i++) \r\n\t materialArray[i].side = THREE.BackSide;\r\n\r\n\tvar skyboxMaterial = new THREE.MeshFaceMaterial( materialArray );\r\n\tvar skyboxGeom = new THREE.CubeGeometry( 500, 500, 500);\r\n\tvar skybox = new THREE.Mesh( skyboxGeom, skyboxMaterial );\r\n\tscene.add( skybox );\r\n}", "function drawSpheres() {\n \"use strict\";\n var cuboids = new THREE.Group();\n\n var geometry = new THREE.SphereBufferGeometry(GRID_WIDTH / 2);\n geometry.addAttribute('lightPos', POINT_LIGHT_POSITIONS.GPUBuffer);\n var gridPosition = new GridPosition(0,0,0);\n SPHERES_POSITIONS.forEach(function(item) {\n var material;\n // The color attribute of the material must be assigned in the constructor parameters.\n switch (shadingMethod) {\n case GOURAUD_SHADING:\n material = new THREE.MeshLambertMaterial({color: getRandColor(), side: THREE.FrontSide});\n break;\n case PHONG_SHADING:\n material = chooseShading();\n break;\n }\n var cuboid = new THREE.Mesh(geometry, material);\n cuboid.position.copy(gridPosition.setPosition(item[0], item[1], item[2]).getVector3());\n cuboid.matrixAutoUpdate = true;\n cuboids.add(cuboid);\n });\n\n scene.add(cuboids);\n}", "function setupSkyboxBuffers(){\n //Generate the vertex positions \n loadVertices()\n\n //Generate the vertex Textures\n loadTextures()\n}", "function onUpdate(framework) {\n // icoshMaterial.uniforms.Red.value=r;\n // icoshMaterial.uniforms.Green.value=g;\n // icoshMaterial.uniforms.Blue.value=b;\n\n oldt=newt;\n newt=performance.now(); // measures time since the beginning of execution\n time+=(newt-oldt);\n\n // icoshMaterial.uniforms.data.value=Int32Array.from(framework.data); // typed arrays casting\n // icoshMaterial.uniforms.time.value=time/4000; // control the speed of cloud movement\n/* ////// ANIMATION FOR POINT CLOUD VISUALIZER : SINE AND DISPLACEMENT\n /// NEW\n for(var i=0; i<geometry.vertices.length;i++)\n {\n\t\tvar dX, dY, dZ;\n\t\t//dX = Math.random() - 0.5;\n\t\t//dY = Math.random() - 0.5;\n\t\t//dZ = Math.random() - 0.5;\n\t\tvar s = 1;//2*Math.sin(vertList[i].z/20+time/2000);\n\t\tdX = vertList[i].x + 0;\n\t\tdZ = vertList[i].z + 0;\n\t\tdY = vertList[i].y\n\t\t\t+ 10 * s * (framework.data[i%100]/2+framework.data[(i-1)%100]/4+framework.data[(i+1)%100]/4)/255.0\n\t\t\t+ 2 * s;\n\t\t//\t+ s * Math.random()/2 - 0.25;\n\n\t\t//var col = Math.abs(vertList[i].x*vertList[i].z);\n\t\tif(dY>0)\n\t\t\tgeometry.colors[i] = new THREE.Color(vertList[i].y,vertList[i].y,vertList[i].y);//(Math.random(), Math.random(), Math.random());\n\t\t//else\n\t\t\t//geometry.colors[i] = new THREE.Color(1,1,1);\n\n\t\t//var vert = new THREE.Vector3(dX,dY,dZ);\n\t\tgeometry.vertices[i] = new THREE.Vector3(dX,dY,dZ);\n }\n*/\n\n\tif(started===true && mmaker.on)\n\t{\n\t\tfor(var i=0; i<geometry.vertices.length;i++)\n\t {\n\t\t\tvar s = Math.sin(time/60);\n\n\t \t\tvar dX, dY, dZ;\n\t \t\tdX = vertList[i].x;\n\t \t\tdZ = vertList[i].z;\n\n\t\t\tif(i==(mmaker.currentNote+6*(mmaker.currentOctave-2)))\n\t \t\t\tdY = (vertList[i].y + 1);\n\t\t\telse\n\t\t\t\tdY = vertList[i].y * 0.5;\n\n\t\t\tdY = dY*s;\n\n\t\t\tif(dY>3.0)\n\t\t\t\tdY = 3.0;\n\n\t\t\tif(dY<0.001)\n\t\t\t\tdY=0;\n\n\t\t\tvertList[i] = new THREE.Vector3(dX,dY,dZ);\n\t \t\tgeometry.vertices[i] = new THREE.Vector3(dX,dY,dZ);\n\t }\n\t\tgeometry.verticesNeedUpdate = true;\n\t\tgeometry.colorsNeedUpdate = true;\n\t}\n\n}", "function generateScene() {\n var objects = [];\n \n var sphere1 = new Sphere(nextId++, 50);\n sphere1.translate(new THREE.Vector3(2, 5, -240));\n sphere1.setColor(new THREE.Color(1, 0, 0));\n \n var sphere2 = new Sphere(nextId++, 40);\n sphere2.translate(new THREE.Vector3(-65, -30, -300));\n sphere2.setColor(new THREE.Color(0, 0, 1));\n \n var floor = new Rectangle(nextId++, 400, -1600);\n floor.translate(new THREE.Vector3(-285, -80, 500));\n floor.setColor(new THREE.Color(0, 1, 0));\n \n var cube = new Cube(nextId++, new THREE.Vector3(-30, -30, 30), new THREE.Vector3(30, 30, -30));\n cube.scale(new THREE.Vector3(1.5, 1, 1));\n cube.rotate(new THREE.Euler(-Math.PI / 4, Math.PI / 4, 0, 'XYZ'));\n cube.translate(new THREE.Vector3(-70, 25, -370));\n cube.setColor(new THREE.Color(0.5, 0, 0.5));\n \n var cylinder = new Cylinder(nextId++, -30, 30, 30);\n cylinder.rotate(new THREE.Euler(-Math.PI / 3, 0, -Math.PI / 6, 'XYZ'));\n cylinder.translate(new THREE.Vector3(50, 70, -300));\n cylinder.setColor(new THREE.Color(0, 0.5, 0.5));\n \n var torus = new Torus(nextId++, 20, 10);\n torus.setColor(new THREE.Color(0.5, 0.5, 0));\n \n objects.push(sphere1);\n objects.push(sphere2);\n objects.push(floor);\n objects.push(cube);\n objects.push(cylinder);\n //objects.push(torus);\n \n return objects;\n}", "function drawSphere(radius, widthSegments, heightSegments, opacity, color, position){\n\tvar geometry = new THREE.SphereGeometry(radius, widthSegments, heightSegments, 0, 2.*Math.PI, 0, Math.PI)\n\tvar material = new THREE.MeshPhongMaterial( { \n\t\tcolor: color, \n\t\tflatShading: false, \n\t\ttransparent:true,\n\t\topacity:opacity, \n\t\t//shininess:50,\n\t});\n\n\tsphere = new THREE.Mesh( geometry, material );\n\tsphere.position.set(position.x, position.y, position.z)\n\t//update the vertices of the plane geometry so that I can check for the intersection -- not needed (and also breaks the sparse view)\n\t//https://stackoverflow.com/questions/23990354/how-to-update-vertices-geometry-after-rotate-or-move-object\n\t// sphere.updateMatrix();\n\t// sphere.geometry.applyMatrix( sphere.matrix );\n\t// sphere.matrix.identity();\n\t// sphere.position.set( 0, 0, 0 );\n\t// sphere.rotation.set( 0, 0, 0 );\n\t// sphere.scale.set( 1, 1, 1 );\n\n\tparams.scene.add( sphere );\n\t\n\treturn sphere;\n\n}", "constructor(params) {\n // times\n this.time = new THREE.Clock(true);\n this.timeNum = 1;\n this.timeScale = 0.8;\n \n // parameters\n this.sketch = params.sketch;\n this.position = new THREE.Vector3(params.position.x, params.position.y, params.position.z);\n this.size = params.size;\n this.dist = params.dist;\n this.index = params.index;\n this.shadow = params.shadow;\n this.geometry = params.geometry;\n this.material = params.material;\n this.others = params.others;\n\n this.initialize();\n }", "function init(){\n\t//basics\n\tscene = new THREE.Scene();\n\tcamera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.1, 1500 );\n\tcamera.position.set(0, 385, 400);\n\tlookAt = new THREE.Object3D();\n\tlookAt.position.set(0, 25, 0);\n\tcamera.lookAt( lookAt );\n\trenderer = new THREE.WebGLRenderer();\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n\tsetRenderSize();\n\tdocument.body.appendChild( renderer.domElement );\n\tmouse = new THREE.Vector2(0.0, 0.0);\n\trenderSize = new THREE.Vector2(0.0, 0.0);\n\ttime = 0.0;\n\t\n\t//DEBUG\n\t//controls\n\t//var controls = new THREE.OrbitControls( camera, renderer.domElement );\n\t\n\t//background\n\tbackgroundLoader = new THREE.TextureLoader();\n\tbackgroundLoader.setPath( 'textures/' );\n\tbackgroundTexture = backgroundLoader.load( 'background.png' );\n\tscene.background = backgroundTexture;\n\t\n\t//DEBUG\n\t//grid init\n\t/*\n\tgrid = [];\n\tgridGeometry = new THREE.BoxGeometry( 1000, 5, 5 );\n\tgridMaterial = new THREE.MeshBasicMaterial( {color: 0xffffff} );\n\tfor(var a = 0; a < 11; a++){\n\t\tgrid[a] = new THREE.Mesh( gridGeometry, gridMaterial);\n\t\tgrid[a].position.x = 0;\n\t\tgrid[a].position.y = 20;\n\t\tgrid[a].position.z = 500 - a * 100;\n\t\tscene.add(grid[a]);\n\t}\n\t//gridGeometry = new THREE.PlaneGeometry( 1, 250 );\n\tfor( var b = 11; b < 22; b++){\n\t\tgrid[b] = new THREE.Mesh( gridGeometry, gridMaterial);\n\t\tgrid[b].rotation.y = 1.57;\n\t\tgrid[b].position.x = 500 - (b-11)*100; //+ b * 25;\n\t\tgrid[b].position.y = 20;\n\t\tgrid[b].position.z = 0;\n\t\tscene.add(grid[b]);\t\n\t}\n\t*/\n\t\n\t//mover init\n\tmover = new THREE.Object3D();\n\tmover.position.set( 0, 0, 0 );\n\tpositions = {\n\t\tmoverPos: [\n\t\t\tnew THREE.Vector3( 0, 50, 0 ),\n\t\t\tnew THREE.Vector3( 260, 25, -120 ),\n\t\t\tnew THREE.Vector3( -200, 15, 0 )\n\t\t],\n\t\tcameraPos: [\n\t\t\tnew THREE.Vector3( 50, 200, 100 ),\n\t\t\tnew THREE.Vector3( 160, 225, -250 ),\n\t\t\tnew THREE.Vector3( -300, 75, 0 )\n\t\t],\n\t\ttotalStages: 3,\n\t\tcurrentStage: 0,\n\t};\n\t\n\tconsole.log(positions.moverPos.length);\n\t\n\tconsole.log(positions);\n\t\n\tconsole.log( positions.moverPos[0].distanceTo( positions.moverPos[1] ) );\n\t\t\n\t//rain init\n\trainCount = 10000;\n\trainMap = new THREE.TextureLoader().load( \"textures/spark1.png\" );\n\trainMaterial = new THREE.SpriteMaterial({map: rainMap, color: 0xffffff});\n\train = [];\n\tfor( var i = 0; i < rainCount; i++ ){\n\t\train[i] = new THREE.Sprite( rainMaterial );\n\t\train[i].scale.y = 10;\n\t\train[i].scale.x = 0.5\n\t\train[i].position.x = 1000 * Math.random() - 500;\n\t\train[i].position.y = window.innerHeight * Math.random() + 200;\n\t\train[i].position.z = 1000 * Math.random() - 500;\n\t\t//rain[i].position.z = (camera.position.z * 0.9) * Math.random( - camera.position.z/2);\n\t\train[i].originalY = rain[i].position.y;\n\t\tscene.add(rain[i]);\n\t\t//var loc = new THREE.Vector3( rain[i].position.x, rain[i].position.y, rain[i].position.z);\n\t\t//console.log(loc);\n\t}\n\t\n\t//city init\n\tvar city = [];\n\tvar cityLoader = [];\n\t\n\t//backend...\n\t//adjust this as necessary...\n\tfor(var k = 0; k < 4; k++){\n\t\tcity[k] = [];\n\t}\n\tcityLoader[0] = new THREE.OBJLoader();\n\tcityLoader[1] = new THREE.MTLLoader();\t\n\tcityLoader[2] = new THREE.TDSLoader();\n\tcityLoader[3] = new THREE.TextureLoader();\n\t//add more loaders here when necessary\n\t\n\t//[0]. bungalows\n\tcityLoader[1].load( \n\t\t'models/bungalow/bg4_obj.mtl',\n\t\tfunction( bungalowMat ){\n\t\t\t\n\t\t\tcityLoader[0].setMaterials( bungalowMat );\n\t\t\t//console.log(bungalowMat);\n\t\t\t\n\t\t\tcityLoader[0].load(\n\t\t\t\t'models/bungalow/bg4_obj.obj',\n\t\t\t\tfunction( bungalow ) {\n\t\t\t\t\t//DEBUG\n\t\t\t\t\t//bungalow.position.set( 300, 200, 300 );\n\t\t\t\t\t//scene.add(bungalow);\n\t\t\t\t\tfor(var j = 0; j < 50; j++){\n\t\t\t\t\t\t\n\t\t\t\t\t\tcity[0][j] = new THREE.Object3D();\n\t\t\t\t\t\tcity[0][j].copy( bungalow, true );\n\t\t\t\t\t\t\n\t\t\t\t\t\t//generate coordinates\n\t\t\t\t\t\tcity[0][j].genX = 300 * Math.random() + 50;\n\t\t\t\t\t\tif( Math.round( Math.random() ) ){\n\t\t\t\t\t\t\tcity[0][j].genX *= -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//console.log(city[0][j].genX);\n\t\t\t\t\t\tcity[0][j].genZ = 300 * Math.random() + 50;\n\t\t\t\t\t\tif( Math.round( Math.random() ) ){\n\t\t\t\t\t\t\tcity[0][j].genZ *= -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcity[0][j].position.set( city[0][j].genX, -6 * Math.random() - 2, city[0][j].genZ );\n\t\t\t\t\t\t\n\t\t\t\t\t\tcity[0][j].rotateX( 0.26166 * Math.random() );\n\t\t\t\t\t\tcity[0][j].rotateY( 3.14 * Math.random() );\n\t\t\t\t\t\tcity[0][j].rotateZ( 0.26166 * Math.random() );\n\t\t\t\t\t\t\n\t\t\t\t\t\tscene.add(city[0][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\t\n\t//[1]. skycraper #1\n\tcityLoader[1].load( \n\t\t'models/skyscraper1/skyscraper.mtl',\n\t\tfunction( s1Mat ){\n\t\t\t\n\t\t\tcityLoader[0].setMaterials( s1Mat );\n\t\t\t//console.log(s1Mat);\n\t\t\t\n\t\t\tcityLoader[0].load(\n\t\t\t\t'models/skyscraper1/skyscraper.obj',\n\t\t\t\tfunction( s1 ) {\n\t\t\t\t\tfor(var k = 0; k < 20; k++){\n\t\t\t\t\t\t\n\t\t\t\t\t\tcity[1][k] = new THREE.Object3D();\n\t\t\t\t\t\tcity[1][k].copy( s1, true );\n\t\t\t\t\t\t\n\t\t\t\t\t\t//generate coordinate\n\t\t\t\t\t\tcity[1][k].genX = 350 * Math.random() + 50;\n\t\t\t\t\t\tif( Math.round( Math.random() ) ){\n\t\t\t\t\t\t\tcity[1][k].genX *= -1;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcity[1][k].genZ = 350 * Math.random() + 50;\n\t\t\t\t\t\tif( Math.round( Math.random() ) ){\n\t\t\t\t\t\t\tcity[1][k].genZ *= -1;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcity[1][k].position.set( city[1][k].genX, -6 * Math.random() - 2, city[1][k].genZ );\n\t\t\t\t\t\t\n\t\t\t\t\t\tcity[1][k].rotateX( 0.26166 * Math.random() );\n\t\t\t\t\t\tcity[1][k].rotateY( 3.14 * Math.random() );\n\t\t\t\t\t\tcity[1][k].rotateZ( 0.26166 * Math.random() );\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar sky1Scale = 10 * Math.random() + 7;\n\t\t\t\t\t\tcity[1][k].scale.set( sky1Scale, sky1Scale, sky1Scale);\n\t\t\t\t\t\t\n\t\t\t\t\t\tscene.add(city[1][k]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t} \n\t);\n\t\n\t//[2]. skyscraper #2\n\tcityLoader[2].load(\n\t\t'models/skyscraper2/SkyA.3DS',\n\t\tfunction( s2 ){\n\t\t\ts2.scale.set( 0.3, 0.3, 0.3 );\n\t\t\ts2.rotateX(-1.57);\n\t\t\tscene.add(s2);\n\t\t}\n\t);\n\t\n\t//Water init\n\tinitWater(renderer, scene, camera);\n\t\n\t//Glboal Lights\n\tlight = new THREE.PointLight( 0xffffff, 1, 0, 2);\n\tlight.position.set( 0, 500, 100);\n\tscene.add( light );\n\t\n\t//listener events\n\tdocument.addEventListener(\"mousemove\", onMouseMove, false);\n\twindow.addEventListener(\"resize\", onWindowResize, false);\t\n\t\n\t//DEBUG\n\tdocument.addEventListener(\"keydown\", onKey, false);\n\t\n\tPace.on( 'done', function(){\n\t\tPace.stop;\n\t\trender();\n\t\t//\n\t\tconsole.log(\"loaded\");\n\t});\n}", "constructor (scene, params, meta) {\n /** HEDRON TIP **\n Must define a \"root\" property as a THREE.Group or THREE.Object3D\n Hedron looks for this and will add it to the scene.\n **/\n this.root = new THREE.Group()\n\n /** HEDRON TIP **\n It's good practice to not manipulate the root object\n so we create another group and add it to the root.\n This isn't required and the name isn't important.\n **/\n this.group = new THREE.Group()\n this.root.add(this.group)\n\n // Empty array to be populated with meshes\n this.meshes = []\n\n // Defining a single material for all the polyhedra\n const mat = new THREE.MeshBasicMaterial(\n { wireframe: true, color: 0xffffff }\n )\n const size = 1\n\n // Array geometries (the platonic solids!)\n const geoms = [\n new THREE.IcosahedronGeometry(size),\n new THREE.BoxGeometry(size, size, size),\n new THREE.OctahedronGeometry(size),\n new THREE.TetrahedronGeometry(size),\n new THREE.DodecahedronGeometry(size),\n ]\n\n // Loop through meshes\n geoms.forEach(geom => {\n // Create a mesh for each solid\n const mesh = new THREE.Mesh(geom, mat)\n // Add to array\n this.meshes.push(mesh)\n // Add to scene\n this.group.add(mesh)\n })\n\n // Update the shape based on params\n this._updateShape(params.meshIndex)\n }", "function setup()\n{\n\tthis.center = null;\n\tloadShader(\"wave\");\n}", "constructor( max_subdivisions ) // unit sphere) and group them into triangles by following the predictable pattern of the recursion.\r\n { super( \"positions\", \"normals\", \"texture_coords\" ); // Start from the following equilateral tetrahedron:\r\n this.positions.push( ...Vec.cast( [ 0, 0, -1 ], [ 0, .9428, .3333 ], [ -.8165, -.4714, .3333 ], [ .8165, -.4714, .3333 ] ) );\r\n \r\n this.subdivideTriangle( 0, 1, 2, max_subdivisions); // Begin recursion.\r\n this.subdivideTriangle( 3, 2, 1, max_subdivisions);\r\n this.subdivideTriangle( 1, 0, 3, max_subdivisions);\r\n this.subdivideTriangle( 0, 2, 3, max_subdivisions); \r\n \r\n for( let p of this.positions )\r\n { this.normals.push( p.copy() ); // Each point has a normal vector that simply goes to the point from the origin.\r\n\r\n // Textures are tricky. A Subdivision sphere has no straight seams to which image \r\n // edges in UV space can be mapped. The only way to avoid artifacts is to smoothly \r\n this.texture_coords.push( // wrap & unwrap the image in reverse - displaying the texture twice on the sphere.\r\n Vec.of( Math.asin( p[0]/Math.PI ) + .5, Math.asin( p[1]/Math.PI ) + .5 ) ) }\r\n }", "function createSphere(gl){\n var SPHERE_DIV = 15;\n\n var i, ai, si, ci;\n var j, aj, sj, cj;\n var p1, p2;\n\n var vertices = [];\n var indices = [];\n\n // Generate coordinates\n for (j = 0; j <= SPHERE_DIV; j++) {\n aj = j * Math.PI / SPHERE_DIV;\n sj = Math.sin(aj);\n cj = Math.cos(aj);\n for (i = 0; i <= SPHERE_DIV; i++) {\n ai = i * 2 * Math.PI / SPHERE_DIV;\n si = Math.sin(ai);\n ci = Math.cos(ai);\n\n vertices.push(si * sj); // X\n vertices.push(cj); // Y\n vertices.push(ci * sj); // Z\n }\n }\n\n // Generate indices\n for (j = 0; j < SPHERE_DIV; j++) {\n for (i = 0; i < SPHERE_DIV; i++) {\n p1 = j * (SPHERE_DIV+1) + i;\n p2 = p1 + (SPHERE_DIV+1);\n\n indices.push(p1);\n indices.push(p2);\n indices.push(p1 + 1);\n\n indices.push(p1 + 1);\n indices.push(p2);\n indices.push(p2 + 1);\n }\n }\n\n var s = []; // Utilize Object object to return multiple buffer objects together\n // Write vertex information to buffer object\n s.isTexture=false;\n s.vertexBuffer = initArrayBufferForLaterUse(gl, new Float32Array(vertices), 3, gl.FLOAT);\n s.normalBuffer = initArrayBufferForLaterUse(gl, new Float32Array(vertices), 3, gl.FLOAT);\n s.indexBuffer = initElementArrayBufferForLaterUse(gl, new Uint8Array(indices), gl.UNSIGNED_BYTE);\n if (!s.vertexBuffer || !s.normalBuffer || !s.indexBuffer) return null;\n\n s.num_vertices = indices.length;\n s.drawtype = gl.TRIANGLES;\n\n return s;\n}", "function triangleSphere(a, b, c) {\n\n var t1 = subtract(b, a);\n var t2 = subtract(c, a);\n var normal = cross(t2, t1);\n normal = vec3(normal);\n //normal = vec3(1, 1, 1);\n\n points.push(a);\n points.push(b);\n points.push(c);\n normalsArray.push(normal);\n normalsArray.push(normal);\n normalsArray.push(normal);\n\n if (ghost % 3 == 2) {\n \n texCoordsArray.push(texCoord[0]);\n texCoordsArray.push(texCoord[1]);\n texCoordsArray.push(texCoord[2]);\n\n } else {\n\n texCoordsArray.push(texCoord[0]);\n texCoordsArray.push(texCoord[2]);\n texCoordsArray.push(texCoord[3]);\n\n }\n\n indexSphere += 3;\n ghost++;\n\n}", "function initSceneData() {\r\n\r\n // scene/demo-specific three.js objects setup goes here\r\n EPS_intersect = mouseControl ? 0.01 : 1.0; // less precision on mobile\r\n\r\n /* Boxes that needed by the pathTracingScene */\r\n tallBoxGeometry = new THREE.BoxGeometry(1, 1, 1);\r\n tallBoxMaterial = new THREE.MeshPhysicalMaterial({\r\n color: new THREE.Color(0.95, 0.95, 0.95), roughness: 1.0\r\n });\r\n tallBoxMesh = new THREE.Mesh(tallBoxGeometry, tallBoxMaterial);\r\n pathTracingScene.add(tallBoxMesh);\r\n tallBoxMesh.visible = true;\r\n tallBoxMesh.rotation.set(0, Math.PI * 0.1, 0);\r\n tallBoxMesh.position.set(180, 170, -350);\r\n tallBoxMesh.updateMatrixWorld(true);\r\n\r\n shortBoxGeometry = new THREE.BoxGeometry(1, 1, 1);\r\n shortBoxMaterial = new THREE.MeshPhysicalMaterial({\r\n color: new THREE.Color(0.95, 0.95, 0.95), roughness: 1.0\r\n });\r\n shortBoxMesh = new THREE.Mesh(shortBoxGeometry, shortBoxMaterial);\r\n pathTracingScene.add(shortBoxMesh);\r\n shortBoxMesh.visible = false;\r\n shortBoxMesh.rotation.set(0, -Math.PI * 0.09, 0);\r\n shortBoxMesh.position.set(0, 300, -2500);\r\n shortBoxMesh.updateMatrixWorld(true);\r\n \r\n ceilBoxGeometry = new THREE.BoxGeometry(2000, 20, 2900);\r\n ceilBoxMaterial = new THREE.MeshPhysicalMaterial({\r\n color: new THREE.Color(0.95, 0.95, 0.95), roughness: 1.0\r\n });\r\n ceilBoxMesh = new THREE.Mesh(ceilBoxGeometry, ceilBoxMaterial);\r\n pathTracingScene.add(ceilBoxMesh);\r\n ceilBoxMesh.visible = false;\r\n ceilBoxMesh.position.set(0, 500, -3100 * 0.5);\r\n ceilBoxMesh.rotation.set(0, 0, 0);\r\n ceilBoxMesh.updateMatrixWorld(true);\r\n\r\n // set camera's field of view\r\n worldCamera.fov = 60;\r\n focusDistance = 1180.0;\r\n\r\n // position and orient camera\r\n cameraControlsObject.position.set(278, 270, 1050);\r\n ///cameraControlsYawObject.rotation.y = 0.0;\r\n // look slightly upward\r\n cameraControlsPitchObject.rotation.x = 0.005;\r\n\r\n PerlinNoiseTexture = new THREE.TextureLoader().load('textures/perlin256.png');\r\n PerlinNoiseTexture.wrapS = THREE.RepeatWrapping;\r\n PerlinNoiseTexture.wrapT = THREE.RepeatWrapping;\r\n PerlinNoiseTexture.flipY = false;\r\n PerlinNoiseTexture.minFilter = THREE.LinearFilter;\r\n PerlinNoiseTexture.magFilter = THREE.LinearFilter;\r\n PerlinNoiseTexture.generateMipmaps = false;\r\n\r\n} // end function initSceneData()", "initializeCableSleeves() {\n this.torsoFrameCableOutput = new THREE.Object3D();\n this.torsoFrameCableOutput.position.set(0.0, 0.386, -0.102);\n this.torsoFrame.add(this.torsoFrameCableOutput);\n\n this.headFrameCableInput = new THREE.Object3D();\n this.headFrameCableInput.position.set(0.0, 0.058, -0.095);\n this.headFrame.add(this.headFrameCableInput);\n\n this.torsoFrameToHeadFrameSleeveSegments = 10;\n\n this.torsoFrameToHeadFrameCableGeometry = new THREE.TubeBufferGeometry(this.getTorsoFrameToHeadFrameCableCurve(), this.torsoFrameToHeadFrameSleeveSegments, 0.01, 5);\n this.torsoFrameToHeadFrameCableMesh = new THREE.Mesh(this.torsoFrameToHeadFrameCableGeometry, this.cableSleeveMaterial);\n this.torsoFrame.add(this.torsoFrameToHeadFrameCableMesh);\n this.selfMeshes.push(this.torsoFrameToHeadFrameCableMesh);\n\n\n\n this.torsoFrameCableInputL = new THREE.Object3D();\n this.torsoFrameCableInputL.position.set(0.04, 0.139, -0.128);\n this.torsoFrame.add(this.torsoFrameCableInputL);\n\n this.torsoFrameCableInputR = new THREE.Object3D();\n this.torsoFrameCableInputR.position.set(-0.04, 0.139, -0.128);\n this.torsoFrame.add(this.torsoFrameCableInputR);\n\n this.bodyFrameCableOutputL = new THREE.Object3D();\n this.bodyFrameCableOutputL.position.set(0.083, 0.277, -0.119);\n this.bodyFrame.add(this.bodyFrameCableOutputL);\n\n this.bodyFrameCableOutputR = new THREE.Object3D();\n this.bodyFrameCableOutputR.position.set(-0.083, 0.277, -0.119);\n this.bodyFrame.add(this.bodyFrameCableOutputR);\n\n this.bodyFrameToTorsoFrameSleeveSegments = 10;\n\n this.bodyFrameToTorsoFrameCableLGeometry = new THREE.TubeBufferGeometry(this.getBodyFrameToTorsoFrameCableLCurve(), this.bodyFrameToTorsoFrameSleeveSegments, 0.01, 5);\n this.bodyFrameToTorsoFrameCableLMesh = new THREE.Mesh(this.bodyFrameToTorsoFrameCableLGeometry, this.cableSleeveMaterial);\n this.torsoFrame.add(this.bodyFrameToTorsoFrameCableLMesh);\n this.selfMeshes.push(this.bodyFrameToTorsoFrameCableLMesh);\n\n this.bodyFrameToTorsoFrameCableRGeometry = new THREE.TubeBufferGeometry(this.getBodyFrameToTorsoFrameCableRCurve(), this.bodyFrameToTorsoFrameSleeveSegments, 0.01, 5);\n this.bodyFrameToTorsoFrameCableRMesh = new THREE.Mesh(this.bodyFrameToTorsoFrameCableRGeometry, this.cableSleeveMaterial);\n this.torsoFrame.add(this.bodyFrameToTorsoFrameCableRMesh);\n this.selfMeshes.push(this.bodyFrameToTorsoFrameCableRMesh);\n\n\n\n this.baseFrameCableOutputL = new THREE.Object3D();\n this.baseFrameCableOutputL.position.set(0.04, 0.736, -0.209);\n this.baseFrame.add(this.baseFrameCableOutputL);\n\n this.baseFrameCableOutputR = new THREE.Object3D();\n this.baseFrameCableOutputR.position.set(-0.041, 0.736, -0.209);\n this.baseFrame.add(this.baseFrameCableOutputR);\n\n this.bodyFrameCableInputL = new THREE.Object3D();\n this.bodyFrameCableInputL.position.set(0.037, 0.373, -0.175);\n this.bodyFrame.add(this.bodyFrameCableInputL);\n\n this.bodyFrameCableInputR = new THREE.Object3D();\n this.bodyFrameCableInputR.position.set(-0.037, 0.373, -0.175);\n this.bodyFrame.add(this.bodyFrameCableInputR);\n\n this.baseFrameToBodyFrameSleeveSegments = 16;\n\n this.baseFrameToBodyFrameCableLGeometry = new THREE.TubeBufferGeometry(this.getBaseFrameToBodyFrameCableLCurve(), this.baseFrameToBodyFrameSleeveSegments, 0.01, 5);\n this.baseFrameToBodyFrameCableLMesh = new THREE.Mesh(this.baseFrameToBodyFrameCableLGeometry, this.cableSleeveMaterial);\n this.baseFrame.add(this.baseFrameToBodyFrameCableLMesh);\n this.selfMeshes.push(this.baseFrameToBodyFrameCableLMesh);\n\n this.baseFrameToBodyFrameCableRGeometry = new THREE.TubeBufferGeometry(this.getBaseFrameToBodyFrameCableRCurve(), this.baseFrameToBodyFrameSleeveSegments, 0.01, 5);\n this.baseFrameToBodyFrameCableRMesh = new THREE.Mesh(this.baseFrameToBodyFrameCableRGeometry, this.cableSleeveMaterial);\n this.baseFrame.add(this.baseFrameToBodyFrameCableRMesh);\n this.selfMeshes.push(this.baseFrameToBodyFrameCableRMesh);\n }", "function createSphere() {\n var geometry = new THREE.Geometry({\n colorsNeedUpdate : true\n }); // define a blank geometry\n var material = new THREE.MeshBasicMaterial(\n {\n transparency: true,\n opacity: 1.0,\n wireframeLinewidth: 0.5,\n color: 0x444444\n }\n );\n material.wireframe = true;\n\n sphere_radius_3D_S = 60; // test value\n sphere_wSegs_3D_S = 60; // test value 纬带数(纬线数+1)\n sphere_hSegs_3D_S = 60; // test value 经带数\n\n // 【生成所有顶点位置】 latNumber:纬线计数器\n var totalVertex = (sphere_wSegs_3D_S+1)*(sphere_hSegs_3D_S+1);\n for (var latNumber=0; latNumber<=sphere_wSegs_3D_S; latNumber++) {\n var theta = latNumber * Math.PI / sphere_wSegs_3D_S;\n var sinTheta = Math.sin(theta);\n var cosTheta = Math.cos(theta);\n for (var longNumber=0; longNumber<=sphere_hSegs_3D_S; longNumber++) {\n var phi = longNumber * 2 * Math.PI / sphere_hSegs_3D_S;\n var sinPhi = Math.sin(phi);\n var cosPhi = Math.cos(phi);\n // 球坐标系映射到xyz\n var x = sphere_radius_3D_S * sinTheta * cosPhi;\n var y = sphere_radius_3D_S * sinTheta * sinPhi;\n var z = sphere_radius_3D_S * cosTheta;\n var p = new THREE.Vector3(x, y, z);\n geometry.vertices.push(p);\n }\n }\n // 为了把这些顶点缝合到一起,需要【建立三角面片索引列表】\n var indexData = [];\n for (var latNumber = 0; latNumber < sphere_wSegs_3D_S; latNumber++) {\n for (var longNumber = 0; longNumber < sphere_hSegs_3D_S; longNumber++) {\n var first = (latNumber * (sphere_hSegs_3D_S + 1)) + longNumber;\n var second = first + sphere_hSegs_3D_S + 1;\n indexData.push(first);\n indexData.push(second);\n indexData.push(first + 1);\n indexData.push(second);\n indexData.push(second + 1);\n indexData.push(first + 1);\n // 测试用:调整了顶点顺序\n // indexData.push(first + 1);\n // indexData.push(second);\n // indexData.push(second + 1);\n }\n }\n // create faces\n for (var vertexCounter = 0; vertexCounter<indexData.length; vertexCounter+=3) {\n // var face = new THREE.Face3(\n // indexData[vertexCounter],\n // indexData[vertexCounter+1],\n // indexData[vertexCounter+2]\n // );\n var index1 = indexData[vertexCounter];\n var index2 = indexData[vertexCounter+1];\n var index3 = indexData[vertexCounter+2];\n var face = new THREE.Face3(\n index1,\n index2,\n index3\n );\n\n //着色方案1:仅用三种颜色测试\n // var color1 = findColor2(index1);//顶点1颜色\n // var color2 = findColor2(index2);//顶点2颜色\n // var color3 = findColor2(index3);//顶点3颜色\n\n // 着色方案2:灰度→彩色映射\n // 尚未测试\n // var color1 = trans_R( gray_scale(index1,totalVertex) );\n // var color2 = trans_G( gray_scale(index2,totalVertex) );\n // var color3 = trans_B( gray_scale(index3,totalVertex) );\n\n // 着色方案3:随机颜色\n // var color1 = new THREE.Color(0xFFFFFF * Math.random());//顶点1颜色——红色\n // var color2 = new THREE.Color(0xFFFFFF * Math.random());//顶点2颜色——绿色\n // var color3 = new THREE.Color(0xFFFFFF * Math.random());//顶点3颜色——蓝色\n // var color1 = new THREE.Color(getColor());//顶点1颜色——红色 产生随机色の方法2\n // var color2 = new THREE.Color(getColor());//顶点2颜色——绿色\n // var color3 = new THREE.Color(getColor());//顶点3颜色——蓝色\n\n // 着色方案4:随顶点索引数规律变化\n var color1 = findColor(index1,totalVertex);//顶点1颜色——红色\n var color2 = findColor(index2,totalVertex);//顶点2颜色——绿色\n var color3 = findColor(index3,totalVertex);//顶点3颜色——蓝色\n\n face.vertexColors.push(color1, color2, color3);//定义三角面三个顶点的颜色\n geometry.faces.push(face);\n }\n\n sphmat_3D_S=new THREE.MeshBasicMaterial({\n vertexColors: THREE.VertexColors,//以顶点颜色为准\n //vertexColors: geometry.colors,//以顶点颜色为准\n side: THREE.DoubleSide,//两面可见\n transparent: true,\n opacity: 1.0\n });//材质对象\n\n // create sphere and add it to scene\n sphere_3D_S = new THREE.Mesh(geometry,sphmat_3D_S);//网格模型对象\n scene_3D_S.add(sphere_3D_S); //网格模型添加到场景中\n}", "renderSSAO(scene, camera, { clear = true, draw = true } = { clear: true, draw: true }) {\n if (clear) {\n this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\n this.imgData = this.ctx.getImageData(0, 0, this.canvasWidth, this.canvasHeight)\n this.data = this.imgData.data\n this.zBuffer.fill(-Infinity)\n }\n\n let { imgData, data } = this\n\n // setup\n let { model, light } = scene\n let { shader } = model\n let { viewportTr } = camera\n\n shader.updateUniform({\n uniM: camera.uniM,\n lightDir: light.dir,\n })\n\n let renderingTime = new Date()\n let coords = []\n\n let width = camera.vW\n let height = camera.vH\n\n // first pass, using depth shader\n\n for (let fi = 0; fi < model.faces.length; fi++) {\n for (let vi = 0; vi < 3; vi++) {\n coords[vi] = shader.vertex(fi, vi)\n }\n triangleWithZBuffer(...coords, shader, this.zBuffer, data, this.canvasWidth, viewportTr, draw)\n }\n\n // second pass\n\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (this.zBuffer[(height - 1 - y) * width + x] < -1e5) continue\n\n let bufferIdx = (width - 1 - y) * width + x\n\n let total = 0\n // - 1e-4 for preventing extra round due to the float type\n // from ssloy's\n for (let deg = 0; deg < 2 * Math.PI - 1e-4; deg += Math.PI / 4) {\n let dx = Math.round(Math.cos(deg))\n let dy = Math.round(Math.sin(deg))\n\n let tx = x + dx\n let ty = y + dy\n let tIdx = (width - 1 - ty) * width + tx\n let diffZ = this.zBuffer[tIdx] - this.zBuffer[bufferIdx]\n\n if (diffZ < 0) {\n total += Math.PI / 2\n continue\n }\n let maxElevationAngle = Math.atan(diffZ / Math.sqrt(dx ** 2 + dy ** 2))\n total += Math.PI / 2 - maxElevationAngle\n }\n\n total /= Math.PI * 4\n total *= 255\n\n // total = Math.pow(total, 100) * 255\n data[bufferIdx * 4 + 0] = total\n data[bufferIdx * 4 + 1] = total\n data[bufferIdx * 4 + 2] = total\n }\n }\n\n console.log(\"render: \", new Date() - renderingTime, \"ms\")\n this.ctx.putImageData(imgData, 0, 0)\n }", "function Prepare(){\n function PrepareCubeMapLoader(url, ext){\n var urls = [\n url + \"px\" + ext,\n url + \"nx\" + ext,\n url + \"py\" + ext,\n url + \"ny\" + ext,\n url + \"pz\" + ext,\n url + \"nz\" + ext\n ];\n function OnLoad(res){\n res.format = THREE.RGBFormat;\n assetManager.cubeMap = res;\n }\n assetManager.loader.push(function(){\n assetManager.cubeMap= new THREE.CubeTextureLoader(loadManager).load(urls,OnLoad);\n });\n }\n\n function PrepareObjectLoader(url, onLoad){\n assetManager.loader.push(function(){\n new THREE.FBXLoader(loadManager).load(url,onLoad);\n });\n }\n\n PrepareCubeMapLoader(\"img/cubemap/bkg1_\",\".jpg\");\n PrepareObjectLoader(\"model/rendoru-spaceship.fbx\",function (res) {\n var basePath = \"img/texture/Rendoru-space-ship-anim-bone6_\";\n res.traverse(function (child) {\n if(child.isMesh){\n var cleanName = child.name.replace(/[0-9]+/,\"\");\n if(cleanName == \"RightEngine\"){\n cleanName = \"Engine\";\n }\n var emissiveTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Emissive.jpg\");\n var metallicTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Metallic.jpg\");\n var roughnessTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Roughness.jpg\");\n var normalTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Normal.jpg\");\n var baseColorTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_BaseColor.jpg\");\n child.material = new THREE.MeshPhysicalMaterial({\n color: 0x000000,\n map: baseColorTexture,\n emissive: 0xffffff,\n emissiveMap: emissiveTexture,\n envMap: assetManager.cubeMap,\n metalness: 1.0,\n metalnessMap: metallicTexture,\n normalMap: normalTexture,\n roughness: 1.0,\n roughnessMap: roughnessTexture,\n reflectivity: 1.0,\n clearCoat: 1.0,\n });\n child.castShadow = true;\n child.receiveShadow = true;\n }\n });\n var boxGeometry = new THREE.BoxBufferGeometry(1,1,1);\n var hitBoxPosition = [\n new THREE.Vector3(0,-1.5,0), 4,\n new THREE.Vector3(1.5,-1.75,0.5), 2,\n new THREE.Vector3(-1.5,-1.75,0.5), 2,\n new THREE.Vector3(1.5,-1.75,-0.5), 2,\n new THREE.Vector3(-1.5,-1.75,-0.5), 2,\n new THREE.Vector3(3.75,-0.5,0), 2,\n new THREE.Vector3(-3.75,-0.5,0), 2,\n new THREE.Vector3(5,0.5,0), 2,\n new THREE.Vector3(-5,0.5,0), 2,\n ];\n res.hitBoxes = new Array();\n for(var i=0;i<9;i++){\n //var hitBox = new THREE.Mesh(boxGeometry, new THREE.MeshStandardMaterial({color: 0xffff,}));\n var hitBox = new THREE.Object3D();\n hitBox.scale.set(0.5,0.5,0.5);\n hitBox.name = \"hit_box_\"+i.toString();\n var hitboxIndex = i * 2;\n hitBox.position.set(hitBoxPosition[hitboxIndex].x,hitBoxPosition[hitboxIndex].y,hitBoxPosition[hitboxIndex].z);\n res.add(hitBox);\n let tolerance = hitBoxPosition[hitboxIndex + 1];\n hitBox.isColliding = function (other) {\n var resOther = new THREE.Vector3();\n other.getWorldPosition(resOther);\n var resCurrent = new THREE.Vector3();\n this.getWorldPosition(resCurrent);\n var distance = resCurrent.distanceTo(resOther);\n var isCollide = distance < tolerance;\n //this.material.color = new THREE.Color((isCollide) ? 0xff0000 : 0x00ff00);\n return isCollide;\n };\n res.hitBoxes.push(hitBox);\n }\n\n res.isColliding = function (other) {\n for(var i = 0;i<this.hitBoxes.length;i++){\n if(this.hitBoxes[i].isColliding(other)){\n return true;\n }\n }\n return false;\n };\n\n res.name = \"spaceship\";\n res.mixer = new THREE.AnimationMixer(res);\n assetManager.addObject(res);\n });\n\n assetManager.loader.forEach(element => {\n element();\n });\n\n var planeGeometry = new THREE.PlaneBufferGeometry(10,10);\n var standardMaterial = new THREE.MeshStandardMaterial();\n var groundPlane = new THREE.Mesh(planeGeometry, standardMaterial);\n groundPlane.name = \"ground\";\n assetManager.addObject(groundPlane);\n \n var boxGeometry = new THREE.BoxBufferGeometry(1,1,1);\n var standardRedMaterial = new THREE.MeshStandardMaterial({color: 0xff0000, });\n for(var i=0;i<4;i++){\n var redBox = new THREE.Mesh(boxGeometry, standardRedMaterial);\n redBox.name = \"red_box_\"+i.toString();\n assetManager.addObject(redBox);\n }\n\n requestAnimationFrame(Update);\n}", "function createScene() {\n var geometry = new THREE.Geometry().fromBufferGeometry(loadedObject.children[0].geometry);\n var modifier = new THREE.BufferSubdivisionModifier(subdivisions);\n\n geometry = modifier.modify(geometry);\n geometry = new THREE.Geometry().fromBufferGeometry(geometry);\n geometry = new THREE.InstancedBufferGeometry().fromGeometry(geometry);\n geometry.maxInstancedCount = instances;\n\n var offsets = new THREE.InstancedBufferAttribute(new Float32Array(instances * geometry.attributes.position.array.length), 3, 1);\n for (var i = 0, ul = offsets.count; i != ul; ++i) {\n offsets.setXYZ(i, Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n }\n geometry.addAttribute('offset', offsets);\n\n var colors = new THREE.InstancedBufferAttribute(new Float32Array(instances * 4), 4, 1);\n for (var i = 0, ul = colors.count; i != ul; ++i) {\n colors.setXYZW(i, Math.random(), Math.random(), Math.random(), 1.0);\n }\n geometry.addAttribute('color', colors);\n\n var material = new THREE.RawShaderMaterial({\n vertexShader: document.getElementById('vertexShader').textContent,\n fragmentShader: document.getElementById('fragmentShader').textContent,\n side: THREE.DoubleSide,\n transparent: true,\n wireframe: true\n });\n\n model = new THREE.Mesh(geometry, material);\n\n scene.add(model);\n}", "function main() {\n\n // Start by creating a scene\n const scene = new THREE.Scene();\n const canvas = document.querySelector(\"#canvas\");\n\n /***\n *\n * ,ad8888ba, ,ad8888ba, 888b 88 ad88888ba 888888888888 db 888b 88 888888888888 ad88888ba\n * d8\"' `\"8b d8\"' `\"8b 8888b 88 d8\" \"8b 88 d88b 8888b 88 88 d8\" \"8b\n * d8' d8' `8b 88 `8b 88 Y8, 88 d8'`8b 88 `8b 88 88 Y8,\n * 88 88 88 88 `8b 88 `Y8aaaaa, 88 d8' `8b 88 `8b 88 88 `Y8aaaaa,\n * 88 88 88 88 `8b 88 `\"\"\"\"\"8b, 88 d8YaaaaY8b 88 `8b 88 88 `\"\"\"\"\"8b,\n * Y8, Y8, ,8P 88 `8b 88 `8b 88 d8\"\"\"\"\"\"\"\"8b 88 `8b 88 88 `8b\n * Y8a. .a8P Y8a. .a8P 88 `8888 Y8a a8P 88 d8' `8b 88 `8888 88 Y8a a8P\n * `\"Y8888Y\"' `\"Y8888Y\"' 88 `888 \"Y88888P\" 88 d8' `8b 88 `888 88 \"Y88888P\"\n *\n *\n */\n\n // Camera\n const fov = 75;\n const aspect = window.innerWidth / window.innerHeight;\n const near = 0.1;\n const far = 10000;\n const cameraDistance = 100;\n\n // Geometry\n const boxWidth = 1;\n const boxHeight = 1;\n const boxDepth = 1;\n\n // Mesh\n // const materialColor = 0x44aa88;\n\n // Light\n const lightColor = 0xFFFFFF;\n const lightIntensity = 1;\n\n /***\n *\n * ad88888ba 88888888888 888888888888 88 88 88888888ba\n * d8\" \"8b 88 88 88 88 88 \"8b\n * Y8, 88 88 88 88 88 ,8P\n * `Y8aaaaa, 88aaaaa 88 88 88 88aaaaaa8P'\n * `\"\"\"\"\"8b, 88\"\"\"\"\" 88 88 88 88\"\"\"\"\"\"'\n * `8b 88 88 88 88 88\n * Y8a a8P 88 88 Y8a. .a8P 88\n * \"Y88888P\" 88888888888 88 `\"Y8888Y\"' 88\n *\n *\n */\n\n // Create canvas\n const renderer = createRenderer({THREE: THREE, canvas: canvas});\n\n // Create camera and move it back slightly\n const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);\n camera.position.x = 4;\n camera.position.y = 10;\n camera.position.z = cameraDistance;\n\n // Create controls\n const controls = new OrbitControls(camera, canvas);\n\n // Create a Geometry\n const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth);\n\n // Create a mesh\n const cubes = [];\n\n for (let i = 0; i < 500; i++) {\n cubes.push(new Particle({\n scene: scene,\n geometry: geometry,\n x: Math.floor(Math.random() * 100) - 50,\n y: Math.floor(Math.random() * 100) - 50,\n z: Math.floor(Math.random() * 100) - 50,\n }));\n }\n\n // Create a light\n const light = new THREE.DirectionalLight(lightColor, lightIntensity);\n light.position.set(2, 2, 5);\n scene.add(light);\n\n /***\n *\n * 88888888ba 88888888888 888b 88 88888888ba, 88888888888 88888888ba\n * 88 \"8b 88 8888b 88 88 `\"8b 88 88 \"8b\n * 88 ,8P 88 88 `8b 88 88 `8b 88 88 ,8P\n * 88aaaaaa8P' 88aaaaa 88 `8b 88 88 88 88aaaaa 88aaaaaa8P'\n * 88\"\"\"\"88' 88\"\"\"\"\" 88 `8b 88 88 88 88\"\"\"\"\" 88\"\"\"\"88'\n * 88 `8b 88 88 `8b 88 88 8P 88 88 `8b\n * 88 `8b 88 88 `8888 88 .a8P 88 88 `8b\n * 88 `8b 88888888888 88 `888 88888888Y\"' 88888888888 88 `8b\n *\n *\n */\n function render(time) {\n\n // Get the time in seconds\n time *= 0.001;\n\n // Set the cube rotation to the time in seconds\n cubes.forEach(cube => {\n cube.update();\n });\n\n // Update the scene\n renderer.render(scene, camera);\n\n // Get the next frame and restart the loop\n requestAnimationFrame(render);\n }\n\n // Start the render loop\n requestAnimationFrame(render);\n}", "function create_atom_particle_state_2() {\n\n // Creates the Geometry of the Sphere representing\n // the Atom's Particle #2\n atom_particle_geometry_2 = new THREE.SphereGeometry(0.22, 40, 40);\n\n // Creates the Material of the Sphere representing\n // the Atom's Particle #2\n atom_particle_material_2 = new THREE.MeshBasicMaterial(\n {\n color: 0xff2200,\n depthTest: true,\n transparent: true,\n opacity: 1.0\n }\n );\n\n // Creates the Mesh of the Atom's Particle's State #2\n atom_particle_mesh_2 = new THREE.Mesh(atom_particle_geometry_2, atom_particle_material_2); \n\n // Translates/Moves the Atom's Particle's State #2\n // 2.51 units, regarding the Z Axis\n atom_particle_mesh_2.position.z = 2.51;\n\n // Creates the group for the Atom's Particle's State's Pivot #2\n atom_particle_state_pivot_2 = new THREE.Group();\n\n // Adds the Mesh of the Atom's Particle's State #2\n // the group for the Atom's Particle's State's Pivot #2\n atom_particle_state_pivot_2.add(atom_particle_mesh_2);\n\n}", "function setSphere() {\r\n tetrahedron(va, vb, vc, vd, numTimesToSubdivide);\r\n}", "function create_atom_particle_state_3() {\n\n // Creates the Geometry of the Sphere representing\n // the Atom's Particle #3\n atom_particle_geometry_3 = new THREE.SphereGeometry(0.22, 40, 40);\n\n // Creates the Material of the Sphere representing\n // the Atom's Particle #3\n atom_particle_material_3 = new THREE.MeshBasicMaterial(\n {\n color: 0xff2200,\n depthTest: true,\n transparent: true,\n opacity: 1.0\n }\n );\n\n // Creates the Mesh of the Atom's Particle's State #3\n atom_particle_mesh_3 = new THREE.Mesh(atom_particle_geometry_3, atom_particle_material_3); \n\n // Translates/Moves the Atom's Particle's State #3\n // 2.51 units, regarding the Z Axis\n atom_particle_mesh_3.position.z = 2.51;\n\n // Creates the group for the Atom's Particle's State's Pivot #3\n atom_particle_state_pivot_3 = new THREE.Group();\n\n // Adds the Mesh of the Atom's Particle #3\n // the group for the Atom's Particle's State's Pivot #3\n atom_particle_state_pivot_3.add(atom_particle_mesh_3);\n\n}", "function CubeSea( texture, gridSize, cubeSize, lit, merge ) {\n var sea = new THREE.Object3D();\n\n sea.update = function() {};\n\n new THREE.TextureLoader().load( texture, function( map ){\n\n var _geo = new THREE.Geometry();\n var geo = new THREE.BoxGeometry( cubeSize, cubeSize, cubeSize );\n var mat = new (lit ? THREE.MeshLambertMaterial : THREE.MeshBasicMaterial)({\n map: map\n });\n if (!merge) {\n var _cube = new THREE.Mesh( geo, mat );\n } else {\n var matrix = new THREE.Matrix4();\n }\n\n for ( var x = 0; x < gridSize; ++x ) {\n for ( var y = 0; y < gridSize; ++y ) {\n for ( var z = 0; z < gridSize; ++z ) {\n var position = new THREE.Vector3( x - gridSize/2, y - gridSize/2, z - gridSize/2 );\n if ( position.x == 0 && position.y == 0 && position.z == 0 )\n continue;\n\n if (!merge) {\n var cube = _cube.clone();\n cube.position.copy( position );\n sea.add( cube );\n } else {\n _geo.merge( geo, matrix.makeTranslation( position.x, position.y, position.z ) );\n }\n }\n }\n }\n\n if (merge) {\n var _cubes = new THREE.Mesh( _geo, mat );\n sea.add( _cubes );\n }\n\n var size = 0.05;\n var geo = new THREE.BoxGeometry( size*2, size*2, size*2 );\n\n var rCube = new THREE.Mesh( geo, mat );\n\n var rotatingCubes = new THREE.Group();\n rotatingCubes.name = 'rotatingCubes';\n var positions = [ [0, 0.25, -0.8], [0.8, 0.25, 0], [0, 0.25, 0.8], [-0.8, 0.25, 0] ];\n for (var i = 0; i < positions.length; i++) {\n var _rCube = rCube.clone();\n _rCube.position.fromArray( positions[i] );\n rotatingCubes.add( _rCube );\n }\n\n sea.add( rotatingCubes );\n\n sea.update = function( timestamp ) {\n rotatingCubes.rotation.y = timestamp / 2000;\n };\n\n });\n\n return sea;\n\n}", "function init() {\n\tscene = new THREE.Scene();\n\tHEIGHT = window.innerHeight;\n\tWIDTH = window.innerWidth;\n\taspectRatio = WIDTH / HEIGHT;\n\tfieldOfView = 50;\n\tnearPlane = 1;\n\tfarPlane = 2000;\n\tcamera = new THREE.PerspectiveCamera(fieldOfView, aspectRatio,\n\t\tnearPlane, farPlane);\n\tcamera.position.z = 800;\n\tcamera.position.y = -500;\n\trenderer = new THREE.WebGLRenderer({alpha: true, antialias: false });\n\trenderer.setPixelRatio( window.devicePixelRatio );\n\trenderer.setSize(WIDTH, HEIGHT);\n\trenderer.shadowMapEnabled = true;\n\tcontainer = document.getElementById('world');\n\tcontainer.appendChild(renderer.domElement);\n\twindowHalfX = WIDTH / 2;\n\twindowHalfY = HEIGHT / 2;\n\twindow.addEventListener('resize', onWindowResize, false);\n\n\tblackholeGroup = new THREE.Group();\n\n\tblackholeBody = new THREE.Mesh(\n\t\tnew THREE.SphereGeometry( 50, 30, 30 ),\n\t\tnew THREE.MeshBasicMaterial({\n\t\t\tcolor: 0x000000\n\t\t})\n\t);\n\tblackholeBody.receiveShadow = false;\n\tblackholeGroup.add(blackholeBody);\n\tscene.add(blackholeGroup);\n\n\tvar geometry = new THREE.Geometry();\n\tvar colors = [];\n\tfor (var i = 0 ; i < 20000 ; i++) {\n\t\tlet r = getRandomInt(0, i * .008) + 50;\n\t\tparticles[i] = new Particle(i, r);\n\t\tgeometry.vertices.push(new THREE.Vector3(particles[i].x, particles[i].y));\n\t\tlet dist = r * 2;\n\t\tcolors[i] = new THREE.Color('rgb(' + dist + ', ' + dist * 2 + ', ' + 255 + ')');\n\t}\n\tgeometry.colors = colors;\n\tlet material = new THREE.PointsMaterial( {\n\t\tsize: 2,\n\t\ttransparent: false,\n\t\tvertexColors: THREE.VertexColors\n\t} );\n\n\tparticleSystem = new THREE.Points(geometry, material);\n\tscene.add(particleSystem);\n\n\tfor (let i = 0 ; i < 15 ; i++) {\n\t\tlet circleMat = new THREE.LineBasicMaterial( { color: 0xffffff } );\n\t\tlet circleGeo = new THREE.CircleGeometry( 220 + (50 * i), 50 );\n\t\tcircleGeo.vertices.shift();\n\t\tlet lineObj = new THREE.LineLoop(circleGeo, circleMat);\n\t\tlineObj.position.z = -1;\n\t\tscene.add(lineObj);\n\t}\n}", "createGround() {\n const options = {\n octaveCount: 4, // 4 defaults\n amplitude: 0.1, // 0.1\n persistence: 0.2, // 0.2\n }\n\n const resolutionX = 100\n const resolutionY = 100\n const actualResolutionX = resolutionX + 1 // plane adds one vertex\n const actualResolutionY = resolutionY + 1\n\n\n const geometryPlane = new THREE.PlaneGeometry(\n this.sizeX + ((this.sizeX / actualResolutionX) * 2),\n this.sizeY + ((this.sizeY / actualResolutionY) * 2),\n resolutionX,\n resolutionY,\n )\n\n geometryPlane.castShadow = true\n\n const noise = perlin.generatePerlinNoise(actualResolutionX, actualResolutionY, options)\n const riverPath = this.createRiverPath()\n\n let i = 0\n\n const riverDepth = 2\n const riverRadius = 2\n\n for (let x = 0; x < actualResolutionX; x++) {\n for (let y = 0; y < actualResolutionY; y++) {\n let h = noise[i]\n\n const distanceToRiverMiddle = this.getDistanceToRiverMiddle(riverPath, geometryPlane.vertices[i])\n\n if (distanceToRiverMiddle < riverRadius) {\n // This should be zero when distanceToRiverMiddle is at highest\n // This should be riverDepth when distanceToRiverMiddle is at its lowest\n\n h -= Math.sin((1 - (distanceToRiverMiddle / riverRadius)) * riverDepth)\n }\n\n\n // Wrap sides directly down by moving the outer vertices a bit inwards.\n if (x === 0) {\n geometryPlane.vertices[i].y -= (this.sizeY / actualResolutionY)\n }\n\n if (x === resolutionX) {\n geometryPlane.vertices[i].y += (this.sizeY / actualResolutionY)\n }\n\n if (y === 0) {\n geometryPlane.vertices[i].x += (this.sizeX / actualResolutionX)\n }\n\n if (y === resolutionY) {\n geometryPlane.vertices[i].x -= (this.sizeX / actualResolutionX)\n }\n\n\n // Wrap the sides down\n if (\n x === 0 ||\n y === 0 ||\n x === resolutionX ||\n y === resolutionY\n ) {\n geometryPlane.vertices[i].z = -1\n } else {\n geometryPlane.vertices[i].z = h\n }\n\n i++\n }\n }\n\n geometryPlane.verticesNeedUpdate = true\n geometryPlane.computeFaceNormals()\n\n const materialPlane = new THREE.MeshStandardMaterial({\n color: 0xffff00,\n side: THREE.FrontSide,\n roughness: 1,\n })\n\n // materialPlane.wireframe = true\n\n const ground = new THREE.Mesh(geometryPlane, materialPlane)\n geometryPlane.computeVertexNormals()\n ground.name = GROUND_NAME\n ground.receiveShadow = true\n scene.add(ground)\n }", "setupSphere() {\n var myMaterial = new BABYLON.StandardMaterial(\"myMaterial\", this.scene);\n myMaterial.specularColor = new BABYLON.Color3(0.0, 0.0, 0.0);\n myMaterial.alpha = 0.4;\n \n this.sphere.material = myMaterial;\n this.position.y = 0.0;\n this.sphere.scaling = new BABYLON.Vector3(1.0, 1.0, 1.0);\n\n var equator = this.createEquator();\n equator.parent = this.sphere;\n equator.color = this.lineColor;\n\n //Array of points to construct Bloch X axis line\n var xAxisPoints = [\n new BABYLON.Vector3(0, 0, -1.0),\n new BABYLON.Vector3(0, 0, 1.0)\n ];\n\n //Array of points to construct Bloch Y axis line\n var yAxisPoints = [\n new BABYLON.Vector3(-1.0, 0, 0),\n new BABYLON.Vector3(1.0, 0, 0)\n ];\n\n //Array of points to construct Bloch Z axis line\n var zAxisPoints = [\n new BABYLON.Vector3(0, 1.0, 0),\n new BABYLON.Vector3(0, -1.0, 0)\n ];\n\n //Create lines\n var xAxisLine = BABYLON.MeshBuilder.CreateDashedLines(\"xAxisLine\", { points: xAxisPoints, dashSize: 3, gapSize: 3 }, this.scene);\n var yAxisLine = BABYLON.MeshBuilder.CreateDashedLines(\"yAxisLine\", { points: yAxisPoints, dashSize: 3, gapSize: 3 }, this.scene);\n var zAxisLine = BABYLON.MeshBuilder.CreateDashedLines(\"zAxisLine\", { points: zAxisPoints, dashSize: 3, gapSize: 3 }, this.scene);\n\n xAxisLine.color = this.lineColor;\n yAxisLine.color = this.lineColor;\n zAxisLine.color = this.lineColor;\n\n xAxisLine.isPickable = false;\n yAxisLine.isPickable = false;\n zAxisLine.isPickable = false;\n\n xAxisLine.parent = this.sphere;\n yAxisLine.parent = this.sphere;\n zAxisLine.parent = this.sphere;\n\n // Axis labels\n var AxisLabelSize = 0.2\n\n var xChar = this.makeTextPlane(\"X\", \"black\", AxisLabelSize);\n xChar.parent = this.sphere;\n xChar.position = new BABYLON.Vector3(-0.1, -0.1, -0.9);\n xChar.isPickable = false;\n\n var yChar = this.makeTextPlane(\"Y\", \"black\", AxisLabelSize);\n yChar.parent = this.sphere;\n yChar.position = new BABYLON.Vector3(0.9, -0.1, -0.1);\n yChar.isPickable = false;\n\n var zeroKet = this.makeTextPlane(\"|0⟩\", \"black\", AxisLabelSize);\n zeroKet.parent = this.sphere;\n zeroKet.position = new BABYLON.Vector3(-0.1, 0.9, 0);\n zeroKet.isPickable = false;\n\n var oneKet = this.makeTextPlane(\"|1⟩\", \"black\", AxisLabelSize);\n oneKet.parent = this.sphere;\n oneKet.position = new BABYLON.Vector3(-0.1, -0.9, 0);\n oneKet.isPickable = false;\n\n var plusKet = this.makeTextPlane(\"|+⟩\", \"black\", AxisLabelSize);\n plusKet.parent = this.sphere;\n plusKet.position = new BABYLON.Vector3(-0.1, 0.05, -0.9);\n plusKet.isPickable = false;\n \n var minusKet = this.makeTextPlane(\"|-⟩\", \"black\", AxisLabelSize);\n minusKet.parent = this.sphere;\n minusKet.position = new BABYLON.Vector3(-0.1, 0, 0.9);\n minusKet.isPickable = false;\n\n var iKet = this.makeTextPlane(\"|i⟩\", \"black\", AxisLabelSize);\n iKet.parent = this.sphere;\n iKet.position = new BABYLON.Vector3(0.9, 0.05, -0.1);\n iKet.isPickable = false;\n\n var minusiKet = this.makeTextPlane(\"|-i⟩\", \"black\", AxisLabelSize);\n minusiKet.parent = this.sphere;\n minusiKet.position = new BABYLON.Vector3(-0.9, 0, -0.1);\n minusiKet.isPickable = false;\n \n this.quantumStateArrow = this.createQuantumStateArrow(); \n this.quantumStateArrow.parent = this.sphere; \n\n this.updateQuantumStateArrow();\n }", "function animate() {\n requestAnimationFrame(animate);\n scene_3D.animate();\n //this makes the puddle reflective\n scene_3D.pudd.visible = false;\n\n //this makes the mirror in gameScene reflective\n scene_3D.mirrorCube.visible = false;\n //scene_3D.puddCubeCamera.update(renderer_3D,scene_3D);\n mirrorControl++;\n\n if (mirrorControl % 30 === 0) {\n scene_3D.mirrorCubeCamera.update(renderer_3D,scene_3D);\n mirrorControl = 0;\n }\n scene_3D.mirrorCube.visible = true;\n scene_3D.pudd.visible = true;\n renderer_3D.render(scene_3D,scene_3D.getCamera());\n\n /*\n This next few lines switches the viewport and scissoring region (only a certain area will be affected), renders the picture in picture\n and resets the viewport and scissoring region\n */\n let initialViewport = new THREE.Vector4();\n renderer_3D.getViewport(initialViewport);\n let initialScissor = new THREE.Vector4();\n renderer_3D.getScissor(initialScissor);\n\n let currentViewport = new THREE.Vector4(window.innerWidth*0.75, window.innerHeight*0.1,window.innerWidth*0.2, window.innerHeight*0.2);\n let currentScissor = new THREE.Vector4(window.innerWidth*0.75, window.innerHeight*0.1,window.innerWidth*0.2, window.innerHeight*0.2);\n renderer_3D.setViewport(currentViewport);\n renderer_3D.setScissor(currentScissor);\n renderer_3D.setScissorTest(true);\n\n if (scene_3D.minimap.getObject() != null){\n renderer_3D.render(scene_3D, scene_3D.minimap.getObject());\n }\n\n\n renderer_3D.setViewport(initialViewport);\n renderer_3D.setScissor(initialScissor);\n renderer_3D.setScissorTest(false);\n\n scene_3D.simulate(); //simulates physijs objects\n}", "function SkyBox() {\n const materialArray = [];\n const texture_ft = new THREE.TextureLoader().load('./assets/skybox/arid2_ft.jpg');\n const texture_bk = new THREE.TextureLoader().load('./assets/skybox/arid2_bk.jpg');\n const texture_up = new THREE.TextureLoader().load('./assets/skybox/arid2_up.jpg');\n const texture_dn = new THREE.TextureLoader().load('./assets/skybox/arid2_dn.jpg');\n const texture_rt = new THREE.TextureLoader().load('./assets/skybox/arid2_rt.jpg');\n const texture_lf = new THREE.TextureLoader().load('./assets/skybox/arid2_lf.jpg');\n \n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_ft }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_bk }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_up }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_dn }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_rt }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_lf }));\n\n for (let i = 0; i < 6; i++)\n materialArray[i].side = THREE.BackSide;\n\n const skyboxGeo = new THREE.BoxGeometry(2400, 2400, 2400);\n const skybox = new THREE.Mesh(skyboxGeo, materialArray);\n\n return skybox;\n}", "function stars_creat() {\r\n star_geo = new THREE.Geometry();\r\n for (let i = 0; i < 10000; i++) {\r\n star = new THREE.Vector3(\r\n INIT.getRandomInt(-window.innerWidth, window.innerWidth),\r\n INIT.getRandomInt(-window.innerHeight, window.innerHeight),\r\n Math.random() * 1000 - 500\r\n );\r\n star.velocity = 0;\r\n star.acceleration = 1.5;\r\n star_geo.vertices.push(star);\r\n }\r\n let sprite = new THREE.TextureLoader().load('../loader/star.png');\r\n let star_material = new THREE.PointsMaterial({\r\n color: 0xaaaaaa,\r\n size: 1,\r\n map: sprite\r\n });\r\n stars = new THREE.Points(star_geo, star_material);\r\n scene.add(stars);\r\n}", "function makeSphere (slices, stacks) {\n // fill in your code here.\n\tvar triangles = [];\n\tvar origin = [0.0, 0.0, 0.0];\n\tconst radius = 0.5;\n\tconst longi_step = radians(360 / slices); // in radian\n\tconst lati_step = radians(180 / stacks); // in radian\n\n\tvar theta = 0.0;\n\t\n\n\tfor (var i=0; i<slices; i++){\n\n\t\tvar phi = 0.0;\n\t\tfor(var j=0; j<stacks; j++){\n\t\t\tvar v1 = [radius * Math.sin(theta) * Math.sin(phi), radius * Math.cos(phi), radius * Math.cos(theta) * Math.sin(phi)];\n\t\t\tvar v2 = [radius * Math.sin(theta + longi_step) * Math.sin(phi), radius * Math.cos(phi), radius * Math.cos(theta + longi_step) * Math.sin(phi)];\n\t\t\tvar v3 = [radius * Math.sin(theta) * Math.sin(phi + lati_step), radius * Math.cos(phi + lati_step), radius * Math.cos(theta) * Math.sin(phi + lati_step)];\n\t\t\tvar v4 = [radius * Math.sin(theta + longi_step) * Math.sin(phi + lati_step), radius * Math.cos(phi + lati_step), radius * Math.cos(theta + longi_step) * Math.sin(phi + lati_step)];\n\n\t\t\ttriangles.push([v1, v3, v2]);\n\t\t\ttriangles.push([v2, v3, v4]);\n\n\t\t\tphi += lati_step;\n\t\t}\n\n\t\ttheta += longi_step;\n\t}\n\n\tconsole.log(triangles.length);\n\n\tfor (tri of triangles){\n\t\taddTriangle(\n\t\t\ttri[0][0], tri[0][1], tri[0][2],\n\t\t\ttri[1][0], tri[1][1], tri[1][2],\n\t\t\ttri[2][0], tri[2][1], tri[2][2]\n\t\t\t);\n\t}\n\n\n}", "initBuffers() {\n\n var alpha = 2 * Math.PI / this.slices;\n\n this.vertices = [];\n this.normals = [];\n this.indices = [];\n this.texCoords = [];\n this.init_texCoords=[];\n\n var alpha = 2 * Math.PI / this.slices;\n var beta = (Math.PI / 2) / this.stacks;\n\n for (let i = 0; i <= this.stacks; i++) {\n for (let j = 0; j <= this.slices; j++) {\n this.vertices.push(Math.cos(alpha * j) * Math.cos(beta * i), Math.sin(alpha * j) * Math.cos(beta * i), Math.sin(beta * i));\n this.normals.push(Math.cos(alpha * j) * Math.cos(beta * i), Math.sin(alpha * j) * Math.cos(beta * i), Math.sin(beta * i));\n this.texCoords.push(j * 1 / this.slices, i * 1 / this.stacks);\n }\n }\n\n for (let k = 0; k < this.stacks; k++) {\n for (let l = 0; l < this.slices; l++) {\n this.indices.push(k * (this.slices + 1) + l, k * (this.slices + 1) + 1 + l, (k + 1) * (this.slices + 1) + l);\n this.indices.push(k * (this.slices + 1) + 1 + l, (k + 1) * (this.slices + 1) + 1 + l, (k + 1) * (this.slices + 1) + l);\n }\n }\n\n\n\n this.init_texCoords=this.texCoords;\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "function drawSphere(numberToSubdivide, useFlatShading, isSun) {\n divideTriangle(va, vb, vc, numberToSubdivide);\n divideTriangle(vd, vc, vb, numberToSubdivide);\n divideTriangle(va, vd, vb, numberToSubdivide);\n divideTriangle(va, vc, vd, numberToSubdivide);\n \n function triangle(a, b, c) {\n pointsArray.push(a, b, c);\n \n //push normal vectors \n if(useFlatShading){\n var t1 = subtract(c,b);\n var t2 = subtract(c,a);\n var normal = vec4(normalize(cross(t1,t2)));\n if(isSun){\n normal = subtract(vec4(0,0,0,0), normal);\n }\n normalsArray.push(normal, normal, normal);\n }\n else{\n normalsArray.push(a, b, c);\n } \n\n index += 3;\n }\n\n function divideTriangle(a, b, c, count) {\n if ( count <= 0 ) { \n triangle(a, b, c);\n }\n else{ \n var ab = mix( a, b, 0.5);\n var ac = mix( a, c, 0.5);\n var bc = mix( b, c, 0.5);\n \n ab = normalize(ab, true);\n ac = normalize(ac, true);\n bc = normalize(bc, true);\n \n divideTriangle( a, ab, ac, count - 1 );\n divideTriangle( ab, b, bc, count - 1 );\n divideTriangle( bc, c, ac, count - 1 );\n divideTriangle( ab, bc, ac, count - 1 );\n }\n }\n\n}", "function peep(){\n\n\tthis.geometry = new THREE.CubeGeometry( 1,1,1,1,1,1 );\n\t\n\tthis.id;\n\tthis.speed;\n\t\n\t//q is counter\n\tthis.q;\n\t\n\t//client calls dude, dude calls parts\n\t//function(body size xyz (mx,my,mz), arm length/width(al,aw),leg length,width and separation(ll,lw,ls),eye scale x and y and eye separation(ey,es))\n\t\n\tthis.dude = function (mx,my,mz,al,aw,ll,lw,ls,ex,ey,es) {\n\t\t\n\t\tvar rotColor = Math.random() * 16777215;\n\t\tvar hexValue = parseInt(rotColor , 16);\n\t\t\n\t\tvar white = hexValue;\n\t\tvar black = 0x000000;\n\t\t\n\t\tthis.CTRL = new THREE.Object3D();\n\t\tthis.CTRL.name = \"CTRL\";\n\t\t\n\t\tthis[ this.CTRL.name ] = this.CTRL;\n\t\t\n\t\t//(mesh offset xyz, scale xyz, controller position xyz, name, color)\n\t\tvar rlArm = this.part(0,-.5,0,aw,al,aw,0,-al,0,\"rlarm\",white);\n\t\tvar ruArm = this.part(0,-.5,0,aw,al,aw,(mx+(aw))*.5,0,0,\"ruarm\",white);\n\t\t\n\t\tvar llArm =\tthis.part(0,-.5,0,aw,al,aw,0,-al,0,\"llarm\",white);\n\t\tvar luArm =\tthis.part(0,-.5,0,aw,al,aw,(mx+(aw))*-.5,0,0,\"luarm\",white);\n\t\t\n\t\tvar lLeg =\tthis.part(0,-.5,0,lw,ll,lw,ls,-(my*.5),0,\"lleg\",white);\n\t\tvar rLeg =\tthis.part(0,-.5,0,lw,ll,lw,-ls,-(my*.5),0,\"rleg\",white);\n\t\t\n\t\tvar leye =\tthis.part(0,0,.5,ex,ey,ex,es,0,mz*.5,\"leye\",black);\n\t\tvar reye =\tthis.part(0,0,.5,ex,ey,ex,-es,0,mz*.5,\"reye\",black);\n\t\n\t\tvar bod =\tthis.part(0,0,0,mx,my,mz,0,0,0,\"bod\",white);\n\t\t\n\t\tthis.rotation_ruarm.add(rlArm);\t\t\t\n\t\tthis.rotation_luarm.add(llArm);\n\t\t\n\t\tthis.rotation_bod.add(ruArm);\n\t\tthis.rotation_bod.add(luArm);\n\t\t\n\t\tthis.rotation_bod.add(lLeg);\n\t\tthis.rotation_bod.add(rLeg);\n\t\t\n\t\tthis.rotation_bod.add(leye);\n\t\tthis.rotation_bod.add(reye);\n\t\t\n\t\tthis.CTRL.add(bod);\n\t\t\n\t\tthis.CTRL.position.y = my+ll;\n\t}\t\n\t\n\t/*\n\t//this.geometry is a cube set to a scale of 1,1,1 - this is true of every object that's created\n\t//It is placed inside a group which scales it to the desired size\n\t//this group is placed inside a group designated for 'rotation' although you can do anything with it\n\t//this group is placed inside 'poser' the top group, which is returned\n\t//each item's name is assigned to the peep object so it can be easily accessed later\n\t\n\t//(mesh offset xyz, scale xyz, controller position xyz, name, color)\n\t*/\n\tthis.part = function(px,py,pz,\tsx,sy,sz,\tp2x,p2y,p2z,\tnamer,color){\n\t\t\n\t\tthis.material = new THREE.MeshLambertMaterial( { color:0xffffff, shading: THREE.FlatShading } );\n\t\tthis.material.color.setHex(color);\n\t\t\n\t\tvar pos = new THREE.Vector3(px,py,pz);\n\t\tvar scl = new THREE.Vector3(sx,sy,sz);\n\t\tvar pos2 = new THREE.Vector3(p2x,p2y,p2z);\n\t\t\n\t\tthis.mesh = new THREE.Mesh( this.geometry, this.material );\n\t\t\t\t\t\t\t\n\t\tthis.mesh.updateMatrix();\n\t\tthis.mesh.matrixAutoUpdate = true;\t\t\t\t\t\n\t\tthis.mesh.position = pos;\t\t\t\t\n\t\tthis.scalar = new THREE.Object3D();\t\n\n\t\tthis.mesh.name = \"mesh_\"+namer;\n\t\t\n\t\tthis[ this.mesh.name ] = this.mesh;\n\t\t\n\t\tthis.scalar.name = \"scale_\"+namer;\t\n\t\t\n\t\tthis[ this.scalar.name ] = this.scalar;\n\t\t\n\t\tthis.scalar.matrixAutoUpdate = true;\t\t\t\t\t\n\t\tthis.scalar.add(this.mesh);\t\t\t\t\t\n\t\tthis.scalar.scale = scl;\t\t\t\t\t\n\t\tthis.rotator = new THREE.Object3D();\n\n\t\tthis.rotator.name = \"rotation_\"+namer;\t\n\n\t\tthis[ this.rotator.name ] = this.rotator;\n\t\t\n\t\tthis.rotator.matrixAutoUpdate = true;\t\t\t\t\t\n\t\tthis.rotator.add(this.scalar);\t\t\t\t\t\n\t\tthis.poser = new THREE.Object3D();\t\n\t\t\n\t\tthis.poser.name = \"position_\"+namer;\n\t\t\n\t\tthis.poser.matrixAutoUpdate = true;\t\t\t\t\t\n\t\tthis.poser.add(this.rotator);\t\t\t\t\t\n\t\tthis.poser.position = pos2;\t\n\n\t\tthis[ this.poser.name ] = this.poser;\t\n\n\t\treturn this.poser;\n\t}\n}", "function create_atom_particle_state_4() {\n\n // Creates the Geometry of the Sphere representing\n // the Atom's Particle #4\n atom_particle_geometry_4 = new THREE.SphereGeometry(0.22, 40, 40);\n\n // Creates the Material of the Sphere representing\n // the Atom's Particle #4\n atom_particle_material_4 = new THREE.MeshBasicMaterial(\n {\n color: 0xff2200,\n depthTest: true,\n transparent: true,\n opacity: 1.0\n }\n );\n\n // Creates the Mesh of the Atom's Particle's State #4\n atom_particle_mesh_4 = new THREE.Mesh(atom_particle_geometry_4, atom_particle_material_4); \n\n // Translates/Moves the Atom's Particle's State #4\n // -2.51 units, regarding the Z Axis\n atom_particle_mesh_4.position.z = -2.51;\n\n // Creates the group for the Atom's Particle's State's Pivot #4\n atom_particle_state_pivot_4 = new THREE.Group();\n\n // Adds the Mesh of the Atom's Particle #4\n // the group for the Atom's Particle's State's Pivot #4\n atom_particle_state_pivot_4.add(atom_particle_mesh_4);\n\n}", "getSketchesInfo () {\n let points = [];\n for (let sketch of this.sketches) {\n sketch.map(function(curve){\n points.push(...curve.curve.getSpacedPoints(200));\n });\n }\n this.sketchBox = new THREE.Box3().setFromPoints(points);\n this.sketchSphere = new THREE.Sphere().setFromPoints(points);\n }", "createReticle_() {\n // Create a spherical reticle.\n let innerGeometry = new THREE.SphereGeometry(INNER_RADIUS, 32, 32);\n let innerMaterial = new THREE.MeshBasicMaterial({\n color: 0xffffff,\n transparent: true,\n opacity: 0.9\n });\n let inner = new THREE.Mesh(innerGeometry, innerMaterial);\n\n let outerGeometry = new THREE.SphereGeometry(OUTER_RADIUS, 32, 32);\n let outerMaterial = new THREE.MeshBasicMaterial({\n color: 0x333333,\n transparent: true,\n opacity: 0.3\n });\n let outer = new THREE.Mesh(outerGeometry, outerMaterial);\n\n let reticle = new THREE.Group();\n reticle.add(inner);\n reticle.add(outer);\n return reticle;\n }", "constructor( context, control_box ) // The scene begins by requesting the camera, shapes, and materials it will need.\r\n { super( context, control_box ); // First, include a couple other helpful components, including one that moves you around:\r\n if( !context.globals.has_controls ) \r\n context.register_scene_component( new Movement_Controls( context, control_box.parentElement.insertCell() ) ); \r\n\r\n // Define the global camera and projection matrices, which are stored in a scratchpad for globals. The projection is special \r\n // because it determines how depth is treated when projecting 3D points onto a plane. The function perspective() makes one.\r\n // Its input arguments are field of view, aspect ratio, and distances to the near plane and far plane.\r\n context.globals.graphics_state. camera_transform = Mat4.translation([ 0,0,-30 ]); // Locate the camera here (inverted matrix).\r\n context.globals.graphics_state.projection_transform = Mat4.perspective( Math.PI/4, context.width/context.height, .1, 1000 );\r\n \r\n const shapes = { 'triangle' : new Triangle(), // At the beginning of our program, load one of each of these shape \r\n 'strip' : new Square(), // definitions onto the GPU. NOTE: Only do this ONCE per shape\r\n 'bad_tetrahedron' : new Tetrahedron( false ), // design. Once you've told the GPU what the design of a cube is,\r\n 'tetrahedron' : new Tetrahedron( true ), // it would be redundant to tell it again. You should just re-use\r\n 'windmill' : new Windmill( 10 ), // the one called \"box\" more than once in display() to draw\r\n 'box' : new Cube(), // multiple cubes. Don't define more than one blueprint for the\r\n 'ball' : new Subdivision_Sphere( 4 ) }; // same thing here.\r\n this.submit_shapes( context, shapes );\r\n \r\n [ this.hover, this.t ] = [ false, 0 ]; // Define a couple of data members called \"hover\" and \"t\".\r\n \r\n // *** Materials: *** Define more data members here, returned from the material() function of our shader. Material objects contain\r\n // shader configurations. They are used to light and color each shape. Declare new materials as temps when\r\n // needed; they're just cheap wrappers for some numbers. 1st parameter: Color (4 floats in RGBA format).\r\n this.clay = context.get_instance( Phong_Shader ).material( Color.of( .9,.5,.9, 1 ), { ambient: .4, diffusivity: .4 } );\r\n this.plastic = this.clay.override({ specularity: .6 });\r\n this.glass = context.get_instance( Phong_Shader ).material( Color.of( .5,.5, 1,.2 ), { ambient: .4, specularity: .4 } );\r\n this.fire = context.get_instance( Funny_Shader ).material();\r\n this.stars = this.plastic.override({ texture: context.get_instance( \"assets/stars.png\" ) });\r\n\r\n // *** Lights: *** Values of vector or point lights. They'll be consulted by the shader when coloring shapes. Two different lights \r\n // *per shape* are supported by in the example shader; more requires changing a number in it or other tricks.\r\n // Arguments to construct a Light(): Light source position or vector (homogeneous coordinates), color, and intensity.\r\n this.lights = [ new Light( Vec.of( 30, 30, 34, 1 ), Color.of( 0, .4, 0, 1 ), 100000 ),\r\n new Light( Vec.of( -10, -20, -14, 0 ), Color.of( 1, 1, .3, 1 ), 100 ) ];\r\n }", "function init() {\n var container = document.createElement('div');\n document.body.appendChild(container);\n\n camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 40);\n camera.position.z = 10;\n\n scene = new THREE.Scene();\n\n renderer = new THREE.WebGLRenderer();\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(window.innerWidth, window.innerHeight);\n container.appendChild(renderer.domElement);\n\n var manager = new THREE.LoadingManager();\n manager.onProgress = function (item, loaded, total) {\n console.log(item, loaded, total);\n };\n\n var onProgress = function (xhr) {\n if (xhr.lengthComputable) {\n var percentComplete = xhr.loaded / xhr.total * 100;\n console.log(Math.round(percentComplete, 2) + '% downloaded');\n }\n };\n\n var onError = function (xhr) { };\n\n var loader = new THREE.OBJLoader(manager);\n loader.load('./resources/wt_teapot.obj', function (object) {\n loadedObject = object;\n createScene();\n }, onProgress, onError);\n\n var customObjFile = document.getElementById('custom-obj-file');\n customObjFile.addEventListener('change', function () {\n if (this.files[0]) {\n var filename = URL.createObjectURL(this.files[0]);\n loader.load(filename, function (object) {\n loadedObject = object;\n clearScene();\n createScene();\n }, onProgress, onError);\n }\n });\n\n var uploadBtn = document.getElementById('upload-btn');\n uploadBtn.addEventListener('click', function () {\n customObjFile.click();\n });\n\n var instanceSlider = document.getElementById('instance-slider');\n instanceSlider.addEventListener('input', function () {\n instances = instanceSlider.value;\n clearScene();\n createScene();\n });\n\n var subdivisionSlider = document.getElementById('subdivision-slider');\n subdivisionSlider.addEventListener('input', function () {\n subdivisions = subdivisionSlider.value;\n clearScene();\n createScene();\n });\n\n container.addEventListener('mousedown', function () {\n if (needsReset) {\n return;\n }\n start = Date.now();\n explodeGeometry(model.geometry);\n });\n\n window.addEventListener('resize', function () {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\n });\n\n animate();\n}", "function Sphere( radius, segmentsY, segmentsX ) {\n Drawable.call( this );\n radius = radius || 1;\n\n segmentsY = segmentsY || 10;\n segmentsX = segmentsX || segmentsY;\n\n var R = radius;\n var p = segmentsY;\n var m = segmentsX;\n\n var model = {\n vertices: [],\n indices: []\n };\n \n var prev = function( x, m ) {\n if ( x === 0 ) {\n return ( m - 1 );\n }\n else {\n return ( x -1 );\n }\n };\n \n var y, x, z, r,cnt = 0, cnt2 = 0;\n for ( var i = 1; i < p-1; i++ ) { // end points are missing\n y = R*Math.sin( -Math.PI/2 + i*Math.PI/( p - 1 ) );\n r = R*Math.cos( -Math.PI/2 + i*Math.PI/( p - 1 ) );\n //console.log( \"y , r \" ,y, r );\n for ( var k = 0; k < m; k++ ) {\n x = r*Math.cos( 2*Math.PI*k/ m );\n z = r*Math.sin( 2*Math.PI*k/ m );\n //console.log( x, z );\n model.vertices[ cnt ] = x;\n model.vertices[ cnt+1 ] = y;\n model.vertices[ cnt+2 ] = z;\n cnt = cnt+3;\n }\n //make the triangle\n \n \n if ( i > 1 ) {\n var st = ( i - 2 )*m;\n for ( x = 0; x < m; x++ ) {\n model.indices[ cnt2 ] = st + x;\n model.indices[ cnt2+1 ] = st + prev( x, m ) + m;\n model.indices[ cnt2+2 ] = st + x + m;\n cnt2 += 3;\n \n model.indices[ cnt2 ] = st + x;\n model.indices[ cnt2+1 ] = st + prev( x, m );\n model.indices[ cnt2+2 ] = st + prev( x, m ) + m;\n cnt2 += 3;\n }\n }\n }\n \n model.vertices[ cnt ] = 0;\n model.vertices[ cnt+1 ] = -R;\n model.vertices[ cnt+2 ] = 0;\n var down = cnt/3;\n cnt += 3;\n model.vertices[ cnt ] = 0;\n model.vertices[ cnt+1 ] = R;\n model.vertices[ cnt+2 ] = 0;\n cnt += 3;\n \n var top = down + 1;\n for ( x = 0; x < m; x++ ) {\n model.indices[ cnt2 ] = down;\n model.indices[ cnt2+1 ] = prev( x, m );\n model.indices[ cnt2+2 ] = x;\n cnt2 += 3;\n \n model.indices[ cnt2 ] = down - m + x;\n model.indices[ cnt2+1 ] = down - m + prev( x, m );\n model.indices[ cnt2+2 ] = top;\n cnt2 +=3;\n }\n\n\n\n var vertices = new Buffer().setData( model.vertices );\n// uvcoords = new Buffer().setData( ret.uvcoords );\n// normals = new Buffer().setData( ret.normals );\n\n vertices = new VertexAttribute( 'Position' ).setBuffer( vertices );\n// uvcoords = new VertexAttribute( 'UVCoord' ).setBuffer( uvcoords ).setSize( 2 );\n// normals = new VertexAttribute( 'Normal' ).setBuffer( normals );\n\n var indices = new Buffer( Buffer.ELEMENT_BUFFER ).setData( model.indices );\n\n m = new Mesh();\n m.setVertexAttribute( vertices );\n// m.setVertexAttribute( normals );\n// m.setVertexAttribute( uvcoords );\n m.setIndexBuffer( indices );\n\n this.mesh = m;\n}", "function q(){var t,e,i,n,r,a=createjs,s=new a.StageGL(\"target\"),o=[],c=[],h=8,u=.2,l=2e3,f=2.5;a.Ticker.timingMode=a.Ticker.RAF,a.Ticker.on(\"tick\",d),s.setClearColor(\"#201624\");while(c.length<l)p();function d(i){for(var n=i.delta,a=1*r,o=0,h=c.length;o<h;o++){var l=c[o],d=l.t+=1e-4*n*f*l.speed,p=d%1*t-t/2;p+=Math.cos(d*l.p1)*r*l.a1*u;var v=Math.sin(d*Math.PI*4+Math.PI)*r*l.r*.25;v+=Math.sin(d*l.p1)*r*l.a1*u;var _=Math.cos(d*Math.PI*4+Math.PI)*r*l.r*.25;_+=Math.cos(d*l.p1)*r*l.a1*u;var g=a/(_+a);p*=g,v*=g,l.x=p+t/2,l.y=v+e/2,l.getChildAt(1).alpha=1-g,l.scaleX=l.scaleY=.3*Math.pow(g*(1+l.size),2)}s.update()}function p(){if(void 0===i){var t=new a.Shape,e=new a.Shape,r=t.graphics;r.f(\"#fff\").dc(0,0,h);var u=Math.ceil(Math.log(h)/Math.log(2)),l=Math.pow(2,u);t.cache(-l,-l,2*l,2*l),i=new a.Bitmap(t.cacheCanvas);r=e.graphics;r.c().rf([\"hsla(0,0%,100%,0.4)\",\"hsla(180,100%,75%,0)\"],[0,1],0,0,0,0,0,h).dc(0,0,h),e.cache(-l,-l,2*l,2*l),n=new a.Bitmap(e.cacheCanvas),n.scaleX=n.scaleY=2,n.x=n.y=-l,n.alpha=1}return o=new a.Container,o.alpha=.8,o.addChild(n.clone(),i.clone()),o.t=v(Math.PI),o.speed=Math.pow(v(.5,1),3),o.size=1-o.speed,o.a1=v(0,.7)*v(0,o.speed)*(v(1)<.5?-1:1),o.r=1,o.p1=v(.3,.7),c.push(o),s.addChild(o),o}function v(t,e){return void 0===e&&(e=t,t=0),Math.random()*(e-t)+t}function _(){t=window.innerWidth,e=window.innerHeight,Math.max(t,e),r=Math.min(t,e),target.width=t,target.height=e,s.updateViewport(t,e),s.update()}window.addEventListener(\"resize\",_),_()}", "function starship_bs_creation() {\r\n const material = new THREE.MeshBasicMaterial({ color: 0xffff00 })\r\n const geometry = new THREE.SphereGeometry(25, 15, 15)\r\n geometry.computeBoundingSphere();\r\n star_ship_bs = new THREE.Mesh(geometry, material);\r\n star_ship_bs.visible = false\r\n scene.add(star_ship_bs);\r\n vaisseau_bs = new THREE.Sphere(new THREE.Vector3(0, 0, 0), geometry.boundingSphere.radius);\r\n}", "function Player () {\n \n var self = this;\n \n // Mesh ======================================================================\n\n\tthis.size = new THREE.Vector3( 0.9, 0.9, 1.8 );\n this.position = new THREE.Vector3( 0, 0, 0.45 );\n this.rotation = new THREE.Euler( 0, 0, 0, 'ZYX' );\n \n this.bottomSphereMesh = new THREE.Mesh(\n new THREE.SphereGeometry( 0.45, 32, 32, Math.PI, Math.PI, 0, Math.PI ),\n new THREE.MeshLambertMaterial( { color: 0x166eb6, wireframe: false, wrapAround: true } )\n );\n \n this.cylinderMesh = new THREE.Mesh(\n new THREE.CylinderGeometry( 0.45, 0.45, 0.9, 64, 8, true ),\n new THREE.MeshLambertMaterial( { color: 0x166eb6, wireframe: false, wrapAround: true } )\n );\n this.cylinderMesh.rotation.y = Math.PI / 32;\n this.cylinderMesh.rotation.x = Math.PI / 2;\n this.cylinderMesh.position.z = 0.45;\n \n this.topSphereMesh = new THREE.Mesh(\n new THREE.SphereGeometry( 0.45, 32, 32, 0, Math.PI, 0, Math.PI ),\n new THREE.MeshLambertMaterial( { color: 0x166eb6, wireframe: false, wrapAround: true } )\n );\n this.topSphereMesh.position.z = 0.9;\n\n this.cylinderMesh.updateMatrix();\n this.bottomSphereMesh.geometry.merge( this.cylinderMesh.geometry, this.cylinderMesh.matrix );\n\n this.topSphereMesh.updateMatrix();\n this.bottomSphereMesh.geometry.merge( this.topSphereMesh.geometry, this.topSphereMesh.matrix );\n \n this.bottomSphereMesh.geometry.mergeVertices();\n\n this.mesh = this.bottomSphereMesh;\n this.mesh.position.set( this.position.x, this.position.y, this.position.z );\n \n this.mesh.castShadow = true;\n this.mesh.receiveShadow = true;\n \n // Physics ===================================================================\n \n this.physics.enabled = true;\n \n this.physics.sphereShape = new CANNON.Sphere( 0.45 );\n this.physics.cylinderShape = new CANNON.Cylinder( 0.45, 0.45, 0.9, 64 );\n this.physics.mass = 20;\n \n this.physics.body = new CANNON.Body( { mass: this.physics.mass } );\n // this.physics.body.type = CANNON.Body.KINEMATIC; // TODO Consider if implementing this would be superior to DYNAMIC\n this.physics.body.addShape( this.physics.sphereShape, new CANNON.Vec3( this.position.x, this.position.y, this.position.z - 0.45) );\n this.physics.body.addShape( this.physics.cylinderShape, new CANNON.Vec3( this.position.x, this.position.y, this.position.z ) );\n this.physics.body.addShape( this.physics.sphereShape, new CANNON.Vec3( this.position.x, this.position.y, this.position.z + 0.45 ) );\n \n this.physics.body.position.set( this.position.x, this.position.y, this.position.z );\n this.physics.body.quaternion.setFromEuler( this.rotation.x, this.rotation.y, this.rotation.z, 'ZYX');\n \n this.physics.body.collisionFilterGroup = 2; // Collision group 2, collides with everything, but the player rays won't collide with it\n this.physics.body.collisionFilterMask = 1 | 2 | 4;\n \n this.physics.body.material = theWorld.physics.playerMaterial;\n this.physics.body.fixedRotation = true; // prevents rotation\n this.physics.body.updateMassProperties();\n this.physics.body.gravity = new CANNON.Vec3( 0, 0, 0 );\n this.physics.body.playerGravity = new CANNON.Vec3( 0, 0, -35 );\n // The is the custom value for gravity applied just to the player\n // Can be set to theWorld.physics.gravity if you want\n \n this.physics.groundContact = false;\n this.physics.groundRay = false;\n this.physics.onGround = false;\n \n theWorld.physics.add( this.physics.body );\n \n // Interaction and Commands ==================================================\n \n this.state = {};\n this.commands = {};\n this.resetCommands();\n \n // Builder State =============================================================\n \n this.builder = new Builder();\n this.state.builder = new PlayerState();\n this.state.builder.toolset = this.builder;\n \n this.state.builder.update = function () {\n\n var interactVector = new THREE.Vector3( 0, 1, 0 );\n interactVector.applyAxisAngle( X_AXIS, self.rotation.x );\n interactVector.applyAxisAngle( Z_AXIS, self.rotation.z );\n interactVector.multiplyScalar( self.interactionDistance );\n \n var rayFrom = new CANNON.Vec3().copy( self.physics.body.position );\n rayFrom.z = rayFrom.z + ( self.size.z * 0.4 );\n \n var rayTo = new CANNON.Vec3().copy( rayFrom ).vadd( interactVector );\n \n self.builder.rayToWorld( rayFrom, rayTo );\n \n };\n \n this.state.builder.ui = \"builderBar\";\n UI[\"builderBar\"].makeButtons( this.builder.tools );\n \n this.state.builder.onEnter = function () { theOverlay.elements.builderBar.toggle( true ) };\n this.state.builder.onExit = function () {\n theOverlay.elements.builderBar.toggle( false );\n self.builder.cursor.place( 0, 0, -100 );\n self.builder.cursorSnap.place( 0, 0, -100 );\n };\n \n \n // Interact State ============================================================\n \n this.equipment = new Equipment();\n \n this.state.interact = new PlayerState();\n this.state.interact.toolset = this.equipment;\n\n this.state.interact.ui = \"equipmentBar\";\n UI[\"equipmentBar\"].makeButtons( this.equipment.tools );\n\n this.state.interact.onEnter = function () { theOverlay.elements.equipmentBar.toggle( true ) };\n this.state.interact.onExit = function () { theOverlay.elements.equipmentBar.toggle( false ) };\n \n // Options ===================================================================\n \n this.walkForce = 40;\n this.walkForceInAir = 15;\n this.maxWalkVelocity = 10;\n // this.walkVelocity = new CANNON.Vec3( 0, 0, 0 );\n \n this.jumpForce = 250; // Impulse\n // this.jumpVelocity = new CANNON.Vec3( 0, 0, 0 );\n \n this.frictionGround = 7;\n this.frictionAir = 0.1;\n\n this.rotationSpeed = Math.PI * 0.75; // Radians per second\n // Rate at which the player turns using the keyboard\n\n this.interactionDistance = 6;\n \n // Have to define it this way so the previous state button works\n this.state.current = new PlayerState( this.state.interact );\n this.state.current.setState( this.state.builder );\n \n}", "constructor(scene) {\n this.scene = scene;\n\n let geo = new T.SphereBufferGeometry(.5, 30, 30);\n let mat = new T.MeshStandardMaterial({color: \"blue\"});\n \n // let botLeft = [];\n // for (let i = 0; i < 10; i++) {\n // let mesh = new T.Mesh(geo,mat);\n // scene.add(mesh);\n // }\n //split objects into 4 quadrants\n\n // build ground\n let groundGeo = new T.PlaneBufferGeometry(30,30);\n let groundMat = new T.MeshStandardMaterial( {color: \"red\"});\n this.ground = new T.Mesh(groundGeo, groundMat);\n this.ground.receiveShadow = true;\n this.ground.rotateX(2*Math.PI - Math.PI / 2);\n scene.add(this.ground);\n this.worldSize = 15;\n\n // build objects\n this.objects = [];\n let mesh1 = new T.Mesh(geo, mat);\n mesh1.position.x = -10;\n mesh1.position.y = .5;\n mesh1.position.z = -10;\n this.objects.push(mesh1);\n\n let mesh2 = new T.Mesh(geo, mat);\n mesh2.position.x = -5;\n mesh2.position.y = .5;\n mesh2.position.z = 8;\n this.objects.push(mesh2);\n\n let mesh3 = new T.Mesh(geo, mat);\n mesh3.position.x = -8;\n mesh3.position.y = .5;\n mesh3.position.z = -8;\n this.objects.push(mesh3);\n\n let mesh4 = new T.Mesh(geo, mat);\n mesh4.position.x = -12;\n mesh4.position.y = .5;\n mesh4.position.z = -5;\n this.objects.push(mesh4);\n\n let defGeo = new T.ConeBufferGeometry(1,1,50);\n let defMat = new T.MeshStandardMaterial({color: \"yellow\"});\n\n this.defenders = [];\n this.def2 = new T.Mesh(defGeo, defMat); // the following defender\n this.def2.position.x = 0;\n this.def2.position.z = -15;\n this.def2.position.y = .5;\n //this.scene.add(this.def2);\n this.defenders.push(this.def2);\n\n for (let i = 0; i < this.defenders.length; i++) {\n this.scene.add(this.defenders[i]);\n }\n\n for (let i = 0; i < this.objects.length; i++) {\n this.scene.add(this.objects[i]);\n }\n }", "compute(pointer1, pointer2) {\n\n const nav = this.viewer.navigation\n\n const canvas = this.viewer.canvas\n\n const camera = nav.getCamera()\n\n // build 4 rays to project the 4 corners\n // of the selection window\n\n const ray1 = this.pointerToRay(\n canvas, camera, pointer1)\n\n const ray2 = this.pointerToRay(\n canvas, camera, {\n clientX: pointer2.clientX,\n clientY: pointer1.clientY\n })\n\n const ray3 = this.pointerToRay(\n canvas, camera, pointer2)\n\n const ray4 = this.pointerToRay(\n canvas, camera, {\n clientX: pointer1.clientX,\n clientY: pointer2.clientY\n })\n\n // first we compute the top of the pyramid\n const top = new THREE.Vector3(0, 0, 0)\n\n top.add(ray1.origin)\n top.add(ray2.origin)\n top.add(ray3.origin)\n top.add(ray4.origin)\n\n top.multiplyScalar(0.25)\n\n // we use the bounding sphere to determine\n // the height of the pyramid\n const {\n center,\n radius\n } = this.boundingSphere\n\n // compute distance from pyramid top to center\n // of bounding sphere\n\n const dist = new THREE.Vector3(\n top.x - center.x,\n top.y - center.y,\n top.z - center.z)\n\n // compute height of the pyramid:\n // to make sure we go far enough,\n // we add the radius of the bounding sphere\n\n const height = radius + dist.length()\n\n // compute the length of the side edges\n\n const angle = ray1.direction.angleTo(\n ray2.direction)\n\n const length = height / Math.cos(angle * 0.5)\n\n // compute bottom vertices\n\n const v1 = new THREE.Vector3(\n ray1.origin.x + ray1.direction.x * length,\n ray1.origin.y + ray1.direction.y * length,\n ray1.origin.z + ray1.direction.z * length)\n\n const v2 = new THREE.Vector3(\n ray2.origin.x + ray2.direction.x * length,\n ray2.origin.y + ray2.direction.y * length,\n ray2.origin.z + ray2.direction.z * length)\n\n const v3 = new THREE.Vector3(\n ray3.origin.x + ray3.direction.x * length,\n ray3.origin.y + ray3.direction.y * length,\n ray3.origin.z + ray3.direction.z * length)\n\n const v4 = new THREE.Vector3(\n ray4.origin.x + ray4.direction.x * length,\n ray4.origin.y + ray4.direction.y * length,\n ray4.origin.z + ray4.direction.z * length)\n\n var geometry = new THREE.Geometry()\n\n geometry.vertices = [\n v1, v2, v3, v4, top\n ]\n\n geometry.faces = [\n new THREE.Face3(0, 1, 2),\n new THREE.Face3(0, 2, 3),\n new THREE.Face3(1, 0, 4),\n new THREE.Face3(2, 1, 4),\n new THREE.Face3(3, 2, 4),\n new THREE.Face3(0, 3, 4)\n ]\n\n geometry.computeFaceNormals()\n\n return new THREE.Mesh(geometry, this.material)\n }", "function createScene()\n{\n\tconst light = new THREE.PointLight( \"rgb(255, 255, 255)\" );\n\t\tlight.position.set( 0, 10, 3 );\n\t\tlight.castShadow = true;\n\t\tlight.shadow.mapSize.width = 1024; // default\n\t\tlight.shadow.mapSize.height = 1024; // default\n\tscene.add( light );\n\n\tscene.add( new THREE.HemisphereLight( \"rgb(80, 80, 80)\" ) );\n\n\tconst floorGeometry = new THREE.PlaneGeometry( 20, 20 );\n\tconst floorMaterial = new THREE.MeshLambertMaterial( {color: \"rgb(80, 80, 80)\"} );\n\tconst floor = new THREE.Mesh( floorGeometry, floorMaterial );\n\tfloor.rotation.x = -Math.PI / 2;\n\tfloor.position.y -= 0.2;\t\n\tfloor.receiveShadow = true;\n\tscene.add( floor );\n\n\tconst geometries = [\n\t\tnew THREE.BoxGeometry( 0.2, 0.2, 0.2 ),\n\t\tnew THREE.ConeGeometry( 0.2, 0.2, 64 ),\n\t\tnew THREE.CylinderGeometry( 0.2, 0.2, 0.2, 64 ),\n\t\tnew THREE.TorusGeometry( 0.2, 0.04, 64, 32 ),\n\t\tnew THREE.BoxGeometry( 0.2, 0.2, 0.2 )\t\t\n\t];\n\n\tfor ( let i = 0; i < 5; i ++ ) {\n\t\n\t\tconst geometry = geometries[i];\n\t\tconst material = new THREE.MeshPhongMaterial( {color: Math.random() * 0xffffff} );\n\t\n\t\tlet id = i+1;\n\t\tconst object = new THREE.Mesh( geometry, material );\n\t\t\tobject.name = \"Object \" + id;\n\t\n\t\tobject.position.x = i * 2 - 4;\n\t\tobject.position.y = 2;\n\t\tobject.position.z = -4;\n\t\tobject.scale.setScalar( 4.0 );\n\t\n\t\tobject.castShadow = true;\n\t\tobject.receiveShadow = true;\n\t\n\t\tgroup.add( object );\n\t}\t\t\n\tscene.add( group );\n}", "function setup() {\n // create a new div which will be contained in the body html tag\n container = document.createElement('div');\n document.body.appendChild(container);\n\n // calling adding the add start overlay function\n addStartOverlay();\n addGameOverOverlay();\n addWinnerOverlay();\n\n // Setup for the camera in a 3D perspective\n camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.35, 5000);\n camera.position.set(0, 1500, 500);\n\n // Setup for the controls\n controls = new THREE.TrackballControls(camera);\n controls.rotateSpeed = 5.0;\n controls.zoomSpeed = 2.2;\n controls.panSpeed = 1.8;\n controls.noZoom = false;\n controls.noPan = false;\n controls.staticMoving = true;\n controls.dynamicDampingFactor = 0.3;\n\n // creating a scene using Three Js\n scene = new THREE.Scene();\n\n // Setup the background by giving the 6 images of the cube\n var loader = new THREE.CubeTextureLoader().setPath('assets/images/').load([\n 'px.jpg', 'nx.jpg',\n 'py.jpg', 'ny.jpg',\n 'pz.jpg', 'nz.jpg'\n ], function(texture) {\n var pmremGenerator = new THREE.PMREMGenerator(texture);\n pmremGenerator.update(renderer);\n var pmremCubeUVPacker = new THREE.PMREMCubeUVPacker(pmremGenerator.cubeLods);\n pmremCubeUVPacker.update(renderer);\n\n var envMap = pmremCubeUVPacker.CubeUVRenderTarget.texture;\n\n // adding light on the scene\n scene.add(new THREE.AmbientLight(0x505050));\n\n // setting up another light, this one is a spot light\n var light = new THREE.SpotLight(0xffffff, 1.5);\n light.position.set(0, 500, 3000);\n light.angle = Math.PI / 4;\n\n light.castShadow = true;\n light.shadow.camera.near = 500;\n light.shadow.camera.far = 4000;\n light.shadow.mapSize.width = 1024;\n light.shadow.mapSize.height = 1024;\n\n // adding spotlight to the scene\n scene.add(light);\n\n // loading the 3D baby gltf file and adding it to the scene\n var loader = new THREE.GLTFLoader().setPath('assets/gltf/');\n loader.load('BabyModel.gltf', function(gltf) {\n scene.add(gltf.scene);\n });\n\n // setup the spheres, 10 in total\n var sphereGeometry = new THREE.SphereGeometry(40, 50, 50, 0, Math.PI * 2, 0, Math.PI * 2);\n for (var i = 0; i < 10; i++) {\n var material = new THREE.MeshLambertMaterial({\n // give each a random color\n color: Math.random() * 0xffffff\n });\n // create a new sphere\n var sphere = new THREE.Mesh(sphereGeometry, material);\n // set the position as random\n sphere.position.set(Math.random() * 1000 - 500, Math.random() * 600 - 300, Math.random() * 800 - 400);\n // add created sphere to the scene\n scene.add(sphere);\n // add sphere to objects array\n objects.push(sphere);\n // add sphere object to safeToy object array\n safeToyObject.push(sphere);\n }\n\n // set up the rectangles, 20 in total\n var geometry = new THREE.BoxBufferGeometry(40, 40, 40);\n for (var i = 0; i < 20; i++) {\n var toy = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({\n // give each a random color\n color: Math.random() * 0xffffff\n }));\n // set position as random\n toy.position.set(Math.random() * 1000 - 600, Math.random() * 600 - 200, Math.random() * 800 - 300);\n // set rotation as random\n toy.rotation.x = Math.random() * 2 * Math.PI;\n toy.rotation.y = Math.random() * 2 * Math.PI;\n toy.rotation.z = Math.random() * 2 * Math.PI;\n // set scale as random\n toy.scale.x = Math.random() * 2 + 1;\n toy.scale.y = Math.random() * 2 + 1;\n toy.scale.z = Math.random() * 2 + 1;\n // give and receive shadow\n toy.castShadow = true;\n toy.receiveShadow = true;\n // add rectangle to the scene\n scene.add(toy);\n // add rectangle to objects array\n objects.push(toy);\n }\n\n // generate the background\n pmremGenerator.dispose();\n pmremCubeUVPacker.dispose();\n scene.background = texture;\n });\n\n // create rendering three js object\n renderer = new THREE.WebGLRenderer({\n antialias: true\n });\n // set up the rendering object\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.gammaOutput = true;\n // add render element to the div container\n container.appendChild(renderer.domElement);\n // set up an event listener on window resize, call the resize function\n window.addEventListener('resize', onWindowResize, false);\n\n // set up of the three js drag controls\n var dragControls = new THREE.DragControls(objects, camera, renderer.domElement);\n // on drag start, don't enable controls\n dragControls.addEventListener('dragstart', function() {\n controls.enabled = false;\n });\n // on drag end, enbale controls\n dragControls.addEventListener('dragend', function() {\n controls.enabled = true;\n });\n\n // set up Three js raycaster, this enables to track clicks on 3D objects\n rayCaster = new THREE.Raycaster();\n renderer.domElement.addEventListener('click', raycast, false);\n\n // when click on overlay, hide the start overlay\n var startOverlay = $('.start');\n startOverlay.click(\n function() {\n startOverlay.hide();\n }\n );\n}", "function init() {\n\n renderer = new THREE.WebGLRenderer({antialias: true, preserveDrawingBuffer: true});\n renderer.clear()\n renderer.autoClear = false;\n renderer.sortObjects = false;\n renderer.setClearColor( P.styles.backgroundColor);\n renderer.setPixelRatio( window.devicePixelRatio );\n renderer.setSize( window.innerWidth, window.innerHeight );;\n \n // instanced meshes need not to be sorted, they are in the correct order\n renderer.sortObjects = false\n\n //renderer.shadowMap.enabled = true;\n //renderer.shadowMap.renderReverseSided = false\n //renderer.shadowMap.renderSingleSided = false;\n //renderer.shadowMap.height = 4096\n //renderer.shadowMap.width = 4096\n\n // shut safari/firefox up\n var ctx = renderer.context;\n var old = ctx.getShaderInfoLog;\n ctx.getShaderInfoLog = function () { \n var info = old.apply(ctx, arguments);\n if (info.indexOf('GL_ARB_gpu_shader5') > -1)\n return ''\n return info };\n\n var container = document.getElementById( 'container' );\n container.appendChild( renderer.domElement );\n \n renderer.domElement.setAttribute('id', 'mainCanvas')\n P.gestures(clickable)\n\n\n P.Scene.setCamera()\n \n console.log('animations', P.animate.progress ? 'disabled' : 'enabled')\n var scene = P.Scene.build();\n\n controls = new THREE.OrbitControls( camera, wrapper );\n controls.rotateSpeed = 0.5;\n controls.enablePan = false;\n if (location.search.indexOf('controls') == -1) {\n controls.enableZoom = false;\n // How far you can orbit vertically, upper and lower limits.\n // Range is 0 to Math.PI radians.\n controls.minPolarAngle = - Math.PI / 2; // radians\n controls.maxPolarAngle = Math.PI / 2 * 0.75; // radians\n\n // How far you can orbit horizontally, upper and lower limits.\n // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n controls.minAzimuthAngle = Math.PI / 4; // radians\n controls.maxAzimuthAngle = Math.PI / 2 * 1.5; // radians\n\n }\n\n controls.addEventListener( 'change', function() {\n\n P.Scene.measureCamera()\n P.Panel.close()\n P.Scene.onCameraMove(true)\n if (!P.animate.scheduled)\n P.animate.start()\n } );\n\n var rotated = null;\n\n\n if (!controls.originalUpdate)\n controls.originalUpdate = controls.update;\n\n controls.update = function(type) {\n controls.target.x -= 0.00000001\n P.animate.cancel(camera.position, 'x');\n P.animate.cancel(camera.position, 'y');\n P.animate.cancel(camera.position, 'z');\n P.animate.cancel(camera.rotation, 'x');\n P.animate.cancel(camera.rotation, 'y');\n P.animate.cancel(camera.rotation, 'z');\n if (type == 'rotate' && !rotated) {\n rotated = controls.target.clone();\n }\n var result = controls.originalUpdate.apply(controls, arguments);\n controls.target.x += 0.00000001\n return result;\n }\n\n controls.finish = function() {\n if (rotated) {\n P.Scene.rotatedPoint = camera.position.clone().sub(rotated);\n P.Scene.rotationAngle = camera.rotation.clone();\n P.Scene.current.onInitialize();\n rotated = false;\n }\n }\n // generate instanced models\n \n P.areas = []\n P.instances();\n\n P.Atlas.getIframe(function(iframe) {\n \n P.Label.instances.material.map = new P.Atlas(P.Label.instances, 512, 128, iframe, 2048, 2048);\n P.Label.instances.material.map.fetchBufferSize = 2;\n P.Label.instances.material.defines.ATLAS_WIDTH = '2048.';\n P.Label.instances.material.defines.ATLAS_HEIGHT = '2048.';\n P.Label.instances.material.defines.GRID_WIDTH = '512.';\n P.Label.instances.material.defines.GRID_HEIGHT = '128.';\n P.Label.instances.material.defines.ATLAS_OFFSET = '1.';\n\n P.Label.instances.front.material.map = P.Label.instances.material.map\n P.Label.instances.front.material.defines.ATLAS_WIDTH = '2048.';\n P.Label.instances.front.material.defines.ATLAS_HEIGHT = '2048.';\n P.Label.instances.front.material.defines.GRID_WIDTH = '512.';\n P.Label.instances.front.material.defines.GRID_HEIGHT = '128.';\n P.Label.instances.front.material.defines.ATLAS_OFFSET = '1.';\n\n P.Panel.instances.material.map = new P.Atlas(P.Panel.instances, 1024, 256, iframe, 1024, 2048);\n P.Panel.instances.material.map.fetchBufferSize = 2;\n P.Panel.instances.material.defines.ATLAS_WIDTH = '1024.';\n P.Panel.instances.material.defines.ATLAS_HEIGHT = '2048.';\n P.Panel.instances.material.defines.GRID_WIDTH = '1024.';\n P.Panel.instances.material.defines.GRID_HEIGHT = '256.';\n P.Panel.instances.material.defines.ATLAS_OFFSET = '1.';\n\n P.Person.instances.material.map = new P.Atlas(P.Person.instances, 200, 200, iframe, 2048, 4096);\n P.Person.instances.material.defines.ATLAS_WIDTH = '2048.';\n P.Person.instances.material.defines.ATLAS_HEIGHT = '4096.';\n P.Person.instances.material.defines.GRID_WIDTH = '200.';\n P.Person.instances.material.defines.GRID_HEIGHT = '200.';\n P.Person.instances.material.defines.ATLAS_OFFSET = '1.';\n\n P.Company.instances.material.map = P.Person.instances.material.map\n P.Company.instances.material.defines.ATLAS_WIDTH = '2048.';\n P.Company.instances.material.defines.ATLAS_HEIGHT = '4096.';\n P.Company.instances.material.defines.GRID_WIDTH = '200.';\n P.Company.instances.material.defines.GRID_HEIGHT = '200.';\n P.Company.instances.material.defines.ATLAS_OFFSET = '1.';\n\n render(true)\n READY()\n\n })\n\n P.Sprite.instances.material.map = new P.Atlas(P.Sprite.instances, 256, 256, null, 2048, 2048);\n P.Sprite.instances.material.defines.ATLAS_WIDTH = '2048.';\n P.Sprite.instances.material.defines.ATLAS_HEIGHT = '2048.';\n P.Sprite.instances.material.defines.GRID_WIDTH = '256.';\n P.Sprite.instances.material.defines.GRID_HEIGHT = '256.';\n P.Sprite.instances.material.defines.ATLAS_OFFSET = '1.';\n\n P.Sprite.instances.front.material.map = P.Sprite.instances.material.map;\n P.Sprite.instances.front.material.defines.ATLAS_WIDTH = '2048.';\n P.Sprite.instances.front.material.defines.ATLAS_HEIGHT = '2048.';\n P.Sprite.instances.front.material.defines.GRID_WIDTH = '256.';\n P.Sprite.instances.front.material.defines.GRID_HEIGHT = '256.';\n P.Sprite.instances.front.material.defines.ATLAS_OFFSET = '1.';\n\n P.Icon.instances.material.map = P.Sprite.instances.material.map\n P.Icon.instances.material.defines.ATLAS_WIDTH = '2048.';\n P.Icon.instances.material.defines.ATLAS_HEIGHT = '2048.';\n P.Icon.instances.material.defines.GRID_WIDTH = '256.';\n P.Icon.instances.material.defines.GRID_HEIGHT = '256.';\n P.Icon.instances.material.defines.ATLAS_OFFSET = '1.';\n\n P.Icon.instances.front.material.map = P.Sprite.instances.material.map\n P.Icon.instances.front.material.defines.ATLAS_WIDTH = '2048.';\n P.Icon.instances.front.material.defines.ATLAS_HEIGHT = '2048.';\n P.Icon.instances.front.material.defines.GRID_WIDTH = '256.';\n P.Icon.instances.front.material.defines.GRID_HEIGHT = '256.';\n P.Icon.instances.front.material.defines.ATLAS_OFFSET = '1.';\n\n P.Background.instances.material.map = P.Sprite.instances.material.map\n P.Background.instances.material.defines.ATLAS_WIDTH = '2048.';\n P.Background.instances.material.defines.ATLAS_HEIGHT = '2048.';\n P.Background.instances.material.defines.GRID_WIDTH = '256.';\n P.Background.instances.material.defines.GRID_HEIGHT = '256.';\n P.Background.instances.material.defines.ATLAS_OFFSET = '1.';\n\n P.Background.instances.front.material.map = P.Sprite.instances.material.map\n P.Background.instances.front.material.defines.ATLAS_WIDTH = '2048.';\n P.Background.instances.front.material.defines.ATLAS_HEIGHT = '2048.';\n P.Background.instances.front.material.defines.GRID_WIDTH = '256.';\n P.Background.instances.front.material.defines.GRID_HEIGHT = '256.';\n P.Background.instances.front.material.defines.ATLAS_OFFSET = '1.';\n\n P.Furniture.instances.material.map = P.Sprite.instances.material.map\n P.Furniture.instances.material.defines.ATLAS_WIDTH = '2048.';\n P.Furniture.instances.material.defines.ATLAS_HEIGHT = '2048.';\n P.Furniture.instances.material.defines.GRID_WIDTH = '256.';\n P.Furniture.instances.material.defines.GRID_HEIGHT = '256.';\n P.Furniture.instances.material.defines.ATLAS_OFFSET = '1.5';\n\n\n\n// renderer.compile(scene, camera)\n // for ( var l = 0; l < P.areas.length; l ++ ) {\n //// P.scene.add( P.areas[l] );\n // }\n\n // EACH FRAME: Find out which areas are visible, prepare instances\n Object.defineProperty(P.Floor.instances, 'frustumCulled', {\n get: function() {\n if (!renderer.culled) {\n P.Scene.onBeforeCull(renderer)\n renderer.cullingChanged = P.cull(renderer._frustum)\n P.cull.areas(P.areas)\n renderer.culled = true;\n\n } else {\n renderer.cullingChanged = null;\n }\n return false;\n }\n })\n\n\n var axisHelper = new THREE.AxisHelper( 500 );\n if (location.search.indexOf('axis') > -1) \n scene.add( axisHelper );\n\n stats = new Stats();\n if (location.search.indexOf('stats') > -1)\n document.body.appendChild( stats.dom );\n \n if (wrapper.tagName == 'DIV')\n window.onscroll = function(e) {\n if (e.target.tagName != 'DIV' && e.target.tagName != 'SECTION'){\n window.scrollTo(0, 0)\n e.preventDefault()\n }\n }\n\n P.Import.message({\n type: 'energy_saving'\n })\n window.addEventListener( 'orientationchange', onWindowResize, false );\n window.addEventListener( 'resize', onWindowResize, false );\n if (!('ontouchstart' in document)) {\n document.addEventListener( 'mousemove', onMouseMove, false );\n document.addEventListener( 'mouseup', function(e) {\n P.Scene.onDragEnd(e)\n });\n }\n\n //else\n // P.Import.load(P.backend + '/api/users/me_v2/', P.Import.startup)\n\n}", "function createSmokePipeline(_track) {\n const radiusTop = 1;\n const height = 10;\n\n // 1. Create horizontal arrows\n const ctx = document.createElement('canvas').getContext('2d');\n ctx.canvas.width = 64;\n ctx.canvas.height = 64;\n ctx.translate(32, 32);\n ctx.rotate(Math.PI * 0.5);\n ctx.fillStyle = 'rgb(1,129,164)';\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.font = '48px sans-serif';\n ctx.fillText('锟解埥韴�', 0, 0);\n\n texture = new THREE.CanvasTexture(ctx.canvas);\n texture.wrapS = THREE.RepeatWrapping;\n texture.wrapT = THREE.RepeatWrapping;\n texture.repeat.x = 1;\n texture.repeat.y = 3.5;\n\n const stripGeo = _track(new THREE.PlaneBufferGeometry(radiusTop * 1.7, 7));\n const stripMat = _track(\n new THREE.MeshBasicMaterial({\n map: texture,\n opacity: 0.5,\n side: THREE.DoubleSide,\n depthWrite: false,\n depthTest: false,\n transparent: true,\n }),\n );\n stripMesh = _track(new THREE.Mesh(stripGeo, stripMat));\n stripMesh.name = 'Arrow';\n stripMesh.position.set(-2, -1.5, 1.5);\n stripMesh.rotateZ((Math.PI / 180) * -90);\n\n // 2. Create vertical (up) arrows\n const ctxUp = document.createElement('canvas').getContext('2d');\n ctxUp.canvas.width = 64;\n ctxUp.canvas.height = 64;\n ctxUp.translate(28, 28);\n ctxUp.rotate(Math.PI * 0.5);\n ctxUp.fillStyle = 'rgb(1,129,164)';\n ctxUp.textAlign = 'center';\n ctxUp.textBaseline = 'middle';\n ctxUp.font = '48px sans-serif';\n ctxUp.fillText('锟解埥韴�', 0, 0);\n\n textureUp = new THREE.CanvasTexture(ctxUp.canvas);\n textureUp.wrapS = THREE.RepeatWrapping;\n textureUp.wrapT = THREE.RepeatWrapping;\n textureUp.repeat.x = 1;\n textureUp.repeat.y = 2;\n\n const stripGeoUp = _track(new THREE.PlaneBufferGeometry(radiusTop * 1.7, 4));\n const stripMatUp = _track(\n new THREE.MeshBasicMaterial({\n map: textureUp,\n opacity: 0.5,\n side: THREE.DoubleSide,\n depthWrite: false,\n depthTest: false,\n transparent: true,\n }),\n );\n stripMeshUp = _track(new THREE.Mesh(stripGeoUp, stripMatUp));\n stripMeshUp.name = 'ArrowUp';\n stripMeshUp.position.set(-1, -1.5, 1.5);\n stripMeshUp.rotateZ((Math.PI / 180) * -90);\n\n // 2. Create points\n const curve = new THREE.CatmullRomCurve3([\n new THREE.Vector3(2, 0, 5),\n new THREE.Vector3(1, 0, 5),\n new THREE.Vector3(0, 0, 5),\n new THREE.Vector3(-1, 0, 5),\n new THREE.Vector3(-2, 0, 5),\n new THREE.Vector3(-3, 0, 5),\n new THREE.Vector3(-4, 0, 5),\n new THREE.Vector3(-5, 0, 5), // p=8\n //backward\n new THREE.Vector3(-5, 0, 4),\n new THREE.Vector3(-5, 0, 3),\n new THREE.Vector3(-5, 0, 2),\n new THREE.Vector3(-5, 0, 1),\n new THREE.Vector3(-5, 0, 0),\n new THREE.Vector3(-5, 0, -1),\n new THREE.Vector3(-5, 0, -2),\n new THREE.Vector3(-5, 0, -3),\n new THREE.Vector3(-5, 0, -4),\n new THREE.Vector3(-5, 0, -5), // p=18\n // go right\n new THREE.Vector3(-4, 0, -5),\n new THREE.Vector3(-3, 0, -5),\n new THREE.Vector3(-2, 0, -5),\n new THREE.Vector3(-1, 0, -5),\n new THREE.Vector3(0, 0, -5),\n new THREE.Vector3(1, 0, -5),\n new THREE.Vector3(2, 0, -5),\n new THREE.Vector3(3, 0, -5),\n new THREE.Vector3(4, 0, -5),\n new THREE.Vector3(5, 0, -5), // p=28\n // go up\n new THREE.Vector3(5, 1, -5),\n new THREE.Vector3(5, 2, -5),\n new THREE.Vector3(5, 3, -5),\n new THREE.Vector3(5, 4, -5), // p=32\n // forward\n new THREE.Vector3(5, 4, -4),\n new THREE.Vector3(5, 4, -3),\n new THREE.Vector3(5, 4, -2),\n new THREE.Vector3(5, 4, -1),\n new THREE.Vector3(5, 4, 0),\n new THREE.Vector3(5, 4, 1),\n new THREE.Vector3(5, 4, 2),\n new THREE.Vector3(5, 4, 3),\n new THREE.Vector3(5, 4, 4),\n new THREE.Vector3(5, 4, 5), //p=42\n // go left\n new THREE.Vector3(4, 4, 5),\n new THREE.Vector3(3, 4, 5),\n new THREE.Vector3(2, 4, 5),\n new THREE.Vector3(1, 4, 5),\n new THREE.Vector3(0, 4, 5),\n new THREE.Vector3(-1, 4, 5),\n new THREE.Vector3(-2, 4, 5),\n new THREE.Vector3(-3, 4, 5),\n new THREE.Vector3(-4, 4, 5),\n new THREE.Vector3(-5, 4, 5), // p=52\n //backward\n new THREE.Vector3(-5, 4, 4),\n new THREE.Vector3(-5, 4, 3),\n new THREE.Vector3(-5, 4, 2),\n new THREE.Vector3(-5, 4, 1),\n new THREE.Vector3(-5, 4, 0),\n new THREE.Vector3(-5, 4, -1),\n new THREE.Vector3(-5, 4, -2),\n new THREE.Vector3(-5, 4, -3),\n new THREE.Vector3(-5, 4, -4),\n new THREE.Vector3(-5, 4, -5), // p=62\n // go right\n new THREE.Vector3(-4, 4, -5),\n new THREE.Vector3(-3, 4, -5),\n new THREE.Vector3(-2, 4, -5),\n new THREE.Vector3(-1, 4, -5),\n new THREE.Vector3(0, 4, -5),\n new THREE.Vector3(1, 4, -5),\n new THREE.Vector3(2, 4, -5),\n new THREE.Vector3(3, 4, -5),\n new THREE.Vector3(4, 4, -5),\n new THREE.Vector3(5, 4, -5), // p=72\n // go up\n new THREE.Vector3(5, 5, -5),\n new THREE.Vector3(5, 6, -5),\n new THREE.Vector3(5, 7, -5),\n new THREE.Vector3(5, 8, -5), // p=76\n // forward\n new THREE.Vector3(5, 8, -4),\n new THREE.Vector3(5, 8, -3),\n new THREE.Vector3(5, 8, -2),\n new THREE.Vector3(5, 8, -1),\n new THREE.Vector3(5, 8, 0),\n new THREE.Vector3(5, 8, 1),\n new THREE.Vector3(5, 8, 2),\n new THREE.Vector3(5, 8, 3),\n new THREE.Vector3(5, 8, 4),\n new THREE.Vector3(5, 8, 5), //p=86\n // go left\n new THREE.Vector3(4, 8, 5),\n new THREE.Vector3(3, 8, 5),\n new THREE.Vector3(2, 8, 5),\n new THREE.Vector3(1, 8, 5),\n new THREE.Vector3(0, 8, 5),\n new THREE.Vector3(-1, 8, 5),\n new THREE.Vector3(-2, 8, 5),\n new THREE.Vector3(-3, 8, 5),\n new THREE.Vector3(-4, 8, 5),\n new THREE.Vector3(-5, 8, 5), // p=96\n //backward\n new THREE.Vector3(-5, 8, 4),\n new THREE.Vector3(-5, 8, 3),\n new THREE.Vector3(-5, 8, 2),\n new THREE.Vector3(-5, 8, 1),\n new THREE.Vector3(-5, 8, 0),\n new THREE.Vector3(-5, 8, -1),\n new THREE.Vector3(-5, 8, -2),\n new THREE.Vector3(-5, 8, -3),\n new THREE.Vector3(-5, 8, -4),\n new THREE.Vector3(-5, 8, -5), // p106\n // go right\n new THREE.Vector3(-4, 8, -5),\n new THREE.Vector3(-3, 8, -5),\n new THREE.Vector3(-2, 8, -5),\n new THREE.Vector3(-1, 8, -5),\n new THREE.Vector3(0, 8, -5),\n new THREE.Vector3(1, 8, -5),\n new THREE.Vector3(2, 8, -5),\n new THREE.Vector3(3, 8, -5),\n new THREE.Vector3(4, 8, -5),\n new THREE.Vector3(5, 8, -5), // p=116\n // go up\n new THREE.Vector3(5, 9, -5),\n new THREE.Vector3(5, 10, -5),\n new THREE.Vector3(5, 11, -5),\n new THREE.Vector3(5, 12, -5), // p=120\n // forward\n new THREE.Vector3(5, 12, -4),\n new THREE.Vector3(5, 12, -3),\n new THREE.Vector3(5, 12, -2),\n new THREE.Vector3(5, 12, -1),\n new THREE.Vector3(5, 12, 0),\n new THREE.Vector3(5, 12, 1),\n new THREE.Vector3(5, 12, 2),\n new THREE.Vector3(5, 12, 3),\n new THREE.Vector3(5, 12, 4),\n new THREE.Vector3(5, 12, 5), //p=130\n // go left\n new THREE.Vector3(4, 12, 5),\n new THREE.Vector3(3, 12, 5),\n new THREE.Vector3(2, 12, 5),\n new THREE.Vector3(1, 12, 5),\n new THREE.Vector3(0, 12, 5),\n new THREE.Vector3(-1, 12, 5),\n new THREE.Vector3(-2, 12, 5),\n new THREE.Vector3(-3, 12, 5),\n new THREE.Vector3(-4, 12, 5),\n new THREE.Vector3(-5, 12, 5), // p=140\n //backward\n new THREE.Vector3(-5, 12, 4),\n new THREE.Vector3(-5, 12, 3),\n new THREE.Vector3(-5, 12, 2),\n new THREE.Vector3(-5, 12, 1),\n new THREE.Vector3(-5, 12, 0),\n new THREE.Vector3(-5, 12, -1),\n new THREE.Vector3(-5, 12, -2),\n new THREE.Vector3(-5, 12, -3),\n new THREE.Vector3(-5, 12, -4),\n new THREE.Vector3(-5, 12, -5), // p=150\n // go right\n new THREE.Vector3(-4, 12, -5),\n new THREE.Vector3(-3, 12, -5),\n new THREE.Vector3(-2, 12, -5),\n new THREE.Vector3(-1, 12, -5),\n new THREE.Vector3(0, 12, -5),\n new THREE.Vector3(1, 12, -5),\n new THREE.Vector3(2, 12, -5),\n new THREE.Vector3(3, 12, -5),\n new THREE.Vector3(4, 12, -5),\n new THREE.Vector3(5, 12, -5), // p=160\n // go up\n new THREE.Vector3(5, 13, -5),\n new THREE.Vector3(5, 14, -5),\n new THREE.Vector3(5, 15, -5),\n new THREE.Vector3(5, 16, -5), // p=164\n // forward\n new THREE.Vector3(5, 16, -4),\n new THREE.Vector3(5, 16, -3),\n new THREE.Vector3(5, 16, -2),\n new THREE.Vector3(5, 16, -1),\n new THREE.Vector3(5, 16, 0),\n new THREE.Vector3(5, 16, 1),\n new THREE.Vector3(5, 16, 2),\n new THREE.Vector3(5, 16, 3),\n new THREE.Vector3(5, 16, 4),\n new THREE.Vector3(5, 16, 5), //p=174\n // go left\n new THREE.Vector3(4, 16, 5),\n new THREE.Vector3(3, 16, 5),\n new THREE.Vector3(2, 16, 5),\n new THREE.Vector3(1, 16, 5),\n new THREE.Vector3(0, 16, 5),\n new THREE.Vector3(-1, 16, 5),\n new THREE.Vector3(-2, 16, 5),\n new THREE.Vector3(-3, 16, 5),\n new THREE.Vector3(-4, 16, 5),\n new THREE.Vector3(-5, 16, 5), // p=184\n //backward\n new THREE.Vector3(-5, 16, 4),\n new THREE.Vector3(-5, 16, 3),\n new THREE.Vector3(-5, 16, 2),\n new THREE.Vector3(-5, 16, 1),\n new THREE.Vector3(-5, 16, 0),\n new THREE.Vector3(-5, 16, -1),\n new THREE.Vector3(-5, 16, -2),\n new THREE.Vector3(-5, 16, -3),\n new THREE.Vector3(-5, 16, -4),\n new THREE.Vector3(-5, 16, -5), // p=194\n // go right\n new THREE.Vector3(-4, 16, -5),\n new THREE.Vector3(-3, 16, -5),\n new THREE.Vector3(-2, 16, -5),\n new THREE.Vector3(-1, 16, -5),\n new THREE.Vector3(0, 16, -5),\n new THREE.Vector3(1, 16, -5),\n new THREE.Vector3(2, 16, -5),\n new THREE.Vector3(3, 16, -5),\n new THREE.Vector3(4, 16, -5),\n new THREE.Vector3(5, 16, -5), // p=204\n // go up\n new THREE.Vector3(5, 17, -5),\n new THREE.Vector3(5, 18, -5),\n new THREE.Vector3(5, 19, -5),\n new THREE.Vector3(5, 20, -5), // p=208\n // forward\n new THREE.Vector3(5, 20, -4),\n new THREE.Vector3(5, 20, -3),\n new THREE.Vector3(5, 20, -2),\n new THREE.Vector3(5, 20, -1),\n new THREE.Vector3(5, 20, 0),\n new THREE.Vector3(5, 20, 1),\n new THREE.Vector3(5, 20, 2),\n new THREE.Vector3(5, 20, 3),\n new THREE.Vector3(5, 20, 4),\n new THREE.Vector3(5, 20, 5), //p=218\n // go left\n new THREE.Vector3(4, 20, 5),\n new THREE.Vector3(3, 20, 5),\n new THREE.Vector3(2, 20, 5),\n new THREE.Vector3(1, 20, 5),\n new THREE.Vector3(0, 20, 5),\n new THREE.Vector3(-1, 20, 5),\n new THREE.Vector3(-2, 20, 5),\n new THREE.Vector3(-3, 20, 5),\n new THREE.Vector3(-4, 20, 5),\n new THREE.Vector3(-5, 20, 5), // p=228\n //backward\n new THREE.Vector3(-5, 20, 4),\n new THREE.Vector3(-5, 20, 3),\n new THREE.Vector3(-5, 20, 2),\n new THREE.Vector3(-5, 20, 1),\n new THREE.Vector3(-5, 20, 0),\n new THREE.Vector3(-5, 20, -1),\n new THREE.Vector3(-5, 20, -2),\n new THREE.Vector3(-5, 20, -3),\n new THREE.Vector3(-5, 20, -4),\n new THREE.Vector3(-5, 20, -5), // p=238\n ]);\n let num = 238;\n const points = curve.getPoints(num);\n\n // 3. Path\n let path = new THREE.CatmullRomCurve3(points);\n\n // 4. Define params\n let pathSegments = 256, //speed\n tubeRadius = 0.6,\n radiusSegments = 16,\n closed = false;\n\n // 5. Geometry\n let geometry = _track(new THREE.TubeGeometry(path, pathSegments, tubeRadius, radiusSegments, closed));\n\n // 6. Convert Geometry to BufferGoemetry\n geometry = _track(new THREE.BufferGeometry().fromGeometry(geometry));\n nMax = geometry.attributes.position.count;\n\n // 7. Material\n let smokeTexture = _track(new THREE.TextureLoader().load('https://demo.letsee.io/confinity/assets/fog10.png'));\n let material = _track(\n new THREE.MeshBasicMaterial({\n // color: 0x00aee4,\n opacity: 1,\n side: THREE.FrontSide,\n depthWrite: false,\n depthTest: false,\n map: smokeTexture,\n transparent: true,\n }),\n );\n\n // 8. Create tube mesh\n tube = _track(new THREE.Mesh(geometry, material));\n // tube.add( new THREE.AxesHelper( 300 ) );\n tube.name = 'SmokePipeline';\n tube.position.set(0, 0.05, -0.01);\n tube.scale.setScalar(1 / 60);\n tube.rotateY((Math.PI / 180) * 180);\n\n // 9. Create smoke flow\n createSmokeFlow(_track);\n}", "function renderScene() {\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n if (scene === \"one\") {\n if (scaleDown) {\n scale -= 0.005;\n if (scale <= 0) {\n scene = \"two\";\n scaleDown = false;\n scaleUp = true;\n }\n }\n drawBox();\n drawEllipsoid();\n } else if (scene === \"two\") {\n if (scaleUp) {\n scale += 0.005;\n if (scale >= 1) {\n scaleUp = false;\n scaleDown = true;\n }\n } else if (scaleDown) {\n scale -= 0.005;\n if (scale <= 0) {\n scaleUp = true;\n scaleDown = false;\n scene = \"three\";\n }\n }\n for (var i = 0; i < shards.length; i++) {\n updateShard(shards[i]);\n drawShard(shards[i]);\n }\n } else if (scene === \"three\") {\n if (scaleUp) {\n scale += 0.005;\n if (scale >= 1) {\n scaleDown = false;\n scaleUp = false;\n }\n }\n updateSceneThree();\n drawSphere();\n drawStar();\n }\n requestAnimFrame(renderScene)\n}", "function createShapes() {\n for (let i = 0; i < n; i++) {\n var rot2 = new THREE.Matrix4();\n var sca = new THREE.Matrix4();\n var rot = new THREE.Matrix4();\n var tra = new THREE.Matrix4();\n var combined = new THREE.Matrix4();\n\n sca.makeScale(1.5, 1.5, 1.5);\n rot2.makeRotationZ(i * (Math.PI / n));\n tra.makeTranslation(10, 5, 0);\n rot.makeRotationY(i * (2 * Math.PI / n));\n combined.multiply(rot);\n combined.multiply(tra);\n combined.multiply(rot2);\n combined.multiply(sca);\n var color = new THREE.Color(0xffffff);\n color.setHex(Math.random() * 0xffffff);\n cubes[i] = createCube(1, 1, 1, color);\n cubes[i].applyMatrix(combined);\n cubes[i].geometry.computeBoundingBox();\n group.add(cubes[i]);\n }\n var sphere_color = new THREE.Color(0xD3D3D3);\n var sphere = createSphere(5, 24, 24, sphere_color);\n sphere.position.y = 4;\n //addSpotlight over the sphere object\n group.add(sphere);\n}", "function setSkybox(){\n var loader = new THREE.TextureLoader();\n\n var materialArray = [];\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_ft.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_bk.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_up.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_dn.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_rt.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_lf.png') }));\n\n for (var i = 0; i < 6; i++){\n materialArray[i].side = THREE.DoubleSide;\n }\n \n var sky_geometry = new THREE.BoxGeometry(1000, 1000, 1000);\n var skybox = new THREE.Mesh(sky_geometry, materialArray);\n scene.add(skybox);\n}", "function init(){\n scene = new THREE.Scene();\n camera = new THREE.PerspectiveCamera(35, window.innerWidth/window.innerHeight, 300, 10000 );\n renderer = new THREE.WebGLRenderer({antialias:true});\n renderer.setClearColor(\"#000000\");\n renderer.setSize( window.innerWidth, window.innerHeight );\n texture=new THREE.TextureLoader().load( 'image/1.jpg' );\n texture2=new THREE.TextureLoader().load( 'image/bg.jpg' );\n texture3=new THREE.TextureLoader().load( 'image/back.png' );\n texture4=new THREE.TextureLoader().load( 'image/next.png' );\n texture5=new THREE.TextureLoader().load( 'image/s5.png' );\n // to load the texture\n var mtlLoader = new THREE.MTLLoader();\n\n mtlLoader.load(\"model/xuedi.mtl\", function(materials){\n materials.preload();\n\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n\n objLoader.load(\"model/xuedi.obj\", function(mesh){\n mesh.traverse(function(node){\n if( node instanceof THREE.Mesh ){\n node.castShadow = true;\n node.receiveShadow = true;\n }\n });\n var sizeRand = Math.random() * 0.5;\n mesh.scale.set(12,8,8);\n mesh.position.set(0,-180,0);\n mesh.position.z=-1000;\n mesh.rotation.x=0.2;\n //mesh6.rotation.x=0.3;\n scene.add(mesh);\n });\n });\n var mtlLoader2 = new THREE.MTLLoader();\n\n mtlLoader2.load(\"model/yeye.mtl\", function(materials2){\n materials2.preload();\n\n var objLoader2 = new THREE.OBJLoader();\n objLoader2.setMaterials(materials2);\n\n objLoader2.load(\"model/yeye.obj\", function(mesh2){\n mesh2.traverse(function(node){\n if( node instanceof THREE.Mesh ){\n node.castShadow = true;\n node.receiveShadow = true;\n }\n });\n var sizeRand = Math.random() * 0.5;\n mesh2.scale.set(2,2,2);\n mesh2.position.set(-80,-80,0);\n mesh2.position.z=-700;\n mesh2.rotation.y=-6;\n mesh2.rotation.x=0.1;\n //mesh6.rotation.x=0.3;\n scene.add(mesh2);\n });\n });\n var mtlLoader3 = new THREE.MTLLoader();\n\n mtlLoader3.load(\"model/house3.mtl\", function(materials3){\n materials3.preload();\n\n var objLoader3 = new THREE.OBJLoader();\n objLoader3.setMaterials(materials3);\n\n objLoader3.load(\"model/house3.obj\", function(mesh3){\n mesh3.traverse(function(node){\n if( node instanceof THREE.Mesh ){\n node.castShadow = true;\n node.receiveShadow = true;\n }\n });\n var sizeRand = Math.random() * 0.5;\n mesh3.scale.set(20,17,17);\n mesh3.position.set(-600,-130,0);\n mesh3.position.z=-700;\n mesh3.rotation.y=1.8;\n mesh3.rotation.x=0.3;\n //mesh6.rotation.x=0.3;\n scene.add(mesh3);\n });\n });\n // to load the model\n document.body.appendChild( renderer.domElement );\n document.addEventListener( \"mousedown\", onDocumentMouseDown, false );\n document.addEventListener( \"mousemove\", onDocumentMouseMove, false );\n window.requestAnimationFrame(render);\n}", "function init()\n{\n // Create the scene and set the scene size.\n scene = new THREE.Scene();\n scene.updateMatrixWorld(true);\n // keep a loading manager\n loadingManager = new THREE.LoadingManager();\n\n //projector = new THREE.Projector();\n // Get container information\n container = document.createElement( 'div' );\n document.body.appendChild( container ); \n \n var WIDTH = window.innerWidth, HEIGHT = window.innerHeight; //in case rendering in body\n \n\n // Create a renderer and add it to the DOM.\n renderer = new THREE.WebGLRenderer({antialias:true});\n renderer.setSize(WIDTH, HEIGHT);\n // Set the background color of the scene.\n renderer.setClearColor(0x111111, 0);\n //document.body.appendChild(renderer.domElement); //in case rendering in body\n container.appendChild( renderer.domElement );\n\n // Create a camera, zoom it out from the model a bit, and add it to the scene.\n camera = new THREE.PerspectiveCamera(45.0, WIDTH / HEIGHT, 0.01, 1000);\n camera.position.set(-7, 2, -10);\n camera.lookAt(new THREE.Vector3(5,0,0));\n scene.add(camera);\n renderer.shadowMap.enabled = true;\n\n // Create an event listener that resizes the renderer with the browser window.\n window.addEventListener('resize',\n function ()\n {\n var WIDTH = window.innerWidth, HEIGHT = window.innerHeight;\n renderer.setSize(WIDTH, HEIGHT);\n camera.aspect = WIDTH / HEIGHT;\n camera.updateProjectionMatrix();\n }\n );\n \t\n \tinitlighting();\n \n // Load in the mesh and add it to the scene.\n var sawBlade_texPath = 'assets/sawblade.jpg';\n var sawBlade_objPath = 'assets/sawblade.obj';\n OBJMesh(sawBlade_objPath, sawBlade_texPath, \"sawblade\");\n\n //var ground_texPath = 'assets/ground_tile.jpg';\n var ground_texPath = 'assets/ground_tile_1.png';\n var ground_objPath = 'assets/ground1.obj';\n OBJMesh(ground_objPath, ground_texPath, \"ground\");\n //collMeshes.push( scene.getObjectByName(\"ground\") );\n\n //var slab_texPath = 'assets/slab.jpg';\n\tvar slab_texPath = 'assets/BakeAtlas.jpg';\n var slab_objPath = 'assets/slab1.obj';\n OBJMesh(slab_objPath, slab_texPath, \"slab\");\n //collMeshes.push( scene.getObjectByName(\"slab\") );\n \n //Stanford Bunny\n //var bunny_texPath = 'assets/rocky.jpg';\n var bunny_texPath = 'assets/BakeAtlas.jpg';\n var bunny_objPath = 'assets/stanford_bunny1.obj';\n OBJMesh(bunny_objPath, bunny_texPath, \"bunny\");\n //collMeshes.push( scene.getObjectByName(\"bunny\") );\n \n /*var spark_objPath = 'assets/spark.obj';\n OBJMesh(spark_objPath, \"\", \"spark\");*/\n\n //Sphere\n //var sphere_texPath = 'assets/rocky.jpg';\n var sphere_texPath = 'assets/BakeAtlas.jpg';\n var sphere_objPath = 'assets/sphere1.obj';\n OBJMesh(sphere_objPath, sphere_texPath, \"sphere\");\n\n // Generator\n var gen1 = new SparkGenerator();\n gen1.name = 'generator1';\n gen1.position.set(-0.4, 1.15, 0);\n gen1.scale.set( 0, 0, 0 );\n scene.add(gen1);\n\n /*var gen2 = new SparkGenerator();\n gen2.name = 'generator2';\n gen2.position.set(-0.4, 1.17, 0);\n gen2.scale.set( 0, 0, 0 );\n gen2.rate=0.6;\n gen2.spread = new THREE.Vector3(1,1,3);\n scene.add(gen2);*/\n\n //Cube\n //var cube_texPath = 'assets/rocky.jpg';\n var cube_texPath = 'assets/BakeAtlas.jpg';\n var cube_objPath = 'assets/cube1.obj';\n OBJMesh(cube_objPath, cube_texPath, \"cube\");\n \n //Cone\n //var cone_texPath = 'assets/rocky.jpg';\n var cone_texPath = 'assets/BakeAtlas.jpg';\n var cone_objPath = 'assets/cone1.obj';\n OBJMesh(cone_objPath, cone_texPath, \"cone\");\n \n // Add OrbitControls so that we can pan around with the mouse.\n controls = new THREE.OrbitControls(camera, renderer.domElement);\n\n controls.enableDamping = true;\n controls.dampingFactor = 0.4;\n controls.userPanSpeed = 0.01;\n controls.userZoomSpeed = 0.01;\n controls.userRotateSpeed = 0.01;\n controls.minPolarAngle = -Math.PI/2;\n controls.maxPolarAngle = Math.PI/2;\n controls.minDistance = 0.01;\n controls.maxDistance = 30;\n\n\n clock = new THREE.Clock();\n var delta = clock.getDelta();\n}", "function init() {\n // Create the camera, raycaster for shots, and reticle\n const aspect = window.innerWidth / window.innerHeight;\n const near = 0.1;\n const far = 10000;\n rawInputState = new RawInputState();\n camera = new THREE.PerspectiveCamera(103/aspect, aspect, near, far);\n raycaster = new THREE.Raycaster(camera.getWorldPosition(new THREE.Vector3()), camera.getWorldDirection(new THREE.Vector3())); \n fpsControls = new THREE.FirstPersonControls( camera, scene );\n \n renderer = new THREE.WebGLRenderer( { antialias: true } );\n renderer.setPixelRatio( window.devicePixelRatio );\n renderer.setSize( window.innerWidth, window.innerHeight );\n renderer.shadowMap.type = THREE.PCFSoftShadowMap;\n renderer.shadowMap.enabled = true;\n document.body.appendChild( renderer.domElement );\n //renderer.outputEncoding = THREE.sRGBEncoding;\n\n warpCamera = new THREE.OrthographicCamera(-aspect/2, aspect/2, 1/2, -1/2, near, far);\n\n window.addEventListener( 'resize', onWindowResize, false );\n statsContainer.appendChild(stats.dom);\n\n makeScene();\n fpsControls.scene = world;\n\n drawReticle();\n drawC2P();\n\n warpScene.add(warpQuad);\n warpScene.add(warpCamera);\n}", "function init(){\n\n\tvar animspath = \"Assets/3D/1animation/\";\n\tvar anims = [\"Standing\", \"Walk\", \"WalkBack\"];\n\n\tvar itemgroup = [\"HairBack/Back Hair 1\", \"HairFront/Front Hair 1\",\"Eyes/BlueEyes 1\",\"BodyUpper/Pale Skin\", \"Cloth/TopMaid\",\"Panties/PantieMaid\", \"Bra/MaidBra\", \"ItemNeck/MaidCollar\", \"Shoes/HighHeels\"];\n\n\n\n\tscene = new THREE.Scene();\n\n\tcamera = new THREE.PerspectiveCamera(45, window.innerWidth/window.innerHeight, 1, 1000);\n\n\trenderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });\n\trenderer.setPixelRatio(window.devicePixelRatio);\n\trenderer.setSize(window.innerWidth, window.innerHeight);\n\n\t// clock = new THREE.Clock();\n\n\tgroup1 = new THREE.Group();\n\tcount = -1;\n\tlight();\n\tfor (let i of itemgroup){\n\t\tcount += 1;\n\t\tlet subst = i.indexOf(\"/\");\n\t\tlet grpname = i.slice(0, subst);\n\t\tlet itemname = i.slice(subst +1);\n\t\tlet loader = new THREE.FBXLoader();\n\t\tloader.load(\n\t\t\t`${path3d}${grpname}/${itemname}.fbx`,\n\t\t\tfunction( object ) {\n\t\t\t\tmodel = object;\n\t\t\t\tmodel.name = itemname;\n\t\t\t\tmodel.group = grpname;\n\n\t\t\t\t// model.mixer = new THREE.AnimationMixer(model);\n\t\t\t\t// model.mixer.root = model.mixer.getRoot();\n\n\t\t\t\tcolor2(\"#ADD8E6\", i);\n\t\t\t\tgroup1.add(model);\n\t\t\t},\n\t\t\tundefined,\n\t\t\tfunction( error ) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t);\n\t}\n\tscene.add(group1);\n\n}", "function draw() { \n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n \n // We'll use perspective \n mat4.perspective(pMatrix,degToRad(60), gl.viewportWidth / gl.viewportHeight, 0.1, 200.0);\n\n // We want to look down -z, so create a lookat point in that direction \n vec3.add(viewPt, eyePt, viewDir);\n // Then generate the lookat matrix and initialize the MV matrix to that view\n mat4.lookAt(mvMatrix,eyePt,viewPt,up);\n\n //global light\n uploadLightsToShader(lightPosition,[0.0,0.0,0.0],[1.0,1.0,1.0],[1.0,1.0,1.0]);\n \n shiny = document.getElementById(\"shininess\").value;\n \n for (i=0; i<numParticles; i++) {\n mvPushMatrix();\n \n var x = pParticles[i][0];\n var y = pParticles[i][1];\n var z = pParticles[i][2];\n \n mat4.translate(mvMatrix, mvMatrix, vec3.fromValues(x,y,z));\n \n var s = sParticles[i];\n mat4.scale(mvMatrix, mvMatrix, vec3.fromValues(s,s,s));\n \n var R = cParticles[i][0];\n var G = cParticles[i][1];\n var B = cParticles[i][2];\n //particle color\n uploadMaterialToShader([R,G,B],[R,G,B],[1.0,1.0,1.0], shiny);\n setMatrixUniforms();\n drawSphere();\n mvPopMatrix();\n }\n \n \n}", "function space(){\n let galaxyGeometry = new THREE.SphereGeometry(200, 32, 32);\n let galaxyMaterial = new THREE.MeshBasicMaterial({\n side: THREE.BackSide\n });\n let galaxy = new THREE.Mesh(galaxyGeometry, galaxyMaterial);\n\n // Load Galaxy Textures\n textureLoader.crossOrigin = true;\n textureLoader.load(\"https://i0.wp.com/ivrpa.org/wp-content/uploads/2016/08/360vr_space3002_opt.jpg?fit=770%2C385&ssl=1\",\n function(texture) {\n galaxyMaterial.map = texture;\n scene.add(galaxy);\n }\n );\n }", "function drawQuarterSphere(radius, widthSegments, heightSegments, opacity, color, position, rotation){\n\tvar sphere = new THREE.SphereGeometry(radius, widthSegments, heightSegments, 0, Math.PI/2., 0, Math.PI/2.)\n\tvar circle1 = new THREE.CircleGeometry(radius, widthSegments, 0., Math.PI/2.)\n\tvar circle2 = new THREE.CircleGeometry(radius, widthSegments, 0., Math.PI/2.)\n\tvar circle3 = new THREE.CircleGeometry(radius, widthSegments, 0., Math.PI/2.)\n\n\tvar sphereMesh = new THREE.Mesh(sphere);\n\n\tvar circle1Mesh = new THREE.Mesh(circle1);\n\tcircle1Mesh.rotation.set(0, 0, Math.PI/2.);\n\n\tvar circle2Mesh = new THREE.Mesh(circle2);\n\tcircle2Mesh.rotation.set(Math.PI/2., 0, Math.PI/2.);\n\n\tvar circle3Mesh = new THREE.Mesh(circle3);\n\tcircle3Mesh.rotation.set(Math.PI/2., Math.PI/2., 0);\n\n\tvar singleGeometry = new THREE.Geometry();\n\n\tsphereMesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(sphereMesh.geometry, sphereMesh.matrix);\n\n\tcircle1Mesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(circle1Mesh.geometry, circle1Mesh.matrix);\n\n\tcircle2Mesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(circle2Mesh.geometry, circle2Mesh.matrix);\n\n\tcircle3Mesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(circle3Mesh.geometry, circle3Mesh.matrix);\n\n\tvar material = new THREE.MeshPhongMaterial( { \n\t\tcolor: color, \n\t\tflatShading: false, \n\t\ttransparent:true,\n\t\t//shininess:50,\n\t\topacity:opacity, \n\t\tside:THREE.DoubleSide,\n\t});\n\n\tvar mesh = new THREE.Mesh(singleGeometry, material);\n\tmesh.position.set(position.x, position.y, position.z);\n\tmesh.rotation.set(rotation.x, rotation.y, rotation.z);\n\tmesh.renderOrder = -1;\n\tparams.scene.add(mesh);\n\treturn mesh;\n\n}", "function snowyGround() {\n\n let geometry = new THREE.PlaneGeometry(500, 500, 22, 12);\n for (let i = 0; i < geometry.vertices.length; i++) {\n //geometry.vertices[i].x += (Math.cos( i * i )+1/2); \n //geometry.vertices[i].y += (Math.cos(i )+1/2); \n geometry.vertices[i].z = (Math.sin(i * i * i) + 1 / 2) * 3;\n }\n geometry.verticesNeedUpdate = true;\n geometry.normalsNeedUpdate = true;\n geometry.computeFaceNormals();\n\n let material = new THREE.MeshPhongMaterial({\n color: 0xFFFFFF,\n shininess: 60,\n //metalness: 1,\n //specularMap: noiseMap(512,255),\n bumpMap: noise,\n bumpScale: 0.025,\n //emissive: 0xEBF7FD,\n //emissiveIntensity: 0.05,\n shading: THREE.SmoothShading\n });\n\n let plane = new THREE.Mesh(geometry, material);\n plane.rotation.x = Math.PI / -2;\n plane.receiveShadow = true;\n plane.position.y = -5;\n\n return plane;\n\n}", "function createSoapBubblesScene() {\r\n\r\n SoapBubblesScene = new THREE.Scene();\r\n\r\n SoapBubblesCamera = new THREE.PerspectiveCamera(50, ENGINE.canvas.width / ENGINE.canvas.height, 1, 1000000);\r\n SoapBubblesCamera.position.set(0, 0, 500);\r\n SoapBubblesCamera.lookAt( SoapBubblesScene.position);\r\n SoapBubblesScene.add(SoapBubblesCamera);\r\n\r\n var cubemapShader = THREE.ShaderLib[\"cube\"];\r\n var cubeMapShaderUniforms = THREE.UniformsUtils.clone( cubemapShader.uniforms );\r\n cubeMapShaderUniforms['tCube'].value = SoapBubblesCubemap;\r\n var cubemapMaterial = new THREE.ShaderMaterial({\r\n fragmentShader: cubemapShader.fragmentShader,\r\n vertexShader: cubemapShader.vertexShader,\r\n uniforms: cubeMapShaderUniforms,\r\n depthWrite: false,\r\n side: THREE.DoubleSide\r\n });\r\n\r\n var skybox = new THREE.Mesh( new THREE.BoxGeometry( 100000, 100000, 100000, 1, 1, 1), cubemapMaterial );\r\n SoapBubblesScene.add( skybox );\r\n skybox.rotateX(100 );\r\n\r\n SoapBubblesBubbles = new THREE.Object3D();\r\n\r\n var radius = 120 , segments = 20, rings = 20;\r\n\r\n THREE.FresnelShader.uniforms[\"tCube\"].value = SoapBubblesCubemap;\r\n THREE.FresnelShader.uniforms[\"mFresnelBias\"].value = 0.1;\r\n\r\n var fresnelShaderMaterial = new THREE.ShaderMaterial({\r\n\t\tuniforms: \tTHREE.FresnelShader.uniforms,\r\n\t\tvertexShader: THREE.FresnelShader.vertexShader,\r\n\t\tfragmentShader: THREE.FresnelShader.fragmentShader,\r\n\t});\r\n\r\n\r\n for ( var i=0; i < 250; ++i) {\r\n var sphere = new THREE.Mesh( new THREE.SphereGeometry(\r\n radius + (Math.random()-0.5) * 50,\r\n segments,\r\n rings),\r\n fresnelShaderMaterial\r\n );\r\n SoapBubblesBubbles.add( sphere);\r\n sphere.direction = new THREE.Vector3();\r\n\r\n sphere.direction.set(\r\n (Math.random()-0.5)*3,\r\n (Math.random()-0.5)*10,\r\n (Math.random()-0.5)*0.2\r\n );\r\n\r\n sphere.position.set(\r\n (Math.random()-0.5)*6000,\r\n (Math.random()-0.5)*6000,\r\n Math.random()*4500 - 500\r\n );\r\n }\r\n SoapBubblesScene.add( SoapBubblesBubbles);\r\n}", "function animate() {\n\n pos.set(camera.position.x, camera.position.z);\n // headProjection.position.x = pos.x;\n // headProjection.position.z = pos.y;\n\n // sled.rotation.y = Math.atan2(pos.x,pos.y);\n\n var xThing = new THREE.Vector2();\n xThing.copy(pos);\n xThing.normalize();\n sled.matrix.set(\n xThing.y, 0, xThing.x, 0,\n 0, 1, 0, 0,\n -xThing.x, 0, xThing.y, 0,\n 0, 0, 0, 1\n );\n\n sled.matrixWorldNeedsUpdate = true;\n\n if ((pos.distanceTo(sled.position) < sledToggleDistance) && (camera.position.y < crouchToggleHeight)){\n sledToggle = 1;\n }\n\n if ((sledToggle == 1) && (pos.distanceTo(sled.position) < sledDistance) && (camera.position.y < crouchHeight) ){\n slat.material.color.set(0xff0000);\n moveVector.set(-pos.x, -pos.y);\n moveVector.multiplyScalar(speed);\n everything.position.x += moveVector.x;\n everything.position.z += moveVector.y;\n } else {\n sledToggle = 0;\n slat.material.color.set(0x330000);\n };\n\n //animate snow particles\n for (var p = 0; p<partCount; p++) {\n // check if we need to reset particles\n if (particles.vertices[p].y < snowFloor) {\n particles.vertices[p].set(\n 24*Math.random() - 12 - everything.position.x,\n snowFloor + 10,\n 24*Math.random() - 12 - everything.position.z);\n particles.vertices[p].velocity.y = -Math.random()/40 + 0.0001;\n }\n \n particles.vertices[p].y += particles.vertices[p].velocity.y;\n particles.vertices[p].z += particles.vertices[p].velocity.z;\n particles.vertices[p].x += particles.vertices[p].velocity.x;\n }\n\n for (var i = 0; i < plane.geometry.vertices.length; i++){\n var vertexPos = new THREE.Vector2();\n vertexPos.set(plane.geometry.vertices[i].x + everything.position.x, -plane.geometry.vertices[i].y + everything.position.z);\n if (vertexPos.distanceTo(pos) < eatSnowDistance){\n plane.geometry.vertices[i].z = -5;\n plane.geometry.verticesNeedUpdate = true;\n }\n };\n\n for (var i = 0; i < tree.length; i++){//make trees jump away from you\n var treePos = new THREE.Vector2();\n treePos.set(tree[i].position.x + everything.position.x, tree[i].position.z + everything.position.z);\n if (treePos.distanceTo(pos) < 4 && treeTimer[i] <= 0){//is it time to jump?\n treeTimer[i] = 2;\n if (treePos.x*pos.y > pos.x*treePos.y){\n var treeSign = 1;\n }else{\n var treeSign = -1;\n }\n treeVector[i].set(treePos.y * treeSign, -treePos.x * treeSign);//here is where to jump!\n }\n if (treeTimer[i] > -0.04){\n tree[i].position.x += treeVector[i].x*treeSpeed;\n tree[i].position.z += treeVector[i].y*treeSpeed;\n tree[i].position.y = 5 + treeHeight[i]/2 + -5*(treeTimer[i]-1)*(treeTimer[i]-1);//height is a parabola\n treeTimer[i] -= 0.04;\n }\n }\n\n for (var i = 0; i < pine.length; i++){//make ugly trees jump away from you\n var treePos = new THREE.Vector2();\n treePos.set(pine[i].position.x + everything.position.x, pine[i].position.z + everything.position.z);\n if (treePos.distanceTo({x: 0, y: 0}) < 3){\n pine[i].position.x += treePos.x/50;\n pine[i].position.z += treePos.y/50;\n }\n }\n\n for (var i = 0; i< presentNumber; i++){//look at all presents\n var presentPos = new THREE.Vector2(); //make relative position vector\n presentPos.set(present[i].position.x + everything.position.x, present[i].position.z + everything.position.z);\n if (presentPos.distanceTo(pos) < 1){//if close to present,\n if (presentArray[i] !== 0){//if it hasn't been found yet,\n present[i].position.y = stackHeight;\n presentsFound++;\n stackHeight += presentArray[i];\n presentArray[i] = 0;\n presentStack.add(present[i]);\n present[i].position.x = 0;\n present[i].position.z = 0;\n }\n }\n }\n\n var stackPos = new THREE.Vector2();\n stackPos.set(-pos.x, -pos.y);\n stackPos.normalize();\n stackPos.multiplyScalar(0.5);\n\n presentStack.matrix.set(\n xThing.y, 0, xThing.x, stackPos.x,\n 0, 1, 0, 0,\n -xThing.x, 0, xThing.y, stackPos.y,\n 0, 0, 0, 1\n );\n\n presentStack.matrixWorldNeedsUpdate = true;\n\n if (presentsFound == presentNumber){\n pine[0].scale.set(5,5,5);\n }\n\n \n\n for (var i = 0; i < eagleNumber; i++){\n var nosePos = new THREE.Vector2();\n nosePos.set(eagle[i].position.x + everything.position.x, eagle[i].position.z + everything.position.z);\n var noseDistance = nosePos.distanceTo(pos);\n if (noseDistance < 2){\n eagle[i].scale.set(1 + 1-Math.min(1, noseDistance), Math.min(1, noseDistance/2), 1 + 1 - Math.min(1, noseDistance));\n nose[i].position.y = noseHeight[i]*Math.min(1, noseDistance/2);\n } else { \n behindPos.set(2*camera.position.x - everything.position.x + camera.position.z/2, camera.position.y*Math.min(1, noseDistance*2), 2*camera.position.z - everything.position.z -camera.position.x/2)\n nose[i].lookAt(behindPos);\n }\n }\n\n\n //Update VR headset position and apply to camera.\n controls.update();\n\n // Render the scene through the VREffect.\n effect.render( scene, camera );\n requestAnimationFrame( animate );\n}", "function animate() {\n\n\tshader.uniforms[\"u_time\"].value += 0.1;\n\n\trequestAnimationFrame( animate );\n\tcomposer.render();\n\tcontrols.update();\n\tstats.update();\n\n\t// console.log(floor3.material.color);\n\n\t// floor3.geometry.attributes.color = genColor();\n\t//\n\t//\n\tlet t = shader.uniforms[\"u_time\"].value * 0.1;\n\t// let pos = [ Math.cos(t)*-5, Math.sin(t)*5 ];\n\t// let pos = [-5, Math.sin(step)*5 ];\n\n\t// sphere.position.x = pos[0];\n\t// sphere.position.y = pos[1];\n\t//\n\t// let norm = [Math.floor(pos[0]+5), Math.floor(5-pos[1])];\n\t// //\n\t// // let cx = norm[0] % 10;\n\t// // let cy = parseInt( Math.abs( Math.floor(norm[1]+5 % 10) * cx ), 10);\n\t//\n\t// let colorarray = floor3.geometry.attributes.color.array;\n\t// // let coord = [\n\t// // \t[],[],[],[],[],[],[],[],[],[],[],[]\n\t// // ];\n\t// // for(let f=0;f<colorarray.length;f+=3){\n\t// //\n\t// // }\n\t//\n\t// let column = (norm[1] * 10 + norm[0]) % 10;\n\t// let row = Math.ceil(column/10);\n\t//\n\t// let h = colorarray[row * 10 + column];\n\t//\n\t// console.log(\"pos\", norm);\n\t//\n\t// sphere.material.color = (new THREE.Color())\n\t// \t\t\t\t\t\t\t\t\t\t\t\t.setRGB(\n\t// \t\t\t\t\t\t\t\t\t\t\t\t\tcoord[norm[1]][norm[0]].r,\n\t// \t\t\t\t\t\t\t\t\t\t\t\t\tcoord[norm[1]][norm[0]].g,\n\t// \t\t\t\t\t\t\t\t\t\t\t\t\tcoord[norm[1]][norm[0]].b\n\t// \t\t\t\t\t\t\t\t\t\t\t\t);\n\nspheres[0].animate( Math.cos(t)*-5, Math.sin(t)*5, Math.sin(t*0.1)*2);\nspheres[1].animate( Math.cos(t*1.1)*-5, Math.sin(t*0.8)*5, Math.cos(t*0.5)*2 );\nspheres[2].animate( Math.cos(t*0.8)*-5, Math.sin(t*1.8)*5, Math.sin(t*0.9)*2 );\nspheres[3].animate( Math.cos(t*0.2)*-5, Math.sin(t*2.0)*5, Math.cos(t*0.7)*2 );\n\nspheres.forEach( s => {\n\ts.setRGB();\n\ts.colorsNeedUpdate(true);\n});\n// sphere.geometry.colorsNeedUpdate = true;\n\n}", "function Sphere(radius, stacks, slices){\n var stackAngle = 180.0 / stacks;\n var degree = 360.0 / slices;\n var currentRadius;\n\n var vertices = [];\n var allStackVertices = [];\n\n //Duplicate vertices for starting point of cube\n var firstPath = [];\n for (var i = 0; i < slices; i++ ) {\n var x, y, z;\n x = 0; y = radius; z = 0;\n firstPath.push({x, y, z});\n }\n allStackVertices.push(firstPath);\n\n //Calculate vertices for each stack\n for (var j = 1; j < stacks; j++){\n var y;\n var angle = stackAngle * j;\n currentRadius = Math.sin(degreeToRadian(angle)) * radius;\n\n y = Math.cos(degreeToRadian(angle)) * radius;\n\n for(var i = 0; i < slices; i++){\n var x, z;\n angle = degree * i;\n x = Math.cos(degreeToRadian(angle)) * currentRadius;\n z = Math.sin(degreeToRadian(angle)) * currentRadius;\n vertices.push({x, y, z});\n }\n allStackVertices.push(vertices);\n vertices = [];\n }\n\n //Duplicate vertices for starting point of cube\n var lastPath = [];\n for (var i = 0; i < slices; i++ ) {\n var x, y, z;\n x = 0; y = -radius; z = 0;\n lastPath.push({x, y, z});\n }\n allStackVertices.push(lastPath);\n\n return allStackVertices;\n}", "function init() {\n //setup the renderer including shadow map\n renderer = new THREE.WebGLRenderer({\n antialias: true\n });\n renderer.setSize(width, height);\n //antialiasing on shadows\n renderer.shadowMapType = THREE.PCFSoftShadowMap;\n //enable shadows\n renderer.shadowMap.enabled = true;\n //render scene to canvas\n document.getElementById(\"scene\").appendChild(renderer.domElement);\n scene = new THREE.Scene();\n scene.background = new THREE.Color(0xc7d1e0);\n //creates the fog around the scene, keeps it at a distance so it never appears foggy inside the penthouse\n scene.fog = new THREE.Fog(0xc7d1e0, 0.015, 600);\n //camera setup\n //was 60 fov now 45\n camera = new THREE.PerspectiveCamera(45, width / height, 0.1, 1000);\n controlsEnabled = false;\n //setup meshes such as ceiling and floor\n var floorplane = new THREE.BoxBufferGeometry(100, 1, 200);\n //calls the createNormalMesh function to return a mesh with normal map attached.\n var floorMesh = createNormalMesh(floorplane, \"./textures/finewood1.jpg\", \"./textures/floor.png\", 15, 15, 0.1, true)\n floorMesh.rotation.x = 180 * (Math.PI / 180);\n var ceilingGeo = new THREE.BoxBufferGeometry(100, 1, 200);\n var ceilingMesh = createNormalMesh(ceilingGeo, \"./textures/plaster.jpg\", \"./textures/plaster.png\", 5, 5, 1, true)\n ceilingMesh.rotation.x = 180 * (Math.PI / 180);\n ceilingMesh.position.set(0, 20, 0);\n ceilingMesh.castShadow = true;\n /**\n *\n * create the scene's main walls such as the outer walls, partitions and the bar/kitchen areas\n *\n **/\n //array of every wall in the scene\n var walls = []\n var shortWallGeo = new THREE.BoxBufferGeometry(1, 20, 100);\n shortWallGeo.computeBoundingSphere()\n var longWallGeo = new THREE.BoxBufferGeometry(1, 20, 200);\n longWallGeo.computeBoundingSphere()\n longWallGeo.computeFaceNormals();\n var divideWallGeo = new THREE.BoxBufferGeometry(0.5, 20, 40);\n var barWallGeo = new THREE.BoxBufferGeometry(0.5, 8, 40);\n var barGeo = new THREE.BoxBufferGeometry(0.5, 2.5, 40);\n var kitchenCounterGeo = new THREE.BoxBufferGeometry(0.5, 9.98, 28)\n walls[0] = createNormalMesh(longWallGeo, \"./textures/window.png\", \"./textures/windowNormal.png\", 4, 1, 10, true);\n walls[0].position.set(-50.5, 10.5, 0);\n walls[1] = createNormalMesh(longWallGeo, \"./textures/wall2.jpg\", \"./textures/wall2.png\", 4, 1, 3, true);\n walls[1].position.set(50.5, 10.5, 0);\n walls[2] = createNormalMesh(shortWallGeo, \"./textures/window.png\", \"./textures/windowNormal.png\", 2, 1, 10, true);\n walls[2].position.set(0, 10.5, 100.5);\n walls[2].rotation.set(0, 90 * (Math.PI / 180), 0)\n walls[3] = createNormalMesh(shortWallGeo, \"./textures/wall2.jpg\", \"./textures/wall2.png\", 4, 1, 3, true);\n walls[3].position.set(0, 10.5, -100.5);\n walls[3].rotation.set(0, 90 * (Math.PI / 180), 0);\n walls[4] = new THREE.Mesh(divideWallGeo, new THREE.MeshPhongMaterial({\n color: 0xafceff\n }));\n walls[4].position.set(30, 10.5, 40);\n walls[4].rotation.set(0, 90 * (Math.PI / 180), 0)\n walls[4].castShadow = true;\n walls[5] = new THREE.Mesh(divideWallGeo, new THREE.MeshPhongMaterial({\n color: 0xafceff\n }));\n walls[5].position.set(30, 10.5, -40);\n walls[5].rotation.set(0, 90 * (Math.PI / 180), 0)\n walls[5].castShadow = true;\n walls[6] = new THREE.Mesh(barWallGeo, new THREE.MeshPhongMaterial({\n color: 0xafceff\n }));\n walls[6].position.set(6, 4.1, 80);\n walls[6].castShadow = true;\n walls[7] = new THREE.Mesh(barWallGeo, new THREE.MeshPhongMaterial({\n color: 0xafceff\n }));\n walls[7].position.set(6, 4.1, 80);\n walls[7].rotation.set(90 * (Math.PI / 180), 0, 0)\n walls[7].castShadow = true;\n walls[8] = new THREE.Mesh(barGeo, new THREE.MeshPhongMaterial({\n color: 0xafceff\n }));\n walls[8].position.set(7.5, 7.5, 80);\n walls[8].rotation.set(0, 0, 90 * (Math.PI / 180))\n walls[8].castShadow = true;\n walls[9] = createNormalMesh(kitchenCounterGeo, \"./textures/worktop.jpg\", \"./textures/worktop.png\", 12, 3, 0.4, false);\n walls[9].position.set(47.5, 7.04, 86)\n walls[9].rotation.set(0, 0, 90 * (Math.PI / 180))\n walls[9].castShadow = true;\n walls[10] = createNormalMesh(kitchenCounterGeo, \"./textures/worktop.jpg\", \"./textures/worktop.png\", 12, 3, 0.4, false);\n walls[10].position.set(47.5, 7.04, 54)\n walls[10].castShadow = true;\n walls[10].rotation.set(0, 0, 90 * (Math.PI / 180))\n for (var i = 0; i < walls.length; i++) {\n scene.add(walls[i]);\n walls[i].receiveShadow = true;\n walls[i].frustumCulled = false;\n\n\n }\n /**\n *\n * create light blockers behind the wooden textures to imitate the effect of light outside hitting the beams\n *\n **/\n var doubleBeamGeo = new THREE.BoxBufferGeometry(0.1, 20, 12.5);\n var singleBeamGeo = new THREE.BoxBufferGeometry(0.1, 20, 6.25);\n var simpleMat = new THREE.MeshLambertMaterial({\n color: 0x000000,\n alpha: 0\n });\n var blockers = [];\n blockers[0] = new THREE.Mesh(doubleBeamGeo, simpleMat);\n blockers[0].position.set(-50.2, 10.5, 0);\n blockers[1] = new THREE.Mesh(doubleBeamGeo, simpleMat);\n blockers[1].position.set(-50.2, 10.5, 50);\n blockers[2] = new THREE.Mesh(doubleBeamGeo, simpleMat);\n blockers[2].position.set(0, 10.5, 100.2);\n blockers[2].rotation.y = 90 * (Math.PI / 180);\n blockers[3] = new THREE.Mesh(singleBeamGeo, simpleMat);\n blockers[3].position.set(-47, 10.5, 100.1);\n blockers[3].rotation.y = 90 * (Math.PI / 180);\n blockers[4] = new THREE.Mesh(singleBeamGeo, simpleMat);\n blockers[4].position.set(-50.2, 10.5, 97);\n blockers[5] = new THREE.Mesh(singleBeamGeo, simpleMat);\n blockers[5].position.set(-50.2, 10.5, -47);\n blockers[6] = new THREE.Mesh(singleBeamGeo, simpleMat);\n blockers[6].position.set(-50.2, 10.5, -53);\n\n for (var i = 0; i < blockers.length; i++) {\n scene.add(blockers[i]);\n blockers[i].castShadow = true;\n blockers[i].frustumCulled = false;\n }\n\n //bedroom stands\n\n var standGeo = new THREE.BoxBufferGeometry(3, 8, 3);\n var stand1 = new THREE.Mesh(standGeo, new THREE.MeshPhongMaterial({\n color: 0xafceff\n }));\n var stand2 = new THREE.Mesh(standGeo, new THREE.MeshPhongMaterial({\n color: 0xafceff\n }));\n stand1.name = \"MusicBoxStand\";\n stand1.position.set(48, 3.5, -43.5);\n stand1.castShadow = true;\n stand1.receiveShadow = true;\n stand2.name = \"SpotlightStand\";\n stand2.position.set(48, 3.5, -53.5);\n stand2.castShadow = true;\n stand2.receiveShadow = true;\n //create photo on bookshelf\n var photoGeo = new THREE.BoxBufferGeometry(3, 0.2, 2);\n var photo = createNormalMesh(photoGeo, \"./textures/besties.png\", \"./textures/photoNormal.png\", 1, 1, 0.4, false);\n photo.position.set(35, 6, 36);\n photo.rotation.set(-45 * Math.PI / 180, 180 * (Math.PI / 180), 0);\n\n\n\n\n\n /**\n *\n * import Obj Models exported from 3ds Max\n * uses the Obj and MTL loader to import model and apply basic materials\n *\n * loops through every object in mesh and calculates shadows and geometry\n *\n **/\n var mtlLoader = new THREE.MTLLoader();\n mtlLoader.load(\"./models/desk.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/desk.obj\", function (object) {\n object.position.set(-25, 0, 90);\n object.rotation.y += 180 * (Math.PI / 180)\n object.scale.set(0.5, 0.5, 0.5)\n object.castShadow = true;\n object.name = \"album\";\n object.add(ambientMusic);\n vinylPlayer = object;\n vinylPlayer.userData.name = \"album\";\n scene.add(vinylPlayer);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n var mtlLoader = new THREE.MTLLoader();\n mtlLoader.load(\"./models/musicbox.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/musicbox.obj\", function (object) {\n object.position.set(48, 7.5, -43.5);\n object.rotation.y += 180 * (Math.PI / 180)\n object.scale.set(0.1, 0.1, 0.1)\n object.castShadow = true;\n object.name = \"musicBox\";\n musicBox = object;\n object.add(musicBoxMusic);\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n\n mtlLoader.load(\"./models/fire.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/fire.obj\", function (object) {\n object.position.set(50, 0, 0);\n object.rotation.y += -90 * (Math.PI / 180)\n object.scale.set(0.25, 0.25, 0.25)\n object.castShadow = true;\n object.name = \"fire\";\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n mtlLoader.load(\"./models/sofa.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/sofa.obj\", function (object) {\n object.position.set(18, 0, 2.5);\n object.rotation.y += -90 * (Math.PI / 180)\n object.scale.set(0.25, 0.25, 0.25)\n object.castShadow = true;\n object.name = \"sofa\";\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n\n mtlLoader.load(\"./models/piano.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/piano.obj\", function (object) {\n object.position.set(-35, 0, 2.5);\n object.scale.set(0.25, 0.25, 0.25)\n object.castShadow = true;\n object.name = \"piano\";\n\n object.add(pianoScale);\n piano = object;\n piano.name = \"piano\";\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n object.name = \"piano\";\n\n }\n })\n });\n });\n\n mtlLoader.load(\"./models/cupboard.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/cupboard.obj\", function (object) {\n object.position.set(49.90, 12.5, 65);\n object.rotation.y += 90 * (Math.PI / 180)\n object.scale.set(0.45, 0.45, 0.45)\n object.castShadow = true;\n object.name = \"cupboard\";\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n object.name = \"cupboard\";\n\n }\n })\n });\n });\n\n mtlLoader.load(\"./models/stool.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/stool.obj\", function (object) {\n object.position.set(11, 0.5, 72);\n object.rotation.y += -90 * (Math.PI / 180)\n object.scale.set(0.25, 0.25, 0.25)\n object.castShadow = true;\n object.name = \"stool\";\n stool[0] = object.clone();\n stool[1] = object.clone();\n stool[2] = object.clone();\n stool[0].position.set(11, 0.5, 88);\n stool[1].position.set(11, 0.5, 98);\n stool[2].position.set(11, 0.5, 65);\n scene.add(object);\n scene.add(stool[0]);\n scene.add(stool[1]);\n scene.add(stool[2]);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n\n\n obj.geometry.computeVertexNormals();\n\n\n\n }\n });\n for (var i = 0; i < stool.length; i++) {\n stool[i].traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n\n\n obj.geometry.computeVertexNormals();\n\n\n\n }\n });\n }\n });\n\n });\n mtlLoader.load(\"./models/cooker.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/cooker.obj\", function (object) {\n object.position.set(46.2, 0, 65);\n object.rotation.y += -90 * (Math.PI / 180)\n object.scale.set(0.18, 0.18, 0.18)\n object.castShadow = true;\n object.name = \"cooker\";\n\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n mtlLoader.load(\"./models/chair.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/chair.obj\", function (object) {\n object.position.set(45, 0, -90);\n object.rotation.y += -70 * (Math.PI / 180)\n object.scale.set(0.4, 0.4, 0.4)\n object.castShadow = true;\n object.name = \"chair\";\n\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n\n\n\n\n mtlLoader.load(\"./models/table.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/table.obj\", function (object) {\n object.position.set(30, 0, 0);\n object.rotation.y += -90 * (Math.PI / 180)\n object.scale.set(0.25, 0.25, 0.25)\n object.castShadow = true;\n object.name = \"table\";\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n mtlLoader.load(\"./models/bookshelf.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/bookshelf.obj\", function (object) {\n object.position.set(35, 1.5, 39);\n object.scale.set(0.5, 0.5, 0.5)\n object.castShadow = true;\n object.name = \"bookshelf\";\n\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n\n\n\n mtlLoader.load(\"./models/lamp.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/lamp.obj\", function (object) {\n object.position.set(48, 7.5, -53.5);\n object.rotation.y += 98 * (Math.PI / 180)\n object.scale.set(0.1, 0.1, 0.1)\n object.castShadow = true;\n object.name = \"lamp\";\n\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.geometry.computeVertexNormals();\n\n }\n })\n });\n });\n mtlLoader.load(\"./models/bed.mtl\", function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.load(\"./models/bed.obj\", function (object) {\n object.position.set(37.5, 0.5, -70);\n object.rotation.y += 90 * (Math.PI / 180)\n object.scale.set(0.12, 0.12, 0.12)\n object.castShadow = true;\n object.name = \"bed\";\n\n scene.add(object);\n object.traverse(function (obj) {\n if (obj instanceof THREE.Mesh) {\n obj.receiveShadow = true;\n obj.castShadow = true;\n obj.name = \"bed\";\n obj.geometry.computeVertexNormals();\n\n\n }\n })\n });\n\n });\n\n\n\n //misc Objects on desk\n var desk = scene.getObjectByName(\"desk\")\n console.log(\"desk:\" + desk);\n var vinylGeo = new THREE.CylinderBufferGeometry(1.2, 1.2, 0.05, 32);\n vinyl = createNormalMesh(vinylGeo, \"./textures/vinyl.png\", \"./textures/vinylNormal.png\", 1, 1, 0.1, true);\n vinyl.position.set(-21.2, 6.2, 89.93);\n vinyl.name = \"album\"\n var albumGeo = new THREE.BoxBufferGeometry(5, 0.2, 5);\n var album = createNormalMesh(albumGeo, \"./textures/album.png\", \"./textures/albumNormal.png\", 1, 1, 0.1, true);\n album.position.set(-30, 5.8, 90);\n album.rotation.y = 165 * (Math.PI / 180);\n album.name = \"album\";\n\n //invisible trigger meshes \n /**\n *\n * Raycaster has difficulty intersecting objects imported from 3ds Max\n * so I put an invisible trigger mesh around the objects in order to aid interaction\n *\n * \n *\n **/\n var bigTriggerGeo = new THREE.BoxBufferGeometry(20, 10, 10);\n var smallTriggerGeo = new THREE.BoxBufferGeometry(5, 10, 5);\n var deskTrigger = new THREE.Mesh(bigTriggerGeo, new THREE.MeshLambertMaterial());\n deskTrigger.position.set(-25, 5, 90);\n deskTrigger.name = \"album\";\n deskTrigger.material.visible = false;\n scene.add(deskTrigger);\n var pianoTrigger = new THREE.Mesh(bigTriggerGeo, new THREE.MeshLambertMaterial());\n pianoTrigger.position.set(-30, 5, 2.5);\n pianoTrigger.rotation.set(0, 90 * (Math.PI / 180), 0);\n pianoTrigger.name = \"piano\";\n pianoTrigger.material.visible = false;\n scene.add(pianoTrigger);\n\n var musicBoxTrigger = new THREE.Mesh(smallTriggerGeo, new THREE.MeshLambertMaterial());\n musicBoxTrigger.position.set(48, 5, -42.5);\n\n musicBoxTrigger.name = \"musicBoxTrig\";\n musicBoxTrigger.material.visible = false;\n scene.add(musicBoxTrigger);\n\n var spotLightTrigger = new THREE.Mesh(smallTriggerGeo, new THREE.MeshLambertMaterial());\n spotLightTrigger.position.set(48, 5, -52.5);\n\n spotLightTrigger.name = \"spotLight\";\n spotLightTrigger.material.visible = false;\n scene.add(spotLightTrigger);\n\n /**\n *\n * \n * Here I create a skyline of basic skyscraper like buildings\n * to aid immersion of being on a high rise\n *\n * \n *\n **/\n var buildings = [];\n for (var i = 0; i < 10; i++) {\n\n var r = Math.floor(Math.random() * 90)\n console.log(r);\n var geo = new THREE.BoxBufferGeometry(100, 500 + r, 100);\n var material = new THREE.MeshLambertMaterial({\n color: 0xffffff\n });\n buildings[i] = new THREE.Mesh(geo, material);\n if (i > 0) {\n var j = i - 1;\n console.log(j);\n console.log(buildings[j]);\n console.log(buildings[i]);\n var newR = Math.floor(Math.random() * 120);\n buildings[i].position.set(buildings[j].position.x + 100 + newR, -300, buildings[j].position.z + 100 + newR);\n } else {\n buildings[i].position.set(r - 800, -300, r - 200);\n }\n scene.add(buildings[i]);\n }\n\n /**\n *\n * \n * Here i use particles to create two point clouds for the snow outside, in addition to this I also create a pointcloud for the fire in the main living space\n * \n *\n **/\n var snowTexture = THREE.ImageUtils.loadTexture(\"./textures/snowdrop.png\");\n var snowMat = new THREE.PointCloudMaterial({\n size: 2,\n transparent: true,\n opacity: true,\n map: snowTexture,\n blending: THREE.AdditiveBlending,\n sizeAtennuation: true,\n color: 0xffffff\n })\n var area = 600;\n var snowGeo = new THREE.Geometry\n for (var i = 0; i < 1500; i++) {\n var particle = new THREE.Vector3(Math.random() * area - area / 2, Math.random() * 2000 - 1000 /*Math.random() * area * 1.5*/ , Math.random() * area - area / 2);\n particle.velocityX = (Math.random() - 0.5) / 3;\n particle.velocityY = 0.02 + (Math.random() / 5);\n snowGeo.vertices.push(particle);\n }\n\n\n\n snowGeo.computeBoundingSphere();\n snowCloud = new THREE.Points(snowGeo, snowMat);\n snowCloud.sortParticles = true;\n\n snowCloud.frustumCulled = false;\n snowCloud.position.set(-400, 0, 0);\n snowCloud2 = new THREE.Points(snowGeo, snowMat);\n snowCloud2.position.set(0, 0, 400);\n snowCloud2.frustumCulled = false;\n //adding to camera in attempt to reduce the effects of frustum culling (disappearing snow, still happens occasionally)\n camera.add(snowCloud);\n camera.add(snowCloud2);\n //fire setup\n var fireArea = 4;\n var fireGeo = new THREE.Geometry;\n var fireTex = THREE.ImageUtils.loadTexture(\"./textures/fire.png\");\n var fireMat = new THREE.PointCloudMaterial({\n size: 1,\n transparent: true,\n opacity: true,\n map: fireTex,\n blending: THREE.AdditiveBlending,\n sizeAtennuation: true,\n color: 0xff7700\n })\n for (var i = 0; i < 1500; i++) {\n var particle = new THREE.Vector3(Math.random() * fireArea - fireArea / 2, Math.random() * 2000 - 1000 /*Math.random() * area * 1.5*/ , Math.random() * fireArea - fireArea / 2);\n particle.velocityX = (Math.random() - 0.5) / 3 * 0.2;\n particle.velocityY = 0.02 + (Math.random() / 5 * 0.2);\n fireGeo.vertices.push(particle);\n }\n fire = new THREE.Points(fireGeo, fireMat);\n fire.position.set(48, 0, 0);\n /**\n *\n * \n * Music\n * I create positional music pieces, the main piece winterlude is played ambiently at the start and can be toggled from the vinyl player, \n * the other sound effects such as the Music Box and Major scale are\n * played during user interaction.\n *\n **/\n var listener = new THREE.AudioListener();\n camera.add(listener);\n var audioLoader = new THREE.AudioLoader();\n ambientMusic = new THREE.PositionalAudio(listener);\n audioLoader.load(\"./sounds/Winterlude.mp3\", function (buffer) {\n ambientMusic.setBuffer(buffer);\n ambientMusic.setRefDistance(20);\n ambientMusic.setLoop(true);\n ambientMusic.play();\n ambientMusicPlaying = true;\n });\n musicBoxMusic = new THREE.PositionalAudio(listener);\n audioLoader.load(\"./sounds/music-box.mp3\", function (buffer) {\n musicBoxMusic.setBuffer(buffer);\n musicBoxMusic.setRefDistance(20);\n musicBoxMusic.setLoop(false);\n });\n pianoScale = new THREE.PositionalAudio(listener);\n audioLoader.load(\"./sounds/majorscale.mp3\", function (buffer) {\n pianoScale.setBuffer(buffer);\n pianoScale.setRefDistance(20);\n pianoScale.setLoop(false);\n });\n /**\n *\n * \n * Lighting\n * I use a grey directional light as the main source of \"natural\" light in the scene\n * \n * in addition to this I setup light from the fire to invoke the feeling of warmth, with a bit of white ambient light\n * \n * There is also a interactable yellow/white spotlight in the bed area\n * and finally white ceiling pointlights as the main source of \"artificial\" light.\n **/\n var firePointLight = new THREE.PointLight(0xff7700, 1, 50);\n firePointLight.position.set(50, -10, 0);\n firePointLight.castShadow = true;\n var ambient = new THREE.AmbientLight(0xffffff, 0.1);\n var directionalLight = new THREE.DirectionalLight(0xc7d1e0, 0.7);\n lampSpotLight = new THREE.SpotLight(0xffbb73, 1, 14);\n lampSpotLight.castShadow = true;\n lampSpotLight.exponent = 10;\n lampSpotLight.target = stand1;\n lampSpotLight.angle = 60 * (Math.PI / 180);\n lampSpotLight.penumbra = 2;\n lampSpotLight.position.set(48, 9.8, -52.3);\n directionalLight.position.set(0, 2, 0);\n directionalLight.castShadow = true;\n directionalLight.shadow.camera.near = 0.1;\n directionalLight.shadow.camera.far = camera.far;\n directionalLight.shadow.camera.left = -100;\n directionalLight.shadow.camera.right = 100;\n directionalLight.shadow.camera.top = 100;\n directionalLight.shadow.camera.bottom = -100;\n directionalLight.shadow.mapSize.width = 2048;\n directionalLight.shadow.mapSize.height = 2048;\n directionalLight.shadow.shadowDarkness = 0.5;\n directionalLight.visible = true;\n directionalLight.position.set(-200, 10, 70);\n floorMesh.receiveShadow = true;\n var ceilingLights = [];\n for (var i = 0; i < 6; i++) {\n var pointLight = new THREE.PointLight(0xffffff, 0.5, 50);\n var lightGeo = new THREE.CylinderBufferGeometry(0.4, 0.4, 0.2, 16);\n var lightMat = new THREE.MeshLambertMaterial(0xffffff);\n var lightMesh = new THREE.Mesh(lightGeo, lightMat);\n lightMesh.add(pointLight);\n\n ceilingLights.push(lightMesh);\n pointLight.position.set(lightMesh.position.x, lightMesh.position.y - 2, lightMesh.position.z)\n pointLight.castShadow = true;\n var j = i - 1;\n console.log(j);\n if (i > 0) {\n console.log(ceilingLights[j]);\n lightMesh.position.set(2, 19.5, ceilingLights[j].position.z + 34);\n\n\n } else {\n lightMesh.position.set(2, 19.5, -98);\n }\n }\n for (var i = 0; i < ceilingLights.length; i++) {\n scene.add(ceilingLights[i]);\n }\n var kitchenPointLight = new THREE.PointLight(0xffffff, 0.7, 60);\n kitchenPointLight.castShadow = true;\n var kitchenLightGeo = new THREE.CylinderBufferGeometry(0.4, 0.4, 0.2, 16);\n var kitchenLightMat = new THREE.MeshLambertMaterial(0xffffff);\n var kitchenLightMesh = new THREE.Mesh(kitchenLightGeo, kitchenLightMat);\n kitchenLightMesh.add(kitchenPointLight);\n kitchenLightMesh.position.set(25, 19.5, 68);\n kitchenPointLight.position.set(kitchenLightMesh.position.x, kitchenLightMesh.position.y - 2, kitchenLightMesh.position.z);\n //add majority of items to the scene\n scene.add(directionalLight);\n scene.add(floorMesh);\n scene.add(ceilingMesh);\n scene.add(ambient);\n scene.add(firePointLight);\n scene.add(lampSpotLight);\n scene.add(mesh);\n scene.add(snowCloud);\n scene.add(snowCloud2);\n scene.add(fire);\n scene.add(vinyl);\n scene.add(album);\n scene.add(stand1);\n scene.add(stand2);\n scene.add(photo);\n scene.add(kitchenLightMesh);\n scene.add(kitchenPointLight);\n\n /*\n *\n *control handling\n */\n\n controls = new THREE.PointerLockControls(camera);\n var controller = controls.getObject();\n controller.rotation.y = 180 * (Math.PI / 180);\n controller.position.set(0, 10, -80);\n controller.frustumCulled = false;\n scene.add(controls.getObject());\n var onKeyDown = function (event) {\n switch (event.keyCode) {\n case 38: // up\n case 87: // w\n moveForward = true;\n break;\n case 37: // left\n case 65: // a\n moveLeft = true;\n break;\n case 40: // down\n case 83: // s\n moveBackward = true;\n break;\n case 39: // right\n case 68: // d\n moveRight = true;\n break;\n case 69: // e interact with objects\n interact();\n break;\n }\n };\n var onKeyUp = function (event) {\n switch (event.keyCode) {\n case 38: // up\n case 87: // w\n moveForward = false;\n break;\n case 37: // left\n case 65: // a\n moveLeft = false;\n break;\n case 40: // down\n case 83: // s\n moveBackward = false;\n break;\n case 39: // right\n case 68: // d\n moveRight = false;\n break;\n case 88:\n //toggle ambient music\n if (ambientMusic.isPlaying) {\n ambientMusic.pause();\n } else {\n ambientMusic.play();\n }\n break;\n }\n };\n //event listeners\n document.addEventListener('keydown', onKeyDown, false);\n document.addEventListener('keyup', onKeyUp, false);\n window.addEventListener('mousemove', onMouseMove, false);\n window.addEventListener('resize', onResize, false);\n //define raycaster\n raycaster = new THREE.Raycaster();\n}", "function onLoad(framework) {\n var scene = framework.scene;\n var camera = framework.camera;\n var renderer = framework.renderer;\n var gui = framework.gui;\n var stats = framework.stats;\n\n // load basic house\n var objLoader = new THREE.OBJLoader();\n objLoader.load('geo/house.obj', function(obj) {\n var cubeGeo = obj.children[0].geometry;\n var cubeMat = new THREE.MeshLambertMaterial( {color: 0xaf1212} );\n var cubeMesh = new THREE.Mesh(cubeGeo, cubeMat);\n geomArr.push(cubeGeo);\n });\n\n // load modern house\n objLoader.load('geo/anglehouse.obj', function(obj) {\n var cubeGeo = obj.children[0].geometry;\n var cubeMat = new THREE.MeshLambertMaterial( {color: 0xaf1212} );\n var cubeMesh = new THREE.Mesh(cubeGeo, cubeMat);\n // scene.add(cubeMesh); \n geomArr.push(cubeGeo);\n });\n\n// load a door.\n objLoader.load('geo/door.obj', function(obj) {\n var cubeGeo = obj.children[0].geometry;\n var cubeMat = new THREE.MeshLambertMaterial( {color: 0xaf1212} );\n var cubeMesh = new THREE.Mesh(cubeGeo, cubeMat);\n cubeMesh.position.set(0,0,-.07);\n // scene.add(cubeMesh); \n geomArr.push(cubeGeo);\n });\n\n // load a chimney\n objLoader.load('geo/cube.obj', function(obj) {\n var cubeGeo = obj.children[0].geometry;\n var cubeMat = new THREE.MeshLambertMaterial( {color: 0xaf1212} );\n var cubeMesh = new THREE.Mesh(cubeGeo, cubeMat);\n cubeMesh.scale.set(0.125,0.40,0.25);\n cubeMesh.position.set(0.65,0.8,0);\n // scene.add(cubeMesh); pls build frkn cities\n geomArr.push(cubeGeo);\n });\n\n // noise function \n function noise(x, y) {\n x = (x << 13) ^ x;\n // return x;\n var ret = (1.0 - (x * (y * y * 15731.0 + 789221.0) + 1376312589.0) & 140737488355327) / 10737741824.0; \n return ret;\n }\n\n // place and load trees based on noise \n objLoader.load('geo/tree.obj', function(obj) {\n var cubeGeo = obj.children[0].geometry;\n var cubeMat = new THREE.MeshLambertMaterial( {color: 0x91b66d} );\n\n for (var x = -17; x < 20; x += 3) {\n for (var z = -20; z < 0; z += 3) {\n var noX = noise(x, z);\n var cubeMesh = new THREE.Mesh(cubeGeo, cubeMat);\n cubeMesh.position.set(x + noX * 5, -0.75, z - noX * 5);\n cubeMesh.scale.set(0.7, 0.7, 0.7);\n cubeMesh.rotation.set(0,noX * 10,0);\n scene.add(cubeMesh);\n }\n }\n\n for (var x = -20; x < -10; x += 3) {\n for (var z = 0; z < 20; z += 3) {\n var noX = noise(x, z);\n var cubeMesh = new THREE.Mesh(cubeGeo, cubeMat);\n cubeMesh.rotation.set(0,noX * 10,0);\n cubeMesh.position.set(x + noX * 5, -0.75, z - noX * 5);\n cubeMesh.scale.set(0.7, 0.7, 0.7);\n scene.add(cubeMesh);\n }\n }\n\n });\n\n // set background color\n renderer.setClearColor (0xf2caba, 1);\n\n // initialize simple lighting\n var directionalLight = new THREE.DirectionalLight( 0xffffff, 1 );\n directionalLight.color.setHSL(0.1, 1, 0.95);\n directionalLight.position.set(1, 2, 2);\n directionalLight.position.multiplyScalar(10);\n scene.add(directionalLight);\n // add in an ambient light \n var light = new THREE.AmbientLight( 0x404040, 2);\n scene.add(light);\n\n // set camera position\n camera.position.set(1, -.5, 10);\n camera.lookAt(new THREE.Vector3(0,0,0));\n\n // add in ground plane\n // var material = new THREE.MeshLambertMaterial( { color: 0xacaaa5 , side: THREE.DoubleSide} );\n // var geometry = new THREE.PlaneGeometry( 50, 50, 30 );\n // var plane = new THREE.Mesh( geometry, material );\n // plane.rotateX(-Math.PI/2);\n // plane.position.set(0,-1.1,0);\n // scene.add(plane);\n\n var material = new THREE.MeshLambertMaterial( { color: 0xcbccb8, side: THREE.DoubleSide } );\n var geometry = new THREE.CircleGeometry( 30, 30 );\n var cylinder = new THREE.Mesh( geometry, material );\n cylinder.rotateX(-Math.PI/2);\n cylinder.position.set(0,-1.1, 0);\n scene.add( cylinder );\n\n // add in \"pool\"\n var poolGeom = new THREE.CircleGeometry( 5, 32 );\n var mat = new THREE.MeshBasicMaterial( { color: 0xabdbde, side: THREE.DoubleSide} );\n var circle = new THREE.Mesh( poolGeom, mat );\n circle.position.set(0,-1.0,10.0);\n\n circle.rotateX(-Math.PI/2);\n scene.add( circle );\n\n // GUI stuff\n gui.add(camera, 'fov', 0, 180).onChange(function(newVal) {\n camera.updateProjectionMatrix();\n });\n\n var guiItems = function() {\n this.draw = function() {\n var lsys = new Lsystem(scene, geomArr);\n // only one iteration possible\n doLsystem(lsys, 1 , turtle , scene); \n };\n }\n var guio = new guiItems(); \n\n gui.add(guio, 'draw');\n}", "function create_atom_particle_state_1() {\n\n // Creates the Geometry of the Sphere representing\n // the Atom's Particle #1\n atom_particle_geometry_1 = new THREE.SphereGeometry(0.22, 40, 40);\n\n // Creates the Material of the Sphere representing\n // the Atom's Particle #1\n atom_particle_material_1 = new THREE.MeshBasicMaterial(\n {\n color: 0xff2200,\n depthTest: true,\n transparent: true,\n opacity: 1.0\n }\n );\n\n // Creates the Mesh of the Atom's Particle's State #1\n atom_particle_mesh_1 = new THREE.Mesh(atom_particle_geometry_1, atom_particle_material_1); \n \n // Translates/Moves the Atom's Particle's State #1\n // -2.51 units, regarding the X Axis\n atom_particle_mesh_1.position.x = -2.51;\n\n // Creates the group for the Atom's Particle's State's Pivot #1\n atom_particle_state_pivot_1 = new THREE.Group();\n\n // Adds the Mesh of the Atom's Particle's State #1\n // the group for the Atom's Particle's State's Pivot #1\n atom_particle_state_pivot_1.add(atom_particle_mesh_1);\n\n}", "function initTrayPoints(nbPoints, opt, profile, threeDModel) {\r\n\r\n var points = profile.getPoints(nbPoints, threeDModel);\r\n trayDists = distanceMatrix(points);\r\n trayTsne = new tsnejs.tSNE(opt); // create a tSNE instance\r\n trayTsne.initDataDist(trayDists);\r\n if (threeDModel) {\r\n for (var i = 0; i < points.length; i++) {\r\n var color = points[i].color;\r\n var material = new THREE.MeshBasicMaterial({color: color});\r\n var mesh = new THREE.Mesh(trayCubesGeometry, material);\r\n mesh.position.x = points[i].coords[0] * trayRatio;\r\n mesh.position.y = points[i].coords[1] * trayRatio;\r\n mesh.position.z = points[i].coords[2] * trayRatio;\r\n trayStars.push(mesh);\r\n trayScene.add(mesh);\r\n }\r\n } else {\r\n for (var i = 0; i < points.length; i++) {\r\n var star = new THREE.Vector3();\r\n star.x = points[i].coords[0] * trayRatio;\r\n star.y = points[i].coords[1] * trayRatio;\r\n star.z = 0;\r\n trayStarsGeometry.vertices.push(star);\r\n var color = points[i].color;\r\n var texture = new THREE.TextureLoader().load('textures/circle.png');\r\n var starsMaterial = new THREE.PointsMaterial({\r\n size: 0.5,\r\n color: color,\r\n map: texture,\r\n transparent: true,\r\n depthWrite: false\r\n });\r\n var starField = new THREE.Points(trayStarsGeometry, starsMaterial);\r\n trayStars.push(starField);\r\n trayScene.add(starField);\r\n }\r\n }\r\n\r\n\r\n}" ]
[ "0.6465934", "0.64145064", "0.64121383", "0.63814074", "0.6365729", "0.63539296", "0.63539296", "0.6348783", "0.6347253", "0.63336706", "0.6276807", "0.62740856", "0.62642395", "0.6253181", "0.623196", "0.6220718", "0.6206399", "0.6155851", "0.6155828", "0.6151604", "0.614883", "0.61448294", "0.6124803", "0.61112857", "0.61014134", "0.60918844", "0.60732687", "0.6065647", "0.6061393", "0.60607964", "0.60533655", "0.6042714", "0.6037182", "0.60307395", "0.60290426", "0.60191965", "0.59956", "0.5989005", "0.59719366", "0.5970515", "0.59687936", "0.59645116", "0.59571064", "0.5953596", "0.59408295", "0.5939524", "0.5938274", "0.59343684", "0.59240985", "0.5923412", "0.5921289", "0.59117615", "0.5911346", "0.5911342", "0.59085304", "0.5905139", "0.59035814", "0.5898888", "0.5898654", "0.58971596", "0.58938026", "0.5888693", "0.588409", "0.58791375", "0.587735", "0.5869901", "0.5855898", "0.5850086", "0.5844602", "0.5844366", "0.5841209", "0.5840831", "0.58407736", "0.5836082", "0.5833916", "0.5828724", "0.58274204", "0.5810362", "0.5808702", "0.5806494", "0.58047724", "0.58023584", "0.580054", "0.5799299", "0.5792178", "0.5784609", "0.5783982", "0.57799876", "0.57792336", "0.5774702", "0.57721364", "0.57660985", "0.576227", "0.5751735", "0.5749007", "0.5742038", "0.57373947", "0.57373416", "0.57307625", "0.57267404" ]
0.6379459
4
! vuerouter v3.1.3 (c) 2019 Evan You
function r(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "private public function m246() {}", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "private internal function m248() {}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "vampireWithName(name) {\n \n }", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function fyv(){\n \n }", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "transient private internal function m185() {}", "upgrade() {}", "function SigV4Utils() { }", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function uf(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function comportement (){\n\t }", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "updated() {}", "added(vrobject){}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Vt(){this.__data__=[]}", "transient final protected internal function m174() {}", "protected internal function m252() {}", "function VO(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};VO.installed||(VO.installed=!0,t.use(i,e),t.use(r,e),t.use(o,e),t.use(a,e),t.use(s,e),t.use(u,e),t.use(l,e),t.use(c,e),t.use(d,e),t.use(h,e),t.use(f,e),t.use(p,e),t.use(m,e),t.use(v,e),t.use(g,e),t.use(_,e),t.use(y,e),t.use(b,e),t.use(x,e),t.use(w,e),t.use(A,e),t.use(M,e),t.use(S,e),t.use(T,e),t.use(k,e),t.use(O,e),t.use(C,e),t.use(L,e),t.use(E,e),t.use(D,e),t.use(j,e),t.use(I,e),t.use(P,e),t.use(Y,e),t.use(F,e),t.use(R,e),t.use(N,e),t.use(B,e),t.use($,e),t.use(z,e),t.use(H,e),t.use(V,e),t.use(G,e))}", "static get tag(){return\"hal-9000\"}", "function EN(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient protected internal function m189() {}", "function WD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Bevy() {}", "function zC(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "install(Vue, options) {\n Vue.VERSION = 'v0.0.1';\n\n let userOptions = {...defaultOptions, ...options};\n // console.log(userOptions)\n\n // create a mixin\n Vue.mixin({\n // created() {\n // console.log(Vue.VERSION);\n // },\n\n\n });\n Vue.prototype.$italicHTML = function (text) {\n return '<i>' + text + '</i>';\n }\n Vue.prototype.$boldHTML = function (text) {\n return '<b>' + text + '</b>';\n }\n\n // define a global filter\n Vue.filter('preview', (value) => {\n if (!value) {\n return '';\n }\n return value.substring(0, userOptions.cutoff) + '...';\n })\n\n Vue.filter('localname', (value) => {\n if (!value) {\n return '';\n }\n var ln = value;\n if(value!= undefined){\n if ( value.lastIndexOf(\"#\") != -1) { ln = value.substr(value.lastIndexOf(\"#\")).substr(1)}\n else{ ln = value.substr(value.lastIndexOf(\"/\")).substr(1) }\n ln = ln.length == 0 ? value : ln\n }\n return ln\n })\n\n // add a custom directive\n Vue.directive('focus', {\n // When the bound element is inserted into the DOM...\n inserted: function (el) {\n // Focus the element\n el.focus();\n }\n })\n\n }", "function iT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "transient private protected internal function m182() {}", "function vinewx(t=\"untitled\",s=!1){return new class{constructor(t,s){this.name=t,this.debug=s,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>this.isNode?{request:\"undefined\"!=typeof $request?void 0:require(\"request\"),fs:require(\"fs\")}:null)(),this.cache=this.initCache(),this.log(`INITIAL CACHE:\\n${JSON.stringify(this.cache)}`),Promise.prototype.delay=function(t){return this.then(function(s){return((t,s)=>new Promise(function(e){setTimeout(e.bind(null,s),t)}))(t,s)})}}get(t){return this.isQX?(\"string\"==typeof t&&(t={url:t,method:\"GET\"}),$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.get(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}post(t){return this.isQX?(\"string\"==typeof t&&(t={url:t}),t.method=\"POST\",$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.post(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request.post(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}initCache(){if(this.isQX)return JSON.parse($prefs.valueForKey(this.name)||\"{}\");if(this.isLoon||this.isSurge)return JSON.parse($persistentStore.read(this.name)||\"{}\");if(this.isNode){const t=`${this.name}.json`;return this.node.fs.existsSync(t)?JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:\"wx\"},t=>console.log(t)),{})}}persistCache(){const t=JSON.stringify(this.cache);this.log(`FLUSHING DATA:\\n${t}`),this.isQX&&$prefs.setValueForKey(t,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(t,this.name),this.isNode&&this.node.fs.writeFileSync(`${this.name}.json`,t,{flag:\"w\"},t=>console.log(t))}write(t,s){this.log(`SET ${s} = ${JSON.stringify(t)}`),this.cache[s]=t,this.persistCache()}read(t){return this.log(`READ ${t} ==> ${JSON.stringify(this.cache[t])}`),this.cache[t]}delete(t){this.log(`DELETE ${t}`),delete this.cache[t],this.persistCache()}notify(t,s,e,i){const o=\"string\"==typeof i?i:void 0,n=e+(null==o?\"\":`\\n${o}`);this.isQX&&(void 0!==o?$notify(t,s,e,{\"open-url\":o}):$notify(t,s,e,i)),this.isSurge&&$notification.post(t,s,n),this.isLoon&&$notification.post(t,s,e),this.isNode&&(this.isJSBox?require(\"push\").schedule({title:t,body:s?s+\"\\n\"+e:e}):console.log(`${t}\\n${s}\\n${n}\\n\\n`))}log(t){this.debug&&console.log(t)}info(t){console.log(t)}error(t){console.log(\"ERROR: \"+t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){this.isQX||this.isLoon||this.isSurge?$done(t):this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}(t,s)}", "function UserGallerie()\n{\n var Video=deserialize(\"Video\",{});\n // Vorschauliste bunt\n var VideoLinks=$x(\"//a[contains(@href,'watch?v=')]\")\n .map(function (a) { return { link:a.href, elem:('user'==Kategorie?$xs(\"ancestor::div[@class='video yt-tile-visible'] | ancestor::li[@class='channels-content-item']\",a):'channel'==Kategorie?$xs('../..',a):a.parentNode)||a }; })\n .map(function (vid) { vid.id=((vid.link||\"\").match(/v=([a-zA-Z0-9-_]*)/)||[\"\",\"\"])[1]; return vid; });\n //alert(uneval(VideoLinks));\n VideoLinks.forEach(function (vid) { if (Video[vid.id]) /*vid.elem.className=\"w\"+Video[vid.id].qualitaet;*/ vid.elem.style.backgroundColor={ \"gut\":\"green\", \"schlecht\":\"red\", undefined:\"yellow\" }[Video[vid.id].qualitaet]; });\n //showmsg({ text:\"aaa\" });\n $x(\"//a[contains(@href,'v=')]\").forEach(function (a) { a.addEventListener(\"click\",function(event){\n //if (event.ctrlKey) // && event.altKey)\n //{\n var e=event.target;\n while (!e || !e.href) e=e.parentNode;\n var VideoID=e.href.match(/v=([a-zA-Z0-9-_]*)/)[1];\n var Video=deserialize(\"Video\",{});\n if (!Video[VideoID])\n {\n Video[VideoID]={ id:VideoID, anz:0, lastseen:new Date() };\n serialize(\"Video\",Video);\n var ColorNode=$xs(\"ancestor::div[@class='video yt-tile-visible'] | ancestor::li[@class='channels-content-item']\",a)||a;\n ColorNode.style.color=\"lightgray\";\n ColorNode.style.backgroundColor=\"darkgray\";\n event.stopPropagation();\n event.preventDefault();\n }\n //}\n }, true); });\n}", "ready() {\n window.plugin = new window.Vue( {\n el : this.shadowRoot,\n created() {\n Editor.log( \"成功初始化\" );\n },\n data : {\n uuid : \"bae4f6b4-7d1e-4612-99b7-ab5239576cc1\",\n scriptUrl: \"\",\n uuidObj : {},\n isFind : false,\n isFindAll: true,\n },\n methods: {\n _setOpenUrl() {\n let path = Editor.url( 'db://assets' );\n let files = Editor.Dialog.openFile( {\n defaultPath: path,\n properties : [ 'openDirectory' ]\n } );\n if ( files ) {\n path = files[0];\n }\n this.scriptUrl = path;\n },\n onSelectJSPath() {\n this._setOpenUrl();\n let assetUrl = Editor.remote.assetdb.fspathToUrl( this.scriptUrl );\n if ( this.scriptUrl === assetUrl ) {\n Editor.warn( \"请选择项目目录哦\" );\n return;\n }\n this._analyzeUUIDInfo( assetUrl, \"javascript\" );\n },\n\n onSelectSFPath() {\n this._setOpenUrl();\n let assetUrl = Editor.remote.assetdb.fspathToUrl( this.scriptUrl );\n if ( this.scriptUrl === assetUrl ) {\n Editor.warn( \"请选择项目目录哦\" );\n return;\n }\n this._analyzeUUIDInfo( assetUrl, \"sprite-frame\" );\n },\n\n onSelectFontPath() {\n this._setOpenUrl();\n let assetUrl = Editor.remote.assetdb.fspathToUrl( this.scriptUrl );\n if ( this.scriptUrl === assetUrl ) {\n Editor.warn( \"请选择项目目录哦\" );\n return;\n }\n this._analyzeUUIDInfo( assetUrl, [ \"label-atlas\", \"bitmap-font\" ] );\n },\n\n _analyzeUUIDInfo( url, type ) {\n let self = this;\n self.uuidObj = {};\n Editor.assetdb.queryAssets( url + \"/**/*\", type, function ( err, results ) {\n if ( err ) return;\n let len = results.length;\n for (let i = 0; i < len; i++) {\n let uuid = results[i].uuid;\n if ( type === \"javascript\" ) uuid = Editor.Utils.UuidUtils.compressUuid( results[i].uuid );\n self.uuidObj[uuid] = results[i];\n }\n } );\n },\n onCheckUUID() {\n Editor.log( 'check uuid', this.uuid );\n },\n onFindUUID() {\n // Editor.assetdb.queryUuidByUrl( url, function ( err, uuid ) {\n // Editor.log( \"uuid\", uuid );\n // } );\n if ( this.isFind ) {\n Editor.log( \"正在查找中.........\" );\n return;\n }\n this.isFind = true;\n let self = this;\n let objs = Object.values( this.uuidObj );\n if ( objs.length > 0 ) {\n Editor.log( objs[0].type );\n this._findInfo( objs[0].type, this.uuidObj );\n return;\n }\n if ( !this._isUUID() ) {\n Editor.log( \"uuid 无效\" );\n return;\n }\n let url = Editor.remote.assetdb.uuidToUrl( this.uuid );\n Editor.log( \"开始查找!!!!!!!\", this.uuid, url );\n Editor.assetdb.queryInfoByUuid( this.uuid, function ( err, info ) {\n Editor.log( \"当前查找的文件信息\", info, self.uuid );\n if ( err ) return;\n self._findInfo( info.type );\n } );\n // Editor.assetdb.queryUrlByUuid( this.uuid, function ( err, url ) {\n // Editor.log( \"info1\", url );\n // } );\n },\n _isUUID() {\n let isUUID = Editor.Utils.UuidUtils.isUuid( this.uuid );\n return isUUID;\n },\n\n _findInfo( type, uuidOrObj ) {\n let self = this;\n Editor.log( \"find \" + type );\n if ( type === \"sprite-frame\" || type === \"label-atlas\" || type === \"bitmap-font\" ) {\n Editor.assetdb.queryAssets( \"db://assets/resources/prefab/**/*\", [ 'prefab', 'scene' ], function ( err, results ) {\n Editor.log( \"查找 prefab 文件数量:\", results.length );\n self._analyze( results, type, uuidOrObj || self.uuid );\n } );\n } else if ( type === \"javascript\" ) {\n Editor.assetdb.queryAssets( \"db://assets/resources/prefab/**/*\", [ 'prefab', 'scene' ], function ( err, results ) {\n Editor.log( \"查找 prefab 文件数量:\", results.length );\n let uuid = uuidOrObj || Editor.Utils.UuidUtils.compressUuid( self.uuid );\n self._analyze( results, type, uuid );\n } );\n }\n },\n\n _analyze( list, type, uuidOrObj ) {\n let uuidObj = uuidOrObj;\n if ( typeof uuidOrObj === \"string\" ) {\n uuidObj = { [uuidOrObj]: { uuid: uuidOrObj } };\n }\n let len = Array.isArray( list ) ? list.length : 0;\n let result = \"\";\n for (let i = 0; i < len; i++) {\n let template = Fs.readFileSync( list[i].path, 'utf-8' );\n let json = JSON.parse( template ) || [];\n let num = json.length;\n Editor.log( \"正在查找当前文件:\", list[i].path );\n for (let j = 0; j < num; j++) {\n let obj = json[j];\n if ( !obj ) continue;\n let uObj = null;\n if ( type === \"sprite-frame\" ) {\n uObj = this._getSpriteFrame( obj, uuidObj );\n } else if ( type === \"javascript\" ) {\n uObj = this._getSpriteScript( obj, uuidObj );\n } else if ( type === \"label-atlas\" || type === \"bitmap-font\" ) {\n uObj = this._getSpriteFont( obj, uuidObj );\n }\n if ( !uObj ) continue;\n if ( uObj.isExist && !this.isFindAll ) continue;\n uObj.isExist = true;\n let path = uObj.path ? \"<\" + uObj.path + \">\" : uObj.uuid;\n result = result + path + list[i].path + \"\\n\";\n }\n }\n //查找玩家\n Editor.log( \"----------以下文件暂时没有找到引用---------------\" );\n let values = Object.values( uuidObj );\n let count = values.length;\n let sum = 0;\n for (let i = 0; i < count; i++) {\n if ( values[i].isExist ) continue;\n let path = values[i].path ? values[i].path : values[i].uuid;\n Editor.log( path );\n sum++;\n }\n Editor.log( \"总计有\", sum, \"个类型\", type, \"文件未被引用\" );\n this.uuidObj = {};\n this.isFind = false;\n Editor.log( \"----------查找到以下文件以及在那个预制文件下引用---------------\" );\n Editor.log( result );\n Editor.log( \"----------complete---------------\" );\n },\n _getSpriteFrame( obj, uuidObj ) {\n let result = null;\n do {\n if ( obj[\"__type__\"] !== \"cc.Sprite\" ) break;\n if ( !obj[\"_spriteFrame\"] ) break;\n let uObj = uuidObj[obj[\"_spriteFrame\"][\"__uuid__\"]];\n if ( !uObj ) break;\n result = uObj;\n } while ( 0 );\n return result;\n },\n\n _getSpriteScript( obj, uuidObj ) {\n let result = null;\n do {\n let uObj = uuidObj[obj[\"__type__\"]];\n if ( uObj ) {\n result = uObj;\n break;\n }\n let componentId = obj[\"_componentId\"];\n if ( !componentId ) break;\n uObj = uuidObj[componentId];\n if ( !uObj ) break;\n result = uObj;\n } while ( 0 );\n return result;\n },\n _getSpriteFont( obj, uuidObj ) {\n let result = null;\n do {\n if ( obj[\"__type__\"] !== \"cc.Label\" ) break;\n if ( !obj[\"_N$file\"] ) break;\n let uObj = uuidObj[obj[\"_N$file\"][\"__uuid__\"]];\n if ( !uObj ) break;\n result = uObj;\n } while ( 0 );\n return result;\n },\n }\n } );\n }", "function test_candu_graphs_datastore_vsphere6() {}", "function Jb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function ea(){}", "__previnit(){}", "function Eu(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}", "function vB_PHP_Emulator()\n{\n}", "function FP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }" ]
[ "0.5924966", "0.58903253", "0.5834089", "0.5810637", "0.5764255", "0.5731859", "0.56664914", "0.5651077", "0.5648576", "0.56271744", "0.56117946", "0.56101716", "0.56060225", "0.55370706", "0.5529062", "0.5494708", "0.5491031", "0.54674906", "0.5427357", "0.5420879", "0.54150784", "0.5403239", "0.54019266", "0.5400878", "0.5386206", "0.5368212", "0.5356952", "0.53450626", "0.534012", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53386813", "0.53207123", "0.5315813", "0.531446", "0.5299036", "0.5294519", "0.52888876", "0.52807546", "0.5268238", "0.5259227", "0.5254106", "0.52397275", "0.5223261", "0.52017945", "0.51829684", "0.5182112", "0.5163627", "0.516302", "0.515683", "0.5155966", "0.5138305", "0.5122731", "0.511794", "0.51161385", "0.5110434", "0.51076543", "0.5105272", "0.5101295", "0.509837", "0.50933504", "0.5089022", "0.5082332", "0.5067788", "0.50611836", "0.5060055", "0.5060055" ]
0.0
-1
Export the Canvas as SVG. It will descend to whole graph of objects and ask each one to convert to SVG (and use the proper indentation) Note: Placed out of editor.php so we can safelly add '<?...' string
function toSVG() { return ''; /* Note: Support for SVG is suspended * var canvas = getCanvas(); //@see http://www.w3schools.com/svg/svg_example.asp var v2 = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'; v2 += "\n" + '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="' + canvas.width +'" height="' + canvas.height + '" viewBox="0 0 ' + canvas.width + ' ' + canvas.height + '" version="1.1">'; INDENTATION++; v2 += STACK.toSVG(); v2 += CONNECTOR_MANAGER.toSVG(); INDENTATION--; v2 += "\n" + '</svg>'; return v2; */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exportCanvas() {\n //export canvas as SVG\n var v = '<svg width=\"300\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\\\n <rect x=\"0\" y=\"0\" height=\"200\" width=\"300\" style=\"stroke:#000000; fill: #FFFFFF\"/>\\\n <path d=\"M100,100 C200,200 100,50 300,100\" style=\"stroke:#FFAAFF;fill:none;stroke-width:3;\" />\\\n <rect x=\"50\" y=\"50\" height=\"50\" width=\"50\"\\\n style=\"stroke:#ff0000; fill: #ccccdf\" />\\\n </svg>';\n\n\n\n //get svg\n var canvas = getCanvas();\n\n var v2 = '<svg width=\"' + canvas.width + '\" height=\"' + canvas.height + '\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">';\n v2 += STACK.toSVG();\n v2 += CONNECTOR_MANAGER.toSVG();\n v2 += '</svg>';\n alert(v2);\n\n //save SVG into session\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"../common/controller.php\", {action: 'saveSvg', svg: escape(v2)},\n function(data) {\n if (data == 'svg_ok') {\n //alert('SVG was save into session');\n }\n else if (data == 'svg_failed') {\n Log.info('SVG was NOT save into session');\n }\n }\n );\n\n //open a new window that will display the SVG\n window.open('./svg.php', 'SVG', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');\n}", "function saveSVG(){\n\t\t\tvar blob = new Blob([canvas.toSVG()], {type: \"text/plain;charset=utf-8\"});\n\t\t\tsaveAs(blob, \"download.svg\");\n\n\t\t}", "_saveContextSVG(){\n this.getGraphicsContext().saveSVG();\n }", "function canvasToSVG() {\n if (chart.boost &&\n chart.boost.wgl &&\n isChartSeriesBoosting(chart)) {\n chart.boost.wgl.render(chart);\n }\n }", "toSVG() {\n if (this.geometryObject &&\n (\n this.geometryObject.geometryIsVisible === false ||\n this.geometryObject.geometryIsHidden === true ||\n this.geometryObject.geometryIsConstaintDraw === true\n )\n ) {\n return '';\n }\n\n let path = this.getSVGPath();\n\n let attributes = {\n d: path,\n stroke: this.strokeColor,\n fill: '#000',\n 'fill-opacity': 0,\n 'stroke-width': this.strokeWidth,\n 'stroke-opacity': 1, // toujours à 1 ?\n };\n\n let path_tag = '<path';\n for (let [key, value] of Object.entries(attributes)) {\n path_tag += ' ' + key + '=\"' + value + '\"';\n }\n path_tag += '/>\\n';\n\n let pointToDraw = [];\n if (app.settings.areShapesPointed && this.name != 'silhouette') {\n if (this.isSegment())\n pointToDraw.push(this.segments[0].vertexes[0]);\n if (!this.isCircle())\n this.segments.forEach(\n (seg) => (pointToDraw.push(seg.vertexes[1])),\n );\n }\n\n this.segments.forEach((seg) => {\n //Points sur les segments\n seg.divisionPoints.forEach((pt) => {\n pointToDraw.push(pt);\n });\n });\n if (this.isCenterShown) pointToDraw.push(this.center);\n\n let point_tags = pointToDraw.filter(pt => {\n pt.visible &&\n pt.geometryIsVisible &&\n !pt.geometryIsHidden\n }).map(pt => pt.svg).join('\\n');\n\n let comment =\n '<!-- ' + this.name.replace('é', 'e').replace('è', 'e') + ' -->\\n';\n\n return comment + path_tag + point_tags + '\\n';\n }", "serialize() {\n var svg = document.getElementsByTagName(\"svg\")\n var editor = atom.workspace.getActiveTextEditor()\n if(editor && (svg.length == 0)){\n this.createGraph(editor);\n }\n }", "function exportAsImage(){\n \n // variable for image name\n var chartName, svg ;\n \n // Getting svg name from this.id, replacing this.id by save\n // save prefix is for button and replacing it with sample to\n // get the svg chart div name \n\n svg = document.querySelector( '#dendogram svg' );\n \n //\n var svgData = new XMLSerializer().serializeToString( svg );\n\n var canvas = document.createElement( \"canvas\" );\n var ctx = canvas.getContext( \"2d\" );\n \n canvas.height = outerRadius*2;\n canvas.width = outerRadius*2;\n \n var dataUri = '';\n dataUri = 'data:image/svg+xml;base64,' + btoa(svgData);\n \n var img = document.createElement( \"img\" );\n \n img.onload = function() {\n ctx.drawImage( img, 0, 0 );\n \n // Initiate a download of the image\n var a = document.createElement(\"a\");\n \n a.download = \"circularDendogram\" + \".png\";\n a.href = canvas.toDataURL(\"image/png\");\n document.querySelector(\"body\").appendChild(a);\n a.click();\n document.querySelector(\"body\").removeChild(a);\n \n // Image preview in case of \"save image modal\"\n \n /*var imgPreview = document.createElement(\"div\");\n imgPreview.appendChild(img);\n document.querySelector(\"body\").appendChild(imgPreview);\n */\n };\n \n img.src = dataUri;\n}", "function saveCanvas() {\n // Generate SVG.\n var save_button = $('#save');\n var save_svg = $('#canvas').innerHTML.replace('<svg', '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n var data_uri = 'data:image/svg+xml;base64,' + window.btoa(save_svg);\n var filename = 'bustashape-' + window.location.hash.replace('#', '') + '-' + Date.now() + '.svg';\n\n // Prep link for new download.\n save_button.setAttribute('href', data_uri);\n save_button.setAttribute('download', filename);\n}", "saveImage() {\n console.log(this.stripStyles(this.state.svgString));\n canvg('canvas', this.stripStyles(this.state.svgString));\n document.getElementById('canvas').toBlob((blob) => {\n saveAs(blob, `tri2-${new Date().toISOString()}.png`);\n });\n }", "function saveSVG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n saveAs(blob, getFilenameWithoutExtension(curFilename) + \".svg\");\n}", "function savePNG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n var url = window.URL.createObjectURL(blob);\n\n var canvas = document.querySelector(\"canvas\");\n canvas.setAttribute(\"width\", width);\n canvas.setAttribute(\"height\", height);\n var context = canvas.getContext(\"2d\");\n\n var image = new Image;\n image.src = url;\n image.onload = function () {\n context.drawImage(image, 0, 0);\n var a = document.createElement(\"a\");\n a.download = getFilenameWithoutExtension(curFilename) + \".png\";\n a.href = canvas.toDataURL(\"image/png\");\n a.click();\n };\n}", "drawSvg() {\n \n\t}", "exportSvg(svg) {\n return __awaiter(this, void 0, void 0, function* () {\n const svgFilePath = this._uri.fsPath.replace('.json', '');\n const svgFileUri = yield vscode_1.window.showSaveDialog({\n defaultUri: vscode_1.Uri.parse(svgFilePath).with({ scheme: 'file' }),\n filters: { 'SVG': ['svg'] }\n });\n if (svgFileUri) {\n fs.writeFile(svgFileUri.fsPath, svg, (error) => {\n if (error) {\n const errorMessage = `Failed to save file: ${svgFileUri.fsPath}`;\n this._logger.logMessage(logger_1.LogLevel.Error, 'exportSvg():', errorMessage);\n vscode_1.window.showErrorMessage(errorMessage);\n }\n });\n }\n this.webview.postMessage({ command: 'showMessage', message: '' });\n });\n }", "function downloadSVG(){\r\n\tcrackPoint.remove();\r\n\tpaper.view.update();\r\n var svg = project.exportSVG({ asString: true, bounds: 'content' });\r\n var svgBlob = new Blob([svg], {type:\"image/svg+xml;charset=utf-8\"});\r\n var svgUrl = URL.createObjectURL(svgBlob);\r\n var downloadLink = document.createElement(\"a\");\r\n downloadLink.href = svgUrl;\r\n downloadLink.download = simText+\".svg\";\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n document.body.removeChild(downloadLink);\r\n\tcrackPoint.insertAbove(concreteObjects[concreteObjects.length-1]);\r\n}", "function drawSvg() {\n\t\t// selector can be #residential, or #commercial which should be in graph.html\n\t\tvar dataSources = [{selector: '#commercial', data: data.commGraphData}, \n\t\t\t{selector: '#residential', data: data.residGraphData}];\n\n\t\tdataSources.forEach(function(item) {\n\t\t\tvar canvas = createCanvas(item.selector, item.data);\n\t\t\tdrawHorizontalLabel(canvas);\n\t\t\tdrawVerticalLable(canvas, item.data);\n\t\t\tdrawHeatMap(canvas, item.data);\n\t\t});\n\t}", "function SaveAsSVG(document, newname)\r{\r var targetFolder = Folder(MATERIAL_EXPORT_PATH);\r\r if (! targetFolder.exists) {\r // geef een melding en \r throw(\"Onderstaande folder niet gevonden, is de netwerkverbinding gemaakt? \\n\\n\" +\r MATERIAL_EXPORT_PATH);\r }\r\r var exportOptions = new ExportOptionsSVG();\r var exportType = ExportType.SVG;\r\r var targetFile = MakeTempInvisibleFile(targetFolder, newname, \".ai\");\r // alert(targetFile);\r\r exportOptions.embedRasterImages = true;\r exportOptions.compressed = true;\r exportOptions.embedAllFonts = false;\r exportOptions.fontSubsetting = SVGFontSubsetting.GLYPHSUSED;\r exportOptions.cssProperties = SVGCSSPropertyLocation.PRESENTATIONATTRIBUTES;\r exportOptions.optimezForSVGViewer = true;\r\r document.exportFile( targetFile, exportType, exportOptions );\r document.close( SaveOptions.DONOTSAVECHANGES );\r\r var exportedFile = MakeTempInvisibleFile(targetFolder, newname, \".svgz\");\r // alert(exportedFile);\r if (exportedFile.exists) {\r if (! exportedFile.rename(newname+ \".svgz\")) {\r // bij aanwezig zijn oude file, deze proberen te deleten en vervolgens nogmaal renamen:\r var fl = new File(targetFolder + \"/\" + newname + \".svgz\");\r // alert(fl);\r if (fl.remove()) \r exportedFile.rename(newname+ \".svgz\")\r else\r alert(SCRIPT_NAME + \" is niet goed gelukt, oude file is nog aanwezig en niet te overschrijven!\") \r }\r } \r else\r alert(SCRIPT_NAME + \" is niet goed gelukt!\") \r}", "function exportPNG(filename) {\n\n\t$(\".connection\").css(\"fill\", \"none\");\n\t$(\".link-tools\").css(\"display\", \"none\");\n\t$(\".link-tools\").css(\"fill\", \"none\");\n\t\n\tvar svgDoc = paper.svg;\n\tvar serializer = new XMLSerializer();\n\tvar svgString = serializer.serializeToString(svgDoc);\n\n\tvar canvas = document.getElementById(\"canvas\");\n\tvar context = canvas.getContext('2d');\n\t\n\tcanvg(canvas, svgString);\n\t\n\tdestinationCanvas = document.createElement(\"canvas\");\n\tdestinationCanvas.width = canvas.width;\n\tdestinationCanvas.height = canvas.height;\n\n\tdestCtx = destinationCanvas.getContext('2d');\n\t\n\tdestCtx.fillStyle = \"#FFFFFF\";\n\tdestCtx.fillRect(0, 0, canvas.width, canvas.height);\n\t\n\tdestCtx.drawImage(canvas, 0, 0);\n\t\n\tvar img = destinationCanvas.toDataURL(\"image/png\");\n\t\n\tvar downloadLink = document.createElement(\"a\");\n\tdownloadLink.href = img;\n\tdownloadLink.download = filename + \".png\";\n\tdocument.body.appendChild(downloadLink);\n\tdownloadLink.click();\n\tdocument.body.removeChild(downloadLink);\n}", "function saveExternalSVG(){\r\n\tif(simulating)\r\n\t\treturn;\r\n\tvar svgCode = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"2000\" width=\"2000\" version=\"1.1\" viewBox=\"0 0 2000 2000\">\\n <g transform=\"translate(0 1000)\" fill=\"none\">\\n';\r\n\tsvgCode += ' <path d=\"M';\r\n\tfor(i = allGroundPointsX.length-1 ; i > -1 ; i--){\r\n\t\t//\t\trecord X and Y coordiantes with 2 decimal places with spaces between them\r\n\t\tsvgCode += \" \" + String(Math.round(allGroundPointsX[i]*500+100000)/100) + \" \" + String(Math.round(allGroundPointsY[i]*500)/100);\r\n\t\tif(i == 0 || !allGroundBreaks[i-1]){//\tfirst point of new line\r\n\t\t\tif(i == 0)//\t\tlast line\r\n\t\t\t\tsvgCode += '\" stroke=\"#000000\" stroke-width=\"1.5\"/>\\n';\r\n\t\t\telse\r\n\t\t\t\tsvgCode += '\" stroke=\"#000000\" stroke-width=\"1.5\"/>\\n <path d=\"M';\r\n\t\t}\r\n\t}\r\n\t\r\n\tsvgCode += ' <circle id=\"Goal\" cx=\"' + (Math.round(goalx*50+10000)/10) + '\" cy=\"' + (Math.round(-goaly*50)/10) + '\" r=\"' + (Math.round(goalr*50)/10) + '\" stroke=\"' + _goalColor + '\"/>\\n';\r\n\t\r\n\tfor(i = checkx.length-1 ; i > -1 ; i--){\r\n\t\t//\t\trecord X and Y coordinates with 1 decimal place with spaces between them\r\n\t\tsvgCode += ' <circle cx=\"' + (Math.round(checkx[i]*50+10000)/10) + '\" cy=\"' + (Math.round(-checky[i]*50)/10) + '\" r=\"' + (Math.round(checkr[i]*50)/10) + '\" stroke=\"' + _checkpointColor + '\"/>\\n';\r\n\t}\r\n\t\r\n\tsvgCode += ' </g>\\n</svg>';\r\n\t\r\n var downloadFile = document.createElement('a');\r\n\tdownloadFile.href = window.URL.createObjectURL(new Blob([svgCode], {type: 'text/svg'}));\r\n\tdownloadFile.download = 'Level.svg';\r\n\tdocument.body.appendChild(downloadFile);\r\n\tdownloadFile.click();\r\n\tdocument.body.removeChild(downloadFile);\r\n}", "function saveAs() {\n var dataURL = renderedCanvas();\n\n// var $diagram = {c:canvas.save(), s:STACK, m:CONNECTOR_MANAGER};\n var $diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n var $serializedDiagram = JSON.stringify($diagram);\n// $serializedDiagram = JSON.stringify($diagram, Util.operaReplacer);\n var svgDiagram = toSVG();\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //alert($serializedDiagram);\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\", {action: 'saveAs', diagram: $serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram},\n function(data) {\n if (data == 'noaccount') {\n Log.info('You must have an account to use that feature');\n //window.location = '../register.php';\n }\n else if (data == 'step1Ok') {\n Log.info('Save as...');\n window.location = './saveDiagram.php';\n }\n }\n );\n}", "function saveSVG(){\n\tsvg = \"<svg>\\n\\t\" + main.innerHTML + \"\\n</svg>\";\n\tvar link = document.createElement('a');\n\tmimeType = 'image/svg+xml' || 'text/plain';\n\tvar today = new Date();\n\tvar date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate() + '_' + today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n\tvar base = document.getElementsByName('base')[0].value;\n\tvar armWidth = document.getElementsByName('armWidth')[0].value;\n\tvar vertexExtrusion = document.getElementsByName('vertexExtrusion')[0].value;\n\tvar vertexDiameter = document.getElementsByName('vertexDiameter')[0].value;\n\tvar sideRadius = document.getElementsByName('sideRadius')[0].value;\n\tvar filename = 'Triangle_' + date + '_Base' + base + '_ArmWidth' + armWidth + \n\t\t'_VertexExtrusion' + vertexExtrusion + '_VertexDiameter' + vertexDiameter +\n\t\t'_SideRadius' + sideRadius + '.svg';\n\tlink.setAttribute('download', filename);\n\tlink.setAttribute('href', 'data:image/svg+xml; charset=utf-8,' + encodeURIComponent(svg));\n\tdocument.body.append(link);\n\tlink.click();\n\tdocument.body.removeChild(link);\n\tconsole.log(link);\n}", "function svgToCanvas(downloadlinkid){\n\t\t//get svg element.\n\t\tvar svg = document.getElementById(\"svg\");\n\n\t\t//get svg source.\n\t\tvar serializer = new XMLSerializer();\n\t\tvar source = serializer.serializeToString(svg);\n\n\t\t//add name spaces.\n\t\tif(!source.match(/^<svg[^>]+xmlns=\"http\\:\\/\\/www\\.w3\\.org\\/2000\\/svg\"/)){\n\t\t\tsource = source.replace(/^<svg/, '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n\t\t}\n\t\tif(!source.match(/^<svg[^>]+\"http\\:\\/\\/www\\.w3\\.org\\/1999\\/xlink\"/)){\n\t\t\tsource = source.replace(/^<svg/, '<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"');\n\t\t}\n\n\t\t//add xml declaration\n\t\tsource = '<?xml version=\"1.0\" standalone=\"no\"?>\\n' + source;\n\n\t\t//convert svg source to URI data scheme.\n\t\tvar url = \"data:image/svg+xml;charset=utf-8,\"+encodeURIComponent(source);\n\n\t\t//set url value to a element's href attribute.\n\t\tdocument.getElementById(downloadlinkid).href = url;\n\t\tdocument.getElementById(downloadlinkid).innerHTML=\"Figure ready,Right click me to save!\"\n\t\t//you can download svg file by right click menu\t\n\t}", "function save() {\n\n //alert(\"save triggered! diagramId = \" + diagramId );\n Log.info('Save pressed');\n\n if (state == STATE_TEXT_EDITING) {\n currentTextEditor.destroy();\n currentTextEditor = null;\n state = STATE_NONE;\n }\n\n var dataURL = null;\n try {\n dataURL = renderedCanvas();\n }\n catch (e) {\n if (e.name === 'SecurityError' && e.code === 18) {\n /*This is usually happening as we load an image from another host than the one Diagramo is hosted*/\n alert(\"A figure contains an image loaded from another host. \\\n \\n\\nHint: \\\n \\nPlease make sure that the browser's URL (current location) is the same as the one saved in the DB.\");\n }\n }\n\n// Log.info(dataURL);\n// return false;\n if (dataURL == null) {\n Log.info('save(). Could not save. dataURL is null');\n alert(\"Could not save. \\\n \\n\\nHint: \\\n \\nCanvas's toDataURL() did not functioned properly \");\n return;\n }\n\n var diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n //Log.info('stringify ...');\n// var serializedDiagram = JSON.stringify(diagram, Util.operaReplacer);\n var serializedDiagram = JSON.stringify(diagram);\n// Log.error(\"Using Util.operaReplacer() somehow break the serialization. o[1,2] \\n\\\n// is transformed into o.['1','2']... so the serialization is broken\");\n// var serializedDiagram = JSON.stringify(diagram);\n //Log.info('JSON stringify : ' + serializedDiagram);\n\n var svgDiagram = toSVG();\n\n// alert(serializedDiagram);\n// alert(svgDiagram);\n //Log.info('SVG : ' + svgDiagram);\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\",\n {action: 'save', diagram: serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram, diagramId: currentDiagramId},\n function(data) {\n if (data === 'firstSave') {\n Log.info('firstSave!');\n window.location = './saveDiagram.php';\n }\n else if (data === 'saved') {\n //Log.info('saved!');\n alert('saved!');\n }\n else {\n alert('Unknown: ' + data);\n }\n }\n );\n\n\n}", "function saveSVG(callback) {\n\n\t//~console.log('Save graph image file...')\n\toutFileIndex++\n\t\n\tlet outputFileName = filePrefix + '-' + ('' + outFileIndex).padStart(4, '0') + '.svg'\n\t\n\tfs.writeFile(__dirname + '/../data/staging/svg/' + outputFileName, d3n.svgString(), function(err, res) {\n\t\tif (err)\n\t\t\tthrow err\n\t\t\n\t\tif (outFileIndex % 100 === 0)\n\t\t\tconsole.log('...' + outputFileName + ' saved')\n\t\t\n\t\tif (callback)\n\t\t\tcallback()\n\t\t\n\t})\n\n}", "function saveTextAsSVG() {\n\t\t\"use strict\";\n\t\t//var textToWrite = document.getElementById(\"inputTextToSave\").value;\n\t\tvar json = editor.get();\n\t\tvar textToWrite = myDoc.getElementById(\"drawing1\").innerHTML;\n\n\t\tvar textFileAsBlob = new Blob([textToWrite], {\n\t\t\ttype: 'text/plain'\n\t\t});\n\t\tvar fileNameToSaveAs = json.Header.Name + \"_svg.svg\";\n\n\t\tvar downloadLink = document.createElement(\"a\");\n\t\tdownloadLink.download = fileNameToSaveAs;\n\t\tdownloadLink.innerHTML = \"Download File\";\n\t\tif (typeof window.webkitURL !== \"undefined\") {\n\t\t\t// Chrome allows the link to be clicked\n\t\t\t// without actually adding it to the DOM.\n\t\t\tdownloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);\n\t\t} else {\n\t\t\t// Firefox requires the link to be added to the DOM\n\t\t\t// before it can be clicked.\n\n\t\t\tdownloadLink.href = window.URL.createObjectURL(textFileAsBlob);\n\t\t\tdownloadLink.onclick = destroyClickedElement;\n\t\t\tdownloadLink.style.display = \"none\";\n\t\t\tdocument.body.appendChild(downloadLink);\n\n\t\t}\n\t\tsimulateClick(downloadLink);\n\t}", "function createSvg () {\r\n // Remove the existing one\r\n d3\r\n .select(canvasId)\r\n .selectAll('svg')\r\n .remove();\r\n // Create a new svg node\r\n svg = d3\r\n .select(canvasId)\r\n .append('svg:svg')\r\n .attr('width', 500)\r\n .attr('height', 500)\r\n .append('g') // Group all element to make alignment easier\r\n .attr('transform', function () { // Place in center of the page\r\n return 'translate(' + (500 / 2) + ', ' + (500 / 2) + ')';\r\n });\r\n }", "function downloadSVG(sn) {\n // Generate piece.\n var piece = computePiece(sn, {\n cropped: $(\"#cropped\").prop('selected'), \n trapezoidal:$(\"#trapezoidal\").prop('selected')\n });\n \n // Output to SVG.\n var svg = drawSVG(piece, $(\"#tmpSvg svg\")[0]);\n svg.attr('viewBox', \n piece.bbox.x \n + \" \" + piece.bbox.y \n + \" \" \n + (piece.bbox.x2-piece.bbox.x) \n + \" \" \n + (piece.bbox.y2-piece.bbox.y)\n );\n svg.attr({fill: 'none', stroke: 'black', strokeWidth: 0.1});\n\n blob = new Blob([svg.outerSVG()], {type: \"image/svg+xml\"});\n saveAs(blob, sn + \".svg\");\n \n}", "function downloadPNG2x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 2});\n}", "function downloadPNG4x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 4});\n}", "function exportImage(htmlId) {\n var svg = document.getElementById(htmlId);\n var canvas = document.getElementById('saveCanvas');\n canvas.height = svg.clientHeight;\n canvas.width = svg.clientWidth;\n var ctx = canvas.getContext('2d');\n var data = (new XMLSerializer()).serializeToString(svg);\n var DOMURL = window.URL || window.webkitURL || window;\n\n var img = new Image();\n var svgBlob = new Blob([data], { type: 'image/svg+xml;charset=utf-8' });\n var url = DOMURL.createObjectURL(svgBlob);\n img.src = url;\n\n img.onload = function () {\n ctx.drawImage(img, 0, 0);\n var imgURI = canvas\n .toDataURL('image/png')\n .replace('image/png', 'image/octet-stream');\n\n triggerDownload(imgURI);\n };\n\n}", "function downloadSVG() {\n\n var config = {\n filename: 'kappa_rulevis',\n }\n d3_save_svg.save(d3.select('#svg').node(), config);\n}", "function GetSGV() {\r\n var svg = project.exportSVG({ asString: true });\r\n console.log(svg);\r\n}", "serializeDrawingGraphicsChart(writer, chart) {\n let id = '';\n id = this.updatechartId(chart);\n // Processing chart\n writer.writeStartElement('wp', 'docPr', this.wpNamespace);\n writer.writeAttributeString(undefined, 'id', undefined, (this.mDocPrID++).toString());\n writer.writeAttributeString(undefined, 'name', undefined, this.getNextChartName());\n writer.writeEndElement(); // end of wp docPr\n writer.writeStartElement('wp', 'cNvGraphicFramePr', this.wpNamespace);\n writer.writeEndElement(); // end of cNvGraphicFramePr\n writer.writeStartElement('a', 'graphic', this.aNamespace);\n writer.writeStartElement('a', 'graphicData', this.aNamespace);\n writer.writeAttributeString(undefined, 'uri', undefined, this.chartNamespace);\n writer.writeStartElement('c', 'chart', this.chartNamespace);\n writer.writeAttributeString('xmlns', 'r', undefined, this.rNamespace);\n writer.writeAttributeString('r', 'id', undefined, id);\n writer.writeEndElement(); // end of chart\n writer.writeEndElement(); // end of graphic data\n writer.writeEndElement(); // end of graphic\n }", "function putSvg(next) {\n if (next == VIEWS.DOT.hash) {\n goToDot(next + \"/\" + dot_top);\n return;\n }\n if (!next) next = dot_top;\n var root = d3.select(\"#svg_container\");\n d3.xml(\"lib/dot_svg/\" + next + \".svg\", function(error, documentFragment) {\n if (error) {console.log(error); return;}\n var svgNode = documentFragment.getElementsByTagName(\"svg\")[0];\n\n var w = $(root.node()).width();\n var h = $(root.node()).height();\n\n svgNode.setAttribute(\"viewBox\", \"0 0 \" + w + ' ' + h);\n svgNode.setAttribute(\"style\", \"width: \" + w + 'px;height:' + h + \"px;\");\n\n var d = d3.select(svgNode);\n\n if (root.node().childNodes.length > 0) {\n root.node().replaceChild(svgNode, root.node().childNodes[0]);\n } else {\n root.node().appendChild(svgNode);\n }\n var matrix = d.select(\"g\").node().transform.baseVal.consolidate().matrix;\n var X = matrix.e;\n var Y = matrix.f;\n var width = parseInt(svgNode.getAttribute(\"width\"), 10);\n var height = parseInt(svgNode.getAttribute(\"height\"), 10);\n var x_scale = w / width;\n var y_scale = h / height;\n var initial_scale = Math.min(x_scale, y_scale);\n initial_scale = Math.min(initial_scale, 1);\n\n var translate_x = ((w - width*initial_scale) / 2);\n var translate_y = ((h - height*initial_scale) / 2);\n\n // Setup event listeners for model nodes.\n root.selectAll(\"polygon\").each(function() {\n if (this.hasAttribute(\"fill\")) {\n // All model nodes should show the corresponding HDL, or the\n // corresponding DOT graph when clicked. dsdk::A_MODEL_NODEs\n // are magenta, dsdk::A_SCHEDULED_MODEL_NODEs are white, and\n // are not a direct descendant of the \"graph\" (the background\n // is also white, but is a direct descendant of the \"graph\".\n if (this.getAttribute(\"fill\") == \"magenta\" ||\n (this.getAttribute(\"fill\") == \"white\" && !this.parentNode.classList.contains(\"graph\"))) {\n var g = this.parentNode;\n var title = g.getElementsByTagName(\"title\")[0].innerHTML;\n g.addEventListener(\"click\", function(e){\n // Ctrl+Click opens source, plain click opens graph.\n var evt = window.event || e;\n if (evt.ctrlKey) {\n // TODO Eventually the filename will probably need\n // to include a kernel/component subdirectory.\n var filename = title.replace(/^\\d+_/, \"\")+\".vhd\";\n addHdlFileToEditor(\"lib/hdl/\" + filename);\n if (sideCollapsed) {\n collapseAceEditor();\n refreshAreaVisibility();\n adjustToWindowEvent();\n }\n } else {\n var new_hash = window.location.hash + \"/\" + title;\n VIEWS.DOT.hash = new_hash;\n goToDot(new_hash);\n }\n });\n }\n }\n });\n\n // Clickdown for edge highlighting.\n root.selectAll(\"g.edge path\")\n .on('click', function () {\n // TODO use parent\n if (dot_clickdown == this) {\n dot_clickdown = null;\n } else {\n dot_clickdown = this;\n }\n });\n\n // Edge/arrowhead highlighting.\n var highlightColor = \"#1d99c1\";\n root.selectAll(\"g.edge path\")\n .on('mouseover', function () {\n $(this).attr({\"stroke-width\":5, \"stroke\":highlightColor});\n $(this).siblings(\"polygon\").attr({\"fill\":highlightColor, \"stroke\":highlightColor, \"stroke-width\":3});\n })\n .on('mouseout', function () {\n if (dot_clickdown == this) return;\n $(this).attr({\"stroke-width\":1, \"stroke\":\"black\"});\n $(this).siblings(\"polygon\").attr({\"fill\":\"black\", \"stroke\":\"black\", \"stroke-width\":1});\n });\n root.selectAll(\"g.edge polygon\")\n .on('mouseover', function () {\n $(this).siblings(\"path\").attr({\"stroke-width\":5, \"stroke\":highlightColor});\n $(this).attr({\"fill\":highlightColor, \"stroke\":highlightColor, \"stroke-width\":3});\n })\n .on('mouseout', function () {\n if (dot_clickdown == this) return;\n $(this).siblings(\"path\").attr({\"stroke-width\":1, \"stroke\":\"black\"});\n $(this).attr({\"fill\":\"black\", \"stroke\":\"black\", \"stroke-width\":1});\n });\n\n\n // TODO use translateExtent() to prevent translating out of frame?\n //.translateExtent([10 - X, 10 - Y, 2 * X - 10, 2 * Y - 10])\n //.translateExtent([[0, 0], [2 * Y - 10]])\n\n var scaled_x = initial_scale * X;\n var scaled_y = initial_scale * Y;\n scaled_x += translate_x;\n scaled_y += translate_y;\n var zoom = d3.behavior.zoom()\n .scaleExtent([0, 1.5])\n .scale(initial_scale)\n .translate([scaled_x, scaled_y])\n .on(\"zoom\", zoomed);\n d.select(\"g\").attr(\"transform\",\"translate(\" + scaled_x + \",\" + scaled_y +\")scale(\" + initial_scale + \",\" + initial_scale + \")\");\n d.call(zoom);\n if (!$('#dot_edges_toggle').is(':checked')) {\n $(\"#svg_container\").find(\"g.edge\").toggle();\n }\n });\n updateDotHierarchy();\n}", "function convertSVGtoPNG() {\n var canvas = document.getElementById('the-canvas');\n var context = canvas.getContext('2d');\n canvas.width = triOptions.width();\n canvas.height = triOptions.height();\n\n var image = new Image();\n\n $(image).on(\"load\", function() {\n context.drawImage(image, 0, 0);\n $(\"#download-btn\").attr(\"href\", canvas.toDataURL(\"image/png\"));\n });\n\n image.src = currentPattern.dataUri;\n var imagePath = canvas.toDataURL(\"image/png\");\n \n \n\n }", "function RvgsToSvg()\n{\n\t// return qualifyURL(\"/survol/internals/gui_create_svg_from_several_rdfs.py\");\n\treturn LocalHost() + \"/survol/gui_create_svg_from_several_rdfs.py\";\n}", "function downloadSVG() {\n var svg_root = document.getElementById('svg').outerHTML;\n var svgBlob = new Blob([svg_root], {type:\"image/svg+xml;charset=utf-8\"});\n var svgUrl = URL.createObjectURL(svgBlob);\n var downloadLink = document.createElement(\"a\");\n downloadLink.href = svgUrl;\n downloadLink.download = \"GeometricIllustration.svg\";\n document.body.appendChild(downloadLink);\n downloadLink.click();\n document.body.removeChild(downloadLink);\n}", "function downloadPNG() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\");\n}", "function exportsvg(sketch, palette) {\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n let svgns = svg.namespaceURI;\n\n let style = document.createElementNS(svgns, \"style\");\n style.innerHTML += `\n .line {\n fill: none;\n stroke: #000;\n }\n `;\n svg.appendChild(style);\n\n let c = sketch.view.center;\n let s = sketch.view.scale;\n let w = [window.innerWidth, window.innerHeight];\n let bounds = [\n c[0] - w[0] / 2 / s,\n -c[1] - w[1] / 2 / s,\n w[0] / s,\n w[1] / s\n ]\n svg.setAttribute(\"viewBox\", bounds.join(\" \"));\n\n for (let i in sketch.data) {\n let obj = sketch.data[i];\n if (obj.type !== \"line\") {\n continue;\n }\n let line = document.createElementNS(svgns, \"polyline\");\n line.classList.add(\"line\");\n line.style.strokeWidth = 2 * obj.width;\n\n let pointsstr = \"\"\n for (let j in obj.points) {\n let p = obj.points[j];\n pointsstr += `${p[0]} ${-p[1]} `;\n }\n line.setAttribute(\"points\", pointsstr);\n svg.appendChild(line);\n }\n\n return svg;\n}", "function saveAsPNG() {\n // draw to canvas...\n drawingCanvas.toBlob(function(blob) {\n saveAs(blob, \"canvas.png\");\n });\n }", "function configureExportSVG(glyphsGB) { \n if(!glyphsGB) { return; }\n if(!glyphsGB.navCtrls) { return; }\n \n var divFrame = glyphsGB.settings_panel;\n if(!divFrame) { \n divFrame = document.createElement('div'); \n glyphsGB.settings_panel = divFrame;\n }\n glyphsGB.navCtrls.appendChild(glyphsGB.settings_panel);\n \n var navRect = glyphsGB.navCtrls.getBoundingClientRect();\n \n divFrame.setAttribute('style', \"position:absolute; text-align:left; padding: 3px 3px 3px 3px; \" \n +\"background-color:rgb(235,235,240); \" \n +\"border:2px solid #808080; border-radius: 4px; \"\n +\"left:\"+(navRect.left+window.scrollX+glyphsGB.display_width-370)+\"px; \"\n +\"top:\"+(navRect.top+window.scrollY+20)+\"px; \"\n +\"width:350px; z-index:90; \"\n );\n divFrame.innerHTML = \"\";\n var tdiv, tdiv2, tspan1, tspan2, tinput, tcheck;\n\n var exportConfig = glyphsGB.exportSVGconfig;\n\n //close button\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv.setAttribute('style', \"float:right; margin: 0px 4px 4px 4px;\");\n var a1 = tdiv.appendChild(document.createElement('a'));\n a1.setAttribute(\"target\", \"top\");\n a1.setAttribute(\"href\", \"./\");\n a1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); return false; }\n var img1 = a1.appendChild(document.createElement('img'));\n img1.setAttribute(\"src\", eedbWebRoot+\"/images/close_icon16px_gray.png\");\n img1.setAttribute(\"width\", \"12\");\n img1.setAttribute(\"height\", \"12\");\n img1.setAttribute(\"alt\",\"close\");\n\n //title\n tdiv = document.createElement('div');\n tdiv.style = \"font-weight:bold; font-size:14px; padding: 5px 0px 5px 0px;\"\n tdiv.setAttribute('align', \"center\");\n tdiv.innerHTML = \"Export view as SVG image\";\n divFrame.appendChild(tdiv);\n\n //----------\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tdiv2.setAttribute('style', \"float:left; width:200px;\");\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_widgets) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'widgets', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"hide widgets\";\n\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.savefile) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'savefile', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"save to file\";\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_sidebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'sidebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide track sidebars\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_titlebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'titlebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide title bar\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_experiment_graph) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'experiments', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide experiment/expression graph\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_compacted_tracks) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'compacted_tracks', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide compacted tracks\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n //----------\n divFrame.appendChild(document.createElement('hr'));\n //----------\n var button1 = document.createElement('input');\n button1.type = \"button\";\n button1.className = \"medbutton\";\n button1.value = \"cancel\";\n button1.style.float = \"left\"; \n button1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); }\n divFrame.appendChild(button1);\n\n var button2 = document.createElement('input');\n button2.type = \"button\";\n button2.className = \"medbutton\";\n button2.value = \"export svg\";\n button2.style.float = \"right\"; \n button2.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-accept'); }\n divFrame.appendChild(button2);\n}", "function Export() {\n\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(Canvas.toDataURL()));\n element.setAttribute('download', \"img\");\n element.style.display = 'none';\n document.body.appendChild(element);\n element.click();\n document.body.removeChild(element);\n}", "function gLyphsCreateExperimentExpressExportWidget() {\n var g1 = document.createElementNS(svgNS,'g'); \n if(!current_region.exportSVGconfig) {\n g1.setAttributeNS(null, \"onclick\", \"gLyphsToggleExpressionSubpanel('export');\");\n g1.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n g1.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\"); \n // poly.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n }\n \n var rect = g1.appendChild(document.createElementNS(svgNS,'rect'));\n rect.setAttributeNS(null, 'x', '0px');\n rect.setAttributeNS(null, 'y', '0px');\n rect.setAttributeNS(null, 'width', '11px');\n rect.setAttributeNS(null, 'height', '11px');\n rect.setAttributeNS(null, 'fill', 'rgb(240,240,255)');\n rect.setAttributeNS(null, 'stroke', 'rgb(100,100,100)');\n //if(!current_region.exportSVGconfig) {\n // rect.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n // rect.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n // rect.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\");\n //}\n \n var poly = g1.appendChild(document.createElementNS(svgNS,'polygon'));\n poly.setAttributeNS(null, 'points', '4,2 7,2 7,5 9.5,5 5.5,9.5 1.5,5 4,5 4,2');\n //poly.setAttributeNS(null, 'fill', 'blue');\n poly.setAttributeNS(null, 'fill', 'gray');\n //if(!current_region.exportSVGconfig) {\n // poly.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n // poly.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n // poly.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\");\n //}\n g1.setAttributeNS(null, 'transform', \"translate(\" + (current_region.display_width-45) + \",0)\");\n return g1;\n}", "function ioSVG_exportSVGfont() {\n\t\t// debug('\\n ioSVG_exportSVGfont - Start');\n\t\tvar ps = _GP.projectsettings;\n\t\tvar md = _GP.metadata;\n\t\tvar family = md.font_family;\n\t\tvar familyid = family.replace(/ /g, '_');\n\t\tvar timestamp = genDateStampSuffix();\n\t\tvar timeoutput = timestamp.split('-');\n\t\ttimeoutput[0] = timeoutput[0].replace(/\\./g, '-');\n\t\ttimeoutput[1] = timeoutput[1].replace(/\\./g, ':');\n\t\ttimeoutput = timeoutput.join(' at ');\n\n\t\tvar con = '<?xml version=\"1.0\"?>\\n'+\n\t\t\t// '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" >\\n'+\n\t\t\t'<svg width=\"100%\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\\n'+\n\t\t\t'\\t<metadata>\\n\\n'+\n\t\t\t'\\t\\tProject: ' + ps.name + '\\n'+\n\t\t\t'\\t\\tFont exported on ' + timeoutput + '\\n\\n'+\n\t\t\t'\\t\\tCreated with Glyphr Studio - the free, web-based font editor\\n'+\n\t\t\t'\\t\\t' + _UI.thisGlyphrStudioVersion + '\\n'+\n\t\t\t'\\t\\t' + _UI.thisGlyphrStudioVersionNum + '\\n\\n'+\n\t\t\t'\\t\\tFind out more at www.glyphrstudio.com\\n\\n'+\n\t\t\t'\\t</metadata>\\n'+\n\t\t\t'\\t<defs>\\n'+\n\t\t\t'\\t\\t<font id=\"'+escapeXMLValues(familyid)+'\" horiz-adv-x=\"'+ps.upm+'\">\\n'+\n\t\t\t'\\t\\t\\t<font-face\\n'+ ioSVG_makeFontFace()+'\\n'+\n\t\t\t'\\t\\t\\t\\t<font-face-src>\\n'+\n\t\t\t'\\t\\t\\t\\t\\t<font-face-name name=\"'+escapeXMLValues(family)+'\" />\\n'+\n\t\t\t'\\t\\t\\t\\t</font-face-src>\\n'+\n\t\t\t'\\t\\t\\t</font-face>\\n';\n\n\t\tcon += '\\n';\n\t\tcon += ioSVG_makeMissingGlyph();\n\t\tcon += '\\n\\n';\n\t\tcon += ioSVG_makeAllGlyphsAndLigatures();\n\t\tcon += '\\n';\n\t\tcon += ioSVG_makeAllKernPairs();\n\t\tcon += '\\n';\n\n\t\tcon += '\\t\\t</font>\\n'+\n\t\t\t'\\t</defs>\\n\\n';\n\n\t\t// con += '\\t<style type=\"text/css\">\\n';\n\t\t// con += '\\t\\t@font-face {\\n';\n\t\t// con += '\\t\\t\\tfont-family: \"'+family+'\", monospace;\\n';\n\t\t// con += '\\t\\t\\tsrc: url(#'+familyid+');\\n';\n\t\t// con += '\\t\\t}\\n';\n\t\t// con += '\\t</style>\\n\\n';\n\n\t\tcon += '\\t<text x=\"100\" y=\"150\" style=\"font-size:48px;\" font-family=\"'+family+'\">'+family+'</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"220\" style=\"font-size:48px;\" font-family=\"'+family+'\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"290\" style=\"font-size:48px;\" font-family=\"'+family+'\">abcdefghijklmnopqrstuvwxyz</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"360\" style=\"font-size:48px;\" font-family=\"'+family+'\">1234567890</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"430\" style=\"font-size:48px;\" font-family=\"'+family+'\">!\\\"#$%&amp;\\'()*+,-./:;&lt;=&gt;?@[\\\\]^_`{|}~</text>\\n';\n\n\t\tcon += '</svg>';\n\n\t\tvar filename = ps.name + ' - SVG Font - ' + timestamp + '.svg';\n\n\t\tsaveFile(filename, con);\n\n\t\t// debug(' ioSVG_exportSVGfont - END\\n');\n\t}", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "function downloadSVG(){\n window.URL = window.webkitURL || window.URL;\n var contentType = 'image/svg+xml';\n var svgCode = $('#exportcode').val();\n var svgFile = new Blob([svgCode], {type: contentType});\n\n $('#aDownloadSvg').prop('download','pattern-bar.svg');\n $('#aDownloadSvg').prop('href',window.URL.createObjectURL(svgFile));\n // $('#aDownloadSvg').prop('textContent','<i class=\"fa fa-file-code-o\"></i> Download as SVG');\n}", "function downloadGraph() {\n utils.prompt(\"Download Graph Output - Filename:\", 'Graph' + idProject, function (value) {\n if (value) {\n\n // put all of the pieces together into a downloadable file\n var saveData = (function () {\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n return function (data, fileName) {\n var blob = new Blob([data], {type: \"octet/stream\"});\n var url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = fileName;\n a.click();\n window.URL.revokeObjectURL(url);\n };\n }());\n\n // TODO: The chartStyle contains 16 CSS errors. These need to be addressed.\n var svgGraph = document.getElementById('serial_graphing'),\n pattern = new RegExp('xmlns=\"http://www.w3.org/2000/xmlns/\"', 'g'),\n findY = 'class=\"ct-label ct-horizontal ct-end\"',\n chartStyle = '<style>.ct-perfect-fourth:after,.ct-square:after{content:\"\";clear:both}.ct-label{fill:rgba(0,0,0,.4);color:rgba(0,0,0,.4);font-size:.75rem;line-height:1}.ct-grid-background,.ct-line{fill:none}.ct-chart-line .ct-label{display:block;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{dominant-baseline:central}.ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-vertical.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-end;-webkit-justify-content:flex-end;-ms-flex-pack:flex-end;justify-content:flex-end;text-align:right;text-anchor:end}.ct-label.ct-vertical.ct-end{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-grid{stroke:rgba(0,0,0,.2);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:10px;stroke-linecap:round}.ct-line{stroke-width:4px}.ct-area{stroke:none;fill-opacity:.1}.ct-series-a .ct-line,.ct-series-a .ct-point{stroke: #00f;}.ct-series-a .ct-area{fill:#d70206}.ct-series-b .ct-line,.ct-series-b .ct-point{stroke: #0bb;}.ct-series-b .ct-area{fill:#f05b4f}.ct-series-c .ct-line,.ct-series-c .ct-point{stroke: #0d0;}.ct-series-c .ct-area{fill:#f4c63d}.ct-series-d .ct-line,.ct-series-d .ct-point{stroke: #dd0;}.ct-series-d .ct-area{fill:#d17905}.ct-series-e .ct-line,.ct-series-e .ct-point{stroke-width: 1px;stroke: #f90;}.ct-series-e .ct-area{fill:#453d3f}.ct-series-f .ct-line,.ct-series-f .ct-point{stroke: #f00;}.ct-series-f .ct-area{fill:#59922b}.ct-series-g .ct-line,.ct-series-g .ct-point{stroke:#c0c}.ct-series-g .ct-area{fill:#0544d3}.ct-series-h .ct-line,.ct-series-h .ct-point{stroke:#000}.ct-series-h .ct-area{fill:#6b0392}.ct-series-i .ct-line,.ct-series-i .ct-point{stroke:#777}.ct-series-i .ct-area{fill:#f05b4f}.ct-square{display:block;position:relative;width:100%}.ct-square:before{display:block;float:left;content:\"\";width:0;height:0;padding-bottom:100%}.ct-square:after{display:table}.ct-square>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fourth{display:block;position:relative;width:100%}.ct-perfect-fourth:before{display:block;float:left;content:\"\";width:0;height:0;padding-bottom:75%}.ct-perfect-fourth:after{display:table}.ct-perfect-fourth>svg{display:block;position:absolute;top:0;left:0}.ct-line {stroke-width: 1px;}.ct-point {stroke-width: 2px;}text{font-family:sans-serif;}</style>',\n svgxml = new XMLSerializer().serializeToString(svgGraph);\n\n svgxml = svgxml.replace(pattern, '');\n\n // TODO: Lint is complaining about the search values. Should they be enclosed in quotes?\n // No: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n svgxml = svgxml.replace(/foreignObject/g, 'text');\n svgxml = svgxml.replace(/([<|</])a[0-9]+:/g, '$1');\n svgxml = svgxml.replace(/xmlns: /g, '');\n svgxml = svgxml.replace(/span/g, 'tspan');\n svgxml = svgxml.replace(/x=\"10\" /g, 'x=\"40\" ');\n\n svgxml = svgxml.substring(svgxml.indexOf('<svg'), svgxml.length - 6);\n var foundY = svgxml.indexOf(findY);\n var theY = parseFloat(svgxml.substring(svgxml.indexOf(' y=\"', foundY + 20) + 4, svgxml.indexOf('\"', svgxml.indexOf(' y=\"', foundY + 20) + 4)));\n var regY = new RegExp('y=\"' + theY + '\"', 'g');\n svgxml = svgxml.replace(regY, 'y=\"' + (theY + 12) + '\"');\n var breakpoint = svgxml.indexOf('>') + 1;\n svgxml = svgxml.substring(0, breakpoint) + chartStyle + svgxml.substring(breakpoint, svgxml.length);\n saveData(svgxml, value + '.svg');\n }\n });\n}", "boundaryToSVG() {\n var points = this.getOrientedEdges();\n var svgString = \"M\";\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n svgString += point.x.toString() + \" \" + point.y.toString() + \" \";\n }\n svgString += points[0].x.toString() + \" \" + points[0].y.toString() + \" \";\n this.svg = svgString;\n return svgString;\n }", "function drawCharts() {\n\n console.log('in drawCharts()');\n\n // remove any existing svg so we don't append a second one below\n oldSvg = document.getElementById('chartDiv'); // get the parent container div for the svg\n removeChildren(oldSvg); // delete previous svg element before drawing new svg\n\n}", "function SVG(parentid, id='finchartsvg') {\n this.NS = \"http://www.w3.org/2000/svg\";\n this.xlinkNS = \"http://www.w3.org/1999/xlink\";\n this.version = \"1.1\";\n this.container = null;\n this.canvas = null;\n this.chart = null;\n this.volume = null;\n this.elements = [];\n this.width = 600;\n this.height = 300;\n this.padding = 20;\n this.color = \"black\";\n this.backcolor = \"white\";\n this.bordercolor = \"black\";\n this.fillstyle = \"grey\";\n this.strokestyle = \"black\";\n this.strokewidth = \"1px\";\n this.font = \"normal 1em Arial\";\n this.applyfillstyle = false;\n this.applystrokestyle = false;\n this.applystrokewidth = false;\n this.rotateStack = [];\n this.temp = {\n fill:null,\n stroke:null,\n end:null\n };\n this.colors = {\n red:\"red\",\n green:\"green\",\n blue:\"blue\",\n grey:\"grey\",\n lightgrey:\"lightgrey\",\n white:\"white\",\n black:\"black\"\n };\n \n this.container = document.getElementById(parentid);\n this.width = this.container.clientWidth;\n this.height = this.container.clientHeight;\n if(this.container.childNodes.length>0) { this.container.removeChild(this.container.childNodes[0]); }\n this.canvas = document.createElementNS(this.NS,\"svg\");\n this.canvas.setAttribute(\"id\",id);\n this.container.appendChild(this.canvas);\n this.size(this.width, this.height);\n}", "print(id) {\n return new Promise((resolve, reject) => {\n try {\n // firefox issue where svgs wont draw to image without a width and height\n // if we include a with and height they become unresponsive\n const currentWidth = d3.select(`#${id}ChartContainer .svg-container-chart`).node().clientWidth\n const currentHeight = d3.select(`#${id}ChartContainer .svg-container-chart`).node().clientHeight\n d3.select(`#${id}ChartContainer .svg-container-chart svg`)\n .attr(\"height\", currentHeight)\n .attr(\"width\", currentWidth)\n\n const canvasContainer = d3.select(`#${id}ChartContainer`)\n .append('div')\n .attr(\"class\", `${id}Class`)\n .html(`<canvas id=\"canvas${id}\" width=\"${currentWidth}\" height=\"${currentHeight}\" style=\"position: fixed;\"></canvas>`)\n\n const canvas = document.getElementById(`canvas${id}`);\n const image = new Image();\n image.onload = () => {\n canvas.getContext(\"2d\").drawImage(image, 0, 0, currentWidth, currentHeight);\n canvasContainer.remove()\n d3.select(`#${id}ChartContainer .svg-container-chart svg`)\n .attr(\"height\", null)\n .attr(\"width\", null)\n resolve(canvas.toDataURL())\n }\n const svg = \"data:image/svg+xml,\" + d3.select(`#${id}ChartContainer .svg-container-chart`).html().replace(/#/g, '%23')\n image.src = svg\n }\n catch (error) {\n reject(error)\n }\n })\n }", "function saveCanvas() {\n\tcanvas.isDrawingMode = false;\n\tdrawState = \"SELECT\";\n\tscd = JSON.stringify(canvas); // save canvas data\n\tconsole.log(scd);\n}", "function exportSvgClick(event) {\n // console.log('exportSvgClick');\n\n event.preventDefault();\n\n const filename = PageData.SavedImageTitle + '.svg';\n const svgXml = SvgModule.getSvgXml();\n\n Common.exportSvg(filename, svgXml);\n}", "function downloadPNG8x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 8});\n}", "serializeDrawing(writer, draw) {\n writer.writeStartElement(undefined, 'drawing', this.wNamespace);\n if (draw.hasOwnProperty('chartType')) {\n this.serializeInlineCharts(writer, draw);\n }\n else {\n this.serializeInlinePicture(writer, draw);\n }\n writer.writeEndElement();\n }", "function download_svg(doc_element_id,filename){\n var svg = document.getElementById(doc_element_id);\n var svgData = $(svg).find('svg')[0].outerHTML;\n var svgBlob = new Blob([svgData], {type:\"image/svg+xml;charset=utf-8\"});\n var svgUrl = URL.createObjectURL(svgBlob);\n var downloadLink = document.getElementById(\"svg-link\");\n downloadLink.href = svgUrl;\n downloadLink.download = filename+\".svg\";\n document.body.appendChild(downloadLink);\n downloadLink.click();\n}", "function BuildSvg()\n{\n //chomp up the user input into some vars\n var depth = 10; //the depth of recursion\n var min = 0; //the min constant value for macro expansion\n var max = 1500; //the max constant value for macro expansion\n var text = \"<rect x=\\\" T \\\" y=\\\" T \\\" width=\\\" T \\\" height=\\\" T \\\" fill=\\\" V \\\"/> X \\n;\"+\n\t\t\t \"<circle cx=\\\" T \\\" cy=\\\" T \\\" r=\\\" T \\\" fill=\\\" V \\\"/> X \\n;\"+\n\t\t\t \"<line x1=\\\" T \\\" y1=\\\" T \\\" x2=\\\" T \\\" y2=\\\" T \\\" stroke=\\\" V \\\" stroke-width=\\\" W \\\"/>\\n X ;\"+\n\t\t\t \"<ellipse cx=\\\" T \\\" cy=\\\" T \\\" rx=\\\" T \\\" ry=\\\" T \\\" fill=\\\" V \\\" stroke=\\\" V \\\" stroke-width=\\\" T \\\"/>\\n X ;\"+\n\t\t\t \"<path d=\\\"M T T L T T L T T z\\\" fill=\\\" V \\\" stroke=\\\" V \\\" \\\"/>\\n X ;\"+ //simple triangles\n\t\t\t \"<path d=\\\"M T T L T T L T T L T T z\\\" fill=\\\" V \\\" stroke=\\\" V \\\" \\\"/>\\n X ;\"+ //simple four point paths\n\t\t\t \"<path d=\\\"M T T Y Y z\\\" fill=\\\" V \\\" stroke=\\\" V \\\" \\\"/>\\n X ;\"+ //more complicated three point paths\n\t\t\t \"<path d=\\\"M T T Y Y Y z\\\" fill=\\\" V \\\" stroke=\\\" V \\\" \\\"/>\\n X ;\"+ //more complicated four point paths\n\t\t\t \"<path d=\\\"M T T Y Y Y Y z\\\" fill=\\\" V \\\" stroke=\\\" V \\\" \\\"/>\\n X ;\"+ //more complicated five point paths\n\t\t\t \"<path d=\\\"M T T Y Y Y Y Y z\\\" fill=\\\" V \\\" stroke=\\\" V \\\" \\\"/>\\n X ;\"+ //more complicated six point paths\n\t\t\t \" X \";\n\n\tvar outstring = \"<svg fill=\\\"black\\\" width=\\\"1000\\\" height=\\\"800\\\">\\n\"+ //open svg tag\n\t\t\t\t\t\" X \\n\"+ //macro expansion seed\n\t\t\t\t\t\"</svg>\"; //svg close tag\n var splitbysemi = text.split(';'); //split the text string into an array of expressions for macro expansions\n outstring=buildExpr(outstring,splitbysemi,depth,min,max); //build the output string\n\n\tdiv = document.getElementById( 'outputexpressions' ); //get the appropriate div\n div.insertAdjacentHTML( 'beforeend', outstring ); //append the content to the page\n}", "function uploadEntitiesToVizFwk(){\n\n\t//reset to shorter names\n\tvar cur = nc__pars__viz__curEntIdx;\n\tvar stkidx = nc__pars__viz__stkIdx;\n\tvar off = nc__pars__viz__offset;\n\tvar period = nc__pars__viz__period;\n\tvar loopOrd = nc__pars__viz__loopOrd;\n\n\t//ES 2017-11-12 (b_01): do draw using jointjs (svg)\n\tvar tmpDrawViaJointJs = viz.__visPlatformType == VIZ_PLATFORM.VIZ__JOINTJS;\n\t//ES 2017-11-12 (b_01): do draw on canvas\n\tvar tmpDrawOnCanvas = viz.__visPlatformType == VIZ_PLATFORM.VIZ__CANVAS;\n\n\t//iterate over elementes in the drawing stack to compose array that will be pushed to framework\n\tvar tmpArr = [];\n\tfor( \n\t\tvar i = cur; \n\t\ti >= ((cur - off + 1) < 0 ? 0 : (cur - off + 1)); \n\t\ti--\n\t){\n\t\t//ES 2017-11-12 (b_01): if drawing using jointjs (svg)\n\t\tif( tmpDrawViaJointJs ) {\n\t\t\t//add object to array\n\t\t\ttmpArr.push(viz.__visualizerInstanceDbg._drawStack[loopOrd[stkidx]][i].obj);\n\t\t//ES 2017-11-12 (b_01): else, if drawing on canvas\n\t\t} else if( tmpDrawOnCanvas ) {\n\t\t\t//if depicting connections ('cons')\n\t\t\tif( loopOrd[stkidx] == \"cons\" ) {\n\t\t\t\t//execute function pointer\n\t\t\t\tviz.__visualizerInstanceDbg._drawStack[loopOrd[stkidx]][i]();\n\t\t\t//else, rendering canvas element\n\t\t\t} else {\n\t\t\t\t//get array of function pointers\n\t\t\t\tvar tmpFuncPtrArr = viz.__visualizerInstanceDbg._drawStack[loopOrd[stkidx]][i]._drawFuncPtrArr;\n\t\t\t\t//loop thru array of function pointers\n\t\t\t\tfor( var fpIdx = 0; fpIdx < tmpFuncPtrArr.length; fpIdx++ ) {\n\t\t\t\t\t//execute function pointer that is defined inside canvas element object\n\t\t\t\t\ttmpFuncPtrArr[fpIdx]();\n\t\t\t\t}\t//end loop thru array of function pointers\n\t\t\t}\t//end if depicting connections\n\t\t}\t//ES 2017-11-12 (b_01): end if drawing using jointjs (svg)\n\n\t}\t//end iterate over elements to compose array that is pushed to framework\n\n\t//update current index and value for progress bar\n\tnc__progressbar__cur += (nc__pars__viz__curEntIdx < off ? nc__pars__viz__curEntIdx : off);\n\tnc__pars__viz__curEntIdx -= off;\n\n\t//if we exhausted current category\n\tif( nc__pars__viz__curEntIdx <= 0 ){\n\n\t\t//if there is no another category to process\n\t\tif( stkidx >= (loopOrd.length - 1) ){\n\n\t\t\t//hide progress bar\n\t\t\tnc__progress__hide();\n\n\t\t\t//quit\n\t\t\treturn;\n\n\t\t}\t//end if there is no another category to process\n\n\t\t//switch to another category\n\t\tnc__pars__viz__stkIdx++;\n\t\tstkidx = nc__pars__viz__stkIdx;\n\t\tnc__pars__viz__curEntIdx = viz.__visualizerInstanceDbg._drawStack[loopOrd[stkidx]].length - 1;\n\n\t}\t//end if we exhausted current category\n\n\t//update progress bar with the new value\n\tnc__progress__update(\n\t\tparseInt(10000 * nc__progressbar__cur / nc__progressbar__max) / 100\n\t);\n\n\t//ES 2017-11-12 (b_01): if rendering using jointjs\n\tif( tmpDrawViaJointJs ) {\n\t\t//push array to jointJS\n\t\tviz.__visualizerInstanceDbg._graph.addCells(tmpArr);\n\t}\t//ES 2017-11-12 (b_01): end if rendering using jointjs\n\n\t//give back control to browser\n\tsetTimeout(\n\t\tfunction(){\n\t\t\t//ES 2017-12-11 (b_01): renamed function to avoid confusion, since this function\n\t\t\t//\tis used by other visualization frameworks (a.k.a. Canvas)\n\t\t\tuploadEntitiesToVizFwk()\n\t\t},\n\t\tperiod\n\t);\n\n}", "function exportDocToSVG(doc, destFolder, boundingBoxes, currentPathIndex, colorList) {\n\n var newDocName = doc.name.replace(/[.]/g, \"\"); // created to remove dot, that was causing SVG files read/write to fail\n var artboards = doc.artboards;\n var docFileName = doc.fullName;\n var currentSvgFileList = [];\n\n // creates an empty SVG file for each artboard, test for read/write before exporting path data, stores SVG file object in an array\n for (var j = 0; j < artboards.length; j++) {\n var currentArtboard = artboards[j];\n // sends docName with appended artboard name, with file extension dot removed, receives an SVG file object for artboard\n var currentSvgFile = getTargetFile(newDocName + \"_\" + currentArtboard.name, \".svg\", destFolder);\n currentSvgFileList.push(currentSvgFile);\n }\n\n // creates a duplicate temp SVG File to export artboards using cleaned-up document name\n var docSvgFile = new File(destFolder + \"//\" + newDocName + \".svg\");\n\n // export all artboards from temp SVG File object, then removes temp SVG file\n doc.exportFile(docSvgFile, ExportType.SVG, getOptions(colorList));\n docSvgFile.remove();\n\n // checks if the above temp SVG file is open and force closes it\n if (artboards.length > 0) {\n for (j = 0; j < app.documents.length; j++) {\n if (app.documents[j].fullName.fullName == docSvgFile.fullName) {\n app.documents[j].close(SaveOptions.DONOTSAVECHANGES);\n }\n }\n }\n return currentSvgFileList;\n}", "function printDiagram() {\n var svgWindow = window.open();\n if (!svgWindow) return; // failure to open a new Window\n var printSize = new go.Size(1700, 2960);\n var bnds = myDiagram.documentBounds;\n var svg = myDiagram.makeSvg({ scale: 1.0, position: new go.Point(0, 0), size: bnds });\n svgWindow.document.body.appendChild(svg);\n}", "function drawDiagrams() {\n //alert(document.body.innerHTML);\n var sequences = document.getElementsByClassName('language-sequence');\n //alert(sequences.length);\n for (var i = 0; i < sequences.length; i++) {\n var innerHtml = sequences[i].innerHTML;\n //alert(innerHtml);\n var statement = innerHtml.replace(/\\&gt\\;/mg, \">\")\n //alert(statement);\n var diagram = Diagram.parse(statement);\n sequences[i].innerHTML = '';\n diagram.drawSVG(\n sequences[i],\n {\n theme: 'simple'\n }\n );\n $('.language-sequence').parent().addClass(\"pre-language-sequence\")\n }\n\n var flows = document.getElementsByClassName('language-flow');\n //alert(flows.length);\n for (var i = 0; i < flows.length; i++) {\n var innerHtml = flows[i].innerHTML;\n //alert(innerHtml);\n var statement = innerHtml.replace(/\\&gt\\;/mg, \">\")\n //alert(statement);\n var diagram = flowchart.parse(statement);\n flows[i].innerHTML = '';\n diagram.drawSVG(\n flows[i]\n );\n }\n}", "function chart(selection, nodes_raw, edges_raw) {\n nodes = nodes_raw;\n edges = edges_raw;\n total_width = width + margin.left + margin.right;\n total_height = height + margin.top + margin.bottom; //////////////////////////////////////////////////////////////\n //////////////// Create the canvas containers ////////////////\n //////////////////////////////////////////////////////////////\n //Canvas for the hidden edge clicking on node fix\n\n canvas_hidden = selection.append('canvas').attr('id', 'canvas-hidden').style('display', 'none');\n ctx_hidden = canvas_hidden.node().getContext('2d');\n crispyCanvas(canvas_hidden, ctx_hidden, 1); //Canvas for the edges\n\n canvas_edges = selection.append('canvas').attr('id', 'canvas-edges');\n ctx_edges = canvas_edges.node().getContext('2d');\n crispyCanvas(canvas_edges, ctx_edges, sf); //Canvas for the nodes\n\n canvas_nodes = selection.append('canvas').attr('id', 'canvas-nodes');\n ctx_nodes = canvas_nodes.node().getContext('2d');\n crispyCanvas(canvas_nodes, ctx_nodes, sf); //Canvas for the hover effects - mostly for performance\n\n canvas_hover = selection.append('canvas').attr('id', 'canvas-hover');\n ctx_hover = canvas_hover.node().getContext('2d');\n crispyCanvas(canvas_hover, ctx_hover, sf); //////////////////////////////////////////////////////////////\n ////////////////// Create the SVG container //////////////////\n //////////////////////////////////////////////////////////////\n //SVG container for the things on top such as text\n\n svg = selection.append('svg').attr('width', total_width).attr('height', total_height); //Group that will not move when zooming and panning\n\n g_zoom = svg.append('g').attr('id', 'zoom-group').attr('transform', 'translate(' + (margin.left + width / 2) + ',' + (margin.top + height / 2) + ')'); //Create the rectangle that will capture the mouse events\n\n mouse_zoom_rect = g_zoom.append('rect').attr('id', 'zoom-rect').style('fill', 'none').style('pointer-events', 'all'); //Group for all visual elements\n\n g = svg.append('g').attr('id', 'visual-elements-group').attr('transform', 'translate(' + (margin.left + width / 2) + ',' + (margin.top + height / 2) + ')'); //Group for the rotating dotted circle\n\n node_hover_group = g.append('g').attr('id', 'node-hover-group').style('pointer-events', 'none'); //Create circle to show hovered node outer moving dotted line\n //Happens when another node is \"fixed\" after click\n\n node_hover = node_hover_group.append('circle').attr('class', 'node-hovered').style('fill', 'none').style('stroke-linecap', 'round').style('pointer-events', 'none').style('display', 'none'); //Group for the \"icon\" that appears on a node click\n\n node_modal_group = g.append('g').attr('id', 'node-modal-group').style('visibility', 'hidden') //For firefox to work\n .style('pointer-events', 'all').style('cursor', 'pointer').on('mouseover', function () {\n d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].stopPropagation();\n found_edge = null;\n mouseMoveActions(null, found_edge);\n }).on('click', function () {\n showModal(current_click);\n }); //Create an circle icon to show when you fix a node\n\n modal_icon_circle = node_modal_group.append('circle').attr('class', 'modal-circle').style('fill', 'black').style('stroke', 'white'); //The \"+\" sign inside the circle that shows when you fix a node\n\n modal_icon_cross = node_modal_group.append('path').attr('class', 'modal-cross').style('fill', 'white').style('stroke-width', 2.5).attr('d', d3__WEBPACK_IMPORTED_MODULE_6__[\"symbol\"]().size(64).type(d3__WEBPACK_IMPORTED_MODULE_6__[\"symbolCross\"])); //Needed to calculate the cross icon size for each node\n //Based on https://bl.ocks.org/mbostock/3dd515e692504c92ab65\n\n icon_default_size = modal_icon_cross.node().getBBox().width;\n node_modal_group.style('display', 'none').style('visibility', null); //////////////////////////////////////////////////////////////\n ////////////////////// Set-up simulations ////////////////////\n //////////////////////////////////////////////////////////////\n //Initialize the first force simulation\n //Which will set-up the primary structure of the nodes attached to edges of weight 3\n\n simulation_primary = d3__WEBPACK_IMPORTED_MODULE_6__[\"forceSimulation\"]().force('link', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceLink\"]().id(function (d) {\n return d.id;\n }).distance(function (d) {\n return edge_distance_scale(d.weight);\n }).strength(function (d) {\n return edge_strength_scale(d.weight);\n })).force('collide', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceCollide\"]().radius(function (d) {\n return d.r * 1.1 + d.stroke_width + padding;\n }).strength(0)).force('charge', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceManyBody\"]().strength(function (d) {\n return d.type === 'element' ? -10 : node_charge_degree_scale(d.degree);\n }).distanceMax(base_width / 3)).force('x', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceX\"]().x(function (d) {\n return d.focusX;\n }).strength(0.08)) //0.1\n .force('y', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceY\"]().y(function (d) {\n return d.focusY;\n }).strength(0.08)); //0.1\n // .force(\"center\", d3.forceCenter(0,0))\n //Set up the second force simulation\n //That will place the other nodes (the ones used in the primary will now be fixed)\n\n simulation_secondary = d3__WEBPACK_IMPORTED_MODULE_6__[\"forceSimulation\"]() // .alphaMin(0.015)\n // .velocityDecay(0.9)\n .force('link', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceLink\"]().id(function (d) {\n return d.id;\n }).distance(function (d) {\n return edge_distance_scale(d.weight);\n }).strength(function (d) {\n return edge_strength_scale(d.weight);\n })) // .force(\"collide\",\n // d3.forceCollide().radius(d => d.r * 1.1 + d.stroke_width + padding).strength(0).iterations(2)\n // )\n .force('charge', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceManyBody\"]().strength(function (d) {\n return node_charge_scale(d.type);\n }).distanceMax(base_width / 3)).force('r', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceRadial\"](radius_secondary).strength(0.2)); //////////////////////////////////////////////////////////////\n ////////////////////// Set-up the voronoi ////////////////////\n //////////////////////////////////////////////////////////////\n //Initialize the voronoi for the mouseover events\n\n voronoi = d3__WEBPACK_IMPORTED_MODULE_6__[\"voronoi\"]().x(function (d) {\n return d.x;\n }).y(function (d) {\n return d.y;\n }); //////////////////////////////////////////////////////////////\n //////////////////// Set-up zoom processes ///////////////////\n //////////////////////////////////////////////////////////////\n\n zoom = d3__WEBPACK_IMPORTED_MODULE_6__[\"zoom\"]().scaleExtent([min_zoom, max_zoom]).interpolate(function (a, b) {\n zoom_duration = Math.max(1000, d3__WEBPACK_IMPORTED_MODULE_6__[\"interpolateZoom\"](a, b).duration); //Sets a suggested duration for the zoom\n\n return d3__WEBPACK_IMPORTED_MODULE_6__[\"interpolateArray\"](a, b);\n }) //Make the zoom in faster\n // .wheelDelta(() => -(d3.event.deltaY*3) * (d3.event.deltaMode ? 120 : 1) / 500 )\n .on('zoom', zoomChart).on('end', zoomChartEnd); //Set the initial zoom scale\n\n initial_transform = d3__WEBPACK_IMPORTED_MODULE_6__[\"zoomIdentity\"].translate(0, 0).scale(start_zoom); //Set-up an invisible rectangle across the entire canvas that captures\n //the mouse events (zoom and hover)\n\n mouse_zoom_rect.attr('x', -total_width / 2).attr('y', -total_height / 2).attr('width', total_width).attr('height', total_height);\n } //function chart", "function chart(selection, nodes_raw, edges_raw) {\n nodes = nodes_raw;\n edges = edges_raw;\n total_width = width + margin.left + margin.right;\n total_height = height + margin.top + margin.bottom; //////////////////////////////////////////////////////////////\n //////////////// Create the canvas containers ////////////////\n //////////////////////////////////////////////////////////////\n //Canvas for the hidden edge clicking on node fix\n\n canvas_hidden = selection.append('canvas').attr('id', 'canvas-hidden').style('display', 'none');\n ctx_hidden = canvas_hidden.node().getContext('2d');\n crispyCanvas(canvas_hidden, ctx_hidden, 1); //Canvas for the edges\n\n canvas_edges = selection.append('canvas').attr('id', 'canvas-edges');\n ctx_edges = canvas_edges.node().getContext('2d');\n crispyCanvas(canvas_edges, ctx_edges, sf); //Canvas for the nodes\n\n canvas_nodes = selection.append('canvas').attr('id', 'canvas-nodes');\n ctx_nodes = canvas_nodes.node().getContext('2d');\n crispyCanvas(canvas_nodes, ctx_nodes, sf); //Canvas for the hover effects - mostly for performance\n\n canvas_hover = selection.append('canvas').attr('id', 'canvas-hover');\n ctx_hover = canvas_hover.node().getContext('2d');\n crispyCanvas(canvas_hover, ctx_hover, sf); //////////////////////////////////////////////////////////////\n ////////////////// Create the SVG container //////////////////\n //////////////////////////////////////////////////////////////\n //SVG container for the things on top such as text\n\n svg = selection.append('svg').attr('width', total_width).attr('height', total_height); //Group that will not move when zooming and panning\n\n g_zoom = svg.append('g').attr('id', 'zoom-group').attr('transform', 'translate(' + (margin.left + width / 2) + ',' + (margin.top + height / 2) + ')'); //Create the rectangle that will capture the mouse events\n\n mouse_zoom_rect = g_zoom.append('rect').attr('id', 'zoom-rect').style('fill', 'none').style('pointer-events', 'all'); //Group for all _visual elements\n\n g = svg.append('g').attr('id', '_visual-elements-group').attr('transform', 'translate(' + (margin.left + width / 2) + ',' + (margin.top + height / 2) + ')'); //Group for the rotating dotted circle\n\n node_hover_group = g.append('g').attr('id', 'node-hover-group').style('pointer-events', 'none'); //Create circle to show hovered node outer moving dotted line\n //Happens when another node is \"fixed\" after click\n\n node_hover = node_hover_group.append('circle').attr('class', 'node-hovered').style('fill', 'none').style('stroke-linecap', 'round').style('pointer-events', 'none').style('display', 'none'); //Group for the \"icon\" that appears on a node click\n\n node_modal_group = g.append('g').attr('id', 'node-modal-group').style('visibility', 'hidden').style('pointer-events', 'all').style('cursor', 'pointer').on('mouseover', function () {\n d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].stopPropagation();\n found_edge = null;\n mouseMoveActions(null, found_edge);\n }).on('click', function () {\n showModal(current_click);\n }); //Create an circle icon to show when you fix a node\n\n modal_icon_circle = node_modal_group.append('circle').attr('class', 'modal-circle').style('fill', 'black').style('stroke', 'white'); //The \"+\" sign inside the circle that shows when you fix a node\n\n modal_icon_cross = node_modal_group.append('path').attr('class', 'modal-cross').style('fill', 'white').style('stroke-width', 2.5).attr('d', d3__WEBPACK_IMPORTED_MODULE_6__[\"symbol\"]().size(64).type(d3__WEBPACK_IMPORTED_MODULE_6__[\"symbolCross\"])); //Needed to calculate the cross icon size for each node\n //Based on https://bl.ocks.org/mbostock/3dd515e692504c92ab65\n\n icon_default_size = modal_icon_cross.node().getBBox().width;\n node_modal_group.style('display', 'none').style('visibility', null); //////////////////////////////////////////////////////////////\n ////////////////////// Set-up simulations ////////////////////\n //////////////////////////////////////////////////////////////\n //Initialize the first force simulation\n //Which will set-up the primary structure of the nodes attached to edges of weight 3\n\n simulation_primary = d3__WEBPACK_IMPORTED_MODULE_6__[\"forceSimulation\"]().force('link', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceLink\"]().id(function (d) {\n return d.id;\n }).distance(function (d) {\n return edge_distance_scale(d.weight);\n }).strength(function (d) {\n return edge_strength_scale(d.weight);\n })).force('collide', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceCollide\"]().radius(function (d) {\n return d.r * 1.1 + d.stroke_width + padding;\n }).strength(0)).force('charge', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceManyBody\"]().strength(function (d) {\n return d.type === 'element' ? -10 : -40;\n }).distanceMax(base_width / 2)).force('x', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceX\"]().x(function (d) {\n return d.focusX;\n }).strength(0.2)) //0.1\n .force('y', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceY\"]().y(function (d) {\n return d.focusY;\n }).strength(0.2)); //0.1\n // .force(\"center\", d3.forceCenter(0,0))\n //Set up the second force simulation\n //That will place the other nodes (the ones used in the primary will now be fixed)\n\n simulation_secondary = d3__WEBPACK_IMPORTED_MODULE_6__[\"forceSimulation\"]() // .alphaMin(0.015)\n .force('link', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceLink\"]().id(function (d) {\n return d.id;\n }).distance(function (d) {\n return testTypeId(d, 'whc') ? 10 : edge_distance_secondary_scale(d.weight);\n }).strength(function (d) {\n return testTypeId(d, 'whc') ? 1 : edge_strength_secondary_scale(d.weight);\n })) // .force(\"collide\", d3.forceCollide().radius(d => d.r * 1.1 + d.stroke_width + padding).strength(0).iterations(2))\n .force('charge', d3__WEBPACK_IMPORTED_MODULE_6__[\"forceManyBody\"]().strength(function (d) {\n return node_charge_scale(d.type);\n }).distanceMax(base_width / 2)); // .force(\"r\", d3.forceRadial(radius_secondary).strength(d => d.type === \"whc\" ? 0 : 0.05))\n //////////////////////////////////////////////////////////////\n ////////////////////// Set-up the voronoi ////////////////////\n //////////////////////////////////////////////////////////////\n //Initialize the voronoi for the mouseover events\n\n voronoi = d3__WEBPACK_IMPORTED_MODULE_6__[\"voronoi\"]().x(function (d) {\n return d.x;\n }).y(function (d) {\n return d.y;\n }); //////////////////////////////////////////////////////////////\n //////////////////// Set-up zoom processes ///////////////////\n //////////////////////////////////////////////////////////////\n\n zoom = d3__WEBPACK_IMPORTED_MODULE_6__[\"zoom\"]().scaleExtent([min_zoom, max_zoom]).interpolate(function (a, b) {\n zoom_duration = Math.max(1000, d3__WEBPACK_IMPORTED_MODULE_6__[\"interpolateZoom\"](a, b).duration); //Sets a suggested duration for the zoom\n\n return d3__WEBPACK_IMPORTED_MODULE_6__[\"interpolateArray\"](a, b);\n }).on('zoom', zoomChart).on('end', zoomChartEnd); //Set the initial zoom scale\n\n initial_transform = d3__WEBPACK_IMPORTED_MODULE_6__[\"zoomIdentity\"].translate(0, 0).scale(start_zoom); //Set-up an invisible rectangle across the entire canvas that captures\n //the mouse events (zoom and hover)\n\n mouse_zoom_rect.attr('x', -total_width / 2).attr('y', -total_height / 2).attr('width', total_width).attr('height', total_height);\n } //function chart", "function portfolioSVG() {\n return src(input)\n .pipe(svgSprite(config))\n .pipe(dest(output))\n}", "_createSVG() {\n\t\t\treturn d3.select(this._container)\n\t\t\t\t.append('svg');\n\t\t}", "function drawShape(x1, y1, x2, y2) { \n var left = Math.min(x1, x2); \n var top = Math.min(y1, y2); \n var right = Math.max(x1, x2); \n var bottom = Math.max(y1, y2); \n var settings = {fill: $('#fill').val(), stroke: $('#stroke').val(), \n strokeWidth: $('#swidth').val()}; \n var shape = $('#shape').val(); \n var node = null; \n\n\n var scale = ((right - left)/95);\n var $scope = angular.element('#content').scope();\n var mayugeColor = $('select[name=\"colorpicker4mayuge\"]').val();\n var rinkakuColor = $('select[name=\"colorpicker4rinkaku\"]').val();\n var rinkakuWidth = $('select[name=\"rinkakuWidth\"]').val();\n if ($scope.conf.optionsLR == \"r\") {\n node = svgWrapper.group({class_: \"draggable\", transform: \"translate(\" + right + \",\" + bottom + \")\"});\n svgWrapper.use(node, \"#path-r-mayuge-\" + $scope.conf.mayugeType, {fill: mayugeColor, transform: \"scale(\" + scale + \")\", stroke: rinkakuColor, strokeWidth: rinkakuWidth});\n } else {\n node = svgWrapper.group({class_: \"draggable\", transform: \"translate(\" + (right - (right - left)) + \",\" + bottom + \")\"});\n svgWrapper.use(node, \"#path-r-mayuge-\" + $scope.conf.mayugeType, {fill: mayugeColor, transform: \"scale(-\" + scale + \",\" + scale + \")\", stroke: rinkakuColor, strokeWidth: rinkakuWidth});\n }\n\n\n var makeSVGElementDraggable = svgDrag.setupCanvasForDragging();\n makeSVGElementDraggable(node);\n // node.addEventListener(\"mouseup\", $scope.export2canvas);\n node.addEventListener(\"dblclick\", function() {$scope.removeMayuge($(node));});\n $scope.export2canvas();\n // if ($scope.conf.autoSave) {\n // $scope.savePNG();\n // }\n\n\n drawNodes[drawNodes.length] = node; \n // $(node).mousedown(startDrag).mousemove(dragging).mouseup(endDrag); \n $('#svgArea').focus(); \n}", "function exportImage(type) {\n\t\t\t\tvar canvas = document.createElement(\"canvas\");\n\t\t\t\tvar ctx = canvas.getContext('2d');\n\t\n\t\t\t\t// TODO: if (options.keepOutsideViewport), do some translation magic?\n\t\n\t\t\t\tvar svg_img = new Image();\n\t\t\t\tvar svg_xml = _svg.outerHTML;\n\t\t\t\tsvg_img.src = base64dataURLencode(svg_xml);\n\t\n\t\t\t\tsvg_img.onload = function () {\n\t\t\t\t\tdebug(\"exported image size: \" + [svg_img.width, svg_img.height]);\n\t\t\t\t\tcanvas.width = svg_img.width;\n\t\t\t\t\tcanvas.height = svg_img.height;\n\t\t\t\t\tctx.drawImage(svg_img, 0, 0);\n\t\n\t\t\t\t\t// SECURITY_ERR WILL HAPPEN NOW\n\t\t\t\t\tvar image_dataurl = canvas.toDataURL(type);\n\t\t\t\t\tdebug(type + \" length: \" + image_dataurl.length);\n\t\n\t\t\t\t\tif (options.callback) options.callback(image_dataurl);else debug(\"WARNING: no callback set, so nothing happens.\");\n\t\t\t\t};\n\t\n\t\t\t\tsvg_img.onerror = function () {\n\t\t\t\t\tdebug(\"Can't export! Maybe your browser doesn't support \" + \"SVG in img element or SVG input for Canvas drawImage?\\n\" + \"http://en.wikipedia.org/wiki/SVG#Native_support\");\n\t\t\t\t};\n\t\n\t\t\t\t// NOTE: will not return anything\n\t\t\t}", "function fromCanvasToSvg(sourceCanvas, targetSVG, x, y, width, height) {\n var imageData = sourceCanvas.getContext('2d').getImageData(\n x, y, width, height);\n var newCanvas = document.createElement(\"canvas\");\n var imgDataurl;\n newCanvas.width = width; newCanvas.height = height;\n newCanvas.getContext(\"2d\").putImageData(imageData, 0, 0);\n imgDataurl = newCanvas.toDataURL(\"image/png\");\n targetSVG.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", imgDataurl);\n }", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "function initDiagram(diagram) {\n svgDiagrams = {\n \"1\": '<svg class=\"level-1\" width=\"28\" height=\"26\" viewBox=\"0 0 28 26\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M27 12.1802C27 4.90097 20.9766 -1.18524 14.0074 0.916454C12.5764 1.34799 11.1652 1.85135 9.77924 2.42542C8.3933 2.9995 7.03951 3.64144 5.7225 4.34816C-0.691594 7.79002 -0.647187 16.3528 4.5 21.5V21.5C12.8031 29.8031 27 23.9225 27 12.1802V12.1802Z\"fill=\"#2F80ED\" /></svg>',\n \"2\": '<svg class=\"level-2\" width=\"56\" height=\"61\" viewBox=\"0 0 56 61\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M56 19C56 7.9543 46.9382 -1.22134 36.1641 1.21312C31.1843 2.33832 26.2976 3.88785 21.5585 5.85084C16.8194 7.81383 12.2683 10.1736 7.9514 12.8992C-1.38844 18.7962 -1.30796 31.692 6.50252 39.5025L21.8579 54.8579C34.4572 67.4572 56 58.5338 56 40.7157L56 19Z\"fill=\"#2F80ED\" /></svg>',\n \"3\": '<svg class=\"level-3\" width=\"88\" height=\"106\" viewBox=\"0 0 88 106\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M88 19C88 7.9543 78.9976 -1.15165 68.0729 0.47879C57.1998 2.10154 46.5406 5.0501 36.3377 9.27626C26.1349 13.5024 16.5128 18.9547 7.6768 25.4957C-1.20103 32.0677 -1.12777 44.8722 6.68271 52.6827L53.8579 99.8579C66.4572 112.457 88 103.534 88 85.7157L88 19Z\" fill=\"#2F80ED\"/></svg>',\n \"4\": '<svg class=\"level-4\" width=\"119\" height=\"152\" viewBox=\"0 0 119 152\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M119 20C119 8.9543 110.019 -0.114818 99.041 1.10997C82.2551 2.98281 65.7826 7.21276 50.117 13.7017C34.4513 20.1906 19.8125 28.8474 6.6188 39.3925C-2.00958 46.2888 -1.94758 59.0524 5.86291 66.8629L84.8579 145.858C97.4572 158.457 119 149.534 119 131.716L119 20Z\"fill=\"#ED9CEF\" /></svg>',\n \"5\": '<svg class=\"level-5\" width=\"151\" height=\"197\" viewBox=\"0 0 151 197\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M151 20C151 8.9543 142.028 -0.092252 131.026 0.888307C108.325 2.91152 86.0237 8.37581 64.8962 17.1271C43.7687 25.8784 24.1354 37.7841 6.65276 52.4054C-1.82025 59.4917 -1.76739 72.2326 6.0431 80.0431L116.858 190.858C129.457 203.457 151 194.534 151 176.716L151 20Z\" fill=\"#B592FF\"/></svg>',\n \"6\": '<svg class=\"level-6\" width=\"183\" height=\"242\" viewBox=\"0 0 183 242\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M183 20C183 8.95431 174.034 -0.0770592 163.018 0.740395C134.402 2.86397 106.264 9.53909 79.6755 20.5525C53.0867 31.566 28.4699 46.7427 6.734 65.4754C-1.63309 72.6865 -1.58719 85.4128 6.22329 93.2233L148.858 235.858C161.457 248.457 183 239.534 183 221.716L183 20Z\" fill=\"#6FCF97\"/></svg>',\n \"7\": '<svg class=\"level-7\" width=\"216\" height=\"287\" viewBox=\"0 0 216 287\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M215 20C215 8.9543 206.037 -0.066141 195.013 0.634703C160.484 2.83001 126.504 10.7025 94.4547 23.978C62.4051 37.2534 32.8114 55.7136 6.84295 78.5774C-1.44737 85.8766 -1.407 98.593 6.40349 106.404L180.858 280.858C193.457 293.457 215 284.534 215 266.716L215 20Z\" fill=\"#7297FF\" /></svg>',\n \"8\": '<svg class=\"level-8\" width=\"248\" height=\"332\" viewBox=\"0 0 248 332\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M247 20C247 8.95431 238.039 -0.0579224 227.01 0.555413C186.567 2.80455 146.744 11.8661 109.234 27.4034C71.7237 42.9406 37.1571 64.6922 6.9694 91.6992C-1.26273 99.0639 -1.22681 111.773 6.58368 119.584L212.858 325.858C225.457 338.457 247 329.534 247 311.716L247 20Z\"fill=\"#FF856A\" /></svg>',\n \"9\": '<svg class=\"level-9\" width=\"280\" height=\"377\" viewBox=\"0 0 280 377\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M279 20C279 8.95429 270.04 -0.0515232 259.008 0.493714C212.653 2.7847 166.984 13.0297 124.013 30.8288C81.0425 48.6279 41.5056 73.6761 7.10733 104.834C-1.07917 112.25 -1.04662 124.953 6.76387 132.764L244.858 370.858C257.457 383.457 279 374.534 279 356.716L279 20Z\" fill=\"#60C6FF\" /></svg>',\n \"10\": '<svg class=\"level-10\" width=\"310\" height=\"422\" viewBox=\"0 0 310 422\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M309.996 20C309.996 8.9543 301.037 -0.0463853 290.002 0.444371C237.735 2.76889 186.219 14.1935 137.789 34.2542C89.3576 54.315 44.8524 82.6634 6.25003 117.978C-1.89976 125.434 -1.87033 138.134 5.94016 145.944L275.854 415.858C288.453 428.457 309.996 419.534 309.996 401.716L309.996 20Z\" fill=\"#FFCF65\" /></svg>',\n }\n\n const setHeight = (diagram) => {\n diagram.style.height = diagram.clientWidth + 'px';\n }\n const getArrayFromValues = (string) => {\n return string.split(',');\n }\n const setItems = (values, wrapper, svgDiagrams) => {\n values.forEach(value => {\n wrapper.insertAdjacentHTML('beforeend', svgDiagrams[value])\n })\n }\n const createTooltip = (wrapper) => {\n let tooltip = document.createElement('div');\n let colorbox = document.createElement('div');\n let text = document.createElement('div');\n \n tooltip.className = 'diagram__tooltip';\n colorbox.className = 'diagram__tooltip-color';\n text.className = 'diagram__tooltip-text';\n \n tooltip.append(colorbox);\n tooltip.append(text);\n \n return tooltip;\n }\n const setPositionTooltip = (tooltip, x, y) => {\n tooltip.style.opacity = 1;\n tooltip.style.left = x + '%';\n tooltip.style.top = y + '%';\n }\n const createTooltipPositionValues = (items, wrapper) => {\n let values = {};\n const setValues = () => {\n items.forEach((item, index) => {\n if (item.tagName === 'svg') {\n let path = item.children[0];\n let x;\n let y;\n switch (index) {\n case 0:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 1.75);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 3);\n \n values[index] = { x, y };\n break;\n case 1:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 1.65);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 2.5);\n \n values[index] = { x, y };\n break;\n case 2:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 1.5);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 2);\n \n values[index] = { x, y };\n break;\n case 3:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 1.75);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 1.65);\n \n values[index] = { x, y };\n break;\n case 4:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 2.75);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 1.75);\n \n values[index] = { x, y };\n break;\n case 5:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 2.75);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 2);\n \n values[index] = { x, y };\n break;\n case 6:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 2.5);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 2.75);\n \n values[index] = { x, y };\n break;\n case 7:\n \n x = (path.getBoundingClientRect().left - wrapper.getBoundingClientRect().left) + (path.getBoundingClientRect().width / 2);\n y = (path.getBoundingClientRect().top - wrapper.getBoundingClientRect().top) + (path.getBoundingClientRect().height / 2.5);\n \n values[index] = { x, y };\n break;\n }\n }\n \n })\n }\n \n setValues();\n return {\n values,\n update: setValues,\n }\n }\n const setColors = (colors, items) => {\n items.forEach((item, index) => {\n if (item.tagName === 'svg') {\n let path = item.children[0];\n path.setAttribute('fill', colors[index]);\n }\n })\n }\n const sevValueTooltip = (tooltip, color, text, value) => {\n let colorBox = tooltip.children[0];\n let textBox = tooltip.children[1];\n colorBox.style.background = color;\n textBox.innerText = `${text} - ${value}`;\n }\n \n\n let values = getArrayFromValues(diagram.dataset.diagramValues);\n let tooltip = createTooltip();\n let colors = diagram.dataset.diagramColors.split(',');\n let tooltipText = diagram.dataset.diagramText.split(',');\n\n if(diagram.classList.contains('reverse')) {\n values = values.reverse();\n colors = colors.reverse();\n tooltipText = tooltipText.reverse();\n }\n\n setHeight(diagram);\n\n setItems(values, diagram, svgDiagrams);\n\n diagram.append(tooltip);\n\n\n let children = Array.from(diagram.children);\n setColors(colors, children);\n\n let tooltipPositionValues = createTooltipPositionValues(children, diagram);\n\n children.forEach((item, index) => {\n if (item.tagName === 'svg') {\n item.addEventListener('mouseenter', () => {\n let x = (tooltipPositionValues.values[index].x / diagram.clientWidth) * 100;\n let y = tooltipPositionValues.values[index].y / diagram.clientWidth * 100;\n setPositionTooltip(tooltip, x, y);\n sevValueTooltip(tooltip, colors[index], tooltipText[index], values[index]);\n })\n }\n })\n\n window.addEventListener('resize', () => setHeight(diagram));\n window.addEventListener('resize', tooltipPositionValues.update);\n\n\n return {\n showItemInfo: (index) => {\n let x = (tooltipPositionValues.values[index].x / diagram.clientWidth) * 100;\n let y = tooltipPositionValues.values[index].y / diagram.clientWidth * 100;\n setPositionTooltip(tooltip, x, y);\n sevValueTooltip(tooltip, colors[index], tooltipText[index], values[index]);\n },\n\n getItemValue: (index) => {\n return values[index];\n },\n getItemText: (index) => {\n return tooltipText[index];\n },\n getColors: () => {\n return colors;\n }\n }\n }", "function drawAllPaths() {\n var\n //strokeStyle = '#000',\n startCursor = { x: 0, y: 0 },\n lastCursor = { x: 0, y: 0 },\n cursor = { x: 0, y: 0 },\n path,\n i;\n\n for ( i = 0; i < paths.length; i++) {\n path = paths[ i ];\n\n if ( path.attrs.hasOwnProperty( 'd' ) && path.attrs.d ) {\n path.style.pathIdx = i;\n\n // used for debugging style parser\n //path.style.pathId = path.attrs.hasOwnProperty( 'id' ) ? path.attrs.id : 'noid';\n\n processTokens( splitTokens ( path.attrs.d ), path.style );\n //ctx.stroke();\n }\n }\n\n // Tidy whitespace in path.d attribute\n\n function splitTokens( pathStr ) {\n var\n specialChars = [ 'm', 'M', 'z', 'Z', 'h', 'H', 'v', 'V', 'l', 'L' ],\n tokens,\n j;\n\n // replace tabs and newlines with spaces\n pathStr = pathStr.replace( new RegExp( \"\\t\", 'g' ), ' ' ); // eslint-disable-line no-control-regex\n pathStr = pathStr.replace( new RegExp( \"\\n\", 'g' ), ' ' ); // eslint-disable-line no-control-regex\n pathStr = pathStr.replace( new RegExp( \"\\r\", 'g' ), ' ' ); // eslint-disable-line no-control-regex\n\n for ( j = 0; j < specialChars.length; j++ ) {\n // add space before special chars\n pathStr = pathStr.replace( new RegExp( specialChars[j], 'g' ), specialChars[j] + ' ' );\n // remove double space after special chars\n pathStr = pathStr.replace( new RegExp( specialChars[j] + ' ', 'g' ), specialChars[j] + ' ' );\n pathStr = pathStr.replace( new RegExp( specialChars[j] + ' ', 'g' ), specialChars[j] + ' ' );\n }\n\n tokens = pathStr.split( ' ' );\n\n tokens = tokens.filter( function tokenNotEmpty( token ) {\n return ( '' !== token );\n } );\n\n return tokens;\n }\n\n // Follow sequence of drawing operations defined in path.d attribute\n // see: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths\n\n function processTokens( tokens, style ) {\n var\n drawOps = [],\n pathOpts = getPathOptions( style || {} ),\n absMode = true,\n currToken, nextToken,\n cnvSpace,\n temp,\n j;\n\n for ( j = 0; j < tokens.length; j++ ) {\n\n // get the current and next token, if any\n currToken = tokens[ j ];\n nextToken = ( j < ( tokens.length - 1 ) ) ? tokens[ j + 1 ] : '';\n\n // store cursor start position (of next line segment)\n lastCursor.x = cursor.x;\n lastCursor.y = cursor.y;\n\n switch( currToken ) {\n case 'm':\n absMode = false;\n temp = strToPoint( nextToken );\n\n cursor.x = 0;\n cursor.y = 0;\n\n cursor.x = cursor.x + temp.x;\n cursor.y = cursor.y + temp.y;\n startCursor.x = cursor.x;\n startCursor.y = cursor.y;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'moveTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'M':\n absMode = true;\n cursor = strToPoint( nextToken );\n startCursor.x = cursor.x;\n startCursor.y = cursor.y;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'moveTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'v':\n absMode = false;\n // vertical line on canvas, convert absolute to relative offset\n temp = parseFloat( nextToken ); // dY\n cursor.y = cursor.y + temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'V':\n absMode = true;\n // vertical line on canvas to absolute Y position\n temp = parseFloat( nextToken ); // abs Y\n\n cursor.y = temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'h':\n absMode = false;\n // horizontal draw on canvas to relative X position\n temp = parseFloat( nextToken ); // dX\n cursor.x = cursor.x + temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'H':\n absMode = true;\n // horizontal draw on canvas to absolute X position\n temp = parseFloat( nextToken ); // abs X\n cursor.x = temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'l':\n absMode = false;\n // lineTo on canvas to relative X,Y position\n temp = strToPoint( nextToken ); // dX,dY\n cursor.x = cursor.x + temp.x;\n cursor.y = cursor.y + temp.y;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n\n //objPage.lineTo( cnvSpace.x, ( objPage.height() - cnvSpace.y ) );\n //objPage.moveTo( cnvSpace.x, ( objPage.height() - cnvSpace.y ) );\n\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'L':\n absMode = true;\n // lineTo on canvas to absolute X,Y position\n temp = strToPoint( nextToken ); // abs X,Y\n cursor.x = temp.x;\n cursor.y = temp.y;\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n //objPage.lineTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n //objPage.moveTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n absMode = true;\n j = j + 1; // has one argument\n break;\n\n case 'z':\n case 'Z':\n // close the path\n cnvSpace = applyTransforms( startCursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n // draw the path\n if ( drawOps.length > 0 ) { traceOnCanvas( pathOpts, drawOps ); }\n drawOps = [];\n break;\n\n default:\n if ( -1 !== currToken.indexOf( ',' ) ) {\n\n // assume continuation of l or L, implicit next point on line\n temp = strToPoint( currToken );\n\n if ( absMode ) {\n cursor.x = temp.x; // follows L or M\n cursor.y = temp.y;\n } else {\n cursor.x = cursor.x + temp.x; // follows l or m\n cursor.y = cursor.y + temp.y;\n }\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n //ctx.lineTo( cnvSpace.x, cnvSpace.y );\n //objPage.lineTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n //objPage.moveTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n } else {\n Y.log( 'Unhandled SVG path token: ' + currToken + ' in ' + JSON.stringify( tokens ), 'warn', NAME );\n }\n\n break;\n\n }\n }\n\n // finalize any outstanding path (may be missing terminator)\n if ( drawOps.length > 0 ) { traceOnCanvas( pathOpts, drawOps ); }\n }\n\n function traceOnCanvas( pathOpts, drawOps ) {\n // SVG clipping path, nothing to draw\n if ( false === pathOpts.useFill && false === pathOpts.useStroke ) { return false; }\n let i;\n\n hpdf.page_SetLineWidth( pageHandle, pathOpts.strokeWidth );\n hpdf.page_SetRGBStroke( pageHandle, pathOpts.strokeColor[0], pathOpts.strokeColor[1], pathOpts.strokeColor[2] );\n hpdf.page_SetRGBFill( pageHandle, pathOpts.fillColor[0], pathOpts.fillColor[1], pathOpts.fillColor[2] );\n\n for ( i = 0; i < drawOps.length; i++ ) {\n switch( drawOps[i].op ) {\n case 'moveTo': hpdf.page_MoveTo( pageHandle, drawOps[i].x, drawOps[i].y ); break;\n case 'lineTo': hpdf.page_LineTo( pageHandle, drawOps[i].x, drawOps[i].y ); break;\n }\n }\n\n if ( pathOpts.useFill && pathOpts.useStroke ) {\n hpdf.page_FillStroke( pageHandle );\n return;\n }\n if ( pathOpts.useFill ) {\n hpdf.page_Fill( pageHandle );\n return;\n }\n if ( pathOpts.useStroke ) {\n hpdf.page_Stroke( pageHandle );\n }\n }\n\n }", "getSVGPath(scaling = 'scale', infiniteCheck = true, forDrawing = false, forDrawingButInvisible = false) {\n let path = '';\n path = this.segments\n .map((seg) => seg.getSVGPath(scaling, false, infiniteCheck))\n .join('\\n');\n if (forDrawingButInvisible) {\n if (this.vertexes[1] && this.segments[0].isArc()) {\n let arcCenterCoordinates = this.segments[0].arcCenter.coordinates;\n let firstVertex = this.vertexes[0].coordinates;\n let secondVertex = this.vertexes[1].coordinates;\n if (scaling == 'scale') {\n arcCenterCoordinates = arcCenterCoordinates.toCanvasCoordinates();\n firstVertex = firstVertex.toCanvasCoordinates();\n secondVertex = secondVertex.toCanvasCoordinates();\n }\n path += ['M', arcCenterCoordinates.x, arcCenterCoordinates.y, 'L', firstVertex.x, firstVertex.y, 'L', secondVertex.x, secondVertex.y, 'L', arcCenterCoordinates.x, arcCenterCoordinates.y].join(' ');\n }\n }\n if (forDrawing) {\n let seg = this.segments[0];\n let arrowEndCoordinates = seg.vertexes[1].coordinates;\n let arrowAngle = seg.getAngleWithHorizontal() + Math.PI;\n if (seg.isArc()) {\n let originVector = this.segments[0].getArcTangent(1);\n arrowAngle = Math.atan2(originVector.y, originVector.x) + Math.PI;\n }\n let firstTriangleCoord = arrowEndCoordinates.add(new Coordinates({\n x: 20 * Math.cos(arrowAngle + 0.35),\n y: 20 * Math.sin(arrowAngle + 0.35),\n }));\n let secondTriangleCoord = arrowEndCoordinates.add(new Coordinates({\n x: 20 * Math.cos(arrowAngle - 0.35),\n y: 20 * Math.sin(arrowAngle - 0.35),\n }));\n if (scaling == 'scale') {\n arrowEndCoordinates = arrowEndCoordinates.toCanvasCoordinates();\n firstTriangleCoord = firstTriangleCoord.toCanvasCoordinates();\n secondTriangleCoord = secondTriangleCoord.toCanvasCoordinates();\n }\n path += ` M ${arrowEndCoordinates.x} ${arrowEndCoordinates.y} L ${firstTriangleCoord.x} ${firstTriangleCoord.y} M ${arrowEndCoordinates.x} ${arrowEndCoordinates.y} L ${secondTriangleCoord.x} ${secondTriangleCoord.y}`;\n }\n return path;\n }", "function drawDiagramOnCanvas(xmlResult)\n {\n\n var test = xmlResult;\n test = test.replace(/&quot;/g, '\"');\n test = test.split(',');\n\n var jsonobj = eval(\"(\" + test + \")\");\n\n // get length of elements array\n var numberOfElements = jsonobj.xmlSection[0].chevrons[0].element.length;\n\n //draw elements \n for (var i = 0; i < numberOfElements; i++)\n {\n var chevronId = jsonobj.xmlSection[0].chevrons[0].element[i].chevronId;\n var chevronName = jsonobj.xmlSection[0].chevrons[0].element[i].chevronName;\n var positionX = jsonobj.xmlSection[0].styles[0].format[i].X;\n var positionY = jsonobj.xmlSection[0].styles[0].format[i].Y;\n var process = jsonobj.xmlSection[0].chevrons[0].element[i].associatedAsset;\n\n storePropertiesOfChevron(chevronId, chevronName, process);\n\n var element1 = $('<div>').attr('id', 'chevronId').addClass('chevron');\n\n var textField = $('<textArea>').attr(\n {\n name: chevronId\n }).addClass(\"chevron-textField\");\n\n textField.val(chevronName);\n element1.append(textField);\n\n element1.find('.chevron-text').position(\n { // position text box in the center of element\n my: \"center\",\n at: \"center\",\n of: element1\n });\n\n element1.css(\n {\n 'top': positionY,\n 'left': positionX\n\n });\n $('#canvasArea').append(element1);\n\n element1.click(chevronClicked);\n }\n\n }", "function save() {\n // document.getElementById(\"canvasimg\").style.border = \"2px solid\";\n // const savedImage = canvas.toDataURL();\n // document.getElementById(\"canvasimg\").src = savedImage;\n\n // document.getElementById(\"canvasimg\").style.display = \"inline\"; \n //--- this is prob the line of code that saves it next to the current\n }", "function saveCanvas() {\r\n var sor = new SOR();\r\n sor.objName = \"model\";\r\n sor.vertices = g_points;\r\n sor.indexes = [];\r\n for (i = 0; i < g_points.length/3; i++)\r\n sor.indexes.push(i);\r\n console.log(sor.indexes);\r\n saveFile(sor);\r\n}", "function exportDotImage(phpData, phpNum) {\r\n\tvar dataArray = phpData.split(\",\");\r\n\tvar exportData = new Array(8);\r\n\texportData[0] = new Array(DOT_NUM);\r\n\texportData[1] = new Array(DOT_NUM);\r\n\texportData[2] = new Array(DOT_NUM);\r\n\texportData[3] = new Array(DOT_NUM);\r\n\texportData[4] = new Array(DOT_NUM);\r\n\texportData[5] = new Array(DOT_NUM);\r\n\texportData[6] = new Array(DOT_NUM);\r\n\texportData[7] = new Array(DOT_NUM);\r\n\tfor(var i=0; i<8; i++) {\r\n\t\tfor(var j=0; j<DOT_NUM; j++) {\r\n\t\t\texportData[i][j] = dataArray[i*DOT_NUM + j];\r\n\t\t}\r\n\t}\r\n\r\n\tEXPORT_ANIMATION_DELAY = document.forms.exportForm.exportSpeed.value;\r\n\tEXPORT_SIZE = document.forms.exportForm.exportSize.value;\r\n\tEXPORT_LINE_LENGTH = EXPORT_SIZE*0.1777;\r\n\tEXPORT_DOT_RADIUS = EXPORT_LINE_LENGTH*0.125;\r\n\r\n\tFileName = phpNum + '_' +EXPORT_SIZE + 'px' + \".gif\";\r\n\tvar encoder = new GIFEncoder();\r\n\tencoder.setRepeat(0);\r\n\tencoder.setDelay(EXPORT_ANIMATION_DELAY);\r\n\tencoder.setSize(EXPORT_SIZE, EXPORT_SIZE);\r\n\tencoder.start();\r\n\tdocument.getElementById('exportSpace').innerHTML = '<canvas id=\"exportCanvas\" width=\"'+EXPORT_SIZE+'\" height=\"'+EXPORT_SIZE+'\"></canvas>';\r\n\tvar exportView = new View('exportCanvas', EXPORT_SIZE, EXPORT_SIZE, false);\r\n\tvar frameData = new Array(8);\r\n\tfor(var i=0; i<frameData.length; i++) {\r\n\t\tframeData[i] = new DotFrame(EXPORT_LINE_LENGTH, EXPORT_DOT_RADIUS, KIDS_GREEN);\r\n\t\tfor(var j=0; j<DOT_NUM; j++) {\r\n\t\t\tif(exportData[i][j]==1) {\r\n\t\t\t\tframeData[i].arrDot[j].color = WHITE;\r\n\t\t\t\tframeData[i].arrDot[j].isDraw = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar arrDotFrame = frameData;\r\n\tvar center = new Vector2(EXPORT_SIZE/2, EXPORT_SIZE/2);\r\n\tfor(var i=0; i<arrDotFrame.length; i++) {\r\n\t\texportView.drawBg(arrDotFrame[i].bgColor);\r\n\t\tfor(var j=0; j<arrDotFrame[i].arrDot.length; j++) {\r\n\t\t\tarrDotFrame[i].arrDot[j].drawMain(exportView.ctx, center, true);\r\n\t\t}\r\n\t\tencoder.addFrame(exportView.ctx);\r\n\t}\r\n\tencoder.finish();\r\n\tvar bin = new Uint8Array(encoder.stream().bin);\r\n\tvar blob = new Blob([bin.buffer], {type:'image/gif'});\r\n\r\n\tif (window.navigator.msSaveBlob) {\r\n\t\twindow.navigator.msSaveBlob(blob, FileName);\r\n\t} else {\r\n\t\tvar a = document.createElement(\"a\");\r\n\t\ta.href = URL.createObjectURL(blob);\r\n\t\ta.download = FileName;\r\n\t\tdocument.body.appendChild(a) // FireFox specification\r\n\t\ta.click();\r\n\t\tdocument.body.removeChild(a) // FireFox specification\r\n\t}\r\n\tdocument.getElementById('exportSpace').innerHTML = '';\r\n\twindow.alert('export success');\r\n}", "function SVGComic(evt, opts) {\n /// <summary>The main SVGComic object</summary>\n /// <param name=\"evt\">The calling event</param>\n /// <param name=\"opts\">The desired options</param>\n /// <option name=\"author\">The author's name (defaults to A. N. Onymous)</option>\n /// <option name=\"copyright\">The preferred copyright statement (defaults to \"&copy YEAR AUTHOR. All rights \n /// reserved\")</option>\n /// <option name=\"fill\">Preferred gutter color (defaults to black)</option>\n /// <option name=\"fontSize\">Preferred font size for title/author/subtitle/copyright (defaults to 12)</option>\n /// <option name=\"height\">Preferred comic height (defaults to 300)</option>\n /// <option name=\"subtitle\">Preferred secondary/episode title (defaults to blank)</option>\n /// <option name=\"textColor\">Preferred color for title/etc. text (defaults to white)</option>\n /// <option name=\"title\">Preferred title (defaults to \"untitled\")</option>\n /// <option name=\"width\">Preferred comic width (defaults to 800)</option>\n /// <option name=\"xGutter\">Preferred horizontal gutter (defaults to 10)</option>\n \n if (window.svgDocument == null) {\n svgDocument = evt.target.ownerDocument;\n }\n\n this.document = svgDocument;\n this.svg = this.document.rootElement;\n this.ns = 'http://www.w3.org/2000/svg';\n\n if (opts == null) {\n opts = new Array();\n }\n\n var date = new Date();\n\n this.author = opts['author'] || 'A. N. Onymous';\n\n this.copyright = opts['copyright'] || \"© \" + date.getFullYear() + \" \" + this.author + \". All rights reserved.\";\n this.fill = opts['fill'] || 'black';\n this.fontSize = opts['fontSize'] || 12;\n this.height = opts['height'] || 300;\n this.subtitle = opts['subtitle'] || '';\n this.textColor = opts['textColor'] || 'white';\n this.title = opts['title'] || 'Untitled';\n this.width = opts['width'] || 800;\n this.xGutter = opts['xGutter'] || 10;\n\n// this.x = opts['x'] || window.innerWidth / 2 - this.width / 2;\n// this.y = opts['y'] || window.innerHeight / 2 - this.height / 2;\n\n this.panels = new Array();\n\n this.initialize();\n}", "function formatSvgFile(svgPaths, opt = {}) {\n opt = opt || {};\n\n var width = opt.width;\n var height = opt.height;\n\n var computeBounds =\n typeof width === 'undefined' || typeof height === 'undefined';\n if (computeBounds) {\n throw new Error('Must specify \"width\" and \"height\" options');\n }\n\n var units = opt.units || 'px';\n\n var convertOptions = {\n roundPixel: false,\n precision: defined(opt.precision, 5),\n pixelsPerInch: DEFAULT_PIXELS_PER_INCH\n };\n \n var viewWidth = convert(width, units, 'px', convertOptions).toString();\n var viewHeight = convert(height, units, 'px', convertOptions).toString();\n var fillStyle = opt.fillStyle || 'none';\n var strokeStyle = opt.strokeStyle || 'black';\n var lineWidth = opt.lineWidth;\n\n // Choose a default line width based on a relatively fine-tip pen\n if (typeof lineWidth === 'undefined') {\n // Convert to user units\n lineWidth = convert(\n DEFAULT_PEN_THICKNESS,\n DEFAULT_PEN_THICKNESS_UNIT,\n units,\n convertOptions\n ).toString();\n }\n\n return [\n '<?xml version=\"1.0\" standalone=\"no\"?>',\n ' <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" ',\n ' \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">',\n ' <svg width=\"' + width + units + '\" height=\"' + height + units + '\"',\n ' xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 ' + viewWidth + ' ' + viewHeight + '\">',\n ...svgPaths,\n '</svg>'\n ].join('\\n');\n}", "function draw() {\n function drawP(text) {\n var elem = document.createElement(\"p\");\n elem.innerText = text;\n document.getElementById(\"root\").append(elem);\n }\n drawP(\"(0,0) Note: SVG origin is top left\");\n var myGenerator = generator();\n var myChart = chart(400, 400);\n var svg = build(myGenerator, myChart);\n document.getElementById(\"root\").appendChild(svg);\n }", "function makecncsvgexport()\n{\n var c,d,x,y,x0,y0,pts,txt=\"\";\n getdefaults();\n var sfx=cutterwidth/(xmax-xmin);\n var sfy=cutterheight/(ymax-ymin);\n switch(originpos)\n {\n case 0: originx=0; originy=0; break; // Bottom left\n case 1: originx=0; originy=cutterheight; break; // Top left\n case 2: originx=cutterwidth; originy=0; break; // Bottom right\n case 3: originx=cutterwidth; originy=cutterheight; break; // Top right\n case 4: originx=cutterwidth/2; originy=cutterheight/2; break; // Middle\n }\n txt+='<?xml version=\"1.0\" encoding=\"utf-8\"?>\\r\\n';\n txt+='<svg id=\"gcodercncsvg\" width=\"'+cutterwidth+'px\" height=\"'+cutterheight+'px\" style=\"background-color:#FFFFFF\" version=\"1.1\" ';\n txt+='xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" ';\n txt+=makedefaultsparams()+' ';\n txt+='>\\r\\n';\n for(c=0;c<commands.length;c++)\n {\n if(commands[c][0]==='L')\n {\n pts=commands[c][1];\n pts=scaletoolpath(pts,sfx,sfy,cutterheight);\n pts=simplifytoolpath(pts,arcdist);\n txt+=' <path id=\"'+commands[c][12]+'\" d=\"M ';\n for(d=0;d<pts.length;d++)\n {\n x=pts[d][0]-originx;\n y=(cutterheight-pts[d][1])-originy;\n if(d===0)\n {\n x0=x;\n y0=y;\n }\n if(d===pts.length-1 && commands[c][11]===1) txt+=\"Z\";\n else txt+=x.toFixed(3)+\",\"+y.toFixed(3)+\" \";\n }\n txt+='\" opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"1\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-dasharray=\"none\" fill-opacity=\"0\" ';\n txt+=makepathparams(c)+' ';\n txt+='/>\\r\\n';\n }\n }\n txt+='</svg>\\r\\n';\n return txt;\n}", "function svg2Stng(svgElem)\r\n{\r\n console.log(new XMLSerializer().serializeToString(svgElem))\r\n}", "draw(ctx){\n saveMatrix();\n ctx.save();\n translate(0,0);\n\n if (this.extended) {\n this.dockPointsReq.forEach((value) => {\n value.draw(ctx);\n });\n this.dockPointsDev.forEach((value) => {\n value.draw(ctx);\n });\n }\n\n ctx.strokeRect(this.x,this.y+this.margin_top,this.width,this.height);\n restoreMatrix();\n ctx.restore();\n }", "_renderSvg() {\n this._svg = d3\n .select(this.parent)\n .append(\"svg\")\n .attr(\"class\", \"chart-svg\")\n .append(\"g\")\n .attr(\"class\", \"data-container\")\n .append(\"g\")\n .attr(\"class\", \"markers-container\");\n }", "function saveCanvas() {\r\n var sor = new SOR();\r\n sor.objName = \"model\";\r\n sor.vertices = g_points;\r\n sor.indexes = [];\r\n for (i = 0; i < g_points.length/3; i++)\r\n sor.indexes.push(i);\r\n console.log(sor.indexes);\r\n saveFile(sor);\r\n}", "function downloadAsSVG(fileName) {\n // use default name if not provided\n fileName = fileName || \"output.svg\";\n\n // create a data url of the file\n var svgData = project.exportSVG({\n asString: true\n });\n var url = \"data:image/svg+xml;utf8,\" + encodeURIComponent(svgData);\n\n // create a link to the data, and \"click\" it\n var link = document.createElement(\"a\");\n link.download = fileName;\n link.href = url;\n link.click();\n}", "function drawCanvas() {\n if( drawio.loadedIMG != ''){\n drawio.ctx.drawImage(drawio.loadedIMG, 0, 0);\n }\n for( var i = 0; i < drawio.shapes.length; i++) {\n drawio.shapes[i].render();\n }\n if(drawio.selectedElement) {\n drawio.selectedElement.render();\n }\n }", "generateSVGDownloadLinks() {\n\n var svg_header = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>';\n\n document.getElementById('map-download').href = \"data:image/svg+xml;base64,\" + window.btoa(svg_header + document.getElementById('map-area').innerHTML);\n document.getElementById('map-download').download = \"map.svg\";\n\n document.getElementById('cartogram-download').href = \"data:image/svg+xml;base64,\" + window.btoa(svg_header + document.getElementById('cartogram-area').innerHTML);\n document.getElementById('cartogram-download').download = \"cartogram.svg\";\n \n }", "function configureExportSVG() {\n var saveDiv = document.getElementById(\"global_panel_layer\");\n if(saveDiv === undefined) { return; }\n if(!saveDiv) { return; }\n \n if(current_region.exportSVGconfig == undefined) { \n current_region.exportSVGconfig = new Object;\n current_region.exportSVGconfig.title = current_region.configname;\n current_region.exportSVGconfig.savefile = false;\n current_region.exportSVGconfig.hide_widgets = false;\n current_region.exportSVGconfig.savefile = false;\n current_region.exportSVGconfig.hide_sidebar = false;\n current_region.exportSVGconfig.hide_titlebar = false;\n current_region.exportSVGconfig.hide_experiment_graph = false;\n current_region.exportSVGconfig.hide_compacted_tracks = false;\n }\n var exportConfig = current_region.exportSVGconfig;\n\n var e = window.event\n toolTipWidth=350;\n moveToMouseLoc(e);\n var xpos = toolTipSTYLE.xpos;\n var ypos = toolTipSTYLE.ypos + 10;\n\n var divFrame = document.createElement('div');\n divFrame.setAttribute('style', \"position:absolute; background-color:LightYellow; text-align:left; \"\n +\"border:inset; border-width:1px; padding: 3px 3px 3px 3px; \"\n //+\"left:\" + ((winW/2)-250) +\"px; top:\" + (toolTipSTYLE.ypos+10) +\"px; \"\n +\"left:\"+(xpos-350)+\"px; top:\"+(ypos)+\"px; \"\n +\"width:350px; z-index:90; \"\n );\n var tdiv, tdiv2, tspan1, tspan2, tinput, tcheck;\n\n //close button\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv.setAttribute('style', \"float:right; margin: 0px 4px 4px 4px;\");\n var a1 = tdiv.appendChild(document.createElement('a'));\n a1.setAttribute(\"target\", \"top\");\n a1.setAttribute(\"href\", \"./\");\n a1.setAttribute(\"onclick\", \"exportSVGConfigParam('svg-cancel'); return false;\");\n var img1 = a1.appendChild(document.createElement('img'));\n img1.setAttribute(\"src\", eedbWebRoot+\"/images/close_icon16px_gray.png\");\n img1.setAttribute(\"width\", \"12\");\n img1.setAttribute(\"height\", \"12\");\n img1.setAttribute(\"alt\",\"close\");\n\n\n //title\n tdiv = document.createElement('h3');\n tdiv.setAttribute('align', \"center\");\n tdiv.innerHTML = \"Export view as SVG image\";\n divFrame.appendChild(tdiv);\n\n //----------\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tdiv2.setAttribute('style', \"float:left; width:200px;\");\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig.hide_widgets) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.setAttribute(\"onclick\", \"exportSVGConfigParam('widgets', this.checked);\");\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"hide widgets\";\n\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig.savefile) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.setAttribute(\"onclick\", \"exportSVGConfigParam('savefile', this.checked);\");\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"save to file\";\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig.hide_sidebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.setAttribute(\"onclick\", \"exportSVGConfigParam('sidebar', this.checked);\");\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide track sidebars\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig.hide_titlebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.setAttribute(\"onclick\", \"exportSVGConfigParam('titlebar', this.checked);\");\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide title bar\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig.hide_experiment_graph) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.setAttribute(\"onclick\", \"exportSVGConfigParam('experiments', this.checked);\");\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide experiment/expression graph\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig.hide_compacted_tracks) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.setAttribute(\"onclick\", \"exportSVGConfigParam('compacted_tracks', this.checked);\");\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide compacted tracks\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n //----------\n divFrame.appendChild(document.createElement('hr'));\n //----------\n var button1 = document.createElement('input');\n button1.setAttribute(\"type\", \"button\");\n button1.setAttribute(\"value\", \"cancel\");\n button1.setAttribute('style', \"float:left; margin: 0px 4px 4px 4px;\");\n button1.setAttribute(\"onclick\", \"exportSVGConfigParam('svg-cancel','');\");\n divFrame.appendChild(button1);\n\n var button2 = document.createElement('input');\n button2.setAttribute(\"type\", \"button\");\n button2.setAttribute(\"value\", \"export svg\");\n button2.setAttribute('style', \"float:right; margin: 0px 4px 4px 4px;\");\n button2.setAttribute(\"onclick\", \"exportSVGConfigParam('svg-accept','');\");\n divFrame.appendChild(button2);\n\n saveDiv.innerHTML = \"\";\n saveDiv.appendChild(divFrame);\n}", "function drawCanvas() {\n //Clear everything\n clearCanvas([ctx_edges, ctx_donuts, ctx_nodes, ctx_hover]); //Draw the lines in between the domain arcs and the ICH element arcs\n\n if (hover_type === 'element') drawLines(ctx_edges, 'element-domain', edges_element_domain_nest);else if (hover_type !== 'country') drawLines(ctx_edges, 'domain', edges_domain_nest);\n if (hover_type === 'element') drawLines(ctx_edges, 'element-country', edges_element_country_nest);else drawLines(ctx_edges, 'country', edges_country_nest); //Draw the domain arcs\n\n ctx_donuts.font = 'normal normal 400 16px ' + font_family;\n ctx_donuts.textBaseline = 'middle';\n ctx_donuts.textAlign = 'center';\n domain_arcs.forEach(function (d) {\n drawDomainDonutChart(ctx_donuts, d);\n }); //Draw the dots outside the domain arcs\n\n if (hover_type !== 'country') drawDomainDots(); //Draw the ICH element arcs\n\n drawElementDonutChart(); //Draw the dots outside the ICH element arcs\n\n drawElementArcDots(); //Draw the ICH elements\n\n ctx_nodes.lineWidth = element_stroke_width;\n elements.forEach(function (d) {\n drawElements(ctx_nodes, d);\n });\n ctx_nodes.lineWidth = 1; //Draw the regional area arcs\n\n drawCountryDonutChart(); //Draw the country diamonds around the outside\n\n ctx_nodes.textBaseline = 'middle';\n ctx_nodes.lineWidth = 2;\n ctx_nodes.font = 'normal normal 400 13.5px ' + font_family;\n countries.forEach(function (d) {\n drawCountries(ctx_nodes, d);\n }); //Draw the title in the center\n\n if (hover_type === 'element') drawInnerSection(ctx_nodes, current_hover);else if (hover_type === 'domain') drawDomainTitle(current_hover.data, ICH_num);else if (hover_type === 'country') drawCountryTitle(current_hover.label, ICH_num);else drawTitle(ICH_num_all);\n } //function drawCanvas", "_drawStepSVG(color, opacity, x, y, svg_container) {\r\n const that = this;\r\n if (that.squareWidth) {\r\n that.lineWidth = that.squareWidth;\r\n that.lineHeight = that.squareWidth;\r\n }\r\n let rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\r\n rect.setAttribute('x', x);\r\n rect.setAttribute('y', y);\r\n rect.setAttribute('width', that.lineWidth);\r\n rect.setAttribute('height', that.lineHeight);\r\n rect.setAttribute('fill-opacity', opacity);\r\n rect.style.fill = color;\r\n svg_container.appendChild(rect);\r\n }", "async function exportDiagram() {\n\n try {\n\n var result = await bpmnModeler.saveXML({ format: true });\n\n // alert('Diagram exported. Check the developer tools!');\n\n console.log('DIAGRAM', result.xml);\n } catch (err) {\n\n console.error('could not save BPMN 2.0 diagram', err);\n }\n }", "function exportPNG() {\n var canvas = document.getElementById('myCanvas');\n var html = \"<img src='\" + canvas.toDataURL('image/png') + \"' />\"\n if ($.browser.msie) {\n window.winpng = window.open('/static/html/export.html');\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n } else {\n window.winpng = window.open();\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n }\n\n}", "function retearPaper() {\n\n\t// Loop through tornPaperSvg and {{do stuff...}}\n\t\tfor (i = 0; i < tornPaperSvg.length; i++) {\n\n\t\t\t// Return child nodes of tornPaperSvg[i]\n\t\t\t\tvar childNodesList = tornPaperSvg[i].childNodes;\n\t\t\t\t// console.log('childNodesList:');\n\t\t\t\t// console.log(childNodesList);\n\n\t\t\t// Convert childNodes into an array\n\t\t\t\tvar childNodesArray = Array.from(childNodesList);\n\t\t\t\t// console.log('childNodesArray:');\n\t\t\t\t// console.log(childNodesArray);\n\n\t\t\t// Define tagNamesArray variable and assign to empty array\n\t\t\t\tvar tagNamesArray = [];\n\n\t\t\t// Define getTagNames(value) function\n\t\t\t\tfunction getTagNames(value) {\n\n\t\t\t\t\t// Determine the tagName of value argument and add to tagNamesArray\n\t\t\t\t\ttagNamesArray.push(value.tagName);\n\n\t\t\t\t}\n\n\t\t\t// Use the .forEach() method to call getTagNames function once for each element in childNodesArray array\n\t\t\t\tchildNodesArray.forEach(getTagNames);\n\n\t\t\t// Define polygonPosition variable and use .indexOf() method to search tagNamesArray for the specified item and return its position\n\t\t\t\t// NOTE: The .indexOf() method returns -1 if the value is not found\n\t\t\t\tvar polygonPosition = tagNamesArray.indexOf('polygon');\n\t\t\t\t// console.log('polygonPosition:');\n\t\t\t\t// console.log(polygonPosition);\n\n\t\t\t// Return data from childNodesArray[polygonPosition] to access <polygon> element\n\t\t\t\tvar polygonElement = childNodesArray[polygonPosition];\n\t\t\t\t// console.log('polygonElement:');\n\t\t\t\t// console.log(polygonElement);\n\n\t\t\t// Use the .getAttribute() method to return value of the points attribute\n\t\t\t\tvar pointsAttribute = polygonElement.getAttribute('points');\n\t\t\t\t// console.log('pointsAttribute:');\n\t\t\t\t// console.log(pointsAttribute);\n\n\t\t\t// Use the .split() method to convert the pointsAttribute string into an array\n\t\t\t\tvar pointsArray = pointsAttribute.split(',');\n\t\t\t\t// console.log('pointsArray:');\n\t\t\t\t// console.log(pointsArray);\n\n\t\t\t// Define lastElement variable and assign to empty array\n\t\t\t\tvar lastElement = [];\n\t\t\t\t// console.log('lastElement:');\n\t\t\t\t// console.log(lastElement);\n\n\t\t\t// Use .push() method to add last element of pointsArray to lastElement\n\t\t\t\tlastElement.push(pointsArray[pointsArray.length - 1]);\n\t\t\t\t// console.log('lastElement:');\n\t\t\t\t// console.log(lastElement);\n\n\t\t\t\t\t// Regex to extract characters before blank space\n\t\t\t\t\t\t//NOTE: The returned value will be a string and needs to be converted into an integer\n\t\t\t\t\t\tvar xString = lastElement[0].substr(0,lastElement[0].indexOf(' '));\n\t\t\t\t\t\t// console.log('xString:');\n\t\t\t\t\t\t// console.log(xString);\n\n\t\t\t\t\t// Convert xString to an integer\n\t\t\t\t\t\tvar xInt = parseInt(xString);\n\t\t\t\t\t\t// console.log('xInt:');\n\t\t\t\t\t\t// console.log(xInt);\n\n\t\t\t// Define oldSvgWidth variable and assign to value of xInt\n\t\t\t\tvar oldSvgWidth = xInt;\n\t\t\t\t// console.log('oldSvgWidth:');\n\t\t\t\t// console.log(oldSvgWidth);\n\n\t\t\t// Use the .getBoundingClientRect() method to return the size of tornPaperSvg[i].parentNode and its position relative to the viewport (left, top, right, bottom, x, y, width, and height properties)\n\t\t\t\tvar newRect = tornPaperSvg[i].parentNode.getBoundingClientRect();\n\t\t\t\tvar newRectWidth = newRect.width;\n\t\t\t\t// console.log('newRectWidth:');\n\t\t\t\t// console.log(newRectWidth);\n\t\t\t\tvar newRectHeight = newRect.height;\n\t\t\t\t// console.log('newRectHeight:');\n\t\t\t\t// console.log(newRectHeight);\n\n\t\t\t// Assign value of newRectWidth to newSvgWidth\n\t\t\t\tvar newSvgWidth = newRectWidth;\n\t\t\t\t// console.log('newSvgWidth:');\n\t\t\t\t// console.log(newSvgWidth);\n\n\t\t\t// Assign value of (newRectWidth * 0.045) to newSvgHeight\n\t\t\t\tvar newSvgHeight = (newRectWidth * 0.045);\n\t\t\t\t// console.log('newSvgHeight:');\n\t\t\t\t// console.log(newSvgHeight);\n\n\t\t\t// Assign value of newSvgWidth to tornPaperSvg[i] as width attribute\n\t\t\t\ttornPaperSvg[i].style.width = (newSvgWidth + 'px');\n\t\t\t\t// console.log('tornPaperSvg[' + i + '].width:');\n\t\t\t\t// console.log(tornPaperSvg[i].style.width);\n\n\t\t\t// Assign value of newSvgHeight to tornPaperSvg[i] as height attribute\n\t\t\t\ttornPaperSvg[i].style.height = (newSvgHeight + 'px');\n\t\t\t\t// console.log('tornPaperSvg[' + i + '].height:');\n\t\t\t\t// console.log(tornPaperSvg[i].style.height);\n\n\t\t\t// Define svgRatios variable and assign to empty array\n\t\t\t\tvar svgRatios = [];\n\t\t\t\t// console.log('svgRatios:');\n\t\t\t\t// console.log(svgRatios);\n\n\t\t\t// Loop through pointsArray and calculate ratios for X and Y Coordinates\n\t\t\t\tfor (j = 0; j < pointsArray.length; j++) {\n\n\t\t\t\t\t// Regex to extract characters before blank space\n\t\t\t\t\t\tvar xString = pointsArray[j].substr(0,pointsArray[j].indexOf(' '));\n\t\t\t\t\t\t// console.log('xString:');\n\t\t\t\t\t\t// console.log(xString);\n\n\t\t\t\t\t// Regex to extract characters after blank space\n\t\t\t\t\t\tvar yString = pointsArray[j].substr(pointsArray[j].indexOf(' ')+1);\n\t\t\t\t\t\t// console.log('yString:');\n\t\t\t\t\t\t// console.log(yString);\n\n\t\t\t\t\t// Convert xString to a float\n\t\t\t\t\t\tvar xFloat = parseFloat(xString);\n\t\t\t\t\t\t// console.log('xFloat:');\n\t\t\t\t\t\t// console.log(xFloat);\n\n\t\t\t\t\t// Convert yString to a float\n\t\t\t\t\t\tvar yFloat = parseFloat(yString);\n\t\t\t\t\t\t// console.log('yFloat:');\n\t\t\t\t\t\t// console.log(yFloat);\n\n\t\t\t\t\t// Calculate ratio of xFloat / oldSvgWidth\n\t\t\t\t\t\tvar xRatio = (xFloat / oldSvgWidth);\n\t\t\t\t\t\t// console.log('xRatio:');\n\t\t\t\t\t\t// console.log(xRatio);\n\n\t\t\t\t\t// Calculate ration of yFloat / (oldSvgWidth * 0.045)\n\t\t\t\t\t\tvar yRatio = (yFloat / (oldSvgWidth * 0.045));\n\t\t\t\t\t\t// console.log('yRatio:');\n\t\t\t\t\t\t// console.log(yRatio);\n\n\t\t\t\t\t// Add xRatio and yRatio values to svgRatios array\n\t\t\t\t\t\tsvgRatios.push(xRatio + ' ' + yRatio);\n\t\t\t\t\t\t// console.log('svgRatios:');\n\t\t\t\t\t\t// console.log(svgRatios);\n\n\t\t\t\t}\n\t\t\t\t// console.log('svgRatios:');\n\t\t\t\t// console.log(svgRatios);\n\n\t\t\t// Empty the contents of tornPaperSvg[i]\n\t\t\t\twhile (tornPaperSvg[i].hasChildNodes()) {\n\t\t\t\t\ttornPaperSvg[i].removeChild(tornPaperSvg[i].firstChild);\n\t\t\t\t}\n\t\t\t\t// console.log('tornPaperSvg[' + i + '].childNodes:');\n\t\t\t\t// console.log(tornPaperSvg[i].childNodes);\n\n\t\t\t// Define newSVGCoordinates variable and assign to empty array\n\t\t\t\tvar newSVGCoordinates = [];\n\t\t\t\t// console.log('newSVGCoordinates:');\n\t\t\t\t// console.log(newSVGCoordinates);\n\n\t\t\t// Loop through svgRatios array and caculate new X and Y Coordinates relative to newSvgWidth and newSvgHeight\n\t\t\t\tfor (k = 0; k < svgRatios.length; k++) {\n\n\t\t\t\t\t// Regex to extract characters before blank space\n\t\t\t\t\t\tvar xString = svgRatios[k].substr(0, svgRatios[k].indexOf(' '));\n\t\t\t\t\t\t// console.log('xString:');\n\t\t\t\t\t\t// console.log(xString);\n\n\t\t\t\t\t// Regex to extract characters after blank space\n\t\t\t\t\t\tvar yString = svgRatios[k].substr(svgRatios[k].indexOf(' ') + 1);\n\t\t\t\t\t\t// console.log('yString:');\n\t\t\t\t\t\t// console.log(yString);\n\n\t\t\t\t\t// Convert xString to a float\n\t\t\t\t\t\tvar xFloat = parseFloat(xString);\n\t\t\t\t\t\t// console.log('xFloat:');\n\t\t\t\t\t\t// console.log(xFloat);\n\n\t\t\t\t\t// Convert yString to a float\n\t\t\t\t\t\tvar yFloat = parseFloat(yString);\n\t\t\t\t\t\t// console.log('yFloat:');\n\t\t\t\t\t\t// console.log(yFloat);\n\n\t\t\t\t\t// Calculate new xCoordinate value\n\t\t\t\t\t\tvar xCoordinate = (xFloat * newSvgWidth);\n\t\t\t\t\t\t// console.log('xCoordinate:');\n\t\t\t\t\t\t// console.log(xCoordinate);\n\n\t\t\t\t\t// Calculate new yCoordinate value\n\t\t\t\t\t\tvar yCoordinate = (yFloat * newSvgHeight);\n\t\t\t\t\t\t// console.log('yCoordinate:');\n\t\t\t\t\t\t// console.log(yCoordinate);\n\n\t\t\t\t\t// Add xCoordinate and yCoordinate values to newSVGCoordinates array\n\t\t\t\t\t\tnewSVGCoordinates.push(xCoordinate + ' ' + yCoordinate);\n\t\t\t\t\t\t// console.log('newSVGCoordinates:');\n\t\t\t\t\t\t// console.log(newSVGCoordinates);\n\n\t\t\t\t}\n\t\t\t\t// console.log('newSVGCoordinates:');\n\t\t\t\t// console.log(newSVGCoordinates);\n\n\t\t\t// Use Snap.svg JavaScript library to create new drawing surface out of tornPaperSvg[i]\n\t\t\t\tvar svg = Snap(tornPaperSvg[i]);\n\n\t\t\t// Draw a polygon using the X Y coordinates from the newSVGCoordinates array and define a fill color\n\t\t\t\tlet tornPaperModulo = i % 4;\n\t\t\t\tif (tornPaperModulo == 0) {\n\t\t\t\t\tvar tornPaperFill = svg.polygon(newSVGCoordinates).attr({\n\t\t\t\t\t\tfill: '#c5342f'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse if (tornPaperModulo == 1) {\n\t\t\t\t\tvar tornPaperFill = svg.polygon(newSVGCoordinates).attr({\n\t\t\t\t\t\tfill: '#f47b3d'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse if (tornPaperModulo == 2) {\n\t\t\t\t\tvar tornPaperFill = svg.polygon(newSVGCoordinates).attr({\n\t\t\t\t\t\tfill: '#5b9d7a'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar tornPaperFill = svg.polygon(newSVGCoordinates).attr({\n\t\t\t\t\t\tfill: '#ffc63e'\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t}\n\n}", "function pathsToSvgFile(paths, opt = {}) {\n opt = opt || {};\n\n var width = opt.width;\n var height = opt.height;\n\n var computeBounds =\n typeof width === 'undefined' || typeof height === 'undefined';\n if (computeBounds) {\n throw new Error('Must specify \"width\" and \"height\" options');\n }\n\n var units = opt.units || 'px';\n\n var convertOptions = {\n roundPixel: false,\n precision: defined(opt.precision, 5),\n pixelsPerInch: DEFAULT_PIXELS_PER_INCH\n };\n var svgPath = paths.join(' ');\n var viewWidth = convert(width, units, 'px', convertOptions).toString();\n var viewHeight = convert(height, units, 'px', convertOptions).toString();\n var fillStyle = opt.fillStyle || 'none';\n var strokeStyle = opt.strokeStyle || 'black';\n var lineWidth = opt.lineWidth;\n\n // Choose a default line width based on a relatively fine-tip pen\n if (typeof lineWidth === 'undefined') {\n // Convert to user units\n lineWidth = convert(\n DEFAULT_PEN_THICKNESS,\n DEFAULT_PEN_THICKNESS_UNIT,\n units,\n convertOptions\n ).toString();\n }\n\n return [\n '<?xml version=\"1.0\" standalone=\"no\"?>',\n ' <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" ',\n ' \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">',\n ' <svg width=\"' + width + units + '\" height=\"' + height + units + '\"',\n ' xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 ' + viewWidth + ' ' + viewHeight + '\">',\n ' <g>',\n ' <path d=\"' + svgPath + '\" fill=\"' + fillStyle + '\" stroke=\"' + strokeStyle + '\" stroke-width=\"' + lineWidth + units + '\" />',\n ' </g>',\n '</svg>'\n ].join('\\n');\n}", "function print_diagram() {\n var printFrameId = \"printFrame\";\n\n var iframe = document.getElementById(printFrameId);\n\n // if iframe isn't created\n if (iframe == null) {\n iframe = document.createElement(\"IFRAME\");\n iframe.id = printFrameId;\n\n document.body.appendChild(iframe);\n }\n\n // get DOM of iframe\n var frameDoc = iframe.contentDocument;\n\n var diagramImages = frameDoc.getElementsByTagName('img');\n var diagramImage;\n if (diagramImages.length > 0) { // if image is already added\n diagramImage = diagramImages[0];\n\n // set source of image to png of saved diagram\n diagramImage.setAttribute('src', \"data/diagrams/\" + currentDiagramId + \".png\");\n\n } else { // if image isn't created yet\n diagramImage = frameDoc.createElement('img');\n\n // set source of image to png of saved diagram\n diagramImage.setAttribute('src', \"data/diagrams/\" + currentDiagramId + \".png\");\n\n if (frameDoc.body !== null) {\n frameDoc.body.appendChild(diagramImage);\n } else {\n // IE case for more details\n // @see http://stackoverflow.com/questions/8298320/correct-access-of-dynamic-iframe-in-ie\n // create body of iframe\n frameDoc.src = \"javascript:'<body></body>'\";\n // append image through html of <img>\n frameDoc.write(diagramImage.outerHTML);\n frameDoc.close();\n }\n }\n\n // adjust iframe size to main canvas (as it might have been changed)\n iframe.setAttribute('width', canvasProps.getWidth());\n iframe.setAttribute('height', canvasProps.getHeight());\n\n // print iframe\n iframe.contentWindow.print();\n}", "function render() {\n var fn = function (svg, g) {\n preProcessGraph(g);\n\n var outputGroup = createOrSelectGroup(svg, 'output');\n var clustersGroup = createOrSelectGroup(outputGroup, 'clusters');\n var edgePathsGroup = createOrSelectGroup(outputGroup, 'edgePaths');\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, 'edgeLabels'), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, 'nodes'), g, shapes);\n\n layout(g);\n\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n\n postProcessGraph(g);\n };\n\n fn.createNodes = function (value) {\n if (!arguments.length) return createNodes;\n setCreateNodes(value);\n return fn;\n };\n\n fn.createClusters = function (value) {\n if (!arguments.length) return createClusters;\n setCreateClusters(value);\n return fn;\n };\n\n fn.createEdgeLabels = function (value) {\n if (!arguments.length) return createEdgeLabels;\n setCreateEdgeLabels(value);\n return fn;\n };\n\n fn.createEdgePaths = function (value) {\n if (!arguments.length) return createEdgePaths;\n setCreateEdgePaths(value);\n return fn;\n };\n\n fn.shapes = function (value) {\n if (!arguments.length) return shapes;\n setShapes(value);\n return fn;\n };\n\n fn.arrows = function (value) {\n if (!arguments.length) return arrows;\n setArrows(value);\n return fn;\n };\n\n return fn;\n}", "function SaveTheView()\n{\n console.log($(\".display-area\")[0].children)\n var z=$(\".display-area\")[0].children.length;\n for(i=0;i<z;i++)\n {\n console.log($(\".display-area\")[0].children[i])\n console.log($(\".display-area\")[0].children[i].attributes.name.value)\n console.log($(\".display-area\")[0].children[i].style.position)\n console.log($(\".display-area\")[0].children[i].style.top)\n console.log($(\".display-area\")[0].children[i].style.left)\n \n shapes.id=$(\".display-area\")[0].children[i].id;\n shapes.type=$(\".display-area\")[0].children[i].attributes.name.value;\n shapes.position=$(\".display-area\")[0].children[i].style.position;\n shapes.left=$(\".display-area\")[0].children[i].style.left;\n shapes.top=$(\".display-area\")[0].children[i].style.top;\n }\n console.log(shapes)\n}", "function download(fileName) {\n if(graphExists) {\n var svg = d3.select(\"#svg-algo\"),\n html = svg\n .attr(\"version\", 1.1)\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .node().parentNode.innerHTML;\n\n downloadData(html, fileName);\n\n //also download the data struct if it exists\n var structSvg = d3.select(\"#svg-data-struct\");\n if (!structSvg.empty()) {\n html = structSvg\n .attr(\"version\", 1.1)\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .node().parentNode.innerHTML;\n downloadData(html, $(\"#data-struct-title\").text());\n }\n }\n}", "drawHTMLBoard () {\n for (let column of this.spaces) {\n for (let space of column) {\n space.drawSVGSpace();\n }\n }\n }", "function exportPngs(data) {\n for (var i = 0; i < data.layerSets.length ; i++) {\n exportPngs(data.layerSets[i]);\n }\n \n if (data.typename != \"LayerSet\") {\n return;\n }\n\n _xmlString += \"\\t\\t<Layer Name=\\\"\"+ data.name + \"\\\"> \\n\";\n _xmlString += \"\\t\\t\\t<Sprites> \\n\";\n for (var i = 0; i < data.artLayers.length ; i++) {\n data.artLayers[i].visible = true;\n saveCropPng(_file.duplicate(), (data.artLayers[i].name.replace(/ /g,\"-\") + \"-layer-\" + _idx + \"-\" + i), data.artLayers[i].name);\n data.artLayers[i].visible = false;\n }\n _xmlString += \"\\t\\t\\t</Sprites> \\n\";\n _xmlString += \"\\t\\t</Layer>\\n\";\n _idx++;\n}" ]
[ "0.7432512", "0.71305656", "0.70254827", "0.6961973", "0.68934137", "0.6879022", "0.68140775", "0.67515266", "0.66660565", "0.66637975", "0.648514", "0.6440352", "0.643961", "0.63898677", "0.63580865", "0.6290826", "0.62840086", "0.6235493", "0.6172359", "0.6164024", "0.6111217", "0.6075252", "0.60119706", "0.5967763", "0.5952688", "0.59438705", "0.59429675", "0.5908358", "0.59031564", "0.5896452", "0.58941376", "0.58927196", "0.5884019", "0.5857362", "0.58390516", "0.5825397", "0.5803148", "0.5795725", "0.5794624", "0.57838833", "0.57768255", "0.57201713", "0.5703149", "0.5676885", "0.56662565", "0.5659841", "0.56559265", "0.5652699", "0.5646521", "0.5644112", "0.5642031", "0.5630407", "0.5603958", "0.5600042", "0.55999666", "0.55970824", "0.5596096", "0.5584124", "0.55702156", "0.55688745", "0.554828", "0.55453604", "0.55404884", "0.5535247", "0.55296475", "0.55242115", "0.5518532", "0.5505924", "0.55024475", "0.5494427", "0.5464112", "0.546285", "0.5454654", "0.5440973", "0.5437374", "0.5427304", "0.54151297", "0.5406065", "0.5405438", "0.54035187", "0.54025775", "0.5388331", "0.53792065", "0.53756547", "0.5372545", "0.53693813", "0.5367522", "0.53623277", "0.5360877", "0.5359533", "0.53549623", "0.5353424", "0.5349898", "0.53471136", "0.53398645", "0.5337993", "0.530291", "0.5295156", "0.5294152", "0.5289907" ]
0.7124628
2
Supposelly stop any selection from happening
function stopselection(ev) { /*If we are selecting text within anything with the className text, we allow it * This gives us the option of using textareas, inputs and any other item we * want to allow text selection in. **/ if (ev.target.className == "text") { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unblockTextSelection() {\n document.onselectstart = function () {\n return true;\n };\n }", "function unblockTextSelection() {\n document.onselectstart = function () {\n return true;\n };\n}", "function unblockTextSelection() {\n _document2['default'].onselectstart = function () {\n return true;\n };\n}", "function unblockTextSelection() {\n _document2['default'].onselectstart = function () {\n return true;\n };\n}", "function unblockTextSelection() {\n global_document__WEBPACK_IMPORTED_MODULE_7___default.a.onselectstart = function () {\n return true;\n };\n}", "function unblockTextSelection() {\n global_document__WEBPACK_IMPORTED_MODULE_1___default.a.onselectstart = function () {\n return true;\n };\n}", "function unblockTextSelection() {\n global_document__WEBPACK_IMPORTED_MODULE_1___default.a.onselectstart = function () {\n return true;\n };\n}", "function dontPosSelect() {\n return false;\n }", "disable() {\n this.clearSelection();\n this._enabled = false;\n }", "function removeSelectionHighlight() {\r\n hideSelectionRect();\r\n hideRotIndicator();\r\n }", "suspendElementSelect() {\n $(this.editor.container).off('click');\n }", "function disable_text_selection() {\n \n if ( typeof document.body.onselectstart != 'undefined' ){\n document.body.onselectstart = function(){ return false; };\n } else if ( typeof document.body.style.MozUserSelect != 'undefined' ) {\n document.body.style.MozUserSelect = 'none';\n } else if ( typeof document.body.style.webkitUserSelect != 'undefined' ) {\n document.body.style.webkitUserSelect = 'none';\n } else {\n document.body.onmousedown = function(){ return false; };\n }\n\n document.body.style.cursor = 'default';\n \n }", "unselectText_() {\n try {\n this.win.getSelection().removeAllRanges();\n } catch (e) {\n // Selection API not supported.\n }\n }", "unSelectAll () { this.toggSelAll(false); }", "function cancelCursorSelection (cursor, selection) {\n // Clear cursor\n let cellCursor = cursor.cell;\n if (cellCursor != null) {\n\tif (cellCursor.classList.contains(Reshidden)) {\n\t cellCursor.classList.remove(Reshidden);\n\t}\n\tcellCursor.classList.remove(CursorHighlight);\n }\n // Clear selection\n let cells = selection.selectCells;\n let len = cells.length;\n if (len > 0) {\n\tlet selectHighlight = selection.selectHighlight;\n\tfor (let i=0 ; i<len ; i++) {\n\t cells[i].classList.replace(selectHighlight, \"brow\");\n\t}\n\tcells.length = 0;\n\tselection.selectIds.length = 0;\n\n\t// Clear last select operation\n\tselection.lastCell = null;\n\tselection.is_select = true;\n }\n}", "function blockTextSelection() {\n _document2['default'].body.focus();\n _document2['default'].onselectstart = function () {\n return false;\n };\n}", "function blockTextSelection() {\n _document2['default'].body.focus();\n _document2['default'].onselectstart = function () {\n return false;\n };\n}", "deselectAll() {\n if (document.selection) {\n document.selection.empty();\n } else if (window.getSelection) {\n window.getSelection().removeAllRanges();\n }\n }", "function disableselect(e){\n return false\n}", "function disableselect(e){\nreturn false\n}", "function blockTextSelection() {\n document.body.focus();\n\n document.onselectstart = function () {\n return false;\n };\n }", "function blockTextSelection() {\n document.body.focus();\n document.onselectstart = function () {\n return false;\n };\n}", "function blockTextSelection() {\n global_document__WEBPACK_IMPORTED_MODULE_7___default.a.body.focus();\n\n global_document__WEBPACK_IMPORTED_MODULE_7___default.a.onselectstart = function () {\n return false;\n };\n}", "function blockTextSelection() {\n global_document__WEBPACK_IMPORTED_MODULE_1___default.a.body.focus();\n\n global_document__WEBPACK_IMPORTED_MODULE_1___default.a.onselectstart = function () {\n return false;\n };\n}", "function blockTextSelection() {\n global_document__WEBPACK_IMPORTED_MODULE_1___default.a.body.focus();\n\n global_document__WEBPACK_IMPORTED_MODULE_1___default.a.onselectstart = function () {\n return false;\n };\n}", "disableSelectionMode() {\n this.props.setSelectionId(null);\n this.props.disableSelectionMode();\n }", "function noUserSelect(g) {\n g.setAttribute(\"style\", \"-webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;\");\n // IE 9 / 8\n if (typeof g.onselectstart !== 'undefined') {\n g.setAttribute('unselectable', 'on');\n g.onselectstart = function() { return false; };\n }\n }", "function dismissBrowserSelection() {\n if (window.getSelection){\n var selection = window.getSelection();\n selection.collapse(document.body, 0);\n } else {\n var selection = document.selection.createRange();\n selection.setEndPoint(\"EndToStart\", selection);\n selection.select();\n }\n }", "function stopSelect(e)\n{\n\tselectionStarted = false;\n\tif (selectStartX != selectStopX && selectStartY != selectStopY)\n\t{\n\t\tmaxX = Math.max(selectStartX, selectStopX)*ratioX + minX;\n\t\tminX = Math.min(selectStartX, selectStopX)*ratioX + minX;\n\t\tmaxY = Math.max(selectStartY, selectStopY)*ratioY + minY;\n\t\tminY = Math.min(selectStartY, selectStopY)*ratioY + minY;\n\t\tratioX = (maxX - minX) / width;\n\t\tratioY = (maxY - minY) / height;\n\t\trenderFractal();\n\t}\n}", "function deselect() {\n deselectTask(requireCursor());\n }", "function __onMouseSelectionBlocker() {\n $('body').addClass('wcDisableSelection');\n }", "function removeAllSelections() {\r\n\tvar pos = getCaretPosition();\r\n\twindow.getSelection().removeAllRanges();\r\n\tsetCaretPosition(pos);\r\n}", "clearSelection() {\n this._clearSelection();\n }", "function unselectText() {\n window.getSelection().empty();\n}", "resetSelection() {\n if (!this.isSelectionEmpty()) {\n this._resetSelection();\n this._fireChangeSelection();\n }\n }", "function selectDisable(elem) {\n elem.onselectstart = function() { return false; };\n elem.unselectable = \"on\";\n elem.style.MozUserSelect = \"none\";\n elem.style.cursor = \"default\";\n if (window.opera) elem.onmousedown = function() { return false; };\n}", "function removeGhostSelection() {\n\t\t\teditor.on('Undo Redo SetContent', function(e) {\n\t\t\t\tif (!e.initial) {\n\t\t\t\t\teditor.execCommand('mceRepaint');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "resetSelection () {\n this.currentSelection = null\n }", "function noSelect($elem, options) {\n var none = 'none';\n bindMany($elem, options, {\n 'selectstart dragstart mousedown': returnFalse\n });\n\n $elem.css({\n MozUserSelect: none,\n msUserSelect: none,\n webkitUserSelect: none,\n userSelect: none\n });\n }", "selectNone () {\n this.$refs.grid.gridOptions.api.deselectAll();\n this.grid.hasSelectedRows = false;\n }", "function stopTimeSelect() {\n context.on(\"mousemove\", null);\n context.on(\"mouseup\", null);\n filterByDate(MONTHS[TRANGE[0]], MONTHS[TRANGE[1]], _(KIVA['loans']).clone());\n}", "function UnselectSails()\n{\n\tnormalSailSelected = false;\n\tblueSailSelected = false;\n}", "clearSelection() {\n this.selectionStart = undefined;\n this.selectionEnd = undefined;\n this.isSelectAllActive = false;\n this.selectionStartLength = 0;\n }", "function noSelect($elem, options) {\n\t\tvar none = 'none';\n\t\tbindMany($elem, options, {\n\t\t\t'selectstart dragstart mousedown': returnFalse\n\t\t});\n\n\t\t$elem.css({\n\t\t\tMozUserSelect: none,\n\t\t\tmsUserSelect: none,\n\t\t\twebkitUserSelect: none,\n\t\t\tuserSelect: none\n\t\t});\n\t}", "function clearSelection()\n{\n if (window.getSelection) {window.getSelection().removeAllRanges();}\n else if (document.selection) {document.selection.empty();}\n}", "function on_select_ponto(feature){\r\n\t\t\tselect_control.unselectAll({except:feature});\r\n\t\t}", "function d(a){o&&(o=!1,n(),k(\"unselect\",null,a))}", "function releaseDottedSelection() {\n\t\tdocument.body.removeChild(document.getElementById(this.id));\n\t}", "clearSelection() {\n if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) {\n this.state.setSelectedKeys(new $cc81f14158b02e1e259a5a46d24f0c$export$Selection());\n }\n }", "reset() {\n this._selection = -1;\n }", "function disableSelect(el) {\n\tel.style.userSelect = 'none'\n\tel.style.webkitUserSelect = 'none' // for Safari on mac and iOS\n\tel.style.mozUserSelect = 'none' // for mobile FF\n\tel.dataset.selectionEnabled = 'false'\n}", "function clearSelection() {\r\n map.deselectCountry();\r\n pc1.deselectLine();\r\n donut.deselectPie();\r\n sp1.deselectDot();\r\n }", "_handleCancelSelection() {\n const { _rows: oldRows, _searchString: searchString } = this;\n this._rows = this._rows.map((row) =>\n searchString && !doesRowMatchSearchString(row, searchString) ? row : { ...row, selected: false }\n );\n this.requestUpdate('_rows', oldRows);\n }", "selectOff()\n {\n this.DOMContainer.style[\"-webkit-user-select\"] = \"none\";\n this.DOMContainer.style[\"-moz-user-select\"] = \"none\";\n this.DOMContainer.style[\"-ms-user-select\"] = \"none\";\n this.DOMContainer.style[\"user-select\"] = \"none\";\n }", "unSelectItem (i) { this.toggSel(false, i); }", "function handleClick(event)\n {\n if($(_consoleSelector)[0].selectionStart <= _eraseLimit || $(_consoleSelector)[0].selectionEnd <= _eraseLimit)\n {\n $(_consoleSelector)[0].selectionStart = _eraseLimit;\n $(_consoleSelector)[0].selectionEnd = _eraseLimit;\n }\t\n }", "function clearPreviousSelection()\n {\n if ($.browser.msie) \n {\n document.selection.empty();\n }\n else\n {\n window.getSelection().removeAllRanges();\n }\n }", "function _corexitOnMouseUp(event) {\r\n\tvar selection = window.getSelection();\r\n\tvar selectedText = selection ? selection.toString() : \"\";\r\n\r\n //unselect\r\n //selection.collapseToStart();\r\n\r\n\t//if (selectedText.length != 0) {\r\n chrome.extension.sendRequest({command : \"sendText\", text : selectedText});\r\n\t//}\r\n \r\n\t//gClickInTextBox = false;\r\n \r\n}", "_clearSelection(skip) {\n this._chips.forEach(chip => {\n if (chip !== skip) {\n chip.deselect();\n }\n });\n }", "_clearSelection(skip) {\n this._chips.forEach(chip => {\n if (chip !== skip) {\n chip.deselect();\n }\n });\n }", "function normalSail()\n{\t\n\tUnselectSails();\n\tnormalSailSelected = true;\n}", "function ClearSelectionListeners() {\n map.off('mousedown');\n map.off('mousemove');\n map.off('mouseup');\n map.off('touchstart');\n map.off('touchmove');\n map.off('touchend');\n map.off('click');\n CancelPathSelection();\n }", "function removeTextSelections() {\n if (document.selection) document.selection.empty();\n else if (window.getSelection) window.getSelection().removeAllRanges();\n}", "cancel() {\n this._inputController.$commandInput.prop('selectionStart', this.initialRange.start);\n this._inputController.$commandInput.prop('selectionEnd', this.initialRange.end);\n this._inputController.$commandInput.focus();\n\n this.initialRange = {};\n this.targetRange = {};\n this.highlighted = null;\n\n this.$autocomplete.removeClass();\n this.active = false;\n }", "clearSelection(){\n this.selected = null\n }", "function selectSwitchOff(){\n\t\t\t\tislteIE9?$('body').on('selectstart.drag',function(){return false;}):$('body').addClass('lightbox-noselect lightbox-onmove');\n\t\t\t}", "function disable() {\n mouse_highlight.destroy();\n}", "_selectStartHandler(event) {\n const that = this;\n\n if (that.isScrolling || that.editing.isEditing) {\n return;\n }\n\n event.preventDefault();\n }", "_selectStartHandler(event) {\n const that = this;\n\n if (that.isScrolling || that.editing.isEditing) {\n return;\n }\n\n event.preventDefault();\n }", "clearSelection() {\n var _a;\n (_a = this._selectionService) === null || _a === void 0 ? void 0 : _a.clearSelection();\n }", "function resetSelection(){\n\t$(\".document-list, #scrapPaperDiv, .scrap-keyword\").find(\"span\").each(function( index ){\n\t\tif($(this).hasClass('ent_highlighted')){\n\t\t\t$(this).removeClass('ent_highlighted');\n\t\t}\n\t\t\n\t\tif($(this).hasClass('highlighted')){\n\t\t\t$(this).parent().unhighlight({className:$(this).text().split(\" \")[0]});\t\t\n\t\t}\n\t});\n\tqueue = [];\n}", "stopLetterSelect(letter) {\n this.isSelecting = false\n\n // Let's check to see if they selected an actual word :)\n if (\n this.firstLetter &&\n this.endLetter &&\n this.firstLetter !== this.endLetter &&\n (this.firstLetter.data.startWord || this.endLetter.data.startWord) &&\n this.checkLetterAlignment(this.endLetter)\n ) {\n var result = this.checkSelectedLetters()\n\n if (result) {\n this.highlightCorrectWord(result)\n this.foundWords.push(result.word)\n }\n\n // Check word list, game won?\n if (this.foundWords.length === this.solution.length) {\n this.gameWon()\n }\n }\n\n this.grid.setAll('frame', 0)\n\n this.clearLine()\n }", "function clearSelection () {\n if (document.selection) {\n document.selection.empty();\n } else if (window.getSelection) {\n window.getSelection().removeAllRanges();\n }\n}", "function removeTextSelection() {\n\n if (window.getSelection) {\n\n window.getSelection().removeAllRanges();\n\n } else if (document.selection) {\n\n document.selection.empty();\n\n }\n\n}", "function unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}", "function unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}", "function clearSelection() {\n if (window.getSelection) {\n if (window.getSelection().empty) { // Chrome\n window.getSelection().empty();\n } else if (window.getSelection().removeAllRanges) { // Firefox\n window.getSelection().removeAllRanges();\n }\n } else if (document.selection) { // IE?\n document.selection.empty();\n }\n }", "function unselectAll() {\n d3.selectAll(\"#synoptic .selection\")\n .remove();\n }", "function setUISelectionClean(element) {\n element[UISelection] = undefined;\n}", "function resetSelectMode( paramDocument ) {\r\n\tisSelectMode = false;\r\n}", "clearSelection() {\n this.currentlySelected = '';\n }", "function unhighlight() {\n d3.select(this).classed('selected', false)\n }", "function ClearTextSelection() {\n\t//console.log('Clear text selection.');\n\tif ( document.selection ) {\n //console.log('document.selection'); \n\t\tdocument.selection.empty();\n\t} else if ( window.getSelection ) {\n\t\t//console.log('window.getSelection');\n\t\twindow.getSelection().removeAllRanges();\n\t}\n} // END ClearTextSelection.", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "clearSelection() {\n this._model.clearSelection();\n this._removeMouseDownListeners();\n this.refresh();\n this._onSelectionChange.fire();\n }", "function unselectAll() {\n resetAllStrokes();\n resetAllBackgrounds();\n selected_robots = [];\n}", "unSelectAll() {\n\n }", "function disablePointSelection(){\r\n\taddPointMode = false;\r\n}", "function selectionRestore() {\n if (savedSelection) {\n rangy.restoreSelection(savedSelection);\n savedSelection = false;\n }\n}", "deselectAll() {\n this._setAllOptionsSelected(false);\n }", "function clearSelections() {\r\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\r\n if (isFirefox) {\r\n document.selection.empty();\r\n } else {\r\n window.getSelection().removeAllRanges();\r\n }\r\n }", "removeSelection() {\n this.simcirWorkspace.removeSelected();\n }", "function unhighlight(event) {\n preventDefaults(event);\n dropArea.classList.remove('highlight');\n }", "deselectBuckets() {\n this.props.deselectBuckets();\n this.props.disableSelectionMode();\n }", "function hideSelection() {\n\t\tdocument.getElementById(SELECTION).style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"overglass\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(SELECTION).style.left = 0;\n\t\tdocument.getElementById(SELECTION).style.top = 0;\n\t\tdocument.getElementById(SELECTION).style.width = 1;\n\t\tdocument.getElementById(SELECTION).style.height = 1;\n\t}", "unfocus() {}", "function handleToggleSelection(e) {\n\t\tif (e.target.classList.contains(\"canva\")) {\n\t\t\tstore.removeSelection();\n\t\t}\n\t}", "function clearSelection() {\n activeSheet.clearSelectedMarksAsync();\n }" ]
[ "0.77113354", "0.77019185", "0.76112133", "0.76112133", "0.75669646", "0.75624", "0.75624", "0.74814135", "0.7242531", "0.71324104", "0.71240115", "0.7076964", "0.7068476", "0.7055007", "0.7053542", "0.70193714", "0.70193714", "0.6969966", "0.69650686", "0.6951705", "0.6950268", "0.6950203", "0.69407403", "0.6937878", "0.6937878", "0.692294", "0.68995774", "0.6896556", "0.684776", "0.68402296", "0.68340266", "0.68146783", "0.67837447", "0.67621595", "0.6759614", "0.6759046", "0.67422", "0.6736767", "0.67055947", "0.67009807", "0.6698213", "0.66752213", "0.6667897", "0.6644135", "0.6639976", "0.66289073", "0.66283596", "0.66273415", "0.6622998", "0.6620592", "0.6619369", "0.6569188", "0.6559602", "0.6542835", "0.6525759", "0.65236044", "0.65070635", "0.64863205", "0.6484839", "0.6484839", "0.6484141", "0.6483691", "0.64818203", "0.64796454", "0.6478622", "0.6469232", "0.64677644", "0.6463254", "0.6463254", "0.64405245", "0.64360374", "0.64342344", "0.6431546", "0.64139766", "0.640577", "0.640577", "0.63983953", "0.6390861", "0.6386098", "0.6372427", "0.6352702", "0.63342845", "0.6333368", "0.6326521", "0.6326521", "0.6326521", "0.63180614", "0.63167334", "0.6316554", "0.6306391", "0.6305724", "0.6298561", "0.6293027", "0.6291082", "0.6284316", "0.6280248", "0.62742203", "0.6260086", "0.6255205", "0.6249332" ]
0.7350849
8
Return the 2D context of current canvas
function getContext() { var canvas = getCanvas(); if (canvas.getContext) { return canvas.getContext("2d"); } else { alert('You need a HTML5 web browser. Any Safari,Firefox, Chrome or Explorer supports this.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getContext() {\n return this.canvas.getContext('2d')\n }", "context() {\n return this._canvas.getContext('2d');\n }", "function prepareContext(canvas) {\n return canvas.getContext(\"2d\");\n}", "getCanvasContext() {\n return this.context;\n }", "get context () {\n\t\treturn {\n\t\t\tbase: this.element.base.getContext('2d'),\n\t\t\tline: this.element.line.getContext('2d'),\n\t\t\tshadow: this.element.shadow.getContext('2d'),\n\t\t\tglow: this.element.glow.getContext('2d'),\n\t\t\tblur: this.element.blur.getContext('2d'),\n\t\t\tcomposite: this.element.composite.getContext('2d')\n\t\t}\n\t}", "function getContext() {\n var canvas = document.createElement('canvas');\n canvas.width = options.tileWidth * options.divX;\n canvas.height = options.tileHeight * options.divY;\n var context = canvas.getContext('2d');\n context.drawImage(options.image, 0, 0, canvas.width, canvas.height);\n return context;\n }", "drawCanvas2D(){\n const canvas2d = this.refs.canvas2d;\n const context2d = canvas2d.getContext('2d');\n if(context2d != null && context2d != 'undefined') {\n this.drawScene2D(context2d);\n }\n }", "function getCanvas() {\r\n var c = document.getElementById(\"grid\");\r\n return c.getContext(\"2d\");\r\n }", "function getContext(width, height) {\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\"width\", width);\n canvas.setAttribute(\"height\", height);\n return canvas.getContext(\"2d\");\n}", "function getContext(el) {\n // The typecasts through `any` are to fool flow.\n var canvas = el;\n var ctx = canvas.getContext('2d');\n return ctx;\n}", "getContext(canvas) {\n\t\tthis.canvas = canvas;\n\n\t\tconst ctxtOpts = this.contextOptions;\n\t\tthis.gl = canvas.getContext(\"webgl2\", ctxtOpts) ||\n\t\t\t\t canvas.getContext(\"webgl\", ctxtOpts);\n\n\t\tthis.gl.cullFace(this.gl.BACK);\n\t\tthis.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n\t}", "function getEdgeyContext(canvas)\r\n{\r\n var ctx = canvas.getContext('2d');\r\n ctx.imageSmoothingEnabled = false;\r\n ctx.webkitImageSmoothingEnabled = false;\r\n ctx.mozImageSmoothingEnabled = false;\r\n ctx.msImageSmoothingEnabled = false;\r\n return ctx;\r\n}", "function getRenderingContext() {\n var canvas = document.querySelector(\"canvas\");\n canvas.width = canvas.clientWidth;\n canvas.height = canvas.clientHeight;\n var gl = canvas.getContext(\"webgl\") || canvas.getContext('experimental-webgl');\n if (!gl) {\n alert(\"Your browser isn't supported!\");\n return null;\n }\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return gl;\n}", "function getSquareCanvasAndContext(length) {\n if (length in canvases) {\n return canvases[length];\n }\n var canvas = document.createElement('canvas'),\n context;\n canvas.width = length;\n canvas.height = length;\n context = canvas.getContext('2d');\n canvases[length] = [canvas, context];\n return canvases[length];\n }", "function capable() {\n return canvas.getContext && canvas.getContext('2d');\n }", "getCanvas() {\n return this.offScreenCanvas ? this.offScreenCanvas : this.canvas;\n }", "function getCanvasAndContext() {\n canvas = document.getElementById('editor');\n ctx = canvas.getContext('2d');\n ctx.imageSmoothingEnabled = false;\n canvas.width = NUM_COLS * BOX_SIDE_LENGTH + 1; // +1 to display border;\n canvas.height = NUM_ROWS * BOX_SIDE_LENGTH + 1;\n}", "function CargaContextoCanvas(idCanvas){\r\n var elemento = idCanvas;\r\n if(elemento && elemento.getContext){\r\n var contexto = elemento.getContext('2d');\r\n if(contexto){\r\n return contexto;\r\n }\r\n }\r\n return false;\r\n}", "_createNewCanvas(){\n\n let canvas = document.createElement('canvas');\n this.game.container.appendChild(canvas);\n canvas.width = this.game.width;\n canvas.height = this.game.height;\n canvas.style.position = 'absolute';\n canvas.style.zIndex = 0;\n\n\n console.log('Width, height', this.width, this.height);\n\n return canvas.getContext('2d');\n\n }", "function getCanvas(ctx) {\n\treturn {\n\t\tgetContext: sinon.stub().throws().withArgs('2d').returns(ctx || {\n\t\t\tfillRect: sinon.spy()\n\t\t}),\n\t\taddEventListener: sinon.stub().throws()\n\t\t\t.withArgs('mousedown')\n\t\t\t.withArgs('mousemove')\n\t\t\t.withArgs('mouseout')\n\t\t\t.withArgs('mouseup')\n\t\t\t.withArgs('dblclick')\n\t};\n}", "function jsHasCtx2D(elem) {return !!elem.getContext;}", "function jsHasCtx2D(elem) {return !!elem.getContext;}", "function jsHasCtx2D(elem) {return !!elem.getContext;}", "getRenderCanvas(){\n\treturn this.little_canvases[this.render_canvas];\n }", "get canvas() {\n if (this.renderMode === 'webgl') {\n return this._webGLCanvas;\n } else if (this.renderMode === 'svg') {\n return this._svgCanvas;\n } else {\n console.error('No canvas for renderMode: ' + this.renderMode);\n }\n }", "function getCanvas() {\n if (console.getConsoleClient() != null)\n return console.getConsoleClient().getCanvas();\n else\n return null;\n }", "function sglGetCanvasContext(canvasID) {\n\t var canvas = document.getElementById(canvasID);\n\t if (!canvas) return null;\n\n\t var gl = canvas.getContext(\"experimental-webgl\");\n\t if (!gl) return null;\n\n\t if (gl.FALSE == undefined) gl.FALSE = 0;\n\t if (gl.TRUE == undefined) gl.TRUE = 1;\n\n\t return gl;\n }", "function getCanvas(name) {\n var canvas = document.getElementById(name);\n var ctx = canvas.getContext(\"2d\");\n\n return ctx;\n}", "createCanvas () {\n this.canvas = document.createElement(\"canvas\");\n this.canvas.width = GAME_WIDTH;\n this.canvas.height = GAME_HEIGHT;\n this.canvas.id = \"canvas\";\n document.querySelector(\"body\").appendChild(this.canvas);\n this.drawingContext = this.canvas.getContext('2d'); \n }", "function prepareCanvas(canvas) {\n\t var frag = doc.createDocumentFragment();\n\t frag.appendChild(canvas);\n\t var gl = util.getWebGLContext(canvas, context.attributes, null);\n\t return gl;\n\t }", "getCanvas() {\n return this.canvas\n }", "createCanvasContext(zIndex){\n let canvas = document.createElement('canvas');\n canvas.width = canvasWidth;\n canvas.height = canvasHeight;\n canvas.style.zIndex = zIndex;\n\n let canvasContainer = document.querySelector('.container');\n canvasContainer.appendChild(canvas);\n\n return canvas.getContext('2d');\n }", "createCanvas() {\n this.canvas = document.createElement('canvas');\n this.canvas.width = this.width * this.resolution;\n this.canvas.height = this.height * this.resolution;\n this.context = this.canvas.getContext('2d');\n }", "get rootCanvas() {}", "function prepareCanvas(canvas) {\n\t var frag = document.createDocumentFragment();\n\t frag.appendChild(canvas);\n\t var gl = util.getWebGLContext(canvas);\n\t return gl;\n\t }", "canvas() {\n return this._canvas;\n }", "function getCanvas() {\n //In case the canvas dimensions are set in CSS...\n let canvas = document.getElementById('canvas');\n canvas.width = canvas.clientWidth;\n canvas.height = canvas.clientHeight;\n return canvas;\n}", "getCanvas() {\n return this.canvas;\n }", "createCanvas(){\n this.myCanvasHolder = document.querySelector(\".myPaint\");\n this.width = this.myCanvasHolder.width = document.querySelector(\".content\").offsetWidth;\n this.height = this.myCanvasHolder.height = window.innerHeight*0.9;\n this.ctx = this.myCanvasHolder.getContext(\"2d\");\n this.ctx.width = this.width;\n this.ctx.height = this.height;\n this.isDrawing = false;\n }", "get canvas() {\n\t\treturn this._canvas;\n\t}", "function windowToCanvas(x, y) {\n var bbox = canvas.getBoundingClientRect();\n return {\n x: x - bbox.left * w / bbox.width,\n y: y - bbox.top * h / bbox.height\n };\n }", "getCanvas() {\n return this.canvas;\n }", "function Context($p) {\n var el = document.createElement('canvas');\n var ctx = el.getContext(\"2d\");\n ctx.font = $p.font;\n return ctx;\n}", "function windowToCanvas(x, y) {\n var bbox = canvas.getBoundingClientRect();\n return {\n x: x - bbox.left * (w / bbox.width),\n y: y - bbox.top * (h / bbox.height)\n };\n }", "function get_context()\n\t{\n\t\treturn os_ctx;\n\t\t//return ctx;\n\t}", "function initContext() {\n\tvar names = [\"experimental-webgl\", \"webkit-3d\", \"moz-webgl\", \"webgl\"];\n\tvar context;\n\n\tvar canvas = document.getElementById('canvas');\n canvas.width = window.innerWidth - 50;\n\tcanvas.height = window.innerHeight;\n\tfor (var x = 0; x < names.length; x++) {\n\t\ttry {\n\t\t\tcontext = canvas.getContext(names[x]);\n\t\t\tif (context) {\n\t\t\t\tbreak; \n\t\t\t}\n\t \t} catch (e) {\n\t\t\tconsole.log(context);\n\t \t}\n\t}\n\treturn context;\n}", "function initializeCanvas() {\n\tcanvas = document.getElementById(\"canvas\");\n\tctx = canvas.getContext(\"2d\");\n}", "function Canvas2D_Singleton() {\r\n this._canvas = null;\r\n this._canvasContext = null;\r\n\r\n /* I define an null variable that will hold a new canvas that I will use to draw sprites and extract their pixel colour data, so I can generate more\r\n precise collisions between sprite game objects */\r\n this._pixelDataAuxCanvas = null;\r\n this._canvasOffset = myLibrary.Vector2.zero;\r\n }", "get context () { return this._gl; }", "function CreateContext(canvasID) {\n var canvas = document.getElementById(canvasID);\n var glContext = canvas.getContext(\"webgl2\");\n\n if(!glContext) {\n console.error(\"WebGL 2 não está disponivel ...\");\n return null;\n }\n\n /*\n Definimos a cor padrão na qual queremos a tela e definimos alguns metodos auxiliares aqui.\n Algumas opções de renderização tambem são definidas aqui\n */\n\n /* Habilita teste de profundidade */\n glContext.enable(glContext.DEPTH_TEST);\n /* Descarta fragmentos com valores menor ou igual ao fragmento atual */\n glContext.depthFunc(glContext.LEQUAL);\n /* Define a função de blending para 1 - alpha e a habilita */\n glContext.blendFunc(glContext.SRC_ALPHA, glContext.ONE_MINUS_SRC_ALPHA);\n glContext.enable( glContext.BLEND );\n\n /* Limpa a tela com a cor padrão */\n glContext.clearColor(1.0, 1.0, 1.0, 1.0);\n\n /* Emcapsulamento de funcionalidade WebGL */\n glContext.setClearColor = function (r, g, b) {\n this.clearColor(r, g, b, 1.0);\n }\n\n glContext.clearScreen = function () {\n this.clear(this.COLOR_BUFFER_BIT | this.DEPTH_BUFFER_BIT);\n }\n\n glContext.setSize = function (w, h) {\n if(w === undefined || h === undefined){\n w = window.innerWidth;\n h = window.innerHeight;\n }\n\n this.canvas.style.width = w + \"px\";\n this.canvas.style.height = h + \"px\";\n this.canvas.width = w\n this.canvas.height = h;\n\n this.viewport(0, 0, w, h);\n }\n\n glContext.createArrayBuffer = function (vextexArray, isStatic) {\n /* Valor default para variavel */\n if(isStatic === undefined) isStatic = true;\n\n var vertexBuffer = this.createBuffer();\n\n this.bindBuffer(this.ARRAY_BUFFER, vertexBuffer);\n this.bufferData(this.ARRAY_BUFFER, vextexArray, isStatic ? this.STATIC_DRAW : this.DYNAMIC_DRAW);\n this.bindBuffer(this.ARRAY_BUFFER, null);\n\n return vertexBuffer;\n }\n\n glContext.createTextureBufferObject = function (img, flipY) {\n var tbo = this.createTexture();\n\n if(flipY == true) {\n this.pixelStorei(this.UNPACK_FLIP_Y_WEBGL, true);\n }\n\n this.bindTexture(this.TEXTURE_2D, tbo);\n this.texImage2D(this.TEXTURE_2D, 0, this.RGBA, this.RGBA, this.UNSIGNED_BYTE, img);\n\n /* Configura opções de filtragem para quando o zoom estiver muito alto */\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_MAG_FILTER, this.LINEAR);\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_MIN_FILTER, this.LINEAR_MIPMAP_NEAREST);\n\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_WRAP_S, this.CLAMP_TO_EDGE);\n this.texParameteri(this.TEXTURE_2D, this.TEXTURE_WRAP_T, this.CLAMP_TO_EDGE);\n\n this.generateMipmap(this.TEXTURE_2D);\n this.bindTexture(this.TEXTURE_2D, null);\n\n if(flipY == true) {\n this.pixelStorei(this.UNPACK_FLIP_Y_WEBGL, false);\n }\n\n return tbo;\n }\n \n glContext.createVertexArrayObjectMesh = function (indices, vertices, uvs) {\n var vao = {drawMode : this.TRIANGLES};\n\n vao.id = this.createVertexArray();\n this.bindVertexArray(vao.id);\n\n if(vertices !== undefined && vertices != null) {\n vao.vertexBuffer = this.createBuffer();\n this.bindBuffer(this.ARRAY_BUFFER, vao.vertexBuffer);\n this.bufferData(this.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n this.enableVertexAttribArray(ATTR_POSITION);\n this.vertexAttribPointer(ATTR_POSITION, 3, this.FLOAT, false, 0, 0);\n\n vao.vertexCount = vertices.length / 3;\n }\n\n if(uvs !== undefined && uvs != null) {\n vao.uvBuffer = this.createBuffer();\n\n this.bindBuffer(this.ARRAY_BUFFER, vao.uvBuffer);\n this.bufferData(this.ARRAY_BUFFER, new Float32Array(uvs), gl.STATIC_DRAW);\n this.enableVertexAttribArray(ATTR_UV);\n this.vertexAttribPointer(ATTR_UV, 2, this.FLOAT, false, 0, 0);\n\n vao.uvCount = uvs.length / 2;\n }\n\n if(indices !== undefined && indices != null) {\n vao.indexBuffer = this.createBuffer();\n\n this.bindBuffer(this.ELEMENT_ARRAY_BUFFER, vao.indexBuffer);\n this.bufferData(this.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n \n vao.indexCount = indices.length;\n }\n\n /*\n Os objetos devem ser desvinculados na ordem reverssa para não sejam removidos os estado do VAO\n */\n \n this.bindVertexArray(null);\n this.bindBuffer(this.ARRAY_BUFFER, null);\n if(indices !== undefined && indices != null)\n this.bindBuffer(this.ELEMENT_ARRAY_BUFFER, null);\n\n return vao;\n }\n\n glContext.bindContext = function () {\n gl = this;\n }\n\n glContext.bindContext();\n glContext.setSize();\n window.addEventListener(\"resize\", function (e) { glContext.setSize() });\n\n return glContext;\n}", "constructor(sourceCanvas, resultCanvas) {\n this.source = sourceCanvas.getContext(\"2d\")\n this.result = resultCanvas.getContext(\"2d\")\n }", "function createCanvas() {\n // console.log(parseInt(pixelByPixel.value));\n selectedFrameData = null;\n selectedFrameData = {};\n layerCount = 0;\n framesArray = [],\n currentFrame = 0,\n playbackRunning = false,\n playbackInterval = null,\n unsavedFrame = false;\n removeListeners();\n resetFrames();\n resetLayers();\n resetSelectionState();\n addDisplayFrame(0);\n setCurrentFrame(0);\n initCanvas(\"2d\", parseInt(pixelByPixel.value));\n}", "function windowToCanvas(canvas, x, y) {\r\n var bbox = canvas.getBoundingClientRect();\r\n\r\n return {\r\n x: x - bbox.left * (canvas.width / bbox.width),\r\n y: y - bbox.top * (canvas.height / bbox.height),\r\n };\r\n}", "drawScene2D(context2d) {\n context2d.clearRect(0, 0, context2d.canvas.width, context2d.canvas.height);\n this.drawAtoms2D(context2d);\n this.drawBonds2D(context2d);\n }", "function ScreenSpaceCanvas2D(scene,settings){var _this=this;BABYLON.Prim2DBase._isCanvasInit=true;_this=_super.call(this,scene,settings)||this;return _this;}", "function getCanvas(){\n return _fabricCanvas;\n }", "get _ctx() {\n\t\tif (this._parentUI != null) {\n\t\t\tlet ret = this._parentUI.ctx;\n\t\t\tret.translate(this._originX, this._originY);\n\t\t\treturn ret;\n\t\t}\n\t}", "function getContext(_, ctx) {\n return ctx;\n}", "function getContext(_, ctx) {\n return ctx;\n}", "static canvas()\n {\n let canvas = document.getElementById('gl-canvas');\n\n canvas.width = 1000;\n canvas.height = 800;\n\n return canvas;\n }", "getContext() {\n return this._context;\n }", "get inCanvas() {return this._p.inCanvas;}", "drawCanvas() {\n\n\t}", "init() {\n const wrapper = document.getElementById('canvasWrapper');\n let newCanvas;\n if (!document.querySelector('canvas')) {\n newCanvas = document.createElement('canvas');\n newCanvas.width = this.width;\n newCanvas.height = this.height;\n newCanvas.setAttribute('id', 'canvas');\n this.context = newCanvas.getContext('2d');\n wrapper.appendChild(newCanvas);\n } else {\n newCanvas = document.getElementById('canvas');\n newCanvas.width = this.width;\n newCanvas.height = this.height;\n this.context = newCanvas.getContext('2d');\n }\n this.style(wrapper);\n }", "function renderCanvas2() {\n\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n}", "get canvas() { return this._.canvas; }", "function windowToCanvas(canvas, x, y){\n\t\tvar bbox = canvas.getBoundingClientRect();\n\t\treturn { x: parseInt(x - bbox.left * (canvas.width / bbox.width), 10),\n\t\t\t\ty: parseInt(y - bbox.top * (canvas.height / bbox.height), 10)\n\t\t};\n\t}", "function createGLContext(canvas) {\r\n var names = [\"webgl\", \"experimental-webgl\"];\r\n var context = null;\r\n for (var i=0; i < names.length; i++) {\r\n try {\r\n context = canvas.getContext(names[i]);\r\n } catch(e) {}\r\n if (context) {\r\n break;\r\n }\r\n }\r\n if (context) {\r\n context.viewportWidth = canvas.width;\r\n context.viewportHeight = canvas.height;\r\n } else {\r\n alert(\"Failed to create WebGL context!\");\r\n }\r\n return context;\r\n}", "createContext() {\n return new GameContext();\n }", "function getContext(_, ctx) {\n return ctx;\n }", "function getContext(_, ctx) {\n return ctx;\n }", "function initPopupCanvas(width, height) {\n const canvas = document.querySelector('canvas');\n canvas.width = width * window.devicePixelRatio;\n canvas.height = height * window.devicePixelRatio;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n\n const ctx = canvas.getContext('2d');\n ctx.scale(window.devicePixelRatio, window.devicePixelRatio);\n return ctx;\n}", "function init2() {\n\t\tcanvas = document.getElementById('canvas2');\n\t\tcanvas.style.width='50%';\n\t\tcanvas.style.height='65%';\n\t\tcanvas.width = canvas.offsetWidth;\n\t\tcanvas.height = canvas.offsetHeight;\n\t\tHEIGHT = canvas.height;\n\t\tWIDTH = canvas.width;\n\t\tctx = canvas.getContext('2d');\n\t\tghostcanvas = document.createElement('canvas');\n\t\tghostcanvas.height = HEIGHT;\n\t\tghostcanvas.width = WIDTH;\n\t\tgctx = ghostcanvas.getContext('2d');\n\t\t\n\t\t//fixes a problem where double clicking causes text to get selected on the canvas\n\t\tcanvas.onselectstart = function () { return false; }\n\t\t\n\t\t// fixes mouse co-ordinate problems when there's a border or padding\n\t\t// see getMouse for more detail\n\t\tif (document.defaultView && document.defaultView.getComputedStyle) {\n\t\tstylePaddingLeft = parseInt(document.defaultView.getComputedStyle(canvas, null)['paddingLeft'], 10) || 0;\n\t\tstylePaddingTop = parseInt(document.defaultView.getComputedStyle(canvas, null)['paddingTop'], 10) || 0;\n\t\tstyleBorderLeft = parseInt(document.defaultView.getComputedStyle(canvas, null)['borderLeftWidth'], 10) || 0;\n\t\tstyleBorderTop = parseInt(document.defaultView.getComputedStyle(canvas, null)['borderTopWidth'], 10) || 0;\n\t\t}\n\t\t\n\t\t// make mainDraw() fire every INTERVAL milliseconds\n\t\tsetInterval(mainDraw, INTERVAL);\n\t\t\n\t\t// set our events. Up and down are for dragging,\n\t\t// double click is for making new boxes\n\t\tcanvas.onmousedown = myDown;\n\t\tcanvas.onmouseup = myUp;\n\t\tcanvas.ondblclick = myDblClick;\n\t\tcanvas.onmousemove = myMove;\n\t\t\n\t\t// set up the selection handle boxes\n\t\tfor (var i = 0; i < 8; i ++) {\n\t\tvar rect = new Box2;\n\t\tselectionHandles.push(rect);\n\t\t}\n\t\t\n\t\t// add custom initialization here:\n\t\n\t\t\n\t\t// add a large green rectangle\n\t\taddRect(260, 70, WIDTH/2, HEIGHT/2, 'rgba(255, 210, 75, 0.7)');\n\t\t\n\t\t// add a green-blue rectangle\n\t\taddRect(240, 120, WIDTH/2, HEIGHT/2, 'rgba(255, 210, 75, 0.7)'); \n\t\t\n\t\t// add a smaller purple rectangle\n\t\t// addRect(45, 60, 25, 25, 'rgba(150,150,250,0.7)');\n\t}", "function setupCanvas(canvasSelector, width = window.innerWidth, height = 250) {\n\tconst canvas = document.querySelector(canvasSelector);\n\tconst ctx = canvas.getContext('2d');\n\t\n\tcanvas.width = canvasWidth = width;\n\tcanvas.height =\tcanvasHeight = height;\n\n\treturn ctx;\n}", "function getAvailableContext(canvas, contextList) {\n if (canvas.getContext) {\n for(var i = 0; i < contextList.length; ++i) {\n try {\n var context = canvas.getContext(contextList[i]);\n if(context != null)\n return context;\n } catch(ex) { }\n }\n }\n return null;\n}", "getContext2DCanvasFromImageData(src,srcRange,param) {\n\t\tconst canvas=document.createElement(\"canvas\");\n\t\tsrcRange=srcRange||src.validArea; // initial: src valid range\n\n\t\tcanvas.width=srcRange.width;\n\t\tcanvas.height=srcRange.height;\n\t\tif(!(srcRange.width&&srcRange.height)) { // the src is empty\n\t\t\treturn canvas; // return directly\n\t\t}\n\n\t\tthis.vramManager.verify(src);\n\t\tconst ctx2d=canvas.getContext(\"2d\"); // Use Context2D mode\n\t\tconst imgData2D=ctx2d.createImageData(canvas.width,canvas.height);\n\t\tconst buffer=this.imageDataFactory.imageDataToUint8(src,srcRange,null,param); // convert src into 8bit RGBA format\n\t\timgData2D.data.set(buffer);\n\t\tctx2d.putImageData(imgData2D,0,0); // put buffer data into canvas\n\t\treturn canvas;\n\t}", "createCanvas(){\n let canvas = document.createElement(\"canvas\");\n canvas.width = this.cellWidth * this.width;\n canvas.height = this.cellHeight * this.height;\n document.querySelector(\"#main\").appendChild(canvas);\n return canvas;\n }", "function rewriteCTXFunctions(){\r\n\t//Add a fullscreen function to the canvas\r\n\tvar prefixes = [\"moz\",\"webkit\",\"o\",\"ms\"];\r\n\tcanvas.matchScreenRes = false;\r\n\t\r\n\tcanvas.enterFullScreen = function(resize){\r\n\t\tif(exists(this.requestFullScreen)){\r\n\t\t\tthis.requestFullScreen();\r\n\t\t}else{\r\n\t\t\tfor(var prefix in prefixes){\r\n\t\t\t\tprefix = prefixes[prefix];\r\n\t\t\t\tif(exists(this[prefix+\"RequestFullScreen\"])){\r\n\t\t\t\t\tthis[prefix+\"RequestFullScreen\"]();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.matchScreenRes = resize;\r\n\t}\r\n\t\r\n\tcanvas.exitFullScreen = function(){\r\n\t\tif(exists(this.cancelFullScreen)){\r\n\t\t\tthis.cancelFullScreen();\r\n\t\t}else{\r\n\t\t\tfor(var prefix in prefixes){\r\n\t\t\t\tprefix = prefixes[prefix];\r\n\t\t\t\tif(exists(canvas[prefix+\"CancelFullScreen\"])){\r\n\t\t\t\t\tcanvas[prefix+\"CancelFullScreen\"]();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcanvas.onFullScreenChange = function(e){\r\n\t\tif(document.webkitIsFullScreen || document.mozFullScreen){\r\n\t\t\tconsole.log(\"enter full\")\r\n\t\t\tif(canvas.matchScreenRes){\r\n\t\t\t\tcanvas.width = screen.width;\r\n\t\t\t\tcanvas.height = screen.height;\r\n\t\t\t}\r\n\t\t\tcanvas.style.width = screen.width+\"px\";\r\n\t\t\tcanvas.style.height = screen.height+\"px\";\r\n\t\t}else{\r\n\t\t\tconsole.log(\"exit full\")\r\n\t\t\tif(exists(canvas.initialWidth)){\r\n\t\t\t\tcanvas.width = canvas.initialWidth;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(exists(canvas.initialHeight)){\r\n\t\t\t\tcanvas.height = canvas.initialHeight;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcanvas.style.width = \"\";\r\n\t\t\tcanvas.style.height = \"\";\r\n\t\t}\r\n\t\taspectRatio = canvas.width/canvas.height;\r\n\t\tctx.viewportWidth = canvas.width;\r\n\t\tctx.viewportHeight = canvas.height;\r\n\t}\r\n\t\r\n\tdocument.addEventListener(\"fullscreenchange\", canvas.onFullScreenChange, false);\r\n\tdocument.addEventListener(\"mozfullscreenchange\", canvas.onFullScreenChange, false);\r\n\tdocument.addEventListener(\"webkitfullscreenchange\", canvas.onFullScreenChange, false);\r\n\t\r\n\t//var ctxProto = ctx.__proto__;\r\n\tvar ctxProto = ctx.constructor.prototype;\r\n\t\r\n\tvar identityMat = mat4.create();\r\n\tmat4.identity(identityMat);\r\n\tctx.save = function(){\r\n\t\tvar tempMat = mat4.create();\r\n\t\tmat4.multiply(tempMat, mvMatrix, identityMat);\r\n\t\tctx.matrix = tempMat;\r\n\t\tmatrixStack.push_back(tempMat);\r\n\t\tif(use2D){\r\n\t\t\tctxProto.save.call(ctx);\r\n\t\t}\r\n\t}\r\n\t\r\n\tctx.restore = function(){\r\n\t\tmvMatrix = matrixStack.pop_back();\r\n\t\tif(use2D){\r\n\t\t\tctxProto.restore.call(ctx);\r\n\t\t}\r\n\t}\r\n\t\r\n\tctx.curDrawPos = new Vector(0,0,0);\r\n\t\r\n\tctx.moveTo = function(x, y){\r\n\t\tif(!use2D){\r\n\t\t\tctx.curDrawPos.x = x;\r\n\t\t\tctx.curDrawPos.y = y;\r\n\t\t}else{\r\n\t\t\treturn ctxProto.moveTo.call(this, x, y);\r\n\t\t}\t\t\r\n\t}\r\n\t\r\n\tvar lineSprite = new Sprite();\r\n\t//lineSprite.image = Textures.load(\"../engine/images/pixel.png\");\r\n\tlineSprite.image = Textures.load(brinePixelData);\r\n\tctx.lineSprite = lineSprite;\r\n\tctx.glLineWidth = 1;\r\n\tctx.lineTo = function(x, y){\r\n\t\tif(!use2D){\r\n\t\t\tvar xDis = x-this.curDrawPos.x;\r\n\t\t\tvar yDis = y-this.curDrawPos.y;\r\n\t\t\tvar length = Math.sqrt(xDis*xDis+yDis*yDis);\r\n\t\t\tvar ang = Math.atan2(yDis, xDis);\r\n\t\t\tthis.lineSprite.x = this.curDrawPos.x;\r\n\t\t\tthis.lineSprite.y = this.curDrawPos.y;\r\n\t\t\tthis.lineSprite.rotation = ang;\r\n\t\t\tthis.lineSprite.width = length;\r\n\t\t\tthis.lineSprite.height = this.glLineWidth;\r\n\t\t\tthis.lineSprite.offsetY = -this.lineSprite.height/2;\r\n\t\t\tthis.lineSprite.transform(this);\r\n\t\t\tthis.lineSprite.draw(this);\r\n\t\t\tthis.lineSprite.unTransform(this);\r\n\t\t\tthis.curDrawPos.x = x;\r\n\t\t\tthis.curDrawPos.y = y;\r\n\t\t}else{\r\n\t\t\treturn ctxProto.lineTo.call(this, x, y);\r\n\t\t}\r\n\t}\r\n\t\r\n\tctx.getMatrix = function(){\r\n\t\treturn this.matrix;\r\n\t}\r\n\t\r\n\tctx.scale = function(x, y){\r\n\t\tx = x == 0 ? 0.0000001 : x;\r\n\t\ty = y == 0 ? 0.0000001 : y;\r\n\t\t\r\n\t\tmat4.scale(mvMatrix, mvMatrix, [x, y, 1.0]);\r\n\t\tif(use2D){\r\n\t\t\treturn ctxProto.scale.call(this, x, y);\r\n\t\t}\r\n\t}\r\n\t\r\n\tctx.rotate = function(angle){\r\n\t\tmat4.rotateZ(mvMatrix, mvMatrix, -angle);\r\n\t\tif(use2D){\r\n\t\t\treturn ctxProto.rotate.call(this, angle);\r\n\t\t}\r\n\t}\r\n\t\r\n\tctx.translate = function(x, y){\r\n\t\tmat4.translate(mvMatrix, mvMatrix, [x*aspectRatio/canvas.width, -y/canvas.height, 0.0]);\r\n\t\tif(use2D){\r\n\t\t\treturn ctxProto.translate.call(this, x, y);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//These 2 still need to be fixed\r\n\tctx.transform = function(a, b, c, d, e, f){\r\n\t\tif(use2D){\r\n\t\t\treturn ctxProto.transform.call(this, a, b, c, d, e, f);\r\n\t\t}\r\n\t}\r\n\t\r\n\tctx.setTransform = function(a, b, c, d, e, f){\r\n\t\tif(use2D){\r\n\t\t\treturn ctxProto.setTransform.call(this, a, b, c, d, e, f);\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(use2D){\r\n\t\t//Buffer for drawing scrolling sprite to\r\n\t\tctx.spriteBuffer = document.createElement(\"canvas\");\r\n\t\tctx.spriteBCTX = ctx.spriteBuffer.getContext(\"2d\");\r\n\t\t//document.body.appendChild(ctx.spriteBuffer);\r\n\t}else{\r\n\t\tctx.currentBuffer = null;\r\n\t\tctx.setBuffer = function(buffer){\r\n\t\t\tctx.currentBuffer = buffer;\r\n\t\t\tthis.bindFramebuffer(this.FRAMEBUFFER, buffer);\r\n\t\t}\r\n\t\t\r\n\t\t//Simplifies binding textures\r\n\t\tctx.bindTexTo = function(texture, uniform, num){\r\n\t\t\tif(exists(texture)){// && exists(uniform)){\r\n\t\t\t\tnum = num ? num : 0;\r\n\t\t\t\tthis.activeTexture(this.TEXTURE0+num);\r\n\t\t\t\tthis.bindTexture(this.TEXTURE_2D, texture);\r\n\t\t\t\tthis.uniform1i(uniform, num);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar oldUseProgram = ctx.useProgram;\r\n\t\tctx.useProgram = function(program){\r\n\t\t\toldUseProgram.call(this, program);\r\n\t\t\tfor(var i = 0; i < 10; i++){\r\n\t\t\t\tif(i < program.attribCount){\r\n\t\t\t\t\tthis.enableVertexAttribArray(i);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.disableVertexAttribArray(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tctx.drawScreenBuffer = function(shader, clearBuffer, width, height, blendFunc){\r\n\t\t\tthis.useProgram(shader);\r\n\t\t\tmat4.identity(mvMatrix);\r\n\t\t\tmat4.scale(mvMatrix, mvMatrix, [aspectRatio, 1, 1.0]);\r\n\t\t\t\r\n\t\t\twidth = width ? width : this.viewportWidth;\r\n\t\t\theight = height ? height : this.viewportHeight;\r\n\t\t\t\r\n\t\t\t//this.viewport(0, 0, this.viewportWidth, this.viewportHeight);\r\n\t\t\tthis.viewport(0, 0, width, height);\r\n\t\t\tif(clearBuffer){\r\n\t\t\t\tthis.clear(this.COLOR_BUFFER_BIT);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblendFunc = blendFunc ? blendFunc : {a:\"ONE\", b:\"ONE_MINUS_SRC_ALPHA\"};\r\n\t\t\t//this.blendFunc(this.ONE, this.ONE_MINUS_SRC_ALPHA); //This might need to be taken out if there is some buffer drawing issue down the line.\r\n\t\t\tthis.blendFuncSeparate(ctx[blendFunc.a], ctx[blendFunc.b], ctx.ONE, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t//this.blendFuncSeparate(ctx.ONE, ctx.ONE_MINUS_SRC_ALPHA, ctx.ONE, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t\r\n\t\t\tthis.bindBuffer(this.ARRAY_BUFFER, spriteVPB);\r\n\t\t\tthis.vertexAttribPointer(shader.aVertexPosition, spriteVPB.itemSize, this.FLOAT, false, 0, 0);\r\n\t\t\t\r\n\t\t\tthis.bindBuffer(this.ARRAY_BUFFER, spriteVTB);\r\n\t\t\tthis.vertexAttribPointer(shader.aTextureCoord, spriteVTB.itemSize, this.FLOAT, false, 0, 0);\r\n\t\t\t\r\n\t\t\tthis.bindBuffer(this.ELEMENT_ARRAY_BUFFER, spriteVIB);\r\n\t\t\tsetMatrixUniforms(shader);\r\n\t\t\tthis.drawElements(this.TRIANGLES, spriteVIB.numItems, this.UNSIGNED_SHORT, 0);\r\n\t\t\t\r\n\t\t\tmat4.identity(mvMatrix);\r\n\t\t\t\r\n\t\t\tthis.blendFunc(this.ONE, this.ONE_MINUS_SRC_ALPHA);\r\n\t\t}\r\n\t\t\r\n\t\tctx.fillRect = function(shader, x, y, width, height, blendFunc){\r\n\t\t\tthis.useProgram(shader);\r\n\t\t\t\r\n\t\t\tmat4.identity(mvMatrix);\r\n\t\t\tmat4.scale(mvMatrix, mvMatrix, [aspectRatio, 1, 1.0]);\r\n\t\t\t\r\n\t\t\twidth = width ? width : this.currentBuffer.width;\r\n\t\t\theight = height ? height : this.currentBuffer.height;\r\n\t\t\t\r\n\t\t\tthis.viewport(x, y, width, height);\r\n\t\t\t\r\n\t\t\tblendFunc = blendFunc ? blendFunc : {a:\"ONE\", b:\"ONE_MINUS_SRC_ALPHA\"};\r\n\t\t\t//this.blendFunc(this.ONE, this.ONE_MINUS_SRC_ALPHA); //This might need to be taken out if there is some buffer drawing issue down the line.\r\n\t\t\tthis.blendFuncSeparate(ctx[blendFunc.a], ctx[blendFunc.b], ctx.ONE, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t//this.blendFuncSeparate(ctx.ONE, ctx.ONE_MINUS_SRC_ALPHA, ctx.ONE, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t\r\n\t\t\tthis.bindBuffer(this.ARRAY_BUFFER, spriteVPB);\r\n\t\t\tthis.vertexAttribPointer(shader.aVertexPosition, spriteVPB.itemSize, this.FLOAT, false, 0, 0);\r\n\t\t\t\r\n\t\t\tthis.bindBuffer(this.ARRAY_BUFFER, spriteVTB);\r\n\t\t\tthis.vertexAttribPointer(shader.aTextureCoord, spriteVTB.itemSize, this.FLOAT, false, 0, 0);\r\n\t\t\t\r\n\t\t\tthis.bindBuffer(this.ELEMENT_ARRAY_BUFFER, spriteVIB);\r\n\t\t\tsetMatrixUniforms(shader);\r\n\t\t\tthis.drawElements(this.TRIANGLES, spriteVIB.numItems, this.UNSIGNED_SHORT, 0);\r\n\t\t\t\r\n\t\t\tmat4.identity(mvMatrix);\r\n\t\t\t\r\n\t\t\tthis.blendFunc(this.ONE, this.ONE_MINUS_SRC_ALPHA);\r\n\t\t}\r\n\t}\r\n\r\n\tctx.alpha = 1.0;\r\n\tvar sPos = [0,0,0];\r\n\tvar verts = new Array();\r\n\tverts.push([0,0,0]);\r\n\tverts.push([0,0,0]);\r\n\tverts.push([0,0,0]);\r\n\tverts.push([0,0,0]);\r\n\tctx.drawSprite = function(sprite, frame){\r\n\t\tvar width = sprite.width;\r\n\t\tvar height = sprite.height;\r\n\t\tvar sWidth = width*sprite.scaleX;\r\n\t\tvar sHeight = height*sprite.scaleY;\r\n\t\t\r\n\t\t/*var sRadius = Math.sqrt(sWidth*sWidth+sHeight*sHeight)/2;\r\n\t\t//var minDis = canvas.radius+sRadius;\r\n\t\tvar minX = canvas.width/2+sRadius;\r\n\t\tvar minY = canvas.height/2+sRadius;\r\n\t\tsPos[0] = 0;\r\n\t\tsPos[1] = 0;\r\n\t\tmat4.multiplyVec3(mvMatrix, sPos);\r\n\t\tvec3.multiply(sPos, [(1/aspectRatio)*canvas.width, -canvas.height, 1]);\r\n\t\t//var dis = vec3.dist(sPos, canvas.pos);\r\n\t\tvar xDis = Math.abs(sPos[0]-canvas.pos[0]);\r\n\t\tvar yDis = Math.abs(sPos[1]-canvas.pos[1]);\r\n\t\t//println(\"min: \"+minDis+\" dis: \"+dis);*/\r\n\t\t\r\n\t\t//if(dis <= minDis){\r\n\t\tif(true){//}!useViewCulling || (xDis <= minX && yDis <= minY)){\r\n\t\t\tvar x = 0;//sprite.offsetX;\r\n\t\t\tvar y = 0;//sprite.offsetY;\r\n\t\t\t\r\n\t\t\tvar image = sprite.image;\r\n\t\t\tframe = frame ? Math.floor(frame) : 0;\r\n\t\t\tvar frameWidth = sprite.frameWidth > 0 ? sprite.frameWidth : image.width;\r\n\t\t\tvar frameHeight = sprite.frameHeight > 0 ? sprite.frameHeight : image.height;\r\n\t\t\tvar multColor = sprite.multColor;\r\n\t\t\t//var alpha = sprite.alpha;\r\n\t\t\tvar alpha = Math.max(0, ctx.alpha);\r\n\t\t\tvar blendMode = sprite.blendMode;\r\n\t\t\t\r\n\t\t\tctx.globalAlpha = alpha;\r\n\t\t\tctx.globalCompositeOperation = blendMode;\r\n\t\t\t\r\n\t\t\tvar renderShader = spriteShader;\r\n\t\t\t\r\n\t\t\t//If we are using webgl this sets a few uniforms and binds the sprite's texture\r\n\t\t\tif(sprite.image.texture != undefined){\r\n\t\t\t\ty = -y;\r\n\t\t\t\t\r\n\t\t\t\t//ctx.blendFunc(ctx[sprite.blendFunction.a], ctx[sprite.blendFunction.b]);\r\n\t\t\t\tctx.blendFuncSeparate(ctx[sprite.blendFunction.a], ctx[sprite.blendFunction.b], ctx.ONE, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t\r\n\t\t\t\tmat4.translate(mvMatrix, mvMatrix, [x*aspectRatio/canvas.width, y/canvas.height, 0.0]);\r\n\t\t\t\t\r\n\t\t\t\t//If the width or height is 0 the changes to the matrix can't be reversed\r\n\t\t\t\twidth = Math.max(0.0000001, width);\r\n\t\t\t\theight = Math.max(0.0000001, height);\r\n\t\t\t\tmat4.scale(mvMatrix, mvMatrix, [width*aspectRatio/canvas.width, height/canvas.height, 1.0]);\r\n\t\t\t\t\r\n\t\t\t\t//renderShader = spriteShader;\r\n\t\t\t\t\r\n\t\t\t\tif(exists(sprite.shader)){\r\n\t\t\t\t\trenderShader = sprite.shader;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tctx.useProgram(renderShader);\r\n\t\t\t\t\r\n\t\t\t\tctx.bindBuffer(ctx.ARRAY_BUFFER, spriteVPB);\r\n\t\t\t\tctx.vertexAttribPointer(renderShader.aVertexPosition, spriteVPB.itemSize, ctx.FLOAT, false, 0, 0);\r\n\t\t\t\t\r\n\t\t\t\tctx.bindBuffer(ctx.ARRAY_BUFFER, spriteVTB);\r\n\t\t\t\tctx.vertexAttribPointer(renderShader.aTextureCoord, spriteVTB.itemSize, ctx.FLOAT, false, 0, 0);\r\n\t\t\t\t\r\n\t\t\t\tctx.activeTexture(ctx.TEXTURE0);\r\n\t\t\t\tctx.bindTexture(ctx.TEXTURE_2D, sprite.image.texture);\r\n\t\t\t\tctx.uniform1i(renderShader.samplerUniform, 0);\r\n\t\t\t\t\r\n\t\t\t\tctx.uniform3f(renderShader.multColor, multColor.r, multColor.g, multColor.b);\r\n\t\t\t\tctx.uniform1f(renderShader.alpha, alpha);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar tilesX = sprite.tilesX;\r\n\t\t\tvar tilesY = sprite.tilesY;\r\n\t\t\tvar tileImage = (tilesX != undefined && tilesY != undefined);\r\n\t\t\t\r\n\t\t\tvar sliceX = Math.min(Math.max(0, sprite.sliceX), frameWidth);\r\n\t\t\tvar sliceY = Math.min(Math.max(0, sprite.sliceY), frameHeight);\r\n\t\t\tvar sliceWidth = sprite.sliceWidth ? Math.max(0, sprite.sliceWidth) : sprite.sliceWidth;\r\n\t\t\tvar sliceHeight = sprite.sliceHeight ? Math.max(0, sprite.sliceHeight) : sprite.sliceHeight;\r\n\t\t\t\r\n\t\t\tvar scrollX = sprite.scrollX%(width/tilesX);\r\n\t\t\tvar scrollY = sprite.scrollY%(height/tilesY);\r\n\t\t\tvar scrollImage = (scrollX != undefined && scrollY != undefined && (scrollX != 0 || scrollY != 0));\r\n\t\t\t\r\n\t\t\t//New consolidated drawing code\r\n\t\t\tvar frameXOff = (frame%(image.width/frameWidth))*frameWidth;\r\n\t\t\tvar frameYOff = Math.floor(frame/(image.width/frameWidth))*frameHeight;\r\n\t\t\t\r\n\t\t\tframeWidth = frameWidth-sliceX;\r\n\t\t\tframeHeight = frameHeight-sliceY;\r\n\t\t\t\r\n\t\t\tframeWidth = sliceWidth ? Math.min(frameWidth, sliceWidth) : frameWidth;\r\n\t\t\tframeHeight = sliceHeight ? Math.min(frameHeight, sliceHeight) : frameHeight;\r\n\t\t\t\r\n\t\t\t//Add Slice offsets\r\n\t\t\tframeXOff += sliceX;\r\n\t\t\tframeYOff += sliceY;\r\n\t\t\t\r\n\t\t\t//2D drawing\r\n\t\t\tif(use2D){\r\n\t\t\t\tvar tilesXcale = 1/tilesX;\r\n\t\t\t\tvar tilesYcale = 1/tilesY;\r\n\t\t\t\tif(scrollImage){\r\n\t\t\t\t\tscrollX /= tilesXcale;\r\n\t\t\t\t\tscrollY /= tilesYcale;\r\n\t\t\t\t\tscrollX = scrollX%width;\r\n\t\t\t\t\tscrollY = scrollY%height;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//scrollX = -scrollX;\r\n\t\t\t\t\tscrollY = -scrollY;\r\n\t\t\t\t\tif(scrollX < 0){\r\n\t\t\t\t\t\tscrollX = width+scrollX;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(scrollY < 0){\r\n\t\t\t\t\t\tscrollY = height+scrollY;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tadscrollX = (scrollX/width)*frameWidth;\r\n\t\t\t\t\tadscrollY = (scrollY/height)*frameHeight;\r\n\t\t\t\t\tvar q0Width = frameWidth-adscrollX;\r\n\t\t\t\t\tvar q0Height = frameHeight-adscrollY;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar q1Width = frameWidth-q0Width;\r\n\t\t\t\t\tvar q1Height = q0Height;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar q2Width = q1Width;\r\n\t\t\t\t\tvar q2Height = frameHeight-q0Height;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar q3Width = q0Width;\r\n\t\t\t\t\tvar q3Height = q2Height;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.spriteBuffer.width = width;\r\n\t\t\t\t\tthis.spriteBuffer.height = height;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Draw to this buffer so we can tile the sprite lots without having to draw it four times for each tile to get the scrolling effect\r\n\t\t\t\t\t/*this.spriteBCTX.drawImage(image, frameXOff+adscrollX, frameYOff+adscrollY, q0Width, q0Height, x, y, (q0Width/frameWidth)*width, (q0Height/frameHeight)*height);\r\n\t\t\t\t\tthis.spriteBCTX.drawImage(image, frameXOff, frameYOff+adscrollY, q1Width, q1Height, (x+(width-scrollX)), y, (q1Width/frameWidth)*width, (q1Height/frameHeight)*height);\r\n\t\t\t\t\tthis.spriteBCTX.drawImage(image, frameXOff, frameYOff, q2Width, q2Height, (x+(width-scrollX)), (y+(height-scrollY)), (q2Width/frameWidth)*width, (q2Height/frameHeight)*height);\r\n\t\t\t\t\tthis.spriteBCTX.drawImage(image, frameXOff+adscrollX, frameYOff, q3Width, q3Height, x, (y+(height-scrollY)), (q3Width/frameWidth)*width, (q3Height/frameHeight)*height);*/\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(q0Width > 0 && q0Height > 0){\r\n\t\t\t\t\t\tthis.spriteBCTX.drawImage(image, frameXOff+adscrollX, frameYOff+adscrollY, q0Width, q0Height, 0, 0, (q0Width/frameWidth)*width, (q0Height/frameHeight)*height);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(q1Width > 0 && q1Height > 0){\r\n\t\t\t\t\t\tthis.spriteBCTX.drawImage(image, frameXOff, frameYOff+adscrollY, q1Width, q1Height, (0+(width-scrollX)), 0, (q1Width/frameWidth)*width, (q1Height/frameHeight)*height);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(q2Width > 0 && q2Height > 0){\r\n\t\t\t\t\t\tthis.spriteBCTX.drawImage(image, frameXOff, frameYOff, q2Width, q2Height, (0+(width-scrollX)), (0+(height-scrollY)), (q2Width/frameWidth)*width, (q2Height/frameHeight)*height);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(q3Width > 0 && q3Height > 0){\r\n\t\t\t\t\t\tthis.spriteBCTX.drawImage(image, frameXOff+adscrollX, frameYOff, q3Width, q3Height, 0, (0+(height-scrollY)), (q3Width/frameWidth)*width, (q3Height/frameHeight)*height);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Set the current image (not the sprite's) to the buffer we just drew to\r\n\t\t\t\t\timage = this.spriteBuffer;\r\n\t\t\t\t\r\n\t\t\t\t\t//Reset everything to fit the buffer's dimensions\r\n\t\t\t\t\tframeXOff = 0;\r\n\t\t\t\t\tframeYOff = 0;\r\n\t\t\t\t\tframeWidth = width;\r\n\t\t\t\t\tframeHeight = height;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar xOff = 0;\r\n\t\t\t\tvar yOff = 0;\r\n\t\t\t\t\r\n\t\t\t\t//Tile image (or don't)\r\n\t\t\t\tfor(var i = 0; i < tilesX; i++){\r\n\t\t\t\t\tfor(var j = 0; j < tilesY; j++){\r\n\t\t\t\t\t\tthis.drawImage(image, frameXOff, frameYOff, frameWidth, frameHeight, x+xOff, y+yOff, width*tilesXcale, height*tilesYcale);\r\n\t\t\t\t\t\tyOff += height*tilesYcale;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tyOff = 0;\r\n\t\t\t\t\txOff += width*tilesXcale;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tctx.useProgram(renderShader);\r\n\t\t\t\tctx.uniform2f(renderShader.frameOffset, frameXOff/image.width, frameYOff/image.height);\r\n\t\t\t\tctx.uniform2f(renderShader.frameDims, frameWidth/image.width, frameHeight/image.height);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!use2D){\r\n\t\t\t\tif(tileImage){\r\n\t\t\t\t\tctx.uniform2f(renderShader.tiles, sprite.tilesX, sprite.tilesY);\r\n\t\t\t\t}\r\n\t\t\t\tif(scrollImage){\r\n\t\t\t\t\tctx.uniform2f(renderShader.scroll, scrollX/width, scrollY/height);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//WebGL drawing\r\n\t\t\tif(sprite.image.texture != undefined){\r\n\t\t\t\tctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, spriteVIB);\r\n\t\t\t\tsetMatrixUniforms(renderShader);\r\n\t\t\t\tctx.drawElements(ctx.TRIANGLES, spriteVIB.numItems, ctx.UNSIGNED_SHORT, 0);\r\n\t\t\t\t\r\n\t\t\t\tmat4.scale(mvMatrix, mvMatrix, [1/(width*aspectRatio/canvas.width), 1/(height/canvas.height), 1.0]);\r\n\t\t\t\tmat4.translate(mvMatrix, mvMatrix, [-x*aspectRatio/canvas.width, -y/canvas.height, 0.0]);\r\n\t\t\t\t\r\n\t\t\t\tctx.uniform2f(renderShader.frameOffset, 0, 0);\r\n\t\t\t\tctx.uniform2f(renderShader.frameDims, 1, 1);\r\n\t\t\t\tctx.uniform2f(renderShader.tiles, 1, 1);\r\n\t\t\t\tctx.uniform2f(renderShader.scroll, 0, 0);\r\n\t\t\t\t\r\n\t\t\t\tctx.uniform3f(renderShader.multColor, 1, 1, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tctx.globalAlpha = 1.0;\r\n\t\t\tctx.globalCompositeOperation = \"source-over\";\r\n\t\t}else{\r\n\t\t\t//println(\"Sprite failed broad sweep.\");\r\n\t\t}\r\n\t}\r\n}", "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i = 0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch (e) { }\n if (context) {\n break;\n } \n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i=0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch(e) {}\n if (context) {\n break;\n }\n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "function renderToCanvas(_x, _x2) {\n return _renderToCanvas.apply(this, arguments);\n}", "function createGLContext(canvas) {\n var context = canvas.getContext(\"webgl\");\n if (!context) {\n alert(\"Unable to initialize WebGL.\");\n return;\n }\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n return context;\n}", "draw(ctx){\n ctx.save();\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.restore();\n }", "function Canvas2dFilterBackend() {}", "function createGLContext(canvas) {\r\n\tvar names = [\"webgl\", \"experimental-webgl\"];\r\n\tvar context = null;\r\n\tfor (var i = 0; i < names.length; i++) {\r\n\t\ttry {\r\n\t\t\tcontext = canvas.getContext(names[i]);\r\n\t\t} catch(e) {}\r\n\t\tif (context) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif (context) {\r\n\t\tcontext.viewportWidth = canvas. width;\r\n\t\tcontext.viewportHeight = canvas.height;\r\n\t} else {\r\n\t\talert(\"Failed to create WebGL context!\");\r\n\t}\r\n\treturn context;\r\n}", "function initCanvas()\n {\n \t// Use the document object to create a new element canvas.\n \tvar canvas = document.createElement('canvas');\n \t// Assign the canvas an id so we can reference it elsewhere.\n \tcanvas.id = 'mycanvas';\n \tcanvas.width = window.innerWidth;\n \tcanvas.height = window.innerHeight;\n \t// We want this to be a 2D canvas.\n \tvar ctx = canvas.getContext(\"2d\");\n \t// Adds the canvas element to the document.\n \tdocument.body.appendChild(canvas);\n\n \twindow.addEventListener(\"keydown\", function(e) {\n // Space and arrow keys\n if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {\n e.preventDefault();\n }\n }, false);\n\n return canvas;\n }", "set canvas(c){\n this._canvas = c ;\n if (c){\n this._context = c.getContext('2d') ;\n }\n }", "canvasApp() {\n this.context = this.canvas.getContext(\"2d\");\n this.videoLoop();\n }", "function getTestCanvas() {\n\n var testCanvas\n\n if (isBrowser) {\n testCanvas = document.createElement('canvas')\n testCanvas.width = testCanvas.height = 1\n } else\n testCanvas = canvas\n\n return testCanvas\n }", "getContext() {\n return this.context;\n }", "getContext() {\n return this.context;\n }", "onAdd () {\n var canvas = document.createElement('canvas')\n canvas.width = this._size\n canvas.height = this._size\n this.context = canvas.getContext('2d')\n }", "function getContext(state, settings, metrics, fps) {\n\tconst rect = settings.element.getBoundingClientRect()\n\tconst cols = settings.cols || Math.floor(rect.width / metrics.cellWidth)\n\tconst rows = settings.rows || Math.floor(rect.height / metrics.lineHeight)\n\treturn Object.freeze({\n\t\tframe : state.frame,\n\t\ttime : state.time,\n\t\tcols,\n\t\trows,\n\t\tmetrics,\n\t\twidth : rect.width,\n\t\theight : rect.height,\n\t\tsettings,\n\t\t// Runtime & debug data\n\t\truntime : Object.freeze({\n\t\t\tcycle : state.cycle,\n\t\t\tfps : fps.fps\n\t\t\t// updatedRowNum\n\t\t})\n\t})\n}", "function Camera2dCanvasContextBuilder(camera) {\n this._camera = camera;\n this._canvasCenter = this._camera.Position.Clone();\n this._translated = false;\n this._translationState = [];\n this._translationState.push(this._translated);\n }", "draw(context) {\n //TO-DO\n }", "function createCanvas(width, height) {\n var canvasWidth = width,\n canvasHeight = height,\n element, context, devicePixelRatio;\n \n // When there is a high-def (retina) display,\n // we'll size our canvas larger, and draw with a scaled transform.\n // This means that we draw in high def coords - the graphics system\n // will just blast those high-def pixes to the screen. This gives\n // more detail / better anti-aliasing.\n \n devicePixelRatio = window.devicePixelRatio;\n if (devicePixelRatio) {\n canvasWidth *= devicePixelRatio;\n canvasHeight *= devicePixelRatio;\n }\n \n element = $(\"<canvas width=\" + canvasWidth + \" height=\"\n + canvasHeight + \"></canvas>\");\n \n context = element[0].getContext && element[0].getContext('2d');\n \n if( !context) {\n return null;\n }\n \n // Line dash polyfill. Just a no-op where not supported.\n // cf. http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/#dash-list\n if( !context.setLineDash) {\n context.setLineDash = function(segments) {\n };\n context.getLineDash = function() {\n return( [ ]);\n };\n }\n \n if (devicePixelRatio) {\n context.scale(devicePixelRatio, devicePixelRatio);\n }\n \n return {\n 'canvas': element,\n 'context': context,\n 'width': canvasWidth,\n 'height': canvasHeight\n };\n }", "initCanvas() { \n\t\tthis.canvas = document.getElementById(\"canvas\");\n\t\tthis.canvas.width = this.level.getNumBlocksRow * Block.SIZE + (2 * Sprite.SIDE_LR_WIDTH);\n\t\tthis.canvas.height = this.level.getNumBlocksColumn * Block.SIZE + (3 * Sprite.SIDE_TMD_HEIGHT) + Sprite.PANEL_HEIGHT;\n\t\tthis.ctx = this.canvas.getContext(\"2d\");\t\n\t}", "resizeCanvas() {\n this.canvas.width = window.innerWidth;\n this.canvas.height = window.innerHeight;\n this.cx = this.ctx.canvas.width / 2;\n this.cy = this.ctx.canvas.height / 2;\n }", "function initCanvas()\n{\n const canvas = document.getElementById('canvas');\n const ctx = canvas.getContext('2d');\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n const imageData = ctx.getImageData(0,0,1,1);\n\n}", "function initializeContext(ctx) {\n ctx.lineWidth = 10;\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n \n $(\"#mainCanvas\").mousemove(function(event) {\n if (canvasPressed) {\n pointsArray.push({x: event.clientX - canvasPos.left, y: event.clientY - canvasPos.top});\n \n ctx.beginPath();\n ctx.moveTo(pointsArray[0].x, pointsArray[0].y);\n for (var i = 1; i < pointsArray.length; i++) {\n ctx.lineTo(pointsArray[i].x, pointsArray[i].y);\n }\n ctx.stroke();\n }\n });\n \n}" ]
[ "0.81116736", "0.81082594", "0.75677204", "0.7149171", "0.7088059", "0.70335317", "0.70081115", "0.69081634", "0.6897757", "0.6784827", "0.66006917", "0.6575543", "0.64601415", "0.64438176", "0.6422603", "0.6354508", "0.6305635", "0.6290805", "0.629079", "0.6238226", "0.6192148", "0.6192148", "0.6192148", "0.61750627", "0.61723113", "0.612881", "0.6127969", "0.6062117", "0.6052736", "0.6043154", "0.60201496", "0.6004369", "0.6001582", "0.5996046", "0.5968205", "0.5963206", "0.5960308", "0.5944345", "0.5926787", "0.5904744", "0.5899696", "0.5896405", "0.5894264", "0.58824813", "0.5876792", "0.5853342", "0.58409923", "0.5816428", "0.581314", "0.5809822", "0.58095497", "0.58036554", "0.57864875", "0.57861805", "0.57838815", "0.5764535", "0.57589054", "0.5758605", "0.5758605", "0.5745021", "0.57332706", "0.5732575", "0.572446", "0.5718742", "0.5698938", "0.56839633", "0.5682917", "0.5674766", "0.56736904", "0.56728935", "0.56728935", "0.56695765", "0.5663869", "0.56609154", "0.56580985", "0.56532466", "0.56524044", "0.5647289", "0.56407285", "0.56400883", "0.56257933", "0.56100166", "0.56050277", "0.56038344", "0.5601146", "0.5599762", "0.55990815", "0.55964977", "0.55904317", "0.5589401", "0.5589401", "0.55817944", "0.55747914", "0.5565753", "0.5557377", "0.55528206", "0.55523455", "0.5545296", "0.55263686", "0.5513459" ]
0.69390506
7
Setup the editor panel for a special shape.
function setUpEditPanel(shape) { //var propertiesPanel = canvas.edit; //access the edit div var propertiesPanel = document.getElementById("edit"); propertiesPanel.innerHTML = ""; if (shape == null) { //do nothing } else { switch (shape.oType) { case 'Group': //do nothing. We do not want to offer this to groups break; case 'Container': Builder.constructPropertiesPanel(propertiesPanel, shape); break; case 'CanvasProps': Builder.constructCanvasPropertiesPanel(propertiesPanel, shape); break; default: //both Figure and Connector Builder.constructPropertiesPanel(propertiesPanel, shape); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addEditor() {\n // Create new editor\n this.editor = $(`\n <div id=\"${this.id}-Editor\" class=\"editCell\">\n <div class=\"editHeader\">\n <p class=\"editHeaderTitle\">${this.id} Editor</p>\n </div>\n <div class=\"editOptionTable\">\n </div>\n </div>\n `);\n propertyEditor.append(this.editor[0]);\n\n // When working within an editor hilight the relevant shape\n this.editor.on(\"mouseenter\", () => {\n this.hover = true;\n canvas.redrawCanvas();\n });\n this.editor.on(\"mouseleave\", () => {\n this.hover = false;\n canvas.redrawCanvas();\n });\n\n // Add button for deleting a shape off of the canvas\n $(`<button class=\"editHeaderButton\">Delete Shape</button>`)\n .on(\"click\", () => canvas.removeShape(this))\n .appendTo(`div#${this.id}-Editor .editHeader`);\n\n // Fill the editor with options relevant to the shape\n this.refillOptions();\n }", "function setupPanel() {\n // calculate client rect\n opts['panel-before']['clientRect'] = opts['panel-before'][0].getBoundingClientRect();\n opts['panel-after']['clientRect'] = opts['panel-after'][0].getBoundingClientRect();\n pEl['clientRect'] = pEl[0].getBoundingClientRect();\n\n // calculate width/height value of prev, and next sibling node\n opts.panelBeforeSize = opts['panel-before']['clientRect'][opts.size];\n opts.panelAfterSize = opts['panel-after']['clientRect'][opts.size];\n\n opts.elSize = el[0].getBoundingClientRect()[opts.size];\n\n // total width or height for splitter's container node\n setContainerSize(opts.panelBeforeSize + opts.panelAfterSize);\n\n // parent element\n pEl.css(opts.size, pEl['clientRect'][opts.size])\n .attr(opts['namespace'], opts['namespace']);\n }", "function initEditor(node) {\n node = damas.read(node._id);\n if (!document.querySelector('#panelSecond')) {\n compEditor(createPanel(document.body), node);\n }\n else {\n compEditor(document.querySelector('#panelContent'), node);\n }\n }", "function new_shape(editor) {\n var side = document.getElementById('sidebarContainer');\n side.style.display = 'block';\n show_sidebar(side, editor);\n}", "function Editor( el ) {\n \n var self = this;\n this.el = el;\n this.ui = {};\n\n this.init = function() {\n\n self.ui.canvas = $('<div id=\"canvas\" />').appendTo( self.el );\n self.ui.panel = $('<div id=\"panel\" />').appendTo( self.el );\n self.ui.palette = $('<div id=\"palette\" />').appendTo( self.el );\n\n self.ui.paper = false;\n self.boxes = new Boxes({panel: self.ui.panel, paper: self.ui.paper});\n\n $(window).bind('resize', function() {\n if ( self.resize_timer) {\n clearTimeout( self.resize_timer);\n }\n self.resize_timer = setTimeout(self.resize, 100);\n });\n \n self.resize_timer = false;\n setTimeout(self.resize, 10);\n \n for ( var i = 3; i--; i > 0 ) {\n $('<div class=\"box new\" />').appendTo( self.ui.palette );\n }\n\n $(\"#palette .box\").draggable({ \n stack: '.box',\n revert: 'invalid',\n revertDuration: 250,\n appendTo: self.ui.panel,\n opacity: 0.5,\n start: function ( event, ui ) {\n self.disableMove = true;\n },\n helper: 'clone'\n });\n\n self.ui.panel.droppable({ \n accept: function(e) {\n if ( $(e).hasClass('box') ) {\n return true;\n }\n return false;\n },\n drop: function(event, ui) {\n if ( ui.helper.hasClass('new') ) {\n var x = ui.helper.offset().left - self.ui.panel.offset().left;\n var y = ui.helper.offset().top - self.ui.panel.offset().top;\n self.boxes.add({x:x, y:y});\n }\n }\n });\n\n };\n\n this.resize = function () {\n var w = $(window).width();\n var h = $(window).height();\n self.ui.palette.css({ 'width': w-16 });\n var t = self.ui.palette.height() + 16;\n self.ui.canvas.css({ 'top': t, 'width': w-16, 'height': h-t-8 });\n self.ui.panel.css({ 'top': t, 'width': w-16, 'height': h-t-8 });\n self.render();\n };\n\n this.render = function () {\n var rz = 16;\n var w = self.ui.canvas.width();\n var h = self.ui.canvas.height();\n self.ui.canvas.html('');\n self.ui.paper = Raphael( 'canvas', w, h );\n self.ui.paper.clear();\n self.ui.paper.drawGrid( rz/2, rz/2, w - rz, h - rz, (w-rz)/rz, (h-rz)/rz, \"#ccc\");\n self.boxes.paper = self.ui.paper; \n\n };\n\n self.init();\n self.render();\n\n\n}", "_initShape () {\n // Set default style for shaape\n if (!this.handlePointStyle) {\n this.handlePointStyle = HANDLE_POINT_STYLE\n }\n if (!this.shapeStyle) {\n this.shapeStyle = EDIT_SHAPE_STYLE\n }\n }", "function initEditor() {\n renderWorkingLine();\n renderTextInput();\n renderFontColorPicker();\n renderFontSize();\n toggleStrokeBtn();\n renderStrokeColorPicker();\n renderStrokeSize();\n renderStickers();\n}", "addCustomizableElementsPanel() {\n\t\tconst x = 680;\n\t\tconst y = 309;\n\n\t\tconst charBackground = this.game.add.image(x + 28, y + 27, 'character_preview');\n\t\tcharBackground.height = 220;\n\t\tcharBackground.width = 190;\n\n\t\tthis.addPanelElement('Body Type', 'Left', 0, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Body_A_Down2.png'), 'body');\n\t\tthis.addPanelElement('Hairstyle', 'Left', 1, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_HairStyle_A_Down2.png'), 'hairstyle');\n\t\tthis.addPanelElement('Facial Hair', 'Left', 2, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FacialHair_A_Down2.png'), 'facialhair');\n\t\tthis.addPanelElement('Upper Body', 'Left', 3, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_UpperBody_A_Down2.png'), 'upperbody');\n\t\tthis.addPanelElement('Lower Body', 'Left', 4, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_LowerBody_A_Down2.png'), 'lowerbody');\n\t\tthis.addPanelElement('Headwear', '', 0, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_HeadWear_A_Down2.png'), 'headwear');\n\t\tthis.addPanelElement('Facewear', '', 1, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FaceWear_A_Down2.png'), 'facewear');\n\t\tthis.addPanelElement('Hands/Arms', '', 2, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Hands_A_Down2.png'), 'hands');\n\t\tthis.addPanelElement('Footwear', '', 3, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_FootWear_A_Down2.png'), 'footwear');\n\t\tthis.addPanelElement('Weapon', '', 4, new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_Weapon_A_Down_RightHanded2.png'), 'weapon');\n\t\tthis.addEyeColorModifiers(new Piece(this.game, null, null, null, x, y, 'Large_Feminine_OverWorld_EyeColour_A_Down2.png'), 'eyecolour');\n\n\t\tthis.addTurnCharacter();\n\n\t\tthis.characterShuffle();\n\t}", "register(editor){\n super.register(editor);\n\n let getActive = function(){\n return editor.$editable.find('.grapple-image.active');\n };\n\n let updatePanelPosition = ($image) =>{\n let $panel = this.$panel;\n $panel.css($image.offset()).outerWidth($image.width());\n if($panel.offset().left + $panel.outerWidth() > editor.$editable.width()){\n $panel.css('left', editor.$editable.width() - $panel.outerWidth());\n }\n\n return $panel;\n };\n\n let helperGetSizeClass = (current_class, is_increase) =>{\n let arr_ordered_classes = [\n \"size-ico\",\n \"size-xs\",\n \"size-sm\",\n \"size-md\",\n \"size-lg\",\n \"size-full\"\n ];\n\n let current_index = arr_ordered_classes.indexOf(current_class);\n let new_index = current_index;\n\n if (is_increase){\n if (current_index < arr_ordered_classes.length - 1)\n new_index = current_index + 1;\n }else{\n if (current_index > 0)\n new_index = current_index - 1;\n }\n\n return arr_ordered_classes[new_index];\n };\n\n $(editor.doc).on('click', (evt) =>{\n let $target = $(evt.target);\n\n getActive().removeClass('active');\n\n if($target.hasClass('grapple-image')) {\n $target.addClass('active');\n updatePanelPosition($target).addClass('active');\n\n } else {\n this.$panel.removeClass('active');\n }\n });\n\n $(editor.doc).on('drop', function(){\n updatePanelPosition(getActive());\n });\n\n this.$panel = $('<ul class=\"image-pane\">' +\n '<li class=\"align align-left\" data-class=\"align-left\"></li>' +\n '<li class=\"align align-center\" data-class=\"align-center\"></li>' +\n '<li class=\"align align-right\" data-class=\"align-right\"></li>' +\n '<li class=\"size size-decrease\" data-type=\"decrease\"></li>' +\n '<li class=\"size size-increase\" data-type=\"increase\"></li>' +\n '<li class=\"remove\"></li></ul>')\n .prependTo(editor.doc.body);\n\n this.$panel.on('click', 'li.remove', (evt) =>{\n evt.stopPropagation();\n\n getActive().remove();\n this.$panel.removeClass('active');\n editor.checkChange();\n });\n\n this.$panel.on('click', 'li.align', (evt) =>{\n let $active = getActive();\n evt.stopPropagation();\n\n $active.removeClass('align-left align-right align-center').addClass(evt.target.getAttribute('data-class'));\n editor.checkChange();\n updatePanelPosition($active);\n });\n\n this.$panel.on('click', 'li.size', (evt) =>{\n let $active = getActive();\n evt.stopPropagation();\n\n let action_type = evt.target.getAttribute('data-type');\n let current_class = $active.attr('data-size');\n let new_class = helperGetSizeClass(current_class, (action_type==\"increase\"));\n \n $active.removeClass('size-ico size-xs size-sm size-md size-lg size-full').addClass(new_class);\n $active.attr('data-size', new_class);\n\n editor.checkChange();\n editor.updateHeight();\n updatePanelPosition($active);\n });\n }", "initEditor() {\n let savedCode = this.service.getCode(this.currentExo.method);\n if (savedCode)\n this.editor.setValue(savedCode);\n\n byId('editor').style.height = this.editorHeight + 'px';\n this.editor.resize();\n }", "function initializePipelineEditor() {\n pipelineGraphEditor = new GraphEditor($('#pipelineDesigner'),\n createStep,\n handleElementRemove,\n null,\n null,\n function(metaData) {\n // Open the drawer\n loadPropertiesPanel(metaData);\n $('#step-editor-drawer').drawer('show');\n });\n\n // Pipeline Designer\n $('#save-button').click(handleSave);\n $('#new-button').click(handleNew);\n $('#copy-button').click(handleCopy);\n $('#reset-button').click(handleReset);\n $('#delete-button').click(handleDelete);\n $('#layout-pipeline-button').click(function() {\n pipelineGraphEditor.performAutoLayout();\n });\n}", "function LGraphGUIPanel()\r\n\t{\r\n\t\tthis.addOutput(\"pos\",\"vec2\");\r\n\t\tthis.addOutput(\"enabled\",\"boolean\");\r\n\t\tthis.properties = { enabled: true, draggable: false, title: \"\", color: [0.1,0.1,0.1], opacity: 0.7, titlecolor: [0,0,0], position: [10,10], size: [300,200], rounding: 8, corner: LiteGraph.CORNER_TOP_LEFT };\r\n\t\tthis._area = vec4.create();\r\n\t\tthis._color = vec4.create();\r\n\t\tthis._titlecolor = vec4.create();\r\n\t\tthis._offset = [0,0];\r\n\t}", "function setupEditor() {\n\tif (!ITTY || !ITTY.editor || !ITTY.editor.ids || typeof ITTY.editor.ids != \"object\") {\n\t\treturn;\n\t}\n\tvar oInputPane = document.getElementById(ITTY.editor.ids.textinput) || document.getElementById(\"ittyMarkdownInput\");\n\tvar oOutputPane = document.getElementById(ITTY.editor.ids.xhtmloutput) || document.getElementById(\"ittyXhtmlOutput\");\n\tvar oCodeInputPane = document.getElementById(ITTY.editor.ids.xhtmlinput) || document.getElementById(\"ittyXhtmlInput\");\n\tvar oLeftContainer = document.getElementById(ITTY.editor.ids.editordiv) || document.getElementById(\"ittyEditor\");\n\tvar oInfoContainer = document.getElementById(ITTY.editor.ids.infodiv) || document.getElementById(\"ittyfooter\");\n\t\n\t/* oPreviewPaneContainer is optional and not particularly desirable! \n\t Don't set unless you want side by side and accomodate it in your CSS.\n\t When not set, the preview goes below the TA, just after the footer/info. --fac \n\t*/\t \n\tvar oPreviewPaneContainer = document.getElementById(ITTY.editor.ids.previewcontainer);\n\tif (oPreviewPaneContainer) {\n\t\toPreviewPaneContainer.className = ITTY.editor.ids.previewcontainerclass || \"\";\n\t} // define the preview pane if you want, otherwise it's appended below the editor\n\t\n\tif (!oInputPane || !oOutputPane || !oCodeInputPane || !oLeftContainer) {\n\t\treturn;\n\t} //check for presence of required\n\t\n\tvar oContainer = document.createElement(\"div\");\n\t\n\tvar oToolbar = ITTY.editor.toolbar.make(oInputPane);\n\t\t/* make a toolbar object: Arguments\n\t\t[0] oInputPane (object): the input textarea element*/\n\t\n\tif (!oToolbar) {return;}\n\t\n\tif (oContainer.appendChild(oToolbar.toolset)) {\n\t\toContainer.setAttribute('class', 'ittyToolbar');\n\t\t\t// matches internal expectations of ittyToolbar's className\n\t\t\n\t\tif (oInputPane.parentNode.insertBefore(oContainer,oInputPane)) {\n\t\t\t// put the toolbar above the input pane\t\n\t\n\t\t\toLogo = document.createElement(\"span\");\n\t\t\tvar tlogoSpace = (ITTY.editor.ids.logotitle && document.createTextNode(ITTY.editor.ids.logotitle)) || document.createTextNode(\"itty logo\");\n\t\t\tif (oLogo) {\n\t\t\t\toLogo.appendChild(tlogoSpace);\n\t\t\t\tif (ITTY.editor.ids.logoclass) {\n\t\t\t\t\tITTY.editor.common.xsetAttribute(oLogo, 'class', ITTY.editor.ids.logoclass);\n\t\t\t\t} else {\n\t\t\t\t\tITTY.editor.common.xsetAttribute(oLogo, 'class', 'ittyLogo');\n\t\t\t\t}\n\t\t\t\toContainer.insertBefore(oLogo, oContainer.lastChild);\n\t\t\t\t\t// brand the toolbar: add a logo (example is a 52 x 60 px alpha png)\n\t\t\t}\n\t\n\t\t\tvar oC = ITTY.editor.converter.make(oToolbar, oOutputPane, oCodeInputPane, oInfoContainer); //, oInfoContainer optional\n\t\t\t\t/* set up Markdown2xhtml converter: Arguments: \n\t\t\t\t[0] oToolbar (object): import toolbar instance;\n\t\t\t\t[1] oOutputPane (object): viewSource textarea element; and \n\t\t\t\t[2] oInfoContainer (object): the empty, extra info container.*/\n\t\t\t\t// make a converter object\n\t\n\t\t\t\t// may reset some variables to coordinate with our page, like shorter or longer delay for auto-conversion\n\t\t}\n\t}\t\n}", "function initEditorView() {\n shrinkLimit = false;\n scalePercent = 0;\n setOrientation();\n\n dragging = false;\n mainContext = mainCanvas.getContext('2d');\n guideContext = frameCanvas.getContext('2d');\n workingCanvas = document.createElement('canvas');\n workingContext = workingCanvas.getContext('2d');\n scaleSlider.max = image.width;\n scaleSlider.value = image.width;\n scaleSlider.min = w;\n minimumScale = w;\n scaledWidth = image.width;\n scaledHeight = image.height;\n originY = ((image.height - mainCanvas.height) / 2 ) * -1;\n originX = ((image.width - mainCanvas.width) / 2 ) * -1;\n mainContext.clearRect(0, 0, w, h);\n\n document.getElementById('Output').value = '';\n document.getElementById(\"controls\").style.display='block';\n document.getElementById(\"ImageMetrics\").style.display='block';\n document.getElementById(\"ScaleSlider\").style.display='inline-block';\n document.getElementById(\"CropButton\").style.display='inline-block';\n document.getElementById(\"ResetButton\").style.display='inline-block';\n mainCanvas.style.display='block';\n frameCanvas.style.display='block';\n }", "create() {\n let body = document.getElementsByTagName(\"body\")[0];\n let html = SideTools.HTML;\n html = html.replace(/{pathImage}/g, window.easySafeEditor.options.getValue(\"paths.images\"));\n html = html.replace(/{pageEditTitle}/g, window.easySafeEditor.options.getValue(\"labels.pageEditTitle\"));\n html = html.replace(/{openMenu}/g, window.easySafeEditor.options.getValue(\"labels.openMenu\"));\n html = html.replace(/{closeMenu}/g, window.easySafeEditor.options.getValue(\"labels.closeMenu\"));\n html = html.replace(/{close}/g, window.easySafeEditor.options.getValue(\"labels.close\"));\n \n let nodePanel = createElement(html);\n body.insertBefore(nodePanel, body.firstChild);\n\n this.panelTool = document.getElementById(\"easySafeTools\");\n this.pageTitle = document.getElementById(\"easySafeTools_PageTitle\");\n this.editableContainers = document.getElementById(\"easySafeTools_EditableContainers\");\n this.collapseButton = document.getElementById(\"easySafeTools_collapsePanel\");\n this.uncollapseButton = document.getElementById(\"easySafeTools_uncollapsePanel\");\n this.closeButton = document.getElementById(\"easySafeTools_closePanel\");\n this.buttonsContainer = document.getElementById(\"easySafeTools_sideButtons\");\n\n\n this.collapseButton.addEventListener(\"click\", (event) => this.onCollapseButtonClick(event), true);\n this.uncollapseButton.addEventListener(\"click\", (event) => this.onCollapseButtonClick(event), true);\n this.closeButton.addEventListener(\"click\", (event) => this.onCloseButtonClick(event), true);\n\n this.pageTitle.value = window.easySafeEditor.post.getTitle();\n this.pageTitle.addEventListener(\"input\", (event) => this.onChangeTitle(event), true);\n\n let buttons = window.easySafeEditor.options.getValue(\"sideBar.buttons\");\n buttons.forEach(button => {\n let element = null;\n \n if ((typeof button) == \"string\")\n element = createElement(button);\n else if ((typeof button) == \"HTMLElement\")\n element = button;\n\n if (element != null)\n this.buttonsContainer.append(element);\n });\n }", "showPropertyEditor() {\n const LayoutMng = require('../layout/layout_mng');\n // create the editor window if not exists\n if (null==this.propEditor) {\n let editor = this.propEditor = this.createFormWindow('Settings Editor #'+this.id, {\n parent: LayoutMng.singleton.uiParent,\n border: 'line',\n top: Math.max(parseInt(LayoutMng.singleton.uiParent.height/2)-20, 1),\n left: 'center',\n width: 35,\n shrink: true,\n });\n editor.compCount = 0;\n editor.comps = new Object();\n this.addPropertyEditorComps();\n let okay = this.createBtn('Okay', {\n parent: editor, \n right: 14, \n top: this.propEditor.compCount*2+1, \n width: 6, height: 1,\n });\n okay.on('press', ()=>{ editor.submit(); });\n editor.on('submit', (data)=>{\n this.propEditor.hide();\n LayoutMng.singleton.screen.render();\n for (let n in data) {\n if (typeof(data[n])!='string') {\n delete data[n];\n continue;\n }\n data[n] = data[n].trim();\n }\n bilog(\"settings submit: \"+JSON.stringify(data));\n this.onPropertyEditorSubmit(data);\n });\n let cancel = this.createBtn('Cancel', {\n parent: editor, \n right: 2, \n top: this.propEditor.compCount*2+1, \n width: 8, height: 1,\n });\n cancel.on('press', ()=>{\n this.propEditor.hide();\n });\n }\n // reset values of all fields\n LayoutMng.singleton.screen.render();\n this.resetPropertyEditorData();\n // show up\n this.propEditor.show();\n this.propEditor.focus();\n LayoutMng.singleton.screen.render();\n }", "addPanel(component) {\nthis\n.addInfoToComponent(component, formEditorConstants.COMPONENT_TYPE_PANEL)\n.addProperty(component, 'name', this._componentList.findComponentText(component.type, 'name', 'Panel'))\n.addProperty(component, 'zIndex', 0)\n.addProperty(component, 'width', 200)\n.addProperty(component, 'height', 128);\nif (!('containerIds' in component)) {\nthis.addProperty(component, 'containerIds', [this._formEditorState.getNextId()]);\n}\nreturn component;\n}", "_initializeEditor(editor) {\n const that = this;\n\n if (that.$[editor + 'Editor']) {\n that._editor = that.$[editor + 'Editor'];\n return;\n }\n\n const editorElement = document.createElement('jqx-' + JQX.Utilities.Core.toDash(editor));\n\n if (editor === 'numericTextBox') {\n editorElement.spinButtons = true;\n editorElement.inputFormat = 'floatingPoint';\n }\n else if (editor === 'dateTimePicker') {\n editorElement.dropDownAppendTo = that.$.container;\n editorElement.calendarButton = true;\n editorElement.dropDownDisplayMode = 'auto';\n editorElement.enableMouseWheelAction = true;\n editorElement.locale = that.locale;\n\n if (!editorElement.messages[that.locale]) {\n editorElement.messages[that.locale] = {};\n }\n\n editorElement.messages[that.locale].dateTabLabel = that.localize('dateTabLabel');\n editorElement.messages[that.locale].timeTabLabel = that.localize('timeTabLabel');\n }\n\n editorElement.theme = that.theme;\n editorElement.animation = that.animation;\n editorElement.$.addClass('jqx-hidden underlined');\n that.$.editorsContainer.appendChild(editorElement);\n that._editor = that.$[editor + 'Editor'] = editorElement;\n }", "function _setupPanel(panel){\r\n\treturn panel\r\n\t\t.on('panelClosing', function(){\r\n\t\t\tif($('.sub-panel').length <= 1){\r\n\t\t\t\t// XXX when not only the editor is using the panels, this\r\n\t\t\t\t// \t\tis not the correct way to go...\r\n\t\t\t\ttoggleEditor('off')\r\n\t\t\t}\r\n\t\t})\r\n\t\t.on('newPanel', function(evt, panel){\r\n\t\t\t_setupPanel(panel)\r\n\t\t})\r\n\t\t// make clicks on unfocusable elements remove focus...\r\n\t\t.click(function(){\r\n\t\t\tif(event.target != $('.panel :focus')[0]){\r\n\t\t\t\t$('.panel :focus').blur()\r\n\t\t\t}\r\n\t\t})\r\n}", "addPropertyEditorComps() {\n // Postion field\n this.addInputFieldToPropertyEditor('Left,Top', '_lt');\n // Size field\n if (this.resizeable())\n this.addInputFieldToPropertyEditor('Width,Height', '_wh');\n }", "function PropertyEditor(){}", "function BaseEditor() { }", "function BaseEditor() { }", "function Editor() { }", "function Editor() { }", "function PreviewPanel$(config/*:PreviewPanel = null*/){var this$=this;if(arguments.length<=0)config=null;\n var config_$1/*: com.coremedia.cms.editor.sdk.preview.PreviewPanelBase*/ =AS3.cast(com.coremedia.cms.editor.sdk.preview.PreviewPanelBase,{});\n var defaults_$1/*:PreviewPanel*/ =AS3.cast(PreviewPanel,{});\n config = net.jangaroo.ext.Exml.apply(defaults_$1,config);\n config_$1[\"ariaRole\"] = \"region\";\n config_$1[\"focusable\"] = true;\n config_$1.defaultFocus = \":focusable\";\n config_$1.ariaLabel =net.jangaroo.ext.Exml.asString( this.resourceManager.getString('com.coremedia.cms.editor.Editor', 'PreviewPanel_label'));\n AS3.setBindable(config_$1,\"layout\" , \"fit\");\n config_$1.hideCollapseTool = true;\n config_$1.header = false;\n var ui_SwitchingContainer_96_5_$1/*:com.coremedia.ui.components.SwitchingContainer*/ =AS3.cast(com.coremedia.ui.components.SwitchingContainer,{});\n AS3.setBindable(ui_SwitchingContainer_96_5_$1,\"activeItemValueExpression\" , this.getActivePreviewPanelValueExpression());\n var editor_InnerPreviewPanel_99_9_$1/*: com.coremedia.cms.editor.sdk.preview.InnerPreviewPanel*/ =AS3.cast(com.coremedia.cms.editor.sdk.preview.InnerPreviewPanel,{});\n editor_InnerPreviewPanel_99_9_$1.itemId = \"innerPreviewPanel\";\n AS3.setBindable(editor_InnerPreviewPanel_99_9_$1,\"hideDeviceSlider\" , AS3.getBindable(config,\"hideDeviceSlider\"));\n AS3.setBindable(editor_InnerPreviewPanel_99_9_$1,\"metadataService\" , this.getMetadataService());\n var container_102_9_$1/*:ext.container.Container*/ =AS3.cast(Ext.container.Container,{});\n container_102_9_$1.itemId =net.jangaroo.ext.Exml.asString( com.coremedia.cms.editor.sdk.preview.PreviewPanelBase.NO_PREVIEW_ITEM_ID);\n container_102_9_$1.ui =net.jangaroo.ext.Exml.asString( com.coremedia.ui.skins.ContainerSkin.DARK_200);\n var displayField_105_13_$1/*:ext.form.field.DisplayField*/ =AS3.cast(Ext.form.field.Display,{});\n displayField_105_13_$1.ui =net.jangaroo.ext.Exml.asString( com.coremedia.ui.skins.DisplayFieldSkin.ITALIC.getSkin());\n AS3.setBindable(displayField_105_13_$1,\"value\" , AS3.getBindable(config,\"noPreviewAvailableMessage\") || this.resourceManager.getString('com.coremedia.cms.editor.Editor', 'PreviewPanel_emptyPreview'));\n container_102_9_$1.items = [displayField_105_13_$1];\n ui_SwitchingContainer_96_5_$1.items = [editor_InnerPreviewPanel_99_9_$1, container_102_9_$1];\n config_$1.items = [ui_SwitchingContainer_96_5_$1];\n var editor_PreviewPanelToolbar_113_5_$1/*: com.coremedia.cms.editor.sdk.preview.PreviewPanelToolbar*/ =AS3.cast(com.coremedia.cms.editor.sdk.preview.PreviewPanelToolbar,{});\n AS3.setBindable(editor_PreviewPanelToolbar_113_5_$1,\"collapseHandler\" , AS3.getBindable(config,\"collapseHandler\"));\n AS3.setBindable(editor_PreviewPanelToolbar_113_5_$1,\"hidden\" , AS3.getBindable(config,\"hideToolbar\"));\n editor_PreviewPanelToolbar_113_5_$1.ui =net.jangaroo.ext.Exml.asString( com.coremedia.ui.skins.ToolbarSkin.WORKAREA.getSkin());\n AS3.setBindable(editor_PreviewPanelToolbar_113_5_$1,\"reloadHandler\" , function()/*:void*/ { this$.reloadFrame(); if(config.reloadHandler) {config.reloadHandler();} });\n var ui_ValueExpression_118_9_$1/*:com.coremedia.ui.exml.ValueExpression*/ =AS3.cast(com.coremedia.ui.exml.ValueExpression,{});\n AS3.setBindable(ui_ValueExpression_118_9_$1,\"expression\" , \"previewUrl\");\n AS3.setBindable(ui_ValueExpression_118_9_$1,\"context\" , this);\n AS3.setBindable(editor_PreviewPanelToolbar_113_5_$1,\"urlValueExpression\" , new com.coremedia.ui.exml.ValueExpression(ui_ValueExpression_118_9_$1));\n config_$1.tbar = editor_PreviewPanelToolbar_113_5_$1;\n var editor_BookmarkAction_124_5_$1/*:com.coremedia.cms.editor.sdk.bookmarks.BookmarkAction*/ =AS3.cast(com.coremedia.cms.editor.sdk.bookmarks.BookmarkAction,{});\n AS3.setBindable(editor_BookmarkAction_124_5_$1,\"contentValueExpression\" , AS3.getBindable(config,\"bindTo\"));\n AS3.setBindable(config_$1,\"actionList\" , [new com.coremedia.cms.editor.sdk.bookmarks.BookmarkAction(editor_BookmarkAction_124_5_$1)]);\n config_$1[\"actionList$at\"] = net.jangaroo.ext.Exml.APPEND;\n net.jangaroo.ext.Exml.apply(config_$1,config);\n this.super$aMOS(config_$1);\n }", "static createEditor(params) {\r\n\t\tDOM.createEditor(params);\r\n\t\tInit.editor = Getter.getEditor();\r\n\t\t\r\n\t\tswitch (mode) {\r\n\t\tcase 'balloon':\r\n\t\t\t/*create popup toolbar in balloon mode*/\r\n\t\t\tInit.createToolbar('swe-toolbar-pu', 'swe-none');\r\n\t\t\tInit.setShowingPopupToolbarEvents();\r\n\t\t\t/*set selectionEnd timer value*/\r\n\t\t\tInit.selectionEndTimer = null;\r\n\t\t\tbreak;\r\n\t\tcase 'classic':\r\n\t\tdefault:\r\n\t\t\t/*create fixed toolbar in balloon mode*/\r\n\t\t\tInit.createToolbar('swe-toolbar', params.sticky ? 'swe-toolbar-sticky' : null);\r\n\t\t\tDOM.createBottomPanel();\r\n\t\t\tInit.setEventListener(Init.editor, 'input', Init.setCountersValue);\r\n\t\t\tInit.setCountersValue();\r\n\t\t}\r\n\t\t/*highlight editors images on click*/\r\n\t\tInit.setEventListener(Init.editor, 'mousedown', Images.selectImageOnClick);\r\n\t\tInit.setEventListener(document, 'mousedown', Images.removeImageFrameOnOutsideClick);\t\t\r\n\t\t/*set textarea value on input*/\r\n\t\tInit.setEventListener(Init.editor, 'input', Init.setTextAreaValue);\r\n\t\t/*highlight buttons of toolbar that have the same style as selection*/\r\n\t\tInit.setEventListener(document, 'selectionchange', Init.highlightTheButtons);\r\n\t}", "async setPanel(_) {\n if (!arguments.length)\n return this._nodeEdgePanel;\n this._nodeEdgePanel = _;\n }", "async setPanel(_) {\n if (!arguments.length)\n return this._irisPanel;\n this._irisPanel = _;\n }", "async setPanel(_) {\n if (!arguments.length)\n return this._irisPanel;\n this._irisPanel = _;\n }", "function initialize(editArea) {\r\n this.editArea = editArea;\r\n\r\n this.hasMouseDown = false;\r\n this.element = new Element('div', { 'class': 'editor_toolbar' });\r\n\r\n var toolbar = this;\r\n this.element.observe('mousedown', function(event) { toolbar.mouseDown(event); });\r\n this.element.observe('mouseup', function(event) { toolbar.mouseUp(event); });\r\n\r\n this.editArea.insert({before: this.element});\r\n }", "function initEditor() {\n checkSetup();\n initFirebase();\n initConstants();\n initCanvas();\n initButton();\n initEditorData();\n initEventHandlers();\n resetEditor();\n initGrid();\n initSelectorContent();\n}", "_initializeEditor(editor) {\n const that = this,\n editorTagName = 'jqx-' + JQX.Utilities.Core.toDash(editor),\n editorElement = document.createElement(editorTagName);\n\n if (editor === 'numericTextBox') {\n editorElement.spinButtons = true;\n editorElement.inputFormat = 'floatingPoint';\n }\n else if (editor === 'dateTimePicker') {\n editorElement.calendarButton = true;\n editorElement.dropDownDisplayMode = 'auto';\n editorElement.enableMouseWheelAction = true;\n editorElement.locale = that.locale;\n\n if (!editorElement.messages[that.locale]) {\n editorElement.messages[that.locale] = {};\n }\n\n editorElement.messages[that.locale].dateTabLabel = that.localize('dateTabLabel');\n editorElement.messages[that.locale].timeTabLabel = that.localize('timeTabLabel');\n }\n\n editorElement.tabIndex = '1';\n editorElement.theme = that.theme;\n editorElement.animation = that.animation;\n that.$[editor + 'Editor'] = editorElement;\n editorElement.$ = JQX.Utilities.Extend(editorElement);\n editorElement.className = editorTagName + '-editor jqx-hidden';\n that.$.editorsContainer.appendChild(editorElement);\n that['_' + editor + 'Initialized'] = true;\n }", "function Component_PanelBehavior() {}", "function Component_PanelBehavior() {}", "createdCallback() {\n\t\t/**\n\t\t * @type {Panel}\n\t\t * @access private\n\t\t */\n\t\tthis.panel = undefined;\n\n\t\t/**\n\t\t * @type {CompositeDisposable}\n\t\t * @access private\n\t\t */\n\t\tthis.subscriptions = new CompositeDisposable();\n\n\t\t/**\n\t\t * @type {number}\n\t\t * @access private\n\t\t */\n\t\tthis.width = 0.7;\n\n\t\tthis.innerHTML = `\n\t\t\t<div class = 'resize-handle'></div>\n\t\t\t<div class = 'panel-main panel-body'></div>\n\t\t\t<div class = 'panel-tool panel-body'></div>\n\t\t\t<div class = 'panel-head'>\n\t\t\t\t<nav class='panel-group panel-nav'></nav>\n\t\t\t</div>\n\t\t`;\n\t\tthis.style.width = this.width * 100 + 'vh';\n\t\tthis.querySelector('.panel-tool').style.flexBasis = '350px';\n\t\tlet panelBodyStyle = this.querySelector('.panel-body').style;\n\t\tpanelBodyStyle.fontFamily = atom.config.get('editor.fontFamily');\n\t\tpanelBodyStyle.fontSize = atom.config.get('editor.fontSize');\n\t\tpanelBodyStyle.lineHeight = atom.config.get('editor.lineHeight');\n\t}", "_setupPaletteDragging() {\n this._addDragHandlers(this.visiblePalette);\n\n this.paletteDragHandler = aEvent => {\n let originalTarget = aEvent.originalTarget;\n if (\n this._isUnwantedDragDrop(aEvent) ||\n this.visiblePalette.contains(originalTarget) ||\n this.$(\"customization-panelHolder\").contains(originalTarget)\n ) {\n return;\n }\n // We have a dragover/drop on the palette.\n if (aEvent.type == \"dragover\") {\n this._onDragOver(aEvent, this.visiblePalette);\n } else {\n this._onDragDrop(aEvent, this.visiblePalette);\n }\n };\n let contentContainer = this.$(\"customization-content-container\");\n contentContainer.addEventListener(\n \"dragover\",\n this.paletteDragHandler,\n true\n );\n contentContainer.addEventListener(\"drop\", this.paletteDragHandler, true);\n }", "init() {\n const cls = this.constructor\n\n // Set the initial state of the crop tool to hidden\n this._visible = false\n\n // Create the crop tool (this initial state is hidden)\n this._dom.tool = $.create('div', {'class': cls.css['tool']})\n\n // Create the crop region\n this._dom.region = $.create('div', {'class': cls.css['region']})\n this._dom.tool.appendChild(this._dom.region)\n\n // Create the crop outline\n this._dom.outline = $.create('div', {'class': cls.css['outline']})\n this._dom.region.appendChild(this._dom.outline)\n\n // Create the crop image\n this._dom.image = $.create('div', {'class': cls.css['image']})\n this._dom.image.style.backgroundImage = `url(${this._imageURL})`\n this._dom.outline.appendChild(this._dom.image)\n\n // Create the controls\n for (let ctrl of ['c', 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw']) {\n let ctrlElm = $.create(\n 'div',\n {\n 'class':\n `${cls.css['control']} ${cls.css['controls'][ctrl]}`,\n 'data-control': ctrl\n }\n )\n this._dom.region.appendChild(ctrlElm)\n }\n\n // Add the crop tool to the container\n this._dom.container.appendChild(this._dom.tool)\n\n // Set up event listeners\n $.listen(\n this._dom.region,\n {'mousedown touchstart': this._handlers.startDrag}\n )\n\n $.listen(\n this._dom.region,\n {'mousedown touchstart': this._handlers.startResize}\n )\n\n $.listen(\n document,\n {\n 'mousemove touchmove': this._handlers.drag,\n 'mouseout mouseup touchend': this._handlers.endDrag\n }\n )\n\n $.listen(\n document,\n {\n 'mousemove touchmove': this._handlers.resize,\n 'mouseout mouseup touchend': this._handlers.endResize\n }\n )\n }", "function setup_meal_editor_for_adding_new_meal()\n{\n // Setup the meal editor\n show_edit_mode_controls();\n\n // Populate the editor with the new meal (all fields will be blank)\n populate_meal_editor(current_meal);\n document.getElementById('meal_name_input').focus();\n}", "createEditor() {\n this.simplemde = new SimpleMDE({\n element: $(\"#txtEditor\")[0],\n autoDownloadFontAwesome: false,\n initialValue: controller.markdownText,\n toolbar: [{\n name: \"save\",\n action: (() => this.saveChanges()),\n className: \"fa fa-floppy-o\",\n title: \"Save Changes\"\n },\n //The fullscreen button will be hidden by the css. It was only added here to prevent errors in the side-by-side button\n \"|\", \"bold\", \"italic\", \"strikethrough\", \"heading\", \"|\", \"quote\", \"unordered-list\", \"ordered-list\", \"|\", \"link\", \"image\", \"table\", \"fullscreen\", \"|\",\n {\n name: \"side-by-side\",\n action: (() => this.showSideBySide()),\n className: \"fa fa-columns\",\n title: \"Side by Side Editing\"\n }, \"|\",\n {\n name: \"guide\",\n action: (() => this.showGuide()),\n className: \"fa fa-question-circle\",\n title: \"Markdown Guide\"\n }]\n });\n this.simplemde.codemirror.on(\"change\",\n () => controller.markdownText = this.simplemde.value());\n }", "function sidePanel() {\n strokeWeight(0);\n textSize(36);\n textStyle(BOLD);\n textAlign(CENTER);\n textFont(\"Cambria\");\n\n //This makes the side pannel\n fill(0, 45, 72);\n rect(width - 400, 0, width, height);\n\n //This is for the dividers on the side pannel\n fill(0, 140, 174);\n rect(width - 400, 445, width, 8);\n rect(width - 400, 545, width, 8);\n rect(width - 400, 715, width, 8);\n\n //This is just used to label the pen color and pan size sliders\n fill(200, 241, 247);\n text(\"Pen Color\", width - 200, 40);\n text(\"Pen Size\", width - 200, 490);\n}", "function configuredTool(options){\n\n\tObject.assign(this,options);\n\t{\n\t\tme = this;\n\n\t\tlog.debug(`Options are ${JSON.stringify(options)}`)\n\n\t\tthis.node = $(options.droppedModeHtml).addClass(options.class).addClass(\"dropped-object\").attr('id',this.name)\n\n\t\t\t.css({zIndex: options.zIndex,display:\"block\"}).attr('type',options.type);\n\n\t\tvar div = setUpDiv(this.node);\n\n\t\tdiv.find(\".dropped-object\").each(function(){\n\t\t\tsetUpDiv($(this));\n\t\t})\n\n\t\tif(div.attr(\"type\") == \"FIELD\"){\n\t\t\tdiv.find(\".dropped-object\").each(function(idx,n){\n\t\t\t\tn = $(n);\n\t\t\t\tlog.debug(\"ID IS \" + $(div).attr(\"id\"))\n\t\t\t\tif(n.is(\"[type=T]\")){\n\t\t\t\t\tn.attr(\"id\",div.attr(\"id\")+ \"-label\")\n\t\t\t\t} else {\n\t\t\t\t\tn.attr(\"id\",div.attr(\"id\")+ \"-control\")\n\t\t\t\t\tn.find(\"input\").attr(\"id\", div.attr(\"id\") + \"inputField\");\n\t\t\t\t}\n\n\t\t\t\tsetUpDiv($(n));\n\t\t\t})\n\t\t}\n\n\t\tif(!options.droppable){\n\t\t\t$(this.node).removeClass(\"ui-droppable\").droppable(\"destroy\")\n\t\t}\n\t\n\t\tlog.debug(`hello`);\n\t\tlog.debug(this.node)\n\t\t//Note: since node has not been added to document, it can does not have a width or height yet\n\t\treturn this.node;\n\n\n\t}\n\t\n}", "function buildUI (thisObj ) {\r var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'FSS Fake Parallax',[0,0,150,260],{resizeable: true});\r\r if (win !== null) {\rvar red = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [1, 0.1, 0.1],1);\rvar green = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [0.1, 1, 0.1],1);\r\r var H = 25; // the height\r var W = 30; // the width\r var G = 5; // the gutter\r var x = G;\r var y = G;\r\r // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\r // win.check_box.value = metaObject.setting1;\r\r win.select_json_button = win.add('button',[x ,y,x+W*5,y + H], 'read json');\r x+=(W*5)+G;\r win.read_label = win.add('statictext',[x ,y,x+W*5,y + H],'NO JSON');\r win.read_label.graphics.foregroundColor = red;\r x=G;\r y+=H+G;\r win.do_it_button = win.add('button', [x ,y,x+W*5,y + H], 'simple import');\r x=G;\r y+=H+G;\r win.regen_it_button = win.add('button', [x ,y,x+W*5,y + H], 'regenerate');\r x=G;\r y+=H+G;\r win.prepare_logo_button = win.add('button', [x ,y,x+W*5,y + H], 'prepare logo');\r\r // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up'); \r\r // win.check_box.onClick = function (){\r // alert(\"check\");\r // };\r //\r //\r win.select_json_button.addEventListener (\"click\", function (k) {\r /**\r * if you hold alt you can clear the the json and all that stuff\r * \r */\r if (k.altKey) {\r mpo2ae.images_folder_flat = null;\r mpo2ae.json = null;\r mpo2ae.allfolders.length = 0;\r mpo2ae.pre_articles.length = 0;\r mpo2ae.articles.length = 0;\r win.read_label.text = 'NO JSON';\r win.read_label.graphics.foregroundColor = red;\r }else{\r\r\r\r// win.select_json_button.onClick = function () {\r /**\r * Why is this in here?\r * Because we can make changed to the GUI from the function\r * makeing some overview for the JSON and stuff like that\r *\r */\r mpo2ae.project = app.project;\r var presets = mpo2ae.settings.comp.layerpresets;\r var jsonFile = File.openDialog(\"Select a JSON file to import.\", \"*.*\",false);\r // var path = ((new File($.fileName)).path);\r if (jsonFile !== null) {\r mpo2ae.images_folder_flat = jsonFile.parent;\r\r var textLines = [];\r jsonFile.open(\"r\", \"TEXT\", \"????\");\r while (!jsonFile.eof){\r textLines[textLines.length] = jsonFile.readln();\r }\r jsonFile.close();\r var str = textLines.join(\"\");\r var reg = new RegExp(\"\\n|\\r\",\"g\");\r str.replace (reg, \" \");\r // var reghack = new RegExp('\"@a','g');\r // str.replace(reghack, '\"a');\r mpo2ae.json = eval(\"(\" + str + \")\"); // evaluate the JSON code\r if(mpo2ae.json !==null){\r // alert('JSON file import worked fine');\r // alert(mpo2ae.json);\r win.read_label.text = 'YES JSON';\r win.read_label.graphics.foregroundColor = green;\r mpo2ae.pre_articles = mpo2ae.json.seite.artikel;\r//~ $.write(mpo2ae.pre_articles.toSource());\r /**\r * This is only cheking if ther are some folders already there\r * \r */\r // var allfolders = [];\r if(mpo2ae.pre_articles.length > 0){\r var projItems = mpo2ae.project.items;\r for(var f = 1; f <= projItems.length;f++){\r if (projItems[f] instanceof FolderItem){\r // alert(projItems[f]);\r mpo2ae.allfolders.push(projItems[f]);\r }\r } // end folder loop\r\r for(var i = 0; i < mpo2ae.pre_articles.length;i++){\r var article = mpo2ae.pre_articles[i];\r var artfolder = null;\r var artimages = [];\r var artnr = null;\r var artprice = null;\r var arttxt = null;\r var artname = null;\r var artdiscr = null;\r var artbrand = null;\r var artfootage = [];\r var artgroup = null;\r if(article.hasOwnProperty('artikelInformation')){\r ainfo = article.artikelInformation;\r if(ainfo.hasOwnProperty('iArtikelNr')){\r // artnr = ainfo.iArtikelNr;\r // ------------ loop all folders per article ------------\r if(mpo2ae.allfolders !== null){\r for(var ff = 0; ff < mpo2ae.allfolders.length;ff++){\r if(mpo2ae.allfolders[ff].name == ainfo.iArtikelNr){\r artfolder = mpo2ae.allfolders[ff];\r break;\r }\r } // close ff loop\r } // close folder null check\r // ------------ end loop all folders per article ------------\r\r // if(artfolder === null){\r // artfolder = mpo2ae.project.items.addFolder(ainfo.iArtikelNr.toString());\r // } // close artfolder null\r }// close iArtikelNr check\r\r if(ainfo.hasOwnProperty('iHersteller')){\r artbrand = ainfo.iHersteller;\r }\r if(ainfo.hasOwnProperty('iGruppenFarbe')){\r artgroup = ainfo.iGruppenFarbe;\r }\r } // close artikelInformation check\r\r if(article.hasOwnProperty('preis')){\r artprice = article.preis;\r }\r if(article.hasOwnProperty('textPlatzieren')){\r if(article.textPlatzieren.hasOwnProperty('artikelBezeichnung')){\r artname = article.textPlatzieren.artikelBezeichnung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelBeschreibung')){\r artdiscr = article.textPlatzieren.artikelBeschreibung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelText')){\r arttxt = article.textPlatzieren.artikelText;\r }\r\r if(article.textPlatzieren.hasOwnProperty('artikelNr')){\r artnr = article.textPlatzieren.artikelNr;\r }\r }\r\r// ------------ this is start folder creation and image import ------------\r if(artfolder !== null){\r var imgpath = null;\r if(article.hasOwnProperty('bild')){\r if( Object.prototype.toString.call( article.bild ) === '[object Array]' ) {\r // article.bild is an array\r // lets loop it\r // \r for(var j =0;j < article.bild.length;j++){\r\r if(article.bild[j].hasOwnProperty('attributes')){\r imgpath = article.bild[j].attributes.href.substring(8);\r artimages.push(imgpath);\r alert(imgpath);\r return;\r }// article bild is an Array attributes close\r } // close J Loop\r }else{\r // now this is an error in the JSON\r // the property 'bild' comes as Array OR Object\r // we need to fix that\r if(article.bild.hasOwnProperty('attributes')){\r artimages.push(article.bild.attributes.href.substring(8));\r alert(imgpath);\r return;\r } // article bild is an object attributes close\r\r }// close Object.prototype.toString.call( article.bild )\r\r // alert( mpo2ae.images_folder_flat.fullName + \"\\n\" + artimages);\r // for(var ig = 0; ig < artimages.length;ig++){\r\r // var a_img = File( mpo2ae.images_folder_flat.fsName + \"/\" + artimages[ig]);\r // if(a_img.exists){\r // var footageitem = mpo2ae.project.importFile(new ImportOptions(File(a_img)));\r // footageitem.parentFolder = artfolder;\r // artfootage.push(footageitem);\r // }else{\r // artfootage.push(null);\r // } // close else image does not exist on HD\r // } // end of ig loop artimages\r }else{\r // artile has no property 'bild'\r $.writeln('There are no images on article ' + ainfo.iArtikelNr);\r // alert('There are no images on article ' + ainfo.iArtikelNr);\r }\r }else{\r // it was not possible to create folders\r // neither from the names nor did they exist\r // alert('Error creating folder for import');\r }\r// ------------ end of folder creation an image import ------------\r // var curComp = mpo2ae.project.items.addComp(\r // mpo2ae.settings.projectname + \" \" + ainfo.iArtikelNr,\r // mpo2ae.settings.comp.width,\r // mpo2ae.settings.comp.height,\r // mpo2ae.settings.comp.pixelAspect,\r // mpo2ae.settings.comp.duration,\r // mpo2ae.settings.comp.frameRate);\r // curComp.parentFolder = artfolder;\r\r // now we got all info togther and everything is checked\r // we create an cleaned object with the props we need\r // for later usage\r var art = new Article();\r art.nr = artnr;\r art.folder = artfolder;\r // art.images = artimages;\r // var regdash = new RegExp(\"--\",\"g\");\r art.price = regdashes(artprice);// artprice.replace(regdash,\"\\u2013\");\r art.txt = arttxt;\r art.name = artname;\r art.discr = artdiscr;\r art.brand = artbrand;\r art.footage = artfootage;\r art.group = artgroup;\r mpo2ae.articles.push(art);\r } // end article loop\r\r\r }else{\r alert('No articles in JSON');\r }\r }else{\r alert('JSON is null');\r }\r}else{\r\r alert('File is null');\r}\r } // end else not alt\r // };\r }); // end of eventListener\r\r win.do_it_button.onClick = function () {\r simple_import();\r alert('done');\r };\r\r win.regen_it_button.onClick = function () {\r // simple_import();\r if((app.project.selection < 1) && (!(app.project.selection[0] instanceof CompItem ))){\r alert('Please select your template composition');\r return;\r }\r regenerate_from_template(app.project.selection[0]);\r\r\r };\r\r win.prepare_logo_button.onClick = function () {\r prepare_selected_logo();\r };\r }\r return win;\r}", "function EditorConstructor() { }", "function EditorConstructor() { }", "function PanelHelper() {\n\t}", "function initEditorCanvas() {\n let canvas = document.getElementById('editorCanvas');\n // Resize the canvas.\n canvas.width = EDITOR_SCALE * CHR_WIDTH;\n canvas.height = EDITOR_SCALE * CHR_HEIGHT;\n\n let ctx = cmn.getContext2DNA(canvas);\n ctx.imageSmoothingEnabled = false;\n ctx.scale(EDITOR_SCALE, EDITOR_SCALE);\n\n // Canvas is white by default.\n ctx.fillStyle = 'black';\n ctx.fillRect(0, 0, CHR_WIDTH, CHR_HEIGHT);\n\n canvas.addEventListener('mousedown', function (me) { _mouseDown = true; onMouseMove(me); });\n canvas.addEventListener('mousemove', onMouseMove);\n canvas.addEventListener('mouseup', function (me) { _mouseDown = false; });\n canvas.addEventListener('mouseleave', function (me) { _mouseDown = false; });\n}", "setPanel(panel){\n this.PANEL = panel;\n this.updatePanelTitle();\n }", "prepareEditor(svg, conns, nodes, subnodes) {\n nodes\n .attr('class', 'mindmap-node mindmap-node--editable')\n .on('dblclick', (node) => {\n node.fx = null;\n node.fy = null;\n });\n\n nodes.call(d3Drag(this.state.simulation, svg, nodes));\n\n this.state.simulation\n .alphaTarget(0.5).on('tick', () => onTick(conns, nodes, subnodes));\n }", "function ceateDrawPanel(rId) {\n\t\t\t\t\t\t\treturn\tExt.create('Ext.panel.Panel', {\n\t\t\t\t\t\t\t\tautoShow:true,\n\t\t\t\t\t\t\t\tid:rId,\n\t\t\t\t\t\t\t\twidth:mySignet1.width,\n\t\t\t\t\t\t\t\theight:mySignet1.height,\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t'padding': '0 0 0 0',\n\t\t\t\t\t\t\t\t\t'background-color': 'transparent',\n\t\t\t\t\t\t\t\t\t'border': '1px dotted blue',\n\t\t\t\t\t\t\t\t\t'-moz-user-select':'none'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tbodyStyle: {\n\t\t\t\t\t\t\t\t\t'background-image': 'url(resources/images/s.gif)',//图路径\n\t\t\t\t\t\t\t\t\t'background-repeat': 'no-repeat',\n\t\t\t\t\t\t\t\t\t'background-color': 'transparent',\n\t\t\t\t\t\t\t\t\t'-moz-opacity': '1',\n\t\t\t\t\t\t\t\t\t'opacity':'1',\n\t\t\t\t\t\t\t\t\t'border': '0px dotted blue',\n\t\t\t\t\t\t\t\t\t'-moz-user-select':'none',\n\t\t\t\t\t\t\t\t\t'filter':\"progid:DXImageTransform.Microsoft.Chroma(color='white')\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlisteners: {\n\t\t\t\t\t\t\t\t\t// beforerender: function (com, opts) {\n\t\t\t\t\t\t\t\t\t// mySignet1.setPanelDimension(com);\n\t\t\t\t\t\t\t\t\t// },\n\t\t\t\t\t\t\t\t\trender: function (com, opts) {\n\n\t\t\t\t\t\t\t\t\t\tvar img = com.getEl();\n\n\t\t\t\t\t\t\t\t\t\t// img.on('select', function() {\n\t\t\t\t\t\t\t\t\t\t// return false;\n\t\t\t\t\t\t\t\t\t\t// });\n\t\t\t\t\t\t\t\t\t\t//ie下取消选择\n\t\t\t\t\t\t\t\t\t\timg.dom.onselectstart= function() {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\timg.on('mousedown', function (event, htmel, object, opts) {\n\t\t\t\t\t\t\t\t\t\t\tif(stampcls.getIsDrawing()) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tmySignet1.isDrag = true;\n\n\t\t\t\t\t\t\t\t\t\t\tmySignet1.offsetLeft = img.getX() - event.getX();\n\t\t\t\t\t\t\t\t\t\t\tmySignet1.offsetTop = img.getY() - event.getY();\n\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\twin.getEl().on('mousemove', function (event, htmel, object, opts) {\n\n\t\t\t\t\t\t\t\t\t\t\tif (!mySignet1.isDrag)\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t\t\t\t\timg.setStyle('cursor', 'pointer');\n\n\t\t\t\t\t\t\t\t\t\t\tcom.setPagePosition(event.getX() + mySignet1.offsetLeft, event.getY() + mySignet1.offsetTop, false);\n\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\timg.on('mouseup', function (event, htmel, object, opts) {\n\t\t\t\t\t\t\t\t\t\t\tif(stampcls.getIsDrawing()) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tmySignet1.isDrag = false;\n\t\t\t\t\t\t\t\t\t\t\timg.setStyle('cursor', 'auto');\n\t\t\t\t\t\t\t\t\t\t\t//移动后重置cX,cY\n\t\t\t\t\t\t\t\t\t\t\tvar temp = stampcls.getStampList().getByKey(com.id);\n\t\t\t\t\t\t\t\t\t\t\t//- win.down('#currImage').getPosition()[0]\n\t\t\t\t\t\t\t\t\t\t\ttemp.cX = com.getEl().getXY()[0]- win.down('#currImage').getEl().getXY()[0];\n\t\t\t\t\t\t\t\t\t\t\ttemp.cY = com.getEl().getXY()[1]- win.down('#currImage').getEl().getXY()[1];\n\t\t\t\t\t\t\t\t\t\t\t//getPosition\n\t\t\t\t\t\t\t\t\t\t\t//stampcls.getStampList().add(com.id,temp);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t//img单击选中事件\n\t\t\t\t\t\t\t\t\t\timg.on('click', function (e, htmel, object, opts) {\n\t\t\t\t\t\t\t\t\t\t\t//alert(com.id);\n\t\t\t\t\t\t\t\t\t\t\tstampcls.getStampList().eachKey( function(item) {\n\t\t\t\t\t\t\t\t\t\t\t\tif(com.id == item) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar curSel = win.down('#'+com.id+'');\n\t\t\t\t\t\t\t\t\t\t\t\t\tcurSel.getEl().setStyle('border','1px solid blue');\n\t\t\t\t\t\t\t\t\t\t\t\t\tstampcls.getSelList().add('cursel',curSel);\n\t\t\t\t\t\t\t\t\t\t\t\t\twin.down('#delStamps').setDisabled(false);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar other = win.down('#'+item+'');\n\t\t\t\t\t\t\t\t\t\t\t\t\tother.getEl().setStyle('border','1px dotted blue');\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\te.stopEvent();\n\t\t\t\t\t\t\t\t\t\t\t//win.down\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t//img双击事件\n\t\t\t\t\t\t\t\t\t\timg.on('dblclick', function (e, htmel, object, opts) {\n\t\t\t\t\t\t\t\t\t\t\t//alert(com.id);\n\t\t\t\t\t\t\t\t\t\t\tstampcls.getStampList().eachKey( function(item) {\n\t\t\t\t\t\t\t\t\t\t\t\tif(com.id == item) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlineEditor.comId=com.id;\n\t\t\t\t\t\t\t\t\t\t\t\t\tlineEditor.show();\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\te.stopEvent();\n\t\t\t\t\t\t\t\t\t\t\t//win.down\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}", "constructor(){\n super();\n\n /**\n * @private\n * @type {Location}\n */\n this._location = Location.None;\n\n /**\n * @private\n * @type {number}\n */\n this._reserve = WYSIWYG_CAPTION_AUTO;\n\n /**\n * @private\n * @type {TextBlock}\n */\n this._textBlock = new TextBlock(\"\");\n\n /**\n * Indicates if we need to ensure the TextBlock is in the right location\n * @type {boolean}\n * @private\n */\n this._needToRecalc = true;\n\n /**\n * The last layout that was given to draw with. Used to know if we need to recalculate\n * @type {Layout}\n * @private\n */\n this._lastDrawLayout = new Layout();\n\n /**\n * The last border that was given to draw with. Used to know if we need to recalculate\n * @type {Border}\n * @private\n */\n this._lastDrawBorder = new Border();\n\n this._textBlock.font.subscribe(EVENT_PROPERTY_CHANGE, (e) => this._needToRecalc = true);\n }", "function stateStartEditor(game) {\n\n // Ensure we don't have accidental clicks and start with plain mode\n edClickSafety = game.time.now;\n edState = EDITOR_STATE_EDIT;\n\n // Create the blueprint map if not present\n if (mapBlueprint == null) {\n mapBlueprint = mapCreateEmpty(3*16, 2*9);\n }\n\n // Create all phaser objects related to the map\n editorCreateAllFromMap(game, mapBlueprint);\n\n // Create grid and other UI phaser3 objects\n editorAddToolBox(game.add.rectangle(settingWidth / 2.0, settingHeight / 2.0, settingWidth - 160.0, settingHeight - 160.0, 0xffffff), 0.25);\n edLeftSelect = editorAddToolBox(game.add.rectangle(edLeftSelectPos.x * 80.0 + 40.0 + 80.0, edLeftSelectPos.y * 80.0 + 40.0 + 80.0, 60, 60, 0xff0000), 0.5);\n edRightSelect = editorAddToolBox(game.add.rectangle(edRightSelectPos.x * 80.0 + 40.0 + 80.0, edRightSelectPos.y * 80.0 + 40.0 + 80.0, 60, 60, 0x00ff00), 0.5);\n EDITOR_MENU.forEach(mo => editorAddMenuOption(game, mo) );\n edToolBoxObjects.forEach(o => o.setVisible(false) );\n}", "constructor (values: $Shape<EditorStateConfig>) {\n super(values)\n }", "function buildUI (thisObj ) {\n var H = 25; // the height\n var W = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n var rownum = 1;\n var columnnum = 3;\n var gutternum = 2;\n var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'Connect With Path',[0,0,gutternum*G + W*columnnum,gutternum*G + H*rownum],{resizeable: true});\n if (win !== null) {\n\n // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\n // win.check_box.value = metaObject.setting1;\n win.do_it_button = win.add('button', [x ,y,x+W*3,y + H], 'connect them');\n // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up');\n\n // win.check_box.onClick = function (){\n // alert(\"check\");\n // };\n win.do_it_button.onClick = function () {\n connect_all_layers();\n };\n\n }\n return win;\n}", "editShape () {\n this.shapeStyle = EDIT_SHAPE_STYLE\n this.edit = true\n this.freeDraw._updateModel('edit', this.id)\n this.freeDraw._refreshShapesInCanvas()\n this._backupData()\n return this\n }", "function setupConf() {\n\tconf = popupManager.newConfig();\n\tconf.draw();\n}", "_showEditor() {\n const EditorCls = this.richText ? CodeMirrorWrapper : TextAreaWrapper;\n\n if (this.richText) {\n RB.DnDUploader.instance.registerDropTarget(\n this.$el, gettext('Drop to add an image'),\n this._uploadImage.bind(this));\n }\n\n this._editor = new EditorCls({\n parentEl: this.el,\n autoSize: this.options.autoSize,\n minHeight: this.options.minHeight\n });\n\n this._editor.setText(this._value);\n this._value = '';\n this._richTextDirty = false;\n this._prevClientHeight = null;\n\n this._editor.$el.on(\n 'resize',\n _.throttle(() => this.$el.triggerHandler('resize'), 250));\n\n this.listenTo(this._editor, 'change', _.throttle(() => {\n /*\n * Make sure that the editor wasn't closed before the throttled\n * handler was reached.\n */\n if (this._editor === null) {\n return;\n }\n\n const clientHeight = this._editor.getClientHeight();\n\n if (clientHeight !== this._prevClientHeight) {\n this._prevClientHeight = clientHeight;\n this.$el.triggerHandler('resize');\n }\n\n this.trigger('change');\n }, 500));\n\n this.focus();\n }", "function initCanvasAndEditor() {\n // Editor\n initEditor();\n\n // Canvas\n canvasResizer();\n renderCanvas();\n\n // Listeners\n addListeners();\n}", "constructor(spec) {\n\t\tsuper(spec);\n\t\tvar make = this.make;\n\t\tthis.factory = factory;\n\t\tthis.Object_KVP = Object_KVP_Editor;\n\n\t\t//this._super(spec);\n\n\t\tthis.add_class('object-editor');\n\t\tthis.__type_name = 'object_editor';\n\n\t}", "static Setup () {\n BrowserUI.instance = new BrowserUI()\n BrowserUI.instance.createWorkbench()\n document.getElementById('tabDefault').click()\n REDIPS.drag.init()\n REDIPS.drag.dropMode = 'single' // one item per cell\n REDIPS.drag.trash.question = null // don't confirm deletion\n }", "make_control_panel()\r\n {\r\n /* Add a button for controlling the scene. */\r\n this.key_triggered_button( \"Change Colors\", [ \"c\" ], this.set_colors );\r\n\r\n /* toggle your outline on and off */\r\n this.key_triggered_button( \"Outline\", [ \"o\" ], () => {\r\n this.drawing_outlines = !this.drawing_outlines;\r\n } );\r\n\r\n /* toggle swaying on and off */\r\n this.key_triggered_button( \"Sit still\", [ \"m\" ], () => {\r\n this.is_swaying = !this.is_swaying;\r\n } );\r\n\r\n /* toggle extra credit scaling on and off */\r\n this.new_line();\r\n this.key_triggered_button( \"Extra credit part II\", [ \"x\" ], () => {\r\n this.extraCreditII = !this.extraCreditII;\r\n } );\r\n\r\n /* change the max angle */\r\n this.new_line();\r\n this.key_triggered_button( \"max angle-\", [ \"k\" ], () => {\r\n this.maxAngle += 0.01\r\n } );\r\n this.live_string( box => { box.textContent = \"max angle: \" + (-1*this.maxAngle.toFixed(2)) } );\r\n this.key_triggered_button( \"max angle+\", [ \"l\" ], () => {\r\n this.maxAngle -= 0.01;\r\n } );\r\n\r\n /* change the hertz */\r\n this.new_line();\r\n this.key_triggered_button( \"hertz-\", [ \"[\" ], () => {\r\n this.hertz -= 0.1;\r\n if (this.hertz < 0) this.hertz = 0;\r\n } );\r\n this.live_string( box => { box.textContent = \"Hertz: \" + this.hertz.toFixed(1) } );\r\n this.key_triggered_button( \"hertz+\", [ \"]\" ], () => {\r\n this.hertz += 0.1;\r\n } );\r\n }", "function setup_editor() {\n $('#microbit-svg').removeClass();\n $('#microbit-svg').addClass('microbit-svg');\n // Show the controls.\n $('.controls').show();\n // Ensure the form never submits.\n $('#control-form').submit(function(e) {\n return false;\n });\n // Set up the colour scheme for the device.\n set_flavour('banana');\n $('#flavour').change(function() {\n var flavour = $(this).find(\"option:selected\").attr('value');\n set_flavour(flavour);\n });\n // Ensure that Crocodile clips can be toggled on the device.\n $(':checkbox').change(function() {\n crocodile(this.name, this.checked);\n });\n // Built in images and fonts\n var image_names = Object.keys(images);\n for(i=0; i<image_names.length; i++) {\n var name = image_names[i];\n $('#images').append('<option value=\"'+name+'\">'+name+'</option>');\n }\n var char_names = Object.keys(font);\n for(i=0; i<char_names.length; i++) {\n var name = char_names[i];\n $('#images').append('<option value=\"'+name+'\">'+name+'</option>');\n }\n $('#images').change(function() {\n var image = $(this).find(\"option:selected\").attr('value');\n if(images[image]) {\n show(images[image]);\n if(image == 'clear') {\n delete QS['image'];\n } else {\n QS['image'] = image;\n delete QS['scroll'];\n }\n } else {\n show(font[image])\n }\n });\n // Button clicks\n $('#button-a').click(function(e) {\n console.log(\"Button A clicked\");\n });\n $('#button-b').click(function(e) {\n console.log(\"Button B clicked\");\n });\n // Text scrolling\n $('#start_scroll').click(function(e) {\n for(i=0; i<TIMEOUTS.length; i++) {\n window.clearTimeout(TIMEOUTS[i]);\n }\n TIMEOUTS = [];\n var text = $('#scroll').val().trim();\n var repeat = $('#repeat')[0].checked;\n if(text.length > 0) {\n scroll_text(text, 100, repeat);\n QS['scroll'] = text;\n QS['repeat'] = repeat;\n delete QS['image'];\n } else {\n alert(\"You must enter some text!\");\n }\n });\n // Reset the form and state.\n $('#reset').click(function(e) {\n QS = {};\n show(images['clear']);\n set_flavour('banana');\n crocodile('pin-0', false);\n crocodile('pin-1', false);\n crocodile('pin-2', false);\n crocodile('pin-3v', false);\n crocodile('pin-gnd', false);\n });\n // Update the target when the direct link is clicked.\n $('#direct-button').click(function(e) {\n set_qs(QS);\n });\n}", "function show_additional_panel(tool){\n var new_panel = '';\n switch(tool){\n case 'polyline':\n case 'line':\n case 'path':\n case 'multipath':\n new_panel = 'open_shape_style';\n break;\n case 'polygon':\n case 'rect':\n case 'circle':\n new_panel = 'closed_shape_style';\n break;\n case 'image':\n new_panel = 'image_style';\n break;\n }\n if(g['additional_panel'] != new_panel){\n if(g['additional_panel'] != '')\n // Hide old panel\n getById(g['additional_panel']).className = 'hidden';\n if(new_panel != ''){\n var panel = getById(new_panel);\n // Show the new panel\n panel.className = 'new_panel';\n }\n // Save changes\n g['additional_panel'] = new_panel;\n }\n}", "function defineRegion(){\n\n\t//console.log(' begin region definition ');\n\n\t// drawTypeInputPanel_Boostrap(); //current disabled \n\tfinishDefinition();\n\t// drawTypeInputPanel();\n}", "init() {\n this.editor.style.width = this.width;\n this.editor.style.height = this.height;\n this.bar.setupToolbar();\n\n this.createTag(\"\", this.getActiveTags(), this.getActiveStyle());\n\n let tools = document.querySelectorAll(\".editor-button\");\n tools.forEach(t => {\n t.addEventListener('click', (e) => {\n this.updateStyle(e);\n });\n });\n }", "function onPaletteChanged() {\n if (_tile) drawEditorView(_tile);\n}", "function init(e) {\r\n\r\n\tbackgroundPane = dojo.widget.byId(\"backgroundPane\");\r\n\tfontPane = dojo.widget.byId(\"fontPane\");\r\n\tcolorPane = dojo.widget.byId(\"colorPane\");\r\n\timagePane = dojo.widget.byId(\"imagePane\");\r\n\tuploadPane = dojo.widget.byId(\"uploadPane\");\r\n\tdeletePane = dojo.widget.byId(\"deletePane\");\r\n\tyahooLinksPane = dojo.widget.byId(\"yahooLinksPane\");\r\n\ttabContainerSearchUi = dojo.widget.byId(\"tabContainerSearchUi\");\r\n\tssbcpPane = dojo.widget.byId(\"ssbcpPane\");\r\n\t\r\n\tdojo.event.kwConnect({srcObj:colorPicker, srcFunc:\"onColorSelect\", targetObj:this, \r\n\t\t\ttargetFunc:\"updateColorAndClose\", once:true});\r\n\t\r\n\t// Sidebar needs to be drawn after the rest of the Graphics are initiated to\r\n\t// prevent Firefox from drawing it incorrectly...\r\n\tdocument.getElementById(\"side-bar\").style.display = \"block\";\r\n\t\r\n\tverifyCheckboxes();\r\n}", "function shapeFactory(){\r\n}", "function updatePanel(editor) {\n var $svgParent = $(\".svg-preview\", $svgPanel);\n $svgParent.html(editor.document.getText());\n var $svgRoot = $svgParent.children();\n \n if (!$svgRoot.length) { // empty document\n return;\n }\n \n updateSize($svgParent, $svgRoot);\n }", "function CreateSpecialOfferPanel(name, percentage, command)\n{\n /**\n Create a panel for insert/editing special_offers and add on the body\n\n :param name String:\n The name of the special_offer that will be showing on the input name\n\n :param percentage String:\n The percentage of the special_offer that will be showing on the input percentage\n\n :param command String:\n 'Insert'\n 'Edit'\n 'Delete'\n */\n\n // Format the title according the Command parameter\n var title = '';\n switch (command) {\n case COMMAND_INSERT : title = PANEL_TITLE_ADDING_SPECIAL_ORDER; break;\n case COMMAND_EDIT : title = PANEL_TITLE_EDITING_SPECIAL_ORDER; break;\n case COMMAND_DELETE : title = PANEL_TITLE_DELETING_SPECIAL_ORDER; break;\n }\n\n // Create the background panel element object\n panel_bg = document.createElement('div');\n panel_bg.className = 'panel_bg';\n panel_bg.id = 'panel_bg';\n\n // Create the panel element object\n panel = document.createElement('div');\n panel.className = 'panel';\n panel.id = 'panel';\n\n // Create the content of the panel\n var panel_content = '';\n panel_content += ' <div class=\"tit\">' + title + '</div>';\n panel_content += ' <div class=\"lin\">';\n panel_content += ' <label>Name</label>';\n panel_content += ' <input type=\"text\" id=\"spo_name\" value=\"' + name + '\" placeholder=\"SpecialOffer name\" />';\n panel_content += ' </div>';\n panel_content += ' <div class=\"lin\">';\n panel_content += ' <label>Percentage</label>';\n panel_content += ' <input type=\"text\" id=\"spo_percentage\" value=\"' + percentage + '\" placeholder=\"only the number\" />';\n panel_content += ' </div>';\n panel_content += ' <div class=\"buttons\">';\n panel_content += ' <div class=\"btn\" id=\"panel_save\" onclick=\"Do' + command + 'SpecialOffer();\">Save</div>';\n panel_content += ' <div class=\"btn\" id=\"panel_cancel\" onclick=\"DoCancel' + command + 'SpecialOffer();\">Cancel</div>';\n panel_content += ' <div style=\"clear:both;\"></div>';\n panel_content += ' </div>';\n\n panel.innerHTML = panel_content;\n\n // Insert the panel and background panel to the body\n document.body.appendChild(panel_bg);\n document.body.appendChild(panel);\n\n // Associate the objects of the panel into variables\n obj_spo_name = document.getElementById('spo_name');\n obj_spo_percentage = document.getElementById('spo_percentage');\n}", "function SetShape(obj) {\n var drawingshape;\n drawingshape = { type: \"Basic\", shape: obj };\n node = {\n shape: drawingshape\n };\n diagramInstance.drawingObject = node;\n enableTool();\n}", "function initPanel() {\n\tvar i;\n\tallpanel = document.getElementsByClassName(\"settingPanel\");\n\tallpanelholder = document.getElementById(\"settingpanelgroup\");\n\tfor (i = 0;i < allpanel.length;++i)\n\t{\n\t\tallpanel[i].style.height = allpanel[i].offsetHeight + \"px\";\n\t\tallpanel[i].firstElementChild.addEventListener('click',changePanel);\n\t\tallpanel[i].classList.remove(\"selected\");\n\t}\n\tallpanel[0].firstElementChild.click();\n\tallpanelholder.setAttribute(\"contextualType\",\"normal\");\n}", "function editModeSetup() {\n bodyActiveZone = document.getElementById(\"activeEditZone\");\n}", "function set_panel_defaults(itm,row,col) {\r\n\tif (itm === null || row === null || col === null) {return;} //no item received\r\n\r\n\tvar ed=itm.getProperties().edit();\r\n\tvar box=ed.getBox(\"i.box\");\r\n\tbox.setColor(\"bt\",\"ns\",0x64ffffff);\r\n\tbox.setColor(\"bl,br,bb\",\"ns\",0x64ffffff);//0xff33b5e5);\r\n\t//box.setSize(\"bt\",10);\r\n\t//box.setSize(\"bl,br,bb\",10);\r\n\ted.commit();\r\n\r\n\tvar itm_c=itm.getContainer();\r\n\tvar ed=itm_c.getProperties().edit();\r\n\ted.setBoolean(\"newOnGrid\",true);\r\n\ted.setBoolean(\"allowDualPosition\",false);\r\n\ted.setBoolean(\"useDesktopSize\",false);\r\n\ted.setString(\"scrollingDirection\",\"NONE\");\r\n\ted.setString(\"gridPColumnMode\",\"NUM\");\r\n\ted.setString(\"gridLColumnMode\",\"NUM\");\r\n\ted.setString(\"gridPRowMode\",\"NUM\");\r\n\ted.setString(\"gridLRowMode\",\"NUM\");\r\n\ted.setInteger(\"gridPColumnNum\",col);\r\n\ted.setInteger(\"gridLColumnNum\",col);\r\n\ted.setInteger(\"gridPRowNum\",row);\r\n\ted.setInteger(\"gridLRowNum\",row);\r\n\ted.setBoolean(\"swapItems\",true);\r\n\ted.commit();\r\n}", "initNodeEditor() {\n this.container = document.getElementById('d3-node-editor');\n\n this.editor = new D3NE.NodeEditor(\n `${this.name}NodeEditor${this._version}`,\n this.container,\n this.components,\n this.menu,\n );\n\n this.engine = new D3NE.Engine(`${this.name}NodeEditor${this._version}`,\n this.components);\n\n this.engine.onError =\n (msg, obj) => { console.error(`Node Editor Error: ${msg}`, obj); };\n\n this._addEventListener();\n\n this.editor.view.zoomAt(this.editor.nodes);\n this.engine.process(this.editor.toJSON());\n this.editor.view.resize();\n }", "function setup() {\n const doc = Sketch.Document.getSelectedDocument();\n log(\"testing yarn\");\n log(doc);\n if (!doc) {\n return false;\n }\n\n // From plugin \"super shapes\"\n\n // var Panel = NSPanel.alloc().init();\n // Panel.setTitleVisibility(NSWindowTitleHidden);\n // Panel.setTitlebarAppearsTransparent(true);\n // Panel.standardWindowButton(NSWindowCloseButton).setHidden(false);\n // Panel.standardWindowButton(NSWindowMiniaturizeButton).setHidden(true);\n // Panel.standardWindowButton(NSWindowZoomButton).setHidden(true);\n // Panel.setWorksWhenModal(true);\n // NSApp.runModalForWindow(Panel);\n\n selection = doc.selectedLayers;\n if (!selection || selection.length == 0) {\n alert('Select a layer!');\n return false;\n }\n\n return true;\n}", "function setupSplitter() {\n // adjust splitter within next sibling node's width|height\n opts.panelAfterSize = opts.containerSize - opts.panelBeforeSize - opts.elSize;\n\n drawSplitter();\n\n // On window resize event after adjusting size of left and right nodes of splitter,\n // container size increases too. Not sure why? This code to check that extra increment.\n adjustPanelAfterWindowResize();\n }", "function positionPanel() {\n $(\"#ad-hoc-panel\").position({\n my: \"left+10 top\",\n at: \"right top\",\n of: model.selectedAnchor,\n collision: \"flipfit fit\"\n })\n}", "constructor() {\n super();\n this.layer = new this.paper.Layer();\n this._widget = new paper.SelectionWidget({\n layer: this.layer\n });\n this.paper.project.selectionWidget = this._widget;\n }", "function appendPanel(){\n\t\t/*jQuery('<div/>', {\n\t\t id: \"foo\",\n\t\t text: \"Get into Facebook\"\n\t\t }).appendTo(\"body\");*/\n\t\tvar panelSeklly = '<div class=\"panel panel-default\">\\n' +\n\t\t\t\t '\t<div class=\"panel-heading\">\\n' + \n\t\t\t\t '\t\t<h3 class=\"panel-title\">Panel title</h3>\\n' + \n\t\t\t \t '\t</div>\\n' + \n\t \t\t\t '\t<div class=\"panel-body\">\\n' + \n \t\t\t\t '\t\tPanel content\\n' + \n \t\t\t\t '\t</div>\\n' + \n\t\t\t\t '\t<div class=\"panel-footer\">Panel footer</div>\\n' + \n\t\t\t\t'</div>';\n\t\t//window.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 setBasicContentsAdGraphicsPanel() {\n var htmlStr = \"\";\n //make the dropdown disappear and put the cursor at the right text box...?\n /*\n htmlStr += \"<span><a href='javascript:setAdGraphicsFields(false, -1, \\\"\\\" , \\\"\\\", \\\"\\\")'>Add a new creative.</a></span><hr><p>\";\n htmlStr += \"<span>Hint: Type words to search (by name) your existing creatives.</span><hr>\";\n */\n htmlStr += '<span>' + hseLabelInt['creatives'] + ':</span><br>';\n\n for (var gid in graphicObjs){\n var obj = graphicObjs[gid];\n\n htmlStr += \"<a href='javascript:populateCreativesTab(false, \" + gid +\n \", \\\"\" + escape(obj.hse_gname) + \"\\\", \\\"\" + obj.image_url + \"\\\", \\\"\" +\n obj.target_url +\n \"\\\")'><img height=\\\"52\\\" width=\\\"90\\\" src=\\\"\";\n htmlStr += obj.image_url + \"\\\" class=\\\"hastip tiny_adgraphics_img\\\" title=\\\"\";\n htmlStr += obj.target_url + \",\" + obj.hse_gname;\n htmlStr += \"\\\"/></a>\";\n }\n var contents = $(htmlStr);\n var dest = $(\"#hse_graphicsPanel\");\n dest.empty();\n contents.appendTo(dest);\n $( \".hastip\").tooltip({show: {effect:\"none\", delay:0}});\n}", "function setup() {\n\t// display the messages from the database\n\tdisplaymessages();\n\t// Froala Editor Settings for different type of screen sizes\n\n\t$(\"#text\").froalaEditor({\n\t\ttoolbarButtons: [\n\t\t\t\"insertImage\",\n\t\t\t\"insertVideo\",\n\t\t\t\"insertFile\",\n\t\t\t\"insertLink\",\n\t\t\t\"|\",\n\t\t\t\"color\",\n\t\t\t\"|\",\n \"specialCharacters\",\n\t\t],\n\t\ttoolbarButtonsMD: [\n\t\t\t\"insertLink\",\n\t\t\t\"insertImage\",\n\t\t\t\"insertVideo\",\n\t\t\t\"insertFile\",\n\t\t\t\"|\",\n\t\t\t\"specialCharacters\",\n\t\t\t\"|\",\n\t\t\t\"color\",\n\t\t],\n\t\ttoolbarButtonsSM: [\n\t\t\t\"insertLink\",\n\t\t\t\"insertImage\",\n\t\t\t\"insertVideo\",\n\t\t\t\"insertFile\",\n\t\t\t\"|\",\n\t\t\t\"color\",\n\t\t\t\"|\",\n\t\t\t\"specialCharacters\",\n\t\t],\n\t\ttoolbarButtonsXS: [\n\t\t\t\"insertImage\",\n\t\t\t\"insertVideo\",\n\t\t\t\"insertLink\",\n\t\t\t\"insertFile\",\n\t\t\t\"|\",\n\t\t\t\"specialCharacters\",\n\t\t\t\"|\",\n\t\t\t\"color\",\n\t\t],\n\n\t\ttheme: \"gray\",\n\t\theightMin: 80,\n\t\theightMax: 80,\n\t\twidth: \"100%\",\n\t\timageDefaultWidth: 50,\n\t\trequestWithCORS: true,\n\t\timageResizeWithPercent: true,\n\t\tcharCounterCount: true,\n\t\ttoolbarBottom: true,\n\t\ttabSpaces: 4,\n\t});\n\t// remove agora unlicensed product div after the page loads\n\tvar unlicensed_box = document.getElementsByClassName(\"fr-box\")[0];\n\tif (\n\t\tunlicensed_box &&\n\t\tunlicensed_box.childNodes.length >= 2 &&\n\t\tunlicensed_box.childNodes[1].tagName == \"DIV\" &&\n\t\tunlicensed_box.childNodes[1].style.position == \"absolute\"\n\t) {\n\t\tunlicensed_box.childNodes[1].remove();\n\t}\n}", "function init() {\n\n\t\t// Bind the editor elements to variables\n\t\tbindElements();\n\n\t\t// Create event listeners for keyup, mouseup, etc.\n\t\tcreateEventBindings();\n\t}", "addControls() {\n console.log('add controls',this.top_element);\n var html = `\n <div class='control_div'>\n <div id='marker' class='dragthing rounded-sm'><img src='/annotation/marker-blue.svg'/></div>\n <div id='arrow' class='dragthing rounded-sm'><img src='/annotation/myarrow.svg'/></div>\n <div id='circle' class='dragthing rounded-sm'><img src='/annotation/circle.svg'/></div>\n <div id='rect' class='dragthing rounded-sm'><img src='/annotation/rect.svg'/></div>\n <div id='text' class='dragthing rounded-sm'><img src='/annotation/text.svg'/></div>\n <div class='palette fill'>\n <span>Fill</span>\n <span class='palette-box' data-color=\"#000000\"></span>\n <span class='palette-box' data-color=\"#575757\"></span>\n <span class='palette-box' data-color=\"#ad2323\"></span>\n <span class='palette-box' data-color=\"#2a4bd7\"></span>\n <span class='palette-box' data-color=\"#1d6914\"></span>\n <span class='palette-box' data-color=\"#814a19\"></span>\n <span class='palette-box' data-color=\"#8126c0\"></span>\n <span class='palette-box' data-color=\"#a0a0a0\"></span>\n <span class='palette-box' data-color=\"#81c57a\"></span>\n <span class='palette-box' data-color=\"#9dafff\"></span>\n <span class='palette-box' data-color=\"#29d0d0\"></span>\n <span class='palette-box' data-color=\"#ff9233\"></span>\n <span class='palette-box' data-color=\"#ffee33\"></span>\n <span class='palette-box' data-color=\"#e9debb\"></span>\n <span class='palette-box' data-color=\"#ffcdf3\"></span>\n <span class='palette-box' data-color=\"#ffffff\"></span>\n <span class='palette-box' data-color=\"\"></span>\n </div>\n <div class='palette stroke'>\n <span>Line</span>\n <span class='palette-box' data-color=\"#000000\"></span>\n <span class='palette-box' data-color=\"#575757\"></span>\n <span class='palette-box' data-color=\"#ad2323\"></span>\n <span class='palette-box' data-color=\"#2a4bd7\"></span>\n <span class='palette-box' data-color=\"#1d6914\"></span>\n <span class='palette-box' data-color=\"#814a19\"></span>\n <span class='palette-box' data-color=\"#8126c0\"></span>\n <span class='palette-box' data-color=\"#a0a0a0\"></span>\n <span class='palette-box' data-color=\"#81c57a\"></span>\n <span class='palette-box' data-color=\"#9dafff\"></span>\n <span class='palette-box' data-color=\"#29d0d0\"></span>\n <span class='palette-box' data-color=\"#ff9233\"></span>\n <span class='palette-box' data-color=\"#ffee33\"></span>\n <span class='palette-box' data-color=\"#e9debb\"></span>\n <span class='palette-box' data-color=\"#ffcdf3\"></span>\n <span class='palette-box' data-color=\"#ffffff\"></span>\n <span class='palette-box' data-color=\"\"></span>\n </div>\n <div><span class='delete btn btn-primary'>&#9003;</span</div> \n </div>\n `;\n $(this.top_element).append(html);\n this.control_element = $('.control_div',this.top_element).get(0);\n this.top_element.tabIndex=1000;\n\n // For each individual little colored box, set color = data\n $('.palette-box',this.control_element).each(function(){\n var c = $(this).data('color');\n if(c.length>0) $(this).css('background-color',c);\n });\n\n // color controls: clicking fill or stroke\n var self=this;\n $('.fill .palette-box',this.control_element).on('click',function(){\n var obj = self.canvas.getActiveObject();\n var c = $(this).data('color');\n console.log('click fill color',obj,c,this);\n obj.set({fill:$(this).data('color')});\n self.canvas.renderAll();\n });\n\n $('.stroke .palette-box',this.control_element).on('click',function(){\n var obj = self.canvas.getActiveObject();\n var c = $(this).data('color');\n obj.set({stroke:c});\n if(obj.my_text_obj && c != '') obj.my_text_obj.set({fill:c,stroke:c});\n self.canvas.renderAll();\n });\n\n // delete if button pressed or ke pressed.\n var delete_selected = function() {\n var obj = self.canvas.getActiveObject();\n if(obj) {\n if(obj.my_text_obj) self.canvas.remove(obj.my_text_obj);\n self.canvas.remove(obj);\n self.canvas.renderAll();\n }\n }\n\n $('.delete',this.control_element).on('click',delete_selected);\n\n\n // undo/redo\n this.top_element.addEventListener('keydown',function(event){\n console.log('keydown',event.key);\n switch(event.key) {\n case \"Backspace\":\n case \"Delete\":\n delete_selected();\n break;\n case \"z\":\n //https://github.com/lyzerk/fabric-history#readme\n if(event.ctrlKey || event.metaKey){\n self.canvas.undo();\n }\n break;\n case \"Z\":\n if(event.ctrlKey || event.metaKey){\n self.canvas.redo();\n }\n break;\n }\n },false);\n\n\n // If you start dragging a thing, put it's id in the drag info\n $('.dragthing',this.canvas_element).on('dragstart',function(ev){\n ev.originalEvent.dataTransfer.setData(\"text\", this.id);\n });\n\n }", "constructor() {\n super();\n this.name = 'ellipse';\n this.path = null;\n this.topLeft = null;\n this.bottomRight = null;\n }", "attach() {\n\t\tif (!this.panel) {\n\t\t\tthis.panel = atom.workspace.addRightPanel({item: this, visible: false, priority: -1000});\n\t\t}\n\t}", "panel() {\n\n if (this.$p.cursor.grid_id !== this.layout.id) {\n return\n }\n\n let lbl = this.$p.cursor.y$.toFixed(this.layout.prec)\n this.ctx.fillStyle = this.$p.colors.colorPanel\n\n let panwidth = this.layout.sb + 1\n\n let x = - 0.5\n let y = this.$p.cursor.y - PANHEIGHT * 0.5 - 0.5\n let a = 5 //* 0.5\n this.ctx.fillRect(x - 0.5, y, panwidth, PANHEIGHT)\n this.ctx.fillStyle = this.$p.colors.colorTextHL\n this.ctx.textAlign = 'left'\n this.ctx.fillText(lbl, a, y + 16)\n\n }", "init(config = {}) {\n const els = config.container;\n if (!els) throw new Error(\"'container' is required\");\n config = { ...defaultConfig, ...config, grapesjs: this };\n config.el = isElement(els) ? els : document.querySelector(els);\n const editor = new Editor(config).init();\n\n // Load plugins\n config.plugins.forEach(pluginId => {\n let plugin = plugins.get(pluginId);\n const plgOptions = config.pluginsOpts[pluginId] || {};\n\n // Try to search in global context\n if (!plugin) {\n const wplg = window[pluginId];\n plugin = wplg && wplg.default ? wplg.default : wplg;\n }\n\n if (plugin) {\n plugin(editor, plgOptions);\n } else if (isFunction(pluginId)) {\n pluginId(editor, plgOptions);\n } else {\n console.warn(`Plugin ${pluginId} not found`);\n }\n });\n\n editor.getModel().loadOnStart();\n config.autorender && editor.render();\n editors.push(editor);\n\n return editor;\n }", "function setup() {\n mode = modeTypes[0];\n blackMode.classList.add('selected-mode');\n\n grid.style.width = `${gridDim}px`;\n grid.style.height = `${gridDim}px`;\n createGrid(16);\n\n modeBtns.forEach((btn) => {\n btn.addEventListener('click', changeMode);\n });\n clearBtn.addEventListener('click', clear);\n sizeBtn.addEventListener('click', changeSize);\n}", "function set_properties(obj) {\r\n select_layer(obj);\r\n if (obj.type == \"i-text\") {\r\n fill_panel_toggle('enable');\r\n stroke_panel_toggle('enable');\r\n shadow_panel_toggle('enable');\r\n set_userinput_fill(obj.get('fill'));\r\n set_userinput_fontWeight(obj.get('fontWeight'));\r\n set_userinput_stroke(obj);\r\n set_userinput_shadow(obj);\r\n $(\"#font\").removeClass(\"disabledPanel\");\r\n $(\"#fill\").removeClass(\"disabledPanel\");\r\n }\r\n else if (obj.type == \"image\") {\r\n fill_panel_toggle('disable');\r\n stroke_panel_toggle('enable');\r\n shadow_panel_toggle('enable');\r\n // $(\"#font\").addClass(\"disabledPanel\");\r\n // $(\"#fill\").addClass(\"disabledPanel\");\r\n }\r\n}", "init()\n { this.animated_children.push( this.axes_viewer = new Axes_Viewer( { uniforms: this.uniforms } ) );\n // Scene defaults:\n this.shapes = { box: new defs.Cube() };\n const phong = new defs.Phong_Shader();\n this.material = { shader: phong, color: color( .8,.4,.8,1 ) };\n }", "function showArtifactPanel() {\n clear()\n this.style.background = '#8ed41f';\n artifact_panel.style.display = 'block';\n gId('textarea_artifact').focus();\n}", "initSettings() {\n\t\tthis.settingsPanel = document.createElement( 'div' );\n\t\tthis.settingsPanel.classList.add( 'kl-settings' );\n\t\tdocument.body.appendChild( this.settingsPanel );\n\n\t\t// add heading\n\t\tconst row = this.getSettingRow();\n\t\trow.appendChild( document.createTextNode( \"CSS Styles\" ) );\n\t\trow.classList.add( 'kl-row__heading' )\n\t\tthis.settingsPanel.append( row );\n\n\t\t// add CSS box\n\t\tconst cssRow = this.getSettingRow();\n\t\tconst stylesTextArea = document.createElement( 'textarea' );\n\t\tconst parent = this;\n\t\tstylesTextArea.addEventListener( 'input', ( e ) => {\n\t\t\tconst value = e.target.value;\n\t\t\tparent.settings.styles = value;\n\t\t\tparent.refreshStyles();\n\t\t} );\n\t\tstylesTextArea.value = this.settings.styles;\n\t\tcssRow.appendChild( stylesTextArea );\n\t\tcssRow.classList.add( 'kl-row__styles' )\n\t\tthis.settingsPanel.append( cssRow );\n\t\t\n\n\t\t// Init the close button\n\t\tconst closeButtonRow = this.getSettingRow();\n\t\tcloseButtonRow.style.flexDirection = 'row-reverse';\n\t\tconst closeButton = document.createElement( 'button' );\n\t\tcloseButton.classList.add( 'kl-container__settings-button' );\n\t\tcloseButton.style.margin = 0;\n\t\tcloseButton.appendChild( document.createTextNode( \"Close\" ) );\n\t\tcloseButton.addEventListener( 'click', this.hideSettingsPanel );\n\t\tcloseButtonRow.append( closeButton );\n\t\tthis.settingsPanel.append( closeButtonRow );\n\t}", "add(shape) {\n const elementToAffect = this.currentView ? this.currentView : this.domElement;\n elementToAffect.insertBefore(shape.domGroup, elementToAffect.firstChild);\n const image = this.domElement.getElementById(elementToAffect.attributes.id.nodeValue + \"image\");\n if (image) {\n elementToAffect.insertBefore(image, elementToAffect.firstChild);\n }\n shape.view = elementToAffect;\n this.clicked = false;\n this.currentShape = shape;\n this.masterState.push(shape);\n this.currentState.push(shape);\n this.shapes.push(shape);\n // setting default class to area\n shape.domGroup.classList.add(\"area\");\n }", "function addShape(pConfShape, pIndex) {\n\t\tvar myCanvas = myCanvasContainer.svg().svg(\"get\"),\n\t\t\tg = myCanvasContainer.find(\"#shapesOverlay\").svg(),\n\t\t\tmyElemId = \"shape_\" + gCountTexts++,\n\t\t\tmyShape = null,\n\t\t\tmyShapeHandles = null;\n\t\tswitch (pConfShape.type) {\n\t\t\tcase \"ellipse\":\n\t\t\t\tmyShape = myCanvas.ellipse(g, pConfShape.position.x, pConfShape.position.y, pConfShape.rx, pConfShape.ry, { \"id\": myElemId });\n\t\t\t\tbreak;\n\t\t\tcase \"polygon\":\n\t\t\t\t// TODO\n\t\t\t\tmyShape = myCanvas.rect(g, pConfShape.position.x, pConfShape.position.y, 50, 50, $(\"#cornerRadiusSize\").val() * 1, $(\"#cornerRadiusSize\").val() * 1, { \"id\": myElemId });\n\t\t\t\tbreak;\n\t\t\tcase \"rect\":\n\t\t\tdefault:\n\t\t\t\tmyShape = myCanvas.rect(g, pConfShape.position.x, pConfShape.position.y, pConfShape.width, pConfShape.height, pConfShape.rx, pConfShape.ry, { \"id\": myElemId });\n\t\t\t\tbreak;\n\t\t}\n\t\tmyShape = $(myShape);\n\t\tmyShape.data(\"x\", pConfShape.position.x);\n\t\tmyShape.data(\"y\", pConfShape.position.y);\n\t\tfor (myStyle in pConfShape.style) {\n\t\t\tmyShape.css(myStyle, pConfShape.style[myStyle]);\n\t\t}\n\t\tswitch (pConfShape.type) {\n\t\t\tcase \"polygon\":\n\t\t\t\t// TODO\n\t\t\t\tbreak;\n\t\t\tcase \"ellipse\":\n\t\t\t\tmyShape.on(\"mouseenter\", function(e) {\n\t\t\t\t\tif (!gIsReadOnly) {\n\t\t\t\t\t\tif (!$(this).hasClass(\"moving\") && myDraggedElement === null && !$(this).hasClass(\"resizing\") && myResizedElement === null && !$(this).hasClass(\"rotating\") && myRotatedElement === null) {\n\t\t\t\t\t\t\tvar myShapePositionX = myShape.data(\"x\"),\n\t\t\t\t\t\t\t\tmyShapePositionY = myShape.data(\"y\"),\n\t\t\t\t\t\t\t\tmyShapeRadiusX = myShape.attr(\"rx\") * 1,\n\t\t\t\t\t\t\t\tmyShapeRadiusY = myShape.attr(\"ry\") * 1;\n\t\t\t\t\t\t\tmyShapeOptionsHandler.css(\"top\", (myShapePositionY + myCanvasContainer[0].offsetTop - 8) + \"px\")\n\t\t\t\t\t\t\t\t.css(\"left\", (myShapePositionX + myCanvasContainer[0].offsetLeft - 8) + \"px\")\n\t\t\t\t\t\t\t\t.on(\"mouseenter\", function(e) {\n\t\t\t\t\t\t\t\t\tmyContextMenuShape.css(\"top\", (myShapePositionY + myCanvasContainer[0].offsetTop - 8) + \"px\")\n\t\t\t\t\t\t\t\t\t\t.css(\"left\", (myShapePositionX + myCanvasContainer[0].offsetLeft - 8) + \"px\")\n\t\t\t\t\t\t\t\t\t\t.attr(\"rel\", myShape.attr(\"id\"));\n\t\t\t\t\t\t\t\t\t$(this).hide();\n\t\t\t\t\t\t\t\t\tmyContextMenuShape.show();\n\t\t\t\t\t\t\t\t\t// Keep menu open for 200ms\n\t\t\t\t\t\t\t\t\tpreventClosingContextMenu = true;\n\t\t\t\t\t\t\t\t\ttimeoutIdContextMenu = window.setTimeout(function() {\n\t\t\t\t\t\t\t\t\t\tpreventClosingContextMenu = false;\n\t\t\t\t\t\t\t\t\t}, 200);\n\t\t\t\t\t\t\t\t}).show();\n\t\t\t\t\t\t\tmyShapeOptionsHandler.parent().attr(\"rel\", myShape.attr(\"id\"));\n\t\t\t\t\t\t\tgCurrentElement = pConfShape;\n\t\t\t\t\t\t\tmyShapeHandlers.show();\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\tcase \"rect\":\n\t\t\tdefault:\n\t\t\t\tmyShape.on(\"mouseenter\", function(e) {\n\t\t\t\t\tif (!gIsReadOnly) {\n\t\t\t\t\t\tif (!$(this).hasClass(\"moving\") && myDraggedElement === null && !$(this).hasClass(\"resizing\") && myResizedElement === null && !$(this).hasClass(\"rotating\") && myRotatedElement === null) {\n\t\t\t\t\t\t\tvar myShapePositionX = myShape.data(\"x\"),\n\t\t\t\t\t\t\t\tmyShapePositionY = myShape.data(\"y\"),\n\t\t\t\t\t\t\t\tmyShapeWidth = myShape.attr(\"width\") * 1,\n\t\t\t\t\t\t\t\tmyShapeHeight = myShape.attr(\"height\") * 1;\n\t\t\t\t\t\t\tmyShapeOptionsHandler.css(\"top\", (myShapePositionY + myCanvasContainer[0].offsetTop + (myShapeHeight / 2) - 8) + \"px\")\n\t\t\t\t\t\t\t\t.css(\"left\", (myShapePositionX + myCanvasContainer[0].offsetLeft + (myShapeWidth / 2) - 8) + \"px\")\n\t\t\t\t\t\t\t\t.on(\"mouseenter\", function(e) {\n\t\t\t\t\t\t\t\t\tmyContextMenuShape.css(\"top\", (myShapePositionY + myCanvasContainer[0].offsetTop + (myShapeHeight / 2) - 8) + \"px\")\n\t\t\t\t\t\t\t\t\t\t.css(\"left\", (myShapePositionX + myCanvasContainer[0].offsetLeft + (myShapeWidth / 2) - 8) + \"px\")\n\t\t\t\t\t\t\t\t\t\t.attr(\"rel\", myShape.attr(\"id\"));\n\t\t\t\t\t\t\t\t\t$(this).hide();\n\t\t\t\t\t\t\t\t\tmyContextMenuShape.show();\n\t\t\t\t\t\t\t\t\t// Keep menu open for 200ms\n\t\t\t\t\t\t\t\t\tpreventClosingContextMenu = true;\n\t\t\t\t\t\t\t\t\ttimeoutIdContextMenu = window.setTimeout(function() {\n\t\t\t\t\t\t\t\t\t\tpreventClosingContextMenu = false;\n\t\t\t\t\t\t\t\t\t}, 200);\n\t\t\t\t\t\t\t\t}).show();\n\t\t\t\t\t\t\tmyShapeOptionsHandler.parent().attr(\"rel\", myShape.attr(\"id\"));\n\t\t\t\t\t\t\tgCurrentElement = pConfShape;\n\t\t\t\t\t\t\tmyShapeHandlers.show();\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\tmyShape.on(\"mouseleave\", function(e) {\n\t\t\tif (!preventClosingContextMenu) {\n\t\t\t\tmyContextMenuShape.hide();\n\t\t\t\tmyShapeOptionsHandler.hide();\n\t\t\t}\n\t\t});\n\t\t// Update serialization\n\t\tif (!gIsImporting) {\n\t\t\tgCurrentConf.shapes.push(pConfShape);\n\t\t\tmyShape.data(\"index\", gCurrentConf.shapes.length - 1);\n\t\t} else {\n\t\t\tmyShape.data(\"index\", pIndex);\n\t\t}\n\t}", "function setupParts() {\n if (setupParts.called) return;\n setupParts.called = true;\n CreateInfoButton('info', { frontID: 'front', foregroundStyle: 'white', backgroundStyle: 'black', onclick: 'showBack' });\n CreateGlassButton('done', { text: 'Done', onclick: 'showFront' });\n CreateShape('topRectangleShape', { rightImageWidth: 12, leftImageWidth: 12 });\n CreateShape('bottomRectangleShape', { rightImageWidth: 12, leftImageWidth: 12 });\n CreateScrollArea('contentarea', { spacing: 11, leftMargin: 11, rightMargin: 7, hasVerticalScrollbar: true, autoHideScrollbars: true, scrollbarMargin: 6, scrollbarDivSize: 18 });\n CreateText('loading-text', { text: 'Loading' });\n CreateText('article-length', { text: 'Article Length' });\n CreateGlassButton('glassbutton', { onclick: 'createNewTicket', text: '+' });\n CreateText('text', { text: 'Trac URL' });\n CreateText('text1', { text: 'User Name' });\n CreateGlassButton('glassbutton1', { onclick: 'viewSource', text: 'Source' });\n CreateGlassButton('glassbutton2', { onclick: 'viewWiki', text: 'Wiki' });\n CreateGlassButton('glassbutton3', { onclick: 'viewTimeline', text: 'Timeline' });\n CreateGlassButton('glassbutton4', { onclick: 'viewRoadmap', text: 'Roadmap' });\n}", "constructor(shape=null,pos=null){\n this.fsm = createDragStateMachine();\n this.fsm.observe({\n onLeftMouseMove:this.onLeftMouseMove.bind(this),\n onLeftMouseDown:this.onLeftMouseDown.bind(this),\n onEnterSelected:this.onEnterSelected.bind(this)\n });\n if(!shape || !pos){\n return;\n }\n this.install(shape,pos);\n }", "function createProxyEditorView(proxyEditorSelector) {\n proxyEditor = $(proxyEditorSelector);\n proxyEditor.bind('delete-proxy', onProxyDelete);\n proxyEditor.bind('apply', onProxyApply);\n proxyEditor.bind('scalarbar-visibility', onScalarBarVisibility);\n proxyEditor.bind('rescale-transfer-function', onRescaleTransferFunction);\n }", "function drawShape(x1, y1, x2, y2) { \n var left = Math.min(x1, x2); \n var top = Math.min(y1, y2); \n var right = Math.max(x1, x2); \n var bottom = Math.max(y1, y2); \n var settings = {fill: $('#fill').val(), stroke: $('#stroke').val(), \n strokeWidth: $('#swidth').val()}; \n var shape = $('#shape').val(); \n var node = null; \n\n\n var scale = ((right - left)/95);\n var $scope = angular.element('#content').scope();\n var mayugeColor = $('select[name=\"colorpicker4mayuge\"]').val();\n var rinkakuColor = $('select[name=\"colorpicker4rinkaku\"]').val();\n var rinkakuWidth = $('select[name=\"rinkakuWidth\"]').val();\n if ($scope.conf.optionsLR == \"r\") {\n node = svgWrapper.group({class_: \"draggable\", transform: \"translate(\" + right + \",\" + bottom + \")\"});\n svgWrapper.use(node, \"#path-r-mayuge-\" + $scope.conf.mayugeType, {fill: mayugeColor, transform: \"scale(\" + scale + \")\", stroke: rinkakuColor, strokeWidth: rinkakuWidth});\n } else {\n node = svgWrapper.group({class_: \"draggable\", transform: \"translate(\" + (right - (right - left)) + \",\" + bottom + \")\"});\n svgWrapper.use(node, \"#path-r-mayuge-\" + $scope.conf.mayugeType, {fill: mayugeColor, transform: \"scale(-\" + scale + \",\" + scale + \")\", stroke: rinkakuColor, strokeWidth: rinkakuWidth});\n }\n\n\n var makeSVGElementDraggable = svgDrag.setupCanvasForDragging();\n makeSVGElementDraggable(node);\n // node.addEventListener(\"mouseup\", $scope.export2canvas);\n node.addEventListener(\"dblclick\", function() {$scope.removeMayuge($(node));});\n $scope.export2canvas();\n // if ($scope.conf.autoSave) {\n // $scope.savePNG();\n // }\n\n\n drawNodes[drawNodes.length] = node; \n // $(node).mousedown(startDrag).mousemove(dragging).mouseup(endDrag); \n $('#svgArea').focus(); \n}", "function initialDesign(viewer){ \n //create design model\n var greenBox = viewer.entities.add({\n name : '设计模型',\n polylineVolume : {\n positions : [new Cesium.Cartesian3.fromDegrees(-122.3892091861, 37.7738780081, -29.2504926276),\n new Cesium.Cartesian3.fromDegrees(-122.3892480337, 37.7754872048, -28.9870413317),\n new Cesium.Cartesian3.fromDegrees(-122.3881664472, 37.7754636487, -28.7960743653),\n new Cesium.Cartesian3.fromDegrees(-122.388121449, 37.773975726, -28.9640646892)],\n shape :[new Cesium.Cartesian2(-10, -10),\n new Cesium.Cartesian2(10, -10),\n new Cesium.Cartesian2(10, 10),\n new Cesium.Cartesian2(-10, 10)],\n cornerType : Cesium.CornerType.BEVELED,\n material : Cesium.Color.WHITE.withAlpha(0.5),\n outline : true,\n outlineColor : Cesium.Color.BLACK\n }\n });\n\n greenBox.show = false;\n\n //create region\n var iframe = document.getElementsByClassName('cesium-infoBox-iframe')[0];\n\n iframe.setAttribute('sandbox', 'allow-same-origin allow-scripts allow-popups allow-forms allow-modals'); \n\n var e = viewer.entities.add({\n polygon : {\n hierarchy : {\n positions : [new Cesium.Cartesian3.fromDegrees(-122.3897195868, 37.7761320483, -28.8083237172),\n new Cesium.Cartesian3.fromDegrees(-122.3894522363, 37.7730635703, -29.0436988295),\n new Cesium.Cartesian3.fromDegrees(-122.3877113228, 37.7734856854, -29.139382365),\n new Cesium.Cartesian3.fromDegrees(-122.3878530435, 37.7763023092, -29.0629695339)]\n },\n material : Cesium.Color.BLUE.withAlpha(0.5)\n },\n name:\"宗地编号CH43\",\n description: 'Loading <div class=\"cesium-infoBox-loading\"></div>',\n description: \n '<h2 style=\"font-size: 22px;\">宗地基本资讯</h2>'+\n '<table class=\"cesium-infoBox-defaultTable\"><tbody>' +\n '<link rel=\"stylesheet\" href=\"/Component/designPanel.css\" media=\"screen\">'+\n '<tr><th>宗地编号</th><td>' + \"CH43\" + '</td></tr>' +\n '<tr><th>宗地位置</th><td>' + \"福州市XX区XX路XX号\" + '</td></tr>' +\n '<tr><th>净用地面积(平方公米)</th><td>' + \"48.9096\" + '</td></tr>' +\n '<tr><th>土地用途及使用年限</th><td>' + \"商业40年\" + '</td></tr>' +\n '<tr><th>拍卖起叫价</th><td>' + \"楼面地价:3000元/平方米\" + '</td></tr>' +\n '<tr><th>竞买保证金(万元)</th><td>' + \"7300\" + '</td></tr>' +\n '<tr><th>拍卖出让时间</th><td>' + \"2018/07/02\" + '</td></tr>' +\n '<tr><th>持证准用面积(亩)及方式</th><td>' + \"48.9096指标证书\" + '</td></tr>' +\n '<tr><th>出让人</th><td>' + \"福州市国土资源局\" + '</td></tr>' +\n '</tbody></table>'+\n '<h2 style=\"font-size: 22px;text-align: right;\">显示模型 <label class=\"switch\" style=\"top: -24px;\"><input type=\"checkbox\" onclick=\"showDmodel()\"><span class=\"slider round\"></span></label></h2>'+\n '<div id=\"Checkbar\" style=\"position: fixed;visibility: visible;opacity: 0;transition:opacity 0.2s linear;\">'+\n '<a href=\"Source/SampleData/designModel.ifc\" download>'+\n '<button id=\"Mydownload\"\">导出模型</button>'+\n '</a>'+\n '<h2 style=\"font-size: 22px;\">项目模型基本资讯</h2>'+\n '<table class=\"cesium-infoBox-defaultTable\"><tbody>' +\n '<tr><th>项目名称</th><td>' + \"福州市建案A\" + '</td></tr>' +\n '<tr><th>业主方</th><td>' + \"公司B\" + '</td></tr>' +\n '<tr><th>设计方</th><td>' + \"单位C\" + '</td></tr>' +\n '<tr><th>上传作者</th><td>' + \"雷翔\" + '</td></tr>' +\n '<tr><th>上传时间</th><td>' + \"2019/04/06\" + '</td></tr>' +\n '</tbody></table>'+\n '<button id=\"Mybutton\" onclick=\"move()\">查验</button>'+\n '<h2 style=\"font-size: 22px;\">规则设计条件</h2>'+\n '<table class=\"cesium-infoBox-defaultTable\"><tbody>' +\n '<tr><th>设计容积率总建筑面积/容积率</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>建筑密度</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>建筑高度</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>绿地率</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>规划用地使用性质</th><td>' + \" \" + '</td></tr>' +\n '</tbody></table>'+\n '<br>'+\n '<div id=\"myProgress\"> <div id=\"myBar\">0%</div></div><br>'+\n '</div>'\n });\n\n //Infobox event add method\n viewer.infoBox.frame.addEventListener('load', function() {\n //\n // Now that the description is loaded, register a click listener inside\n // the document of the iframe.\n //\n\n viewer.infoBox.frame.contentDocument.greenBox = greenBox\n viewer.infoBox.frame.contentDocument.body.addEventListener('click', function(e) {\n //\n // The document body will be rewritten when the selectedEntity changes,\n // but this body listener will survive. Now it must determine if it was\n // one of the clickable buttons.\n //\n if(viewer.infoBox.frame.contentDocument.body.getElementsByClassName('script').length == 0)\n {\n // Create the element\n\n var script = document.createElement(\"script\");\n var script1 = document.createElement(\"script\");\n\n // Add script content\n\n script.innerHTML = \"function showDmodel(){egg = document.getElementsByTagName('input')[0].checked;if(!egg){document.greenBox.show = false;document.getElementById('Checkbar').style.position = 'fixed';document.getElementById('Checkbar').style.opacity = 0;}else{document.greenBox.show = true;document.getElementById('Checkbar').style.position = 'initial';document.getElementById('Checkbar').style.opacity = 1;}}\";\n\n script1.innerHTML ='function move(){var t=document.getElementById(\"myBar\"),e=10,n=setInterval(function(){e>=100?(clearInterval(n),document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(1) > td\").innerText=\"符合\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(2) > td\").innerText=\"符合\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(3) > td\").innerText=\"符合\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(4) > td\").innerText=\"违规\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(5) > td\").innerText=\"符合\"):(e++,t.style.width=e+\"%\",t.innerHTML=1*e+\"%\")},10)}';\n \n viewer.infoBox.frame.contentDocument.body.appendChild(script)\n viewer.infoBox.frame.contentDocument.body.appendChild(script1)\n\n }\n }, false);\n }, false);\n\n //viewer.zoomTo(e)\n}" ]
[ "0.70467025", "0.63430184", "0.6309362", "0.6300952", "0.62441707", "0.62281024", "0.6204311", "0.5986968", "0.59697926", "0.58973294", "0.58360356", "0.58198124", "0.5749198", "0.57448304", "0.5737035", "0.5714603", "0.56999", "0.5699018", "0.56742215", "0.5621828", "0.55888647", "0.5557794", "0.5557794", "0.55477136", "0.55477136", "0.55361235", "0.5532169", "0.5527958", "0.5527838", "0.5527838", "0.5527643", "0.5525838", "0.5517493", "0.5498414", "0.5498414", "0.54920375", "0.54789305", "0.5476354", "0.5474735", "0.54733765", "0.54452324", "0.5426268", "0.541394", "0.54050875", "0.54050875", "0.54036796", "0.5392994", "0.53915185", "0.53712314", "0.53685254", "0.53658515", "0.5355366", "0.5354818", "0.53343445", "0.53336436", "0.5328216", "0.5324206", "0.5312225", "0.53083044", "0.53035444", "0.53027785", "0.5301936", "0.5301731", "0.5288437", "0.52879006", "0.5284369", "0.5255163", "0.52483875", "0.52423733", "0.52340496", "0.52334666", "0.5231818", "0.5230453", "0.5219929", "0.5215678", "0.5213791", "0.52052", "0.5204682", "0.52027863", "0.51990926", "0.51963776", "0.51920396", "0.51897544", "0.5187993", "0.5183762", "0.51815844", "0.517835", "0.5175917", "0.5175216", "0.5171212", "0.5165922", "0.51658845", "0.5162941", "0.5159372", "0.5147605", "0.51460624", "0.5141851", "0.51385266", "0.5133792", "0.5131797" ]
0.7721231
0
Resets any state to STATE_NONE
function resetToNoneState() { // clear text editing mode if (state == STATE_TEXT_EDITING) { currentTextEditor.destroy(); currentTextEditor = null; } // deselect everything selectedFigureId = -1; selectedConnectionPointId = -1; selectedConnectorId = -1; selectedContainerId = -1; // if group selected if (state == STATE_GROUP_SELECTED) { var selectedGroup = STACK.groupGetById(selectedGroupId); // if group is temporary then destroy it if (!selectedGroup.permanent) { STACK.groupDestroy(selectedGroupId); } //deselect current group selectedGroupId = -1; } state = STATE_NONE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n\t setState(null);\n\t} // in case of reload", "reset() {\r\n this.state = this.initial;\r\n }", "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "resetState() {\n if(this.state) this.state = Node.UNVISITED;\n else this.state = null;\n }", "function resetState() {\n state = 'unopened';\n order = [];\n}", "reset() {\r\n this.currentState = this.initalState;\r\n this.clearHistory();\r\n }", "reset() {\r\n return this.state = \"normal\";\r\n }", "reset() {\r\n this.state = this.config.initial;\r\n }", "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.initial;\r\n }", "reset() {\r\n this.activeState = this.config.initial;\r\n }", "reset() {\n state = createGameState();\n notifyListeners();\n }", "_resetState() {\n this.setState({\n ...this._defaultState\n });\n }", "reset() {\r\n this.currentState = this.initial;\r\n }", "function resetStateAll() {\n that.state.all = false;\n }", "reset() {\n this.setState(this._getInitialState());\n }", "reset() {\r\n this.state = this.config.initial;\r\n }", "resetState() {\n this.state = states.WAITING_FOR_CHOICE;\n }", "reset() {\r\n this.setState(this.baseState);\r\n }", "function resetToInitialState() {\n storage.clear(STATE_STORAGE)\n setState(Object.assign({}, INITIAL_STATE))\n}", "reset() {\n this.setState(this._getInitialState());\n }", "resetState() {\n this.setState({\n show: false,\n currCode: null,\n latest: 0,\n performance: 0,\n capital: 0,\n amount: 0,\n potential: 0,\n multiplier: 1.5,\n prediction: 1,\n err: false,\n err_msg: null\n })\n }", "reset(state) {\n state.isLogged = false\n state.isAdmin = false\n state.isRoot = false\n state.id = ''\n state.name = ''\n state.role = ''\n state.description = {}\n state.groupIds = []\n }", "reset() {\r\n this.currentState = this.config.initial;\r\n }", "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "reset() {\r\n this.statesDone.clear();\r\n this.statesDone.push(this.initialState);\r\n }", "function clear() {\n state = {\n operandOne: \"0\",\n operandTwo: undefined,\n operation: undefined,\n result: undefined\n };\n }", "function resetState() {\n state = {\n bpm: undefined,\t\n bpmArtist: undefined,\n bpmTitle: undefined,\n running: false, // whether metronome is active (making sound)\n playing: false, // whether metronome is playing (UI play button shows a triangle)\n loading: true,\t\n loadingMsg: undefined,\n shortMsg: undefined,\n altered: false, // whether initial state has been altered (by inputting a new song title, bpm, etc.\n error: undefined,\n keyString: undefined, // song key (e.g. \"Db Major\")\n timeSig: undefined, // enumerator of time signature (e.g. 3 for 3/4)\n settings: {\n followVid: true,\n autoSync: true\n }\n };\n }", "function reset() {\n state.moves = [];\n state.turnCount = 0;\n state.playbackSpeed = 700;\n chooseMove();\n }", "reset() {\n if (!this._running) {\n this._currentState = undefined;\n }\n }", "function reset() {\n setSeconds(0);\n setIsActive(false);\n }", "reset () {\n this.state.clear()\n this.redraw()\n }", "function resetState() {\n gameState = {\n segments: [],\n startSegment: {inner: {x: -1, y: -1}, outer: {x: -1, y: -1}},\n endSegment: {inner: {x: -1, y: -1}, outer: {x: -1, y: -1}},\n click: 1,\n firstPoint: {x: -1, y: -1},\n endPoint: \"start\",\n player: 1\n }\n payload = {};\n}", "function reset() {\n // noop\n }", "function reset() {\r\n // noop\r\n }", "resetSIMMState() {\r\n this.setState({\r\n currentReference : -1,\r\n currentProcess : 'N/A',\r\n currentPage : 'N/A',\r\n swapSpace : new SwapSpace(),\r\n frameTable : new FrameTable(),\r\n colorGenerator : new ColorGenerator()\r\n });\r\n }", "function reset() { }", "static clearState() {\n delete state.marchingOrder;\n MarchingOrder.State.getState();\n }", "static clearState() {\n delete state.marchingOrder;\n MarchingOrder.State.getState();\n }", "function reset() {\n\tstate.questionCounter = 0;\n\tstate.score = 0;\n\tstate.questions = [\n\t\t{\n\t\t\tid: 0,\n\t\t\tpregunta: 'Ets un/a Vilafranquí/ina de Tota la Vida? Prova el test!',\n\t\t\trespostes: [],\n\t\t\tcorrecte: null,\n\t\t},\n\t];\n\tstate.collectedAnswers = [];\n\tstate.comodinsLeft = state.comodinsInitial;\n\tstate.comodiUsedInQuestion = false;\n\tstate.comodiButtonExpanded = false;\n\t// display initial question\n\tdisplayInitialQuestion();\n}", "resetState() {\n this.state = 'pending'\n }", "function reset() {\n // Internal State\n this.currentState = constants.STATE_NOT_INITIALIZED;\n this.lastErrorCode = 0;\n\n // Utility Functions\n this.apiLogLevel = constants.LOG_LEVEL_ERROR;\n this.listenerArray = [];\n }", "function resetState() {\n state = 1\n changePage()\n}", "reset() {\n for (let node of this.nodes) {\n node.phase = NetworkNode.PHASE.NORMAL;\n }\n for (let l of this.links) {\n l.state = NodeLink.STATES.NORMAL;\n }\n }", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "_resetStates() {\r\n this._queue = null;\r\n this._ignoredLine = false;\r\n this._nextTarget = null;\r\n this._wait = false;N\r\n this._endScript = false;\r\n }", "RESET_STATE (state) {\n state.databases = []\n state.tables = []\n state.selected_table = ''\n state.query_results = []\n }", "resetState() {\n this._movements = 0;\n }", "function clear() {\n $log.debug(\"kyc-flow-state clear()\");\n clearCurrent();\n states = [];\n }", "reset() {\r\n this.currentState = this.config.initial;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('reset');\r\n }", "function resetApplicationState() {\r\n Canvas.clearCanvas();\r\n Animation.reset();\r\n animating = false;\r\n\r\n AlgoSelect.deselectAlgButtons();\r\n AlgoSelect.loadAlgoInfo('default');\r\n\r\n // save to undo history\r\n saveCurrentState()\r\n}", "resetState() {\r\n let oldValue = this._state;\r\n this.setState(undefined);\r\n this.emit('reset.state', oldValue);\r\n return this;\r\n }", "function reset() {\n generateLevel(0);\n Resources.setGameOver(false);\n paused = false;\n score = 0;\n lives = 3;\n level = 1;\n changeRows = false;\n pressedKeys = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }", "clearState() {\n const emptyState = {};\n Object.keys(this.state).forEach((key) => {\n emptyState[key] = '';\n });\n\n this.setState(emptyState);\n }", "_reset()\n {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n }", "reset() {\n // do nothing\n }", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "function reset_all()\n {\n $states = [];\n $links = [];\n $graph_table = [];\n $end_states = [];\n graph.clear();\n $start_right = [];\n $left = [];\n $current_tape_index = \"\";\n $current_state = \"\";\n $previous_state = \"\";\n $old_current_state = \"\";\n $old_previous_state = \"\";\n $old_tape_index = \"\";\n $error = false;\n $old_tape_head_value = \"\";\n }", "function reset() {\n userData.t = 0.0;\n userData.done = false;\n userData.lastBits = bits1;\n }", "resetCalculatorState() {\n this.setState({\n output: \"0\",\n storedOutput: null,\n operator: null\n })\n }", "resetInteractionState() {\n this.touched = false;\n this.submitted = false;\n this.dirty = false;\n this.prefilled = !this._isEmpty();\n }", "reset() {\r\n this._state = this._config.initial;\r\n this._history.push(this._state);\r\n }", "reset()\n {\n // unbind any VAO if they exist..\n if (this.nativeVaoExtension)\n {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n // reset all attributes..\n this.resetAttributes();\n\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n this.setBlendMode(0);\n\n // TODO?\n // this.setState(this.defaultState);\n }", "_reset() {\r\n\t\tthis._pressed = false;\r\n\t}", "reset() {\n emitter.emit('reset_state')\n }", "function reset(){\n\t\t\tnumber1 = Number.MAX_SAFE_INTEGER;\n\t\t\tnumber2 = Number.MAX_SAFE_INTEGER;\n\t\t\topcode=\"\";\n\t\t\tlastPressed=\"\";\n\t\t}", "function reset() {\n\t// reset proposals/partners\n\tfor (var i = 0; i < personData.length; i++) {\n\t\tpersonData[i].fiance = null;\n\t\tpersonData[i].free = true;\n\t\tpersonData[i].exes = [];\n\t\talertQueue = [];\n\t\tif (personData[i].gender == \"m\") {\n\t\t\tpersonData[i].proposals = 0;\n\t\t}\n\t\tif(personData[i] == selectPerson) {\n\t\t\tpersonData[i].prefs = prevState;\n\t\t}\n\t}\n\tselecting = false;\n\tselectPerson = null;\n\tselectIndex = 0;\n\tprevState = null;\n\tcurManIndex = null;\n\tstarted = false;\n\tstepClicked = false;\n\tcheckClicked = false;\n\tplaying = false;\n\tfinished = false;\n\td3.select(\"#play-button\").text(\"Play Algorithm\");\n\tclearInterval(interval);\n\tupdateAlert();\n\tupdateVis();\n}", "function StateManager_Reset()\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_ResetCallBack, this);\n}", "reset() {\r\n this.historyStates.push(this.currentState);\r\n this.currentState = this.historyStates[0];\r\n }", "function reset() {\n setSeconds(duration);\n setRunning(false);\n }", "reset() {\n this.currentOperand = '0';\n this.previousOperand = '';\n this.operation = undefined;\n }", "reset() {\n this.setIrqMask(0);\n this.setNmiMask(0);\n this.resetCassette();\n this.keyboard.clearKeyboard();\n this.setTimerInterrupt(false);\n this.z80.reset();\n }", "function reset() {\n\n }", "function reset() {\n frc = false;\n load(DEFAULT_POSITION);\n }", "clearTimelineState() {\n \tthis._startTime = NaN;\n \tthis._stopTime = Infinity;\n \tthis._state = STATE.waiting;\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(`${initClass} ${activeClass} ${animation}`);\n }", "resetAll(state) {\n state.restoList = [];\n state.filteredList = [];\n state.ratingAverage = [];\n state.markersDisplayed = [];\n state.filteringFinished = false;\n state.searchResultHasPage = false;\n state.seeMoreCliked = false;\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "Reset()\n {\n this._position = 0;\n }", "reset() {\n \t// Do not change state (counter) directly like - this.state.counter = 0 - Bad practice!\n \t// Instead use setState as below\n this.setState({ counter: 0 });\n }", "resetToInitialState() {\n this._itemsManager.reset();\n this._directionsManager.reset();\n if(this._currentGuide) {\n this._currentGuide.finish();\n this._currentGuide = null;\n }\n }", "_clearState(){\n\t\tthis._isLoaded = null;\n\t}", "function reset() {\n clear();\n initialize(gameData);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset () {\n setCurrentlyClicking(false);\n setCounter(1);\n clearInterval(currentInterval);\n setCurrentInterval(\"\");\n setClickingFast(false);\n setColors(initialColors);\n }", "resetProgram() {\n this.checkForIntervalId();\n this.stateHistory.reset();\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "reset() {\n\t\t// Keys\n\t\tthis.keys \t\t= {};\n\n\t\t// State\n\t\tthis.state \t\t= \"\";\n\n\t\t// Score\n\t\tthis.score \t\t= 0;\n\n\t\t// Health\n\t\tthis.health \t= 100;\n\t}", "function resetState(){\n Oclasses = {}; // known classes\n arrayOfClassVals = null; // cached array of class values\n arrayOfClassKeys = null; // cached array of class keys\n objectProperties = {}; // known object properties\n arrayOfObjectPropVals = null; // array of object property values\n arrayOfObjectPropKeys = null; // array of object property keys\n dataTypeProperties = {}; // known data properties\n arrayOfDataPropsVals = null; // array of data properties values\n\n classColorGetter = kiv.colorHelper();\n svg = null;\n zoomer = null;\n renderParams = null;\n mainRoot = null;\n panel = null;\n }", "reset() {\r\n this.done = false; // State of Algorithm\r\n this.graphInit = false; // State of Graph Initializaion\r\n this.queue = null; // Holds Queue of Blocks\r\n }", "function resetState() {\n webSockOpts = undefined;\n ws = null;\n wsUp = false;\n host = undefined;\n url = undefined;\n pendingEvents = [];\n handlers = {};\n clusterNodes = [];\n clusterIndex = -1;\n glyphs = [];\n connectRetries = 0;\n openListeners = {};\n nextListenerId = 1;\n }", "reset() {\r\n this.active = 'normal';\r\n }", "function resetState () {\n index = queue.length = 0\n has = {}\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production') {\n circular = {}\n }\n flushing = false\n}", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "resetConvos() {\n this.setState(this.getInitState());\n }", "resetClicks() {\n\t\tvar newState = _.extend(this.state, {click1: null, click2: null});\n\t\tthis.setState(newState);\n\t}" ]
[ "0.7936449", "0.7825173", "0.7752531", "0.77017516", "0.75434554", "0.7539825", "0.7533742", "0.7522667", "0.7518189", "0.7487151", "0.7470921", "0.7444708", "0.7441125", "0.74256325", "0.7417033", "0.74135065", "0.73819554", "0.73625124", "0.7346728", "0.7235018", "0.72124606", "0.7208674", "0.71854633", "0.71789", "0.71789", "0.71789", "0.71653587", "0.7141159", "0.7131283", "0.7129391", "0.7088883", "0.7085058", "0.7083394", "0.7058194", "0.70358455", "0.70286125", "0.70102125", "0.7002802", "0.7002531", "0.7002531", "0.69966036", "0.6991693", "0.6941321", "0.6914224", "0.6886528", "0.68735874", "0.6857227", "0.68522865", "0.6847684", "0.68426806", "0.68397963", "0.68151206", "0.6810261", "0.678589", "0.67656386", "0.67548215", "0.67357033", "0.67216283", "0.671931", "0.6718543", "0.67141384", "0.67090654", "0.6707284", "0.668787", "0.6687285", "0.6684718", "0.66840446", "0.6671899", "0.6669723", "0.66681445", "0.66644555", "0.6662997", "0.6661699", "0.66539156", "0.66530985", "0.6643823", "0.6636387", "0.6632389", "0.66274434", "0.66263145", "0.662053", "0.6615532", "0.6609725", "0.6608869", "0.6604559", "0.6604559", "0.6604559", "0.6604559", "0.660432", "0.6595888", "0.65919584", "0.6580211", "0.6578027", "0.6576771", "0.6573047", "0.6562684", "0.65580213", "0.6557288", "0.6556807", "0.6552889" ]
0.7793816
2
Show "Insert image" dialog Insert image dialog can be triggered in 1 case: 1 from quick toolbar Description: Call popup to get image from url or upload target image from local
function showInsertImageDialog() { resetToNoneState(); draw(); setUploadedImagesList(); var dialogContent = document.getElementById('insert-image-dialog'); $.modal(dialogContent, {minWidth: '450px', containerId: 'upload-image-dialog', overlayClose: true}); // update dialog's position $.modal.setPosition(); // empty upload errors in dialog var errorDiv = document.getElementById(uploadImageErrorDivId); errorDiv.innerHTML = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openOldImageDialog(title,onInsert){\r\n\t\tvar params = \"type=image&post_id=0&TB_iframe=true\";\r\n\t\t\r\n\t\tparams = encodeURI(params);\r\n\t\t\r\n\t\ttb_show(title,'media-upload.php?'+params);\r\n\t\t\r\n\t\twindow.send_to_editor = function(html) {\r\n\t\t\t tb_remove();\r\n\t\t\t var urlImage = jQuery(html).attr('src');\r\n\t\t\t if(!urlImage || urlImage == undefined || urlImage == \"\")\r\n\t\t\t\tvar urlImage = jQuery('img',html).attr('src');\r\n\t\t\t\r\n\t\t\tonInsert(urlImage,\"\");\t//return empty id, it can be changed\r\n\t\t}\r\n\t}", "function openNewImageDialog(title, onInsert, isMultiple){\r\n\t\t\r\n\t\topenNewMediaDialog(title, onInsert, isMultiple, \"image\");\r\n\t\t\r\n\t}", "function openAddonImageSelectDialog(title, onInsert){\r\n\t\t\r\n\t\topenAddonMediaSelectDialog(title, onInsert, \"image\");\r\n\t\r\n\t}", "function InsertPicture(_1){\r\nif(typeof _editor_picturePath!==\"string\"){\r\n_editor_picturePath=Xinha.getPluginDir(\"InsertPicture\")+\"/demo_pictures/\";\r\n}\r\nInsertPicture.Scripting=\"php\";\r\n_1.config.URIs.insert_image=\"../plugins/InsertPicture/InsertPicture.\"+InsertPicture.Scripting+\"?picturepath=\"+_editor_picturePath;\r\n}", "function imageURL() {\n var range = this.quill.getSelection();\n var value = prompt('What is the image URL');\n this.quill.insertEmbed(range.index, 'image', value, Quill.sources.USER);\n }", "function insertImage() {\n var data, container, images;\n detectPlugin('rasimage');\n data = $(getIframe()).contents().find('input[name=\"' + SELECTED_IMAGE_CLASS + '\"]').data();\n\n var content = renderPluginContent($(getIframe()).contents().find('#lightbox').prop('checked'), data);\n\n container = '<div class=\"mceNonEditable pluginContainer imagePlugin ' + size + '\" data-image-id=\"'\n + data.imageid + '\">';\n\n container += content;\n container += '<span class=\"mceEditable image-plugin-description\">'\n + data.alt + ', Foto: ' + data.photographer + '</span>';\n container += '</div>';\n\n //this \"hack\" is to make tiny place cursor after plugin placeholder\n container += '<br />';\n\n // Load external script\n var scriptLoader = new tinymce.dom.ScriptLoader();\n scriptLoader.add('/resources/js/adaptive/jquery-picture.js?v=2');\n scriptLoader.loadQueue(function() {\n editorGlobal.insertContent(container);\n popup.close();\n\n $('figure.editorPlugin').ready(function() {\n var figure = $(images).find('figure');\n $(\"iframe\").contents().find(\"figure\").picture();\n });\n });\n}", "function insertImage() {\n telemetry_1.reporter.sendTelemetryEvent(\"command\", { command: telemetryCommandMedia + \".art\" });\n Insert(true);\n}", "function insert() {\n let imgRadio = document.querySelectorAll('.imgRadio')\n if (imgRadio) {\n var checkedImage;\n imgRadio.forEach(image => {\n if (image.checked) { checkedImage = image }\n });\n let src = checkedImage.value\n let editor = document.querySelector('#output');\n\n if (inserImgCaller === 'editor' && editor) {\n let img = `<img src=${src} alt=${title.toString()} />`\n editor.focus();\n pasteHtmlAtCaret(img);\n }\n\n if (inserImgCaller === 'AddProduct') {\n let id = makeid(5)\n setImageToList(id, src)\n }\n\n if (inserImgCaller === 'AddJob') {\n let id = makeid(5)\n setImageToList(id, src)\n }\n\n if (inserImgCaller === 'AddArticleCover') {\n\n setImageToList(src)\n }\n checkedImage.checked = false;\n closeInsertImageModal();\n }\n }", "function editImage(imageForEditing) {\n createAlert(\n \"Change Image\",\n \"Package Header Banner\",\n \"editImageUI\",\n \"saveBanner()\"\n )\n}", "displayPicture(url){this.newPictureContainer.attr('src',url);page('/add');this.imageCaptionInput.focus();this.uploadButton.prop('disabled',true)}", "function viewImage() { \n var imageId = view.popup.selectedFeature.attributes.sheetId; \n viewer.open( \"https://collections.lib.uwm.edu/digital/iiif/agdm/\" + imageId + \"/\");\n $('#imageModal').modal('show');\n }", "function showImage(path){\r\n\t$('#imageDialog').html(\"<img src='\" + path + \"'></img>\");\r\n\t$('#imageDialog').dialog('open');\r\n\t$('#imageDialog').dialog({title:getName()});\r\n\treturn false;\r\n}", "function editImage(selImg) {\n initEditor(selImg);\n}", "function editor_tools_handle_img()\n{\n var url = 'http://';\n\n for (;;)\n {\n // Read input.\n url = prompt(editor_tools_translate(\"enter image url\"), url);\n // Cancel clicked? Empty string is also handled as cancel here,\n // because Safari returns an empty string for cancel. Without this\n // check, this loop would never end.\n if (url == '' || url == null) return;\n url = editor_tools_strip_whitespace(url);\n\n // Check the URL scheme (http, https, ftp and mailto are allowed).\n var copy = url.toLowerCase();\n if (copy == 'http://' || (\n copy.substring(0,7) != 'http://' &&\n copy.substring(0,8) != 'https://' &&\n copy.substring(0,6) != 'ftp://')) {\n alert(editor_tools_translate(\"invalid image url\"));\n continue;\n }\n\n break;\n }\n\n editor_tools_add_tags('[img]' + url + '[/img]', '');\n editor_tools_focus_textarea();\n}", "function addPhoto() {\n // If an operation is in progress, usually involving the server, don't do it.\n if (processing) { return false; }\n if (currentCollection == null) {\n alert(\"Please select a collection first.\");\n return false;\n }\n // If photo happens to be growing, cut it short.\n snapImageToLandingPad();\n // Open the dialog.\n window.open(\"showAddPhoto.action\", \"\", \"width=620,height=440\");\n}", "function batchTagImagesDialog(){\r\n\t// XXX\r\n}", "function handleMediaManagerSelect(fileData){\n quill.insertEmbed(insertPointIndex, 'image', fileData.url);\n}", "function showImageOnButton(uri) {\n //me.getAddImageButtonRef().setHtml('<div class=\"addPhotoButtonHolder\"><img src=\"' + uri + '\" class=\"addPhotoButtonImage\"/></div>');\n\t\t me.getAddImageButtonRef().setHtml('<div class=\"addPhotoButtonHolder\" style=\"background:url(' + uri + '); background-size:cover; background-repeat:no-repeat; background-position:center;\">&nbsp;</div>');\n\t\t}", "function ImageHead(url) {\n\twhiteboard.modalClose('.modal_image_upload_progress');\n\twhiteboard.modalClose('.modal_image_select');\n\twhiteboard.modalOpen('.modal_image');\n\twhiteboard.toolbarActivate('#toolbar_confirm', '#toolbar_cancel', '#toolbar_image');\n\tthis.url = url;\n\t$('#modal_image').attr('src', url);\n}", "static insertImageIntoUserSelection(url) {\n var selection = new Selection();\n var img = document.createElement('img');\n img.src = url;\n\n selection.insert(img);\n EditImage.setImage(img);\n\n return img;\n }", "function insertImg(URI){\n\t\t/*\n\t\t*\tAdd image to UI via img element and src attribute\n\t\t*/\n\t\tvar photo = document.getElementById('mugin-photo');\n\t\t\n\t\t// Create new image\n\t\tvar userImage = new Image();\n\t\tuserImage.src = URI; \n\n\t\t// Add into DOM\n\t\tphoto.parentNode.insertBefore(userImage, photo);\n\t}", "alertImage() {\n\t\tAlert.alert(\n\t\t\t'MobiShop',\n\t\t\t'from where you want the image',\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttext: 'cancel',\n\n\t\t\t\t\tstyle: 'cancel'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: 'gallery',\n\t\t\t\t\tonPress: () => this.onChooseImageUploud2()\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: 'camera',\n\t\t\t\t\tonPress: () => this.onChooseImageUploud()\n\t\t\t\t}\n\t\t\t],\n\t\t\t{ cancelable: false }\n\t\t);\n\t}", "function openProductImageDialog(imageIndex)\n{\n viewModel.productImageDialog(imageIndex);\n\n applyFileUploadEventListener();\n}", "openUploadImageWindow(){\n // click on inputFileElement in application template (browse window can only be called from application template)\n document.getElementById('inputFileElement').click();\n }", "execute(url){\n let html = `<p><div class=\"avoid-break\"><img class=\"grapple-image align-left size-full\" src=\"${url}\" data-size=\"size-full\"/></div></p>`;\n let commandContext = this;\n\n let $image = $(html);\n\n this.editor.insert($image);\n\n $image.find('img').on('load', function(){\n commandContext.editor.updateHeight();\n });\n\n this.editor.checkChange();\n }", "function drawImage(editor) {\n\t\t\tvar cm = editor.codemirror;\n\t\t\tvar stat = getState(cm);\n\t\t\tvar options = editor.options;\n\t\t\tvar url = \"http://\";\n\t\t\tif(options.promptURLs) {\n\t\t\t\turl = prompt(options.promptTexts.image);\n\t\t\t\tif(!url) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n\t\t}", "function ImageProtectionImages(editor) {\n this.editor = editor;\n var cfg = editor.config;\n var self = this;\n\n cfg.registerButton({\n id : \"ImageProtectionImages\",\n tooltip : \"Insert Image\",\n image : editor.imgURL(\"btn_open1.gif\", \"ImageProtectionImages\"),\n textMode : false,\n action : function(editor) {\n \turl = document.location.pnbaseURL + document.location.entrypoint + \"?module=ImageProtection&type=plugins&func=Images\";\n\t\t\t\t\t\tScribitePluginsImageProtectionXinha(editor, url);\n \t\t }\n })\n cfg.addToolbarElement(\"ImageProtectionImages\", \"insertimage\", 1);\n}", "chooseImage() {\n var finder = new CKFinder();\n finder.selectActionFunction = (fileUrl) => {\n this.$scope.data.Image = fileUrl;\n this.$scope.data.SEO_Image = fileUrl;\n this.$scope.$apply();\n };\n finder.SelectFunction = \"ShowFileInfo\";\n finder.popup();\n }", "function drawImage(editor) {\n\t\tvar cm = editor.codemirror;\n\t\tvar stat = getState(cm);\n\t\tvar options = editor.options;\n\t\tvar url = \"http://\";\n\t\tif(options.promptURLs) {\n\t\t\turl = prompt(options.promptTexts.image);\n\t\t\tif(!url) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n\t}", "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "function insertImage(editor, imageFile) {\n var reader = new FileReader();\n reader.onload = function (event) {\n if (!editor.isDisposed()) {\n editor.addUndoSnapshot(function () {\n var image = editor.getDocument().createElement('img');\n image.src = event.target.result;\n image.style.maxWidth = '100%';\n editor.insertNode(image);\n }, \"Format\" /* Format */);\n }\n };\n reader.readAsDataURL(imageFile);\n}", "function onSuccess (imageData) {\n\t\t//var image = document.getElementById ('picture');\n\t\t//image.src = \"data:image/jpeg;base64,\" + imageData;\n\t\t//send_png(imageData);\n\t\t//alert(encode);\n\t\t//var target = document.getElementById(\"textArea\");\n\t\t//target.value = makeSmall(imageData);\n\t\timageurl = \"data:image/jpeg;base64,\"+imageData;\n\t\t//send_png(imageurl);\n\t\t//alert(smallurl);\n\t\tmyNavigator.pushPage(\"edit.html\");\n\t}", "function drawImage() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "function insertFile(file) {\n uploadFile(file, function (url) {\n var text = \"[img]\" + url + \"[/img]\";\n typeInTextarea(text);\n });\n }", "function TB_image() {\n\tvar t = this.title || this.name ;\n\tTB_show(t,this.href,'image');\n\treturn false;\n}", "function insertCapturedImg(src) {\n\tvar img = createImgContainer('captured');\n\timg.setAttribute('src', src);\n\tvar textbox = $($(\".CEdit_btn\").parents(\"tbody\")[1]).find(\"[role=textbox]\")[0];\n\ttextbox.append(img);\n}", "function addImageToScreen(myURL) {\n\n}", "function insertImage(){\r\n var val = document.getElementsByTagName('input')[0].value;\r\n CreateElement('img','div',0);\r\n SetAttribute('img',count,'src',val);\r\n count++; //index for next image\r\n}", "insert(e) {\n e.preventDefault();\n\n // Insert the image.\n // @todo, support other media types.\n if (this.range != null && e.target.href) {\n let start = this.range.start;\n this.quill.insertEmbed(start, 'image', e.target.href);\n this.quill.setSelection(start + 1, start + 1);\n }\n else if (e.target.href) {\n this.quill.insertEmbed(0, 'image', e.target.href);\n }\n }", "function fnAddimage()\n{\n\t\n\tvar appImage=document.forms[0];\n\tvar imageName=trim(appImage.imgName.value);\n\tvar imageDesc=trim(appImage.imgDesc.value);\n\tappImage.imgName.value=imageName;\n\tappImage.imgDesc.value=imageDesc;\n\n\tif(imageName.length==0 || imageName.value==\"\" )\n\t{\n\t\n\t\tvar id = '798';\n\t\t//hideErrors();\n\t\taddMsgNum(id);\n\t\tshowScrollErrors(\"imgName\",-1);\n \t\treturn false;\n\n\t}\t\n\tif (imageDesc.length>2000)\n\t{\n\t\tvar id = '799';\n\t\t//hideErrors();\n\t\taddMsgNum(id);\n\t\tshowScrollErrors(\"imgDesc\",-1);\n\t\treturn false;\n\t\t\n\t}\n\n\n\n\t\n\n\tvar toLoadFileName=document.forms[0].imageSource.value;\n\n\ttoLoadFileName=toLoadFileName.substring(0,toLoadFileName.indexOf('_'));\n\tvar fileName=document.forms[0].imageSource.value;\n\n\t\n\t\t\n\t\t\tif (fileName==\"\" || fileName.length==0)\n\t\t\t{\n\t\t\t\t\t\t\tvar id='780';\n\t\t\t\t\t\t\t//hideErrors();\n\t\t\t\t\t\t\taddMsgNum(id);\n\t\t\t\t\t\t\tshowScrollErrors(\"imageSource\",-1);\n\t\t\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\tif(fileName==\"\"){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar code=fileName.split(\"\\\\\");\n\t\t\t\t\tvar temp=\"\";\n\t\t\t\t\tif (code.length > 1)\t{\n\t\t\t\t\t\tfor (j=1;j<code.length;j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp=code[j];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp=code[0];\n\t\t\t\t\t}\n\t\t\t\t\tif(temp!=\"\")\n\t\t\t\t\t{\n\t\t\t\t\tvar checkParam=temp.substring(temp.indexOf('.')+1,temp.length);\n\t\t\t\t\t\n\t\t\t\t\tvar flag = false;\n\t\t\t\t\tvar arr = new Array();\n\t\t\t\t\tarr[0] = \"gif\";\n\t\t\t\t\tarr[1] = \"jpeg\";\n\t\t\t\t\tarr[2] = \"bmp\";\n\t\t\t\t\tarr[3] = \"tiff\";\n\t\t\t\t\tarr[4] = \"jpg\";\n\t\t\t\t\tarr[5] = \"tif\";\n\t\t\t\t\tarr[6] = \"pdf\";//Added for CR_97 for allowing PDF files in Appendix\n\t\t\t\t\t\n\t\t\t\t\tfor(var i = 0 ; i < arr.length; i++){\n\t\t\t\t\t\tif(trim(checkParam.toLowerCase())==arr[i]){\n\t\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!flag){\n\t\t\t\t\t\n\t\t\t\t\t\tvar id='901';\n\t\t\t\t\t\t//hideErrors();\n\t\t\t\t\t\taddMsgNum(id);\n\t\t\t\t\t\tshowScrollErrors(\"imageSource\",-1);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\tdocument.forms[0].action=\"AppendixAction.do?method=addImage\";\n\t\t\t\t\tdocument.forms[0].submit();\n}\n}", "function popupUploadImg () {\n\t\t\tconsole.log('upload img modal win!!!!');\n\t\t\tcreate_jpg_web ();\n\t\t\t$.fancybox.open([\n\t\t\t\t\t{ href : '#modal-save-pdf', \n\t\t\t\t\t\ttitle : 'Сохранить в PDF'\n\t\t\t\t\t}\n\t\t\t\t], {\n\t\t\t\t\t\tmaxWidth\t: 800,\n\t\t\t\t\t\tmaxHeight\t: 600,\n\t\t\t\t\t\tfitToView\t: false,\n\t\t\t\t\t\twidth\t\t: '70%',\n\t\t\t\t\t\theight\t\t: '70%',\n\t\t\t\t\t\tautoSize\t: false,\n\t\t\t\t\t\tcloseClick\t: false,\n\t\t\t\t\t\topenEffect\t: 'fade',\n\t\t\t\t\t\tcloseEffect\t: 'fade'\n\t\t\t\t});\t\t\t\t\n\t\t}", "function openNewMediaDialog(title,onInsert,isMultiple, type){\r\n\t\t\r\n\t\tif(isMultiple == undefined)\r\n\t\t\tisMultiple = false;\r\n\t\t\r\n\t\t// Media Library params\r\n\t\tvar frame = wp.media({\r\n\t\t\t//frame: 'post',\r\n //state: 'insert',\r\n\t\t\ttitle : title,\r\n\t\t\tmultiple : isMultiple,\r\n\t\t\tlibrary : { type : type},\r\n\t\t\tbutton : { text : 'Insert' }\r\n\t\t});\r\n\r\n\t\t// Runs on select\r\n\t\tframe.on('select',function(){\r\n\t\t\tvar objSettings = frame.state().get('selection').first().toJSON();\r\n\t\t\t\r\n\t\t\tvar selection = frame.state().get('selection');\r\n\t\t\tvar arrImages = [];\r\n\t\t\t\r\n\t\t\tif(isMultiple == true){\t\t//return image object when multiple\r\n\t\t\t selection.map( function( attachment ) {\r\n\t\t\t \tvar objImage = attachment.toJSON();\r\n\t\t\t \tvar obj = {};\r\n\t\t\t \tobj.url = objImage.url;\r\n\t\t\t \tobj.id = objImage.id;\r\n\t\t\t \tarrImages.push(obj);\r\n\t\t\t });\r\n\t\t\t\tonInsert(arrImages);\r\n\t\t\t}else{\t\t//return image url and id - when single\r\n\t\t\t\tonInsert(objSettings.url, objSettings.id);\r\n\t\t\t}\r\n\t\t\t \r\n\t\t});\r\n\r\n\t\t// Open ML\r\n\t\tframe.open();\r\n\t}", "function img_create(src, key, data) {\t \n\tvar alink = document.createElement('a')\n\talink.setAttribute('href',\"display.html?nasa_id=\"+data.nasa_id);\n\n\tvar img = new Image(); \n\timg.src = src;\n\timg.setAttribute('id',key);\n\talink.appendChild(img)\n\t\n\t//dialog.innerHTML = \"<dialog class='backdrop' id='dialog\" + key + \"'><img src='\" + src + \"' width='auto' height='80%'><table><tr><td><b>\" + data.title + \"</b></td></tr><tr><td>\" + data.description + \"</td></tr><tr><td>Date:\" + data.date_created + \"</td></tr><tr><td>Center:\" + data.center + \"</td></tr><tr><td>Photographer:\" + data.photographer + \"</td></tr><tr><td>Location:\" + data.location + \"</td></tr><tr><td>NASA ID:\" + data.nasa_id + \"</td></tr><tr><td><form method='dialog'><input type='submit' value='Close'/></form></td></tr></table></dialog>\";\n return alink;\n}", "function insertImageUrl(uri, imageUrl) {\n const sourceUri = vscode.Uri.parse(uri);\n vscode.window.visibleTextEditors\n .filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) &&\n editor.document.uri.fsPath === sourceUri.fsPath)\n .forEach((editor) => {\n // const line = editor.selection.active.line\n editor.edit((textEditorEdit) => {\n textEditorEdit.insert(editor.selection.active, `![enter image description here](${imageUrl})`);\n });\n });\n }", "function file_com_img(img){\n \n var files=$(img)[0].files;\n var filename= files[0].name;\n var extension=filename.substr(filename.lastIndexOf('.')+1);\n var allowed=[\"jpg\",\"png\",\"jpeg\"];\n \n if(allowed.lastIndexOf(extension)===-1){\n $.alert({\n title:'Error on file type!',\n content:'The file type selected is not of jpg , jpeg or png. Please select a valid image/photo',\n type:'red',\n typeAnimated:true,\n buttons:{\n ok:{\n text:'Ok',\n btnClass:'btn-red',\n action:function()\n {\n img.value=\"\";\n $('#label-span').html('Select photo/image');\n\t\t\t\t\t\t/*\n $('#upload_image_view').attr({src:\"assets/img/default-icon-1024.png\"}).show();\n $('#hidden_pre_div').hide();*/\n }\n }\n }\n });\n }else{\n if(img.files && img.files[0])\n {\n var filereader = new FileReader();\n filereader.onload=function(evt)\n {\n //Hide the default image/photo\n //$('#upload_image_view').hide();\n //Show the image selected and add an img element to the div element\n //$('#hidden_pre_div').show().html('<img src=\"'+evt.target.result+'\" width=\"200\" height=\"200\" />');\n //set label text\n $('#label-span').html(''+filename);\n\t\t\t \n };\n filereader.readAsDataURL(img.files[0]);\n }\n }\n}", "function _doImageUpload(){\n var dataUrl = _getDataUrl($img),\n metaTransferId = (function(){\n if(metaTransfer && metaTransfer.getServerSideId())\n return metaTransfer.getServerSideId();\n else if(_locInfo.argumenta.metadata)\n return _locInfo.argumenta.metadata;\n else\n return 'null';\n })()\n transfer = basiin.tell(dataUrl);\n\n transfer.event.add({\n 'onAfterFinalize':function(event){\n frameProgressBar.setProgress(0);\n window.location = srv.location\n +'/'+ srv.basiin\n +'/image/uploaded/'+ basiin.transaction().id\n +'/'+ transfer.getServerSideId()\n +'/'+ metaTransferId\n },\n 'onAfterPacketLoad':function(event){\n frameProgressBar.setProgress(\n event.object.getProgress());\n }\n });\n }", "function addImage() {\n myPresentation.getCurrentSlide().addImage(inTxt.value);\n inTxt.value = \"\";\n}", "function uploadTileImage() {\n BinaryUpload.Uploader().Upload(\"/images/l_Sliderx96.png\", \"/SiteAssets/l_Sliderx96.png\");\n //setImageUrl();\n createConfigList();\n }", "function onPhotoURISuccess(imageURI){\n // Show the selected image\n var smallImage = document.getElementById('smallImage');\n smallImage.style.display = 'block';\n smallImage.src = imageURI;\n}", "function action_modal_imageViewInMsgBox(img_id, imgPath) {\n $('#modal-imageView').modal();\n var img = document.getElementById('img-view');\n var imgSrc = document.getElementById(img_id);\n img.src = imgSrc.src;\n resize_modal_imageView();\n selectedImgContent = imgSrc.src;\n selectedImgPath = imgPath;\n // Show pin button..\n $('#btn-addImgToBoard').attr('style', \"\");\n // Hide remove button..\n $('#btn-removeImgFromBoard').attr('style', \"display: none;\");\n\n // Set download image link..\n $('#link-downloadImg').attr('href', \"download?file=\" + imgPath);\n\n // Set share image link..\n $('#btn-shareToOthers').attr('onclick', \"javascript:action_modal_shareImgToUser('\" + imgPath + \"');\");\n}", "function drawImage(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n var options = editor.options;\n var url = 'https://';\n if (options.promptURLs) {\n url = prompt(options.promptTexts.image, 'https://');\n if (!url) {\n return false;\n }\n }\n _replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}", "viewImageInNewTab()\r\n {\r\n document.getElementById(\"context-viewimage\")\r\n .setAttribute(\"oncommand\", `openTrustedLinkIn(gContextMenu.imageURL, \"tab\")`);\r\n }", "function mediaClick(e, data) {\n page = 0;\n $('#imgs').load('/admin/mediaSelector', addImgClickHandler);\n\n $(data.popup).children(\"#next\").click(function(e) {\n $('#imgs').load('/admin/mediaSelector?page=' + ++page, addImgClickHandler);\n });\n\n // Wire up the submit button click event\n $(data.popup).children(\"#submit\")\n .unbind(\"click\")\n .bind(\"click\", function(e) {\n // Get the editor\n var editor = data.editor;\n\n // Get the full url of the image clicked\n var fullUrl = $(data.popup).find(\"#imgToInsert\").val();\n\n // Insert the img tag into the document\n var html = \"<img src='\" + fullUrl + \"'>\";\n editor.execCommand(data.command, html, null, data.button);\n\n // Hide the popup and set focus back to the editor\n editor.hidePopups();\n editor.focus();\n });\n }", "function showpopupimageselection(){\n\t\t$('#imageselectionpopupmenu').popup('open');\n\t}", "static pasteImageURL(image_url) {\n let filename = image_url.split(\"/\").pop().split(\"?\")[0];\n let ext = path.extname(filename);\n let imagePath = this.genTargetImagePath(ext);\n if (!imagePath)\n return;\n let silence = this.getConfig().silence;\n if (silence) {\n Paster.downloadFile(image_url, imagePath);\n }\n else {\n let options = {\n prompt: \"You can change the filename. The existing file will be overwritten!\",\n value: imagePath,\n placeHolder: \"(e.g:../test/myimg.png?100,60)\",\n valueSelection: [\n imagePath.length - path.basename(imagePath).length,\n imagePath.length - ext.length,\n ],\n };\n vscode.window.showInputBox(options).then((inputVal) => {\n Paster.downloadFile(image_url, inputVal);\n });\n }\n }", "function UploadImageURL(){\n // lade Startkonfiguaration\n StartConfig();\n UploadFormURL[0].style.display = \"inline\";\n}", "function mostrarImg(urlImg){\n $(\"#menuMobile\").fadeOut();\n document.getElementById(\"imgDialog\").style=\"display :inline\";\n $(\"#bsDialog\").show(function () {\n document.getElementById(\"imgDialog\").src=urlImg; \n });\n}", "function selectImage(imgUrl) {\n console.log('gMeme', gMeme);\n gMeme.imgUrl = imgUrl;\n saveMemeToLocalStorage();\n window.location.href='memeEditor.html'\n}", "function insertNewIMGButton(photoURL, id/*imageURL*/){\n var context = {\n \"id\": id,\n \"photoURL\": photoURL\n // Figure out later \"imageURL\": imageURL (For the second tab for image borders!)\n }\n var newIMGButtonHTML = Handlebars.templates.newIMGButton(context);\n var imgButtonDiv = document.getElementById(\"imgButtonDiv\");\n imgButtonDiv.insertAdjacentHTML(\"beforeend\", newIMGButtonHTML);\n}", "function injectImage(request, sender, sendResponse) {\n console.log(\"pageCopier.js: injectImage:-\");\n //removeEverything();\n //insertImage(request.imageURL);\n\n\n}", "function sendImageToPanelAfterUplaod(image_name) {\n var token = uniqueid();\n var image_url = \"/img/customImage/\" + image_name;\n setImageToCanvas(image_url);\n}", "function handler4AddPicture(file, action) {\n\tif (!/image\\/\\w+/.test(file.type)) {\n alert(getResource(\"messages.imageFileRequired\"));\n return false;\n }\n var reader = new FileReader();\n reader.onload = function () {\n switch (action) {\n case \"addpicture\":\n addPicture(this.result);\n break;\n }\n };\n reader.readAsDataURL(file);\n return true;\n}", "function imageEditorApplyImage (xml) {\r\n var h, w, uh, uw, src;\r\n $('#imageEditorPreview').hide();\r\n $('#imageEditorPreview').attr(\"src\", \"\");\r\n $('#imageEditorCaption').hide();\r\n parent.jQuery.fancybox.showActivity();\r\n\r\n src = editor_image_url_template.replace('image-guid.image-ext',\r\n getRegexpValue(xml, /Thumb=\"([^\"]*?)\"/));\r\n\r\n h=getRegexpValue(xml, /ThumbHeight=\"([^\"]*?)\"/);\r\n w=getRegexpValue(xml, /ThumbWidth=\"([^\"]*?)\"/);\r\n uh=getRegexpValue(xml, /ImageHeightUndo=\"([^\"]*?)\"/);\r\n uw=getRegexpValue(xml, /ImageWidthUndo=\"([^\"]*?)\"/);\r\n if (!uh || !uw)\r\n $('#imageEditorRestore').hide();\r\n else {\r\n $('#imageEditorRestore').show();\r\n $('#imageEditorLeft #imageEditorRestore').attr('title', zetaprints_trans('Undo all changes') + '. ' + zetaprints_trans('Original size') + ': ' + uw + ' x ' + uh + ' px.');\r\n }\r\n mime=getRegexpValue(xml, /MIME=\"([^\"]*?)\"/);\r\n if(mime=='image/tif' || mime=='application/eps'){\r\n $('#imageEditorRotateRight').hide();\r\n $('#imageEditorRotateLeft').hide();\r\n $('#imageEditorCrop').hide();\r\n }\r\n if (!h || !w) {\r\n alert(zetaprints_trans('Unknown error occured'));\r\n return false;\r\n }\r\n $('#imageEditorPreview').attr(\"src\", src);\r\n $('#imageEditorPreview').height(h);\r\n $('#imageEditorPreview').width(w);\r\n $('#imageEditorHeightInfo').html(h + ' px');\r\n $('#imageEditorWidthInfo').html(w + ' px');\r\n\r\n tmp1 = $('input[value='+imageEditorId+']', top.document).parent().find('img');\r\n if (tmp1.length == 0)\r\n tmp1 = $('#img'+imageEditorId, top.document);\r\n if (tmp1.length == 0)\r\n tmp1 = $('input[value='+imageEditorId+']', top.document).parent().find('img');\r\n if (src.match(/\\.jpg/m))\r\n tmp1.attr('src', src.replace(/\\.(jpg|gif|png|jpeg|bmp)/i, \"_0x100.jpg\"));\r\n else\r\n tmp1.attr('src', src);\r\n imageEditorApplySize(w, h);\r\n }", "function previewImage(what, previewArea, defaultPicObj) {\n\t\n\tdefaultPic = defaultPicObj.value;\n\t\n\tvar source = what.value;\n\tsource = Trim(source);\n\t\n\tvar clearAction = false;\n\tif (source == \"\")\n\t\tclearAction = true;\n\t\t\n var ext = source.substring(source.lastIndexOf(\".\")+1, source.length).toLowerCase();\n \n for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;\n \n globalPreviewArea = previewArea;\n globalPic = new Image();\n \n if (i<fileTypes.length) { \n\t globalPic.src = source; \n\t \n\t} else {\n\t\t\n \tglobalPic.src = defaultPic;\n \t\n \tif (!clearAction) {\n \talert(\"THAT IS NOT A VALID IMAGE\\nPlease load an image with an extention of one of the following:\\n\\n\"+fileTypes.join(\", \"));\n \t}\n }\n \n setTimeout(\"applyChanges()\",200);\n \n} // end previewImage", "function dndImage(targetName,targetSample,popup,buttonName)\n\t{\n\t\t//Drag and Drop\n\t\tvar draggingFile;\n\n\t\t//Event:drag start ---- pass to dataTransfer\n\t\t$(document).on(\"dragstart\",$(popup).find(\".colorpicker\"),function(e)\n\t\t{\n\t\t\tif(e.originalEvent.dataTransfer.files.length!=0)\n\t\t\t{//drag image file\n\t\t\t\tdraggingFile=e.originalEvent.dataTransfer;//need 'originalEvent' when use JQuery\n\t\t\t}\n\t\t});\n\t\t\n\t\t$(document).on(\"dragover\",$(popup).find(\".colorpicker\"),function(e)\n\t\t{\n\t\t\te.preventDefault();\n\t\t});\n\t\t\n\t\t//Event:drop\n\t\t$(document).on(\"drop\",popup,function(e)\n\t\t{\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif(e.originalEvent.dataTransfer.files.length!=0)\n\t\t\t{\t\n\t\t\t\t//get from dataTransfer\n\t\t\t\tvar file=e.originalEvent.dataTransfer.files[0];\n\t\t\t\tvar file_reader = new FileReader();//API\n\t\t\t\t\n\t\t\t\t//ater file read\n\t\t\t\tfile_reader.onloadend = function(e){\n\n\t\t\t\t\t// when error occur\n\t\t\t\t\tif(file_reader.error) return;\n\n\t\t\t\t\t//hide div tag used in image drop\n\t\t\t\t\tif(window.navigator.userAgent.indexOf(\"rv:11\")!=-1)$(\".cleditorCatcher\").hide();\n\t\t\t\t\t\n\t\t\t\t\tvar imageObj=file_reader.result;\n\t\t\t\t\t\n\t\t\t\t\t//apply image to sample \n\t\t\t\t\t$(popup).find(targetName).css(\"background-image\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t\n\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\tvar cb = $(popup).find(\".appobj\")//find(\"input[type=checkbox]\");\n\t\t\t\t\n\t\t\t\t\t//switch background image visibility by checkbox\n\t\t\t\t\tif($(cb[1]).prop(\"checked\")==true)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(buttonName===\"borderstyle\")\n\t\t\t\t\t\t\t$(targetSample).css(\"border-image-source\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$(targetSample).css(\"background-image\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(buttonName===\"borderstyle\")\n\t\t\t\t\t\t\t$(targetSample).css(\"border-image-source\",\"\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$(targetSample).css(\"background-image\",\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfile_reader.readAsDataURL(file);\n\t\t\t}\n\t\t});\n\t}", "function popupImage(displaImgAndInfo, url) {\n const popupImage = document.querySelector('#popup');\n const image = displaImgAndInfo.querySelector('img');\n image.addEventListener('click', () => {\n popupImage.style.display = 'flex';\n popupImage.querySelector('img').src = `${url}`; \n })\n // Close popup\n popupImage.addEventListener('click', () => {\n popupImage.style.display = 'none';\n })\n}", "function showImage( im )\r\n {\r\n var fileName = imageURLs[im].split(\"/\")[2];\r\n window.scrollTo(0, 0);\r\n currentImage = im;\r\n\r\n if ( !images[im] )\r\n {\r\n images[im] = new Image();\r\n }\r\n\r\n if ( useSmaller )\r\n {\r\n images[im].src = smallerURLs[im];\r\n }\r\n else\r\n {\r\n images[im].src = imageURLs[im];\r\n }\r\n setInner( \"image\", \"<h3>Waiting for image ...<\\/h3>\" );\r\n waitForCurrent();\r\n\r\n setInner( \"image\", \"<img class=\\\"main_image\\\"\" +\r\n \"src=\\\"\"+images[im].src +\r\n \"\\\" \" +\r\n \"alt=\\\"\"+imageURLs[im] +\r\n \"\\\" height=\\\"\"+imgHeight+\"\\\" />\" );\r\n setInner( \"title\", fileName );\r\n }", "function onSuccess(imageURI, name) {\n addImageURI(name,imageURI);\n}", "static OpenUpload () {\n _imageUploadButton.openFileDialog(true)\n }", "confirmImg(){\n var canvas = document.getElementsByTagName(\"canvas\");\n var image = canvas[0].toDataURL(\"image/jpeg\", 1.0);\n window.open(image);\n }", "imageClick(e) {\n e.preventDefault();\n\n if (this.item.link) {\n window.open(this.item.link, '_blank');\n } else {\n this.shadowRoot.querySelector('#image-dialog').open();\n\n HhAnalytics.trackDialogOpen(this.item.internalTitle);\n }\n }", "function C999_Common_Achievements_ShowImage(ImagePath) {\n C999_Common_Achievements_Image = ImagePath;\n}", "function getImg() {\n filepicker.setKey(\"ABDI6UIw6SzCfmtCVzEI3z\");\n filepicker.pick({\n mimetypes: [\"image/*\"],\n container: \"modal\",\n services: filepickerServices(),\n },\n function(InkBlob) {\n $(\"#pic\").find(\".btn[type=submit]\").removeAttr(\"disabled\").removeClass(\"disabled\");\n $(\"#profile_pic\").attr(\"src\", InkBlob.url);\n $(\"#id_pic_url\").attr(\"value\", InkBlob.url);\n });\n}", "function insert_asset(){ \t\n try{\n\t\tvar url = getUrl(this.href);\n\t\t$.get(url,{}, function(data){\n\t\t\t//insert into editor(tinyMCE is global)\n\t\t\ttinyMCE.execCommand('mceInsertContent', false, data); \n\t\t});\n\t}catch(e){ alert(\"insert asset: \"+ e);}\n}", "function imagenClick(e, data) {\n // Wire up the submit button click event\n $(data.popup).children(\":button\")\n .unbind(\"click\")\n .bind(\"click\", function(e) {\n \t //enviamos el formulario\n\t $('#form_envio').submit();\n\t$('#carga').html('<img src=\"'+IMG_CARGA+'\">');\n\t\t\n\n // Get the editor\n var editor = data.editor;\n \n \n // Get the entered name\n var name = $(data.popup).find(\":text\").val();\n \n \n // Insert some html into the document\n var html = \"Hello \" + name;\n \n /*\n // Hide the popup and set focus back to the editor\n editor.hidePopups();\n editor.focus();\n \n */\n });\n \n \n }", "function drawImage(editor) {\n // TODO Rework the full logic of draw image\n var cm = editor.codemirror;\n var stat = getCMTextState(cm);\n //var options = editor.options;\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "function add_photo_to_site(event, ui){\n var url = ui.draggable.attr('src');\n var img = $(event.target).find('.photo img');\n $.post(\"/sources\",{site_id: site_id, image: url},function(){\n \n })\n }", "function add_img() {\n var i, URL, imageUrl, id, file,\n files = gId('type_file').files; // all files in input\n if (files.length > 0) {\n for (i = 0; i < files.length; i++) {\n file = files[i];\n if (!file.type.match('image.*')) { //Select from files only pictures\n continue;\n }\n // Create array Images to be able to choose what pictures will be uploaded.\n // You cannot change the value of an <input type=\"file\"> using JavaScript.\n Images.push(file);\n URL = window.URL;\n if (URL) {\n var imageUrl = URL.createObjectURL(files[i]); // create object URL for image \n var img_block = document.createElement(\"div\");\n img_block.className = \"img_block\";\n gId('photo_cont').appendChild(img_block)\n var img_story = document.createElement(\"img\")\n img_story.className = \"img_story\";\n img_story.src = imageUrl;\n img_block.appendChild(img_story);\n var button_delete = document.createElement(\"button\"); // create button to delete picture\n button_delete.className = \"button_3\";\n var x = document.createTextNode(\"x\");\n button_delete.appendChild(x)\n img_block.appendChild(button_delete);\n }\n }\n gId('photo_cont').style.display = 'inline-block';\n }\n}", "static pasteImage() {\n let ext = \".png\";\n let imagePath = this.genTargetImagePath(ext);\n if (!imagePath)\n return;\n let silence = this.getConfig().silence;\n if (silence) {\n Paster.saveImage(imagePath);\n }\n else {\n let options = {\n prompt: \"You can change the filename. The existing file will be overwritten!.\",\n value: imagePath,\n placeHolder: \"(e.g:../test/myimage.png?100,60)\",\n valueSelection: [\n imagePath.length - path.basename(imagePath).length,\n imagePath.length - ext.length,\n ],\n };\n vscode.window.showInputBox(options).then((inputVal) => {\n Paster.saveImage(inputVal);\n });\n }\n }", "function loadImageFromPage(image) {\r\n var width = Math.min((image.width + 35), 760);\r\n var height = Math.min((image.height + 35), 475);\r\n var options = stdOpt + \"width=\" + width + \",height=\" + height;\r\n var win = window.open(image.src, \"image\", options);\r\n if (window.focus) win.focus();\r\n}", "function openUploadWidget () {\n cloudinary.openUploadWidget({\n cloud_name: 'ddanielnp',\n upload_preset: 'profile_preset',\n multiple: false\n }, function (error, result) {\n $('.profile_image').attr('src', result[0].eager[0].secure_url)\n $('#account_profile_image').val(result[0].eager[0].secure_url)\n })\n}", "chooseImageBanner() {\n var finder = new CKFinder();\n finder.selectActionFunction = (fileUrl) => {\n this.$scope.data.ImageBanner = fileUrl;\n this.$scope.$apply();\n };\n finder.SelectFunction = \"ShowFileInfo\";\n finder.popup();\n }", "function setInitialImage() {\n placeImage(\"img/no-image.jpg\");\n}", "function onOk_ImageUserModalPopup() {\r\n var imageUserPath = $(\"#hfdImagePath\").attr(\"value\");\r\n if (imageUserPath != \"\") {\r\n $(\"#imgFoto\").attr(\"src\", imageUserPath);\r\n pathImagen = imageUserPath;\r\n }\r\n $('#dialogoCambiarFoto').wijdialog('close');\r\n}", "function displayUploadedImage( cropOptions ) {\n\n\t\t// display image,\n\t\t// assign its properties as data attributes\n\t\t// initialise crop tool with settings\t\t\n\t\t$( '#img' ).attr( 'src', imgPath ).data( {\n\t\t\tname : imgName,\n\t\t\twidth : imgWidth,\n\t\t\theight : imgHeight,\n\t\t\tsize : imgSize,\n\t\t\ttype : imgOrigType,\n\t\t\tpath : imgPath \n\t\t}).fadeIn( 300 ).Jcrop( cropOptions, function() {\n\t\t\tjCropAPI = this;\n\t\t});\n\t\t$( '#delete' ).removeAttr( 'disabled' );\n\t\t$( '#crop' ).removeAttr( 'disabled' );\t\n\t\t$( '#template' ).attr( 'disabled', 'disabled' );\n\t\t$( 'h2' ).animate( { opacity : 1 }, 300 );\t\n\t\tinput.attr( 'disabled', 'disabled' );\t\n\t\tuserMsg( \"Image successfully uploaded.\" );\n\t}", "function showPic() {\r\n var nextImage = document.createElement(\"img\");\r\n nextImage.src = \"img/roles/\" + rolePics[0].fileName;\r\n nextImage.id = rolePics[0].id;\r\n nextImage.alt = rolePics[0].altText;\r\n document.querySelector(\".DnD__toDrag-img\").appendChild(nextImage);\r\n}", "function loadSingleOption(singleImageURL) {\n setTab('t1');\n document.getElementById('url').value = singleImageURL;\n updateImageUrl(singleImageURL);\n}", "function show_meal_image_picker_dialog() {\n if (!isEmpty(user_meal_images_url_cache)) {\n populate_meal_image_picker_list_with_user_images();\n } else {\n populate_meal_image_picker_list_with_default_images();\n }\n document.getElementById('meal_image_picker_pop_up_background').style.display = \"block\";\n}", "function uploadDraggedImage(event) {\n\t\t\tvar fileUrl = event.dataTransfer.getData(\"text/uri-list\");\n\n\t\t\tsch.dump(fileUrl);\n\n\t\t\tif (fileUrl.match(/^(.+)\\.(jpg|jpeg|gif|png)$/i)<1) {\n\t\t\t\talert(\"File must be one of the following:\\n .jpg, .jpeg, .gif, .png\");\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tSpaz.UI.uploadImage(fileUrl);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}", "PresentDialogToOpenOneImageFile(\n\t\ttitle, // unused in this impl\n\t\tfn // (err?, absoluteFilePath?) -> Void\n\t)\n\t{\n\t\tconst self = this\n\t\tconst options =\n\t\t{\n\t\t\tmaximumImagesCount: 1\n\t\t}\n\t\twindow.imagePicker.getPictures(\n\t\t\tfunction(pictureURIs) {\n\t\t\t\tconst pictureURIs_length = pictureURIs.length\n\t\t\t\tif (pictureURIs_length == 0) {\n\t\t\t\t\tfn() // canceled ?\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// Since this iOS image picker plugin lets you pick more than one image,\n\t\t\t\t// we must check for this and simply let the user know. Cause it may not make\n\t\t\t\t// sense to try to pick the 0th img on the assumption ordering is retained \n\t\t\t\t// and have it fail confusingly.\n\t\t\t\tif (pictureURIs_length > 1) {\n\t\t\t\t\tfn(new Error(\"Please select only one image.\"))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst pictureURI = pictureURIs[0]\n\t\t\t\tfn(null, pictureURI)\n\t\t\t}, \n\t\t\tfunction (error) \n\t\t\t{\n\t\t\t\tconsole.log('Error: ' + error)\n\t\t\t\tfn(error)\n\t\t\t},\n\t\t\toptions\n\t\t)\n\t}", "function choose_img(files_id) { // function choose img upload from file in your folder.\r\n $(\"#\" + files_id).click();\r\n}", "function popupResult(result) {   \n var html\n   if (result.src) {\n html = '<img class=\"img-responsive\" style=\"margin:0 auto\" src=\"' + result.src + '\" /><input type=\"hidden\" value=\"'+result.src+'\" id=\"r-image-b64\">';\n $('#show-img-result').html(html)\n  }\n}", "function TinyMCE_advanced_getInsertImageTemplate()\n{\n\tvar template = new Array();\n\n\ttemplate['file'] = 'image.htm?src={$src}';\n\ttemplate['width'] = 340;\n\ttemplate['height'] = 280;\n\n\t// Language specific width and height addons\n\ttemplate['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0);\n\ttemplate['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0);\n\n\treturn template;\n}", "function openPicture(img) {\n $('#modal_picture_content').html(\"<img class='w3-modal-content w3-center' src=\"+img+\">\");\n document.getElementById('modal_picture').style.display='block'\n}", "function showUploaded() {\n var userImageUrl = $('#imgurl').val();\n $('#imgurl').val('');\n $('#uploaded-image-card').fadeIn();\n $('#uploaded-image-card').html('<h2>' + \"You uploaded:\" + '</h2>' + '<img src=\"' + userImageUrl + '\" alt=\"\" class=\"image-thumbnail\"/>'); \n $('#dropdown').removeClass('hidden'); \n }", "function insertImg(range, src, imageId) {\n if (range) {\n range.deleteContents();\n var divContainer = document.createElement(\"div\");\n divContainer.setAttribute('class', 'divImageHolder');\n\n var img = document.createElement(\"img\");\n img.setAttribute('src', src);\n img.setAttribute('alt', 'img');\n img.setAttribute('id', imageId);\n\n divContainer.appendChild(img);\n\n range.deleteContents();\n range.insertNode(divContainer);\n\n }\n}", "function link_to_image(pid)\r\n{\r\n temp = prompt(link_to_img_prompt, show_img_url+pid);\r\n return false;\r\n}", "async function insert_image(){\n\n let imagefoam = document.getElementById('imagePopupFoam').files;\n\n let popupList = $('#popup_mylist');\n let popupCh = $('#popup_mylist').children();\n let thisName = popupCh[0].id;\n //contentbtn=`<input type=\"button\" class = \"popup_db_title\" id=\"${thisContentsLa}++${thisContentsRa}++${thismarkerId}++${thisId}\"\n let thisSplit = thisName.split(\"++\");\n let thisLa = thisSplit[0];\n let thisRa = thisSplit[1];\n let thisMarkerId = thisSplit[2];\n let thisId = thisSplit[3];\n let thisTitle = thisSplit[3].split(\"(\")\n thisTitle = thisTitle[0];\n\n let dblistNum = $('.popup_db_list').length;\n\n console.log(\"imagefoam_____:\",imagefoam[0],imagefoam.length);\n console.log(\"1____dblistNum_____:\",dblistNum,\"\\n\");\n\n for(let i = 0; imagefoam.length > i; i++){\n\n let myname = `${thisId}_${dblistNum+1+i}`;\n let imageName = imagefoam[i].name;\n let pointNum = (dblistNum + i + 1) % 5;\n console.log(\"imageName:\",imageName, \"myname:\",myname);\n\n let result = await fetch(`http://localhost:3000/image/${imageName}`);\n let blob = await result.blob();\n //console.log(\"blob_________________:\",blob);\n let objectUrl = URL.createObjectURL(blob);\n console.log(\"objectUrl_________________:\",objectUrl);\n\n let contentbtn = `<img class = \"popup_db_list\" id=\"${thisId}++==++${imageName}\" src=\"\"\n alt=\"${imageName}\" onclick=\"show_image(this);\">`;\n\n popupList.append(contentbtn);\n document.getElementById(`${thisId}++==++${imageName}`).src = objectUrl//srcData;\n contentbtnId = $('#popup_mylist').children(\"input:last\").attr(\"id\");\n\n checkbox = `<input type=\"checkbox\" class = \"popup_db_checkbox\" id=\"${thisId}++==++${imageName}+checkbox\"\n onclick=\"get_checked();\" \"></input>`;//style=\"display:none;\n\n popupList.append(checkbox);\n checkboxId = $('#popup_mylist').children(\"input:last\").attr(\"id\");\n\n console.log(\"loop____i_____:\",i,\"\\n\",\n \"myname______\",myname,\"\\n\",\n \"pointNum=(dblistNum + i + 1) % 5_____:\", pointNum, \"\\n\");\n\n console.log(\"$('.popup_db_list'):\", $('.popup_db_list'));\n\n if(pointNum === 0 && dblistNum !== 0){\n let space = `<br/>`;\n popupList.append(space);\n console.log(\"insert <br>\");\n console.log(\"$('.popup_db_list'):\", $('.popup_db_list'));\n console.log(\"$('#popup_mylist'):\", $('#popup_mylist').children());\n }\n\n var MypopupId = new popupID(myname,contentbtnId,checkboxId);\n mypopupDic[myname] = MypopupId\n\n var httpRequest = new XMLHttpRequest();\n\n var data = JSON.stringify({\n id: \"i_contents\",\n sig: \"insert_image\",\n contents: [thisLa, thisRa, thisId, thisTitle, thisMarkerId, imageName]\n })\n\n //console.log(\"insert_image_____________________:\",contentsID, \"\\n\",contentsTitle,\"\\n\", filename,\"\\n\", srcData);\n httpRequest.open('POST', 'http://localhost:3000');\n httpRequest.send(data);\n\n //URL.revokeObjectURL(blob);\n\n }\n document.getElementById('imagePopupLabel').innerHTML = \"Choose images to upload\";\n history.go(0);\n //location.reload(true);\n}" ]
[ "0.7541309", "0.7215126", "0.7118943", "0.6926356", "0.6894035", "0.67635053", "0.6601723", "0.65470695", "0.6531377", "0.6474292", "0.6439846", "0.64021355", "0.63644123", "0.6291139", "0.6266591", "0.62444633", "0.62285763", "0.62196326", "0.62155485", "0.621167", "0.6185301", "0.6180516", "0.615408", "0.61438334", "0.6133255", "0.6132022", "0.61061794", "0.60992223", "0.6065765", "0.6050836", "0.6050836", "0.6050836", "0.60479236", "0.6020519", "0.60186493", "0.601658", "0.59877", "0.5983516", "0.59779793", "0.5963113", "0.59605265", "0.59403205", "0.59364486", "0.592237", "0.59065974", "0.59017366", "0.5899343", "0.5890268", "0.58840156", "0.5875503", "0.58585346", "0.5852804", "0.5849505", "0.58291936", "0.58281255", "0.5819993", "0.58190095", "0.58162516", "0.58064353", "0.5805507", "0.5795015", "0.57880145", "0.5767278", "0.57661825", "0.57650715", "0.5758597", "0.5750603", "0.5749736", "0.5747092", "0.5745708", "0.5740361", "0.57375133", "0.57305956", "0.5720153", "0.5717488", "0.57155645", "0.5708516", "0.57055074", "0.5705261", "0.56995016", "0.56954336", "0.5693892", "0.5678865", "0.56727576", "0.5669665", "0.56648815", "0.5663089", "0.56580645", "0.5653562", "0.56440973", "0.5643911", "0.5637516", "0.5636279", "0.56361824", "0.56358343", "0.56353354", "0.56323075", "0.56303096", "0.5629668", "0.56283754" ]
0.70658576
3
Show filenames of uploaded images in "Insert image" dialog Get filenames from server and insert them into dialog
function setUploadedImagesList() { //see: http://api.jquery.com/jQuery.get/ $.post("./common/controller.php", {action: 'getUploadedImageFileNames'}, function(data) { var list = document.getElementById('insert-image-reuse'); var reuseGroup = document.getElementById('insert-image-reuse-group'); data = JSON.parse(data); if (data != null && data.length) { var i, length = data.length, option; // add options with filenames to select for (i = 0; i < length; i++) { option = document.createElement('option'); option.value = data[i]; option.textContent = data[i]; list.appendChild(option); } // enable reuse select and group button list.disabled = false; reuseGroup.disabled = false; } else { // disable reuse select and group button list.disabled = true; reuseGroup.disabled = true; } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showInsertImageDialog() {\n resetToNoneState();\n\n draw();\n\n setUploadedImagesList();\n\n var dialogContent = document.getElementById('insert-image-dialog');\n $.modal(dialogContent, {minWidth: '450px', containerId: 'upload-image-dialog', overlayClose: true});\n // update dialog's position\n $.modal.setPosition();\n\n // empty upload errors in dialog\n var errorDiv = document.getElementById(uploadImageErrorDivId);\n errorDiv.innerHTML = '';\n}", "function filename()\n{ \n var fileName = document.getElementById(\"blog_image\").files[0].name;\n document.getElementById('image_label').innerText=fileName;\n}", "function openOldImageDialog(title,onInsert){\r\n\t\tvar params = \"type=image&post_id=0&TB_iframe=true\";\r\n\t\t\r\n\t\tparams = encodeURI(params);\r\n\t\t\r\n\t\ttb_show(title,'media-upload.php?'+params);\r\n\t\t\r\n\t\twindow.send_to_editor = function(html) {\r\n\t\t\t tb_remove();\r\n\t\t\t var urlImage = jQuery(html).attr('src');\r\n\t\t\t if(!urlImage || urlImage == undefined || urlImage == \"\")\r\n\t\t\t\tvar urlImage = jQuery('img',html).attr('src');\r\n\t\t\t\r\n\t\t\tonInsert(urlImage,\"\");\t//return empty id, it can be changed\r\n\t\t}\r\n\t}", "function displayImageText(){\n var fileValue = document.getElementById(\"filebtn\");\n var txt = \"\";\n if ('files' in fileValue) {\n if (fileValue.files.length == 0) {\n txt = \"\";\n } else {\n for (var i = 0; i < fileValue.files.length; i++) {\n txt += \"<br><strong>\" + (i+1) + \". File: </strong>\";\n var file = fileValue.files[i];\n if ('name' in file) {\n txt += file.name + \"<br>\";\n }\n if ('size' in file) {\n txt += \"Size: \" + file.size + \" bytes <br>\";\n }\n }\n }\n } \n else {\n if (fileValue.value == \"\") {\n txt += \"\";\n } else {\n txt += \"The files property is not supported by your browser!\";\n txt += \"<br>The path of the selected file: \" + fileValue.value; \n }\n }\n document.getElementById(\"imageVal\").innerHTML = txt;\n}", "function onUploadResponse(event) {\n var images = event.data.split('|');\n var imageContainer = $('#imagepickerthumbs');\n\n var image = images[0].split(':');\n\n imageContainer.prepend('<li id=\"i' + image[1] + '\"><span class=\"i\" style=\"background-image: url(/content/img/lib/cms/' + image[1] + '.jpg);\">' + image[1] + '</span><span>' + image[0] + '</span></li>');\n}", "function openNewImageDialog(title, onInsert, isMultiple){\r\n\t\t\r\n\t\topenNewMediaDialog(title, onInsert, isMultiple, \"image\");\r\n\t\t\r\n\t}", "function batchTagImagesDialog(){\r\n\t// XXX\r\n}", "function uploadCallback(e,data){\n\tvar filename = data.files[0][\"name\"];\n\tvar publicurl = data.result[0].publicUrl;\n\tvar path = data.result[0].location;\n\t$(\"#Post_fileFolder\").val(data.result[0].fileFolder); // add the folder with the files to the form\n\t$(\"#attachments ul\").append('<li><i name=\"'+path+'\" class=\"icon-remove cursor delAttachment\"></i> <a href=\"'+publicurl+'\" title=\"'+filename+'\"><img src=\"'+publicurl+'\" title=\"'+filename+'\" height=\"75\" width=\"75\"/></a></li>');\n}", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n\n var reader = new FileReader();\n\n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n // Render thumbnail.\n var img = $(\"#imgOriginal\")[0];\n img.src = e.target.result;\n $(\"#dialogOriginal\").dialog({\n width: img.width + 10,\n heigth: img.height + 10\n });\n };\n })(f);\n\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }", "onDrop(files) {\n let data = new FormData();\n \n // Goes through every single file that was chosen and adds it to the data\n // that will be sent\n files.map(file=> {\n data.append(file.name, file, file.name);\n });\n\n const config = {\n headers: { 'content-type': 'multipart/form-data' }\n }\n\n // Uploading the pictures to the server\n const request = axios.post('/pages/images', data, config);\n\n // Shows the images that were added\n request.then(result => {\n let updatedContentWithImages = tinyMCE.activeEditor.getContent();\n\n // Adds the images to the current text with fixed size\n updatedContentWithImages = result.data.imageUrls.reduce((acu,curr)=>acu + \"<img src='\" + curr + \"' height='200' width='200'/>\", updatedContentWithImages);\n\n // Set the content of the editor\n tinyMCE.activeEditor.setContent(updatedContentWithImages);\n })\n }", "function add_img() {\n var i, URL, imageUrl, id, file,\n files = gId('type_file').files; // all files in input\n if (files.length > 0) {\n for (i = 0; i < files.length; i++) {\n file = files[i];\n if (!file.type.match('image.*')) { //Select from files only pictures\n continue;\n }\n // Create array Images to be able to choose what pictures will be uploaded.\n // You cannot change the value of an <input type=\"file\"> using JavaScript.\n Images.push(file);\n URL = window.URL;\n if (URL) {\n var imageUrl = URL.createObjectURL(files[i]); // create object URL for image \n var img_block = document.createElement(\"div\");\n img_block.className = \"img_block\";\n gId('photo_cont').appendChild(img_block)\n var img_story = document.createElement(\"img\")\n img_story.className = \"img_story\";\n img_story.src = imageUrl;\n img_block.appendChild(img_story);\n var button_delete = document.createElement(\"button\"); // create button to delete picture\n button_delete.className = \"button_3\";\n var x = document.createTextNode(\"x\");\n button_delete.appendChild(x)\n img_block.appendChild(button_delete);\n }\n }\n gId('photo_cont').style.display = 'inline-block';\n }\n}", "function handleFileSelect(e) {\n\n //if (!e.files) return;\n if (!e.files || !window.FileReader) return;\n\n var files = e.files;\n var fileNames = \"\";\n var filesArr = Array.prototype.slice.call(files);\n\n for (var i = 0; i < filesArr.length; i++) {\n var file = files[i];\n if (!file.type.match(\"image.*\")) {\n return;\n }\n var reader = new FileReader();\n //reader.onload = function (e) {\n // $('#blah').attr('src', e.target.result);\n //}\n\n reader.onload = function (e) {\n $(\".images\").append(\" <img class='arrayimg' src='\" + e.target.result + \"' width='50' height='50' />\");\n }\n reader.readAsDataURL(file);\n }\n $(\".images\").html(fileNames);\n\n}", "function subForm1(){\r\n \r\n if (imageNumber() <1 ) {\r\n alert(\"No file\"); \r\n return;\r\n }\r\n \r\n var fd = new FormData();\r\n fd.append(\"name\", \"paul\");\r\n $(\"#\" + imagelist + \" img\").each(function( index,element ) {\r\n //alert($(element)[0].src);\r\n fd.append(\"image\"+index, $(element)[0].src);\r\n });\r\n $.ajax({\r\n url: 'index.php',\r\n data: fd,\r\n processData: false,\r\n contentType: false,\r\n type: 'POST',\r\n success: function ( data ) {\r\n alert( data );\r\n }\r\n });\r\n }", "function updateImageModal(){\n var filename = $('#browser').children().eq(rightIndex).find('.browser-files-file').text();\n var string ='<img src=\"get-imgs?type='+filename+'\" alt=\"' +filename+'\" class= \"imageModal-image\"></img>';\n $('#imageModal').find('.modal-body').empty();\n $('#imageModal').find('.modal-body').append(string);\n}", "function onImageUpload(photos, editor, welEditable)\n\t{\n\t\t$.each(photos, function(index, photo)\n\t\t{\n\t\t\tuploadPhoto(photo).done(function(response) {\n\n\t\t\t\teditor.insertImage(welEditable, response.url);\n\n\t\t\t}).fail(function(response, xhr, code)\n\t\t\t{\n\t\t\t\tconsole.warn('failure', response, xhr, code);\n\t\t\t\talert('Failed to upload image.');\n\t\t\t});\n\n\t\t});\n\t}", "function showImage(path){\r\n\t$('#imageDialog').html(\"<img src='\" + path + \"'></img>\");\r\n\t$('#imageDialog').dialog('open');\r\n\t$('#imageDialog').dialog({title:getName()});\r\n\treturn false;\r\n}", "function updateImageDisplay() {\n var preview = document.querySelector('.preview'+fileKey);\n var input = document.getElementById('image_uploads'+fileKey);\n \n while(preview.firstChild) {\n preview.removeChild(preview.firstChild);\n }\n\n var curFiles = input.files;\n if(curFiles.length === 0) {\n\tvar para = document.createElement('p');\n para.textContent = 'Nenhum arquivo selecionado';\n preview.appendChild(para);\n } else {\n\t var listItem = document.createElement(\"div\");\n var para = document.createElement('p');\n\t \n if(validFileType(curFiles[0])) {\n var image = document.createElement('img');\n image.src = window.URL.createObjectURL(curFiles[0]);\n\t\t\n listItem.append(image);\n\t\t\n } else {\n para.textContent = 'O Arquivo ' + curFiles[0].name + ': Não é um tipo de arquivo válido.';\n\t\tlistItem.append(para);\n }\n\t \n\t preview.appendChild(listItem); // adiciona na div\n }\n}", "function up_initFileUploads(imagepath) {\n up_imagePath = imagepath;\n\n // Bug fix: show cancel button in ModalBox in safari\n var preload_cancel = new Image();\n preload_cancel.src = up_imagePath + 'cancelbutton.gif';\n\n var W3CDOM = (document.createElement && document.getElementsByTagName);\n if (!W3CDOM) return;\n var fakeFileUpload = document.createElement('div');\n fakeFileUpload.className = 'upFakeFile';\n var txt = document.createElement('input');\n txt.className = 'upFileBox';\n fakeFileUpload.appendChild(txt);\n var image = document.createElement('img');\n image.src = up_imagePath + 'selectbutton.gif';\n image.style.cursor = 'hand';\n image.style.marginLeft = '5px';\n image.className = 'upSelectButton';\n fakeFileUpload.appendChild(image);\n var x = document.getElementsByTagName('input');\n for (var i = 0; i < x.length; i++) {\n if (x[i].type != 'file') continue;\n if (x[i].parentNode.className.indexOf('upFileInputs') != 0 || x[i].relatedElement != null) continue;\n\n x[i].className = 'upFile hidden';\n var clone = fakeFileUpload.cloneNode(true);\n x[i].parentNode.appendChild(clone);\n x[i].relatedElement = clone.getElementsByTagName('input')[0];\n x[i].onchange = x[i].onmouseout = function() {\n if (this.cleared || this.value == '') return;\n\n var val = this.value;\n val = val.substr(val.lastIndexOf('\\\\') + 1, val.length);\n val = val.substr(val.lastIndexOf('/') + 1, val.length);\n this.relatedElement.value = val;\n }\n }\n}", "function showUploaded() {\n var userImageUrl = $('#imgurl').val();\n $('#imgurl').val('');\n $('#uploaded-image-card').fadeIn();\n $('#uploaded-image-card').html('<h2>' + \"You uploaded:\" + '</h2>' + '<img src=\"' + userImageUrl + '\" alt=\"\" class=\"image-thumbnail\"/>'); \n $('#dropdown').removeClass('hidden'); \n }", "function file_com_img(img){\n \n var files=$(img)[0].files;\n var filename= files[0].name;\n var extension=filename.substr(filename.lastIndexOf('.')+1);\n var allowed=[\"jpg\",\"png\",\"jpeg\"];\n \n if(allowed.lastIndexOf(extension)===-1){\n $.alert({\n title:'Error on file type!',\n content:'The file type selected is not of jpg , jpeg or png. Please select a valid image/photo',\n type:'red',\n typeAnimated:true,\n buttons:{\n ok:{\n text:'Ok',\n btnClass:'btn-red',\n action:function()\n {\n img.value=\"\";\n $('#label-span').html('Select photo/image');\n\t\t\t\t\t\t/*\n $('#upload_image_view').attr({src:\"assets/img/default-icon-1024.png\"}).show();\n $('#hidden_pre_div').hide();*/\n }\n }\n }\n });\n }else{\n if(img.files && img.files[0])\n {\n var filereader = new FileReader();\n filereader.onload=function(evt)\n {\n //Hide the default image/photo\n //$('#upload_image_view').hide();\n //Show the image selected and add an img element to the div element\n //$('#hidden_pre_div').show().html('<img src=\"'+evt.target.result+'\" width=\"200\" height=\"200\" />');\n //set label text\n $('#label-span').html(''+filename);\n\t\t\t \n };\n filereader.readAsDataURL(img.files[0]);\n }\n }\n}", "function showImagesEventHandler(e) {\n var app = UiApp.getActiveApplication();\n var panel = app.getElementById('panelForImages').clear();\n var info = Utilities.jsonParse(ScriptProperties.getProperty('info'));\n for (i in info) {\n if (info[i][0] == e.parameter.albumListBox) {\n var data = UrlFetchApp.fetch(URL + '/albumid/' + info[i][1], googleOAuth_()).getContentText();\n var xmlOutput = Xml.parse(data, false);\n var photos = xmlOutput.getElement().getElements('entry');\n for (j in photos) {\n panel.add(app.createImage(photos[j].getElement('content').getAttribute('src').getValue()));\n }\n }\n }\n return app;\n}", "function displayImageInfo() {\n\t\t\t\t// Get selected file\n\t\t\t\tvar selectedFiles = finder.request( 'files:getSelected' );\n\t\t\t\tvar file = selectedFiles.first();\n\n\t\t\t\t// Send ImageInfo command to the server\n\t\t\t\tfinder.request( 'command:send', {\n\t\t\t\t\tname: 'ImageInfo',\n\t\t\t\t\tfolder: file.get( 'folder' ),\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tfileName: file.get( 'name' )\n\t\t\t\t\t}\n\t\t\t\t} ).done( function( response ) {\n\t\t\t\t\tif ( !response.error ) {\n\t\t\t\t\t\t// Display a dialog window\n\t\t\t\t\t\tfinder.request( 'dialog', {\n\t\t\t\t\t\t\ttemplate: imageInfoTemplate,\n\t\t\t\t\t\t\ttemplateModel: new Backbone.Model( response ),\n\t\t\t\t\t\t\ttitle: 'Image Info',\n\t\t\t\t\t\t\tname: 'ImageInfoDialog',\n\t\t\t\t\t\t\tbuttons: [ 'okClose' ]\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}", "function fnAddimage()\n{\n\t\n\tvar appImage=document.forms[0];\n\tvar imageName=trim(appImage.imgName.value);\n\tvar imageDesc=trim(appImage.imgDesc.value);\n\tappImage.imgName.value=imageName;\n\tappImage.imgDesc.value=imageDesc;\n\n\tif(imageName.length==0 || imageName.value==\"\" )\n\t{\n\t\n\t\tvar id = '798';\n\t\t//hideErrors();\n\t\taddMsgNum(id);\n\t\tshowScrollErrors(\"imgName\",-1);\n \t\treturn false;\n\n\t}\t\n\tif (imageDesc.length>2000)\n\t{\n\t\tvar id = '799';\n\t\t//hideErrors();\n\t\taddMsgNum(id);\n\t\tshowScrollErrors(\"imgDesc\",-1);\n\t\treturn false;\n\t\t\n\t}\n\n\n\n\t\n\n\tvar toLoadFileName=document.forms[0].imageSource.value;\n\n\ttoLoadFileName=toLoadFileName.substring(0,toLoadFileName.indexOf('_'));\n\tvar fileName=document.forms[0].imageSource.value;\n\n\t\n\t\t\n\t\t\tif (fileName==\"\" || fileName.length==0)\n\t\t\t{\n\t\t\t\t\t\t\tvar id='780';\n\t\t\t\t\t\t\t//hideErrors();\n\t\t\t\t\t\t\taddMsgNum(id);\n\t\t\t\t\t\t\tshowScrollErrors(\"imageSource\",-1);\n\t\t\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\tif(fileName==\"\"){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar code=fileName.split(\"\\\\\");\n\t\t\t\t\tvar temp=\"\";\n\t\t\t\t\tif (code.length > 1)\t{\n\t\t\t\t\t\tfor (j=1;j<code.length;j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp=code[j];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp=code[0];\n\t\t\t\t\t}\n\t\t\t\t\tif(temp!=\"\")\n\t\t\t\t\t{\n\t\t\t\t\tvar checkParam=temp.substring(temp.indexOf('.')+1,temp.length);\n\t\t\t\t\t\n\t\t\t\t\tvar flag = false;\n\t\t\t\t\tvar arr = new Array();\n\t\t\t\t\tarr[0] = \"gif\";\n\t\t\t\t\tarr[1] = \"jpeg\";\n\t\t\t\t\tarr[2] = \"bmp\";\n\t\t\t\t\tarr[3] = \"tiff\";\n\t\t\t\t\tarr[4] = \"jpg\";\n\t\t\t\t\tarr[5] = \"tif\";\n\t\t\t\t\tarr[6] = \"pdf\";//Added for CR_97 for allowing PDF files in Appendix\n\t\t\t\t\t\n\t\t\t\t\tfor(var i = 0 ; i < arr.length; i++){\n\t\t\t\t\t\tif(trim(checkParam.toLowerCase())==arr[i]){\n\t\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!flag){\n\t\t\t\t\t\n\t\t\t\t\t\tvar id='901';\n\t\t\t\t\t\t//hideErrors();\n\t\t\t\t\t\taddMsgNum(id);\n\t\t\t\t\t\tshowScrollErrors(\"imageSource\",-1);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\tdocument.forms[0].action=\"AppendixAction.do?method=addImage\";\n\t\t\t\t\tdocument.forms[0].submit();\n}\n}", "function onImageFileChange() {\n // Show the name of the file\n if (this.files.length > 0) {\n // Get a preview of the selected files\n let reader = new FileReader();\n reader.onload = e => {\n let $preview = $('#projectImagePreview');\n $preview.attr('src', e.target.result);\n $preview.show();\n };\n reader.readAsDataURL(this.files[0]);\n $('#labelImageFile').text(this.files[0].name);\n $('#selectProjectImages').val('');\n $('#selectProjectImages')\n .data('picker')\n .sync_picker_with_select();\n }\n}", "async function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n\n var url_list = '';\n var image_list = '';\n\n for (var i = 0; i < evt.target.files.length; i++) {\n var src = URL.createObjectURL(this.files[i]);\n image_list += '<li><img id=\"myImg\" src=\"'+ src + '\"></li>';\n var file = evt.target.files[i];\n var metadata = {\n 'contentType': file.type\n };\n\n var snapshot = await storageRef.child('images/' + file.name).put(file, metadata);\n console.log('Uploaded', snapshot.totalBytes, 'bytes.');\n console.log('File metadata:', snapshot.metadata);\n // Let's get a download URL for the file.\n var url = await snapshot.ref.getDownloadURL();\n console.log('File available at', url);\n url_list += '<li><a href=\"' + url + '\">' + file.name + '</a></li>';\n \n console.log(url_list);\n }\n $('#messagesDiv > div.list-urls').html(url_list); \n $('#messagesDiv > div.image-lists').html(image_list);\n storageRef.putString(image_name_list);\n }", "function previewImage() {\r\n var image = document.getElementById(\"image\");\r\n \r\n var imagePreview = document.getElementById(\"imagePreview\");\r\n var arr = image.value.split('\\\\');\r\n imagePreview.src = \"images/\" + arr[arr.length-1];\r\n}", "function Attachments(input, count) {\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n document.getElementById('PhotoSource' + count + '').value = e.target.result; //Generated DataURL\n document.getElementById('PhotoFileName' + count + '').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "setEditImages(){\n // first clear imagesPreviewContainer\n var previewsContainer = document.getElementById('imagesPreviewContainer');\n previewsContainer.innerHTML = '';\n\n // check what is user doing\n if(this.get('actionType') === 'edit'){\n // if is editing get images from sharedData\n var images = this.get('sharedData').get('imagesToEdit');\n\n // this value will be innerHTML\n var imagesHTML = '';\n\n // loop through images and set them to previous declared variable\n for(var i = 0; i < images.length; i++){\n // create image\n var img = '<img src=' + images[i] + ' class=\"previewImage\" />';\n\n // append image to global variable\n imagesHTML += img;\n }\n\n // set previewContainer innerHTML as imagesHTML\n previewsContainer.innerHTML = imagesHTML;\n\n }else {\n // if is adding, clear the input file\n document.getElementById('inputFileElement').value = '';\n }\n\n }", "function getImages(name) {\n var selector = document.getElementById(\"selectShown\");\n var formdata = new FormData();\n //gewünschte Gruppe auslesen (übergeben oder aus selector)\n if (typeof (name) == \"string\") {\n formdata.set(\"selected\", name);\n } else {\n var strArray = selector.value.split(\" \");\n var selected = strArray[1];\n formdata.set(\"selected\", selected);\n }\n //Request erstellen getImages-Handler aufrufen\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"http://localhost:4242/getImages\");\n xhr.onload = function () {\n //JSON response parsen\n var response = JSON.parse(xhr.responseText);\n var container = document.getElementById(\"thumbnailContainer\");\n \n //Container mit Thumbails leeren\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n \n //Container mit neuen Thumbnails füllen\n if (response.Files.length == 0) {\n var text = document.createElement(\"p\");\n text.innerText = \"Es sind keine Bilder vorhanden!\";\n container.appendChild(text);\n } else {\n //einzelne Thumbnails erstellen\n for (var i = 0; i < response.Files.length; i++) {\n var thumbnail = document.createElement(\"img\");\n thumbnail.addEventListener(\"click\", thumbClicked);\n thumbnail.setAttribute(\"id\", response.Files[i].Id);\n thumbnail.addEventListener(\"mouseenter\", showSize); //Größe wird angezeigt beim Hovern\n thumbnail.addEventListener(\"mouseleave\", showSize);\n thumbnail.style.position = \"relative\";\n thumbnail.style.textAlign = \"center\";\n thumbnail.style.color = \"red\";\n thumbnail.setAttribute(\"src\", \"/getImage?fileId=\" + response.Files[i].ThumbId + \"&gridfsName=\" + response.Path);\n thumbnail.className = \"thumbnail\";\n container.appendChild(thumbnail);\n }\n }\n }\n xhr.send(formdata);\n }", "function loadImageBtnClick() {\n if (invisible_file_input) {\n invisible_file_input.accept = '.jpg,.jpeg,.png,.bmp';\n invisible_file_input.onchange = function (event) {\n for (var i = 0; i < event.currentTarget.files.length; i++) {\n // create image info\n var imageInfo = new ImageInfo();\n imageInfo.fileRef = event.currentTarget.files[i];\n imageInfo.loadFromFile();\n // add image info\n gImageInfoList.push(imageInfo);\n }\n imageInfoRegionsSelectorUpdate();\n selectImageNumberUpdate();\n // image number input\n //if (gImageInfoList.length > 0)\n // imageNumberInput.max = gImageInfoList.length - 1;\n }\n invisible_file_input.click();\n }\n}", "function showPhotos(response) {\n console.log(\"Show Photos\");\n if (response.length > 0) {\n var uploadImages = '';\n for (var i = 0; i < response.length; i++) {\n var upImage = response[i];\n if (upImage.status) {\n uploadImages += '<div class=\"col-xs-6 col-md-4 thumbnail\"><img src=\"' + upImage.publicPath + '\" alt=\"' + upImage.filename + '\"></div>';\n } else {\n uploadImages += '<div class=\"col-xs-6 col-md-4 thumbnail\">Invalid file type - ' + upImage.filename + '</div>';\n }\n }\n $('#uploadedPhotos').html(uploadImages);\n } else {\n alert('No image uploaded.')\n }\n}", "function onPageLoad () {\n\t// Get the stored files object from local storage\n\tvar storedFilesObj = getStoredFilesObject()\n\n\t// Get the html container element for the uploaded images\n\tvar container = document.getElementById(\"uploaded-images\")\n\n\t// Get the files array of the stored files object\n\tvar files = storedFilesObj.files\n\n\t// Loop from 0 to the number of image files stored\n\tfor (var i = 0; i < files.length; i++) {\n\n\t\t// Create a new image html element\n\t\tvar img = document.createElement('img')\n\n\t\t// Set the 'src' property of the image element\n\t\t// to the \"ith\" file src in the stored object\n\t\timg.src = files[i]\n\n\t\t// Add the new image element to the html container\n\t\tcontainer.append(img)\n\t}\n}", "function uploadImageListFromServer(){\n\tvar xhr = new XMLHttpRequest();\n\t\n\txhr.open(\"GET\", \"/listImages\");\n\txhr.onload = function() {\n\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\n\t\tif(xhr.status == 200){\n\t\t\t\n\t\t\tresponseList = response;\n\t\t\t\n\t\t\t// data null check\n\t\t\tif(response == null || response == undefined)\n\t\t\t\treturn;\n\t\t\t// append valid data to gallery.\n\t\t\tresponse.forEach(element => {\n\t\t\t\tappendResponseToGallery(element.preview);\n\t\t\t});\n\t\t\t// add listeners.\n\t\t\tloadGallery(true, 'a.thumbnail');\n\t\t}\n\t\tif(xhr.status == 400){\n\t\t\t// show error message\n\t\t\talert(response.message);\n\t\t}\n\t};\n\txhr.send();\n}", "function getChosenFileName(obj) {\n var files = obj.files;\n var result = \"\";\n for (var i = 0; i < files.length - 1; i++) {\n result += files[i].name + \", \";\n }\n result += files[files.length - 1].name;\n $('#inputFileName').html(result);\n}", "function display_file_name(event) {\n // alert(event.fpfile.filename );\n $('.uploaded_file_name').text(event.fpfile.filename)\n}", "function handleFileSelect(evt) {\n let files = evt.target.files; // FileList object\n \n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n let reader = new FileReader();\n \n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(event) {\n // Render thumbnail.\n let span = document.createElement('span');\n span.innerHTML = ['<img class=\"thumb\" src=\"', event.target.result,\n '\" title=\"', escape(theFile.name), '\"/>'].join('');\n document.getElementById('list').insertBefore(span, null);\n $('#add-post-container .input-field').find('#button').addClass('button-image');\n $('#add-post-container .input-field').find('#description-span').addClass('image-span');\n let $inputContent = $('#first_name').val();\n if ($inputContent && $('#files').val()) {\n $publishButton.removeAttr('disabled');\n } else {\n $publishButton.attr('disabled', true);\n } \n };\n })(f);\n \n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }", "function loadImages() {\r\n var files = document.getElementById('images').files, i, file, reader;\r\n for (i = 0; i < files.length; i = i + 1) {\r\n file = files[i];\r\n if (file.name.endsWith(\".jpg\") || file.name.endsWith(\".gif\") || file.name.endsWith(\".png\")) {\r\n images.push(file);\r\n }\r\n }\r\n if (images.length > 0) {\r\n showLoadedImages(\"list\");\r\n } else {\r\n alert(\"No images found. Try another directory.\");\r\n }\r\n }", "function updateImageDisplay() {\n var curFiles = input.files;\n\n if(curFiles.length === 0) {\n } else {\n for(var i = 0; i < curFiles.length; i++) {\n // if(isThere(curFiles[i].name)){\n // alert('uz sa tam nachadza');\n // }\n // else(alert('neni'))\n // alert(isThere(curFiles[i]));\n var lastid = $(\".element:last\").attr(\"id\");\n var split_id = lastid.split(\"_\");\n var nextindex = Number(split_id[1]) + 1;\n var para = document.createElement('p');\n\n // para.textContent = 'Súbor ' + curFiles[i].name + ', veľkosť ' + returnFileSize(curFiles[i].size) + '.';\n var image = document.createElement('img');\n image.src = window.URL.createObjectURL(curFiles[i]);\n // alert(curFiles[i].name);\n $(\".element:last\").after(\"<div class='element' id='div_\" + nextindex + \"'></div>\");\n $(\"#div_\" + nextindex).append(\"<span id='remove_\" + nextindex + \"' class='remove'>X</span>\");\n $(\"#div_\" + nextindex).append(image);\n $(\"#div_\" + nextindex).append(para);\n\n // var lastPic = $('li:last').data-target;\n // $('li:last').after('<li><a data-target=\"'+lastPic+'\" data-toggle=\"tab\"><img src=\"'+this.children[0].children[0].src+'\" /></a></li>');\n\n $('.remove').click(function(){\n var id = this.id;\n var split_id = id.split(\"_\");\n var deleteindex = split_id[1];\n\n // Remove <div> with id\n $(\"#div_\" + deleteindex).remove();\n event.stopPropagation();\n event.preventDefault();\n });\n }\n }\n }", "function ShowPreview(input) {\n var fileName = $('input[type=file]').val();\n //$(\"#hdfOldImageName\").val(\"\");\n $(\"#hdfImageName\").val(fileName);\n if (input.files && input.files[0]) {\n var ImageDir = new FileReader();\n ImageDir.onload = function (e) {\n $(\"#profileImage\").attr(\"src\", e.target.result);\n }\n ImageDir.readAsDataURL(input.files[0]);\n }\n\n var validator = $(\"#frm_Profile\").validate();\n validator.element(\"#hdfImageName\");\n}", "function displayMultiSelection(files) {\n $(\".upload-filelist\").empty();\n for (var i=0; i<files.length; i++) {\n $(\".upload-filelist\").append($(\"<li/>\").text(files[i].name));\n }\n }", "function openAddonImageSelectDialog(title, onInsert){\r\n\t\t\r\n\t\topenAddonMediaSelectDialog(title, onInsert, \"image\");\r\n\t\r\n\t}", "function imageUploaded(result) {\r\n var message = result.entry.name + \" created at \" + result.entry.created;\r\n var id = result.entry.id;\r\n notify(id, message);\r\n viewImage(result);\r\n}", "async function insert_image(){\n\n let imagefoam = document.getElementById('imagePopupFoam').files;\n\n let popupList = $('#popup_mylist');\n let popupCh = $('#popup_mylist').children();\n let thisName = popupCh[0].id;\n //contentbtn=`<input type=\"button\" class = \"popup_db_title\" id=\"${thisContentsLa}++${thisContentsRa}++${thismarkerId}++${thisId}\"\n let thisSplit = thisName.split(\"++\");\n let thisLa = thisSplit[0];\n let thisRa = thisSplit[1];\n let thisMarkerId = thisSplit[2];\n let thisId = thisSplit[3];\n let thisTitle = thisSplit[3].split(\"(\")\n thisTitle = thisTitle[0];\n\n let dblistNum = $('.popup_db_list').length;\n\n console.log(\"imagefoam_____:\",imagefoam[0],imagefoam.length);\n console.log(\"1____dblistNum_____:\",dblistNum,\"\\n\");\n\n for(let i = 0; imagefoam.length > i; i++){\n\n let myname = `${thisId}_${dblistNum+1+i}`;\n let imageName = imagefoam[i].name;\n let pointNum = (dblistNum + i + 1) % 5;\n console.log(\"imageName:\",imageName, \"myname:\",myname);\n\n let result = await fetch(`http://localhost:3000/image/${imageName}`);\n let blob = await result.blob();\n //console.log(\"blob_________________:\",blob);\n let objectUrl = URL.createObjectURL(blob);\n console.log(\"objectUrl_________________:\",objectUrl);\n\n let contentbtn = `<img class = \"popup_db_list\" id=\"${thisId}++==++${imageName}\" src=\"\"\n alt=\"${imageName}\" onclick=\"show_image(this);\">`;\n\n popupList.append(contentbtn);\n document.getElementById(`${thisId}++==++${imageName}`).src = objectUrl//srcData;\n contentbtnId = $('#popup_mylist').children(\"input:last\").attr(\"id\");\n\n checkbox = `<input type=\"checkbox\" class = \"popup_db_checkbox\" id=\"${thisId}++==++${imageName}+checkbox\"\n onclick=\"get_checked();\" \"></input>`;//style=\"display:none;\n\n popupList.append(checkbox);\n checkboxId = $('#popup_mylist').children(\"input:last\").attr(\"id\");\n\n console.log(\"loop____i_____:\",i,\"\\n\",\n \"myname______\",myname,\"\\n\",\n \"pointNum=(dblistNum + i + 1) % 5_____:\", pointNum, \"\\n\");\n\n console.log(\"$('.popup_db_list'):\", $('.popup_db_list'));\n\n if(pointNum === 0 && dblistNum !== 0){\n let space = `<br/>`;\n popupList.append(space);\n console.log(\"insert <br>\");\n console.log(\"$('.popup_db_list'):\", $('.popup_db_list'));\n console.log(\"$('#popup_mylist'):\", $('#popup_mylist').children());\n }\n\n var MypopupId = new popupID(myname,contentbtnId,checkboxId);\n mypopupDic[myname] = MypopupId\n\n var httpRequest = new XMLHttpRequest();\n\n var data = JSON.stringify({\n id: \"i_contents\",\n sig: \"insert_image\",\n contents: [thisLa, thisRa, thisId, thisTitle, thisMarkerId, imageName]\n })\n\n //console.log(\"insert_image_____________________:\",contentsID, \"\\n\",contentsTitle,\"\\n\", filename,\"\\n\", srcData);\n httpRequest.open('POST', 'http://localhost:3000');\n httpRequest.send(data);\n\n //URL.revokeObjectURL(blob);\n\n }\n document.getElementById('imagePopupLabel').innerHTML = \"Choose images to upload\";\n history.go(0);\n //location.reload(true);\n}", "function showFiles(data) {\n var html = \"\";\n for (var i = 0; i < data.length; i++) {\n var fileData = data[i];\n html += GenerateFileHTML(fileData);\n }\n $('#thumbs').html(html).selectable({\n filter: 'div.thumb',\n selected: function (event, ui) {\n currentImg = $(ui.selected).attr(\"file\").replaceAll(\"\\\\\", \"/\");\n sendFileToCKEditor(currentImg);\n }\n });\n createFileContextMenu();\n}", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n\n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n\n // Only process image files.\n console.log(f.type);\n\n var reader = new FileReader();\n\n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n doc.name = theFile.name ;\n\t doc.content = e.target.result;\n\t switchToPanel('adjust');\n\t document.getElementById('span_filename').innerHTML = doc.name;\n };\n })(f);\n\n // Read in the file as Text -utf-8.\n reader.readAsText(f);\n }\n}", "function displayBankLogo(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function(e) {\n $('#banklogoImage').attr('src', e.target.result);\n };\n reader.readAsDataURL(input.files[0]);\n var uploadedFilename = $('#bankLogo').val().split('/').pop().split('\\\\').pop();\n $('#logoUploadInput').val(uploadedFilename);\n }\n}", "function getImg() {\n filepicker.setKey(\"ABDI6UIw6SzCfmtCVzEI3z\");\n filepicker.pick({\n mimetypes: [\"image/*\"],\n container: \"modal\",\n services: filepickerServices(),\n },\n function(InkBlob) {\n $(\"#pic\").find(\".btn[type=submit]\").removeAttr(\"disabled\").removeClass(\"disabled\");\n $(\"#profile_pic\").attr(\"src\", InkBlob.url);\n $(\"#id_pic_url\").attr(\"value\", InkBlob.url);\n });\n}", "function ajxSelectImages() {\n serializedData = JSON.stringify({unDelete: true});\n jQuery.ajax({type: 'POST', url: \"ajxSelectImage.php\", dataType: 'json', data: \"data=\" + serializedData,\n success: function(data) {\n ajxSelectImagesDone(data);\n }\n });\n }", "function get_meta_images(){\n return $(\"#msb-images\").val().split(',');\n }", "function insertFile(file) {\n uploadFile(file, function (url) {\n var text = \"[img]\" + url + \"[/img]\";\n typeInTextarea(text);\n });\n }", "function fnCreateImageInput() {\n //Every time an image is added, add to the counter\n iImageCounter++;\n //Variable that contains the image input template\n var sImageInputTemplate = '<div class=\"lblPropertyFileUplaod\">\\\n <img class=\"imgPreview\" src=\"\"></img>\\\n <input class=\"file\" type=\"file\" name=\"file-' + iImageCounter + '\">\\\n </div>';\n //Append the template to the form\n $(\"#frmCreateProperty\").append(sImageInputTemplate);\n}", "function uploadEditorImg() {\n let formData = new FormData(); // FormData() helps to compile a request module.\n formData.append('type', 'set');\n formData.append('img', $('#editor-img-input')[0].files[0]);\n $.ajax({\n url: '/Vuvuzela/services/editor/editor_info.php',\n type: 'POST',\n data: formData,\n processData: false,\n contentType: false,\n enctype: 'multipart/form-data',\n success: (msg) => {\n if(msg['status'] === 'error') {\n showError($('#articles'), 'Error uploading image');\n console.log(msg['errorMsg']);\n } else if(msg['status'] === 'success') {\n let info = msg['data'];\n $('#editor-info-img').attr('src', '/Vuvuzela/' + info['img']);\n $('#editor-info-title').text(info['name']);\n }\n },\n error: (jqXHR, textStatus, errorThrow) => {\n showError($('#articles'), 'Error uploading image');\n console.log(jqXHR.responseText + \"\\n\" + textStatus + \"\\n\" + errorThrow);\n },\n dataType: 'json'\n });\n}", "function getimages(){\n\t\t\t\t var files = \"\";\n\t\t\t\t $.ajax({\n\t\t\t\t url: 'getFiles.php?image=true', // point to server-side PHP script \n\t\t\t\t dataType: 'text', // what to expect back from the PHP script, if anything \n\t\t\t\t type: 'get',\n\t\t\t\t async: false,\n\t\t\t\t success: function(text){\n\t\t\t\t files = text; // display response from the PHP script, if any\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t return files;\n\t\t\t\t}", "function handleFileSelect(evt) {\n var files = evt.target.files;\n\n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n\n var reader = new FileReader();\n\n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n\n\n // Render thumbnail.\n var span = document.createElement('li');\n\n span.innerHTML = [\n '<div class=\"img-delete\"><img src=\"assets/png/cancel.png\"></div><a data-fancybox=\"images\" data-type=\"image\" data-width=\"1000\" href=\"', e.target.result, '\"><img style=\"width: 113px;\" src=\"',\n e.target.result,\n '\" title=\"', escape(theFile.name),\n '\"/></a>'\n ].join('');\n \n document.getElementById('list').insertBefore(span, null);\n\n $('#myModal2').on('shown.bs.modal', function() {\n handleFileSelect();\n })\n };\n })(f);\n\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n\n\n }\n}", "function displayUploadedImage( cropOptions ) {\n\n\t\t// display image,\n\t\t// assign its properties as data attributes\n\t\t// initialise crop tool with settings\t\t\n\t\t$( '#img' ).attr( 'src', imgPath ).data( {\n\t\t\tname : imgName,\n\t\t\twidth : imgWidth,\n\t\t\theight : imgHeight,\n\t\t\tsize : imgSize,\n\t\t\ttype : imgOrigType,\n\t\t\tpath : imgPath \n\t\t}).fadeIn( 300 ).Jcrop( cropOptions, function() {\n\t\t\tjCropAPI = this;\n\t\t});\n\t\t$( '#delete' ).removeAttr( 'disabled' );\n\t\t$( '#crop' ).removeAttr( 'disabled' );\t\n\t\t$( '#template' ).attr( 'disabled', 'disabled' );\n\t\t$( 'h2' ).animate( { opacity : 1 }, 300 );\t\n\t\tinput.attr( 'disabled', 'disabled' );\t\n\t\tuserMsg( \"Image successfully uploaded.\" );\n\t}", "function upload_file2(img) {\n\t//var d = new Date();\n var toDisplay = \"<img id=\\\"upload1\\\" class=\\\"hidecls\\\" src='/~jadrn040/proj1/images/\" + img + \"?\" + new Date().getTime() +\"' />\";\t\n $('#upload_img2').html(toDisplay);\n}", "function ChequeAttachments(input, id) {\n\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById(id + 'PhotoSource').value = e.target.result; //Generated DataURL\n document.getElementById(id + 'FileName').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\" + id).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "function upload(files) {\r\n var roomId = getParam(\"id\");\r\n var formData = new FormData(),\r\n xhr = new XMLHttpRequest(),\r\n x;\r\n // Begränsar till att endast kunna ladda upp en bild\r\n for (x = 0; x < 1; x++) {\r\n formData.append('file[]', files[x]);\r\n }\r\n // Tar emot svar och skickar vidare till funktionen displayUploads() som visar den uppladdade bilden\r\n xhr.onload = function() {\r\n var data = JSON.parse(this.responseText);\r\n displayUploads(data, roomId);\r\n }\r\n xhr.open('post', 'ajax/uploadImage.php?id=' + roomId);\r\n xhr.send(formData);\r\n }", "refreshHiddenInput() {\n const files = $(this.options.filesContainer).find(\"button\").map((index, button) => {\n return $(button).attr(\"data-filename\");\n }).get().join(\",\");\n\n $(this.options.hiddenInput).val(files);\n }", "function choose_img(files_id) { // function choose img upload from file in your folder.\r\n $(\"#\" + files_id).click();\r\n}", "function handleImgsData(images) {\r\n\t\t\t\t\t\tvar html = '';\r\n\t\t\t\t\t\tfor ( var i = 0; i < images.length; i++) {\r\n\t\t\t\t\t\t\tvar imgT = images[i].images[6]['source'];\r\n\t\t\t\t\t\t\tvar imgN = images[i].images[4]['source'];\r\n\t\t\t\t\t\t\t$('#lastPics').append(\r\n\t\t\t\t\t\t\t\t\t'<li><a href=\"' + imgN\r\n\t\t\t\t\t\t\t\t\t\t\t+ '\" rel=\"external\">'\r\n\t\t\t\t\t\t\t\t\t\t\t+ '<img src=\"' + imgT\r\n\t\t\t\t\t\t\t\t\t\t\t+ '\" alt=\"NITHs\" /></a></li>');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar currentPage = $(e.target);\r\n\t\t\t\t\t\tvar p = Code.PhotoSwipe.getInstance(currentPage.attr('id'));\r\n\r\n\t\t\t\t\t\tif (p != null) {\r\n\t\t\t\t\t\t\tCode.PhotoSwipe.detatch(p);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar currentPage = $(e.target), options = {};\r\n\t\t\t\t\t\t$(\"ul.gallery a\", e.target).photoSwipe(options,\r\n\t\t\t\t\t\t\t\tcurrentPage.attr('id'));\r\n\r\n\t\t\t\t\t\tshowImgs();\r\n\t\t\t\t\t}", "static formImages() {\n let mainfsDirCount = PP64.fs.mainfs.getDirectoryCount();\n for (let d = 0; d < mainfsDirCount; d++) {\n let dirFileCount = PP64.fs.mainfs.getFileCount(d);\n for (let f = 0; f < dirFileCount; f++) {\n let fileBuffer = PP64.fs.mainfs.get(d, f);\n if (!PP64.utils.FORM.isForm(fileBuffer))\n continue;\n\n try {\n let formUnpacked = PP64.utils.FORM.unpack(fileBuffer);\n if (formUnpacked.BMP1.length) {\n formUnpacked.BMP1.forEach(bmpEntry => {\n let dataUri = PP64.utils.arrays.arrayBufferToDataURL(bmpEntry.parsed.src, bmpEntry.parsed.width, bmpEntry.parsed.height);\n console.log(`${d}/${f}:`);\n console.log(dataUri);\n });\n }\n }\n catch (e) {}\n }\n }\n }", "function upload_file3(img) {\n\t//var d = new Date();\n var toDisplay = \"<img id=\\\"upload2\\\" src='/~jadrn040/proj1/images/\" + img + \"?\" + new Date().getTime() +\"' />\";\n $('#upload_img3').html(toDisplay);\n}", "function ObtenerFormaAgregarEmpresa()\n{\n $(\"#dialogAgregarEmpresa\").obtenerVista({\n url: \"Empresa.aspx/ObtenerFormaAgregarEmpresa\",\n nombreTemplate: \"tmplAgregarEmpresa.html\",\n despuesDeCompilar: function(pRespuesta) {\n var ctrlSubirLogo = new qq.FileUploader({\n element: document.getElementById('divSubirLogo'),\n action: '../ControladoresSubirArchivos/SubirLogo.ashx',\n allowedExtensions: [\"png\",\"jpg\",\"jpeg\"],\n debug: true,\n onSubmit: function(id, fileName){\n $(\".qq-upload-list\").empty();\n },\n onComplete: function(id, file, responseJSON) {\n $(\"#divLogo\").html(\"<img src='../Archivos/EmpresaLogo/\" + responseJSON.name + \"' title='Logo' />\");\n $(\"#divLogo\").attr(\"archivo\", responseJSON.name);\n }\n });\n $(\"#dialogAgregarEmpresa\").dialog(\"open\");\n }\n });\n}", "function insertImage(){\n var form_data = new FormData(); \n form_data.append(\"gallery_file\", document.getElementById('gallery_file').files[0]);\n \n $.ajax({\n url:\"scripts/save_gallery.php\",\n method:\"POST\",\n data: form_data,\n contentType: false,\n cache: false,\n processData: false, \n success:function(data)\n {\n $('#modal_gallery').modal('hide');\n toastr[data['status']](data['message']);\n clearGalleryFields();\n setTimeout( function () {\n window.location.reload();\n }, 3000 );\n }\n });\n }", "function fnUpload() {\n\tvar mainmenu = $(\"#mainmenu\").val();\n\tvar userId = $(\"#userId\").val();\n\tvar houseId = $(\"#houseId\").val();\n\t$('#uploadPopup').load('uploadImgPopup?mainmenu='+mainmenu+'&time='+datetime+'&userId='+userId+'&houseId='+houseId);\n\t$(\"#uploadPopup\").modal({\n\t\tbackdrop: 'static',\n\t\tkeyboard: false\n\t});\n\t$('#uploadPopup').modal('show');\n}", "function showMyImage(fileInput, imagePreview) {\n var files = fileInput.files;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n var imageType = /image.*/;\n if (!file.type.match(imageType)) {\n continue;\n }\n var img = document.getElementById(imagePreview);\n img.file = file;\n var reader = new FileReader();\n reader.onload = (function (aImg) {\n return function (e) {\n aImg.src = e.target.result;\n };\n })(img);\n reader.readAsDataURL(file);\n }\n files = \"\";\n img = \"\";\n}", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n\n var files = evt.dataTransfer.files; // FileList object.\n \n // files is a FileList of File objects. List some properties.\n //var output = files[0].name;\n //console.log(files[0]);\n document.getElementById('uploadPic').name=files[0];\n for(var i = 0; i < files.length;i++){\n if (i == 0){ \n document.getElementById('dropzone').innerHTML = \"<p>\"+files[i].name +\"</p>\";\n }else{\n document.getElementById('dropzone').innerHTML += \"<p>\"+files[i].name +\"</p>\";\n }\n }\n /*for (var i = 0, f; f = files[i]; i++) {\n output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\n f.size, ' bytes, last modified: ',\n f.lastModifiedDate.toLocaleDateString(), '</li>');\n }*/\n \n }", "function Ins_Files() {\n // ShowLoading(\"#frmIns_Images\");\n $.ajax({\n url: \"/Action/ProcessBackendAction.ashx?ActionObject=Images&action=CMS-Ins\",\n type: \"POST\",\n dataType: \"json\",\n data: $(\"#frmIns_Images\").serialize(),\n\n success: function (data) {\n if (data.status == \"success\") {\n $(\".flexgripImages\").flexReload();\n showMessageBox(\"Thêm file thành công.\");\n\n }\n else if (data.status != \"success\") {\n showMessageBox(\"Thêm Images lỗi: <font style='font-size:9px'>\" + data.message + \"</font>\");\n\n }\n },\n error: function (ex) {\n }\n });\n}", "function CrearBtUploadImg(){\n\t\n\t var argv = CrearBtUploadImg.arguments;\n\t var BotonId = argv[0];\n\t var idImgMostrar = argv[1];\n\t var divGuardar = argv[2];\n\t var inputSize = argv[3];\n\t var inputName = argv[4];\n\t var inputFile = argv[5];\n\t\n\t var uploader = new qq.FileUploader({\n element: document.getElementById(BotonId),\n action: 'mul_multimedia_carga_temporal.php',\n multiple: false,\n template: '<div class=\"qq-uploader\">' +\n '<div class=\"qq-upload-drop-area\" style=\"display: none;\"><span>Drop files here to upload</span></div>' +\n '<div class=\"qq-upload-button\" style=\"height:17px;\">Seleccione un archivo</div>' +\n '<div class=\"qq-upload-size\"></div>' +\n '<ul class=\"qq-upload-list\"></ul>' + \n '</div>', \n\n onComplete: function(id, fileName, responseJSON) {\n\t\t\t\t var htmlmostrar = responseJSON.archivo.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');\n\t\t\t\t $(idImgMostrar).html(htmlmostrar);\n\t\t\t\t $(inputSize).val(responseJSON.size);\n\t\t\t\t $(inputName).val(responseJSON.nombrearchivo);\n\t\t\t\t $(inputFile).val(responseJSON.nombrearchivotmp);\n\t\t\t\t $(divGuardar).show();\n },\n messages: {\n },\n debug: false\n }); \n}", "function load_images_muploader(){\n $(\".mupload_img_holder\").each(function(i,v){\n if ($(this).next().next().val() != ''){\n if (!$(this).children().size() > 0){\n var h = $(this).attr('data-he');\n var w = $(this).attr('data-wi');\n $(this).append('<img src=\"' + $(this).next().next().val() + '\" style=\"height: '+ h +';width: '+ w +';\" />');\n $(this).next().next().next().val(\"Delete\");\n $(this).next().next().next().removeClass('at-upload_image_button').addClass('at-delete_image_button');\n }\n }\n });\n}", "function uploadDraggedImage(event) {\n\t\t\tvar fileUrl = event.dataTransfer.getData(\"text/uri-list\");\n\n\t\t\tsch.dump(fileUrl);\n\n\t\t\tif (fileUrl.match(/^(.+)\\.(jpg|jpeg|gif|png)$/i)<1) {\n\t\t\t\talert(\"File must be one of the following:\\n .jpg, .jpeg, .gif, .png\");\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tSpaz.UI.uploadImage(fileUrl);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}", "function addAdditionalImages(urlArray) {\r\n var freeUrlInputs = [];\r\n // getting free inputs (inf url and file inputs are empty)\r\n $(\".additional_image_file\").each(function() {\r\n var url = $(this).siblings(\"input.additional_image_url\").val();\r\n var file = $(this).val();\r\n if (\r\n file == \"\" && // new local file\r\n url == \"\" && // or url\r\n // image can be already set\r\n !$(this).parents(\"div.control-group.span6\").find(\".controls .rmAddPic\").size() > 0\r\n ) {\r\n freeUrlInputs.push($(this).siblings(\"input.additional_image_url\").attr('id'))\r\n }\r\n });\r\n\r\n if (urlArray.length > freeUrlInputs.length) {\r\n return \"Недостаточно мест для изображений\";\r\n }\r\n\r\n for (var i = 0; i < urlArray.length; i++) {\r\n var img = document.createElement(\"img\");\r\n img.src = urlArray[i];\r\n $(img).addClass('img-polaroid').css({\r\n width: '50px',\r\n 'max-heigth': '100%'\r\n });\r\n $(\"#\" + freeUrlInputs[i]).val(urlArray[i]);\r\n $(\"#\" + freeUrlInputs[i]).parents(\"div.control-group.span6\").find(\".controls\").html(img);\r\n }\r\n return true;\r\n }", "function handleImage(){\n let imageFile = document.getElementById(\"uploadImages\").files[0];\n let img = document.createElement(\"img\");\n img.src = window.URL.createObjectURL(imageFile);\n img.style.height = \"250px\";\n img.style.width = \"250px\";\n img.id = img.src;\n img.style.opacity = 1;\n img.onclick = () => selectImage(img);\n images.push(img);\n\n document.getElementById(\"imageUploadView\").appendChild(img);\n}", "function openProductImageDialog(imageIndex)\n{\n viewModel.productImageDialog(imageIndex);\n\n applyFileUploadEventListener();\n}", "function handleFileSelect() {\n var picture = document.getElementById('picture_input').files.item(0);\n displayPicturePreview(picture);\n }", "displayPicture(url){this.newPictureContainer.attr('src',url);page('/add');this.imageCaptionInput.focus();this.uploadButton.prop('disabled',true)}", "function filterServerImageList(filterbox, fieldName) {\n\tvar selbox = document.getElementById('select_' + fieldName);\n\n\tvar obj = $(selbox)\n\tvar res = obj.data[\"storedOptions\"]\n\tvar opt = \"\"\n\tfor (var sc = 0; sc < res.length - 1; sc++) {\n\t\tvar imageFilename = res[sc]\n\t\tif (imageFilename.toLowerCase().indexOf(filterbox.value.toLowerCase()) != -1) {\n\t\t\topt += \"<option>\" + imageFilename + \"</option>\"\n\t\t}\n\t}\n\tobj.html(opt)\n}", "function displayImage(){\n\t//Function always displays the image in the \"0\" value of the array\n\tcurrentImage.image = \"galleryImages/\" + imageFiles[0];\n}", "async function showFileNames() {\n const ul = document.getElementById('my-files');\n\n // Query from database to get files names\n const names = await fetch('/filenames');\n let returnedNames;\n if (names.ok) {\n returnedNames = await names.json();\n } else {\n returnedNames = { msg: 'No names found' };\n }\n\n for (const names of returnedNames) {\n const li = document.createElement('li');\n // console.log(names.originalName); // test file name output\n li.appendChild(document.createTextNode(names.originalName));\n ul.appendChild(li);\n }\n}", "function onPhotoDataSuccess(imageData) {\n curFile = imageData;\n setStuffForm();\n}", "function onSuccess(imageURI, name) {\n addImageURI(name,imageURI);\n}", "function handleMediaManagerSelect(fileData){\n quill.insertEmbed(insertPointIndex, 'image', fileData.url);\n}", "function uploadImage(event){\n\tvar files = event.target.files;\n\tvar formData = new FormData();\n\n\tfor (var i = 0, file; file = files[i]; i++) \n\t\tformData.append(\"image\"+i, file);\t\n\t\t\n\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\tdata: formData,\t\n\t\turl: server_path + \"uploadimage\",\n\t\tprocessData: false,\n\t\tcontentType: false,\n\t\tsuccess: traiteReponseUpload,\n\t\terror: traiteReponseErreur\n\n\t});\n\n}", "function addProgressImages(progressId,keys){\n\t// input file\n\tvar selectedFiles = document.querySelector('#progressUploadAddOnImages').files;\n\tvar selectedFile = document.querySelector('#progressUploadAddOnImages').files[0];\n\tvar count = 0;\n\tvar fileLength = selectedFiles.length;\n\n\tif(fileLength<=5 && keys<=5) {\n\tif (selectedFile != null && selectedFile.type.match('image')) {\n\n\tfor (var i = 0; i < selectedFiles.length;i++) {\n\t\tvar file = selectedFiles[i];\n\t\t// get file name && timestamp\n\t\tvar fullPaths = document.getElementById(\"progressUploadAddOnImages\").files[i].name;\n\t\tvar filenames = \"\";\n\t\tif (fullPaths) {\n\t\t filenames = fullPaths +\" (\" + Date.now() + \")\";\n\t\t}\nif (selectedFiles[i].type.match('image')){\n\t//Add Image data\n\tcount++;\n\taddImageData(progressId,filenames,selectedFiles[i],count,fileLength);\n\n} else {\n\talert(\"Please check your image type\");\n}\n}\n}else{\n\talert(\"Please check your image type\");\n} \n} else {\n\talert(\"You can only upload a maximum of 5 images\");\n}\n}", "function uploadFileInput(event) {\n $.loader({\n className:\"blue-with-image-2\",\n content:''\n });\n var files = $(\"#uploadFileInput\").get(0).files;\n uploadFile(files, \"uploadfile\", function(data, textStatus, jqXHR,\n uploaded_url) {\n $(\"#uploadFileInput\").val(\"\");\n var img = $('<img src=\"' +uploaded_url + '\"/>').load(function() {\n var w = this.width;\n var h = this.height;\n if (w < minWidthImg || h < minHeightImg) {\n $.loader('close');\n err('Minimum resolution is 800x500 px');\n } else {\n uploaded_url = uploaded_url.substring(uploaded_url.indexOf(\"image_\"));\n if(imagecount < images_num){\n onImageGallerySuccess(uploaded_url);\n imagecount++;\n }else{\n err('Limit exceeded on the allowed number of images');\n }\n $.loader('close');\n }\n });\n\n\n }, function(jqXHR, textStatus, errorThrown) {\n err('Unable to upload image to server');\n $.loader('close');\n });\n}", "addMedia() {\n var finder = new CKFinder();\n finder.selectActionFunction = (fileUrl) => {\n const tempArray = fileUrl.split(\"/\");\n // Get path\n let path = \"\";\n tempArray.forEach((e, i) => {\n if (i < tempArray.length - 1) {\n path += e + \"/\";\n }\n });\n // Get Images\n const selectedFiles = finder.api.getSelectedFiles();\n selectedFiles.forEach((e) => {\n this.$scope.data.Images.push(path + e.name);\n this.$scope.$apply();\n });\n };\n finder.SelectFunction = \"ShowFileInfo\";\n finder.popup();\n }", "function getImagesFilenames()\n{\n filenameArray = null;\n jQuery.ajax({\n type: \"POST\",\n contentType: \"JSON\",\n url: \"php/get_images_filenames.php\"\n }).done(function(jsonData){\n filenameArray = JSON.parse(jsonData);\n refreshGallery();\n }).fail(function(error){\n console.log(\"ERROR get_image_filenames.php : \" + error);\n });\n}", "function ShowImagePreview( files ){\n\n $(\"#imgSalida\").css('display', 'none');\n\n\n if( !( window.File && window.FileReader && window.FileList && window.Blob ) ){\n alert('Por favor Ingrese un archivo de Imagen');\n document.getElementById(\"myForm\").reset();\n return false;\n }\n\n if( typeof FileReader === \"undefined\" ){\n alert( \"El archivo no es una imagen por favor ingrese una\" );\n document.getElementById(\"myForm\").reset();\n return false;\n }\n\n var file = files[0];\n\n if( !( /image/i ).test( file.type ) ){\n alert( \"El archivo no es una imagen\" );\n document.getElementById(\"myForm\").reset();\n return false;\n }\n\n reader = new FileReader();\n reader.onload = function(event)\n { var img = new Image;\n img.onload = UpdatePreviewCanvas;\n img.src = event.target.result; }\n reader.readAsDataURL( file );\n}", "function addColaboratorImage() {\n $(\"#form_register\").on('change', \".image_colaborator_file\", function () {\n var id_content_image = $(this).data(\"content-preview\");\n readURL(this, id_content_image);\n\n });\n\n}", "function domestics_completeUpload(success, fileName) {\n if (success == $('#domestics_id').val()) {\n $('#imagePreview').attr(\"src\", \"\");\n $('#imagePreview').attr(\"src\", fileName);\n $('#fileInput').attr(\"value\", fileName);\n console.log(success);\n console.log(fileName);\n\n } else {\n alert('There was an error during file upload!');\n }\n return true;\n}", "function fileUploaded(status) {\r\n document.getElementById('issuePicFormlet').style.display = 'none';\r\n document.getElementById('output').innerHTML = status;\r\n }", "function displaySingleSelection(fileName) {\n var baseName = fileName.replace(/^.*[\\/\\\\]/, \"\");\n $(\".upload-filelist\").empty();\n $(\".upload-filelist\").append($(\"<li/>\").text(baseName));\n }", "function previewFile() {\n\n for (var j=1; j<=3; j++){\n document.querySelector(\"#uploaded_image\"+(j).toString()).src = \"\";\n $('#'+'uploaded_image'+(j.toString())).hide();\n }\n\n let files = document.querySelector('input[type=file]').files;\n\n // upload supports up to 3 images\n if (files.length>3){\n showMessage('error', \"You can upload up to 3 images!\", 2500);\n let clear_photos = document.querySelector(\"#clear_photos\");\n clear_photos.style.visibility = 'hidden';\n $('#clear_photos').hide();\n //read the files with FileReader\n } else if (files.length>0){\n //console.log(\"fileslength\", files.length);\n for (var i=0; i<files.length; i++) {\n let image = document.querySelector(\"#uploaded_image\" + (i + 1).toString());\n $('#'+'uploaded_image'+((i+1).toString())).show();\n let file = files[i];\n var reader = new FileReader();\n reader.addEventListener(\"load\", function (event) {\n image.src = event.target.result;\n image.style.visibility = 'visible';\n });\n if (file) {\n reader.readAsDataURL(file);\n }\n }\n // enable the clear photos button\n let clear_photos = document.querySelector(\"#clear_photos\");\n clear_photos.style.visibility = 'visible';\n $('#clear_photos').show();\n }\n\n}", "function insert() {\n let imgRadio = document.querySelectorAll('.imgRadio')\n if (imgRadio) {\n var checkedImage;\n imgRadio.forEach(image => {\n if (image.checked) { checkedImage = image }\n });\n let src = checkedImage.value\n let editor = document.querySelector('#output');\n\n if (inserImgCaller === 'editor' && editor) {\n let img = `<img src=${src} alt=${title.toString()} />`\n editor.focus();\n pasteHtmlAtCaret(img);\n }\n\n if (inserImgCaller === 'AddProduct') {\n let id = makeid(5)\n setImageToList(id, src)\n }\n\n if (inserImgCaller === 'AddJob') {\n let id = makeid(5)\n setImageToList(id, src)\n }\n\n if (inserImgCaller === 'AddArticleCover') {\n\n setImageToList(src)\n }\n checkedImage.checked = false;\n closeInsertImageModal();\n }\n }", "function addFiles(input) {\n\n\t\t\tvar files = input.files;\n\t\t\tvar totalFileNum = o.todoList.length + o.uploadSuccessNum + files.length; //本次上传文件总数\n\t\t\tfor ( var i = o.addedFileNumber; i < o.addedFileNumber+files.length; i++ ) {\n\n\t\t\t\tif ( totalFileNum > options.max_filenum ) {\n\t\t\t\t\toptions.errorHandler(KindEditor.tmpl(options.lang.uploadLimit, {uploadLimit: options.max_filenum}), \"error\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar builder = new StringBuilder();\n\t\t\t\tvar tempFile = files[i- o.addedFileNumber];\n\t\t\t\tbuilder.append('<li id=\"img-comtainer-'+dialogSCode+i+'\"><div class=\"imgWrap\">');\n\n\t\t\t\t//如果上传的不是图片,则通过判断文件后缀来显示不同的图标\n\t\t\t\tvar extension = getFileExt(tempFile.name);\n\t\t\t\tif ( extension == '' ) extension = \"default\";\n\t\t\t\textension = extension.toLowerCase();\n\t\t\t\tif ( \"jpg|jpeg|gif|png|bmp\".indexOf(extension) == -1 ) {\n\t\t\t\t\tbuilder.append('<span class=\"icon-placeholder icon-default icon-'+extension+'\"></span>');\n\t\t\t\t} else {\n\t\t\t\t\tbuilder.append('<img src=\"'+window.URL.createObjectURL(tempFile)+'\" border=\"0\" />');\n\t\t\t\t}\n\n\t\t\t\tbuilder.append('</div><div class=\"file-opt-box clearfix\"><span class=\"remove\" index=\"'+i+'\">'+options.lang.remove+'</span><span class=\"rotateRight\">'+options.lang.rotateRight+'</span>');\n\t\t\t\tbuilder.append('<span class=\"rotateLeft\">'+options.lang.rotateLeft+'</span></div><div class=\"success\"></div><div class=\"error\"></div>');\n\t\t\t\tbuilder.append('<div class=\"progress\"><span style=\"display: none; width: 0px;\"></span></div></li>');\n\n\t\t\t\tvar $image = $(builder.toString());\n\t\t\t\t//bind onelele event\n\t\t\t\t$image.find(\".remove\").on(\"click\", function() {\n\t\t\t\t\t$(this).parents(\"li\").remove(); //remove element\n\t\t\t\t\t//remove file from todoList\n\t\t\t\t\tvar index = $(this).attr(\"index\");\n\t\t\t\t\tfor ( var i = 0; i < o.todoList.length; i++ ) {\n\t\t\t\t\t\tif ( o.todoList[i].index == index ) {\n\t\t\t\t\t\t\to.totalFilesize -= o.todoList[i].file.size;\n\t\t\t\t\t\t\tupdateInfoText(o.uploadSuccessNum + o.todoList.length-1, o.totalFilesize);\n\t\t\t\t\t\t\to.todoList.splice(i, 1);\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\tif (G(\".filelist li\").length == 0) {\n\t\t\t\t\t\tG(\".image-list-box\").hide();\n\t\t\t\t\t\tG(\".wra_pla\").show();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t$image.on(\"mouseover\", function() {\n\t\t\t\t\t$(this).find(\".file-opt-box\").show();\n\t\t\t\t}).on(\"mouseout\", function() {\n\t\t\t\t\t$(this).find(\".file-opt-box\").hide();\n\t\t\t\t});\n\n\t\t\t\tG(\".wra_pla\").hide();\n\t\t\t\tG(\".image-list-box\").show();\n\t\t\t\tG(\".filelist\").append($image);\n\n\t\t\t\to.todoList.push({index:i, file:tempFile});\n\t\t\t\to.totalFilesize += tempFile.size;\n\n\t\t\t\t//console.log(tempFile);\n\t\t\t}\n\t\t\to.addedFileNumber += files.length;\n\t\t\tupdateInfoText(o.uploadSuccessNum + o.todoList.length, o.totalFilesize);\n\n\t\t\t//缩放并裁剪图片\n\t\t\t$(\".imgWrap img\").imageCrop(113,113);\n\n\t\t}", "function previewMultiple(event) {\n var url = URL.createObjectURL(event.target.files[0]);\n document.getElementById(event.target.id).parentElement.firstChild.src = url;\n }", "function selectFiles() {\n return File.openDialog(\"选择需要处理的png文件\", \"*.png\", true);\n}", "function upstaff() {\r\n\tvar info = document.getElementById('lbx_pro_staff');\r\n\tvar image = info.options[info.selectedIndex].text;\r\n\tdocument.getElementById('staff_newinner').innerHTML = \r\n\t'<center><label>New Image</label><br><img src=\"../images/staff/'+image+'\" alt=\"\" height=\"180px\" class=\"resizeme1\" width=\"140px\" onload=”$(this).aeImageResize({ height: 130, width: 150});/><br><label>'+image+'</label>';\r\n\tdocument.getElementById('staffpiccy').value = image;\r\n}", "function addImage(e){\n\t\t \n \t\tvar file = e.target.files[0],\n \t\timageType = /image.*/;\n\t\n \t\tif (!file.type.match(imageType)){\n\t\t \t\t$('#imgImagen').attr(\"src\",\"http://placehold.it/500x300&text=[ad]\");\n\t\t \t \tdocument.getElementById('fileImagen').value ='';\n\t\t \t\tif($('#imagenName').val() != 0){\n\t\t\t \t\t$('#imgImagen').attr(\"src\",URL_IMG + \"app/event/max/\" + $('#imagenName').val())\n\t\t \t\t} else {\n\t\t\t\t\t$('#lblPublicityImage').addClass('error');\n\t\t\t \t\t$('#alertImage').empty();\n\t\t\t \t\t$('#alertImage').append(\"Selecione una imagen\");\n\t\t\t \t\t$('#alertImage').show();\n\t\t \t\t}\n \t\t\treturn;\n\t \t\t}\n \t\t\t//carga la imagen\n \t\tvar reader = new FileReader();\n \t\treader.onload = fileOnload;\n \t\treader.readAsDataURL(file);\n \t}" ]
[ "0.65618056", "0.6453599", "0.6396575", "0.638491", "0.6306462", "0.62864834", "0.6283511", "0.62643534", "0.62244606", "0.62209976", "0.62126684", "0.61309355", "0.6106297", "0.60958284", "0.60577846", "0.60371876", "0.5998121", "0.59846145", "0.5984415", "0.59318274", "0.59274846", "0.5922172", "0.5915202", "0.5914642", "0.58637", "0.5860602", "0.5857679", "0.5856605", "0.5829775", "0.5823527", "0.58222604", "0.5817439", "0.5817333", "0.5785864", "0.5770309", "0.57660383", "0.57587194", "0.57461375", "0.57426107", "0.57393694", "0.5733686", "0.5716272", "0.56939304", "0.56922144", "0.56910104", "0.56770325", "0.565964", "0.56591445", "0.5655527", "0.56416386", "0.5624126", "0.5622713", "0.561422", "0.56070566", "0.55942565", "0.5583613", "0.5581451", "0.55778897", "0.5573217", "0.5557943", "0.5549262", "0.55423105", "0.5535546", "0.5528525", "0.5521235", "0.55179435", "0.55020535", "0.5496097", "0.5492139", "0.54910815", "0.5484133", "0.5481327", "0.54795754", "0.54781896", "0.5468939", "0.5466611", "0.54592854", "0.54590553", "0.54570025", "0.5446612", "0.5441908", "0.54404205", "0.5437285", "0.54350466", "0.54342055", "0.5428593", "0.542344", "0.5420057", "0.54136556", "0.5413226", "0.5409124", "0.54072547", "0.5405795", "0.54042125", "0.5402124", "0.5398221", "0.5396733", "0.5396666", "0.5395546", "0.539456" ]
0.6388024
3
Makes grid visible or invisible, depedinding of previous value If the "snap to" was active and grid made invisible the "snap to" will be disabled
function showGrid() { /**If grid was visible and snap to was check we need to take measures*/ if (gridVisible) { if (snapTo) { snapTo = false; document.getElementById("snapCheckbox").checked = false; } } gridVisible = !gridVisible; backgroundImage = null; // reset cached background image of canvas //trigger a repaint; draw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function snap() {\r\n\t\tvar snap = document.getElementById(\"snap\");\r\n\t\tif (snap.checked === true) {\r\n\t\t myDiagram.toolManager.draggingTool.isGridSnapEnabled = true;\r\n\t\t myDiagram.toolManager.resizingTool.isGridSnapEnabled = true;\r\n\t\t} else {\r\n\t\t myDiagram.toolManager.draggingTool.isGridSnapEnabled = false;\r\n\t\t myDiagram.toolManager.resizingTool.isGridSnapEnabled = false;\r\n\t\t}\r\n\t }", "function setGridInvisible() {\n grid.style.transition = \"none\";\n grid.style.visibility = \"hidden\";\n}", "function toggleVisible() {\n setVisible(false)\n\n }", "function toggleGrid()\n{\n\tconsole.log(\"Show Grid: \" + !showGrid);\n\tshowGrid = !showGrid;\n}", "function grid() {\r\n\t\tvar grid = document.getElementById(\"grid\"); \r\n\t\tif (grid.checked === true) {\r\n\t\t myDiagram.grid.visible = true;\r\n\t\t return;\r\n\t\t} else {\r\n\t\t myDiagram.grid.visible = false; \r\n\t\t}\r\n\t }", "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 updateGridOption() {\n myDiagram.startTransaction(\"grid\");\n var grid = document.getElementById(\"grid\");\n myDiagram.grid.visible = (grid.checked === true);\n myDiagram.commitTransaction(\"grid\");\n}", "function updateSnapOption() {\n // no transaction needed, because we are modifying tools for future use\n var snap = document.getElementById(\"snap\");\n if (snap.checked === true) {\n myDiagram.toolManager.draggingTool.isGridSnapEnabled = true;\n myDiagram.toolManager.resizingTool.isGridSnapEnabled = true;\n } else {\n myDiagram.toolManager.draggingTool.isGridSnapEnabled = false;\n myDiagram.toolManager.resizingTool.isGridSnapEnabled = false;\n }\n}", "function snapToGrid(activity, xValue, yValue) {\n\n}", "set visible(value) {\n this._planeHelper.visible = value;\n }", "checkVisible() {\r\n let squares = this.state.squares;\r\n let mapLevel = this.state.mapLevel;\r\n let p = this.state.playerIndex;\r\n let n = 20;\r\n let visible = [];\r\n const aura = [p, p-2, p-1, p+1, p+2, p+3, p-3,\r\n p-n, p-n-2, p-n-1, p-n+1, p-n+2,\r\n p+n, p+n-2, p+n-1, p+n+1, p+n+2,\r\n p-n*2, p-n*2-1, p-n*2+1,\r\n p+n*2, p+n*2-1, p+n*2+1,\r\n p-4, p+4];\r\n\r\n //only set visible what is on grid and eliminate overflow to other rows\r\n for (let i=0; i<aura.length; i++) {\r\n if (Math.abs(aura[i] % n - p % n) < 4 && aura[i] >= 0 && aura[i] < squares[mapLevel].length) {\r\n visible.push(aura[i]);\r\n }\r\n }\r\n let hidden = [];\r\n for (let i=0; i<squares[mapLevel].length; i++) {\r\n if (!visible.includes(i)) {\r\n hidden.push(i);\r\n }\r\n }\r\n this.setHidden(hidden);\r\n this.setVisible(visible);\r\n }", "toggleVisibility() {\n this.setVisible(!this.visible);\n }", "toggle() {\n const v = this.getSetting(\"visible\");\n this.visible = !v;\n this.setSetting(\"visible\", !v);\n\n //If first time, set autofog to opposite so it doesn't reapply it.\n let history = canvas.scene.getFlag(this.layername, \"history\");\n\n if (history === undefined) {\n this.setSetting(\"autoFog\", !v);\n return;\n }\n }", "function executeSnapGrid(state){\r\n\tif(state){\r\n\t\tcy.snapToGrid('snapOn');\r\n\t\tcy.snapToGrid('gridOn');\r\n\t}\r\n\telse{\r\n\t\tcy.snapToGrid('snapOff');\r\n\t\tcy.snapToGrid('gridOff');\r\n\t}\r\n}", "function visibilityMoney() {\n setVisible((prevState) => !prevState);\n }", "set visible(value) {\n if (value) {\n this.node.setAttribute(\"visible\", true);\n } else {\n this.node.removeAttribute(\"visible\");\n this.active = false;\n this.focusWhenActive = false;\n }\n }", "function toggleSnapping() {\n\t\tvar snapOK = document.getElementById(\"snap\").checked;\n\t\tif (snapOK) {\n\t\t\tsnapping.activate();\n\t\t} else {\n\t\t\tsnapping.deactivate();\n\t\t}\n}", "setLandingInfoDisplayed(value) {\n this.landingInfoDisplayed = value;\n this.box2.visible = value;\n _.each(_.filter(this.nodes, (node) => node.showCloseToPlanet), (node) => {\n node.shape.visible = value;\n });\n }", "static set visible(value) {}", "function toggleGrid() {\n if (!hideGrid) {\n hideGrid = true;\n $('#svgGrid').find('rect').attr('fill', 'white');\n } else {\n hideGrid = false;\n $('#svgGrid').find('rect').attr('fill', 'url(#grid)');\n }\n}", "setVisible(value) {\n this.visible = value;\n _.each(this.shapes, (shape) => {\n shape.visible = value;\n });\n }", "function setVisibles() {\n $scope.show_feeding_curves = false; //Wenn Daten vorhanden und nicht Objekt nicht leer, dann auf true\n $scope.show_error_text = false; //Wenn keine Daten vorhanden sind, dann auf true\n //$scope.selectedIndex = -1; //setzt die Klasse \"active\" auf die ausgewaehlte Tabellenzeile\n $scope.leftYLabel = '';\n }", "function toggleVisibility() {\n setVisibility(isVisible => !isVisible);\n }", "function toggleVisibility() {\n setVisibility(isVisible => !isVisible);\n }", "function toggle_to_low(){\n\tisSnapVisible = true;\n\tvideo_out.style.display = 'none';\n\tsnap_out.style.display = 'block';\n\tpause();\n\tsend_img_loop();\n}", "noGrid() {\n this._gridParams = false;\n }", "function toggleMovementDisplay() {\n\tisHidden.style.display = 'block';\n}", "function update() {\n //var snap = snap.prop(\"checked\"), liveSnap = $liveSnap.prop(\"checked\");\n Draggable.create('.box', {\n bounds: container,\n edgeResistance: 0.65,\n type: 'x,y',\n throwProps: true,\n liveSnap: liveSnap,\n snap: {\n x: function (endValue) {\n return snap || liveSnap ? Math.round(endValue / gridWidth) * gridWidth : endValue;\n },\n y: function (endValue) {\n return snap || liveSnap ? Math.round(endValue / gridHeight) * gridHeight : endValue;\n }\n }\n });\n }", "function snapOut(focus) {\n var keys = Object.keys(visibles);\n if (keys.length > 2 || keys.length < 1) throw \"PLOT: expected 1-2 layers\";\n\n if (Math.abs(10000 - visibles[Object.keys(visibles)[0]].scale.x) > 4) {\n this.zoom(focus, 5);\n return false;\n } else {\n for (var key in visibles) {\n visibles[key].scale.x = 10000;\n }\n return true;\n }\n }", "function update() {\n var snap = $snap.prop(\"checked\"),\n liveSnap = $liveSnap.prop(\"checked\");\n\tDraggable.create(\".box\", {\n\t\tbounds:$container,\n\t\tedgeResistance:0.65,\n\t\ttype:\"x,y\",\n\t\tthrowProps:true,\n\t\tliveSnap:liveSnap,\n\t\tsnap:{\n\t\t\tx: function(endValue) {\n\t\t\t\treturn (snap || liveSnap) ? Math.round(endValue / gridWidth) * gridWidth : endValue;\n\t\t\t},\n\t\t\ty: function(endValue) {\n\t\t\t\treturn (snap || liveSnap) ? Math.round(endValue / gridHeight) * gridHeight : endValue;\n\t\t\t}\n\t\t}\n\t});\n}", "function gridCBClicked(cb){\n var sz = parseFloat($('#grid-size').val());\n if (cb.checked){\n $('#cb-snap').prop('checked', true);\n drawGrid(sz);\n $('#cb-snap').prop(\"disabled\", false);\n }\n else {\n $('#cb-snap').prop('checked', false);\n removeGrid();\n $('#cb-snap').prop(\"disabled\", true);\n }\n}", "function animOnVisibility() {\n checkVisible(demos, dist);\n}", "function SetVisible(n,t){WDAnimSurImage.prototype.SetVisibilite(n,t?\"visible\":\"hidden\")}", "function movedown(){\n undraw();\n currentposition+=GRID_WIDTH;\n draw();\n freeze();\n console.log(down);\n }", "showHideTrace(station){\n\t\t\tstation[\"visible\"]=!station[\"visible\"];\n\t\t\tvar container = this.container;\n\t\t\tvar data = container.data;\n\t\t\tvar trace_index = station[\"trace_index\"];\n\t\t\tvar trace = data[trace_index];\n\t\t\ttrace.visible = station[\"visible\"];\n\t\t\tPlotly.redraw(container);\n\t\t}", "hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }", "function disableGrid() {\r\n // Get all cells\r\n let cells = $(\".cell\");\r\n\r\n // Remove their click and hover function\r\n cells.unbind(\"click\");\r\n cells.unbind(\"mouseenter mouseleave\");\r\n\r\n // Add a disabled state\r\n cells.addClass(\"cellDisabled\");\r\n $(\".arrow\").addClass(\"arrowDisabled\");\r\n}", "function showGrid() {\n setTimeout(() => {\n grid.classList.remove('hidden')\n intro.classList.add('hidden')\n liveDIV.classList.remove('hidden')\n highScoreDIVPM.classList.remove('hidden')\n scroreDiv.classList.remove('hidden')\n scoreSpan.classList.remove('hidden')\n liveLost.classList.add('hidden')\n pacmanHeader.classList.remove('hidden')\n }, 1500)\n}", "toggleVisibility() {\n this.setState(state => {\n if (state.visibility === true) {\n return { visibility: false };\n } else {\n return { visibility: true };\n }\n });\n }", "function snapIn(focus) {\n var keys = Object.keys(visibles);\n if (keys.length > 2 || keys.length < 1) throw \"PLOT: expected 1-2 layers\";\n\n if (Math.abs(10000 - visibles[Object.keys(visibles)[0]].scale.x) > 5) {\n this.zoom(focus, -5);\n return false;\n } else {\n for (var key in visibles) {\n visibles[key].scale.x = 10000;\n }\n return true;\n }\n }", "function setVisible(val) {\n\t\tif(val == undefined) {\n\t\t\tval = true;\n\t\t}\n\t\tthis.visible = val;\n\t}", "setVisible() {\n this.visible = true;\n this.getNumber();\n }", "function setBackToNoraml() {\n liveFloorview.style.transform = 'scale(.4)';\n liveFloorview.style.opacity = '0';\n workstation.style.transform = 'translateX(100%)'\n}", "function setRangeRingVisibility (showhide) {\n var show = null;\n\n if (showhide === 'hide') {\n $('#sitepos_checkbox').removeClass('settingsCheckboxChecked')\n show = false;\n } else if (showhide === 'show') {\n $('#sitepos_checkbox').addClass('settingsCheckboxChecked')\n show = true;\n } else {\n return\n }\n\n ol.control.LayerSwitcher.forEachRecursive(layerGroup, function(lyr) {\n if (lyr.get('name') === 'site_pos') {\n lyr.setVisible(show);\n }\n });\n}", "function toggle_to_high(){\n\tisSnapVisible = false;\n\tvideo_out.style.display = 'block';\n\tsnap_out.style.display = 'none';\n\tpause();\n\tend_send_loop();\n}", "reset() {\n this.parts.forEach((part) => part.setVisible(false));\n this.visibleIndex = -1;\n }", "function setClippingsVisibility()\r\n\t{\r\n\t\r\n\tfor (i=0; i < allClippings.length; i++)\r\n\t\t{\r\n\t\tvis = \"visible\";\r\n\t\t\r\n\t\t//find if this clipping is already selected\r\n\t\tfor (x=0; x <activeClippings.length; x++) if (allClippings[i].id == activeClippings[x].id) vis = \"hidden\";\r\n\t\t\tobj = \"clp\"+allClippings[i].id;\r\n\t\t\tclippingInstanceVisibility(obj,vis)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function snapGrid(element) {\r\n let x = 0;\r\n let y = 0\r\n interact(element)\r\n .draggable({\r\n modifiers: [\r\n interact.modifiers.snap({\r\n targets: [\r\n interact.createSnapGrid({\r\n x: 5,\r\n y: 5\r\n })\r\n ],\r\n range: Infinity,\r\n relativePoints: [{\r\n x: 0,\r\n y: 0\r\n }]\r\n }),\r\n interact.modifiers.restrict({\r\n restriction: element.parentNode,\r\n elementRect: {\r\n top: 0,\r\n left: 0,\r\n bottom: 1,\r\n right: 1\r\n },\r\n endOnly: true\r\n })\r\n ],\r\n inertia: true\r\n })\r\n .on('dragmove', function(event) {\r\n x += event.dx\r\n y += event.dy\r\n\r\n event.target.style.webkitTransform =\r\n event.target.style.transform =\r\n 'translate(' + x + 'px, ' + y + 'px)'\r\n })\r\n }", "show() {\n if (!this[$visible]) {\n this[$visible] = true;\n this[$updateVisibility]({ notify: true });\n }\n }", "handleVisibleChange(visible) {\n this.setState({ visible });\n }", "function toggleGridUnclickable() {\n grid.style.pointerEvents = \"none\";\n}", "toggleCell(x, y, grid) {\n const nextGrid = grid.slice();\n if (nextGrid[y][x] === undefined) {\n nextGrid[y][x] = \"live\";\n } else {\n nextGrid[y][x] = undefined;\n }\n return nextGrid;\n }", "_setInitialComponentDisplay() {\n const that = this;\n\n switch (that.scalePosition) {\n case 'near':\n that.$scaleNear.removeClass('jqx-hidden');\n that.$scaleFar.addClass('jqx-hidden');\n break;\n case 'far':\n that.$scaleNear.addClass('jqx-hidden');\n that.$scaleFar.removeClass('jqx-hidden');\n break;\n case 'both':\n that.$scaleFar.removeClass('jqx-hidden');\n that.$scaleNear.removeClass('jqx-hidden');\n break;\n case 'none':\n that.$scaleFar.addClass('jqx-hidden');\n that.$scaleNear.addClass('jqx-hidden');\n break;\n }\n that.$tooltip.addClass('jqx-hidden');\n\n if (that.ticksPosition === 'track') {\n that.$trackTicksContainer.removeClass('jqx-hidden');\n }\n }", "function toggle_visibility_grid(id) {\n var element = document.getElementById(id);\n\n if (element.style.display === \"grid\") {\n element.style.display = \"none\";\n } else {\n element.style.display = \"grid\";\n }\n}", "function setVisibility(){\n $jQ(':visible').each(function(){\n $jQ(this).attr(vars.visible, \"true\");\n });\n $jQ(':hidden').each(function(){\n $jQ(this).attr(vars.visible, \"false\");\n });\n}", "function visible(sw) {\n\treturn {\n\t\ttype: types.SIDE_VISIBLE,\n\t\tvalue: sw\n\t};\n}", "toggleVisibility() {\n this.setState(state => {\n if (state.visibility === true) {\n return { visibility: false };\n } else {\n return { visibility: true };\n }\n });\n }", "function toggle_stats_box(show) {\r\n // Does nothing if current display status already matches desired status\r\n if (stats_visible == show) {\r\n return\r\n }\r\n\r\n // Converts to int to get the desired grid layout from the array\r\n var i = show ? 1 : 0;\r\n\r\n // Changes the 'grid-template-rows' css property of the Preview div\r\n $('.preview').css('grid-template-rows', grid_layouts[i]);\r\n // Toggles the visibility of the stats-box\r\n $('.stats-box').css('visibility', visibility[i]);\r\n\r\n // Inverts the value of the bool\r\n stats_visible = !stats_visible;\r\n}", "set visible(v) {\n this._visible = v;\n this.setAttribute('visible', v);\n }", "toggleVisible() {\n if (this.visible) {\n this.visible = false;\n // this.element.setAttribute('style', 'display: none;');\n this.element.style.display = 'none';\n } else {\n this.visible = true;\n this.element.style.display = 'block';\n }\n }", "changeView() {\n if (!this.state.isRunning) {\n this.clearGrid();\n this.clearWalls();\n const desktop = !this.state.desktop;\n let grid;\n if (desktop) {\n grid = this.setUpTheGrid(20, 35) ;\n this.setState({desktop, grid});\n } else {\n //The initial start and finish nodes change to [0, 0] and [0, 5]\n //when switching to mobile view if \n //they exist outside the 10*20 grid(i.e. the mobile view grid).\n if (this.state.startRow > 10 || this.state.finishRow > 20 || this.state.startCol > 10 || this.state.finishCol > 20)\n {\n this.state.startCol = 0 ;\n this.state.startRow = 0 ;\n this.state.finishCol = 5 ;\n this.state.finishRow = 0 ;\n }\n grid = this.setUpTheGrid(10, 20) ;\n this.setState({desktop, grid});\n }\n }\n }", "toggler() {\n const visibility = this.state.visibility;\n const expanded = this.state.expanded;\n if (visibility === \"hidden\" && !expanded) {\n this.setState({\n visibility: \"visible\",\n expanded: true\n })\n } else {\n this.setState({\n visibility: \"hidden\",\n expanded: false\n })\n }\n\n }", "_setLayerVisibility() {\n let layerVisibility = this.get('layerVisibility');\n if (this.get('visibility')) {\n this._visibilityOfLayerByZoom();\n } else if (!Ember.isNone(layerVisibility)) {\n layerVisibility.set('visibility', false);\n this.set('layerVisibility', null);\n }\n }", "setVisible() {\n element.removeClass('hidden');\n }", "setVisible() {\n element.removeClass('hidden');\n }", "function changeGridStatus() {\n BLOCKED = !BLOCKED;\n $(\"#blockGrid\").text(BLOCKED ? \"Unblock\" : \"Block\");\n}", "function moveGrid(pref) {\r\n if ( pref.animate_top === false ) {\r\n $(\"#widget-holder,#grid-holder\").css({\r\n \"-webkit-transition\": \"left .2s ease-in-out\"\r\n });\r\n } else {\r\n $(\"#widget-holder,#grid-holder\").css({\r\n \"-webkit-transition\": \"left .2s ease-in-out, top .2s ease-in-out\"\r\n });\r\n }\r\n\r\n $(\"#widget-holder,#grid-holder\").css({\r\n \"top\" : GRID_MARGIN_TOP,\r\n \"left\": GRID_MARGIN_LEFT\r\n });\r\n\r\n updateGridOpacity();\r\n}", "function toggleVisibility() {\r\n\t\tif (designImage.style.display == '') {\r\n\t\t\tdesignImage.style.display = 'block';\r\n\t\t\tmeasurement.box.style.display = 'block';\r\n\t\t\tpositionDesignImage()\r\n\t\t\tEstate.Develop.CheckImage.Run( requestURL )\r\n\t\t} else {\r\n\t\t\tdesignImage.style.display = '';\r\n\t\t\tmeasurement.box.style.display = '';\r\n\t\t}\r\n\t}", "function gridP1Delay() {\n\t\t\t$(\".four\").removeClass(\"hide\");\n\t\t\t$(\".three\").addClass(\"hide\");\t\t\t\t \n\t\t\t$(\".board2\").addClass(\"hide\");\n\t\t\t$(\".board3\").addClass(\"hide\");\t\t\t\n\t\t\t$(\".board\").removeClass(\"hide\");\t\n\t\t}", "function changeVisibility() {\n magic.style.visibility = 'hidden';\n magic.style.display = 'block;';\n}", "function toggleGrid(item) {\n if (item.style.outline !== \"none\") {\n item.style.outline = \"none\";\n grid = false;\n }\n else if (item.classList.contains( \"not-filled\") && item.style.outline == \"none\") {\n item.style.outline = \"1px solid #e8e7e7\";\n grid = true;\n }\n else if (item.classList.contains( \"filled\") && item.style.outline == \"none\") {\n item.style.outline = \"1px solid \" + item.style.backgroundColor;\n grid = true;\n }\n}", "flag(){\n \n if(this.currentState == 'hidden') // allow flag option only if cell is hidden\n this.currentState = 'flagged';\n\n else if(this.currentState == 'flagged') // remove flag from cell\n this.currentState = 'hidden';\n \n }", "getHidden() {\n return !this.shot.visible;\n }", "function gridP2Delay() {\n\t\t\t$(\".three\").removeClass(\"hide\");\n\t\t\t$(\".four\").addClass(\"hide\");\t\t\t\t \n\t\t\t$(\".board2\").addClass(\"hide\");\n\t\t\t$(\".board3\").addClass(\"hide\");\t\t\t\n\t\t\t$(\".board\").removeClass(\"hide\");\n\t\t}", "function go_black() { \n var s2=gl.GetMidLay();\n var sh=s2.GetVisibility().toLowerCase();\n //alert(sh);\n if (sh=='show') {\n s2.SetVisibility('hide');\n gl.LinkBtn('screen',go_black,'SCRN ON');\n }\n else {\n s2.SetVisibility('show');\n gl.LinkBtn('screen',go_black,'SCRN OFF');\n }\n}", "setPortVisibility(step, visible = true) {\n this.headsContainer.interactive = visible && SharedElementHelpers.IsStep(step);\n this.headsContainer.visible = visible && SharedElementHelpers.IsStep(step);\n\n this.headIn.visible = visible && !SharedElementHelpers.IsSource(step);\n this.headIn.interactive = visible && !SharedElementHelpers.IsSource(step);\n }", "function gridViewChecker() {\n var item = $('.grid .grid-item');\n item.removeClass('ml-15');\n if ( $('.grid').hasClass('grid-view') ) {\n item.not('.hidden').each(function(index) {\n if ( index % 2 !== 0 ) {\n $(this).addClass('ml-15');\n }\n });\n }\n AOS.refresh();\n}", "function _sh_overview_hidden(){\n\tin_overview = false;\n\twrap_plane_clone.visible = false;\n\tif( paused_preserve ) pause();\n}", "toggleHidden (prop) {\n\t\t\tvar isVisible = true;\n\t\t\tif (!isNone(prop['isVisible'])) {\n\t\t\t\tisVisible = prop['isVisible'];\n\t\t\t}\n\t\t\tset(prop,'isVisible', isVisible?false:true);\n\t\t\t//comprobamos si queda alguna columna como visible, si no ocultamos acciones\n\t\t\tvar visible = false;\n\t\t\tvisible = this.properties.some(function(entry){\n\t\t\t\tif ( entry['isVisible'] ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tvisible?this.handleVisibility(false):this.handleVisibility(true);\n\t\t}", "function setScanVisibility(name, value) {\n var currentCAD = getCad();\n if (!currentCAD) {\n return;\n }\n console.log(\"Right before Set Property\");\n currentCAD.setProperty({\n name: name,\n path: \"visible\",\n value: value\n });\n console.log(\"Right after\");\n }", "function dbatt1(){\n\t\t\troot.batt_1.visible = false;\n\t\t\troot.line_cover_4.visible = true;\n\t\t\troot.line_cover_5.visible = true;\n\t\t\troot.dot_path4_rev.visible = true;\n\t\t\troot.dot_path5_rev.visible = true;\n\t\t}", "show() {\n this.isVisible = true\n this.clip._root.children.forEach(elt => elt.visible = true)\n this._updateVisibilityImg()\n }", "reveal() {\n this.visible = true;\n }", "attached() {\n this.visible = false;\n }", "show(direction, opts) {\n // start the grid item's movement (mousemove)\n this.startMovement();\n\n return new Promise(resolve => {\n const imageElems = this.gridItems.map(item => item.DOM.image);\n const glitchElems = this.gridItems.map(item => item.DOM.glitch);\n\n gsap\n .timeline({\n // this grid becomes the current one\n onStart: () => {\n this.DOM.el.classList.add('content__slide--current');\n this.isCurrent = true;\n },\n onComplete: resolve\n })\n .addLabel('start')\n // Set the items to be in the center of the viewport, scaled, rotated and not visible\n .set(imageElems, {\n // set x,y so the item is in the center of the viewport\n x: pos => {\n const rect = this.gridItems[pos].getRect();\n return winsize.width/2 - rect.left - rect.width/2;\n },\n y: pos => {\n const rect = this.gridItems[pos].getRect();\n return winsize.height/2 - rect.top - rect.height/2;\n },\n // randomly rotate the item\n rotation: () => getRandomNumber(-10,10),\n // scale it up\n scale: 2,\n // hide it\n opacity: 0\n })\n // now show each item one after the other\n .set(imageElems, {\n opacity: 1,\n stagger: 0.1\n }, 'start+=0.1')\n .addLabel('visible')\n // animate the body color\n .to(document.body, {\n duration: 0.5,\n ease: 'Power2.easeOut',\n backgroundColor: getComputedStyle(document.body).getPropertyValue('--color-bg'),\n //delay: 0.8\n }, 'visible+=0.1')\n // And once they are all stacked, animate each one to their default positions\n .to(imageElems, 0.9, {\n ease: 'Expo.easeOut',\n x: 0,\n y: 0,\n rotation: 0,\n scale: 1,\n stagger: 0.05\n }, 'visible+=0.1')\n // Adding a custom callback (after all the items are back in the grid)\n .add(() => opts?.halfWayCallback())\n // Set the grid texts to be translated up/down and hidden\n .set(this.DOM.texts, {\n y: direction === -1 ? '-50%' : '50%',\n opacity: 0,\n }, 'start')\n // Then animate them in\n .to(this.DOM.texts, 0.9, {\n ease: 'Expo.easeOut',\n y: 0,\n opacity: 1,\n stagger: direction * 0.15\n }, 'visible+=0.6');\n });\n }", "get disableSnap() {\n\t\treturn this.nativeElement ? this.nativeElement.disableSnap : undefined;\n\t}", "detached() {\n this.vGridObservables.disableObservablesAttributes();\n this.vGridObservables.disableObservablesCollection();\n this.vGridObservables.disableObservablesArray();\n }", "detached() {\n this.vGridObservables.disableObservablesAttributes();\n this.vGridObservables.disableObservablesCollection();\n this.vGridObservables.disableObservablesArray();\n }", "hide() {\n this.isVisible = false\n this.skeleton.visible = false\n this.clip._root.children.forEach(elt => elt.visible = false)\n this._updateVisibilityImg()\n }", "flattenVisible() {\n EventBus.$emit(\"try-flatten-visible-layers\");\n }", "function setGridToNonClickable(grid){\n grid.style.pointerEvents=\"none\";\n}", "function setGridToClickable(grid){\n grid.style.pointerEvents=\"visiblePainted\";\n}", "function enableFullMove() {\n raster.move = false;\n raster.zoom = false;\n me.options.fullMove = true;\n }", "_toggle() {\n if (this._isVisible) {\n this._hide();\n } else {\n this._show();\n }\n }", "toggle() {\n this.setState({\n visible: !this.state.visible,\n });\n }", "handleClick() {\n this.setState(prev => ({ visible: !prev.visible }))\n }", "function hiddenState(vis) {\n return vis === spin.PANEL_HIDDENLEFT ||\n vis === spin.PANEL_HIDDENRIGHT;\n }", "snapToGrid(draw) {\n\n var temp = null;\n\n // An array was given. Loop through every element\n if (draw.length) {\n temp = [draw[0] % this.options.snapToGrid, draw[1] % this.options.snapToGrid];\n draw[0] -= temp[0] < this.options.snapToGrid / 2 ? temp[0] : temp[0] - this.options.snapToGrid;\n draw[1] -= temp[1] < this.options.snapToGrid / 2 ? temp[1] : temp[1] - this.options.snapToGrid;\n return draw;\n }\n\n // Properties of element were given. Snap them all\n for (let i in draw) {\n temp = draw[i] % this.options.snapToGrid;\n draw[i] -= (temp < this.options.snapToGrid / 2 ? temp : temp - this.options.snapToGrid) + (temp < 0 ? this.options.snapToGrid : 0);\n }\n\n return draw;\n }", "_refreshVisibility() {\n this._sideBar.setHidden(this._sideBar.titles.length === 0);\n this._stackedPanel.setHidden(this._sideBar.currentTitle === null);\n }", "deactivateHouse() {\r\n this.lightOn = false;\r\n this.light.visible = false;\r\n }" ]
[ "0.7160396", "0.6910818", "0.6657223", "0.66179657", "0.66085166", "0.65047735", "0.63629955", "0.63577014", "0.6345158", "0.6317878", "0.63112783", "0.6302816", "0.62902975", "0.6274988", "0.6164239", "0.6106401", "0.60991347", "0.60934", "0.6076557", "0.60635424", "0.60488003", "0.6010976", "0.6002839", "0.6002839", "0.59509784", "0.5913045", "0.5901443", "0.58545256", "0.5852112", "0.5841842", "0.5832333", "0.5831668", "0.5819555", "0.58091486", "0.5807377", "0.5768741", "0.57442397", "0.57170105", "0.5707766", "0.5704028", "0.5701136", "0.569409", "0.5680874", "0.56726044", "0.56637686", "0.5659647", "0.5656619", "0.56511", "0.5650224", "0.56463456", "0.5646026", "0.56391877", "0.56261593", "0.56225634", "0.5615437", "0.5611658", "0.5602429", "0.5596925", "0.55804473", "0.5573437", "0.55713433", "0.55701286", "0.5559755", "0.5555037", "0.5555037", "0.5554382", "0.55542225", "0.5545569", "0.55441445", "0.55313987", "0.55299246", "0.5528566", "0.55218506", "0.5518344", "0.5518126", "0.5495073", "0.5493604", "0.54916805", "0.54913574", "0.54876", "0.5486854", "0.5484703", "0.54777116", "0.5475455", "0.54607135", "0.5457855", "0.54522437", "0.54522437", "0.5429569", "0.5422665", "0.54209757", "0.54177094", "0.5412752", "0.54055864", "0.5396467", "0.5395099", "0.5390764", "0.53837633", "0.5382233", "0.5379293" ]
0.7035048
1
Click is disabled because we need to handle mouse down and mouse up....etc etc etc
function onClick(ev) { var coords = getCanvasXY(ev); var x = coords[0]; var y = coords[1]; //here is the problem....how do we know we clicked on canvas /*var fig=STACK.figures[STACK.figureGetMouseOver(x,y,null)]; if(CNTRL_PRESSED && fig!=null){ TEMPORARY_GROUP.addPrimitive(); STACK.figureRemove(fig); STACK.figureAdd(TEMPORARY_GROUP); } else if(STACK.figureGetMouseOver(x,y,null)!=null){ TEMPORARY_GROUP.primitives=[]; TEMPORARY_GROUP.addPrimitive(fig); STACK.figureRemove(fig); }*/ //draw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_click(event) {\n if (this.disabled) {\n event.preventDefault();\n }\n else {\n this._handleInteraction(event);\n event.stopPropagation();\n }\n }", "function enableMouseClick() {\n // Add event listener for mouse click events to the canvas\n canvas.addEventListener(\"mousedown\", function (evt) {\n triggerMouseEvent(evt, canvas, connectedGame.mouseClickEvent);\n }, false);\n }", "function disableClick(){\r\n body.style.pointerEvents='none';\r\n setTimeout(function() {body.style.pointerEvents='auto';},1000);\r\n}", "function bloquear_click_derecho(){\n if(document.layers)document.captureEvents(Event.MOUSEDOWN);\n document.onmousedown=evento_click_derecho;\n}", "handleJDotterClick() {}", "clickOnButton() {\n if (!this._disabled) {\n this.cancelBlur();\n this.focusOnButton();\n\n if (this._triggers === 'click') {\n this.toggleMenuVisibility();\n }\n }\n }", "function disableClick() {\n body.style.pointerEvents = 'none';\n setTimeout(function() {body.style.pointerEvents = 'auto';}, 1000);\n}", "function mousedown() {\n \"use strict\";\n mouseclicked = !mouseclicked;\n}", "function _corexitOnMouseDown(event) {\r\n\t// Update the options. Need to do it here, because in mouse up it's too late\r\n\t//chrome.extension.sendRequest({command : \"getOptions\"}, getOptions);\r\n\t// Mark if the source click is inside a text box\r\n\tif (!event.target.nodeName)\r\n\t\tgClickInTextBox = false;\r\n\telse\r\n\t\tgClickInTextBox = (event.target.nodeName == \"INPUT\" || event.target.nodeName == \"TEXTAREA\");\r\n}", "function disableClick() {\n //makes body non clickable\n body.style.pointerEvents = 'none';\n //makes body clickable again\n setTimeout( function() {body.style.pointerEvents = 'auto';}, 1000);\n}", "function disableMouse(clic) {\r\n document.addEventListener(\"click\", e => {\r\n if (clic) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }, true);\r\n}", "handleClick() {}", "function handleMouseDown()\r\n{\r\n _mouse_down = true;\r\n}", "function _click(d){\n \n }", "function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }", "function disableClick() {\n //this makes our body unclickable\n body.style.pointerEvents = 'none';\n //this makes our body clickable again\n setTimeout(function () { body.style.pointerEvents = 'auto'; }, 1000);\n}", "handleClick( event ){ }", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "_evtClick(event) { }", "function mouse_down_handler(e) {\n e.preventDefault(); //Prevents the default action from happening (e.g. navigation)\n mouse.down = true; //Sets the mouse object's \"down\" value to true\n }", "function disableClickZoom () {\n status.disableClickZoom = true;\n }", "function mousePressed(e) {\n return false;\n}", "onMouseDown(e) {}", "function mouseDown(e) {\n mousePress(e.button, true);\n}", "function mouseDown(e)\n{\n\tmouseClickDown = true;\n\tmouseX = e.clientX;\n\tmouseY = e.clientY;\n}", "function mousedown(e){\n\t\t// console.log(e);\n\t\tmouseIsDown = true;\n\t}", "function disableClick() {\n body.style.pointerEvents = 'none'; //this makes our body unclickable\n setTimeout(function() { body.style.pointerEvents = 'auto'; }, 1000); //Makes the body clickable again after 1 second\n}", "clickEvent(e) {\r\n /** close search dropdown list on mouse click outside of search */\r\n const target = e.target ? e.composedPath()[0] : e.target;\r\n if (!target.classList.contains('dxp-dropdown-list-item') && !target.classList.contains('searchbox') && !target.classList.contains('dxp-icon')) {\r\n this.showSearchBoxList = false;\r\n this.showDownArrow = true;\r\n }\r\n }", "click(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n const [xd, yd] = this.status.mouseDownDiff;\n if (xd > 20 || yd > 20) {\n return true;\n }\n else {\n return this.handleClick(e);\n }\n }", "click(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n const [xd, yd] = this.status.mouseDownDiff;\n if (xd > 20 || yd > 20) {\n return true;\n }\n else {\n return this.handleClick(e);\n }\n }", "click(x, y, _isLeftButton) {}", "function onMouseClick(event) {\n freeze = !freeze;\n }", "function mousedownFunc(e){\r\n\t\tif(window.event){\r\n\t\t\twindow.event.cancelBubble = true;\r\n\t\t}\r\n\t\tif(e && e.stopPropagation){\r\n\t\t\te.stopPropagation();\r\n\t\t}\r\n\t}", "_mousedown(event) {\n if (this._isEditing()) {\n return;\n }\n if (!this.disabled) {\n this.focus();\n }\n event.preventDefault();\n }", "function disableClickToClose() {\n\n // Close the menu when a menu item is clicked.\n $(CSS_SELECTOR_MENU_ITEM).unbind(\"click\");\n }", "_onClick() {\n if (!this.disableClick) {\n this.showFileSelector();\n }\n }", "function click() {\n d3_eventCancel();\n w.on(\"click.drag\", null);\n }", "function cb_beforeClick(cb, pos) { }", "function pressRightClick() { return false; }", "function handleClick(event)\n{\n}", "capturesClicks() {\n return false;\n }", "_evtMousedown(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n if (Private.nonstandardClick(event)) {\n this.reset();\n return;\n }\n let target = event.target;\n while (target !== document.documentElement) {\n // If the user has made a selection, emit its value and reset the widget.\n if (target.classList.contains(ITEM_CLASS)) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n this._selected.emit(target.getAttribute('data-value'));\n this.reset();\n return;\n }\n // If the mouse event happened anywhere else in the widget, bail.\n if (target === this.node) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n return;\n }\n target = target.parentElement;\n }\n this.reset();\n }", "function mousedown(e){\n\t\t// Ignore non-primary buttons\n\t\tif (!isPrimaryButton(e)) { return; }\n\n\t\t// Ignore form and interactive elements\n\t\tif (isIgnoreTag(e)) { return; }\n\n\t\ton(document, mouseevents.move, mousemove, e);\n\t\ton(document, mouseevents.cancel, mouseend, e);\n\t}", "function onMouseClick()\r\n{\r\n\tfor (var i = 0; i < activeBtns.length; i++)\r\n\t{\r\n\t\tif (activeBtns[i].over == true)\r\n\t\t{\t\r\n\t\t\tactiveBtns[i].click();\r\n\t\t\tbreak;\r\n\t\t}\t\t\r\n\t}\r\n}", "function enableButtons() {\n\tbindClickEvents();\n}", "onSkipTap_() {\n if (this.buttonsDisabled) {\n return;\n }\n this.buttonsDisabled = true;\n this.browserProxy_.flowFinished();\n }", "function enableClickZoom () {\n status.disableClickZoom = false;\n }", "mouseDown(x, y, _isLeftButton) {}", "function mouseDown(e) {\n // update click state\n clickObj.mouseDown = true;\n clickObj.ele = e.currentTarget;\n clickObj.startX = e.clientX;\n clickObj.startY = e.clientY;\n \n switch ( e.target.id) {\n case String(c.sv.box).replace(/[#.]/g,''):\n case String(c.sv.marker).replace(/[#.]/g,''):\n clickObj.parentLeft = $(c.sv.box).offset().left;\n clickObj.parentTop = $(c.sv.box).offset().top;\n $(window).mousemove(mouseMove);\n break;\n case String(c.hue.box).replace(/[#.]/g,''):\n case String(c.hue.marker).replace(/[#.]/g,''):\n clickObj.parentLeft = $(c.hue.box).offset().left;\n clickObj.parentTop = $(c.hue.box).offset().top;\n $(window).mousemove(mouseMove);\n break;\n case String(c.name).replace(/[#.]/g,''):\n clickObj.parentLeft = e.offsetX;\n clickObj.parentTop = e.offsetY;\n $(window).mousemove(mouseMove);\n break;\n default:\n break;\n } \n \n e.preventDefault();\n e.stopPropagation();\n return true;\n }", "function mousePressed() {\n return false;\n}", "handleMouseDown(e) {\n this.toggleMenu();\n e.stopPropagation();\n }", "function mousePressed(){\n\treturn false;\n}", "function mousedownForCanvas(event)\n{\n global_mouseButtonDown = true;\n event.preventDefault(); //need? (maybe not on desktop)\n}", "function mousedown(e) {\n // Ignore non-primary buttons\n if (!isPrimaryButton(e)) { return; }\n\n // Ignore form and interactive elements\n if (isIgnoreTag(e)) { return; }\n\n on(document, mouseevents.move, mousemove, e);\n on(document, mouseevents.cancel, mouseend, e);\n }", "function mousedown(e) {\n // Ignore non-primary buttons\n if (!isPrimaryButton(e)) { return; }\n\n // Ignore form and interactive elements\n if (isIgnoreTag(e)) { return; }\n\n on(document, mouseevents.move, mousemove, e);\n on(document, mouseevents.cancel, mouseend, e);\n }", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "function o(a){a.click(p).mousedown(ka)}", "mouseClick(p) {\n }", "click() { }", "function mouseReleased() {\r\n if (clickState === 1) {\r\n clickState = 0;\r\n }\r\n}", "function mouseDown(x, y, button) {\r\n\tif (button == 0 || button == 2) {\t// If the user clicks the right or left mouse button...\r\n\t\tmouseClick = true;\r\n\t}\r\n\t//*** Your Code Here\r\n}", "handleClick(e) {\n if (e) {e.preventDefault()};\n }", "handleClick () {\n super.handleClick();\n if (this.casting) {\n return this.stopCasting();\n } else {\n return this.doLaunch();\n }\n }", "mouseDown(pt) {}", "mouseDown(pt) {}", "doubleClick(x, y, _isLeftButton) {}", "function ClickBlock() {\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'none';\n // }\n // setTimeout(()=>{\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'auto';\n // }\n // }, 210);\n }", "get disableClick() {\n return this._disableClick;\n }", "function setEventBehaviour(){\n\t\t\tbutton.style(\"pointer-events\",\"all\");\n\t\t}", "function down(evt){mouseDown(getMousePos(evt));}", "function down(evt){mouseDown(getMousePos(evt));}", "function clickPrevent() {\n\t$.trigger(\"clickPrevent\");\n}", "function Edit_Mandatory_MouseDown(event)\n{\n\t//not screenshot mode?\n\tif (!__SCREENSHOTS_ON)\n\t{\n\t\t//get the html\n\t\tvar theHTML = Get_HTMLObject(Browser_GetEventSourceElement(event));\n\t\t//set focus on it\n\t\ttheHTML.focus();\n\t}\n}", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }", "_handleClick(event) {\n this.interaction.next(event);\n event.stopPropagation();\n }", "static _HandleButtonDown(e) {\n if (!Mouse._button_down.includes(e.button))\n Mouse._button_down.push(e.button)\n }", "function mouseStatusDown(evt) {\n evt.preventDefault();\n mouseStatus = 'down';\n paintPixel(evt);\n}", "function _clickBehavior() {\n\t\t\tchildren.parent().find('.' + options.className + '-timeblock:not(.inactive) .' + options.className + '-dot').on('click', function(e) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tvar currYear = $(this).parent().parent().find('.' + options.className + '-timeblock.active').attr('data-year');\n\t\t\t\tvar nextYear = $(this).attr('data-year');\n\n\t\t\t\tif (currYear != nextYear) {\n\t\t\t\t\thook('onLeave', [currYear, nextYear]);\n\n\t\t\t\t\tchildren.removeClass('active');\n\t\t\t\t\t$(this).closest('.' + options.className + '-timeblock').addClass('active');\n\t\t\t\t}\n\n\t\t\t\t_updateTimelinePos('click');\n\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}", "enableMoveItemDownButtons(){\n const moveItemDownButtons = document.getElementsByClassName(\"moveItemDownButton\");\n moveItemDownButtons[moveItemDownButtons.length - 1].style.color = \"#353a44\";\n moveItemDownButtons[moveItemDownButtons.length - 1].style.pointerEvents = \"none\";\n for(let i = 0; i < moveItemDownButtons.length - 1; i++){\n moveItemDownButtons[i].onmousedown = () => {\n let itemId = moveItemDownButtons[i].parentNode.parentNode.id;\n itemId = itemId.substring(15);\n this.moveItemDownTransaction(itemId);\n this.performTransaction();\n }\n }\n }", "function q(a){a.click(u).mousedown(Ta)}", "handleClickSelf(event) {\n if (event.target.classList.contains('clicked')) {\n event.target.classList.remove('clicked');\n this.showBackSide(event.target);\n this.resetClicks();\n return true;\n }\n return false;\n }", "function disableClick(el) {\n el.classList.add('cant-click-this');\n}", "function onMouseDown(event) { }", "function mouseup(){\n mouse_down = false;\n}", "externalClick() {\n this._strikeClick();\n this._localPointer.x = this.getPointer().x;\n this._localPointer.y = this.getPointer().y;\n }", "function clickable(e) {\n if (1 != which(e)) return;\n if (e.metaKey || e.ctrlKey || e.shiftKey) return;\n if (e.defaultPrevented) return;\n return true;\n}", "function mouseDown(event) {\r\n this.hasMouseDown = true;\r\n }", "function resetSafeClick(disabled = true) {\r\n var [elSafe1, elSafe2, elSafe3] = document.querySelectorAll('.safeClick');\r\n elSafe1.disabled = disabled;\r\n elSafe1.innerText = SAFE_CLICK;\r\n elSafe2.disabled = disabled;\r\n elSafe2.innerText = SAFE_CLICK;\r\n elSafe3.disabled = disabled;\r\n elSafe3.innerText = SAFE_CLICK;\r\n}", "onMouseDown(e) {\n var self = this;\n\n if (self.isFocused) {\n if (self.settings.mode !== 'single') {\n self.setActiveItem();\n }\n\n self.open();\n return false;\n } else {\n // give control focus\n setTimeout(() => self.focus(), 0);\n }\n }", "function cClick(){\r\nif(OLloaded&&OLgateOK){OLhover=0;OLhideObject(over);o3_showingsticky=0;}\r\nreturn false;\r\n}", "function mouseReleased() {\r\n mouseIsDown = false;\r\n}", "function mouse_up_handler() {\n mouse.down = false; \n }", "function cust_MouseDown() {\n\n}", "function onMouseUp(event){if(preventMouseUp){event.preventDefault();}}", "function mouseClicked() {\n if (start.start === false) {\n start.mouseClicked();\n } else {\n handler.mouseClicked();\n }\n if (handler.active === handler.warning && trigger.warning === false) {\n trigger.mouseClicked();\n }\n if (\n handler.active === handler.nameplate &&\n doorbell.ok === false &&\n doorbell.name.length >= 1\n ) {\n doorbell.mouseClicked();\n }\n if (\n handler.active === handler.decisionC1 ||\n handler.active === handler.decisionH3 ||\n handler.active === handler.decisionF1 ||\n handler.active === handler.decisionF3\n ) {\n decision1.mouseClicked();\n decision2.mouseClicked();\n }\n // red flags buttons\n if (handler.active === handler.annegretC1) {\n control.mouseClicked();\n }\n if (handler.active === handler.frankE6) {\n lie.mouseClicked();\n }\n if (handler.active === handler.monologueE3) {\n arm.mouseClicked();\n }\n if (handler.active === handler.annegretF8) {\n victim.mouseClicked();\n }\n if (handler.active === handler.monologueG2) {\n noise.mouseClicked();\n }\n if (handler.active === handler.monologueH8) {\n phone.mouseClicked();\n }\n\n if (handler.active === handler.end) {\n end.mouseClicked();\n }\n}", "function enableMouse() {\n\tnoMouse = false;\n}", "function mouseUp(e) {\n clickObj.mouseDown = false;\n $(window).unbind('mousemove');\n }", "click_extra() {\r\n }", "onMouseDown(event) {\n\t\tcurrentEvent = event\n\t\tthis.isClicked = true\n\t\tthis.render()\n\t}", "function handlClickLinks(ev) {\r\n ev.preventDefault();\r\n \r\n}" ]
[ "0.7456236", "0.7253409", "0.71875346", "0.7174194", "0.7163691", "0.715022", "0.71209514", "0.7078039", "0.7036769", "0.70297337", "0.7007449", "0.6999466", "0.6961894", "0.69208467", "0.69149566", "0.68985206", "0.6877706", "0.6852906", "0.6852628", "0.68507403", "0.68499243", "0.68269", "0.6826015", "0.68075114", "0.68074197", "0.68070394", "0.6801042", "0.6797944", "0.6791928", "0.6791928", "0.6763225", "0.6761051", "0.6753823", "0.6739646", "0.6734078", "0.67155385", "0.6714561", "0.67102593", "0.67087024", "0.66974634", "0.66945827", "0.6686871", "0.66845876", "0.6681776", "0.66807723", "0.668007", "0.6679455", "0.6677169", "0.6676361", "0.6671753", "0.6668335", "0.6664487", "0.66533506", "0.66480327", "0.66480327", "0.6647628", "0.6636844", "0.66344196", "0.66326034", "0.66172975", "0.6615588", "0.66126424", "0.6608447", "0.6586296", "0.6586296", "0.6579916", "0.65730804", "0.65712917", "0.65560657", "0.6552794", "0.6552794", "0.65433615", "0.6536904", "0.65366095", "0.65354204", "0.65285444", "0.65242535", "0.6518557", "0.6513213", "0.6510418", "0.6503185", "0.64996606", "0.64991236", "0.6497562", "0.64973235", "0.6496751", "0.64881724", "0.6487523", "0.6479316", "0.6478622", "0.6474784", "0.6469994", "0.6469588", "0.6467599", "0.6466622", "0.64659494", "0.64620566", "0.64520866", "0.64458364", "0.6445276", "0.6440016" ]
0.0
-1
Draws all the stuff on the canvas
function draw() { var ctx = getContext(); // Log.group("A draw started"); //alert('Paint 1') reset(getCanvas()); //if grid visible paint it // if(gridVisible){ //paint grid addBackground(getCanvas()); // } //alert('Paint 2') STACK.paint(ctx); minimap.updateMinimap(); // Log.groupEnd(); //alert('Paint 3') refCabecera(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawCanvas() {\n\t\tdraw(context, drawer, colours, solver);\n\t\tsolver.callStateForItem(spanState);\n\t}", "Draw()\n\t{\n\t\t// Clear the canvas, optimize later if enough brain\n\t\tthis.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);\n\n\t\t// Draw everything\n\t\tfor(var i = 0; i < this.CanvasComponentCollection.orderedCollection.length; i++)\n\t\t{\n\t\t\tthis.CanvasComponentCollection.orderedCollection[i].Draw();\n\t\t}\n\t}", "function drawCanvas() {\n\t\tdrawing(context, drawer, colours, solver, selectedSpacesGrid);\n\t\tsolver.callStateForItem(spanState);\n\t}", "draw() { \r\n // Make sure the canvas has been prepared\r\n if (!this._setup) {\r\n this.prepare();\r\n }\r\n \r\n // Get the drawing context\r\n let ctx = this._canvas.getContext(\"2d\");\r\n \r\n // Clear the canvas by displaying only the background color\r\n ctx.fillStyle = this._background;\r\n ctx.fillRect(0, 0, this._width, this._height);\r\n \r\n // Loop through all of the shapes, asking them to draw theirselves\r\n // on the drawing context\r\n this._shapes.forEach(s => s.draw(ctx));\r\n }", "function drawAll() {\n\tdrawBackground();\n\tdrawMarkers();\n\tpanForTranslation();\n\tblob.show();\n\n\tfor (var i = 0; i < playerData.length; i++) {\n\t\tif (playerData[i].id !== socket.id) {\n\t\t\tcanvasContext.fillStyle = 'white';\n\t\t\tcanvasContext.beginPath();\n\t\t\tcanvasContext.arc(playerData[i].xPos, playerData[i].yPos, 10, 0,Math.PI*2, true);\n\t\t\tcanvasContext.fill();\n\t\t}\n\t}\n}", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "drawCanvas() {\n\n\t}", "_draw () {\r\n\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n\r\n\t\tthis.particles.forEach(particle => {\r\n\t\t\tparticle.draw(this.context);\r\n\t\t});\r\n\t}", "function drawCanvas() {\n clearCanvas();\n\n var i,\n shape;\n\n for (i = 0; i < shapes.length; i += 1) {\n shape = shapes[i];\n shape.draw(drawingContext);\n }\n }", "function drawCanvas() {\n\t\tdrawer.drawWallGrid(context, solver.gridWall, solver.xLength, solver.yLength, selectedSpacesGrid); \n\t\tdrawInsideSpaces(context, drawer, colourSet, solver, purificator, selectedSpacesGrid);\n\t\tdrawer.drawSudokuFrames(context, solver, mouseCoorsItem); \n\t\tsolver.callStateForItem(spanState);\n\t}", "function drawCanvas() {\n if( drawio.loadedIMG != ''){\n drawio.ctx.drawImage(drawio.loadedIMG, 0, 0);\n }\n for( var i = 0; i < drawio.shapes.length; i++) {\n drawio.shapes[i].render();\n }\n if(drawio.selectedElement) {\n drawio.selectedElement.render();\n }\n }", "function drawEverything() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n drawGrid();\n drawPlayer();\n drawTreasure();\n}", "draw() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // display problem\n this.drawProblem()\n // display input field\n if (this.input) {\n this.input._value = ''\n }\n \n this.drawInputField()\n\n // draw attacks\n this.attacks.draw(this.ctx, this.attackIndex)\n\n // draw player data\n this.player.drawPlayerData(this.ctx)\n // draw computer data\n this.computer.drawComputerData(this.ctx)\n \n }", "paintCanvas() {\n // Draw the tile map\n this.game.map.drawMap();\n\n // Draw dropped items\n this.game.map.drawItems();\n\n // Draw the NPCs\n this.game.map.drawNPCs();\n\n // Draw the player\n this.game.map.drawPlayer();\n\n // Draw the mouse selection\n this.game.map.drawMouse();\n }", "draw() {\n this.clearCanvas();\n\n this._ball.draw();\n this._paddle1.draw();\n this._paddle2.draw();\n\n this.drawScore();\n\n this.detectCollision();\n\n this.movePaddles();\n\n this._ball.move();\n }", "function draw() {\n ctx.fillStyle = \"#70c5ce\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n cloud.draw();\n pipes.draw();\n ball.draw();\n ground.draw();\n bird.draw();\n getReady.draw();\n gameOver.draw();\n score.draw();\n}", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "function drawAll() {\n //refreshes canvas everyone to give the animation effect\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (optionScreen) {\n clickOption();\n return;\n }\n \n //calling functions to draw objects\n drawNet();\n drawRectangle1();\n drawRectangle2();\n drawBall();\n drawScorePlayer();\n drawScoreComputer();\n computerMovement();\n drawWinner();\n moveObjects();\n \n \n //requests an animation from the browser API onto canvas = to user refresh rate\n window.requestAnimationFrame(drawAll);\n }", "function drawAll()\n{\t\n //\tDraw background\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n //\tDraw the universe\n univ.draw();\n}", "draw() {\n\t\t\tc.beginPath();\n\t\t\tc.fillStyle = this.color;\n\t\t\tc.fillRect(\n\t\t\t this.x - width / 2,\n\t\t\t this.y - height / 2,\n\t\t\t\twidth,\n\t\t\t\theight\n\t\t\t);\n\t\t\tc.closePath();\n\t\t }", "function draw(){\n context.clearRect(0, 0, canvas.width, canvas.height);\n boxes.forEach(function(box, i){\n context.fillStyle = box.color;\n context.fillRect(box.x, box.y, box.width, box.height);\n });\n}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function draw() {\n computeBoardSize(board);\n\n context.drawImage(\n this,\n current_x_offset,\n current_y_offset,\n board.width,\n board.height\n );\n\n positionPlayer();\n clearBlinkers();\n\n for (let i of allObjects) {\n if (isInView(i.x, i.y) && !i.completed) {\n const [x, y] = normalize_image_position(i.x, i.y);\n createBlinker(x, y, i.isGold);\n }\n }\n }", "function drawCanvas() {\t\t\n\t// Erase everything currently on the canvas\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\t\n\t// Loop through each layer in the list and draw it to the canvas\n\tlayer_list.forEach(function(layer, index) {\n\t\t\n\t\t// If the layer has a blend mode set, use that blend mode, otherwise use normal\n\t\tif (layer.blend) {\n\t\t\tcontext.globalCompositeOperation = layer.blend;\n\t\t} else {\n\t\t\tcontext.globalCompositeOperation = 'normal';\n\t\t}\n\t\t\n\t\t// Set the opacity of the layer\n\t\tcontext.globalAlpha = layer.opacity;\n\t\t\n\t\t// Draw the layer into the canvas context\n\t\tcontext.drawImage(layer.image, layer.position.x, layer.position.y);\n\t});\n\t\n\t// Loop this function! requestAnimationFrame is a special built in function that can draw to the canvas at 60 frames per second\n\t// NOTE: do not call drawCanvas() without using requestAnimationFrame here—things will crash!\n\trequestAnimationFrame(drawCanvas);\n}", "draw(){\n this._context.fillStyle = '#000';\n this._context.fillRect(0, 0, canvas.width, canvas.height);\n \n // draw ball and players\n this.drawRectangle(this.ball) \n this.players.forEach(player => this.drawRectangle(player));\n\n //draw score\n this.drawScore();\n }", "function drawAll() {\n\n // color in the background\n ctx.fillStyle = \"#000000\";\n ctx.fill(0, 0, canvasWidth, canvasHeight);\n\n // draw ship\n ship.draw();\n\n // draw rocks\n for (var i = 0; i < rocks.length; i++) {\n rocks[i].draw();\n }\n\n // draw bullets\n for (var i = 0; i < bullets.length; i++) {\n bullets[i].draw();\n }\n\n // draw stars\n for (var i = 0; i < stars.length; i++) {\n stars[i].draw();\n }\n\n // draw everything else\n}", "drawCanvas() {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.fillStyle = '#18121e';\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n this.moveDots();\n }", "function drawCanvas() {\r\n // Clear everything\r\n context1.clearRect(0, 0, canvas1.width, canvas1.height); // Clear canvas\r\n\r\n // Background grids\r\n drawGrid(context1,canvas1.width, canvas1.height); // Draw background grid\r\n\r\n // Curve through points and vertices\r\n drawCurve(context1, styleUniformParametrization, computeUniformInterpolation(numberOfPoints, points)); // Draw uniform parametrization\r\n drawCurve(context1, styleNonUniformParametrization, computeNonUniformInterpolation(numberOfPoints, points)); // Draw non-uniform parametrization\r\n\r\n drawVertices(context1, style, points); // Draw vertices as circles\r\n\r\n }", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "function draw()\n{\n\trequestAnimationFrame(draw);\n\tg_canvas.clearRect(0, 0, g_canvasWidth, g_canvasHeight);\n\tfor (let renderable of g_renderables)\n\t{\n\t\trenderable.render();\n\t}\n}", "function drawCanvas() {\n // clear canvas before next draw\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n // draw\n drawLayout()\n drawTargets()\n drawBalls()\n drawAliasBalls()\n if (mouseDrag && ballClicked && mouseLoc) {\n drawCatapultLine()\n }\n\n //test for selecting ball\n // ctx.strokeStyle = 'rgba(255, 0, 0, .5)'\n // ctx.strokeRect(ballRect.x, ballRect.y, ballRect.width, ballRect.height)\n\n // used to render canvas at 60FPS\n raf = requestAnimationFrame(drawCanvas)\n }", "draw() {\n\t\tinfo.context.beginPath();\n\t\tinfo.context.arc(this.position.x, this.position.y, 30, 0, 2 * Math.PI);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function renderCanvas()\n {\n if (drawing)\n {\n context.moveTo(lastPos.x, lastPos.y);\n context.lineTo(mousePos.x, mousePos.y);\n context.stroke();\n lastPos = mousePos;\n }\n }", "draw() {\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fill();\n }", "draw() {\n // Clear the Canvas\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n // Check Win\n this.checkWin();\n // Draw the dashes in the center\n this.drawDashes();\n // Draw the Ball\n this.drawBall();\n // Draw the Paddle 1\n this.drawPaddle1();\n // Draw the Paddle 2\n this.drawPaddle2();\n // Move the ball\n this.moveBall();\n // Check Ball Collision\n this.checkBallCollision();\n // Display the score\n this.displayScore();\n // Move the paddles\n this.movePaddle();\n // Check Paddle Collision\n this.checkPaddleCollision();\n }", "draw() {\n\t\tthis.newPosition()\n\t\tthis.hoverCalc()\n\n\n\t\t// this.drawWaves()\n\n\t\tthis.applyCircleStyle()\n\n\n\t\tthis.ly.circle( this.x, this.y, 2 * this.r * this.scale )\n\n\t\tthis.applyTextStyle()\n\t\tthis.ly.text( this.label, this.x, this.y )\n\n\n\n\t}", "_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}", "function draw(){\n tile.clearRect(0, 0, canvas.width, canvas.height);\n drawFoundAnswers();\n drawSelection();\n drawBoard();\n drawAnswers();\n drawWinner();\n}", "function drawCanvas() {\n\tif (imageId != null) {\n\t\tdrawJointJS(imageId);\n\t\timageId = null;\n\t}\n}", "draw(){\r\n ctx.beginPath();\r\n ctx.fillStyle = 'white';\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\r\n ctx.fill();\r\n }", "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "function renderCanvas() {\n\tframeCount++;\n\tif (frameCount < fCount) {\n\t\t// skips the drawing for this frame\n\t\trequestAnimationFrame(renderCanvas);\n\t\treturn;\n\t}\n\telse frameCount = 0;\n\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\t// context.fillStyle = \"#999999\";\n\t// context.fillRect(0,0,canvas.width,canvas.height);\n\n\t\n\n\tGhost.draw()\n\trequestAnimationFrame(renderCanvas);\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false);\n ctx.fillStyle = this.color;\n ctx.fill();\n }", "function draw(){\n\n requestAnimationFrame(draw);\n \n //Draw background\n ctx.fillStyle = 'teal';\n ctx.fillRect(0,0, canvas.width, canvas.height);\n\n //Draw map\n drawCheckpoints();\n\n //Draw objects\n objects.forEach(obj => {\n obj.draw();\n });\n\n drawText();\n}", "function draw(canvas)\n{\t\n\thelper.clear(canvas) // Clear canvas and set size\n \tvar ctx=canvas[0].getContext(\"2d\");\t\n\tctx.fillStyle=\"green\";\n\tctx.fillRect(0, 0, canvas.width(), canvas.height());\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.moveTo(this.position.x - width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x + width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x, this.position.y - width/2);\n\t\tinfo.context.closePath();\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function drawScreen() {\n\t\tcircleCount=0;\n\t\tcircles = [];\n\t\tcontext.fillStyle = bgColor;\n\t\tcontext.fillRect(0,0,canvas.width,canvas.height);\n\t}", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "function draw() {\n\t//clear the board\n\tctx.clearRect(0, 0, canvas[0].width, canvas[0].height);\n\n\t//draw the player\n\tplayer.draw(ctx);\n\n\t//draw the turrets\n\t$.each(turrets, function(i,turr) {\n\t\tturr.draw(ctx);\n\t});\n\n\t//draw the projectiles\n\t$.each(projectiles, function(i,proj) {\n\t\tproj.draw(ctx);\n\t});\n\n\t//draw the effects\n\t//make sure damaging effects are on top\n\tvar damagingEffects = [];\n\t$.each(effects, function(i,eff) {\n\t\tif (eff.getDoesDamage()) {\n\t\t\tdamagingEffects.push(eff);\n\t\t} else {\n\t\t\teff.draw(ctx);\n\t\t}\n\t});\n\n\t$.each(damagingEffects, function(i,eff) {\n\t\teff.draw(ctx);\n\t});\n}", "function paint() {\n detectEndGame();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawPaddle();\n drawBricks();\n movePaddle();\n drawBall(ctx, ballX, ballY, ballRadius);\n detectCollision();\n moveBall(ballDX, ballDY);\n drawScore();\n drawLives();\n requestAnimationFrame(paint);\n}", "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "doDraw() {\n draw_context.strokeStyle = \"#000\";\n draw_context.fillStyle = \"#eee\";\n draw_context.font = \"40px Times\";\n draw_context.lineWidth = 10;\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "function draw() {\n // Clear the drawing surface and fill it with a black background\n context.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n context.fillRect(0, 0, 400, 400);\n\n // Go through all of the particles and draw them.\n particles.forEach(function(particle) {\n particle.draw();\n });\n}", "draw(context) {\n context.fillStyle = '#414048';\n context.beginPath();\n for (let i = 0; i < this.length; ++i) {\n context.fillRect(this.units[i].x, this.units[i].y, this.size, this.size);\n }\n context.closePath();\n }", "paint () {\n // Clearing canvas first\n this.clear()\n this.root.__paint(this.canvasContext)\n }", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false); //creates a circle\n ctx.fillStyle = '#ffffff';\n ctx.fill();\n }", "draw() {\n this._drawLines(this.linesData);\n this._drawLines(this.linesAux);\n this._drawThickLines();\n this._drawSurfaces(this.surfaces);\n }", "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "function canvasDraw(){\n context.clearRect(0, 0, canvas.width, canvas.height);\n // define a function to be carried out on every object in the \"balls\" array\n // name of element in forEach function doesn't matter\n balls.forEach(function(ball_obj){\n ball_obj.draw();\n ball_obj.move();\n })\n }", "draw() {\n if (this._page !== currentPage) {\n return;\n }\n this.drawRectangles();\n if (!isReady) {\n return;\n }\n // Only used if using text lines.\n if (this._textLines.length > 0) {\n for (var i = 0; i < this._textLines.length; i++) {\n this._textLines[i].draw();\n }\n }\n // Only used if using input panels.\n if (this._inputPanels.length > 0) {\n for (var i = 0; i < this._inputPanels.length; i++) {\n this._inputPanels[i].draw();\n }\n }\n // Only used if using progress bars.\n if (this._progressBars.length > 0) {\n for (var i = 0; i < this._progressBars.length; i++) {\n this._progressBars[i].draw();\n }\n }\n }", "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n context2d.fillStyle = 'black';\n context2d.fillRect(0, 0, this.width, this.height);\n\n this.currentScene.draw();\n\n this.gameManager.drawHUD();\n }", "function draw(){\n empty(); // clear canvas\n context.fillStyle = boxColor; // change our paintbrush color\n context.fillRect(xOffset,yOffset,boxSize,boxSize); // draw box\n drawFood();\n}", "draw(){ \n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false)\n ctx.fillStyle = this.color\n ctx.fill();\n }", "function drawEverythingFromScratch() {\n\tcanvas.width = canvas.width;\n\tdrawThings();\n}", "function draw() {\n if (canvasValid == false) {\n clear(ctx);\n\n // Add stuff you want drawn in the background all the time here\n\n // draw all boxes\n var l = boxes.length;\n for (var i = 0; i < l; i++) {\n drawshape(ctx, boxes[i], boxes[i].fill);\n }\n\n // draw selection\n // right now this is just a stroke along the edge of the selected box\n if (mySel != null) {\n ctx.strokeStyle = mySelColor;\n ctx.lineWidth = mySelWidth;\n ctx.strokeRect(mySel.x,mySel.y,mySel.w,mySel.h);\n }\n\n // Add stuff you want drawn on top all the time here\n\n canvasValid = true;\n //if(mySel != null)\n // fall();\n timeStep();\n }\n}", "function drawScreen(){\r\n //clear canvas\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n // draw pretty much everything\r\n myball.draw();\r\n mypaddle.draw();\r\n drawBricks(bricksArray);\r\n drawText();\r\n\r\n}", "function drawAll() {\n drawRect(0, 0, canvas.width, canvas.height, \"#5394FC\");\n drawCircle(ballX, ballY, ballRadius, \"white\");\n drawRect(paddleX, paddleY, PADDLE_WIDTH, PADDLE_HEIGHT, \"white\");\n drawBricks();\n drawText(\"20px Sabo\", `Score : ${score}`, 10, 40);\n}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw() {\n // push the scene objects to the scene array\n this.prepareScene();\n\n // call each object's draw method\n this.drawSceneToCanvas();\n }", "draw() {\n\t\tnoStroke();\n\t\tfill(\"rgba(255, 255, 255, 0.1)\");\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function mainDraw() {\n\t\tif (canvasValid == false) {\n\t\tclear(ctx);\n\t\t\n\t\t// Add stuff you want drawn in the background all the time here\n\t\t\n\t\t// draw all boxes\n\t\tvar l = boxes2.length;\n\t\tfor (var i = 0; i < l; i++) {\n\t\t\tboxes2[i].draw(ctx); // we used to call drawshape, but now each box draws itself\n\t\t}\n\t\t\n\t\t// Add stuff you want drawn on top all the time here\n\t\tdocument.querySelector('#iou').innerHTML = computeIoU(boxes2[0], boxes2[1]);\n\t\t\n\t\tcanvasValid = true;\n\t\t}\n\t}", "function paintCanvas() {\r\n ctx.clearRect(0, 0, width, height);\r\n }", "doDraw() {\n console.log(\"big game over\");\n draw_context.fillStyle = \"#000F\";\n draw_context.fillRect(0,0, canvas_element.width,canvas_element.height);\n draw_context.lineWidth = 20;\n draw_context.lineJoin = \"round\";\n draw_context.textAlign = \"center\";\n draw_context.font = \"80px Lemon\";\n draw_context.strokeStyle = \"#fff\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.lineWidth = 10;\n draw_context.strokeStyle = \"#000\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n \n draw_context.fillStyle = this.grad1;\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "paint() {\r\n graphics.fillStyle = \"#ff1a1a\";\r\n graphics.beginPath();\r\n graphics.moveTo(this.x, this.y + this.h / 2);\r\n graphics.lineTo(this.x + this.w / 2, this.y - this.h / 2);\r\n graphics.lineTo(this.x - this.w / 2, this.y - this.h / 2);\r\n graphics.closePath();\r\n graphics.fill();\r\n }", "draw() {\n this.context.beginPath();\n this.context.arc(this.x, this.y, this.size, 0, 2 * Math.PI, false)\n this.context.fillStyle = this.color\n this.context.fill()\n this.context.stroke()\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "draw() {\n // drawing curbs first\n const shades = ['#9ca297', '#b1bab0'];\n for (let i = 0; i < 2; i++) {\n ctx.fillStyle = shades[i];\n // curbs just big rects mildly translated so some shading\n if (i) {\n ctx.translate(0, 3.3);\n }\n ctx.fillRect(0, this.y - (this.linH / 3) * 1.5, init.w, inProptn(1, 7) + (this.linH / 3) * (3 - i * 1.5));\n }\n ctx.translate(0, -3.3);\n\n // road itself\n ctx.fillStyle = 'black';\n ctx.fillRect(0, this.y, init.w, inProptn(1, 7));\n\n this.markings();\n }", "function drawCanvas(){\n\tclearCanvas();\n\t// loop over the objects of the paint\n\tif (dataLoaded){\n\t\tif (!isFullHistory){\n\t\t\tctx.save();\n\t\t\tctx.globalAlpha = globalAlpha;\n\t\t\tfor (index in objArr)\n\t\t\t{\n\t\t\t\tobjArr[index].draw();\n\t\t\t}\n\t\t\tctx.restore();\n\n\t\t\thistoryObj.draw();\n\t\t\tif (moveToFullHistoy != 0){\n\t\t\t \tmoveToFullHistoy--;\n\t\t\t \tvar currInterval = (HISTORY_ANIMATION_TIME-moveToFullHistoy)/HISTORY_ANIMATION_TIME;\n\t\t\t\tgraphW = BASE_GRAPH_W + ((MAX_GRAPH_W - BASE_GRAPH_W) * currInterval);\n\t\t\t\tgraphH = BASE_GRAPH_H + ((MAX_GRAPH_H - BASE_GRAPH_H) * currInterval);\n\t\t\t\thistoryObj.pos.x = MIN_GRAPH_X + ((BASE_GRAPH_X-MIN_GRAPH_X) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\thistoryObj.pos.y = MIN_GRAPH_Y + ((BASE_GRAPH_Y-MIN_GRAPH_Y) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\tglobalAlpha = 1-currInterval;\n\t\t\t\tif (moveToFullHistoy == 0){\n\t\t\t\t\tisFullHistory = true;\n\t\t\t\t\tmoveToFullHistoy =-1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\thistoryObj.draw();\n\t\t\tfor (index in objArr)\n\t\t\t{\n\t\t\t\tif (objArr[index].kind == WATT_KIND) \n\t\t\t\t\tobjArr[index].draw();\n\t\t\t}\n\t\t\tif (moveToFullHistoy != -1){\n\t\t\t\tmoveToFullHistoy++;\n\t\t\t \tvar currInterval = (HISTORY_ANIMATION_TIME-moveToFullHistoy)/HISTORY_ANIMATION_TIME;\n\t\t\t\tglobalAlpha = 1;\n\t\t\t\tgraphW = BASE_GRAPH_W + ((MAX_GRAPH_W - BASE_GRAPH_W) * currInterval);\n\t\t\t\tgraphH = BASE_GRAPH_H + ((MAX_GRAPH_H - BASE_GRAPH_H) * currInterval);\n\t\t\t\thistoryObj.pos.x = MIN_GRAPH_X + ((BASE_GRAPH_X-MIN_GRAPH_X) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\thistoryObj.pos.y = MIN_GRAPH_Y + ((BASE_GRAPH_Y-MIN_GRAPH_Y) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\tif (moveToFullHistoy == HISTORY_ANIMATION_TIME){\n\t\t\t\t\tisFullHistory = false;\n\t\t\t\t\tmoveToFullHistoy = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "draw(ctx) {\n\t\t\n\t\tctx.beginPath();\n\t\t\n\t\tctx.fillStyle = this.fillStyle;\n\t ctx.fillRect(this.x, this.y, this.w, this.h);\n\t\t\n\t\tif (this.lineWidth && this.strokeStyle) {\n\t\t\tctx.lineWidth = this.lineWidth;\n\t\t\tctx.strokeStyle = this.strokeStyle;\n\t\t ctx.strokeRect(this.x, this.y, this.w, this.h);\n\t\t\tctx.stroke();\n\t\t}\n\n\t\tctx.closePath();\n\t}", "function draw() {\n // clears the canvas before drawing\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"Points: \" + POINTS, 0, 0);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"\" + powername, 0, 745);\n\n //drawing sprites\n player.draw();\n for (let b of balls) {\n b.draw();\n }\n for (let p of powerups) {\n p.draw();\n }\n for (let w of walls) {\n w.draw();\n }\n for (let m of mobs1) {\n m.draw();\n }\n}", "function ticked() {\n //undraw all\n context.clearRect(0, 0, width, height);\n\n //save the entire canvas state\n context.save();\n context.translate(width / 2, height / 2);\n\n // draw links\n context.beginPath();\n links.forEach(drawLink);\n context.strokeStyle = COLOR_LINK;\n context.stroke();\n\n //draw file nodes\n context.beginPath();\n nodes.forEach(drawFileNode);\n context.fillStyle = COLOR_FILE;\n context.fill();\n context.strokeStyle = COLOR_LINK;\n context.class = \"arc\"\n context.stroke();\n\n // draw directory nodes\n context.beginPath();\n nodes.forEach(drawDirNode);\n context.fillStyle = COLOR_DIR;\n context.fill();\n context.strokeStyle = COLOR_LINK;\n context.class = \"arc\"\n context.stroke();\n\n context.restore();\n }", "function draw(){\n\n\n // canvas.save();\n // canvas.clearRect(0, 0, width, height);\n // canvas.translate(transform_x, transform_y);\n // canvas.scale(scale_value, scale_value);\n\n coresetData.forEach(function(d){\n canvas.beginPath();\n canvas.rect(parseFloat(d.x), -parseFloat(d.y), parseFloat(d.delta), parseFloat(d.delta));\n canvas.fillStyle = d.color;\n canvas.fill();\n //canvas.closePath();\n });\n }", "function draw() {\n // calculate the center coordinates of the canvas.\n var center = [(canvas.width / 2), (canvas.height / 2)];\n\n // draw the application name string.\n ctx.font = \"32pt Arial\";\n ctx.fillText(\"HTML5 BREAKOUT\", center[0], center[1] - 200);\n\n // draw the number of players selection instruction strings.\n ctx.font = \"24pt Arial\";\n ctx.fillText(\"Controls:\", center[0], center[1] - 100);\n ctx.fillText(\"[spacebar] launch a ball\", center[0], center[1] - 50);\n ctx.fillText(\"[left-arrow] move left\", center[0], center[1]);\n ctx.fillText(\"[right-arrow] move right\", center[0], center[1] + 50);\n ctx.fillText(\"Press [1] to start a 1 player game\", center[0], center[1] + 150);\n ctx.fillText(\"Press [2] to start a 2 player game\", center[0], center[1] + 200);\n }", "function draw() { \n\n\tctx.clearRect(0,0,canvas.width, canvas.height); \n\t\n}", "draw() {\n // Don't draw if shape has have moved off the canvas\n if (this.x > this.canvas.width || this.y > this.canvas.height ||\n this.x + this.width < 0 || this.y + this.height < 0) {\n return;\n }\n this.canvas.context.fillStyle = this.fill;\n this.canvas.context.fillRect(this.x, this.y, this.width, this.height);\n // Highlight after fill so it is on top\n if (this.selected) {\n this.highlightSelected();\n this.drawResizeHandles();\n }\n }", "canvasDraw() {\n let prev = this.p0;\n for (const point of this.points) {\n Point.drawLine(prev, point, false, this.isSelected, this.color);\n prev = point;\n }\n Point.drawLine(prev, this.p3);\n Point.drawLine(this.p0, this.p1, true);\n Point.drawLine(this.p2, this.p3, true);\n this.p0.draw();\n this.p1.draw();\n this.p2.draw();\n this.p3.draw();\n }", "draw() {\n // Limpa a tela antes de desenhar\n Game.Drawing.clearCanvas();\n Game.Drawing.drawImage(Game.ImageManager.image('background'), 190, 130);\n Game.gameObjectList.forEach(gameObject => gameObject.draw());\n\n }", "function draw() {\r\n canvas_resize();\r\n set_origin();\r\n set_speed();\r\n bars[it].display();\r\n if (looping && it < nb_op) it++;\r\n}", "doDraw() {\n draw_context.fillStyle = \"#00007777\";\n draw_context.fillRect(0,0, canvas_element.width,canvas_element.height);\n draw_context.lineWidth = 40;\n draw_context.lineJoin = \"round\";\n draw_context.textAlign = \"center\";\n draw_context.font = \"70px Lemon\";\n draw_context.strokeStyle = this.grad1;\n draw_context.strokeText(\"The Bane of\", canvas_element.width/2, 150);\n draw_context.font = \"160px Lemon\";\n draw_context.strokeText(\"Gurnok\", canvas_element.width/2, 260);\n \n draw_context.fillStyle = \"#FA5\";\n draw_context.font = \"70px Lemon\";\n draw_context.fillText(\"The Bane of\", canvas_element.width/2, 150);\n draw_context.fillStyle = this.grad2;\n draw_context.font = \"160px Lemon\";\n draw_context.fillText(\"Gurnok\", canvas_element.width/2, 260);\n }", "function renderCanvas() {\n if (drawing) {\n ctx.beginPath();\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.closePath();\n ctx.stroke();\n\n lastPos = mousePos;\n }\n}", "draw() {\n if (this.isFilled) {\n this.fill();\n } else {\n this.outline();\n }\n }", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }" ]
[ "0.79625636", "0.7953237", "0.7858081", "0.7777354", "0.7763634", "0.7740923", "0.77013445", "0.7684438", "0.76764005", "0.76613915", "0.76338327", "0.7620704", "0.7605712", "0.7533357", "0.75102735", "0.74997985", "0.74620855", "0.7457429", "0.7434739", "0.74090564", "0.74037385", "0.73981655", "0.73981655", "0.73981655", "0.73981655", "0.7395966", "0.73930466", "0.73702776", "0.7351767", "0.7336817", "0.7331149", "0.73245585", "0.7313344", "0.73116815", "0.7304919", "0.73012996", "0.72964776", "0.7289368", "0.7284143", "0.72767735", "0.727497", "0.7250304", "0.72474504", "0.72448516", "0.7244679", "0.72409195", "0.72294164", "0.7224353", "0.72226715", "0.7213921", "0.7178425", "0.71696806", "0.7169023", "0.71607924", "0.7158563", "0.7156985", "0.7156242", "0.71555907", "0.71505135", "0.71503454", "0.71471405", "0.7145355", "0.71443605", "0.7143541", "0.71350163", "0.713302", "0.713302", "0.713302", "0.71172416", "0.709636", "0.70909137", "0.7090118", "0.7085345", "0.7078632", "0.70710725", "0.7070531", "0.7064381", "0.70635605", "0.7062627", "0.7059466", "0.7058774", "0.7045169", "0.7041632", "0.70413464", "0.70390666", "0.7035239", "0.703128", "0.7014984", "0.7009179", "0.70022595", "0.6995479", "0.6993307", "0.699059", "0.69897425", "0.6988101", "0.6985745", "0.6983966", "0.69831586", "0.6970806", "0.6969836" ]
0.7299192
36
Returns a text containing all the URL in a diagram
function linkMap() { var csvBounds = ''; var first = true; for (f in STACK.figures) { var figure = STACK.figures[f]; if (figure.url != '') { var bounds = figure.getBounds(); if (first) { first = false; } else { csvBounds += "\n"; } csvBounds += bounds[0] + ',' + bounds[1] + ',' + bounds[2] + ',' + bounds[3] + ',' + figure.url; } } Log.info("editor.php->linkMap()->csv bounds: " + csvBounds); return csvBounds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "function _decorate_urls(text) {\n var pattern = XRegExp('[a-zA-z]+://[^\\\\s]*', 'g');\n return _decorate_process(text, pattern, function(m) {\n return '<span onclick=\"window.open(\\''+m+'\\', \\'_blank\\');\" class=\"content-link\">' + m + '</span>';\n });\n\n\n }", "function toString(){\n\t\treturn this.url;\n\t}", "function formatSourceHTML(text, url) {\n return `<b>Source: </b>${formatHyperlink(text, url)}`;\n}", "function linkInfo(d) { // Tooltip info for a link data object\n return \"Link:\\nfrom \" + d.from + \" to \" + d.to;\n}", "function drawLink() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "function visualize() {\r\n var a = d.getElementsByTagName('a');\r\n var a_text = '';\r\n for ( var i=0; i<a.length; i++ ) {\r\n match = '';\r\n if ( a[i].innerHTML.indexOf('<img') > -1 ) continue; // Skip Image Link\r\n if ( a[i].getAttribute('vid') ) continue; // Skip checked Link\r\n if ( a[i].getAttribute('class') == 'yt-button' ) continue; // Skip Button Link\r\n if ( a[i].href.match(/#$/) ) continue; // Skip functional Link\r\n if ( a[i].href.match(/watch\\?v=([a-zA-Z0-9_-]*)/) ) {\r\n match = RegExp.$1;\r\n a[i].setAttribute('vid',1);\r\n strong = d.createElement('strong');\r\n strong.setAttribute('class',match);\r\n a[i].parentNode.insertBefore(strong, a[i]);\r\n }\r\n }\r\n \r\n var s = d.getElementsByTagName('strong');\r\n \r\n var c = '';\r\n for ( var i=0; i<s.length; i++ ) {\r\n if ( !s[i].innerHTML && s[i].getAttribute('class') && c.indexOf(s[i].getAttribute('class')) < 0 ) {\r\n c += ' ' + s[i].getAttribute('class');\r\n checkURL( s[i].getAttribute('class') );\r\n }\r\n }\r\n }", "getUrl(name) { return \"\"; }", "function showUrl(url) {\n url = encodeURI(url);\n var txt = '<a href=\"' + url + '\" target=\"_blank\">' + url + '</a>';\n var element = document.getElementById(SOLR_CONFIG[\"urlElementId\"]);\n element.innerHTML = txt;\n}", "function showUrl(url) {\n url = encodeURI(url);\n var txt = '<a href=\"' + url + '\" target=\"_blank\">' + url + '</a>';\n var element = document.getElementById(SOLR_CONFIG[\"urlElementId\"]);\n element.innerHTML = txt;\n}", "function detectUrl(text) {\n let urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n return text.replace(urlRegex, (url) => {\n if (isImageURL(text)) return ( '<p><img src=\"' + url + '\" alt=\"img\" width=\"200\" height=\"auto\"/></p>' ); \n return ( '<a id=\"chat-msg-a\" href=\"' + url + '\" target=\"_blank\">' + url + \"</a>\" );\n });\n}", "function detectUrl(text) {\n let urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n return text.replace(urlRegex, (url) => {\n if (isImageURL(text)) return ( '<p><img src=\"' + url + '\" alt=\"img\" width=\"200\" height=\"auto\"/></p>' ); \n return ( '<a id=\"chat-msg-a\" href=\"' + url + '\" target=\"_blank\">' + url + \"</a>\" );\n });\n}", "function url() {\n var u = a + b + c + d\n return u\n }", "toString() {\n return this.url();\n }", "toString() {\n return this.url();\n }", "async getOutputHref(data) {\n this.bench.get(\"(count) getOutputHref\").incrementCount();\n let link = await this._getLink(data);\n return link.toHref();\n }", "getProjectUrlElement () {\n const url = this.props.url;\n if (!url) {\n return null;\n }\n\n if (!url.urlTarget) {\n return <p>{url.urlDisplay}</p>;\n }\n\n return <p><a href={url.urlTarget} target=\"_blank\">{url.urlDisplay}</a></p>;\n }", "function getURLForAnnotationControl(element) {\n return element.parents(\".result-div\").find(\".content .result-title a\").attr(\"href\");\n }", "function markupHyperLinks(str){\n\t\t\t\tvar reg = new RegExp(/[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?/gi);\n\t\t\t\tvar match = str.match(reg);\n\t\t\t\tvar res = \"\";\n\t\t\t\tif(match != null)\n\t\t\t\t\tmatch.forEach(\n\t\t\t\t\t\tfunction(e){\n\t\t\t\t\t\t\tvar tmp = str.split(e)[0];\n\t\t\t\t\t\t\tif(tmp != \"\")\n\t\t\t\t\t\t\t\tres += \"<pre>\" + tmp + \"</pre>\";\n\t\t\t\t\t\t\tvar m = e.match(new RegExp(/.*jpg|.*bmp|.*gif|.*png|.*jpeg/));\n\t\t\t\t\t\t\tif(m != null && m.indexOf(e) != -1)\n\t\t\t\t\t\t\t\tres += \"<img style='width:100px; height:auto' src='\" + e + \"'></img>\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tres += \"<a href='\" + e + \"'>\" + e + \"</a>\";\n\t\t\t\t\t\t\tvar i = str.indexOf(tmp + e) + (tmp + e).length;\n\t\t\t\t\t\t\tstr = str.substring(i,str.length);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\tif(str != \"\")\n\t\t\t\t\tres += \"<pre>\" + str + \"</pre>\"\n\t\t\t\tconsole.log(res);\n\t\t\t\treturn res;\n\t\t\t}", "function PdfTextWebLink(){var _this=_super.call(this)||this;// Fields\n/**\n * Internal variable to store `Url`.\n * @default ''\n * @private\n */_this.uniformResourceLocator='';/**\n * Internal variable to store `Uri Annotation` object.\n * @default null\n * @private\n */_this.uriAnnotation=null;/**\n * Checks whether the drawTextWebLink method with `PointF` overload is called or not.\n * If it set as true, then the start position of each lines excluding firest line is changed as (0, Y).\n * @private\n * @hidden\n */_this.recalculateBounds=false;_this.defaultBorder=new PdfArray();for(var i=0;i<3;i++){_this.defaultBorder.add(new PdfNumber(0));}return _this;}", "function addLinkText(par, url) {\r\n try {\r\n // add blue color to url text\r\n var color = [0, 0, 0.85];\r\n var urlText = addColorText(par, url, color);\r\n urlText.helpTip = loc_linkTextTip;\r\n\r\n // open url by click\r\n with(par) {\r\n urlText.onClick = function() {\r\n var os = ($.os.indexOf('Win') != -1) ? 'Win' : 'Mac';\r\n if (os == 'Win') {\r\n system('explorer ' + url);\r\n } else {\r\n system('open ' + url);\r\n }\r\n };\r\n }\r\n return urlText;\r\n } catch (e) {\r\n var urlText = addStaticText(par, url);\r\n return urlText;\r\n }\r\n}", "function tableFormat(str) {\n // Regular Expression for URIs in table specifically\n const tableexp = /(https|http|mailto|tel|dav|ftp|ftps)[:^/s]/i;\n var graph = gAppState.checkValue(\"docNameID\", \"docNameID2\");\n var strLabel = str; // variable for what is show on screen in the href\n\n if (str.includes(\"https://linkeddata.uriburner.com/describe/?url=\")) {// of str is in fct format\n strLabel = strLabel.replace(\"https://linkeddata.uriburner.com/describe/?url=\", \"\");\n strLabel = strLabel.replace(\"%23\", \"#\");\n }\n\n\n if (DOC.iSel(\"uriID\").checked == true) { //if user wants short URIs\n if (strLabel.includes(graph)) { //if str is in fct format it still includes the docname\n strLabel = strLabel.replace(graph, \"\"); //remove the docName from string\n }\n if (strLabel.includes(\"nodeID://\")) {\n strLabel = strLabel.replace(\"nodeID://\", \"_:\");\n } else if (strLabel.includes(\"#\")) {\n strLabel = strLabel.split('#')[1];\n } else if (strLabel.includes(\"/\")) {\n var strList = strLabel.split(\"/\");\n strLabel = strList.pop();\n }\n }\n\n if (tableexp.test(str)) { // if str is an absolute or relative uri\n str = '<a href=\"' + str + '\">' + strLabel + '</a>'\n return str\n }\n else {\n return strLabel\n }\n}", "function urlRenderer() {\n\treturn function(value) {\n\t\tif (value) {\n\t\t\tvar url = \"\";\n\t\t\tvar label = \"\";\n\t\t\tvar s = value.split(\"\\n\");\n\t\t\tif (s.length == 2) {\n\t\t\t\turl = Ext.util.Format.htmlEncode(s[1]);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(s[0]) || url;\n\t\t\t}\n\t\t\telse {\n\t\t\t\turl = Ext.util.Format.htmlEncode(value);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(value);\n\t\t\t}\n\t\t\treturn \"<a href=\\\"\" + url + \"\\\" target=\\\"_blank\\\">\" + label + \"</a>\";\n\t\t}\n\t\treturn \"\";\n\t};\n}", "function renderUrl(url) {\n var divurl = document.querySelector('#url');\n var urltext = (url.length < 45) ? url : url.substr(0, 42) + '...';\n var anchor = document.createElement('a');\n anchor.href = url;\n anchor.innerText = urltext;\n divurl.appendChild(anchor);\n}", "function getLink(url, term, label) {\n formattedTerm = term.split(' ').join('+');\n return \"<a target=\\\"_blank\\\" href=\\\"\" + url + formattedTerm + \"\\\" title=\\\"View results on \" + label + \"\\\"\\\">\" + term + \"</a>\";\n}", "function formatHyperlink(text, url) {\n return `<a href=\"${url}\">${text}</a>`;\n}", "function highlightURL(str) {\n if (!str) return;\n var tempArr = str.split(\" \");\n var retString = '';\n return tempArr.reduce(function(acc, value) {\n\t\tvar temp;\n if (isURL(value)) {\n temp =acc + ' \\<span class=\"isLink\"\\>' + value + '\\<\\/span\\> ';\n } else {\n temp= acc + ' ' + value + ' ';\n }\n\t\treturn temp;\n }, '');\n}", "function gatherLinks(p) {\n\tvar tokens = getBracketedItems(p.text());\n\tvar myJsonString = \"\";\n\n\t$.each(tokens, function(k, v) {\n\t\tif(v.content.length <= 2)\n\t\t\tmyJsonString += '\"' + v.content + '\", ';\n\t});\n\n\treturn myJsonString;\n}", "function createURL(urlText){\n const URL= \"https://api.funtranslations.com/translate/klingon.json\" + \"?\"+\"text=\" + urlText;//The text act as a Key and the value is urlText.\n return URL; \n}", "function getURL(c){\n\t\tvar oldURL = $('#target').attr('src');\n\t\tvar split = oldURL.split('/');\n\t\tvar sc = scaleCoords(c, oldURL); // scaled coordinates\n\t\tvar tc = translateCoords(sc, oldURL);\n \n /////////////////////////////////////////////////\n /* / */\n /*var coordStr = tc.x.toString() + \",\"+ tc.y.toString()+\",\"+tc.w.toString()+\",\"+tc.h.toString();\n\t\tsplit[split.length - 4] = coordStr;\n\t\tvar newURL = split.join(\"/\");\n\t\t$('#output').val(newURL);*/\n var widthL = $('#target').prop('naturalWidth');\n var heightL = $('#target').prop('naturalHeight');\n var px=Math.round(tc.x/parseInt(widthL)*1000)/10;\n var py=Math.round(tc.y/parseInt(heightL)*1000)/10;\n var pw=Math.round(tc.w/parseInt(widthL)*1000)/10;\n var ph=Math.round(tc.h/parseInt(heightL)*1000)/10;\n var coordStr = \"pct:\"+px + \",\"+ py +\",\"+pw+\",\"+ph;\n $('#output').val(coordStr);\n split[split.length - 4] = coordStr;\n\t\tvar newURL = split.join(\"/\");\n\t\tvar txt='<a href=\"'+newURL+'\">link</a>';\n\t\t$('#fragment').val(newURL);\n\t\t$('#linkfragment').html(txt);\n /* / */\n /////////////////////////////////////////////////\n\t}", "function buildDpSearhUrl ( text ) {\n return \"http://www.dianping.com/search/keyword/1/0_\"+text;\n}", "function makeDescUrl(title, startDom) {\n return \"https://\" + startDom + \".wikipedia.org/w/api.php?action=query&formatversion=2&prop=pageterms&titles=\" + encodeURIComponent(title) + \"&format=json\";\n}", "function url_encode_cb (){\r\n\t drawcontrol.show_tree_url();\r\n\t}", "get url() { return this.serializeUrl(this.currentUrlTree); }", "function formatUrl(word) {\n return encodeURI(JISHO + word);\n}", "function getTextContent(graphic){\n var attr = graphic.attributes;\n\n var content = '<table width=\"100%\" class=\"nomenclature-info\">';\n\n content += '<tr><th>Name:</th><td>' + attr['SLIDESHOWT'] + '</td></tr>';\n content += '<tr><th>X :</th><td>' + graphic.geometry.x + '</td></tr>';\n content += '<tr><th>Y :</th><td>' + graphic.geometry.y + '</td></tr>';\n\n\n // for (var i=0;i<keys.length; i++) {\n // if (keys[i].toLowerCase() == \"link\") {\n // if (/\\S/.test(attr.link)) {\n // content += '<tr><th></th><td><a href=\"' + attr.link + '\" target=\"_blank\">Additional Info</a></td></tr>';\n // }\n // } else {\n // content += '<tr><th>' + fieldTable[keys[i]] + ':</th><td>' + attr[keys[i]] + '</td></tr>';\n // }\n // }\n\n content += \"</table>\";\n content += '<p class=\"popupButtonContainerP\"><button type=\"button\" value=\"' + attr[\"SLIDESHOWI\"] + '\" class=\"btn btn-link popupShowSlideshowInSidebarBtn' + self.getPole(layer, config) + '\">More</button></p>';\n return content;\n }", "function createLinks(txt){\n let xp =/((?:https?|ftp):\\/\\/[\\-A-Z0-9+\\u0026\\u2019@#\\/%?=()~_|!:,.;]*[\\-A-Z0-9+\\u0026@#\\/%=~(_|])/gi\n \n if (_.isString(txt)){\n return txt.replace(xp, \"<br><a target='_blank' href='$1'>$1</a>\") \n }\n}", "function drawLink(editor) {\n var cm = editor.codemirror;\n var stat = editor.getCMTextState(cm);\n //var options = editor.options;\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "toString(){let url=this.url==null?\"\":this.url.url;return\"\".concat(this.total,\" | \").concat(this.progress,\" :: tested: \").concat(url)}", "function displayShortenedUrl(res) {\n link.textContext = res.data.shortUrl;\n link.setAttribute('href', res.data.shortUrl);\n shrBox.style.opacity = '1';\n urlBox.value = '';\n}", "get url() { return this.link.url; }", "toString(): string {\n const message = this.url != null ? this.url.url : \"\";\n return `${this.total} | ${this.progress} :: retrieving: ${message}`;\n }", "function getURL(){\n\tvar html = document.getElementById(\"report\")\n\tvar share = document.getElementById(\"share\")\n\tvar url = window.location.href\n\thtml.innerHTML += \"<a href=\\\"mailto:[email protected]?subject=Reported%20Image&body=\"+ encodeURIComponent(url) +\"\\\">Report offensive image here</a>\"\n\tshare.innerHTML += \"<a href=\\\"mailto:?subject=Check%20out%20this%20image%20on%20PhotoSect!&body=\"+ encodeURIComponent(url) +\"\\\">Share with friends!</a>\"\n}", "function generateUrlGlyphs(glyphs) {\n var url = [];\n\n for (var g in glyphs) {\n if (glyphs[g]) {\n url.push(glyphs[g].uid);\n }\n }\n\n return url.join(':');\n }", "function newDiagramLink(text, href) {\n const element = document.createElement('a');\n element.className = 'diagram';\n element.textContent = text;\n element.href = href;\n return element;\n}", "function createLink(url,text){\r\n\treturn \"<a href=\\\"\"+url+\"\\\"\"+Target+\">\"+text+\"</a>\";\r\n}", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "function getArticleOriginalSourceOptionalURL(articleData) {\n if (articleData.original_source_url != null && articleData.original_source_url != \"\") {\n return \"<a id='articleOriginalSourceURL' href='\"+articleData.original_source_url+\"'><i class='fa fa-external-link'> \" + LABEL_SHOW_ARTICLE_SOURCE + \" </i></a>\";\n }\n return \"\";\n}", "function mirrorbrain_getTupel( href ) {\n\tvar retVal = \"\";\n\tvar file;\n\tfile = mirrorbrain_getTagFileName( href );\n if ( file != null ) {\n\t\tvar product, os, lang, version;\n\t\tproduct = mirrorbrain_getTagProduct( file );\n\t\tversion = mirrorbrain_getTagVersion( file );\n\t\tos = mirrorbrain_getTagOS( file );\n\t\tlang = mirrorbrain_getTagLang( file );\n\t\tretVal = product + \" \" + version + \"-\" + os + \"-\" + lang + \"-\" + version;\n }\n return retVal;\n}", "_toLinkUrl() {\r\n return this._stringifyPathMatrixAuxPrefixed() +\r\n (isPresent(this.child) ? this.child._toLinkUrl() : '');\r\n }", "function uutrimurl(source) { // @param String: ' url(\"http://...\") '\r\n // @return String: \"http://...\"\r\n return (!source.indexOf(\"url(\") && source.indexOf(\")\") === source.length - 1) ?\r\n source.slice(4, -1).replace(uutrim._QUOTE, \"\") : source;\r\n}", "function branchHyperlink(ix){\n var br = tx.rowinfo[ix].br\n var dest = tx.baseUrl + \"/timeline?r=\" + encodeURIComponent(br)\n dest += tx.fileDiff ? \"&m&cf=\" : \"&m&c=\"\n dest += encodeURIComponent(tx.rowinfo[ix].h)\n return dest\n }", "escapeLinks(description) {\n\n\t\t// <a href=\";\n\t\tvar aStartPos = description.search(\"<a\"); // Next\n\t\tvar descriptionArr = [];\n\t\tvar key = 0;\n\n\t\t// Contains links\n\t\tif (aStartPos !== -1) {\n\n\t\t\twhile (aStartPos !== -1) {\n\n\t\t\t\t// Add text segment if any\n\t\t\t\tvar textSeg = description.substring(0, aStartPos);\n\t\t\t\tif(aStartPos !== 0) descriptionArr.push(textSeg);\n\n\t\t\t\t// Establishing Positions\n\t\t\t\tvar targetPos = description.search(\"target\");\n\t\t\t\tvar aEndPos = description.search(\"</a>\");\n\n\t\t\t\t// Adding the a tag\n\t\t\t\t// e.g. <a href=\"https://www.straitstimes.com/singapore/health/ip-insurers-losses-raise-possibility-of-premium-hikes\" target=\"_blank\">IP insurers' losses raise </a>\n\t\t\t\tvar link, text;\n\n\t\t\t\tif (targetPos !== -1 && targetPos < aEndPos) { // Contains target\n\n\t\t\t\t\tlink = description.substring(aStartPos + 9, targetPos - 2);\n\t\t\t\t\ttext = description.substring(targetPos + 16, aEndPos);\n\n\t\t\t\t} else { // Doesn;t contain target\n\n\t\t\t\t\tvar aStartBracketPos = description.search(\">\");\n\n\t\t\t\t\tlink = description.substring(aStartPos + 9, aStartBracketPos - 1);\n\t\t\t\t\ttext = description.substring(aStartBracketPos + 1, aEndPos);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdescriptionArr.push(<a href={link} target=\"_blank\" key={key} rel=\"noopener noreferrer\">{text}</a>);\n\n\t\t\t\t// Trim a tag\n\t\t\t\tdescription = description.substring(aEndPos + 4);\n\n\t\t\t\t// Update counters\n\t\t\t\taStartPos = description.search(\"<a\");\n\t\t\t\tkey++;\n\t\t\t}\n\n\t\t\t// Add text segment if any\n\t\t\tif(description !== \"\") descriptionArr.push(description);\n\t\t\treturn descriptionArr;\n\n\t\t// No links\n\t\t} else {\n\n\t\t\tdescriptionArr.push(description);\n\t\t\treturn descriptionArr;\n\t\t}\n\n\t}", "function getUrl(tweet) {\n console.log(\"---> getUrl <---\");\n // console.log(tweet.entities.urls);\n if (!tweet.entities) {\n return;\n }\n if (!tweet.entities.urls[0]) {\n return;\n }\n const link = tweet.entities.urls[0].url;\n return link;\n}", "getAspectText(asp) {\n let info = {}\n let ref = this.getReferenceById(asp.id)\n\n info.name = ref.name;\n info.nodesText = []\n \n for (let x in asp.nodes) {\n let nodeSubIndex = asp.nodes[x]\n let node = {parent: null, subNode: null, subNodeIndex: null,}\n \n node.parent = ref.nodesText[x].parent\n\n node.subNode = ref.nodesText[x].subNodes[nodeSubIndex]\n node.subNodeIndex = nodeSubIndex\n\n info.nodesText.push(node)\n }\n\n return info;\n }", "function viewList(info, tab) {\n var aler = \"\";\n for(var i=0; i<urls.length; i++)\n aler = aler + \"\\n\" + urls[i];\n\n alert(aler);\n}", "function TextToMarkdown(gDocText){\n var gDocTextMarkdown = '';\n \n var textString = gDocText.getText();\n \n var currentURLLink = undefined;\n var currentLinkText = undefined;\n \n for(var i=0 ; i<textString.length ; i++){\n var characterLink = gDocText.getLinkUrl(i);\n \n var currentCharacter = textString[i];\n \n if(!characterLink){ // no link\n if(currentURLLink){ // end of previous link\n var linkMarkdown = '['+currentLinkText+']('+currentURLLink+')'\n gDocTextMarkdown += linkMarkdown;\n \n currentLinkText = undefined\n currentURLLink = undefined\n }\n \n gDocTextMarkdown += currentCharacter;\n }\n else{ // link\n if(!currentURLLink){ // there was no link being tracked\n currentLinkText = currentCharacter\n currentURLLink = characterLink\n }\n else{ // previous link being tracked\n if(characterLink === currentURLLink){ // same link\n currentLinkText += currentCharacter\n }\n else{ // different link\n // créer le lien en markdown\n var linkMarkdown = '['+currentLinkText+']('+currentURLLink+')'\n gDocTextMarkdown += linkMarkdown;\n \n // tracker le nouveau lien\n currentLinkText = currentCharacter\n currentURLLink = characterLink\n }\n } \n }\n }\n \n if(currentLinkText && currentURLLink){\n var linkMarkdown = '['+currentLinkText+']('+currentURLLink+')'\n gDocTextMarkdown += linkMarkdown;\n }\n\n return gDocTextMarkdown;\n}", "function searchResultDisplayHtmlString(venue){\n\n \n let venue_name = venue.name?venue.name:\"\"\n let address = venue.location.formattedAddress?venue.location.formattedAddress:\"\"\n let descriptions = venue.categories?venue.categories:\"\"\n let location_description=[]\n for(let description of descriptions){\n\n location_description.push(description.name)\n\n }\n\n return `\n <style>\n .search-result p{\n\n font-family: var(--font-family-main);\n margin:10px;\n \n \n }\n \n .search-result p a{\n \n text-decoration:none;\n color:black;\n \n }\n\n .location-name-link{\n\n font-size:17px;\n\n }\n\n .address-link{\n\n font-size:15px;\n\n }\n\n .description-link{\n\n font-size:12px;\n\n }\n\n \n .line{\n \n background-image:linear-gradient(90deg,transparent, var(--primary-color),transparent);\n width:auto;\n height:2px;\n \n }\n \n </style>\n <div class=\"search-result\" onClick=\"stopCallingApi()\">\n <p>\n <a class=\"location-name-link\" href=\"#\">${venue_name}</a> \n </p>\n <p>\n <a class=\"address-link\" href=\"#\">${address.join(\" \")}</a> \n </p>\n <p>\n <a class=\"description-link\" href=\"#\">${location_description.join(\" \")}</a> \n </p>\n\n <div class=\"line\"></div>\n </div>`\n}", "domain() {\n const domain = this.props.notice.DOMN;\n if (!domain || !Array.isArray(domain) || !domain.length) {\n return null;\n }\n const links = domain\n .map(d => (\n <a href={`/search/list?domn=[\"${d}\"]`} key={d}>\n {d}\n </a>\n ))\n .reduce((p, c) => [p, \", \", c]);\n return <React.Fragment>{links}</React.Fragment>;\n }", "function mostrarLinks(inicio, fin){\n\tvar s = '';\n\tfor(var i=inicio; i<=fin && link[i]!==undefined; i++){\n\t\tif(i==posActual) s+= '\\n<<--actual-->>\\n';//'<actual>\\n\\t';\n\t\ts += i + ':\\t' +\n\t\t\t(link[i] && typeof(link[i])=='object' ? link[i][0]+' ; '+link[i][1] : link[i]) +\n\t\t\t'\\n\\t' + imagen[i] + '\\n';\n\t\tif(i==posActual) s+= '<<--actual-->>\\n\\n';//'</actual>\\n';\n\t}\n\treturn s;\n}", "function fetch_links(str){\n var links=[]\n var tmp=str.match(/\\[\\[(.{2,80}?)\\]\\](\\w{0,10})/g)//regular links\n if(tmp){\n tmp.forEach(function(s){\n var link, txt;\n if(s.match(/\\|/)){ //replacement link [[link|text]]\n s=s.replace(/\\[\\[(.{2,80}?)\\]\\](\\w{0,10})/g,\"$1$2\") //remove ['s and keep suffix\n link=s.replace(/(.{2,60})\\|.{0,200}/,\"$1\")//replaced links\n txt=s.replace(/.{2,60}?\\|/,'')\n //handle funky case of [[toronto|]]\n if(!txt && link.match(/\\|$/)){\n link=link.replace(/\\|$/,'')\n txt=link\n }\n }else{ // standard link [[link]]\n link=s.replace(/\\[\\[(.{2,60}?)\\]\\](\\w{0,10})/g,\"$1\") //remove ['s\n }\n //kill off non-wikipedia namespaces\n if(link.match(/^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media|special|wp|wikipedia|help|user|mediawiki|portal|talk|template|book|draft|module|topic|wiktionary|wikisource):/i)){\n return\n }\n //kill off just anchor links [[#history]]\n if(link.match(/^#/i)){\n return\n }\n //remove anchors from end [[toronto#history]]\n link=link.replace(/#[^ ]{1,100}/,'')\n link=helpers.capitalise(link)\n var obj={\n page:link,\n src: txt\n }\n links.push(obj)\n })\n }\n links=links.filter(helpers.onlyUnique)\n if(links.length==0){\n return undefined\n }\n return links\n }", "function drawLink(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n _replaceSelection(cm, stat.link, '[', '](http://)');\n}", "function wikipedia_fetch_url() {\n\tvar article_name = $('#article_name').val();\n\tvar language = $('#language').val();\n var base_url = \"https://\" + language + \".wikipedia.org/w/api.php\";\n var data_format = \"&format=json\";\n var request_url = \"?action=parse&prop=text&page=\" + article_name;\n var url = base_url + request_url + data_format;\n return url;\n}", "function er_extractPdfUrlOf(servery, diningHTML) {\n\tconst regex = new RegExp(\"<p>(\\\\r\\\\n\\\\s)*<a href=\\\"([^\\\"]+)\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\">\"+buildingName+\"<\\\\/a>\");\n\tconst matchesArray = diningHTML.match(regex);\n\tconst matches = matchesArray !== null ? matchesArray.length : 0;\n\n\t// 0 = entire match, 1 = first parenthesis, 2 = URL parenthesis\n\tif (matchesArray !== null && matches === 3)\n\t\treturn matchesArray[2];\n\t\n\tconsole.error(\"Unexpected number instances of \\\"\"+buildingName+\"\\\" found. Expected 1 but got \"+matches+\".\");\n\treturn \"\";\n}", "function createOptionLabel(Text,URL){\n if ( URL && !isAllWhite(URL) )\n return ( Text + \" (\" + URL + \")\" );\n else\n return Text ;\n}", "get link() {\n return this.getText('link');\n }", "function createLink() {\n const editor = document.querySelector(`.editor-wrap`);\n const text = document.querySelector(`.editor`).innerText;\n const encoded = encodeUnicode(text);\n\n html2canvas(editor, {width: 700}).then((canvas) => {\n document.body.querySelector(`.result`).appendChild(canvas);\n });\n document.querySelector(`#text`).innerHTML = `<a href=\"/?text=${encoded}\">Copy link for plaintext</a>`;\n}", "function buildLink(xx,yy,ii,jj,kk,ll,colonyData){\r\n\tgetCell(xx,yy,ii,jj).innerHTML = createLink(constructionUrl(kk,ll,colonyData),getCell(xx,yy,ii,jj).innerHTML);\r\n}", "function citekit_getUrlString( elementId ){\n\t\tvar thisURN = \"\";\n\t\tvar thisType = \"\";\n\t\tvar thisService = \"\";\n\t\tvar thisString = \"\";\n\n\t\t// identify the type of link\n\t for ( whichClass in citekit_var_classNames ){\n\t\t\t\tif ( $(\"#\" + elementId).hasClass(citekit_var_classNames[whichClass])) {\n\t\t\t\t\tthisType = whichClass;\n\t\t\t\t}\n\t\t}\n\n\t\t// Get the plain URN from the attribute\n\t\tif ( $(\"#\" + elementId).attr(\"src\")) {\n\t\t\t\tthisURN = $(\"#\" + elementId).attr(\"src\");\n\t\t} else if ( $(\"#\" + elementId).attr(\"cite\")) {\n\t\t\t\tthisURN = $(\"#\" + elementId).attr(\"cite\");\n\t\t} else if ( $(\"#\" + elementId).attr(\"href\")) {\n\t\t\t\tthisURN = $(\"#\" + elementId).attr(\"href\");\n\t\t}\n\n\t\t//If a service is specified, grab that URL-string\n\t\tfor (whichService in citekit_var_services){\n\t\t\t\tif ( $(\"#\" + elementId).hasClass(whichService) ){\n\t\t\t\t\tswitch (thisType) {\n\t\t\t\t\t\t\tcase \"cts\":\n\t\t\t\t\t\t\t\t\tthisString = citekit_var_services[whichService] + citekit_var_qs_GetPassagePlus;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"citeimg\":\n\t\t\t\t\t\t\t\t\tthisString = citekit_var_services[whichService] + citekit_var_qs_GetImagePlus;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"cite\":\n\t\t\t\t\t\t\t\t\tthisString = citekit_var_services[whichService] + citekit_var_qs_GetObjectPlus;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\t//Otherwise, grab the default URL-string\n\t\tif ( thisString == \"\"){ \n\t\t\t\tswitch (thisType) {\n\t\t\t\t\t\tcase \"cts\":\n\t\t\t\t\t\t\t\tthisString = citekit_var_services[citekit_var_default_cts] + citekit_var_qs_GetPassagePlus;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"citeimg\":\n\t\t\t\t\t\t\t\tthisString = citekit_var_services[citekit_var_default_img] + citekit_var_qs_GetImagePlus;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"cite\":\n\t\t\t\t\t\t\t\tthisString = citekit_var_services[citekit_var_default_coll] + citekit_var_qs_GetObjectPlus;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\n\t\t//Assemble and return\n\t\treturn thisString + thisURN;\n}", "function demoTemplate({\n url\n}) {\n return `Go here to see a demo <a href=\"${url}\">${url}</a>.`;\n}", "function lineTemplate({\n config\n}) {\n let url = \"\";\n const {\n line\n } = config; // If the line should not be there we just return an empty string.\n\n if (line === exports.LineColor.NONE) {\n return ``;\n } // Construct the URL.\n\n\n if (isValidURL(line)) {\n url = line;\n } else {\n url = `https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/${line}.png`;\n }\n\n return `![-----------------------------------------------------](${url})`;\n}", "function delicious2text(links, linkFormat, linkSeparator){\n var linkTexts = [];\n links.forEach(function(link){\n var linkText = linkFormat.replace(/%([\\w]+)/g, function(match, linkAttribute){\n return link[linkAttribute];\n });\n linkTexts.push(linkText);\n });\n return linkTexts.join(linkSeparator);\n}", "function datafunction(quesion) {\n let pricearray = document.querySelectorAll(quesion);\n let details = [];\n for (let i = 0; i < pricearray.length; i++) {\n let name = pricearray[i].textContent.trim()\n let url = \"https://leetcode.com\" + pricearray[i].getAttribute('href');\n details.push(`<td><a target=\"_blank\" href=${url}>${name}</a></td>`)\n }\n \n return details;\n }", "function formatLink(text, link, rel, isImg) {\n if (typeof isImg === 'undefined') {\n isImg = false;\n }\n if (typeof rel === 'undefined') {\n rel = false;\n }\n var lnk = '';\n if (prg.markdown) {\n if (isImg) {\n lnk = \"!\";\n }\n lnk += \"[\" + text + \"](\" + link + \")\";\n } else if (prg.json) {\n lnk = {\"text\": text, \"link\": link, \"isImg\": isImg, \"rel\": rel};\n } else {\n lnk = text + \"\\t\" + link;\n }\n return lnk;\n}", "function lc_Linkify(){\r\n var urlRegex = /_?((h\\S\\Sp)?(:\\/\\/|rapidshare\\.)[^\\s+\\\"\\<\\>]+)/ig;\r\n var snapTextElements = document.evaluate(\"//text()[\"+\r\n \"not(ancestor::a) and not(ancestor::script) and (\"+\r\n \"contains(translate(., 'RAPIDSHE', 'rapidshe'), 'rapidshare.')\"+\r\n \" or contains(translate(., 'RAPIDSFENT', 'rapidsfent'), 'rapidsafe.net/')\"+\r\n \" or contains(translate(., 'LIXN', 'lixn'), '://lix.in/')\"+\r\n \")]\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0; i < snapTextElements.snapshotLength; i++) {\r\n var elmText = snapTextElements.snapshotItem(i);\r\n if (urlRegex.test(elmText.nodeValue)) {\r\n var sURLText = elmText.nodeValue;\r\n var elmSpan = document.createElement(\"span\");\r\n // add class name\r\n elmSpan.className = \"rs_linkcheck_linked\";\r\n elmText.parentNode.replaceChild(elmSpan, elmText);\r\n urlRegex.lastIndex = 0;\r\n for(var match = null, lastLastIndex = 0; (match = urlRegex.exec(sURLText)); ) {\r\n // skip truncated links\r\n if(match[0].indexOf(\"...\") != -1) continue;\r\n // skip bare domains\r\n if(match[0].indexOf(\"/\") == -1) continue;\r\n elmSpan.appendChild(document.createTextNode(sURLText.substring(lastLastIndex, match.index)));\r\n lastLastIndex = urlRegex.lastIndex;\r\n var elmLink = document.createElement(\"a\");\r\n // make sure there's an http:\r\n elmLink.href = match[1].replace(/^((h\\S\\Sp)?:\\/\\/)?rapidshare\\./, \"http://rapidshare.\");\r\n var nextPart = \"\";\r\n // Check if there was a space\r\n if(/\\brapidshare\\.(com|de)\\/files\\/.*[^\\.]{5}$/i .test(match[0]) &&\r\n /^\\s.*\\.\\w/.test(sURLText.substring(urlRegex.lastIndex))){\r\n nextPart = sURLText.substring(urlRegex.lastIndex);\r\n nextPart = nextPart.match(/^\\s[^\\s+\\\"\\<\\>]*\\.\\w+(\\.html)?/i)[0];\r\n lastLastIndex += nextPart.length;\r\n elmLink.href += nextPart.replace(/\\s/, \"\");\r\n }\r\n // open in new window or tab\r\n elmLink.target = \"_blank\";\r\n // tool-tip to indicate Linkified\r\n elmLink.title = \"[linked]\";\r\n elmLink.appendChild(document.createTextNode(match[0] + nextPart));\r\n elmSpan.appendChild(elmLink);\r\n }\r\n elmSpan.appendChild(document.createTextNode(\r\n sURLText.substring(lastLastIndex)));\r\n elmSpan.normalize();\r\n // stop events on new links, like pop-ups and cookies\r\n elmSpan.addEventListener(\"click\", function(e){ e.stopPropagation(); }, true);\r\n }\r\n }\r\n}", "function diagramInfo(model) { // Tooltip info for the diagram's model\n return \"Model:\\n\" + model.nodeDataArray.length + \" nodes, \" + model.linkDataArray.length + \" links\";\n }", "function printInfo(text) {\n var str = '';\n for(var index in info_text) {\n if(str != '' && info_text[index] != '') {\n str += \" - \";\n }\n str += info_text[index];\n }\n document.getElementById(\"graph-info\").innerHTML = str;\n }", "function resolve_links(line){\n // categories, images, files\n var re= /\\[\\[:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف):[^\\]\\]]{2,80}\\]\\]/gi\n line=line.replace(re, \"\")\n\n // [[Common links]]\n line=line.replace(/\\[\\[:?([^|]{2,80}?)\\]\\](\\w{0,5})/g, \"$1$2\")\n // [[Replaced|Links]]\n line=line.replace(/\\[\\[:?(.{2,80}?)\\|([^\\]]+?)\\]\\](\\w{0,5})/g, \"$2$3\")\n // External links\n line=line.replace(/\\[(https?|news|ftp|mailto|gopher|irc):\\/\\/[^\\]\\| ]{4,1500}([\\| ].*?)?\\]/g, \"$2\")\n return line\n }", "function linkURL(formula){\n return formula.match(/=hyperlink\\(\"([^\"]+)\"/i)[1]\n}", "function display(str, wx, wy, strtitle, source, sourceURL, add) {\n var sourceHTML = \"\";\n var showleft=mouseX;\n var showtop=mouseY;\n if (source != undefined) {\n if (sourceURL != undefined) {\n sourceHTML = '<div><center>Structure from:<a target=\"_blank\" style=\"text-decoration: underline;\" href=\"$URL$\">$SOURCE$</a></center></div>'.replace(\"$SOURCE$\", source).replace(\"$URL$\", sourceURL);\n } else {\n sourceHTML = '<div><center>Structure from:<span style=\"text-decoration: underline;\" >$SOURCE$</span></center></div>'.replace(\"$SOURCE$\", source);\n }\n }\n if(add.inchikey){\n \tvar ikey = add.inchikey.split(\"=\")[1];\n //https://www.google.com/search?q=BSYNRYMUTXBXSQ-UHFFFAOYSA-N\n \tsourceHTML += '<div style=\"text-align: center;font-size:small;\"><a href=\"https://www.google.com/search?q=' + ikey + '\" target=\"_blank\">' + ikey +'</a></div>';\n }\n //https://ginas.ncats.nih.gov/ginas/app/substances?q=CC(%3DO)OC1%3DC(C%3DCC%3DC1)C(O)%3DO&type=FLEX\n if (str == \"\" || str == undefined) {\n notify(\"No structure found for : \" + strtitle);\n return;\n }\n sourceHTML += '<div style=\"text-align: center;font-size:small;\"><a href=\"https://ginas.ncats.nih.gov/ginas/app/substances?q=' + encodeIt(str) + '&type=FLEX\" target=\"_blank\">Search GSRS</a></div>';\n \n if (strtitle == undefined) strtitle = str;\n var strtitlem = '<img style=\"margin-bottom: 2px;margin-right: 10px;border-radius: 5px; margin-left: -10px; padding: 4px; vertical-align: bottom; background: none repeat scroll 0% 0% white;/* clear: none; *//* display: inline; */\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRUlEQVR42p1STYhSURTWoimmrOQlRZM/D/+fz/+f0HkzI8ODx2slbgyGiEanoBzLGCpahLqRhIpctHBTK2cbudClCyEIQtonGc7KRYskeqHv1fceNOCQUh243HvPPd93vnPuUanmmMlkOkZR1ILqf4ym6bN+v5/1er2czWZb+mugTqc7EQqFWIC3PR5PDusmzjksHopOz8MeRrZIIBDYcblcW8jKQL7f7XZf8vl8y9g3sO9gX0XskX0UgiiLxXI0HA5vIMsjs9m8rNFozuDpEPwnoeAqSJ/Z7XYP7i4kuY/7dfiPKwTxePwLJL+G8x6C1kFAH1CmdjqdNN5fYt2SE4JkE2QXlNd8Pj+uVCrfOI57D+mXEfQU7sU/lLhgMBgoOQEIrmHXK95isSj2ej2xXq8LyWSyAYJduGc2C9LJKYJSqSQOh0NpNBpJjUZD4Hn+E+St/QuBBIKfMEkQBKnT6UxQThelMgewiwCv4BccswgUk2Ddbvc7y7JvAbDLTYxEIuto9C6G64rVasVv+jL7BIVCQRwMBmK/35+02+1JIpGYxGKxj/jSV3L3g8HgXfl7jUZjgCTJFfToMQi2tFrtKYUgk8kItVrtazqd3mu1WkI2mx1D5hMExZDR6XA41lAOD98NSH+AabwImDwDaoWAYZjnqPkFJD6sVqufm83mGFk+IHgbJLdxvgOiHGaEQzghT+xUZ5CBAOs5uaZUKvWmXC7/AOgdJJMoYRWzwREEsTQ1vjNMjaxMNBrd1Ov153/75JGeB/oFDjDMFWlNFx4AAAAASUVORK5CYII=\"><span class=\"\" style=\"' +\n 'overflow: hidden;text-overflow: ellipsis;width: 80%;display: inline-block;\">' + strtitle + \"</span>\";\n\n jQuery(\"<div class='mystr'><a name='righthere' class='shosmi' href='#righthere' style=\\\"\\\n margin: auto;\\\n display: block;\\\n text-align: center;\\\n font-size: 8pt;\\\n\\\">(show smiles)</a><input style='display:none;width: 100%;font-size: smaller;font-family: monospace;' type='textbox' value='\" + str + \"'/>\" + \n\t \"<img title='Click to get structure' style='cursor: pointer;\\\nheight: 100%;\\\nmargin: auto;\\\nmax-width: 100%;\\\ndisplay: block;\\\nmargin-bottom: -40px;' src='\" + structureImgURL(str) + \"'>\" +\n sourceHTML +\n \"</div>\")\n .dialog({\n dialogClass: 'NCATSFindDialog',\n closeText: \"hide\",\n title: strtitle,\n position: 'top',\n show: {\n effect: 'fade',\n duration: 350\n },\n hide: {\n effect: 'fade',\n duration: 250\n }\n });\n jQuery(\".NCATSFindDialog\").css('z-index', 99999);\n jQuery(\".NCATSFindDialog\").css('border', \"none\");\n jQuery(\".NCATSFindDialog\").css('border-radius', 0);\n jQuery(\".NCATSFindDialog\").css('box-shadow', \"rgba(0, 0, 0, 0.329412) 5px 5px 5px\");\n jQuery(\".NCATSFindDialog\").css('position', 'fixed');\n jQuery(\".NCATSFindDialog\").css('padding', 0);\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('border', 'none');\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('color', 'white');\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('border-radius', 0);\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('background', \"rgb(158, 158, 158)\");\n\n jQuery(\".NCATSFindDialog\").not(\".setup\").css('top', showtop+ 'px');\n jQuery(\".NCATSFindDialog\").not(\".setup\").css('left', showleft+ 'px');\n jQuery(\".NCATSFindDialog\").not(\".setup\").addClass(\"setup\");\n\n\n jQuery(\".mystr a.shosmi\").click(function() {\n\tjQuery(this).parent().find(\"input\").show();\n\tjQuery(this).hide();\n });\n jQuery(\".mystr img\").click(function() {\n var smi = jQuery(this).parent().find(\"input\").val();\n var mole = {\n \"smiles\": smi\n };\n editMolecule(mole);\n });\n\n jQuery(\".ui-dialog .ui-dialog-content\").css(\"overflow\", \"hidden\");\n jQuery(\".ui-dialog-title\").css(\"overflow\", \"visible\");\n jQuery(\".ui-dialog-title\").not(\".active\").html(strtitlem);\n jQuery(\".ui-dialog-title\").addClass(\"active\");\n}", "function short(){\n shorten.shortenLink()\n .then((data)=>{\n //paint it to the DOM\n ui.paint(data)\n })\n .catch((err)=>{\n console.log(err)\n })\n}", "function getUrl() { \n var uri = createUriParams(), \n url = document.URL.split(\"#\")[0]; \n \n url += \"#\" + uri \n dojo.byId(\"url\").value = url; \n \n dijit.byId(\"urlDialog\").show(); \n}", "function e(t){return t.replace(s,function(s,e){var d=(e.match(l)||[])[1]||\"\",m=i[d];e=e.replace(l,\"\"),e.split(m).length>e.split(d).length&&(e+=d,d=\"\");var o=e,p=e;return 100<e.length&&(p=p.substr(0,100)+\"...\"),\"www.\"===o.substr(0,4)&&(o=\"http://\"+o),\"<a href=\\\"\"+o+\"\\\">\"+p+\"</a>\"+d})}", "function generateUrl(el) {\n\tvar generatedUrl = assembleUrl();\n\n\t// ADD TO CLIPBOARD add it to the dom\n\tcopyToClipboard(generatedUrl);\n\tdomElements.wrapperUrl.el.html(generatedUrl);\n}", "function constructURL(text){\n return \"https://api.funtranslations.com/translate/minion.json\" +\"?\" + \"text=\" +text;\n}", "function toUrl(string) {\n return string.indexOf('//') === -1 ? '//' + string : string;\n }", "function loadLinkData(url, result) {\n // build output\n var text = \"<div class='row link_preview'>\";\n // link title\n if (result.title) {\n text += \"<h3>\" + result.title + \"</h3>\";\n text += \"<input type='hidden' name='link_title' value='\" + result.title + \"'/>\";\n }\n // link url\n //text += \"<div class='url'><em><a href='\" + url + \"' target='_blank'>\" + url + \"</a></em></div>\";\n text += \"<input type='hidden' name='link' value='\" + url + \"'/>\";\n if (result.img) {\n text += \"<img src='\" + result.img + \"' class='thumb'/>\";\n text += \"<input type='hidden' name='link_img' value='\" + result.img + \"'/>\";\n }\n // link description\n if (result.description) {\n text += \"<p>\" + result.description + \"</p>\";\n text += \"<input type='hidden' name='link_description' value='\" + result.description + \"'/>\";\n }\n text += \"</div>\";\n return text;\n}", "getURL()\n {\n return this.url;\n }", "function _getLinkEquivText(Aelt) {\n var text = '';\n var nodes = Aelt.childNodes;\n for (var i=0; i<nodes.length; i++) {\n var node = nodes[i];\n if (node.nodeType == Node.TEXT_NODE) {\n text += stripString(node.data);\n } else if (node.tagName == 'IMG') {\n var img_alt = node.getAttribute('alt');\n if (isDefinedAttr(img_alt)) {\n img_alt = stripString(img_alt);\n text += img_alt;\n }\n } else\n text += _getLinkEquivText(node);\n }\n return text;\n}", "function copiarURL(text) {\r\n const textOculto = document.createElement(\"textarea\");\r\n document.body.appendChild(textOculto);\r\n textOculto.value = text;\r\n textOculto.select();\r\n document.execCommand(\"copy\");\r\n document.body.removeChild(textOculto);\r\n}", "rawLink () {\n const ua = navigator.userAgent.toLowerCase()\n\n /**\n * On IOS, SMS sharing link need a special formatting\n * Source: https://weblog.west-wind.com/posts/2013/Oct/09/Prefilling-an-SMS-on-Mobile-Devices-with-the-sms-Uri-Scheme#Body-only\n */\n if (this.key === 'sms' && (ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1)) {\n return this.networks[this.key].replace(':?', ':&')\n }\n\n return this.networks[this.key]\n }", "function plot_html(path,tree){\n\tvar node = tree;\n\tif (path != \"/null\")\n\tfor (var i = 1; i < path.length; ++i)\n\tnode = (path.charAt(i)=='1') ? node.left: node.right;\n\tvar output = '<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>Corresponding Logs</title></head><body><p>';\n\tfor (x in node.value)\n\toutput += node.value[x]+\"<br>\";\n\treturn output+\"</p></body></html>\";\n}", "function link_generator(data){\n\n var i = 0,\n title = data[1],\n description = data[2],\n link = data[3];\n\n for(i; i < data[3].length; i++){\n var list_link = '<a href=\"'+link[i]+'\">'+title[i]+'</a><br/>';\n list_description = list_link+description[i]+'<hr>';\n links.append(list_description);\n }\n }", "url(urls: Array<string>, scheme: ?string) {\n const bbox = WhooTS.getTileBBox(this.x, this.y, this.z);\n const quadkey = getQuadkey(this.z, this.x, this.y);\n\n return urls[(this.x + this.y) % urls.length]\n .replace('{prefix}', (this.x % 16).toString(16) + (this.y % 16).toString(16))\n .replace('{z}', String(this.z))\n .replace('{x}', String(this.x))\n .replace('{y}', String(scheme === 'tms' ? (Math.pow(2, this.z) - this.y - 1) : this.y))\n .replace('{quadkey}', quadkey)\n .replace('{bbox-epsg-3857}', bbox);\n }", "text_processor(wikitext, page_data) {\n\t\t\t// console.log(wikitext);\n\t\t\t// console.log(page_data);\n\t\t\treturn wikitext.replace(/(\\|\\s*)url-status(\\s*=\\s*)(dead|live)/g,\n\t\t\t\t(all, prefix, equal, status) => prefix + 'dead-url' + equal + (status === 'dead' ? 'yes' : 'no')\n\t\t\t).replace(/(\\|\\s*)url-status(\\s*=\\s*)(\\||}})/g, '$3');\n\t\t}", "function combineDescription(node) {\n \n desc = node.description + \"\\n\\n\" \n \n links = node.stuff.filter((e) => {\n return e.text != \"Episode:\"\n });\n\n for (const e of links) {\n desc += e.text + \"\\n\" + e.url + \"\\n\\n\"\n }\n\n return desc\n\n}", "get url() {\n return internalSlots.get(this).url.href;\n }", "function bp_ont_link(ont_acronym){\n return \"/ontologies/\" + ont_acronym;\n}", "toLinkUrl() {\r\n return this.urlPath + this._stringifyAux() +\r\n (isPresent(this.child) ? this.child._toLinkUrl() : '');\r\n }" ]
[ "0.6158752", "0.61071175", "0.60826486", "0.60786897", "0.6025609", "0.5869289", "0.5729157", "0.5686321", "0.56816036", "0.568082", "0.568082", "0.56807977", "0.56807977", "0.56796306", "0.56644607", "0.56644607", "0.56207585", "0.555842", "0.5549773", "0.5537478", "0.5529226", "0.5513961", "0.54900444", "0.5458609", "0.5445998", "0.5445734", "0.5418005", "0.54113483", "0.5402487", "0.5397324", "0.5396586", "0.5383163", "0.5371437", "0.53661644", "0.5357739", "0.53538597", "0.5347244", "0.5342547", "0.5334295", "0.53180057", "0.5310139", "0.53090894", "0.5275277", "0.52587265", "0.5239557", "0.5231819", "0.522831", "0.52275616", "0.5219454", "0.52127373", "0.5208827", "0.52023697", "0.5196479", "0.51925623", "0.5188142", "0.51755214", "0.5174737", "0.5170932", "0.51689935", "0.516205", "0.51585925", "0.51571614", "0.5151836", "0.5148474", "0.51292026", "0.5124591", "0.5123586", "0.512295", "0.5113687", "0.51135874", "0.5110698", "0.5110616", "0.5107474", "0.510035", "0.50921035", "0.5086638", "0.5083503", "0.5080271", "0.50707793", "0.50684214", "0.50633556", "0.50554734", "0.5051507", "0.50482124", "0.504719", "0.5045914", "0.5042799", "0.50401056", "0.5037257", "0.50370103", "0.5034582", "0.5031959", "0.5031285", "0.50309575", "0.5030259", "0.50267464", "0.5022808", "0.5022297", "0.50154936", "0.50132227", "0.50114036" ]
0.0
-1
Save current diagram Save can be triggered in 3 cases: 1 from menu 2 from quick toolbar 3 from shortcut CtrlS (onKeyDown) See:
function save() { //alert("save triggered! diagramId = " + diagramId ); Log.info('Save pressed'); if (state == STATE_TEXT_EDITING) { currentTextEditor.destroy(); currentTextEditor = null; state = STATE_NONE; } var dataURL = null; try { dataURL = renderedCanvas(); } catch (e) { if (e.name === 'SecurityError' && e.code === 18) { /*This is usually happening as we load an image from another host than the one Diagramo is hosted*/ alert("A figure contains an image loaded from another host. \ \n\nHint: \ \nPlease make sure that the browser's URL (current location) is the same as the one saved in the DB."); } } // Log.info(dataURL); // return false; if (dataURL == null) { Log.info('save(). Could not save. dataURL is null'); alert("Could not save. \ \n\nHint: \ \nCanvas's toDataURL() did not functioned properly "); return; } var diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion}; //Log.info('stringify ...'); // var serializedDiagram = JSON.stringify(diagram, Util.operaReplacer); var serializedDiagram = JSON.stringify(diagram); // Log.error("Using Util.operaReplacer() somehow break the serialization. o[1,2] \n\ // is transformed into o.['1','2']... so the serialization is broken"); // var serializedDiagram = JSON.stringify(diagram); //Log.info('JSON stringify : ' + serializedDiagram); var svgDiagram = toSVG(); // alert(serializedDiagram); // alert(svgDiagram); //Log.info('SVG : ' + svgDiagram); //save the URLs of figures as a CSV var lMap = linkMap(); //see: http://api.jquery.com/jQuery.post/ $.post("./common/controller.php", {action: 'save', diagram: serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram, diagramId: currentDiagramId}, function(data) { if (data === 'firstSave') { Log.info('firstSave!'); window.location = './saveDiagram.php'; } else if (data === 'saved') { //Log.info('saved!'); alert('saved!'); } else { alert('Unknown: ' + data); } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuSaveClick(event) {\n // console.log('menuSaveClick');\n\n event.preventDefault();\n\n let diagramTitle = PageData.SavedImageTitle;\n let storageKey = Date.now().toString();\n\n let overwrite = Common.customConfirm('Overwrite existing diagram?');\n if (overwrite) {\n storageKey = PageData.Filename;\n } else {\n diagramTitle = Common.customPrompt('Save diagram as:', diagramTitle);\n if (!diagramTitle) return;\n }\n\n const svgXml = SvgModule.getSvgXml();\n const svgObject = { Title: diagramTitle, SvgXml: svgXml };\n const jsonData = JSON.stringify(svgObject);\n localStorage.setItem(storageKey, jsonData);\n}", "function save() {\n\t\tdocument.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n\t\tmyDiagram.isModified = false;\n\t}", "function save() {\n saveDiagramProperties();\t// do this first, before writing to JSON\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n}", "function save() {\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n }", "function callSaveFile() {\n let win = BrowserWindow.getFocusedWindow();\n win.webContents.send('save-menu-click');\n}", "function save() {\r\n document.getElementById('mySavedModel').value = myDiagram.model.toJson();\r\n myDiagram.isModified = false;\r\n}", "function saveCallback()\n {\n clearUndoBuffer();\n updateUndoButton();\n if (!($('#perc-region-tool-inspector').hasClass('buttonPressed')))\n {\n $(\"#perc-undo-tool\").hide();\n $(\"#perc-undo-tool-disabled\").hide();\n }\n }", "function saveDocument() {\n if (checkLocalStorage()) {\n var saveName = getCurrentFileName();\n if (saveName === UnsavedFileName) {\n saveDocumentAs();\n } else {\n saveDiagramProperties()\n window.localStorage.setItem(saveName, myDiagram.model.toJson());\n myDiagram.isModified = false;\n }\n }\n}", "function save() {\r\n\t\tvar str = myDiagram.model.toJson();\r\n\t\tdocument.getElementById(\"mySavedModel\").value = str;\r\n\t }", "onKeyDown(evt) {\n if (evt.ctrlKey && evt.key == \"s\") {\n evt.stopPropagation()\n evt.preventDefault()\n \n this.livelyEditor.saveFile()\n }\n }", "function keyPressed() {\n //if the key pressed is equal to s, lowercase or capital, run the saveCanvas command and name it with a timestamp in the generative design library. This saves the canvas as a png.\n if (key == 's' || key == 'S') saveCanvas(gd.timestamp(), 'png');\n}", "function keyPressed() {\n\t\n if( key === 's' || key === 'S' ) {\n\n save();\n \n }else if( key === 'z' || key === 'Z' ) {\n toggleGrid();\n }else if( key === 'x' || key === 'X' ) {\n toggleQuarterLine();\n }\n\n}", "function save() {\n str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "function saveDocumentAs() {\n if (checkLocalStorage()) {\n var saveName = prompt(\"Save file as...\", getCurrentFileName());\n if (saveName && saveName !== UnsavedFileName) {\n setCurrentFileName(saveName);\n saveDiagramProperties()\n window.localStorage.setItem(saveName, myDiagram.model.toJson());\n myDiagram.isModified = false;\n }\n }\n}", "function keyPressed(){\n if (key == 'S' || key == 's') {\n save(\"masterpiece.png\")\n }\n}", "saveMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null: // case MenuChoices.edit:\n this.menuView.contentsMenu.style.display = \"block\";\n this.menuView.saveContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.save;\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.saveButton.style.zIndex = \"1\";\n break;\n case MenuChoices.save:\n this.menuView.contentsMenu.style.display = \"none\";\n this.menuView.saveContent.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.saveButton.style.zIndex = \"0\";\n break;\n default:\n this.cleanMenu();\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.saveButton.style.zIndex = \"1\";\n this.menuView.saveContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.save;\n break;\n }\n }", "function save() {\n str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "function va02Save(){\r\n\r\n\tonscreen 'SAPLSPO2.0300'\r\n\t\tHANDLE_POPUP_0300:;\r\n\t\tenter('=OPT1');\r\n\r\n\tonscreen 'SAPLATP4.0500'\r\n\t\tenter('=WEIT');\r\n\r\n\tonscreen 'SAPLSPO2.0300'\r\n\t\tgoto HANDLE_POPUP_0300\r\n\r\n\tonscreen 'SAPMV45A.0102'\t\r\n\t\tif(_message){\r\n\t\t\tmessage(\"S:\"+_message);\t\r\n\t\t\tenter('/n');\r\n\t\t}\t\r\n}", "function saveAs() {\n var dataURL = renderedCanvas();\n\n// var $diagram = {c:canvas.save(), s:STACK, m:CONNECTOR_MANAGER};\n var $diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n var $serializedDiagram = JSON.stringify($diagram);\n// $serializedDiagram = JSON.stringify($diagram, Util.operaReplacer);\n var svgDiagram = toSVG();\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //alert($serializedDiagram);\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\", {action: 'saveAs', diagram: $serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram},\n function(data) {\n if (data == 'noaccount') {\n Log.info('You must have an account to use that feature');\n //window.location = '../register.php';\n }\n else if (data == 'step1Ok') {\n Log.info('Save as...');\n window.location = './saveDiagram.php';\n }\n }\n );\n}", "function save() {\n // clear the redo stack\n redo = [];\n $('#redo').prop('disabled', true);\n // initial call won't have a state\n if (state) {\n undo.push(state);\n $('#undo').prop('disabled', false);\n }\n state = JSON.stringify(canvas);\n }", "function keyPressed() {\n if (key == 's' || key == 'S') {\n saveCanvas(gd.timestamp(), 'png');\n }\n}", "function keyPressed() {\n if (key == 's' || key == 'S') {\n saveCanvas(gd.timestamp(), 'png');\n }\n}", "function handleSave(evt) {\n hideNavMenu();\n let filename = \"okit.json\";\n if (okitSettings.is_timestamp_files) {\n filename = 'okit-' + getTimestamp() + '.json'\n }\n console.info('>> Saving Single Region File');\n okitJsonModel.updated = getCurrentDateTime();\n saveJson(JSON.stringify(okitJsonModel, null, 2), filename);\n}", "function newOrClose(){\r\n\t\tconsole.log(self.save);\t\t\t\t\r\n\t\tif(self.save== \"saveclose\" ){\r\n\t\t\t drawerClose('.drawer') ;\r\n\t\t}\r\n\t\treset();\r\n\t}", "function callSaveAsFile() {\n let win = BrowserWindow.getFocusedWindow();\n win.webContents.send('saveas-menu-click');\n}", "function startSaveListener(){\r\n\tdocument.getElementById(\"saveit\").addEventListener(\"click\", saveGraph);\r\n document.getElementById(\"pushit\").addEventListener(\"click\", savepng);\r\n}", "onSaving() {\n if (this._saving) {\n this._saving.raise();\n }\n }", "function saveGame() {\n if (store.getState().lastAction == 'GAME_SAVE' && store.getState().currentPage == 'LOAD_SAVED') {\n localStorage.setItem('kr_xp_save', JSON.stringify(store.getState().savedData));\n savedData = JSON.parse(localStorage.getItem('kr_xp_save'));\n loadGameStateChangeStarter();\n setTimeout(function(){\n loadSavedMenuGameslotDisplayHandler();\n }, 600);\n }\n }", "function saveBeforeClose() {\n // We've already saved all other open editors when they go active->inactive\n saveLineFolds(EditorManager.getActiveEditor());\n }", "function inner_after_save()\n\t{\n\t\tthat.processCodeInScripts();\n\t\tthat.editor.focus();\n\t\tthat.showInFooter(\"saved\");\n\t\tLiteGUI.trigger( that, \"stored\" );\n\t}", "onSaved() {\n this.saved.raise();\n }", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "save() {\n // // Update the global selection before saving anything.\n this.surface.editor.selection.update();\n Object.assign(this.saved, this.state);\n }", "function keyPressed() {\n if (key == 's' || key == 'S') {\n //saves canvas as an image - jpg or png\n // saveCanvas('image','png');\n saveCanvas(gd.timestamp(), 'png');\n }\n}", "function keyPressed() {\n if (key == 's' || key == 'S') {\n //saves canvas as an image - jpg or png\n // saveCanvas('image','png');\n saveCanvas(gd.timestamp(), 'png');\n }\n}", "function handleSaveShortcut(e) {\n if (e.isDefaultPrevented()) return false;\n if (!e.metaKey && !e.ctrlKey) return false;\n if (e.key != 'S' && e.key != 's') return false;\n\n e.preventDefault();\n\n // Share and save\n share(function(url) {\n window.location.href = url + '.go?download=true';\n });\n\n return true;\n }", "function saveAndExit() {\n scope.showSaveAndExitModal = true;\n }", "function keyReleased() {\n if (keyCode == CONTROL) saveCanvas(gd.timestamp(), \"png\");\n}", "function pfClickedSave(mode){\n\tvar targetArray = connectArray(mode);\n\tvar keyList = connectList(mode);\n\tprocessList(targetArray, keyList);\n\tsetCookie();\n\tdocument.getElementById(\"overpanel\").style.display = \"none\";\n}", "function keyReleased() {\n if (keyCode == CONTROL) saveCanvas(gd.timestamp(), 'png');\n}", "function save(key) {\r\n return function (value) {\r\n s[key] = value;\r\n storage.write(SETTINGS_FILE, s);\r\n //WIDGETS[\"activepedom\"].draw();\r\n };\r\n }", "function saveNav() {\n saveNavDiagramProperties(); // do this first, before writing to JSON\n document.getElementById(\"mySavedNavModel\").value = navDiagram.model.toJson();\n navDiagram.isModified = false;\n}", "function save() {\n // clear the redo stack\n redo = [];\n if (!reDo.classList.contains('disabled')) {\n reDo.classList.add('disabled');\n }\n // initial call won't have a state\n if (state) {\n undo.push(state);\n unDo.classList.remove(\"disabled\");\n }\n state = JSON.stringify(canvas);\n}", "saveAndExit() {\n saveAndExit();\n }", "function saveCanvas() {\n\tcanvas.isDrawingMode = false;\n\tdrawState = \"SELECT\";\n\tscd = JSON.stringify(canvas); // save canvas data\n\tconsole.log(scd);\n}", "function saveButtonOnClick(ev)\n{\n\tlet stopPointInfo = getCurrentStopPointInfo();\n\t//console.log(\"saveButtonOnClick(\", ev, \"): name \", stopPointInfo.name);\n\tlet savedStopPoints = generateStopPointsToSave(stopPointTable, stopPointInfo);\n\tstorage.setStopPoints(savedStopPoints);\n}", "function va01Save(){\r\n\r\n\tonscreen 'SAPLSPO2.0300'\r\n\t\tHANDLE_POPUP_0300:;\r\n\t\tenter('=OPT1');\r\n\r\n\tonscreen 'SAPLATP4.0500'\r\n\t\tenter('=WEIT');\r\n\r\n\tonscreen 'SAPLSPO2.0300'\r\n\t\tgoto HANDLE_POPUP_0300\r\n\t\t\r\n\tonscreen 'SAPMV45A.4001'\r\n\t\tgoto SAPMV45A_3;\r\n\tonscreen 'SAPMV45A.4008'\r\n\t\tSAPMV45A_3:;\t\r\n\t\tif(_message){\r\n\t\t\tprintln('----------------------------------:' + _message);\r\n\t\t\tif(_message.indexOf('has been saved') > -1) {\t// If String is found\r\n\t\t\t\tmessage(\"S: \"+_message);\r\n\t\t\t\tset(\"V[z_vaxx_*]\",\"\");\r\n\t\t\t\tset(\"V[z_va01_*]\",\"\");\r\n\t\t\t\tset('V[z_va02_order]', _message.replace(/\\D/g,''));\r\n\t\t\t\tenter('/n');\r\n\t\t\t\tgoto SCRIPT_END;\r\n\t\t\t}\r\n\t\t\tif(_message.substring(0,2) == 'E:'){\r\n\t\t\t\tmessage(_message);\r\n\t\t\t\tenter('?');\r\n\t\t\t\tgoto SCRIPT_END;\r\n\t\t\t}\r\n\t\t}\r\n\tSCRIPT_END:;\r\n\t\r\n}", "_event_saving() {\n\t\tlet ev = new Event(\"saving\", { \"bubbles\": true, \"cancelable\": true });\n\t\tthis.dispatchEvent(ev);\n\t}", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "function save_options() {\n localStorage[\"keycode\"] = keyValue.value;\n\n if (warnYes.checked) {\n localStorage[\"warn\"] = true;\n } else {\n localStorage[\"warn\"] = false;\n }\n\n if (saveYes.checked) {\n localStorage[\"save\"] = true;\n } else {\n localStorage[\"save\"] = false;\n }\n\n if (modifyYes.checked) {\n localStorage[\"modify\"] = true;\n } else {\n localStorage[\"modify\"] = false;\n }\n\n alert('Changes Saved');\n window.close();\n}", "function onSaveButtonPress() {\n\tif (!validateSettings()) return;\n\tdlgMain.close(saveButtonID);\n}", "function doSaveDocument() {\n var presenter = new mindmaps.SaveDocumentPresenter(eventBus,\n mindmapModel, new mindmaps.SaveDocumentView(), autosaveController, filePicker);\n presenter.go();\n }", "function saveFile(){\n $('#overlay').show();\n $('#saveIt, #saveDrive').addClass('inactive');//grays out button\n $(this).css({'background':'white','color':'black'});//sets colors of 1st save button back to original state\n $(document).unbind('mousedown');//disables preventDefault() in order to eneable typing\n $('#saveCancel').mousedown(function(){\n $('#saveCancel').mouseup(function(){\n $('#overlay').hide();\n $('#savedocumentdiv').hide();//hide 2nd popup\n $('.rowlines, #closecanvastable').show();\n $('#saveCancel').css({'background':'white','color':'black'});\n $('#yesClose, #yesSave').css({'background':'white','color':'black'});\n $('#closefile, #saveAs, #savefile, #revert, #printdraft, #printfin').removeClass('inactive').addClass('active');\n $(\"#newcanvas, #openfile\").removeClass('active').addClass('inactive');\n });\n });\n $('#saveClose').hide();//hides initial popup\n $('.saveDivs, #filenametext').show().css('z-index','10002');//shows new popup\n $('#savedocumentdiv, #savedocument').show().addClass('formshowing').css('z-index','10001');//shows form\n $('#typed').focus().css('cursor','default').css('font-family','Chicago'); //click inside text box to start the blinking cursor\n //http://stackoverflow.com/questions/2132172/disable-text-highlighting-on-double-click-in-jquery\n //used this to disable highlighting of text when dblclicking inside the save-file text box\n \n /*$.extend($.fn.disableTextSelect = function() {\n return this.each(function(){\n if($.browser.mozilla){//Firefox\n $(this).css('MozUserSelect','none');\n }else if($.browser.msie){//IE\n $(this).bind('selectstart',function(){return false;});\n }else{//Opera, etc.\n $(this).mousedown(function(){return false;});\n }\n });\n });*/\n //$('input').disableTextSelect();//No text selection on input elements(text box)\n\n // interactions\n\n $('#typed').keyup(function() {//grays/ungrays form save button depending on input length\n var nameString = $(this).val().length; \n //console.log(nameString);\n if(nameString && !$('#saveEject').hasClass('inactive'))$('#saveIt').removeClass('inactive').addClass('saveActive');\n else {\n $('#saveIt').removeClass('saveActive').addClass('inactive');\n $('#saveYes').unbind();\n }\n if($('#saveIt').hasClass('saveActive')){//if button isn't grayed out\n $('#saveYes').mousedown(function(){//when 2nd save button pressed..\n $(this).mouseup(function(){//button released..\n $('#closefile, #saveAs, #savefile, #revert, #printdraft, #printfin').removeClass('inactive').addClass('active');\n $(\"#newcanvas, #openfile\").removeClass('active').addClass('inactive');\n $('#saveYes, #yesClose, #yesSave').css({'background':'white','color':'black'})//original colors\n var fileName = $(\"#typed\").val();//value of the text field\n $('#savedocumentdiv').hide();//hide 2nd popup\n $('#overlay').hide();\n $('.rowlines, #closecanvastable').show();//hide window bar lines & small box\n nameFile(fileName);\n /*$('#filename').html('<span>'+fileName+'</span>');//replace 'untitled' with new file name\n var nameInPixels = $('#filename').find('span').width();//find length of new name in pixels\n var padSize = (414 - (nameInPixels + 6))/2;//calculate left and right padding\n $('#filename').css('left', padSize + 'px')//centers the new filename based on padding\n .css('width', (nameInPixels +6) + 'px')\n .css({'backgroud':'white','color':'black'}).css('text-align','center');*/\n $(document).mousedown(function(event){//rebinds it\n event.preventDefault();\n });\n });\n });\n }\n //else if ($('#saveIt').hasClass('inactive')){\n // $('#saveYes').unbind();\n //}\n });\n }", "@keydown('meta+s')\n onSave(ev: SyntheticKeyboardEvent) {\n if (this.props.readOnly) return;\n\n ev.preventDefault();\n ev.stopPropagation();\n this.props.onSave();\n }", "function save() { \n const a = document.createElement(\"a\") \n const settings = { atype: \"setting\", canvasWidth: currentCanvasSizeX, canvasHeight: currentCanvasSizeY, foreTexture: document.getElementById('foreImage').dataset.aid, backTexture: document.getElementById('backImage').dataset.aid }\n const symbols = { atype : \"symbol\", contents : actionArray } \n const paths = { atype : \"path\", contents : pathRawArray } \n const obj = { settings: settings, symbols: symbols, paths: paths }\n a.href = URL.createObjectURL(new Blob([JSON.stringify(obj)], {type: \"text/plain; charset=utf-8\"}))\n a.setAttribute(\"download\", \"data.json\")\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n }", "onSaved() {\n if (this._saved) {\n this._saved.raise();\n }\n }", "function keyPressed() {\n if (key === 'S') {\n savePaintData();\n }\n if (key === 'L') {\n loadPaintData();\n }\n}", "save() {\n this.currentTabView.save();\n }", "function launchSave_options(e){\n\te = e || window.event;\n\n if (e.keyCode == '13') \n \tsave_options();\n}", "function saveDocumentAs() {\r\n\t\tif (checkLocalStorage()) {\r\n\t\t var saveName = prompt(\"Save file as...\");\r\n\t\t if (saveName) {\r\n\t\t\tvar str = myDiagram.model.toJson();\r\n\t\t\tlocalStorage.setItem(saveName, str);\r\n\t\t\tmyDiagram.isModified = false;\r\n\t\t\tvar listbox = document.getElementById(\"mySavedFiles\");\r\n\t\t\t// adds saved floor plan to listbox if it isn't there already \r\n\t\t\tvar exists = false;\r\n\t\t\tfor (var i = 0; i < listbox.options.length; i++) {\r\n\t\t\t if (listbox.options[i].value === saveName) {\r\n\t\t\t\texists = true;\r\n\t\t\t\tbreak;\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\tif (exists === false) {\r\n\t\t\t var option = document.createElement('option');\r\n\t\t\t option.value = saveName;\r\n\t\t\t option.text = saveName;\r\n\t\t\t listbox.add(option, null);\r\n\t\t\t}\r\n\t\t\tvar currentFile = document.getElementById(\"currentFile\");\r\n\t\t\tcurrentFile.innerHTML = saveName;\r\n\t\t }\r\n\t\t}\r\n\t }", "function openDocument() {\n if (checkLocalStorage()) {\n if (myDiagram.isModified) {\n var save = confirm(\"Would you like to save changes to \" + getCurrentFileName() + \"?\");\n if (save) {\n saveDocument();\n }\n }\n openElement(\"openDocument\", \"mySavedFiles\");\n }\n}", "function save_and_export() {\r\n\r\n}", "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n saveOutputOption();\r\n break;\r\n }\r\n}", "function userSavesHandler() {\n\tif (!filepath) {\n\t\tdialog.showSaveDialog(savePathChosenHandler);\n\t} else {\n\t\twriteToFile(filepath)\n\t}\n}", "function keyPressed() {\n if (key == 's' || key == 'S') {\n //saves canvas as an image - jpg or png\n // saveCanvas('image','png');\n saveCanvas(gd.timestamp(), 'png');\n }\n\n if (keyCode == DELETE || keyCode == BACKSPACE) {\n background(255);\n clear();\n initialPoint();\n }\n}", "function saveAction(state) {\n api.setSaveMenu(state);\n}", "function doClickSaveCurrentState() {\r\n\twarningMsg(\"This option only saves the state temporarily. To save your work, use File...Export...image+state(PNGJ). The image created can be dragged back into Jmol or JSmol or sent to a colleague to reproduce the current state exactly as it appears in the image.\");\r\n\trunJmolScriptWait('save ORIENTATION orask; save STATE stask; save BOND bask');\r\n}", "function setupCmdCtrlKeys() {\n document.onkeydown = function (e) {\n if (state.siteKey && (e.ctrlKey || e.metaKey) && e.keyCode === 83) {\n saveFile();\n return false;\n }\n };\n }", "function clickSaveButton() {\n\tif(this.innerHTML === savedButtText) {\n\t\tthis.innerHTML = notSavedButtText;\n\t} else {\n\t\tthis.innerHTML = savedButtText;\n\t}\n\n\tupdateAllSavedPCs();\n}", "function saveOrNotBeforeQuit (event, button) {\n switch (button) {\n case 'yes':\n case 'ok':\n app.on('workspace-save-all-finish', function () {\n app.quit();\n });\n app.emit('menu-save-all-files');\n break;\n case 'no':\n enforceQuit = true;\n app.quit();\n break;\n case 'cancel':\n break;\n default:\n // Do nothing\n break;\n }\n}", "function Save() {\n win.name = JSON.stringify(store);\n }", "function saveGame() {\n\n}", "function prompt_save_fn(filename) {\n\tschedule_path = location.pathname;\n\tschedule_path = schedule_path.slice(\n\t\t1,\n\t\t-path.basename(schedule_path).length\n\t) + \"save/\" + filename + \".json\";\n\n\tprompt_hide();\n\n\t// Make the directory.\n\tif (!fs.existsSync(\"save\"))\n\t\tfs.mkdirSync(\"save\");\n\n\t// Add the creation date stamp.\n\tschedule.created = new Date();\n\n\tfile_save();\n\tmessage_new(\n\t\t\"Schedule will now automatically save.<br>\" +\n\t\t\"Click to open folder.\",\n\t\t() => {\n\t\t\tshell.openItem(__dirname + \"\\\\save\");\n\n\t\t\treturn 1;\n\t\t},\n\t\t3\n\t);\n\n\t// Hide the save button.\n\timg.save.style.opacity = \"\";\n\timg.save.style.pointerEvents = \"\";\n}", "function save() {\n\tlet lastStrokeNumber = 0;\n\tlet actualStrokeNumber = 0;\n\treturn `\n\t${drawing.size.x}, ${drawing.size.y} |\n\t${drawing.history.map(function(h) {\n\t\tif(h.strokeNumber !== lastStrokeNumber){\n\t\t\tactualStrokeNumber++;\n\t\t\tlastStrokeNumber = h.strokeNumber;\n\t\t}\n\t\treturn `\n\t\t${h.coords.x}, ${h.coords.y},\n\t\t${h.color}, ${actualStrokeNumber}\n\t\t`\n\t}).join('|')}\n\t`.replace(/\\s+/g, '');\n}", "get saveButton() {\n return {\n command: \"save\",\n icon: \"save\",\n label: \"Save\",\n type: \"rich-text-editor-button\",\n };\n }", "function evEditorSave() {\n \tvar nn = Number($(\".nodeselected.nn\").text());\n \tconsole.log(\"nvEditorSave nn=\"+nn);\n \t\n \tvar module = findModule(nn) ;\n \tif (module == undefined) {\n \t\tconsole.log(\"findModule returned undefined\");\n \t\treturn;\n \t}\n \t\n \tvar enn = Number($(\".eventselected.enn\").text());\n \tvar en = Number($(\".eventselected.en\").text());\n \tvar event = findEvent(module, enn, en);\n \tvar create = false;\n \tif (event == undefined) {\n \t\tcreate = true;\n \t}\n\n \tvar i;\n \tconsole.log(\"nvEditorSave copying \"+module.evsperevent+\" values\");\n \tfor (i=1; i<= module.evsperevent; i++) {\n \t\tvar value = Number($(\"#ev\"+i).val());\n \t\tconsole.log(\"i=\"+i+\" value=\"+value);\n \t\tevent.evs[i] = value;\n \t}\n \t// generic editor just write them all\n \tevEditorWrite(nn);\n }", "function setSaveEvent(data){\n\t\tvar theID = '#save_' + data.doc.index;\n\t\tscroll_id = '#save_' + data.doc.index;\n\t\t$(theID).click(function(){\n\n\t\t\t$.each(jsonData.rows,function(i){\n\t\t\t\tif(jsonData.rows[i].doc.index == data.doc.index){\n\t\t\t\t\tconsole.log(\"we are SAVING \" + data.doc.index);\n\t\t\t\t\t// Update the video name to JSON database\n\t\t\t\t\tthis_video_name= document.getElementById(\"nameForSaving\").innerHTML + \"_\" + data.doc.index +\n\t\t\t\t\t\t\t\"_\" + data.doc._id + \".mp4\";\n\n\t\t\t\t\t$(\"#save-to-disk\").trigger('click');\n\t\t\t\t\tjsonData.rows[i].doc[\"video\"] = this_video_name;\n\t\t\t\t\tsendUpdateJSONRequest();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\t\tsendUpdateJSONRequest();\n\t});\n}", "async function saveDraftWithKeyboard() {\n\tawait page.waitForSelector( '.editor-post-save-draft' );\n\tawait Promise.all( [\n\t\tpage.waitForSelector( '.editor-post-saved-state.is-saved' ),\n\t\tpressKeyWithModifier( 'primary', 'S' ),\n\t] );\n}", "function saveTrack(){\r\n\tif (document.getElementById(\"edit-track-action\").selectedItem.value == \"c\") {\r\n\t\twindow.arguments[1].action=\"c\";\r\n\t}\r\n\telse if (document.getElementById(\"edit-track-action\").selectedItem.value == \"e\") {\r\n\t\twindow.arguments[1].action=\"e\";\r\n\t}\r\n\telse if (document.getElementById(\"edit-track-action\").selectedItem.value == \"n\") {\r\n\t\twindow.arguments[1].action=\"n\";\r\n\t\twindow.arguments[1].step = document.getElementById(\"outer-select-step\").selectedItem.label\r\n\t\twindow.arguments[1].stepNum = parseInt(document.getElementById(\"outer-select-step\").selectedItem.value);\r\n\t}\r\n\treturn true;\r\n}", "saveDocument(window, getSavePath) {\n this.getDocumentContents(window, (data) => {\n const contents = JSON.stringify(data);\n const document = this.getDocumentByWindow(window);\n\n const saveFile = (fileName, contents) => {\n fs.writeFile(fileName, contents, (err) => {\n if (err) {\n alert(err.message);\n }\n\n this.setWindowEditStatus(window, false);\n });\n };\n\n if (document.fileName && fs.existsSync(document.fileName)) {\n saveFile(document.fileName, contents);\n } else {\n getSavePath(window, (fileName) => {\n // TODO: Check if fileName exists -- when clicking cancel on save dialog it is undefined\n const basename = path.basename(fileName);\n saveFile(fileName, contents);\n this.setWindowFilename(window, fileName);\n window.setRepresentedFilename(basename);\n window.setTitle(basename);\n });\n }\n });\n }", "function save(){\n\tsaveScript(document.getElementById(\"scripts\").selectedIndex);\n}", "function doSave(oExactBrowser, bSkip) {\n\t\toExactBrowser._saveDialog.close();\n\t\tif(!bSkip){\n\t\t\talert(\"Save: \"+oExactBrowser._saveTextField.getValue());\n\t\t}\n\t}", "function onSave( editor )\r\n\t{\r\n\t\t// Don't fire auto save.\r\n\t\tautosaveWorking = true;\r\n\t\t// don't fire beforeunload.\r\n\t\teditor.config.autosaveUseOnBeforeUnload = false;\r\n\t\t// cleanup.\r\n\t\twindow.clearInterval( autosaveInterval );\r\n\t\twindow.clearTimeout( autosaveTimeoutDefaultDirtyIcon );\r\n\t\twindow.clearTimeout( autosaveTimeoutBetweenRequests );\r\n\t\treturn true;\r\n\t}", "function saveAndPreview(){ \n\t\tvar view = tabsFrame.newView;\n\t\t//if (pattern.match(/highlight-thematic/gi) && prefix != 'drill' && view.tableGroups.tables[0].table_name != 'zone'){\n\t\tif (pattern.match(/highlight-thematic/gi)){\n\t\t\tvar drill2 = $('drill2Std').innerHTML;\n\t\t\tvar data = $('dataStd').innerHTML;\n\t\t\tvar requiredMsg = getMessage('required');\n\t\t\tif((drill2 == requiredMsg || data == requiredMsg) && view.tableGroups[0].tables[0].table_name != 'zone'){\n\t\t\t\talert(getMessage('noStandards'));\n\t\t\t} \n\t\t}\n\t\t\t\t\n if ((pattern.match(/paginated-parent/gi) && validateParameterRestrictions(view) == false) || !removeVirtualFields(view)){\n } else if(hasMeasuresInSummarizeBySortOrder() == false){\n \talert(getMessage('noStatistics')); \n } else {\n \ttabsFrame.selectTab('page5');\n \t}\n}", "function saveOnEnter(e) {\n codeReporter(\"saveOnEnter()\");\n e.preventDefault();\n var box = ($(e.target).attr('id') ? $(e.target) : $(e.target).parent());\n // Grab the current value of the textarea.\n var new_text = box.find(\"textarea\").val();\n // Empty the current contents of the box.\n box.empty();\n // Write the new text to the box.\n box.css(\"background-color\", \"white\");\n box.text(new_text);\n flash_saved(box);\n}", "function loadSaveView() {\n // Set the status bar\n setStatusBar('save');\n\n // Fill the title\n document.getElementById('title').innerHTML = localization['Save']['Title'];\n\n // Fill the content area\n document.getElementById('content').innerHTML = `\n <p>${localization['Save']['Description']}</p>\n <img class=\"image\" src=\"images/bridge_paired.png\" alt=\"${localization['Save']['Title']}\">\n <div class=\"button\" id=\"close\">${localization['Save']['Save']}</div>\n `;\n\n // Add event listener\n document.getElementById('close').addEventListener('click', close);\n document.addEventListener('enterPressed', close);\n\n // Save the bridge\n window.opener.document.dispatchEvent(new CustomEvent('saveBridge', {\n detail: {\n ip: bridge.getIP(),\n id: bridge.getID(),\n username: bridge.getUsername(),\n }\n }));\n\n // Close this window\n function close() {\n window.close();\n }\n}", "function openSaveDiagramModal() {\n const name = document.getElementById('diagram-title-name').innerText;\n if (![\"undefined\", \"null\", \"untitled\"].includes(String(name).toLowerCase())){\n document.getElementById('saveName').value = name;\n }\n document.getElementById(\"saveDiagramModal\").style.display = \"flex\";\n}", "function savedOnClick(ev)\n{\n\tsearchInfoFrame.clear();\n\tlet savedStopPoints = storage.getStopPoints();\n\tgenerateSavedStopPointTable(savedStopPoints, false);\n\tresetSearchFrame();\n\tresetArrivalsFrame();\n\tresetStopPointFrame();\n}", "save(saveCode) {\n if (saveCode === Constants.SaveCodes.NOSAVE) {\n this.client.disconnect();\n process.exit(Constants.SaveCodes.NOSAVE);\n }\n\n Skarm.saveLog(\"\\n\\nBeginning save sequence...\");\n\n\n Guilds.save();\n Users.save();\n this.comics.save();\n\n Skarm.saveLog(\"Beginning push to cloud storage...\");\n\n let savior = spawn('powershell.exe', [Constants.skarmRootPath + 'saveData.ps1']);\n savior.stdout.on(\"data\", (data) => {\n data = data.toString().replaceAll(\"\\r\",\"\").replaceAll(\"\\n\",\"\");\n if(data.length > 1)\n Skarm.saveLog(data);\n });\n savior.stderr.on(\"data\", (data) => {\n data = data.toString().replaceAll(\"\\r\",\"\").replaceAll(\"\\n\",\"\");\n if(data.length > 1)\n Skarm.saveLog(data);\n });\n savior.on('exit', (code) => {\n console.log(\"Received code: \" + code + \" on saving data.\");\n if (saveCode === Constants.SaveCodes.DONOTHING)\n return;\n if (saveCode === undefined)\n return;\n setTimeout(() => {\n this.client.disconnect();\n process.exit(saveCode);\n }, 2000);\n });\n\n }", "function save() {\n // document.getElementById(\"canvasimg\").style.border = \"2px solid\";\n // const savedImage = canvas.toDataURL();\n // document.getElementById(\"canvasimg\").src = savedImage;\n\n // document.getElementById(\"canvasimg\").style.display = \"inline\"; \n //--- this is prob the line of code that saves it next to the current\n }", "function doSave() {\n try {\n var savedSelection = saveSelection(document\n .getElementsByTagName('body')[0]);\n if (!savedSelection) {\n return;\n }\n savedSelection.color = currentColor;\n return savedSelection;\n } catch (e) {\n window.TextSelection.jsError(\"doSave\\n\" + e);\n }\n\n}", "function Main()\n{\n initial_save=0;\n Savecheck();\n\n if (initial_save == 0)\n {\n \n Graphic1();\n Getstats();\n \n }\n\n if (initial_save == 1)\n {\n \n Graphic2();\n Load();\n Map();\n Hud();\n Commands();\n \n }\n \n}", "saveDialog() {\n content = JSON.stringify(datastore.getDevices());\n dialog.showSaveDialog({ filters: [\n { name: 'TellSec-Dokument', extensions: ['tell'] }\n ]},(fileName) => {\n if (fileName === undefined) {\n console.log(\"Du hast die Datei nicht gespeichert\");\n return;\n }\n fileName = fileName.split('.tell')[0] \n fs.writeFile(fileName+\".tell\", content, (err) => {\n if (err) {\n alert(\"Ein Fehler tritt während der Erstellung der Datei auf \" + err.message)\n }\n alert(\"Die Datei wurde erfolgreich gespeichert\");\n });\n });\n }", "function keyTyped() {\n if (key === 's') {\n console.log(\"saving file\");\n\n // name the file with the current date and time\n //save(year() + \"-\" + month() + \"-\" + day() + \"_\" + hour() + \"-\" + minute() + \"-\" + second());\n\n save(\"image.jpg\");\n }\n}", "function openSaveAs() {\n var ediv = $(\"#edit-widget-content\").get(0);\n if ($.data(ediv, \"assetid\")) {\n saveAssetContent(null,null);\n } else {\n if (contentEditCriteria.producesResource) {\n $.perc_browser({on_save:onSave, initial_val:\"\"});\n } else {\n saveAssetContent(contentEditCriteria.contentName,null);\n }\n }\n }", "function saveConfirm(nextCommand) {\n let confirm = true;\n if (app.CommandManager.Get().sceneChanged) {\n const {dialog} = require('electron').remote;\n\n let result = dialog.showMessageBox({\n type:\"warning\",\n title:\"Save changes\",\n message:\"The scene has changed, ¿do you want to save it before continue?\",\n buttons:[\"Yes\",\"No\",\"Cancel\"]\n });\n\n if (result==0) {\n setTimeout(() => {\n app.CommandHandler.Trigger('saveScene',{ followingCommand:nextCommand });\n },10);\n return false;\n }\n else if (result==2) {\n return false;\n }\n }\n return true;\n }", "handleSaveAsSceneSettingsClick() {\n UIStore.get().stateTree.sceneModal.isOpen = true;\n }", "function keyPressed(){\n saveJSON(json, 'downwarddog' + '_data.json');\n // if(keyCode === 97){\n // label = 'Downward Dog';\n // }\n // if(keyCode === 98){\n // label = 'Mountain';\n // }\n // if(keyCode === 99){\n // label = 'Tree';\n // }\n // if(keyCode === 100){\n // label = 'Goddess';\n // }\n // if(keyCode === 101){\n // label = 'Warrior2'\n // }\n // if(keyCode === 83){\n // brain.saveData();\n // }\n // console.log(label);\n}", "function saveCanvas() {\n // Generate SVG.\n var save_button = $('#save');\n var save_svg = $('#canvas').innerHTML.replace('<svg', '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n var data_uri = 'data:image/svg+xml;base64,' + window.btoa(save_svg);\n var filename = 'bustashape-' + window.location.hash.replace('#', '') + '-' + Date.now() + '.svg';\n\n // Prep link for new download.\n save_button.setAttribute('href', data_uri);\n save_button.setAttribute('download', filename);\n}" ]
[ "0.7099783", "0.6916381", "0.69039446", "0.6789661", "0.67653114", "0.6692602", "0.65565056", "0.64719975", "0.64695704", "0.64639384", "0.6453733", "0.64110696", "0.639087", "0.6349562", "0.62926996", "0.62871623", "0.62530655", "0.6214551", "0.6206543", "0.6194648", "0.6171237", "0.61667454", "0.61463165", "0.6120342", "0.61107314", "0.6106231", "0.6097261", "0.60859776", "0.6083714", "0.6081949", "0.60765946", "0.6073613", "0.6073613", "0.60646933", "0.6061417", "0.6061417", "0.60603154", "0.6052318", "0.6047568", "0.60410637", "0.6038961", "0.6004388", "0.59980524", "0.5996096", "0.5977152", "0.5974413", "0.5947516", "0.5938147", "0.59351027", "0.5928446", "0.5915601", "0.5910995", "0.59092236", "0.58710724", "0.5870269", "0.58483744", "0.5838442", "0.58381855", "0.58250946", "0.5818546", "0.58168525", "0.58138996", "0.5803629", "0.578842", "0.5781149", "0.5780172", "0.5776814", "0.5766035", "0.5760543", "0.57469726", "0.57442325", "0.5715872", "0.5698533", "0.5692303", "0.56877434", "0.5686716", "0.56802386", "0.566759", "0.5659135", "0.565313", "0.56490576", "0.5635577", "0.5631162", "0.5630784", "0.56306326", "0.5626841", "0.5624667", "0.56214046", "0.5587176", "0.5587171", "0.5578597", "0.55785096", "0.55638885", "0.5556068", "0.55461144", "0.5545854", "0.5527529", "0.5523023", "0.5510998", "0.55023146" ]
0.63150704
14
Print current diagram Print can be triggered in 3 cases only after diagram was saved: 1 from menu 2 from quick toolbar 3 from Ctrl + P shortcut Copy link to saved diagram's png file to src of image, add it to iframe and call print of last.
function print_diagram() { var printFrameId = "printFrame"; var iframe = document.getElementById(printFrameId); // if iframe isn't created if (iframe == null) { iframe = document.createElement("IFRAME"); iframe.id = printFrameId; document.body.appendChild(iframe); } // get DOM of iframe var frameDoc = iframe.contentDocument; var diagramImages = frameDoc.getElementsByTagName('img'); var diagramImage; if (diagramImages.length > 0) { // if image is already added diagramImage = diagramImages[0]; // set source of image to png of saved diagram diagramImage.setAttribute('src', "data/diagrams/" + currentDiagramId + ".png"); } else { // if image isn't created yet diagramImage = frameDoc.createElement('img'); // set source of image to png of saved diagram diagramImage.setAttribute('src', "data/diagrams/" + currentDiagramId + ".png"); if (frameDoc.body !== null) { frameDoc.body.appendChild(diagramImage); } else { // IE case for more details // @see http://stackoverflow.com/questions/8298320/correct-access-of-dynamic-iframe-in-ie // create body of iframe frameDoc.src = "javascript:'<body></body>'"; // append image through html of <img> frameDoc.write(diagramImage.outerHTML); frameDoc.close(); } } // adjust iframe size to main canvas (as it might have been changed) iframe.setAttribute('width', canvasProps.getWidth()); iframe.setAttribute('height', canvasProps.getHeight()); // print iframe iframe.contentWindow.print(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printDiagram() {\n var svgWindow = window.open();\n if (!svgWindow) return; // failure to open a new Window\n var printSize = new go.Size(1700, 2960);\n var bnds = myDiagram.documentBounds;\n var svg = myDiagram.makeSvg({ scale: 1.0, position: new go.Point(0, 0), size: bnds });\n svgWindow.document.body.appendChild(svg);\n}", "_print() {\n const printWindow = window.open('about:blank', '_new');\n printWindow.document.open();\n printWindow.document.write(`\n <html>\n <head>\n <script>\n function onloadImage() {\n setTimeout('printImage()', 10);\n }\n function printImage() {\n window.print();\n window.close();\n }\n </script>\n </head>\n <body onload='onloadImage()'>\n <img src=\"${this.attachmentViewer.attachment.defaultSource}\" alt=\"\"/>\n </body>\n </html>`);\n printWindow.document.close();\n }", "function print_custom() {\n if (getNama_custom()) {\n nama = getNama_custom();\n //bersihkan canvas sebelum print\n canvas_custom.discardActiveObject(canvas_custom.getActiveObject());\n canvas_custom.requestRenderAll();\n //timeout menuggu canvas dibersihkan\n setTimeout(function () {\n //printing\n $(\"#c-custom\")\n .get(0)\n .toBlob(function (blob) {\n saveAs(blob, nama);\n },'image/jpeg', 0.99 ); //{JPEG at 99% quality}. Untuk mengganti ekstensi file tinggal ganti aja jpeg ke png atau ke yang lainnya\n }, 1000);\n }\n}", "function page_print() {\n\twoas._customized_popup(current, woas.getHTMLDiv(d$(\"woas_wiki_area\")),\n\t\t\t'function go_to(page) { alert(\"'+woas.js_encode(woas.i18n.PRINT_MODE_WARN)+'\");}');\n}", "function printBarCodeA4Sheet(obj) {\r\n\r\n var DocumentContainer = document.getElementById(obj);\r\n var html = '<html><head><title>Online Munim - Print Page www.OnlineMunim.com www.omunim.com</title>' +\r\n '<link href=\"css/index.css\" rel=\"stylesheet\" type=\"text/css\" />' +\r\n '<link href=\"css/ogcss.css\" rel=\"stylesheet\" type=\"text/css\" />' +\r\n '<link href=\"css/orcss.css\" rel=\"stylesheet\" type=\"text/css\" />' +\r\n '<script type=\"text/javascript\" src=\"scripts/emNavigation.js\"></script>' +\r\n '<script type=\"text/javascript\" src=\"scripts/ogNavFunctions.js\"></script>' +\r\n '</head><body>' +\r\n DocumentContainer.innerHTML +\r\n '<br />' +\r\n '<a style=\"cursor: pointer;\" onClick=\"window.print();\" class=\"noPrint\"><img src=\"images/printer32.png\" alt=\"Print\" title=\"Print\" width=\"32px\" height=\"32px\" /></a>' +\r\n '<br />' +\r\n '<br />' +\r\n '</body></html>';\r\n var WindowObject = window.open(\"\", \"PrintWindow\", \"width=1000,height=1000,top=120,left=120,toolbars=no,scrollbars=yes,status=no,resizable=yes\");\r\n WindowObject.document.open();\r\n WindowObject.document.writeln(html);\r\n WindowObject.document.close();\r\n WindowObject.focus();\r\n}", "function MostrarDialogoImprimir() {\n window.print();\n}", "function saveAs() {\n var dataURL = renderedCanvas();\n\n// var $diagram = {c:canvas.save(), s:STACK, m:CONNECTOR_MANAGER};\n var $diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n var $serializedDiagram = JSON.stringify($diagram);\n// $serializedDiagram = JSON.stringify($diagram, Util.operaReplacer);\n var svgDiagram = toSVG();\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //alert($serializedDiagram);\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\", {action: 'saveAs', diagram: $serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram},\n function(data) {\n if (data == 'noaccount') {\n Log.info('You must have an account to use that feature');\n //window.location = '../register.php';\n }\n else if (data == 'step1Ok') {\n Log.info('Save as...');\n window.location = './saveDiagram.php';\n }\n }\n );\n}", "function print() {\n if (getNama()) {\n nama = getNama();\n //bersihkan canvas sebelum print\n canvas.discardActiveObject(canvas.getActiveObject());\n canvas.requestRenderAll();\n //timeout menuggu canvas dibersihkan\n setTimeout(function () {\n //printing\n $(\"#c\")\n .get(0)\n .toBlob(function (blob) {\n saveAs(blob, nama);\n }, 'image/png', 0.99 ); //{PNG at 99% quality}, yang berarti 99%}Untuk mengganti ekstensi file tinggal ganti aja jpeg ke png atau ke yang lainnya\n }, 1000);\n }\n}", "function print_() {\n\tgetRef();\n\tif( action_ == 0 ) {\n\t\talert( MSG_NOTPRINT_ );\n\t\treturn;\t\n\t}\n\turl = document.location.href+\"&print=1\";\n\tvar atrib = \"toolbar=no,location=no,directories=no,status=no,\" +\n\t\t\t\t\"menubar=no,scrollbars=no,resizable=no\";\n\twindow.open( url, \"print\", atrib );\n\n}", "function print(id,name) { \t\r\n\tvar value=parent.document.getElementById(id).src;\r\n\t//var ObjectPrint=window.open();\r\n\tif(value != '' ){\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t \t\t\t \r\n\t\twindow.frames[name].window.focus();\r\n\t\twindow.frames[name].window.print();\r\n\t}\r\n}", "function save() {\n\n //alert(\"save triggered! diagramId = \" + diagramId );\n Log.info('Save pressed');\n\n if (state == STATE_TEXT_EDITING) {\n currentTextEditor.destroy();\n currentTextEditor = null;\n state = STATE_NONE;\n }\n\n var dataURL = null;\n try {\n dataURL = renderedCanvas();\n }\n catch (e) {\n if (e.name === 'SecurityError' && e.code === 18) {\n /*This is usually happening as we load an image from another host than the one Diagramo is hosted*/\n alert(\"A figure contains an image loaded from another host. \\\n \\n\\nHint: \\\n \\nPlease make sure that the browser's URL (current location) is the same as the one saved in the DB.\");\n }\n }\n\n// Log.info(dataURL);\n// return false;\n if (dataURL == null) {\n Log.info('save(). Could not save. dataURL is null');\n alert(\"Could not save. \\\n \\n\\nHint: \\\n \\nCanvas's toDataURL() did not functioned properly \");\n return;\n }\n\n var diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n //Log.info('stringify ...');\n// var serializedDiagram = JSON.stringify(diagram, Util.operaReplacer);\n var serializedDiagram = JSON.stringify(diagram);\n// Log.error(\"Using Util.operaReplacer() somehow break the serialization. o[1,2] \\n\\\n// is transformed into o.['1','2']... so the serialization is broken\");\n// var serializedDiagram = JSON.stringify(diagram);\n //Log.info('JSON stringify : ' + serializedDiagram);\n\n var svgDiagram = toSVG();\n\n// alert(serializedDiagram);\n// alert(svgDiagram);\n //Log.info('SVG : ' + svgDiagram);\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\",\n {action: 'save', diagram: serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram, diagramId: currentDiagramId},\n function(data) {\n if (data === 'firstSave') {\n Log.info('firstSave!');\n window.location = './saveDiagram.php';\n }\n else if (data === 'saved') {\n //Log.info('saved!');\n alert('saved!');\n }\n else {\n alert('Unknown: ' + data);\n }\n }\n );\n\n\n}", "function printWithCanvas(){\n document.querySelector(\".button_container\").classList.add(\"hide\");\n html2canvas(document.querySelector(\"body\")).then(canvas => {\n printJS({printable: canvas.toDataURL(), type: 'image'});\n document.querySelector(\".button_container\").classList.remove(\"hide\");\n });\n}", "function downloadPNG(){\r\n\tcrackPoint.remove();\r\n\tpaper.view.update();\r\n var canvas = document.getElementById(\"paperCanvas\");\r\n var downloadLink = document.createElement(\"a\");\r\n downloadLink.href = canvas.toDataURL(\"image/png;base64\");\r\n downloadLink.download = simText+'.png';\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n document.body.removeChild(downloadLink);\r\n\tcrackPoint.insertAbove(concreteObjects[concreteObjects.length-1]);\r\n}", "function PrintSeccion() {\n document.getElementsByClassName(\"Print-Seccion\")[0].id = \"Print-chart-seccion\"\n if ($(\"#WebChart\").is(\":visible\")) {\n var chart = document.getElementById(\"WebChart\").getElementsByTagName(\"img\")[0].cloneNode(true)\n } else {\n var chart = document.getElementById(\"WebChart1\").getElementsByTagName(\"img\")[0].cloneNode(true)\n }\n var center = document.createElement(\"center\")\n center.setAttribute(\"id\", \"centerDiv\")\n center.appendChild(chart)\n document.getElementsByClassName(\"Print-Seccion\")[0].appendChild(center)\n chart.style.zIndex = \"10000\"\n $(\"#contenedor-print\").hide()\n $(\"#cssmenu\").hide()\n $(\"header\").hide()\n window.print()\n $(\"#centerDiv\").remove()\n document.getElementsByClassName(\"Print-Seccion\")[0].removeAttribute(\"id\")\n $(\"#contenedor-print\").show()\n $(\"#cssmenu\").show()\n $(\"header\").show()\n}", "function saveAndPreview(){ \n\t\tvar view = tabsFrame.newView;\n\t\t//if (pattern.match(/highlight-thematic/gi) && prefix != 'drill' && view.tableGroups.tables[0].table_name != 'zone'){\n\t\tif (pattern.match(/highlight-thematic/gi)){\n\t\t\tvar drill2 = $('drill2Std').innerHTML;\n\t\t\tvar data = $('dataStd').innerHTML;\n\t\t\tvar requiredMsg = getMessage('required');\n\t\t\tif((drill2 == requiredMsg || data == requiredMsg) && view.tableGroups[0].tables[0].table_name != 'zone'){\n\t\t\t\talert(getMessage('noStandards'));\n\t\t\t} \n\t\t}\n\t\t\t\t\n if ((pattern.match(/paginated-parent/gi) && validateParameterRestrictions(view) == false) || !removeVirtualFields(view)){\n } else if(hasMeasuresInSummarizeBySortOrder() == false){\n \talert(getMessage('noStatistics')); \n } else {\n \ttabsFrame.selectTab('page5');\n \t}\n}", "function printShow() {\n\t$('.view-print').on('click', function (e) {\n\t\te.preventDefault();\n\t\twindow.print();\n\t})\n}", "function printShow() {\n\t$('.view-print').on('click', function (e) {\n\t\te.preventDefault();\n\t\twindow.print();\n\t})\n}", "function print_multi() {\n if (getNama_multi()) {\n nama = getNama_multi();\n //bersihkan canvas sebelum print\n canvas_multi.discardActiveObject(canvas_multi.getActiveObject());\n canvas_multi.requestRenderAll();\n //timeout menuggu canvas dibersihkan\n setTimeout(function () {\n //printing\n $(\"#c-multi\")\n .get(0)\n .toBlob(function (blob) {\n saveAs(blob, nama);\n },'image/png', 0.99 ); //{PNG at 99% quality}. Untuk mengganti ekstensi file tinggal ganti aja jpeg ke png atau ke yang lainnya\n }, 1000);\n }\n}", "function triggerPrintDialog() {\n window.print();\n }", "handlePrint() {\n window.print();\n }", "function printSpecial() {\n if (document.getElementById != null) {\n\n var html = '<HTML>\\n<HEAD>\\n <link rel=\"stylesheet\" href=\"<%=SiteDesign.CssFolder %>print.css\" type=\"text/css\" />';\n\n html += '\\n</HE>\\n<BODY >\\n';\n\n var printReadyElem = document.getElementById(\"printReady\");\n\n if (printReadyElem != null) {\n\n\n\n html += \"<table class='printholder' border='0' cellpadding='0' cellspacing='0' align=center>\"\n html += \"<tr><td class='printheader'></td></tr>\"\n html += \"<tr><td class='printbody'>\"\n\t html += printReadyElem.innerHTML;\n\t html += \"</td></tr>\"\n\t html += \"<tr><td class='printfooter'></td></tr>\"\n\t html += \"</table>\"\n\n\n\t}\n\telse {\n\t alert(\"Could not find the printReady function\");\n\t return;\n\t}\n\n\thtml += '\\n</BO>\\n</HT>';\n\n\tvar printWin = window.open(\"\", \"printSpecial\");\n\tprintWin.document.open();\n\tprintWin.document.write(html);\n\tprintWin.document.close();\n\tif (gAutoPrint)\n\t printWin.print();\n}\nelse {\n alert(\"The print ready feature is only available if you are using an browser. Please update your browswer.\");\n}\n}", "function printSchedule() {\n var win=window.open();\n win.document.write(\"<head><title>My Class Schedule</title>\");\n win.document.write(\"<style> img { border: 2.5px solid gray; } h1 { font-family: 'Arial'; }</style></head>\");\n win.document.write(\"<body><h1 style='text-align: center; width: 1080;'>\"+_schedule+\"</h1>\");\n win.document.write(\"<img src='\"+_canvas.toDataURL()+\"'></body>\");\n win.print();\n win.close();\n }", "function quickprintLogic()\n{\n // If the Print Remote button exists, remove it and adjust the Save As dialog to say Quick Print.\n if ($(\"#reportPrint\").length)\n {\n $(\"#reportPrint\").remove();\n $(\"#reportSaveAs\").text(\"Quickprint\");\n }\n\n // Create new functionality for the big Download button.\n if ($(\"#fileDownloadBtn\").length)\n {\n // Exists solely to communicate with the Autoregform.js script.\n // Intended to prevent this script from executing if the regform data\n // was sent over from Student Planner.\n var regformDataAvailable = $(\"#report-browser-pre-text\").attr(\"regform\");\n if (typeof regformDataAvailable === \"undefined\")\n {\n var url = $(\"#fileDownloadBtn\").attr(\"href\");\n\n // Only make a new button if we're in the 'Save As' dialog.\n if (!hasFileExt(url))\n {\n var adjustedBtn = $cloneBtn($(\"#fileDownloadBtn\"))\n .attr(\"id\", \"quickprint\")\n .attr(\"type\", \"button\");\n $(adjustedBtn).text(\"Quickprint\");\n $(\"#fileDownloadBtn\").replaceWith(adjustedBtn);\n adjustedBtn.on(\"click\", function () {\n quickPrint(url);\n });\n\n // PRINT IMMEDIATELY!!! The button solely exists as a failsafe.\n quickPrint(url);\n }\n }\n }\n\n // Remove the data window(s) when we're done.\n if ($(\"#btn_close_report_browser\").length)\n {\n $(\"#btn_close_report_browser\").on(\"click\", function () {\n cleanUp();\n });\n }\n}", "function printCurrentPage() {\n window.print();\n}", "function print(){\n window.print();\n }", "function imprimir(){\n window.print();\n}", "function save(e) {\n render();\n let url = canvas.toDataURL();\n let image = new Image();\n image.src = url;\n let w = window.open();\n let a = document.createElement(\"a\");\n a.href = url;\n a.download = \"graph\";\n a.textContent = \"Download\";\n a.id = \"download\";\n setTimeout(function(){\n w.document.write(\"<title>Saved Image</title>\")\n w.document.write(image.outerHTML);\n w.document.write(a.outerHTML);\n w.document.write(`\n <style>\n body {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n }\n img {\n margin: 1em;\n }\n #download {\n border-radius: .25em;\n padding: .5em;\n color: black; /*rgb(80, 235, 126)*/\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Noto Sans, sans-serif;\n background: white;\n box-shadow: 2px 2px 5px 0 #0004;\n height: min-content;\n width: min-content;\n display: block;\n text-decoration: none;\n }\n #download:hover {\n box-shadow: 1px 1px 3px 0 #0004;\n }\n </style>\n `);\n }, 0);\n }", "function print_current_page()\n{\nwindow.print();\n}", "function save() {\n // document.getElementById(\"canvasimg\").style.border = \"2px solid\";\n // const savedImage = canvas.toDataURL();\n // document.getElementById(\"canvasimg\").src = savedImage;\n\n // document.getElementById(\"canvasimg\").style.display = \"inline\"; \n //--- this is prob the line of code that saves it next to the current\n }", "handlePrint() {\n const { cms } = this.props;\n const label = cms && cms.commonLabels && cms.commonLabels.printLabel ? cms.commonLabels.printLabel : 'print';\n\n this.pushAnalytics(label);\n window.print();\n }", "function NavPrintPdf(/**string*/ baseName, /**string*/ number)\r\n{\r\n\tSeS('G_PrintMenu').DoClick();\r\n\tSeS('G_PDFMenuItem').DoClick();\r\n\tSeS('G_SavePrintedDocument').DoClick();\r\n\tvar outputFolder = Global.GetFullPath(\"OutputFiles\");\r\n\tvar filePath = NavMakeFileName(outputFolder, baseName, number, \"pdf\");\r\n\tTester.Message(\"Printing file: \" + filePath);\r\n\tSeS('G_SaveDialogFileName').DoSendKeys(filePath);\r\n\tSeS('G_SaveDialogSaveButton').DoClick();\r\n}", "function PrintElem(elem) {\n\n var mywindow = window.open('', 'PRINT', 'height=400,width=600');\n\n mywindow.document.write('<html><head><title>Menu</title>');\n mywindow.document.write('<style>tr {border-bottom:1px #808080 solid}</style>');\n mywindow.document.write('<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js\"></script>');\n mywindow.document.write('<link rel=\"stylesheet\" href=\"css/menu.css\">');\n mywindow.document.write('</head><body >');\n mywindow.document.write('<h1>' + document.title + '</h1>');\n mywindow.document.write(document.getElementById(elem).innerHTML);\n mywindow.document.write('</body></html>');\n\n mywindow.document.close(); // necessary for IE >= 10\n mywindow.focus(); // necessary for IE >= 10*/\n\n mywindow.print();\n mywindow.close();\n download(elem);\n\n return true;\n}", "function duplicateToPrintArtboard(printColumns) {\r\n\r\n // move online artboard elements to print artboard\r\n var printArtboardBounds = getArtboardBounds(printArtboard)\r\n var xTranslation = printArtboardBounds.left - artboardBounds.left;\r\n var yTranslation = printArtboardBounds.top - artboardBounds.top;\r\n app.activeDocument.selectObjectsOnActiveArtboard();\r\n for (var i = selection.length - 1; i >= 0; i--) {\r\n var duplicatedItem = selection[i].duplicate(printGraphicGroup); \r\n duplicatedItem.selected = false;\r\n duplicatedItem.translate(xTranslation, yTranslation, true, true, true, true)\r\n };\r\n \r\n\r\n // set print artboard's width\r\n var targetPrintWidth = columnMmWidths[printColumns - 1] * mmInPixel; \r\n printArtboardBounds.width = targetPrintWidth; \r\n \r\n \r\n // scale layer group to fit inside print artboard\r\n var scaleFactor = targetPrintWidth / artboardBounds.width;\r\n printGraphicGroup.resize(scaleFactor * 100, scaleFactor * 100, true, true, true, true, true, Transformation.DOCUMENTORIGIN);\r\n\r\n\r\n // adapt source text frame alignment and rectangle widths according to new width\r\n authorTextFrame.left = targetPrintWidth - authorTextFrame.width;\r\n for (var i=0, len=printHeaderGroup.pathItems.length; i < len; i++) {\r\n printHeaderGroup.pathItems[i].width = targetPrintWidth;\r\n };\r\n for (var i=0, len=printFooterGroup.pathItems.length; i < len; i++) {\r\n printFooterGroup.pathItems[i].width = targetPrintWidth;\r\n };\r\n\r\n\r\n // set height for print artboard and place graphic's and footer's vertical position\r\n printGraphicGroup.top -= printHeaderGroup.height;\r\n var numBaselines = Math.ceil((artboardBounds.height * scaleFactor) / baselineHeight);\r\n printArtboardBounds.height = printHeaderGroup.height + (numBaselines * baselineHeight) + printFooterGroup.height;\r\n printFooterGroup.top = (printHeaderGroup.height + (numBaselines * baselineHeight)) * -1;\r\n setArtboardBounds(printArtboard, printArtboardBounds); \r\n\r\n // deselect duplicated group and artboard\r\n printGraphicGroup.selected = false;\r\n printArtboard.selected = false;\r\n\r\n}", "function printFormNew() {\n printBackForm();\n printNewForm();\n printBtnCancelForm();\n printFormularioNew();\n}", "function reportPrint()\r\n{\r\n window.focus();\r\n\twindow.print();\r\n}", "function printPageLabOpen(lab) {\n if ( $.cookie(\"topo\") == undefined ) $.cookie(\"topo\", 'light');\n var html = '<div id=\"lab-sidebar\"><ul></ul></div><div id=\"lab-viewport\" data-path=\"' + lab + '\"></div>';\n $('#body').html(html);\n // Print topology\n $.when(printLabTopology(),getPictures()).done( function (rc,pic) {\n if ((ROLE == 'admin' || ROLE == 'editor') && LOCK == 0 ) {\n $('#lab-sidebar ul').append('<li class=\"action-labobjectadd-li\"><a class=\"action-labobjectadd\" href=\"javascript:void(0)\" title=\"' + MESSAGES[56] + '\"><i class=\"glyphicon glyphicon-plus\"></i></a></li>');\n }\n $('#lab-sidebar ul').append('<li class=\"action-nodesget-li\"><a class=\"action-nodesget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[62] + '\"><i class=\"glyphicon glyphicon-hdd\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-networksget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[61] + '\"><i class=\"glyphicon glyphicon-transfer\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-configsget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[58] + '\"><i class=\"glyphicon glyphicon-align-left\"></i></a></li>');\n $('#lab-sidebar ul').append('<li class=\"action-picturesget-li\"><a class=\"action-picturesget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[59] + '\"><i class=\"glyphicon glyphicon-picture\"></i></a></li>');\n if ( Object.keys(pic) < 1 ) {\n $('.action-picturesget-li').addClass('hidden');\n }\n\n $('#lab-sidebar ul').append('<li><a class=\"action-textobjectsget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[150] + '\"><i class=\"glyphicon glyphicon-text-background\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-moreactions\" href=\"javascript:void(0)\" title=\"' + MESSAGES[125] + '\"><i class=\"glyphicon glyphicon-th\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-labtopologyrefresh\" href=\"javascript:void(0)\" title=\"' + MESSAGES[57] + '\"><i class=\"glyphicon glyphicon-refresh\"></i></a></li>');\n $('#lab-sidebar ul').append('<li class=\"plus-minus-slider\"><i class=\"fa fa-minus\"></i><div class=\"col-md-2 glyphicon glyphicon-zoom-in sidemenu-zoom\"></div><div id=\"zoomslide\" class=\"col-md-5\"></div><div class=\"col-md-5\"></div><i class=\"fa fa-plus\"></i><br></li>');\n $('#zoomslide').slider({value:100,min:10,max:200,step:10,slide:zoomlab});\n //$('#lab-sidebar ul').append('<li><a class=\"action-freeselect\" href=\"javascript:void(0)\" title=\"' + MESSAGES[151] + '\"><i class=\"glyphicon glyphicon-check\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-status\" href=\"javascript:void(0)\" title=\"' + MESSAGES[13] + '\"><i class=\"glyphicon glyphicon-info-sign\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-labbodyget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[64] + '\"><i class=\"glyphicon glyphicon-list-alt\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-lock-lab\" href=\"javascript:void(0)\" title=\"' + MESSAGES[166] + '\"><i class=\"glyphicon glyphicon-ok-circle\"></i></a></li>');\n if ( $.cookie(\"topo\") == 'dark' ) {\n $('#lab-sidebar ul').append('<li><a class=\"action-lightmode\" href=\"javascript:void(0)\" title=\"' + MESSAGES[236] + '\"><i class=\"fas fa-sun\"></i></a></li>');\n } else {\n $('#lab-sidebar ul').append('<li><a class=\"action-nightmode\" href=\"javascript:void(0)\" title=\"' + MESSAGES[235] + '\"><i class=\"fas fa-moon\"></i></a></li>');\n }\n $('#lab-sidebar ul').append('<div id=\"action-labclose\"><li><a class=\"action-labclose\" href=\"javascript:void(0)\" title=\"' + MESSAGES[60] + '\"><i class=\"glyphicon glyphicon-off\"></i></a></li></div>');\n $('#lab-sidebar ul').append('<li><a class=\"action-logout\" href=\"javascript:void(0)\" title=\"' + MESSAGES[14] + '\"><i class=\"glyphicon glyphicon-log-out\"></i></a></li>');\n $('#lab-sidebar ul a').each(function () {\n var t = $(this).attr(\"title\");\n $(this).append(t);\n\n\n })\n if ( LOCK == 1 ) {\n lab_topology.setDraggable($('.node_frame, .network_frame, .customShape'), false);\n $('.customShape').resizable('disable');\n }\n })\n}", "function print_current_page() {\n window.print();\n}", "function takeScreenshot_P() {\n\ttinyMCE.triggerSave();\n\tvar copyText = document.getElementById(\"Proof\");\n\tcopyText.select();\n\tdocument.execCommand(\"copy\");\n\tvar iframe=document.createElement('iframe');\n\tdocument.body.appendChild(iframe);\n\tsetTimeout(function(){\n\t var iframedoc=iframe.contentDocument||iframe.contentWindow.document;\n\t iframedoc.body.innerHTML=copyText.value;\n\t html2canvas(iframedoc.body, {\n\t \t\t//useCORS: true,\n\t \t\tallowTaint: true,\n\t \t\tbackground: '#fff',\n\t \t\tscale: 1.5,\n\t \t\tonrendered: function(canvas) {\n\t \t\t\tvar fileNameToSaveAs = document.getElementById(\"inputFileNameToSaveAsP\").value;\n\t \t\t\tvar downloadLink = document.createElement(\"a\");\n\t \t\t\tdownloadLink.download = fileNameToSaveAs + \".png\";\n\t \t\t\tdownloadLink.innerHTML = \"Download File\";\n\t \t\t\tdownloadLink.href = canvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n\t \t\t\tdownloadLink.onclick = destroyClickedElement;\n\t \t\t\tdownloadLink.style.display = \"none\";\n\t \t\t\tdocument.body.appendChild(downloadLink);\n\t \t\t\tdownloadLink.click();\n\t \t\t\tdocument.body.removeChild(iframe);\n\t }\n\t });\n\t}, 10);\n}", "function saveDrawing() {\n var canvas5 = document.getElementById(\"demo5\");\n window.open(canvas5.toDataURL(\"image/png\"));\n}", "function fn() {\n\n printWindow.print();\n printWindow.close();\n }", "function print_current_page() {\n window.print();\n}", "function print_current_page() {\n window.print();\n}", "function print() {\n\tvar text = editor.getText();\n var compiler = new SlickCompiler();\n const input = compiler.compile(text);\n dialog.showSaveDialog({filters: [{name: 'pdf', extensions: ['pdf']},\n]}, function(filename){\n\tconsole.log(filename.toString())\n\t\tprintHelper(filename, input);\n });\n}", "function loadSavedDiagram() {\n // console.log('loadSavedDiagram');\n\n if (!window.location.hash) {\n showError('Missing saved diagram details');\n return;\n }\n\n const end = window.location.hash.indexOf('-blank');\n if (end !== -1) {\n PageData.Filename = window.location.hash.substring(2, end);\n } else {\n PageData.Filename = window.location.hash.substring(2);\n }\n\n const json = localStorage.getItem(PageData.Filename);\n if (!json) {\n showError('Failed to load saved diagram');\n return;\n }\n\n const data = JSON.parse(json);\n if (!data || !data.SvgXml) {\n showError('Failed to process saved diagram data');\n return;\n }\n\n PageData.SavedImageTitle = data.Title;\n\n document.title = 'Saved diagram: ' + PageData.SavedImageTitle + ' | M365 Maps';\n\n const svgXml = data.SvgXml\n .replace(/<!--.*-->/i, '')\n .replace(/<\\?xml.*\\?>/i, '')\n .replace(/<!doctype.*>/i, '')\n .replace(/^[\\n\\r]+/, '');\n\n SvgModule.Data.Tag = Common.createElementFromHtml(svgXml);\n document.body.appendChild(SvgModule.Data.Tag);\n\n SvgModule.injectHighlightStyles();\n SvgModule.sizeSvg();\n SvgModule.registerEvents();\n\n if (SvgModule.Data.Tag.style.filter !== '')\n readFilterValuesfromSvg();\n\n filterChange();\n}", "function print_saves(){\n clickSound.play();\n\n // met à jour les sauvegardes\n load_saves();\n\n // efface les sauvegardes déjà affichées\n $('#view_load .sauvegarde_bagues').empty();\n\n var x = 0;\n\n // parcourt toutes les sauvegardes et les affiche\n $.each(bagues_saves, function(index, value){\n msg = \"<li>\"\n +\"<div class='save_data' ontouchend='javascript: load_bague(\" + value.type_configurateur + \", \\\"\" + (value.options).join(\",\") + \"\\\");'>\"\n +\"<img src='img/fleche_droite.png' class='fleche_droite' />\"\n +\"<span class='save_name'>\" + value.name + \"</span>\"\n +\"<br>\"\n +\"<span class='save_date'>\" + value.date + \"</span>\"\n +\"</div>\"\n +\"<div class='save_modify' ontouchend='javascript: remove_save(\" + x + \");'>supprimer</div>\"\n +\"</li>\";\n\n $('#view_load .sauvegarde_bagues').append(msg);\n\n x++;\n });\n\n // configure la vue du chargeur de bague\n var view_saves = { \n title: \"Default View \" + parseInt(Math.random()*1000),\n backLabel: 'retour',\n view: $('#view_load').clone()\n };\n\n // affiche la vue\n window.viewNavigator.pushView(view_saves);\n\n // affiche le contenu n° 2 pour la barre du haut\n // print_barreTop(2);\n\n // dit que les boutons de suppression sont fermés\n modify_saves_open = false;\n\n e.stopPropagation();\n}", "function showPrintingDiagnostics() {\n showPrintingCropMarks();\n showPrintingDescription();\n showPrintingRulers();\n}", "function save() {\n saveDiagramProperties();\t// do this first, before writing to JSON\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n}", "function printWindow() {\n if (!loading) window.print(); \n }", "function printThis() {\n if (window.print) {\n window.print();\n } else {\n var WebBrowser = '<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>';\n document.body.insertAdjacentHTML('beforeEnd', WebBrowser);\n WebBrowser1.ExecWB(6, 2);\n WebBrowser1.outerHTML = \"\";\n }\n}", "async function printCanvas(canvas) {\n\n let css = \"<head><title>Share</title>\" + \"<!-- Required meta tags -->\\n\" +\n \" <meta charset=\\\"utf-8\\\">\\n\" +\n \" <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1, shrink-to-fit=no\\\">\\n\" +\n \" <!-- Bootstrap CSS -->\\n\" +\n \" <link rel=\\\"stylesheet\\\"\" +\n \" href=\\\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\"\\n\" +\n \" integrity=\\\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T\\\"\" +\n \" crossorigin=\\\"anonymous\\\">\\n\" +\n \" <!-- Internal CSS -->\\n\" +\n \" <link rel=\\\"stylesheet\\\" href=\\\"css/style2.css\\\"></head>\"\n\n let my_window = window.open('', 'mywindow', 'width=' + screen.availWidth + ',height=' + screen.availHeight);\n my_window.document.write('<!DOCTYPE html>');\n my_window.document.write('<html lang=\"en\">');\n my_window.document.write(css);\n my_window.document.write('<body>');\n my_window.document.write('<img src=\"' + canvas.toDataURL() + '\" alt=\"exported image\">');\n my_window.document.write('<p>Please copy or Print this image.')\n my_window.document.write('When you print this window, it will close afterward.</p>');\n my_window.document.write('</body></html>');\n}", "function menuSaveClick(event) {\n // console.log('menuSaveClick');\n\n event.preventDefault();\n\n let diagramTitle = PageData.SavedImageTitle;\n let storageKey = Date.now().toString();\n\n let overwrite = Common.customConfirm('Overwrite existing diagram?');\n if (overwrite) {\n storageKey = PageData.Filename;\n } else {\n diagramTitle = Common.customPrompt('Save diagram as:', diagramTitle);\n if (!diagramTitle) return;\n }\n\n const svgXml = SvgModule.getSvgXml();\n const svgObject = { Title: diagramTitle, SvgXml: svgXml };\n const jsonData = JSON.stringify(svgObject);\n localStorage.setItem(storageKey, jsonData);\n}", "do_print() {\n return window.print();\n }", "function printPage(elem) {\n\t\tpopup(jQuery(elem).html(), elem);\n\t}", "function btnPrint_OnClick() {\n\n var CycleID = objddlBillingCycle.value;\n var RadID = objddlRadiologist.value;\n\n if (CycleID != \"00000000-0000-0000-0000-000000000000\") {\n parent.GsFileType = \"PDF\";\n parent.GsLaunchURL = \"AP/DocumentPrinting/VRSDocPrint.aspx?DocID=2&CYCLE=\" + CycleID + \"&RADID=\" + RadID + \"&UID=\" + UserID;\n parent.PopupReportViewer();\n }\n else {\n parent.PopupMessage(RootDirectory, strForm, \"btnPrint_OnClick()\", \"229\", \"true\");\n }\n}", "function print_rpt(){\n URL=\"../../libraries/print_page/Print_a4_Eng.php?selLayer=PrintArea\";\n day = new Date();\n id = day.getTime();\n eval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=yes,scrollbars=yes ,location=0,statusbar=0 ,menubar=yes,resizable=1,width=880,height=600,left = 20,top = 50');\"); \n}", "function printerFriendly() {\n\t$('#header').hide();\n\t$('#content').hide();\n\t$('#footer').hide();\n\t$('body').append(\"<div id='printerFriendly'>\" +\n\t\t\t\t\t\t\"<span class='no-print'>\" +\n\t\t\t\t\t \t\t\"<button class='btn btn-default' onclick='exitPrinter()'><span class='glyphicon glyphicon-circle-arrow-left' style='vertical-align:top'> Return</span></button>\" +\n\t\t\t\t\t \t\t\"<button class='btn btn-default' onclick='togglePrint(1)'>Toggle Text</button>\" +\n\t\t\t\t\t \t\t\"<button class='btn btn-default' onclick='togglePrint(2)'>Toggle Visual</button>\" +\n\t\t\t\t\t \t\t\"<button class='btn btn-default' onclick='window.print()'><span class='glyphicon glyphicon-print' style='vertical-align:top'> Print</span></button>\" +\n\t\t\t\t\t \"</span>\" +\n\t\t\t\t\t $('#tablebody').html() + \n\t\t\t\t\t \"</div>\");\n\twindow.print();\n}", "function init() {\n if (!checkLocalStorage()) {\n var currentFile = document.getElementById(\"currentFile\");\n currentFile.textContent = \"Sorry! No web storage support. \\n If you're using Internet Explorer, you must load the page from a server for local storage to work.\";\n }\n var openDocument = document.getElementById(\"openDocument\");\n openDocument.style.visibility = \"hidden\";\n\n var removeDocument = document.getElementById(\"removeDocument\");\n removeDocument.style.visibility = \"hidden\";\n\n myDiagram =\n $AJ(go.Diagram, \"myDiagramDiv\", {\n \"grid.visible\": true,\n allowDrop: true, // accept drops from palette\n allowLink: false, // no user-drawn links\n commandHandler: new DrawCommandHandler(), // defined in DrawCommandHandler.js\n // default to having arrow keys move selected nodes\n \"commandHandler.arrowKeyBehavior\": \"move\",\n \"toolManager.mouseWheelBehavior\": go.ToolManager.WheelZoom, // mouse wheel zooms instead of scrolls\n // allow Ctrl-G to call groupSelection()\n \"commandHandler.archetypeGroupData\": {\n text: \"Group\",\n isGroup: true\n },\n\n rotatingTool: new RotateMultipleTool(), // defined in RotateMultipleTool.js\n\n resizingTool: new ResizeMultipleTool(), // defined in ResizeMultipleTool.js\n\n draggingTool: new GuidedDraggingTool(), // defined in GuidedDraggingTool.js\n \"draggingTool.horizontalGuidelineColor\": \"blue\",\n \"draggingTool.verticalGuidelineColor\": \"blue\",\n \"draggingTool.centerGuidelineColor\": \"green\",\n \"draggingTool.guidelineWidth\": 1,\n\n \"draggingTool.isGridSnapEnabled\": true,\n \"resizingTool.isGridSnapEnabled\": true,\n // notice whenever the selection may have changed\n \"ChangedSelection\": enableAll, // defined below, to enable/disable commands\n\n // notice when the Paste command may need to be reenabled\n \"ClipboardChanged\": enableAll,\n\n // notice when an object has been dropped from the palette\n \"ExternalObjectsDropped\": function (e) {\n var nodex;\n e.subject.each(function (node) {\n console.log(node.data.key);\n if (node.data.key == 'car')\n nodex = node;\n });\n if (nodex) {\n myDiagram.remove(nodex);\n //var cod = '69';\n //var cco = myDiagram.findNodeForKey('016903');\n //var coo1 = myDiagram.findNodeForKey('017103');\n //var ll = (go.Point.parse(cco.data.loc).x + go.Point.parse(coo1.data.loc).x) / 2;\n //var ly = (go.Point.parse(cco.data.loc).y + go.Point.parse(coo1.data.loc).y) / 2;\n //var loc = go.Point.stringify(new go.Point(ll,ly))\n var ops1 = {\n key: \"016803\",\n color: \"red\",\n width: 40\n };\n var a = new createObj();\n a.cntr(ops1);\n\n //alert(go.Point.parse(\"121 20\").x);\n //myDiagram.remove(cco);\n //cco.data.loc=\"100 200\";\n // myDiagram.model.setDataProperty(cco.data, \"color\", \"red\");\n //console.log(cco);\n }\n }\n\n });\n\n\n\n // change the title to indicate that the diagram has been modified\n myDiagram.addDiagramListener(\"Modified\", function (e) {\n var currentFile = document.getElementById(\"currentFile\");\n var idx = currentFile.textContent.indexOf(\"*\");\n if (myDiagram.isModified) {\n if (idx < 0) currentFile.textContent = currentFile.textContent + \"*\";\n } else {\n if (idx >= 0) currentFile.textContent = currentFile.textContent.substr(0, idx);\n }\n });\n //the Layers\n\n myDiagram.addLayer(yardlay);\n myDiagram.addLayer(cntrlay);\n // the Template\n myDiagram.nodeTemplate = myPaletteTp;\n myDiagram.groupTemplateMap.add(\"yardGroup\", groupTp);\n myDiagram.nodeTemplateMap.add('yardTitle', nodeTpYardTitle);\n myDiagram.nodeTemplateMap.add('yardShape', nodeTpYardShape);\n myDiagram.nodeTemplateMap.add('yardText', nodeTpYardText);\n myDiagram.nodeTemplateMap.add('cntr', nodeTpCntr);\n myDiagram.nodeTemplate.contextMenu = contextTp;\n\n\n // default structures and furniture\n myPalette =\n $AJ(go.Palette, \"myPaletteDiv\", {\n nodeTemplate: myDiagram.nodeTemplate, // shared with the main Diagram\n \"contextMenuTool.isEnabled\": false, // but disable context menus\n allowZoom: false,\n //allowDragOut:false,\n layout: $AJ(go.GridLayout, {\n cellSize: new go.Size(1, 1),\n spacing: new go.Size(5, 5)\n }),\n // initialize the Palette with a few furniture and structure nodes\n model: $AJ(go.GraphLinksModel, {\n nodeDataArray: [\n {\n key: \"yardtp\",\n //geo: \"F1 M0 0 L5,0 5,40 0,40 0,0z x M5,0 a40,40 0 0,1 40,40 \",\n fig: \"InternalStorage\",\n color: \"lightgreen\"\n },\n {\n key: \"car\",\n geo: \"F1 M0 0 L30 0 30 30 0 30 z\",\n color: \"red\"\n },\n\n {\n key: \"FieldBridge2\",\n geo: \"F M13,0 L48,0 L48,140 L13,140 Z M0,13 L60,13 L60,25 L0,25 Z M0,115 L60,115 L60,128 L0,128 Z\",\n color: \"lightblue\"\n }\n\n ] // end nodeDataArray\n }) // end model\n }); // end Palette\n var car = {\n key: \"Car\",\n geo: \"F M0,1 L0,19 L14,19 L14,1 Z M1,2 L1,9 L4,9 L4,2 Z M1,18, L1,11 L4,11 L4,18 Z M5,1 L5,19 M0,10 L5,10 M1,19 L1,20 L6,20 L6,19 Z M9,19 L9,20 L14,20 L14,19 Z M40,0 L40,1 L45,1 L45,0 Z M48,0 L48,1 L53,1 L53,0 Z M1,0 L1,1 L6,1 L6,0 Z M9,0 L9,1 L14,1 L14,0 Z M40,19 L40,20 L45,20 L45,19 Z M48,19 L48,20 L53,20 L53,19 Z M17,1 L17,19 L57,19 L57,1 Z M 14,9 L17,9 L17,8 L14,8 Z M14,10 L14,11 L17,11 L17,10 Z M20,2 L20,18 L54,18 L54,2 Z\",\n color: \"green\"\n };\n // myPalette.model.addNodeData(car);\n var a = new createObj();\n a.car(car);\n\n\n // the Overview\n\n\n myOverview =\n $AJ(go.Overview, \"myOverviewDiv\", {\n observed: myDiagram,\n maxScale: 0.5\n });\n\n // change color of viewport border in Overview\n myOverview.box.elt(0).stroke = \"dodgerblue\";\n\n\n // start off with an empty document\n myDiagram.isModified = false;\n newDocument();\n var ops = {\n name: \"01\",\n text: \"yard01\",\n row: 8,\n bay: 40,\n tile: 5,\n rowSeq: \"A\",\n baySeq: \"L\"\n };\n var ops2 = {\n name: \"02\",\n text: \"yard02\",\n row: 8,\n bay: 40,\n tile: 5,\n rowSeq: \"A\",\n baySeq: \"L\"\n };\n\n var a = new createObj();\n a.yard(ops);\n //a.yard(ops2);\n\n\n} // end init", "function init() {\n if (!checkLocalStorage()) {\n var currentFile = document.getElementById(\"currentFile\");\n currentFile.textContent = \"Sorry! No web storage support. \\n If you're using Internet Explorer, you must load the page from a server for local storage to work.\";\n }\n var openDocument = document.getElementById(\"openDocument\");\n openDocument.style.visibility = \"hidden\";\n var removeDocument = document.getElementById(\"removeDocument\");\n\n removeDocument.style.visibility = \"hidden\";\n\n myDiagram =\n $AJ(go.Diagram, \"myDiagramDiv\",\n { \"grid.visible\": true,\n // ExternalObjectsDropped : function(e) {\n // console.log(e);\n // //myDiagram.commandHandler.deleteSelection();\n //},\n\n allowDrop: true, // accept drops from palette\n allowLink: false, // no user-drawn links\n commandHandler: new DrawCommandHandler(), // defined in DrawCommandHandler.js\n // default to having arrow keys move selected nodes\n \"commandHandler.arrowKeyBehavior\": \"move\",\n \"toolManager.hoverDelay\": 100, // how quickly tooltips are shown\n \"toolManager.mouseWheelBehavior\": go.ToolManager.WheelZoom , // mouse wheel zooms instead of scrolls\n // allow Ctrl-G to call groupSelection()\n \"commandHandler.archetypeGroupData\": { text: \"Group\", isGroup: true },\n\n rotatingTool: new RotateMultipleTool(), // defined in RotateMultipleTool.js\n\n resizingTool: new ResizeMultipleTool(), // defined in ResizeMultipleTool.js\n\n draggingTool: new GuidedDraggingTool(), // defined in GuidedDraggingTool.js\n \"draggingTool.horizontalGuidelineColor\": \"blue\",\n \"draggingTool.verticalGuidelineColor\": \"blue\",\n \"draggingTool.centerGuidelineColor\": \"green\",\n \"draggingTool.guidelineWidth\": 1,\n\n \"draggingTool.isGridSnapEnabled\": true,\n \"resizingTool.isGridSnapEnabled\": true,\n // notice whenever the selection may have changed\n \"ChangedSelection\": enableAll, // defined below, to enable/disable commands\n\n // notice when the Paste command may need to be reenabled\n \"ClipboardChanged\": enableAll,\n\n // notice when an object has been dropped from the palette\n \"ExternalObjectsDropped\": function(e) {\n document.getElementById(\"myDiagramDiv\").focus(); // assume keyboard focus should be on myDiagram\n myDiagram.toolManager.draggingTool.clearGuidelines(); // remove any guidelines\n var nodex;\n // event.subject is the myDiagram.selection, the collection of just dropped Parts\n e.subject.each(function (node) {\n console.log(node.data.key);\n if (node.data.key == 8)\n nodex = node;\n\n });\n if (nodex) {\n //console.log(nodex);\n\n myDiagram.remove(nodex);\n var ag = new drawObj();\n ag.yy(nodex.position);\n }\n }\n\n });\n\n\n // sets the qualities of the tooltip\n var tooltiptemplate =\n $AJ(go.Adornment, go.Panel.Auto,\n $AJ(go.Shape, \"RoundedRectangle\",\n { fill: \"whitesmoke\", stroke: \"gray\" }),\n $AJ(go.TextBlock,\n { margin: 3, editable: true },\n // converts data about the part into a string\n new go.Binding(\"text\", \"\", function(data) {\n if (data.item != undefined) return data.item;\n return \"(unnamed item)\";\n }))\n );\n\n myDiagram.groupTemplate =\n $AJ(go.Group, \"Vertical\",\n { selectionObjectName: \"PANEL\", // selection handle goes around shape, not label\n ungroupable: true }, // enable Ctrl-Shift-G to ungroup a selected Group\n $AJ(go.TextBlock,\n {\n background: \"lightgreen\",\n margin: 18,\n font: \"bold 19px sans-serif\",\n isMultiline: false, // don't allow newlines in text\n editable: true ,alignment: go.Spot.Left // allow in-place editing by user\n },\n new go.Binding(\"text\", \"text\").makeTwoWay(),\n new go.Binding(\"stroke\", \"color\")),\n $AJ(go.Panel, \"Auto\",\n { name: \"PANEL\" },\n $AJ(go.Shape, \"Rectangle\", // the rectangular shape around the members\n { fill: \"rgba(255,128,128,0.2)\", stroke: \"gray\", strokeWidth: 0 }),\n $AJ(go.Placeholder) // represents where the members are\n )\n );\n // Define the generic furniture and structure Nodes.\n // The Shape gets it Geometry from a geometry path string in the bound data.\n myDiagram.nodeTemplate =\n $AJ(go.Node, \"Spot\",\n {\n locationObjectName: \"SHAPE\",\n locationSpot: go.Spot.Center,\n toolTip: tooltiptemplate,click:function(e, node) {\n console.log(node.data.color);\n myDiagram.startTransaction(\"change color\");\n myDiagram.model.setDataProperty(node.data, \"color\", \"red\");\n myDiagram.commitTransaction(\"change color\");\n },\n selectionAdorned: false // use a Binding on the Shape.stroke to show selection\n },\n //new go.Binding(\"name\", \"xxx\"),\n // remember the location of this Node\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(go.Point.stringify),\n // move a selected part into the Foreground layer, so it isn't obscured by any non-selected parts\n new go.Binding(\"layerName\", \"isSelected\", function(s) { return s ? \"Foreground\" : \"\"; }).ofObject(),\n // can be resided according to the user's desires\n { resizable: true, resizeObjectName: \"SHAPE\" },\n $AJ(go.Shape,\n {\n name: \"SHAPE\",\n // the following are default values;\n // actual values may come from the node data object via data-binding\n geometryString: \"F1 M0 0 L20 0 20 20 0 20 z\",\n fill: \"rgb(130, 130, 256)\"\n },\n new go.Binding(\"figure\", \"fig\"),\n // this determines the actual shape of the Shape\n new go.Binding(\"geometryString\", \"geo\"),\n // allows the color to be determined by the node data\n new go.Binding(\"fill\", \"color\"),\n // selection causes the stroke to be blue instead of black\n new go.Binding(\"stroke\", \"isSelected\", function(s) { return s ? \"dodgerblue\" : \"black\"; }).ofObject(),\n // remember the size of this node\n new go.Binding(\"desiredSize\", \"size\", go.Size.parse).makeTwoWay(go.Size.stringify),\n // can set the angle of this Node\n new go.Binding(\"angle\", \"angle\").makeTwoWay()\n )\n );\n\n myDiagram.nodeTemplate.contextMenu =\n $AJ(go.Adornment, \"Vertical\",\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Rename\", { margin: 3 }),\n { click: function(e, obj) { rename(obj); } }),\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Cut\", { margin: 3 }),\n { click: function(e, obj) { myDiagram.commandHandler.cutSelection(); } }),\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Copy\", { margin: 3 }),\n { click: function(e, obj) { myDiagram.commandHandler.copySelection(); } }),\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Rotate +45\", { margin: 3 }),\n { click: function(e, obj) { myDiagram.commandHandler.rotate(45); } }),\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Rotate -45\", { margin: 3 }),\n { click: function(e, obj) { myDiagram.commandHandler.rotate(-45); } }),\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Rotate +90\", { margin: 3 }),\n { click: function(e, obj) { myDiagram.commandHandler.rotate(90); } }),\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Rotate -90\", { margin: 3 }),\n { click: function(e, obj) { myDiagram.commandHandler.rotate(-90); } }),\n $AJ(\"ContextMenuButton\",\n $AJ(go.TextBlock, \"Rotate 180\", { margin: 3 }),\n { click: function(e, obj) { myDiagram.commandHandler.rotate(180); } })\n );\n\n//var n = new drawObj();\n// n.yy();\n // group settings from basic.html to lock things together\n\n // make grouped Parts unselectable\n myDiagram.addDiagramListener(\"SelectionGrouped\", function(e) {\n // e.subject should be the new Group\n e.subject.memberParts.each(function(part) { part.selectable = false; });\n });\n\n myDiagram.addDiagramListener(\"SelectionUngrouped\", function(e) {\n // e.parameter should be collection of ungrouped former members\n e.parameter.each(function(part) {\n part.selectable = true;\n part.isSelected = true;\n });\n });\n\n myDiagram.addDiagramListener(\"SelectionCopied\", function(e) {\n // selection collection will be modified during this loop,\n // so make a copy of it first\n var sel = myDiagram.selection.toArray();\n for (var i = 0; i < sel.length; i++) {\n var part = sel[i];\n // don't have any members of Groups be selected or selectable\n if (part instanceof go.Group) {\n var mems = new go.Set().addAll(part.memberParts);\n mems.each(function(member) {\n member.isSelected = false;\n member.selectable = false;\n });\n }\n }\n });\n\n // change the title to indicate that the diagram has been modified\n myDiagram.addDiagramListener(\"Modified\", function(e) {\n var currentFile = document.getElementById(\"currentFile\");\n var idx = currentFile.textContent.indexOf(\"*\");\n if (myDiagram.isModified) {\n if (idx < 0) currentFile.textContent = currentFile.textContent + \"*\";\n } else {\n if (idx >= 0) currentFile.textContent = currentFile.textContent.substr(0, idx);\n }\n });\n\n // the Palette\n\n // brushes for furniture structures\n var wood = $AJ(go.Brush, \"Linear\", { 0: \"red\", 1: \"#5E2605\" })\n var wall = $AJ(go.Brush, { color: \"palegreen\" });\n var blue = $AJ(go.Brush, \"Linear\", { 0: \"#42C0FB\", 1: \"#009ACD\" });\n var metal = $AJ(go.Brush, \"Linear\", { 0: \"#A8A8A8\", 1: \"#474747\" });\n var green = $AJ(go.Brush, \"Linear\", { 0: \"#9CCB19\", 1: \"#698B22\" });\n\n // default structures and furniture\n myPalette =\n $AJ(go.Palette, \"myPaletteDiv\",\n {\n nodeTemplate: myDiagram.nodeTemplate, // shared with the main Diagram\n \"contextMenuTool.isEnabled\": false, // but disable context menus\n allowZoom: false,\n //allowDragOut:false,\n layout: $AJ(go.GridLayout, { cellSize: new go.Size(1, 1), spacing: new go.Size(5, 5) }),\n // initialize the Palette with a few furniture and structure nodes\n model: $AJ(go.GraphLinksModel,\n {\n nodeDataArray: [\n {\n key: 1,\n //geo: \"F1 M0 0 L5,0 5,40 0,40 0,0z x M0,0 a40,40 0 0,0 \",\n fig:\"RoundedRectangle\",\n item: \"left door\",\n color: wall\n },\n {\n key: 2,\n //geo: \"F1 M0 0 L5,0 5,40 0,40 0,0z x M5,0 a40,40 0 0,1 40,40 \",\n fig:\"InternalStorage\",\n item: \"right door\",\n color: wall\n },\n {\n key: 3, angle: 90,\n geo: \"F1 M0,0 L0,100 12,100 12,0 0,0z\",\n item: \"wall\",\n color: wall\n },\n {\n key: 4, angle: 90,\n geo: \"F1 M0,0 L0,50 10,50 10,0 0,0 x M5,0 L5,50z\",\n item: \"window\",\n color: \"whitesmoke\"\n },\n {\n key: 5,\n geo: \"F1 M0,0 L50,0 50,12 12,12 12,50 0,50 0,0 z\",\n item: \"corner\",\n color: wall\n },\n {\n key: 6,\n geo: \"F1 M0 0 L40 0 40 40 0 40 0 0 x M0 10 L40 10 x M 8 10 8 40 x M 32 10 32 40 z\",\n item: \"arm chair\",\n color: blue\n },\n {\n key: 7,\n geo: \"F1 M0 0 L80,0 80,40 0,40 0 0 x M0,10 L80,10 x M 7,10 7,40 x M 73,10 73,40 z\",\n item: \"couch\",\n color: blue\n },\n {\n key: 8,\n geo: \"F1 M0 0 L30 0 30 30 0 30 z\",\n item: \"Side Table\",\n color: wood\n },\n {\n key: 9,\n geo: \"F1 M0 0 L80,0 80,90 0,90 0,0 x M0,7 L80,7 x M 0,30 80,30 z\",\n item: \"queen bed\",\n color: green\n }\n ] // end nodeDataArray\n }) // end model\n }); // end Palette\n\n\n // the Overview\n\n\n myOverview =\n $AJ(go.Overview, \"myOverviewDiv\",\n { observed: myDiagram, maxScale: 0.5 });\n\n // change color of viewport border in Overview\n myOverview.box.elt(0).stroke = \"dodgerblue\";\n\n\n // start off with an empty document\n myDiagram.isModified = false;\n newDocument();\n var nodeDataArray = [\n { key: 111, text: \"Alpha\", color: \"lightblue\",\"loc\":\"0 58\" },\n { key: 112, text: \"Beta\", color: \"orange\",\"loc\":\"100 58\" },\n { key: 113, text: \"Gamma\", color: \"lightgreen\", group: 115 ,name:\"xxx\"},\n { key: 114, text: \"Delta\", color: \"pink\", group: 115 ,\"loc\":\"143.5 58\",name:\"777\"},\n { key: 115, text: \"Yard01\", color: \"green\", isGroup: true }\n ];\n //myDiagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);\n myDiagram.model.addNodeDataCollection(nodeDataArray);\n\n} // end init", "function printFormEdit() {}", "function display() {\n\twindow.print();\n}", "function myFunction() {\n \t window.print();\n \t}", "function printThis () {\r\n window.print();\r\n}", "function startSaveListener(){\r\n\tdocument.getElementById(\"saveit\").addEventListener(\"click\", saveGraph);\r\n document.getElementById(\"pushit\").addEventListener(\"click\", savepng);\r\n}", "function print_corte_operador_day(id_operador){\n\n\t\tlet print_pdf_dia = document.getElementById('modal_content_dia');\n\t\tlet ifram_pdf_dia = document.createElement(\"iframe\");\n\n\t\tifram_pdf_dia.setAttribute(\"src\", baseURL + \"web/Operador_ctrl/pdf_operador_corte_dia?id=\" + id_operador);\n\t\tifram_pdf_dia.setAttribute(\"id\", \"load_pdf_dia\");\n\t\tifram_pdf_dia.style.width = \"100%\";\n\t\tifram_pdf_dia.style.height = \"510px\";\n\t\tprint_pdf_dia.appendChild(ifram_pdf_dia);\n\t}", "function myPrintFunction() {\n window.print();\n}", "function saveStandardsAndContinue(){\n tabsFrame.restriction = null;\t\n myTabsFrame.selectTab('page4a')\n}", "function callPrintToPDF() {\n let win = BrowserWindow.getFocusedWindow();\n win.webContents.send('print-pdf-click');\n}", "function printDivInPopUp() {\n var divToPrint = document.getElementById('code128');\n var newWindow = window.open('', 'Print-Window');\n newWindow.document.open();\n newWindow.document.write('<link rel=\"stylesheet\" type=\"text/css\" href=\"admin-panel.css\" />');\n newWindow.document.write('<html><body onload=\"window.print()\">' + divToPrint.outerHTML + '</body></html>');\n newWindow.document.close();\n setTimeout(function () { newWindow.close(); }, 10);\n}", "function printpage()\n{\n window.print()\n}", "function PrintFinished(){\n\tregistRptPrintHistory();\n}", "function PrintFinished(){\n\tregistRptPrintHistory();\n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}" ]
[ "0.63316315", "0.62739676", "0.6170226", "0.60262626", "0.60187477", "0.59463614", "0.59202445", "0.5874236", "0.5873068", "0.5872673", "0.58568233", "0.58197814", "0.5805974", "0.57907474", "0.5730226", "0.5699699", "0.5699699", "0.5694505", "0.5691409", "0.5687984", "0.56847167", "0.56817514", "0.56707346", "0.5670603", "0.5644998", "0.5612441", "0.56012845", "0.5588926", "0.5587953", "0.5574147", "0.55551624", "0.55485404", "0.5540249", "0.55391026", "0.5534997", "0.55204344", "0.5515757", "0.55139995", "0.55074877", "0.5503016", "0.54964674", "0.54964674", "0.54675937", "0.5460018", "0.5447054", "0.5439318", "0.5438641", "0.54316753", "0.5428626", "0.5414808", "0.5409968", "0.53810215", "0.53750014", "0.5374667", "0.53726816", "0.5371383", "0.5369258", "0.53606886", "0.53603053", "0.53389263", "0.5322207", "0.5319119", "0.5305535", "0.5293227", "0.5289853", "0.5286434", "0.5284611", "0.5283216", "0.5279873", "0.5276698", "0.5276698", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327", "0.527327" ]
0.7598626
0
Exports current canvas as SVG
function exportCanvas() { //export canvas as SVG var v = '<svg width="300" height="200" xmlns="http://www.w3.org/2000/svg" version="1.1">\ <rect x="0" y="0" height="200" width="300" style="stroke:#000000; fill: #FFFFFF"/>\ <path d="M100,100 C200,200 100,50 300,100" style="stroke:#FFAAFF;fill:none;stroke-width:3;" />\ <rect x="50" y="50" height="50" width="50"\ style="stroke:#ff0000; fill: #ccccdf" />\ </svg>'; //get svg var canvas = getCanvas(); var v2 = '<svg width="' + canvas.width + '" height="' + canvas.height + '" xmlns="http://www.w3.org/2000/svg" version="1.1">'; v2 += STACK.toSVG(); v2 += CONNECTOR_MANAGER.toSVG(); v2 += '</svg>'; alert(v2); //save SVG into session //see: http://api.jquery.com/jQuery.post/ $.post("../common/controller.php", {action: 'saveSvg', svg: escape(v2)}, function(data) { if (data == 'svg_ok') { //alert('SVG was save into session'); } else if (data == 'svg_failed') { Log.info('SVG was NOT save into session'); } } ); //open a new window that will display the SVG window.open('./svg.php', 'SVG', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_saveContextSVG(){\n this.getGraphicsContext().saveSVG();\n }", "function saveSVG(){\n\t\t\tvar blob = new Blob([canvas.toSVG()], {type: \"text/plain;charset=utf-8\"});\n\t\t\tsaveAs(blob, \"download.svg\");\n\n\t\t}", "function canvasToSVG() {\n if (chart.boost &&\n chart.boost.wgl &&\n isChartSeriesBoosting(chart)) {\n chart.boost.wgl.render(chart);\n }\n }", "function saveCanvas() {\n // Generate SVG.\n var save_button = $('#save');\n var save_svg = $('#canvas').innerHTML.replace('<svg', '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n var data_uri = 'data:image/svg+xml;base64,' + window.btoa(save_svg);\n var filename = 'bustashape-' + window.location.hash.replace('#', '') + '-' + Date.now() + '.svg';\n\n // Prep link for new download.\n save_button.setAttribute('href', data_uri);\n save_button.setAttribute('download', filename);\n}", "function exportAsImage(){\n \n // variable for image name\n var chartName, svg ;\n \n // Getting svg name from this.id, replacing this.id by save\n // save prefix is for button and replacing it with sample to\n // get the svg chart div name \n\n svg = document.querySelector( '#dendogram svg' );\n \n //\n var svgData = new XMLSerializer().serializeToString( svg );\n\n var canvas = document.createElement( \"canvas\" );\n var ctx = canvas.getContext( \"2d\" );\n \n canvas.height = outerRadius*2;\n canvas.width = outerRadius*2;\n \n var dataUri = '';\n dataUri = 'data:image/svg+xml;base64,' + btoa(svgData);\n \n var img = document.createElement( \"img\" );\n \n img.onload = function() {\n ctx.drawImage( img, 0, 0 );\n \n // Initiate a download of the image\n var a = document.createElement(\"a\");\n \n a.download = \"circularDendogram\" + \".png\";\n a.href = canvas.toDataURL(\"image/png\");\n document.querySelector(\"body\").appendChild(a);\n a.click();\n document.querySelector(\"body\").removeChild(a);\n \n // Image preview in case of \"save image modal\"\n \n /*var imgPreview = document.createElement(\"div\");\n imgPreview.appendChild(img);\n document.querySelector(\"body\").appendChild(imgPreview);\n */\n };\n \n img.src = dataUri;\n}", "function exportPNG(filename) {\n\n\t$(\".connection\").css(\"fill\", \"none\");\n\t$(\".link-tools\").css(\"display\", \"none\");\n\t$(\".link-tools\").css(\"fill\", \"none\");\n\t\n\tvar svgDoc = paper.svg;\n\tvar serializer = new XMLSerializer();\n\tvar svgString = serializer.serializeToString(svgDoc);\n\n\tvar canvas = document.getElementById(\"canvas\");\n\tvar context = canvas.getContext('2d');\n\t\n\tcanvg(canvas, svgString);\n\t\n\tdestinationCanvas = document.createElement(\"canvas\");\n\tdestinationCanvas.width = canvas.width;\n\tdestinationCanvas.height = canvas.height;\n\n\tdestCtx = destinationCanvas.getContext('2d');\n\t\n\tdestCtx.fillStyle = \"#FFFFFF\";\n\tdestCtx.fillRect(0, 0, canvas.width, canvas.height);\n\t\n\tdestCtx.drawImage(canvas, 0, 0);\n\t\n\tvar img = destinationCanvas.toDataURL(\"image/png\");\n\t\n\tvar downloadLink = document.createElement(\"a\");\n\tdownloadLink.href = img;\n\tdownloadLink.download = filename + \".png\";\n\tdocument.body.appendChild(downloadLink);\n\tdownloadLink.click();\n\tdocument.body.removeChild(downloadLink);\n}", "function toSVG() {\n return '';\n\n /* Note: Support for SVG is suspended\n *\n var canvas = getCanvas();\n //@see http://www.w3schools.com/svg/svg_example.asp\n var v2 = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n v2 += \"\\n\" + '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"'\n + canvas.width +'\" height=\"' + canvas.height\n + '\" viewBox=\"0 0 ' + canvas.width + ' ' + canvas.height + '\" version=\"1.1\">';\n INDENTATION++;\n v2 += STACK.toSVG();\n v2 += CONNECTOR_MANAGER.toSVG();\n INDENTATION--;\n v2 += \"\\n\" + '</svg>';\n \n return v2;\n */\n}", "function convertSVGtoPNG() {\n var canvas = document.getElementById('the-canvas');\n var context = canvas.getContext('2d');\n canvas.width = triOptions.width();\n canvas.height = triOptions.height();\n\n var image = new Image();\n\n $(image).on(\"load\", function() {\n context.drawImage(image, 0, 0);\n $(\"#download-btn\").attr(\"href\", canvas.toDataURL(\"image/png\"));\n });\n\n image.src = currentPattern.dataUri;\n var imagePath = canvas.toDataURL(\"image/png\");\n \n \n\n }", "saveImage() {\n console.log(this.stripStyles(this.state.svgString));\n canvg('canvas', this.stripStyles(this.state.svgString));\n document.getElementById('canvas').toBlob((blob) => {\n saveAs(blob, `tri2-${new Date().toISOString()}.png`);\n });\n }", "function exportImage(htmlId) {\n var svg = document.getElementById(htmlId);\n var canvas = document.getElementById('saveCanvas');\n canvas.height = svg.clientHeight;\n canvas.width = svg.clientWidth;\n var ctx = canvas.getContext('2d');\n var data = (new XMLSerializer()).serializeToString(svg);\n var DOMURL = window.URL || window.webkitURL || window;\n\n var img = new Image();\n var svgBlob = new Blob([data], { type: 'image/svg+xml;charset=utf-8' });\n var url = DOMURL.createObjectURL(svgBlob);\n img.src = url;\n\n img.onload = function () {\n ctx.drawImage(img, 0, 0);\n var imgURI = canvas\n .toDataURL('image/png')\n .replace('image/png', 'image/octet-stream');\n\n triggerDownload(imgURI);\n };\n\n}", "function savePNG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n var url = window.URL.createObjectURL(blob);\n\n var canvas = document.querySelector(\"canvas\");\n canvas.setAttribute(\"width\", width);\n canvas.setAttribute(\"height\", height);\n var context = canvas.getContext(\"2d\");\n\n var image = new Image;\n image.src = url;\n image.onload = function () {\n context.drawImage(image, 0, 0);\n var a = document.createElement(\"a\");\n a.download = getFilenameWithoutExtension(curFilename) + \".png\";\n a.href = canvas.toDataURL(\"image/png\");\n a.click();\n };\n}", "exportSvg(svg) {\n return __awaiter(this, void 0, void 0, function* () {\n const svgFilePath = this._uri.fsPath.replace('.json', '');\n const svgFileUri = yield vscode_1.window.showSaveDialog({\n defaultUri: vscode_1.Uri.parse(svgFilePath).with({ scheme: 'file' }),\n filters: { 'SVG': ['svg'] }\n });\n if (svgFileUri) {\n fs.writeFile(svgFileUri.fsPath, svg, (error) => {\n if (error) {\n const errorMessage = `Failed to save file: ${svgFileUri.fsPath}`;\n this._logger.logMessage(logger_1.LogLevel.Error, 'exportSvg():', errorMessage);\n vscode_1.window.showErrorMessage(errorMessage);\n }\n });\n }\n this.webview.postMessage({ command: 'showMessage', message: '' });\n });\n }", "function saveSVG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n saveAs(blob, getFilenameWithoutExtension(curFilename) + \".svg\");\n}", "function downloadSVG(){\r\n\tcrackPoint.remove();\r\n\tpaper.view.update();\r\n var svg = project.exportSVG({ asString: true, bounds: 'content' });\r\n var svgBlob = new Blob([svg], {type:\"image/svg+xml;charset=utf-8\"});\r\n var svgUrl = URL.createObjectURL(svgBlob);\r\n var downloadLink = document.createElement(\"a\");\r\n downloadLink.href = svgUrl;\r\n downloadLink.download = simText+\".svg\";\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n document.body.removeChild(downloadLink);\r\n\tcrackPoint.insertAbove(concreteObjects[concreteObjects.length-1]);\r\n}", "function SaveAsSVG(document, newname)\r{\r var targetFolder = Folder(MATERIAL_EXPORT_PATH);\r\r if (! targetFolder.exists) {\r // geef een melding en \r throw(\"Onderstaande folder niet gevonden, is de netwerkverbinding gemaakt? \\n\\n\" +\r MATERIAL_EXPORT_PATH);\r }\r\r var exportOptions = new ExportOptionsSVG();\r var exportType = ExportType.SVG;\r\r var targetFile = MakeTempInvisibleFile(targetFolder, newname, \".ai\");\r // alert(targetFile);\r\r exportOptions.embedRasterImages = true;\r exportOptions.compressed = true;\r exportOptions.embedAllFonts = false;\r exportOptions.fontSubsetting = SVGFontSubsetting.GLYPHSUSED;\r exportOptions.cssProperties = SVGCSSPropertyLocation.PRESENTATIONATTRIBUTES;\r exportOptions.optimezForSVGViewer = true;\r\r document.exportFile( targetFile, exportType, exportOptions );\r document.close( SaveOptions.DONOTSAVECHANGES );\r\r var exportedFile = MakeTempInvisibleFile(targetFolder, newname, \".svgz\");\r // alert(exportedFile);\r if (exportedFile.exists) {\r if (! exportedFile.rename(newname+ \".svgz\")) {\r // bij aanwezig zijn oude file, deze proberen te deleten en vervolgens nogmaal renamen:\r var fl = new File(targetFolder + \"/\" + newname + \".svgz\");\r // alert(fl);\r if (fl.remove()) \r exportedFile.rename(newname+ \".svgz\")\r else\r alert(SCRIPT_NAME + \" is niet goed gelukt, oude file is nog aanwezig en niet te overschrijven!\") \r }\r } \r else\r alert(SCRIPT_NAME + \" is niet goed gelukt!\") \r}", "function svgToCanvas(downloadlinkid){\n\t\t//get svg element.\n\t\tvar svg = document.getElementById(\"svg\");\n\n\t\t//get svg source.\n\t\tvar serializer = new XMLSerializer();\n\t\tvar source = serializer.serializeToString(svg);\n\n\t\t//add name spaces.\n\t\tif(!source.match(/^<svg[^>]+xmlns=\"http\\:\\/\\/www\\.w3\\.org\\/2000\\/svg\"/)){\n\t\t\tsource = source.replace(/^<svg/, '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n\t\t}\n\t\tif(!source.match(/^<svg[^>]+\"http\\:\\/\\/www\\.w3\\.org\\/1999\\/xlink\"/)){\n\t\t\tsource = source.replace(/^<svg/, '<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"');\n\t\t}\n\n\t\t//add xml declaration\n\t\tsource = '<?xml version=\"1.0\" standalone=\"no\"?>\\n' + source;\n\n\t\t//convert svg source to URI data scheme.\n\t\tvar url = \"data:image/svg+xml;charset=utf-8,\"+encodeURIComponent(source);\n\n\t\t//set url value to a element's href attribute.\n\t\tdocument.getElementById(downloadlinkid).href = url;\n\t\tdocument.getElementById(downloadlinkid).innerHTML=\"Figure ready,Right click me to save!\"\n\t\t//you can download svg file by right click menu\t\n\t}", "drawSvg() {\n \n\t}", "function fromCanvasToSvg(sourceCanvas, targetSVG, x, y, width, height) {\n var imageData = sourceCanvas.getContext('2d').getImageData(\n x, y, width, height);\n var newCanvas = document.createElement(\"canvas\");\n var imgDataurl;\n newCanvas.width = width; newCanvas.height = height;\n newCanvas.getContext(\"2d\").putImageData(imageData, 0, 0);\n imgDataurl = newCanvas.toDataURL(\"image/png\");\n targetSVG.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", imgDataurl);\n }", "function downloadPNG2x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 2});\n}", "function exportImage(type) {\n\t\t\t\tvar canvas = document.createElement(\"canvas\");\n\t\t\t\tvar ctx = canvas.getContext('2d');\n\t\n\t\t\t\t// TODO: if (options.keepOutsideViewport), do some translation magic?\n\t\n\t\t\t\tvar svg_img = new Image();\n\t\t\t\tvar svg_xml = _svg.outerHTML;\n\t\t\t\tsvg_img.src = base64dataURLencode(svg_xml);\n\t\n\t\t\t\tsvg_img.onload = function () {\n\t\t\t\t\tdebug(\"exported image size: \" + [svg_img.width, svg_img.height]);\n\t\t\t\t\tcanvas.width = svg_img.width;\n\t\t\t\t\tcanvas.height = svg_img.height;\n\t\t\t\t\tctx.drawImage(svg_img, 0, 0);\n\t\n\t\t\t\t\t// SECURITY_ERR WILL HAPPEN NOW\n\t\t\t\t\tvar image_dataurl = canvas.toDataURL(type);\n\t\t\t\t\tdebug(type + \" length: \" + image_dataurl.length);\n\t\n\t\t\t\t\tif (options.callback) options.callback(image_dataurl);else debug(\"WARNING: no callback set, so nothing happens.\");\n\t\t\t\t};\n\t\n\t\t\t\tsvg_img.onerror = function () {\n\t\t\t\t\tdebug(\"Can't export! Maybe your browser doesn't support \" + \"SVG in img element or SVG input for Canvas drawImage?\\n\" + \"http://en.wikipedia.org/wiki/SVG#Native_support\");\n\t\t\t\t};\n\t\n\t\t\t\t// NOTE: will not return anything\n\t\t\t}", "function downloadPNG4x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 4});\n}", "toSVG() {\n if (this.geometryObject &&\n (\n this.geometryObject.geometryIsVisible === false ||\n this.geometryObject.geometryIsHidden === true ||\n this.geometryObject.geometryIsConstaintDraw === true\n )\n ) {\n return '';\n }\n\n let path = this.getSVGPath();\n\n let attributes = {\n d: path,\n stroke: this.strokeColor,\n fill: '#000',\n 'fill-opacity': 0,\n 'stroke-width': this.strokeWidth,\n 'stroke-opacity': 1, // toujours à 1 ?\n };\n\n let path_tag = '<path';\n for (let [key, value] of Object.entries(attributes)) {\n path_tag += ' ' + key + '=\"' + value + '\"';\n }\n path_tag += '/>\\n';\n\n let pointToDraw = [];\n if (app.settings.areShapesPointed && this.name != 'silhouette') {\n if (this.isSegment())\n pointToDraw.push(this.segments[0].vertexes[0]);\n if (!this.isCircle())\n this.segments.forEach(\n (seg) => (pointToDraw.push(seg.vertexes[1])),\n );\n }\n\n this.segments.forEach((seg) => {\n //Points sur les segments\n seg.divisionPoints.forEach((pt) => {\n pointToDraw.push(pt);\n });\n });\n if (this.isCenterShown) pointToDraw.push(this.center);\n\n let point_tags = pointToDraw.filter(pt => {\n pt.visible &&\n pt.geometryIsVisible &&\n !pt.geometryIsHidden\n }).map(pt => pt.svg).join('\\n');\n\n let comment =\n '<!-- ' + this.name.replace('é', 'e').replace('è', 'e') + ' -->\\n';\n\n return comment + path_tag + point_tags + '\\n';\n }", "function downloadSVG() {\n var svg_root = document.getElementById('svg').outerHTML;\n var svgBlob = new Blob([svg_root], {type:\"image/svg+xml;charset=utf-8\"});\n var svgUrl = URL.createObjectURL(svgBlob);\n var downloadLink = document.createElement(\"a\");\n downloadLink.href = svgUrl;\n downloadLink.download = \"GeometricIllustration.svg\";\n document.body.appendChild(downloadLink);\n downloadLink.click();\n document.body.removeChild(downloadLink);\n}", "function saveAsPNG() {\n // draw to canvas...\n drawingCanvas.toBlob(function(blob) {\n saveAs(blob, \"canvas.png\");\n });\n }", "function exportImage() {\n console.log(\"clicked\");\n canvas = document.getElementsByTagName(\"canvas\");\n // document.write('<img src=\"'+canvas[0].toDataURL(\"image/png\")+'\"/>');\n var canvasURL = canvas[0].toDataURL(\"image/png\");\n console.log(\"image copied\")\n var img = document.getElementById(\"image1\").src = canvasURL;\n console.log(img);\n}", "function downloadPNG() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\");\n}", "function GetSGV() {\r\n var svg = project.exportSVG({ asString: true });\r\n console.log(svg);\r\n}", "function downloadSVG(sn) {\n // Generate piece.\n var piece = computePiece(sn, {\n cropped: $(\"#cropped\").prop('selected'), \n trapezoidal:$(\"#trapezoidal\").prop('selected')\n });\n \n // Output to SVG.\n var svg = drawSVG(piece, $(\"#tmpSvg svg\")[0]);\n svg.attr('viewBox', \n piece.bbox.x \n + \" \" + piece.bbox.y \n + \" \" \n + (piece.bbox.x2-piece.bbox.x) \n + \" \" \n + (piece.bbox.y2-piece.bbox.y)\n );\n svg.attr({fill: 'none', stroke: 'black', strokeWidth: 0.1});\n\n blob = new Blob([svg.outerSVG()], {type: \"image/svg+xml\"});\n saveAs(blob, sn + \".svg\");\n \n}", "function downloadSVG(){\n window.URL = window.webkitURL || window.URL;\n var contentType = 'image/svg+xml';\n var svgCode = $('#exportcode').val();\n var svgFile = new Blob([svgCode], {type: contentType});\n\n $('#aDownloadSvg').prop('download','pattern-bar.svg');\n $('#aDownloadSvg').prop('href',window.URL.createObjectURL(svgFile));\n // $('#aDownloadSvg').prop('textContent','<i class=\"fa fa-file-code-o\"></i> Download as SVG');\n}", "function Export() {\n\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(Canvas.toDataURL()));\n element.setAttribute('download', \"img\");\n element.style.display = 'none';\n document.body.appendChild(element);\n element.click();\n document.body.removeChild(element);\n}", "function exportPNG() {\n var exportCanvas = document.getElementById(\"myCanvas\");\n var dataURL = exportCanvas.toDataURL();\n\n if (window.navigator.msSaveBlob) {\n window.navigator.msSaveBlob(exportCanvas.msToBlob(), \"exportImage.png\");\n }\n else {\n const a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.href = exportCanvas.toDataURL();\n a.download = \"exportImage.png\";\n a.click();\n document.body.removeChild(a);\n }\n}", "function exportSvgClick(event) {\n // console.log('exportSvgClick');\n\n event.preventDefault();\n\n const filename = PageData.SavedImageTitle + '.svg';\n const svgXml = SvgModule.getSvgXml();\n\n Common.exportSvg(filename, svgXml);\n}", "function downloadPNG8x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 8});\n}", "function createSvg () {\r\n // Remove the existing one\r\n d3\r\n .select(canvasId)\r\n .selectAll('svg')\r\n .remove();\r\n // Create a new svg node\r\n svg = d3\r\n .select(canvasId)\r\n .append('svg:svg')\r\n .attr('width', 500)\r\n .attr('height', 500)\r\n .append('g') // Group all element to make alignment easier\r\n .attr('transform', function () { // Place in center of the page\r\n return 'translate(' + (500 / 2) + ', ' + (500 / 2) + ')';\r\n });\r\n }", "function drawSvg() {\n\t\t// selector can be #residential, or #commercial which should be in graph.html\n\t\tvar dataSources = [{selector: '#commercial', data: data.commGraphData}, \n\t\t\t{selector: '#residential', data: data.residGraphData}];\n\n\t\tdataSources.forEach(function(item) {\n\t\t\tvar canvas = createCanvas(item.selector, item.data);\n\t\t\tdrawHorizontalLabel(canvas);\n\t\t\tdrawVerticalLable(canvas, item.data);\n\t\t\tdrawHeatMap(canvas, item.data);\n\t\t});\n\t}", "function exportPNG() {\n var canvas = document.getElementById('myCanvas');\n var html = \"<img src='\" + canvas.toDataURL('image/png') + \"' />\"\n if ($.browser.msie) {\n window.winpng = window.open('/static/html/export.html');\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n } else {\n window.winpng = window.open();\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n }\n\n}", "function saveExternalSVG(){\r\n\tif(simulating)\r\n\t\treturn;\r\n\tvar svgCode = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"2000\" width=\"2000\" version=\"1.1\" viewBox=\"0 0 2000 2000\">\\n <g transform=\"translate(0 1000)\" fill=\"none\">\\n';\r\n\tsvgCode += ' <path d=\"M';\r\n\tfor(i = allGroundPointsX.length-1 ; i > -1 ; i--){\r\n\t\t//\t\trecord X and Y coordiantes with 2 decimal places with spaces between them\r\n\t\tsvgCode += \" \" + String(Math.round(allGroundPointsX[i]*500+100000)/100) + \" \" + String(Math.round(allGroundPointsY[i]*500)/100);\r\n\t\tif(i == 0 || !allGroundBreaks[i-1]){//\tfirst point of new line\r\n\t\t\tif(i == 0)//\t\tlast line\r\n\t\t\t\tsvgCode += '\" stroke=\"#000000\" stroke-width=\"1.5\"/>\\n';\r\n\t\t\telse\r\n\t\t\t\tsvgCode += '\" stroke=\"#000000\" stroke-width=\"1.5\"/>\\n <path d=\"M';\r\n\t\t}\r\n\t}\r\n\t\r\n\tsvgCode += ' <circle id=\"Goal\" cx=\"' + (Math.round(goalx*50+10000)/10) + '\" cy=\"' + (Math.round(-goaly*50)/10) + '\" r=\"' + (Math.round(goalr*50)/10) + '\" stroke=\"' + _goalColor + '\"/>\\n';\r\n\t\r\n\tfor(i = checkx.length-1 ; i > -1 ; i--){\r\n\t\t//\t\trecord X and Y coordinates with 1 decimal place with spaces between them\r\n\t\tsvgCode += ' <circle cx=\"' + (Math.round(checkx[i]*50+10000)/10) + '\" cy=\"' + (Math.round(-checky[i]*50)/10) + '\" r=\"' + (Math.round(checkr[i]*50)/10) + '\" stroke=\"' + _checkpointColor + '\"/>\\n';\r\n\t}\r\n\t\r\n\tsvgCode += ' </g>\\n</svg>';\r\n\t\r\n var downloadFile = document.createElement('a');\r\n\tdownloadFile.href = window.URL.createObjectURL(new Blob([svgCode], {type: 'text/svg'}));\r\n\tdownloadFile.download = 'Level.svg';\r\n\tdocument.body.appendChild(downloadFile);\r\n\tdownloadFile.click();\r\n\tdocument.body.removeChild(downloadFile);\r\n}", "function saveSVG(){\n\tsvg = \"<svg>\\n\\t\" + main.innerHTML + \"\\n</svg>\";\n\tvar link = document.createElement('a');\n\tmimeType = 'image/svg+xml' || 'text/plain';\n\tvar today = new Date();\n\tvar date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate() + '_' + today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n\tvar base = document.getElementsByName('base')[0].value;\n\tvar armWidth = document.getElementsByName('armWidth')[0].value;\n\tvar vertexExtrusion = document.getElementsByName('vertexExtrusion')[0].value;\n\tvar vertexDiameter = document.getElementsByName('vertexDiameter')[0].value;\n\tvar sideRadius = document.getElementsByName('sideRadius')[0].value;\n\tvar filename = 'Triangle_' + date + '_Base' + base + '_ArmWidth' + armWidth + \n\t\t'_VertexExtrusion' + vertexExtrusion + '_VertexDiameter' + vertexDiameter +\n\t\t'_SideRadius' + sideRadius + '.svg';\n\tlink.setAttribute('download', filename);\n\tlink.setAttribute('href', 'data:image/svg+xml; charset=utf-8,' + encodeURIComponent(svg));\n\tdocument.body.append(link);\n\tlink.click();\n\tdocument.body.removeChild(link);\n\tconsole.log(link);\n}", "function download_svg(doc_element_id,filename){\n var svg = document.getElementById(doc_element_id);\n var svgData = $(svg).find('svg')[0].outerHTML;\n var svgBlob = new Blob([svgData], {type:\"image/svg+xml;charset=utf-8\"});\n var svgUrl = URL.createObjectURL(svgBlob);\n var downloadLink = document.getElementById(\"svg-link\");\n downloadLink.href = svgUrl;\n downloadLink.download = filename+\".svg\";\n document.body.appendChild(downloadLink);\n downloadLink.click();\n}", "function downloadAsSVG(fileName) {\n // use default name if not provided\n fileName = fileName || \"output.svg\";\n\n // create a data url of the file\n var svgData = project.exportSVG({\n asString: true\n });\n var url = \"data:image/svg+xml;utf8,\" + encodeURIComponent(svgData);\n\n // create a link to the data, and \"click\" it\n var link = document.createElement(\"a\");\n link.download = fileName;\n link.href = url;\n link.click();\n}", "function exportPNG() {\n var canvas = document.getElementById('myCanvas');\n var html = \"<img src='\" + canvas.toDataURL('image/png') + \"' />\";\n if ($.browser.msie) {\n window.winpng = window.open('/static/html/export.html');\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n } else {\n window.winpng = window.open();\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n }\n\n}", "function downloadSVG() {\n\n var config = {\n filename: 'kappa_rulevis',\n }\n d3_save_svg.save(d3.select('#svg').node(), config);\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "function portfolioSVG() {\n return src(input)\n .pipe(svgSprite(config))\n .pipe(dest(output))\n}", "function saveSVG(callback) {\n\n\t//~console.log('Save graph image file...')\n\toutFileIndex++\n\t\n\tlet outputFileName = filePrefix + '-' + ('' + outFileIndex).padStart(4, '0') + '.svg'\n\t\n\tfs.writeFile(__dirname + '/../data/staging/svg/' + outputFileName, d3n.svgString(), function(err, res) {\n\t\tif (err)\n\t\t\tthrow err\n\t\t\n\t\tif (outFileIndex % 100 === 0)\n\t\t\tconsole.log('...' + outputFileName + ' saved')\n\t\t\n\t\tif (callback)\n\t\t\tcallback()\n\t\t\n\t})\n\n}", "serialize() {\n var svg = document.getElementsByTagName(\"svg\")\n var editor = atom.workspace.getActiveTextEditor()\n if(editor && (svg.length == 0)){\n this.createGraph(editor);\n }\n }", "function saveCanvas() {\n\tcanvas.isDrawingMode = false;\n\tdrawState = \"SELECT\";\n\tscd = JSON.stringify(canvas); // save canvas data\n\tconsole.log(scd);\n}", "function ioSVG_exportSVGfont() {\n\t\t// debug('\\n ioSVG_exportSVGfont - Start');\n\t\tvar ps = _GP.projectsettings;\n\t\tvar md = _GP.metadata;\n\t\tvar family = md.font_family;\n\t\tvar familyid = family.replace(/ /g, '_');\n\t\tvar timestamp = genDateStampSuffix();\n\t\tvar timeoutput = timestamp.split('-');\n\t\ttimeoutput[0] = timeoutput[0].replace(/\\./g, '-');\n\t\ttimeoutput[1] = timeoutput[1].replace(/\\./g, ':');\n\t\ttimeoutput = timeoutput.join(' at ');\n\n\t\tvar con = '<?xml version=\"1.0\"?>\\n'+\n\t\t\t// '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" >\\n'+\n\t\t\t'<svg width=\"100%\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\\n'+\n\t\t\t'\\t<metadata>\\n\\n'+\n\t\t\t'\\t\\tProject: ' + ps.name + '\\n'+\n\t\t\t'\\t\\tFont exported on ' + timeoutput + '\\n\\n'+\n\t\t\t'\\t\\tCreated with Glyphr Studio - the free, web-based font editor\\n'+\n\t\t\t'\\t\\t' + _UI.thisGlyphrStudioVersion + '\\n'+\n\t\t\t'\\t\\t' + _UI.thisGlyphrStudioVersionNum + '\\n\\n'+\n\t\t\t'\\t\\tFind out more at www.glyphrstudio.com\\n\\n'+\n\t\t\t'\\t</metadata>\\n'+\n\t\t\t'\\t<defs>\\n'+\n\t\t\t'\\t\\t<font id=\"'+escapeXMLValues(familyid)+'\" horiz-adv-x=\"'+ps.upm+'\">\\n'+\n\t\t\t'\\t\\t\\t<font-face\\n'+ ioSVG_makeFontFace()+'\\n'+\n\t\t\t'\\t\\t\\t\\t<font-face-src>\\n'+\n\t\t\t'\\t\\t\\t\\t\\t<font-face-name name=\"'+escapeXMLValues(family)+'\" />\\n'+\n\t\t\t'\\t\\t\\t\\t</font-face-src>\\n'+\n\t\t\t'\\t\\t\\t</font-face>\\n';\n\n\t\tcon += '\\n';\n\t\tcon += ioSVG_makeMissingGlyph();\n\t\tcon += '\\n\\n';\n\t\tcon += ioSVG_makeAllGlyphsAndLigatures();\n\t\tcon += '\\n';\n\t\tcon += ioSVG_makeAllKernPairs();\n\t\tcon += '\\n';\n\n\t\tcon += '\\t\\t</font>\\n'+\n\t\t\t'\\t</defs>\\n\\n';\n\n\t\t// con += '\\t<style type=\"text/css\">\\n';\n\t\t// con += '\\t\\t@font-face {\\n';\n\t\t// con += '\\t\\t\\tfont-family: \"'+family+'\", monospace;\\n';\n\t\t// con += '\\t\\t\\tsrc: url(#'+familyid+');\\n';\n\t\t// con += '\\t\\t}\\n';\n\t\t// con += '\\t</style>\\n\\n';\n\n\t\tcon += '\\t<text x=\"100\" y=\"150\" style=\"font-size:48px;\" font-family=\"'+family+'\">'+family+'</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"220\" style=\"font-size:48px;\" font-family=\"'+family+'\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"290\" style=\"font-size:48px;\" font-family=\"'+family+'\">abcdefghijklmnopqrstuvwxyz</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"360\" style=\"font-size:48px;\" font-family=\"'+family+'\">1234567890</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"430\" style=\"font-size:48px;\" font-family=\"'+family+'\">!\\\"#$%&amp;\\'()*+,-./:;&lt;=&gt;?@[\\\\]^_`{|}~</text>\\n';\n\n\t\tcon += '</svg>';\n\n\t\tvar filename = ps.name + ' - SVG Font - ' + timestamp + '.svg';\n\n\t\tsaveFile(filename, con);\n\n\t\t// debug(' ioSVG_exportSVGfont - END\\n');\n\t}", "function download() {\n const a = document.createElement(\"a\");\n\n document.body.appendChild(a);\n a.href = canvas.toDataURL();\n a.download = \"canvas.png\";\n a.click();\n document.body.removeChild(a);\n}", "function configureExportSVG(glyphsGB) { \n if(!glyphsGB) { return; }\n if(!glyphsGB.navCtrls) { return; }\n \n var divFrame = glyphsGB.settings_panel;\n if(!divFrame) { \n divFrame = document.createElement('div'); \n glyphsGB.settings_panel = divFrame;\n }\n glyphsGB.navCtrls.appendChild(glyphsGB.settings_panel);\n \n var navRect = glyphsGB.navCtrls.getBoundingClientRect();\n \n divFrame.setAttribute('style', \"position:absolute; text-align:left; padding: 3px 3px 3px 3px; \" \n +\"background-color:rgb(235,235,240); \" \n +\"border:2px solid #808080; border-radius: 4px; \"\n +\"left:\"+(navRect.left+window.scrollX+glyphsGB.display_width-370)+\"px; \"\n +\"top:\"+(navRect.top+window.scrollY+20)+\"px; \"\n +\"width:350px; z-index:90; \"\n );\n divFrame.innerHTML = \"\";\n var tdiv, tdiv2, tspan1, tspan2, tinput, tcheck;\n\n var exportConfig = glyphsGB.exportSVGconfig;\n\n //close button\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv.setAttribute('style', \"float:right; margin: 0px 4px 4px 4px;\");\n var a1 = tdiv.appendChild(document.createElement('a'));\n a1.setAttribute(\"target\", \"top\");\n a1.setAttribute(\"href\", \"./\");\n a1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); return false; }\n var img1 = a1.appendChild(document.createElement('img'));\n img1.setAttribute(\"src\", eedbWebRoot+\"/images/close_icon16px_gray.png\");\n img1.setAttribute(\"width\", \"12\");\n img1.setAttribute(\"height\", \"12\");\n img1.setAttribute(\"alt\",\"close\");\n\n //title\n tdiv = document.createElement('div');\n tdiv.style = \"font-weight:bold; font-size:14px; padding: 5px 0px 5px 0px;\"\n tdiv.setAttribute('align', \"center\");\n tdiv.innerHTML = \"Export view as SVG image\";\n divFrame.appendChild(tdiv);\n\n //----------\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tdiv2.setAttribute('style', \"float:left; width:200px;\");\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_widgets) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'widgets', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"hide widgets\";\n\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.savefile) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'savefile', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"save to file\";\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_sidebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'sidebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide track sidebars\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_titlebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'titlebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide title bar\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_experiment_graph) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'experiments', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide experiment/expression graph\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_compacted_tracks) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'compacted_tracks', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide compacted tracks\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n //----------\n divFrame.appendChild(document.createElement('hr'));\n //----------\n var button1 = document.createElement('input');\n button1.type = \"button\";\n button1.className = \"medbutton\";\n button1.value = \"cancel\";\n button1.style.float = \"left\"; \n button1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); }\n divFrame.appendChild(button1);\n\n var button2 = document.createElement('input');\n button2.type = \"button\";\n button2.className = \"medbutton\";\n button2.value = \"export svg\";\n button2.style.float = \"right\"; \n button2.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-accept'); }\n divFrame.appendChild(button2);\n}", "_createSVG() {\n\t\t\treturn d3.select(this._container)\n\t\t\t\t.append('svg');\n\t\t}", "function exportChart(chart) {\n chart.exportChart({format: \"jpg\"});\n}", "function createPng() {\n\n var newImg, canva, ctx, form, filename, fake, imgSrc, link, servePng;\n link = $('.svgtopng');\n servePng = link.parent().find('.serve-png')\n fake = link.parent().find('.preload-png');\n link.addClass('d-none');\n fake.removeClass('d-none');\n\n filename = servePng.attr('download');\n imgSrc = link.data('path')+'.svg';\n\n newImg = new Image();\n canva = document.createElement(\"canvas\"); \n ctx = canva.getContext(\"2d\"); \n form = $('#svgtopng');\n\n newImg.onload = function() {\n var newImgW = (newImg.width*2);\n var newImgH = (newImg.height*2);\n canva.width = newImgW;\n canva.height = newImgH;\n ctx.drawImage(newImg, 0, 0, newImgW, newImgH);\n var dataURL = canva.toDataURL();\n $.ajax({\n type: \"POST\",\n url: relative + \"ajax/png.php\",\n cache: false,\n data: {imgdata: dataURL, filename: filename}\n })\n .fail(function(error) {\n bootbox.alert(error.statusText);\n })\n .done(function(msg) {\n if (msg == 'error') {\n bootbox.alert({\n message: \"File not found\",\n size: 'small'\n });\n } else {\n fake.addClass('d-none');\n link.removeClass('d-none');\n servePng[0].click();\n }\n });\n }\n newImg.src = imgSrc; // this must be done AFTER setting onload\n }", "function exportPngClick(event) {\n // console.log('exportPngClick');\n\n event.preventDefault();\n\n if (Common.isIE) return;\n\n const background = window.getComputedStyle(document.body).backgroundColor;\n const filename = PageData.SavedImageTitle + '.png';\n const svgXml = SvgModule.getSvgXml();\n\n Common.exportPng(filename, svgXml, background);\n}" ]
[ "0.7611495", "0.760116", "0.7534128", "0.7454485", "0.74182296", "0.72102493", "0.71317697", "0.7026638", "0.69958067", "0.686196", "0.68500465", "0.67527467", "0.6705932", "0.669488", "0.6677252", "0.6640134", "0.66087085", "0.6607238", "0.65885", "0.658524", "0.6525618", "0.65045756", "0.6458751", "0.6452541", "0.6444493", "0.6435622", "0.64227355", "0.6366613", "0.6346368", "0.63244605", "0.6311413", "0.6307946", "0.6267725", "0.6258657", "0.62562233", "0.6253525", "0.62227726", "0.6220886", "0.62153286", "0.6200897", "0.616066", "0.6159206", "0.61226666", "0.61226666", "0.61226666", "0.61226666", "0.61226666", "0.61226666", "0.61226666", "0.61226666", "0.61226666", "0.6107942", "0.6104599", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6098836", "0.6065879", "0.60515153", "0.6006844", "0.60019416", "0.5976514", "0.59670585", "0.59424967", "0.5919115", "0.59064764", "0.59060186", "0.58517736" ]
0.77538526
0
Saves a diagram. Actually send the serialized version of diagram for saving
function saveAs() { var dataURL = renderedCanvas(); // var $diagram = {c:canvas.save(), s:STACK, m:CONNECTOR_MANAGER}; var $diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion}; var $serializedDiagram = JSON.stringify($diagram); // $serializedDiagram = JSON.stringify($diagram, Util.operaReplacer); var svgDiagram = toSVG(); //save the URLs of figures as a CSV var lMap = linkMap(); //alert($serializedDiagram); //see: http://api.jquery.com/jQuery.post/ $.post("./common/controller.php", {action: 'saveAs', diagram: $serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram}, function(data) { if (data == 'noaccount') { Log.info('You must have an account to use that feature'); //window.location = '../register.php'; } else if (data == 'step1Ok') { Log.info('Save as...'); window.location = './saveDiagram.php'; } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save() {\n\n //alert(\"save triggered! diagramId = \" + diagramId );\n Log.info('Save pressed');\n\n if (state == STATE_TEXT_EDITING) {\n currentTextEditor.destroy();\n currentTextEditor = null;\n state = STATE_NONE;\n }\n\n var dataURL = null;\n try {\n dataURL = renderedCanvas();\n }\n catch (e) {\n if (e.name === 'SecurityError' && e.code === 18) {\n /*This is usually happening as we load an image from another host than the one Diagramo is hosted*/\n alert(\"A figure contains an image loaded from another host. \\\n \\n\\nHint: \\\n \\nPlease make sure that the browser's URL (current location) is the same as the one saved in the DB.\");\n }\n }\n\n// Log.info(dataURL);\n// return false;\n if (dataURL == null) {\n Log.info('save(). Could not save. dataURL is null');\n alert(\"Could not save. \\\n \\n\\nHint: \\\n \\nCanvas's toDataURL() did not functioned properly \");\n return;\n }\n\n var diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n //Log.info('stringify ...');\n// var serializedDiagram = JSON.stringify(diagram, Util.operaReplacer);\n var serializedDiagram = JSON.stringify(diagram);\n// Log.error(\"Using Util.operaReplacer() somehow break the serialization. o[1,2] \\n\\\n// is transformed into o.['1','2']... so the serialization is broken\");\n// var serializedDiagram = JSON.stringify(diagram);\n //Log.info('JSON stringify : ' + serializedDiagram);\n\n var svgDiagram = toSVG();\n\n// alert(serializedDiagram);\n// alert(svgDiagram);\n //Log.info('SVG : ' + svgDiagram);\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\",\n {action: 'save', diagram: serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram, diagramId: currentDiagramId},\n function(data) {\n if (data === 'firstSave') {\n Log.info('firstSave!');\n window.location = './saveDiagram.php';\n }\n else if (data === 'saved') {\n //Log.info('saved!');\n alert('saved!');\n }\n else {\n alert('Unknown: ' + data);\n }\n }\n );\n\n\n}", "function save() {\n saveDiagramProperties();\t// do this first, before writing to JSON\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n}", "function save() {\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n }", "function save() {\n\t\tdocument.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n\t\tmyDiagram.isModified = false;\n\t}", "function save() {\r\n document.getElementById('mySavedModel').value = myDiagram.model.toJson();\r\n myDiagram.isModified = false;\r\n}", "function save() {\r\n\t\tvar str = myDiagram.model.toJson();\r\n\t\tdocument.getElementById(\"mySavedModel\").value = str;\r\n\t }", "function save() {\n str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "function save() {\n str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "function saveNav() {\n saveNavDiagramProperties(); // do this first, before writing to JSON\n document.getElementById(\"mySavedNavModel\").value = navDiagram.model.toJson();\n navDiagram.isModified = false;\n}", "function saveDiagram()\n{\n var obj=JSON.stringify(myDiagram);\n console.log(obj);\n \n var http = new XMLHttpRequest();\n var url = 'saveDiagram.php';\n var params = 'nombreDiagrama='+myDiagram.name+'&data='+obj;\n http.open('POST', url, true);\n\n //Send the proper header information along with the request\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n http.onreadystatechange = function() {//Call a function when the state changes.\n if(http.readyState == 4 && http.status == 200) {\n alert(http.responseText);\n console.log(http.responseText);\n }\n}\n http.send(params);\n\n}", "function saveJSON() {\n cJsonF = canvas.toJSON();\n info(\"<img src='assets/img/web/preload-2.gif'>\");\n $.post('core/action-design.php', {\n 'act': 'save_design',\n 'b': 'new',\n 'c': JSON.stringify(cJsonF)\n })\n .done(function(data) {\n info(\"<label style='color:green'>Success saving design</label>\");\n })\n .fail(function() {\n info(\"<label style='color:red'>Failed to save design</label>\");\n });\n }", "function saveDocument() {\n if (checkLocalStorage()) {\n var saveName = getCurrentFileName();\n if (saveName === UnsavedFileName) {\n saveDocumentAs();\n } else {\n saveDiagramProperties()\n window.localStorage.setItem(saveName, myDiagram.model.toJson());\n myDiagram.isModified = false;\n }\n }\n}", "function setupDiagram() {\n myFullDiagram.model = go.Model.fromJson(document.getElementById(\"mySavedModel\").value);\n}", "function saveDiagramProperties() {\n myDiagram.model.modelData.position = go.Point.stringify(myDiagram.position);\n}", "function loadSavedDiagram() {\n // console.log('loadSavedDiagram');\n\n if (!window.location.hash) {\n showError('Missing saved diagram details');\n return;\n }\n\n const end = window.location.hash.indexOf('-blank');\n if (end !== -1) {\n PageData.Filename = window.location.hash.substring(2, end);\n } else {\n PageData.Filename = window.location.hash.substring(2);\n }\n\n const json = localStorage.getItem(PageData.Filename);\n if (!json) {\n showError('Failed to load saved diagram');\n return;\n }\n\n const data = JSON.parse(json);\n if (!data || !data.SvgXml) {\n showError('Failed to process saved diagram data');\n return;\n }\n\n PageData.SavedImageTitle = data.Title;\n\n document.title = 'Saved diagram: ' + PageData.SavedImageTitle + ' | M365 Maps';\n\n const svgXml = data.SvgXml\n .replace(/<!--.*-->/i, '')\n .replace(/<\\?xml.*\\?>/i, '')\n .replace(/<!doctype.*>/i, '')\n .replace(/^[\\n\\r]+/, '');\n\n SvgModule.Data.Tag = Common.createElementFromHtml(svgXml);\n document.body.appendChild(SvgModule.Data.Tag);\n\n SvgModule.injectHighlightStyles();\n SvgModule.sizeSvg();\n SvgModule.registerEvents();\n\n if (SvgModule.Data.Tag.style.filter !== '')\n readFilterValuesfromSvg();\n\n filterChange();\n}", "async function exportDiagram() {\n\n try {\n\n var result = await bpmnModeler.saveXML({ format: true });\n\n // alert('Diagram exported. Check the developer tools!');\n\n console.log('DIAGRAM', result.xml);\n } catch (err) {\n\n console.error('could not save BPMN 2.0 diagram', err);\n }\n }", "function savePaper() {\n\t// get the paper with its annotations from the div\n\t// alert($('mainpage').down(1));\n\t// pass on the comments info\n\tcomments = $('comment').getValue();\n\ttitle = $$('title').reduce().readAttribute('filename');\n\t// alert(titleElem.readAttribute('filename'));\n\t// objJSON={\n\t// \"conceptHash\": conceptHash\n\t// };\n\t// var strJSON = encodeURIComponent(JSON.stringify(objJSON));\n\t//alert('109: ' + subTypeHash.get(109));\n\t//alert('113: ' + subTypeHash.get(113));\n\tvar conceptJSON = Object.toJSON(conceptHash);\n\tvar subtypeJSON = Object.toJSON(subTypeHash);\n\t// alert(\"The strJSON is \" + strJSON);\n\n\tnew Ajax.Request('ART?action=savePaperMode2', {\n\t\tmethod :'post',\n\t\tparameters : {\n\t\t\tname :title,\n\t\t\tcomment :comments,\n\t\t\tconceptJSON :conceptJSON,\n\t\t\tsubtypeJSON :subtypeJSON\n\t\t},\n\t\t// response goes to\n\t\tonComplete :notify('save', null)\n\t});\n\n}", "function menuSaveClick(event) {\n // console.log('menuSaveClick');\n\n event.preventDefault();\n\n let diagramTitle = PageData.SavedImageTitle;\n let storageKey = Date.now().toString();\n\n let overwrite = Common.customConfirm('Overwrite existing diagram?');\n if (overwrite) {\n storageKey = PageData.Filename;\n } else {\n diagramTitle = Common.customPrompt('Save diagram as:', diagramTitle);\n if (!diagramTitle) return;\n }\n\n const svgXml = SvgModule.getSvgXml();\n const svgObject = { Title: diagramTitle, SvgXml: svgXml };\n const jsonData = JSON.stringify(svgObject);\n localStorage.setItem(storageKey, jsonData);\n}", "function save() { \n const a = document.createElement(\"a\") \n const settings = { atype: \"setting\", canvasWidth: currentCanvasSizeX, canvasHeight: currentCanvasSizeY, foreTexture: document.getElementById('foreImage').dataset.aid, backTexture: document.getElementById('backImage').dataset.aid }\n const symbols = { atype : \"symbol\", contents : actionArray } \n const paths = { atype : \"path\", contents : pathRawArray } \n const obj = { settings: settings, symbols: symbols, paths: paths }\n a.href = URL.createObjectURL(new Blob([JSON.stringify(obj)], {type: \"text/plain; charset=utf-8\"}))\n a.setAttribute(\"download\", \"data.json\")\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n }", "function save() {\n var dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(lastSketch));\n var downloadAnchorNode = document.createElement('a');\n downloadAnchorNode.setAttribute(\"href\", dataStr);\n downloadAnchorNode.setAttribute(\"download\", \"test.json\");\n document.body.appendChild(downloadAnchorNode); // required for firefox\n downloadAnchorNode.click();\n downloadAnchorNode.remove();\n }", "function showModel() {\n document.getElementById(\"mySavedModel\").textContent = myDiagram.model.toJson();\n }", "function saveDocumentAs() {\n if (checkLocalStorage()) {\n var saveName = prompt(\"Save file as...\", getCurrentFileName());\n if (saveName && saveName !== UnsavedFileName) {\n setCurrentFileName(saveName);\n saveDiagramProperties()\n window.localStorage.setItem(saveName, myDiagram.model.toJson());\n myDiagram.isModified = false;\n }\n }\n}", "function saveSVG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n saveAs(blob, getFilenameWithoutExtension(curFilename) + \".svg\");\n}", "function saveLayout() {\n var layout = []\n layout.push(myDiagram.model.nodeDataArray)\n layout.push(myDiagram.model.linkDataArray)\n var summarized = document.getElementById(\"summarized\").checked\n var save = prompt(\"Please enter a layout name\"); \n\t\tif (save != null) {\t\t\n\t\t\t\tvar data = {\n\t\t\t\t\t'name':save,\n\t\t\t\t\t\"layout\":layout,\n\t\t\t\t\t\"state\":summarized\n\t\t\t\t};\n\t\t\t\n\t\t\t/*send layout data to back end*/\n\t\t\t$.ajax({\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata: JSON.stringify(data),\n\t\t\t\t\tcontentType: 'application/json',\n\t\t\t\t\turl: '/save_layout',\n\t\t\t\t\tsuccess:function(text){\n\t\t\t\t\t\t//alert(text);\n\t\t\t\t\t}\n\t\t\t});\n\t\t}\n }", "saveDrawing(){\n var self = this;\n if(this.drawingHelper.canvas.toBlob) {\n this.drawingHelper.canvas.toBlob(function(blob){\n $(self.refs.myCanvas).data('changed', CONSTANTS.VALUES.TRUE)\n var blobUrl = URL.createObjectURL(blob)\n $(self.refs.preview_image).attr('src', blobUrl)\n self.modal.close()\n })\n }\n }", "function save() {\n //get all metadata entered by the user\n type = $(\"#type\")[0].value;\n material1 = $(\"#mat1\")[0].innerText;\n material2 = $(\"#mat2\")[0].innerText;\n description = $(\"#desc\")[0].value;\n newton = $(\"#newton\")[0].value;\n curve = JSON.stringify(processedData);\n //use jQuerys ajax request to post all data to a php script\n $.post(\"./php_helper/savedata.php\", {\n type: type,\n material1: material1,\n material2: material2,\n description: description,\n newton: newton,\n curve: curve\n }, function (data) {\n showPopup(\"save_success\");\n }).fail(function () {\n showPopup(\"save_fail\")\n });\n}", "function saveFile(fileName) {\r\n\tvar draw_canvas = document.getElementById('visible');\r\n\tvar image = draw_canvas.toDataURL(\"image/png\");\r\n\tif (fileName != null) {\r\n\t\tsocket.emit(\"appDrawingSave\", image, fileName, function (message) {\r\n\t\t\tif (message.error) {\r\n\t\t\t\tconsole.error(message.error);\r\n\t\t\t\tshowItemSaveNotice(message.error);\r\n\t\t\t} else if (message.fileName) {\r\n\t\t\t\tshowItemSaveNotice(\"saved \" + message.fileName + \" successfully\");\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(message);\r\n\t\t\t\tshowItemSaveNotice(\"Someting went wrong\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "async save( path ) {}", "function onSaveSVG(trans,params) {\n\tlog(\"onSaveSVG nameSVG=\"+params['nameSVG']+\" stringSVG=\"+params['stringSVG']);\n\tvar stringSVG = params['stringSVG'];\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.open(\"PUT\", svgURL, true);\n\txmlhttp.setRequestHeader(\"Content-Type\", \"image/svg+xml; charset=utf-8\");\n\txmlhttp.setRequestHeader(\"Content-Length\", stringSVG.length);\n\txmlhttp.send(stringSVG);\n\txmlhttp.onload = function() {\n\t\tlog(\"saved\");\n\t}\n\treturn \"save done\";\n}", "function saveSVG(){\n\t\t\tvar blob = new Blob([canvas.toSVG()], {type: \"text/plain;charset=utf-8\"});\n\t\t\tsaveAs(blob, \"download.svg\");\n\n\t\t}", "saveImage() {\n console.log(this.stripStyles(this.state.svgString));\n canvg('canvas', this.stripStyles(this.state.svgString));\n document.getElementById('canvas').toBlob((blob) => {\n saveAs(blob, `tri2-${new Date().toISOString()}.png`);\n });\n }", "render(diagram, format, savePath) {\n return this.createTask(diagram, \"-pipe\", savePath, format);\n }", "function saveImagen() {\n\t$(\"#btnGuardar3\").hide();\n\t$(\"#mensajeTemporal3\").show();\n\t$(\"#inmueble_subirImagen\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idInmueble\").val(positions[pos_comp].id);\n\tif (inmueble_pos_comp == -1) {\n\t\t$(\"#nuevo\").val(\"1\");\n\t\t$(\"#modificar\").val(\"0\");\n\t\t$(\"#idInmuebleInmueble\").val(\"0\");\n\t}\n\telse {\n\t\t$(\"#nuevo\").val(\"0\");\n\t\t$(\"#modificar\").val(\"1\");\n\t\t$(\"#idInmuebleInmueble\").val(inmueble_positions[inmueble_pos_comp][0]);\n\t}\n\t\n\t\n\t$(\"#subirImagen\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar3\").show();\n\t\t\t$(\"#mensajeTemporal3\").hide();\n\t\t\t$(\"#inmueble_subirImagen\").css({cursor:\"default\"});\n\t\t\t\n\t\t\tinmueble_cerrarPopUp2();\n\t\t\tinmueble_imagenInmuebleCampos(pos_comp, respuesta_json.datos);\n\t\t}\n\t});\n}", "function saveImagen() {\n\t$(\"#btnGuardar3\").hide();\n\t$(\"#mensajeTemporal3\").show();\n\t$(\"#inmueble_subirImagen\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idInmueble\").val(positions[pos_comp].id);\n\tif (inmueble_pos_comp == -1) {\n\t\t$(\"#nuevo\").val(\"1\");\n\t\t$(\"#modificar\").val(\"0\");\n\t\t$(\"#idInmuebleInmueble\").val(\"0\");\n\t}\n\telse {\n\t\t$(\"#nuevo\").val(\"0\");\n\t\t$(\"#modificar\").val(\"1\");\n\t\t$(\"#idInmuebleInmueble\").val(inmueble_positions[inmueble_pos_comp][0]);\n\t}\n\t\n\t\n\t$(\"#subirImagen\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar3\").show();\n\t\t\t$(\"#mensajeTemporal3\").hide();\n\t\t\t$(\"#inmueble_subirImagen\").css({cursor:\"default\"});\n\t\t\t\n\t\t\tinmueble_cerrarPopUp2();\n\t\t\tinmueble_imagenInmuebleCampos(pos_comp, respuesta_json.datos);\n\t\t}\n\t});\n}", "save(){\n\t\tvar dataString = JSON.stringify(this.getData());\n\t\tfs.writeFile('app/json/saveData.txt', dataString);\n\t}", "function saveDocument(fn) {\r\n\t\tif (checkLocalStorage()) {\r\n\t\t var currentFile = document.getElementById(\"currentFile\");\r\n\t\t var str = myDiagram.model.toJson();\r\n\t\t var id = document.getElementById(\"pasientId\").value;\r\n\t\t var vid = document.getElementById(\"vaktrapportId\").value;\r\n\r\n\t\t if (window.XMLHttpRequest) {\r\n\t\t\txmlhttp=new XMLHttpRequest();\r\n\t\t } \r\n\t\t else { \r\n\t\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t }\r\n\t\t xmlhttp.onreadystatechange=function() {\r\n\t\t \tif (xmlhttp.readyState==4 && xmlhttp.status==200) {\r\n if(typeof(fn) == 'function') {\r\n fn(xmlhttp);\r\n } else {\r\n alert(xmlhttp.responseText);\r\n }\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(id>0)\r\n\t\t{\r\n\t\t xmlhttp.open(\"POST\",\"saveVaktrapport.php\",true);\r\n\t\t xmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\r\n\t\t xmlhttp.send(\"q=\"+str+\"&id=\"+id+\"&vid=\"+vid);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\talert(\"Please Try Again\");\r\n\t\t}\r\n\t\t // alert(str);\r\n\t\t // exit();\r\n\t\t localStorage.setItem(currentFile.textContent, str);\r\n\t\t myDiagram.isModified = false;\r\n\t\t}\r\n\t }", "function saveToServer() {\r\n //indicate that a save is in progress\r\n uploadInProgress = true;\r\n // define the action for the post\r\n if (currentPage.status == \"added\")\r\n action = \"newPage\";\r\n else if (currentPage.status == \"deleted\")\r\n action = \"deletePage\";\r\n else action = \"updatePage\";\r\n \r\n // create lists of newly added, changed, and deleted entities\r\n var addedEntities = [];\r\n var changedEntities = [];\r\n var deletedEntities = [];\r\n for (var i = 0; i < entityList.length; ++i) {\r\n if (entityList[i].status == \"added\")\r\n addedEntities.push(new ModelEntity(entityList[i]));\r\n else if (entityList[i].status == \"deleted\")\r\n deletedEntities.push(new ModelEntity(entityList[i]));\r\n else if (entityList[i].changed)\r\n changedEntities.push(new ModelEntity(entityList[i]));\r\n }\r\n \r\n // create lists of newly added, changed, and deleted pages\r\n var addedPages = [];\r\n var changedPages = [];\r\n var deletedPages = [];\r\n for (var i = 0; i < pageList.length; ++i) {\r\n if (pageList[i].status == \"added\")\r\n addedPages.push(pageList[i]);\r\n else if (pageList[i].status == \"deleted\")\r\n deletedPages.push(pageList[i]);\r\n else if (pageList[i].changed)\r\n changedPages.push(pageList[i]);\r\n }\r\n \r\n // Create a canvas element from the previewDiv using the html2canvas library.\r\n html2canvas(pagePreviewDiv, {\r\n onrendered: function(canvas) {\r\n console.log(\"Snapshot successful\");\r\n \r\n // Set the page's image property to the data url from the canvas.\r\n currentPage.audio = canvas.toDataURL();\r\n \r\n // create and send the message\r\n $.post(\"/ShowAndTell/Controller\", {\r\n \"action\" : \"updateLecture\",\r\n \"lecture\" : JSON.stringify(new ModelLecture(currentLecture)),\r\n \"newEntities\" : JSON.stringify(addedEntities),\r\n \"changedEntities\" : JSON.stringify(changedEntities),\r\n \"deletedEntities\" : JSON.stringify(deletedEntities),\r\n \"newPages\" : JSON.stringify(addedPages),\r\n \"updatedPages\" : JSON.stringify(changedPages),\r\n \"deletedPages\" : JSON.stringify(deletedPages)}, processSaveResponse);\r\n // set a timeout for 10s to alert user and reset awaitingResponse in case the server could not be reached/does not respond\r\n setTimeout(function() {\r\n if (uploadInProgress)\r\n alert(\"Connection Timeout: unable to connect to server\");\r\n uploadInProgress = false;\r\n }, 10000);\r\n } \r\n });\r\n}", "async save(code, styles, mermaidCode, diagramType) {\n if (!this._loaded) {\n throw new Error('You have to call load before calling save()')\n }\n const key = this._key || uuidv4()\n this._confluence.saveMacro({uuid: key, updatedAt: new Date()}, code)\n const versionNumber = this._versionNumber\n const contentProperty = {\n key: this.propertyKey(key),\n value: {code, styles, mermaidCode, diagramType},\n version: {\n number: versionNumber ? versionNumber + 1 : 1\n }\n }\n await this.setContentProperty(contentProperty)\n }", "function saveCanvas() {\n\tcanvas.isDrawingMode = false;\n\tdrawState = \"SELECT\";\n\tscd = JSON.stringify(canvas); // save canvas data\n\tconsole.log(scd);\n}", "function saveCanvas() {\n // Generate SVG.\n var save_button = $('#save');\n var save_svg = $('#canvas').innerHTML.replace('<svg', '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n var data_uri = 'data:image/svg+xml;base64,' + window.btoa(save_svg);\n var filename = 'bustashape-' + window.location.hash.replace('#', '') + '-' + Date.now() + '.svg';\n\n // Prep link for new download.\n save_button.setAttribute('href', data_uri);\n save_button.setAttribute('download', filename);\n}", "function save() {\n // clear the redo stack\n redo = [];\n $('#redo').prop('disabled', true);\n // initial call won't have a state\n if (state) {\n undo.push(state);\n $('#undo').prop('disabled', false);\n }\n state = JSON.stringify(canvas);\n }", "function saveJS() {\n var image = new Image();\n image.src = canvas.toDataURL(\"image/png\", 1.0);\n \n var form = document.createElement('form');\n form.setAttribute('method', 'post');\n form.setAttribute('action', './php/save.php');\n form.setAttribute('id', 'saveForm');\n \n var imgData = document.createElement('input');\n imgData.setAttribute('type', 'hidden');\n imgData.setAttribute('name', 'sketch');\n imgData.setAttribute('value', image.src);\n\n var skchData = document.createElement('input');\n skchData.setAttribute('type', 'hidden');\n skchData.setAttribute('name', 'sketchid');\n skchData.setAttribute('value', 1);\n\n //Submit form to save.php, but redirect user to blank iframe to \n //let them stay on the drawing page\n var hiddenFrame = document.getElementById('saveFormAccept');\n form.setAttribute('target', hiddenFrame.getAttribute('name'));\n\n form.appendChild(imgData);\n form.appendChild(skchData);\n document.body.appendChild(form);\n form.submit();\n //alert(\"Sketch saved!\");\n}", "function exportCanvas() {\n //export canvas as SVG\n var v = '<svg width=\"300\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\\\n <rect x=\"0\" y=\"0\" height=\"200\" width=\"300\" style=\"stroke:#000000; fill: #FFFFFF\"/>\\\n <path d=\"M100,100 C200,200 100,50 300,100\" style=\"stroke:#FFAAFF;fill:none;stroke-width:3;\" />\\\n <rect x=\"50\" y=\"50\" height=\"50\" width=\"50\"\\\n style=\"stroke:#ff0000; fill: #ccccdf\" />\\\n </svg>';\n\n\n\n //get svg\n var canvas = getCanvas();\n\n var v2 = '<svg width=\"' + canvas.width + '\" height=\"' + canvas.height + '\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">';\n v2 += STACK.toSVG();\n v2 += CONNECTOR_MANAGER.toSVG();\n v2 += '</svg>';\n alert(v2);\n\n //save SVG into session\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"../common/controller.php\", {action: 'saveSvg', svg: escape(v2)},\n function(data) {\n if (data == 'svg_ok') {\n //alert('SVG was save into session');\n }\n else if (data == 'svg_failed') {\n Log.info('SVG was NOT save into session');\n }\n }\n );\n\n //open a new window that will display the SVG\n window.open('./svg.php', 'SVG', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');\n}", "serialize() {\n var svg = document.getElementsByTagName(\"svg\")\n var editor = atom.workspace.getActiveTextEditor()\n if(editor && (svg.length == 0)){\n this.createGraph(editor);\n }\n }", "function saveMedicationPlan() {\n var\n currentActivitySectionViewModel = peek( self && self.currentActivitySectionViewModel ),\n medicationPlanEditor = currentActivitySectionViewModel && peek( currentActivitySectionViewModel.currentActivityEditor ),\n data,\n medications = [];\n\n if( medicationPlanEditor ) {\n data = medicationPlanEditor.medicationTable && peek( medicationPlanEditor.medicationTable.rows ) || [];\n data.forEach( function( viewModel ) {\n if( viewModel.isModified() || viewModel.isNew() ) {\n medications.push( viewModel.toJSON() );\n }\n } );\n\n Y.doccirrus.jsonrpc.api.activity.saveMedicationPlan( {\n data: {\n medicationPlan: currentActivity.toJSON(),\n medications: medications\n }\n } )\n .done( function(){\n currentActivity.setNotModified();\n binder.navigateToCaseFileBrowser({\n refreshCaseFolder: true\n });\n })\n .fail( function( error ) {\n Y.Array.invoke( Y.doccirrus.errorTable.getErrorsFromResponse( error ), 'display' );\n } );\n }\n }", "function save() {\n storage.write(filename, data);\n }", "function saveTransform(){\n var visTransforms = {};\n // for (var key = 0; key < data.length; key++) {\n for (var key in data) {\n var transformObject = d3.transform(d3.select(\"#vis\"+key).select(\"g\").attr(\"transform\"));\n visTransforms[key] = {\n // \"index\": key,\n \"scale\": parseFloat(transformObject.scale[0]),\n \"translatex\": parseFloat(transformObject.translate[0]),\n \"translatey\": parseFloat(transformObject.translate[1])\n };\n }\n // console.log(visTransforms);\n\n // send scale and translation data to the server to save\n $.ajax({\n url: \"/assignments/updateTransforms/\"+assignmentNumber,\n type: \"post\",\n data: visTransforms\n }).done(function(status) {\n if(status == 'OK'){\n alertMessage(\"Scale and translation saved!\", \"success\");\n } else {\n alertMessage(\"Unsuccessful. Try logging in!\", \"danger\");\n }\n });\n}", "function save() {\n // document.getElementById(\"canvasimg\").style.border = \"2px solid\";\n // const savedImage = canvas.toDataURL();\n // document.getElementById(\"canvasimg\").src = savedImage;\n\n // document.getElementById(\"canvasimg\").style.display = \"inline\"; \n //--- this is prob the line of code that saves it next to the current\n }", "function startSaveListener(){\r\n\tdocument.getElementById(\"saveit\").addEventListener(\"click\", saveGraph);\r\n document.getElementById(\"pushit\").addEventListener(\"click\", savepng);\r\n}", "function savePNG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n var url = window.URL.createObjectURL(blob);\n\n var canvas = document.querySelector(\"canvas\");\n canvas.setAttribute(\"width\", width);\n canvas.setAttribute(\"height\", height);\n var context = canvas.getContext(\"2d\");\n\n var image = new Image;\n image.src = url;\n image.onload = function () {\n context.drawImage(image, 0, 0);\n var a = document.createElement(\"a\");\n a.download = getFilenameWithoutExtension(curFilename) + \".png\";\n a.href = canvas.toDataURL(\"image/png\");\n a.click();\n };\n}", "static save() {\n const nodes = this._nodes;\n\n const state = {};\n\n nodes.forEach((container, index) => {\n const chart = {\n chartId: container.querySelector('.container-outer').id,\n containerId: container.id\n };\n state['chart' + index] = chart;\n });\n\n localStorage.setItem('state', JSON.stringify(state));\n }", "function saveJSON() {\n // save stage as a json string\n var json = stage.toJSON();\n var data = \"text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(json));\n var a = document.createElement('a');\n a.href = 'data:' + data;\n a.download = 'canvas.json';\n a.innerHTML = 'download JSON';\n var container = document.getElementById('container');\n container.appendChild(a);\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}", "function saveAnnotations()\n {\n console.log(\"whiteboard: save annotations to decker\");\n var xhr = new XMLHttpRequest();\n xhr.open('put', annotationURL(), true);\n xhr.onloadend = function() {\n if (xhr.status == 200) {\n console.log(\"whiteboard: save success\");\n needSave = false;\n buttonSave.style.color = \"lightgrey\";\n } else {\n console.log(\"whiteboard: could not save to decker, download instead\");\n downloadAnnotations();\n }\n };\n xhr.send(annotationJSON());\n }", "function drawDiagram(){\n\t\tclient.registerDiagram(diagram);\n\t\tdiagram.resizeToFill();\n\t\tdiagram.windowX = diagram.width / diagram.scale / 2;\n\t\tdiagram.windowY = diagram.height / diagram.scale / 2;\n\t\n\t\tnew InputManager(diagram);\n\t\tdiagram.draw();\n\t}", "function saveToFile(nodes) {\n //Only keep the needed values\n var nodes_minimal = [];\n nodes.forEach(function (d) {\n nodes_minimal.push({\n id: d.id,\n biome_main: d.biome_main,\n degree: d.degree,\n x_fixed: roundTo(d.x_fixed, 2),\n y_fixed: roundTo(d.y_fixed, 2)\n });\n }); //forEach\n\n var graph = _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_3___default()(nodes_minimal);\n\n var file = new Blob([graph], {\n type: 'text/plain'\n });\n var a = document.createElement('a');\n a.href = URL.createObjectURL(file);\n a.download = 'biome-node-locations.json';\n a.click();\n } //function saveToFile", "save() {\n socket.emit('saveAdventureCard', { sessionID: this.sessionID, cardID: this.id, texts: this.texts });\n }", "function saveToFile(nodes) {\n //Only keep the needed values\n var nodes_minimal = [];\n nodes.forEach(function (d) {\n nodes_minimal.push({\n id: d.id,\n community: d.community,\n degree: d.degree,\n x_fixed: roundTo(d.x_fixed, 2),\n y_fixed: roundTo(d.y_fixed, 2)\n });\n }); //forEach\n\n var graph = _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_3___default()(nodes_minimal);\n\n var file = new Blob([graph], {\n type: 'text/plain'\n });\n var a = document.createElement('a');\n a.href = URL.createObjectURL(file);\n a.download = 'constellation-node-locations.json';\n a.click();\n } //function saveToFile", "function save( dataBlob, filesize ){\n saveAs( dataBlob, 'D3 vis exported to PNG.png' ); // FileSaver.js function\n }", "function save( dataBlob, filesize ){\n saveAs( dataBlob, 'D3 vis exported to PNG.png' ); // FileSaver.js function\n }", "function save( dataBlob, filesize ){\n saveAs( dataBlob, 'D3 vis exported to PNG.png' ); // FileSaver.js function\n }", "function save( dataBlob, filesize ){\n saveAs( dataBlob, 'D3 vis exported to PNG.png' ); // FileSaver.js function\n }", "function saveAndRender() {\n save();\n render();\n}", "serializeDrawing(writer, draw) {\n writer.writeStartElement(undefined, 'drawing', this.wNamespace);\n if (draw.hasOwnProperty('chartType')) {\n this.serializeInlineCharts(writer, draw);\n }\n else {\n this.serializeInlinePicture(writer, draw);\n }\n writer.writeEndElement();\n }", "save(elementId){\n document.getElementById(elementId).addEventListener('click', () => {\n // prompt the user to name the file \n let name = prompt(\"name of file: \");\n if(name === \"\"){\n const date = new Date(); \n name = date.toISOString() + \"_funSketch_saveFile\";\n }else if(name === null){\n return;\n }\n const savedData = [];\n this.animationProj.frameList.forEach(function(frame){\n // get frame metadata\n const newFrame = frame.getMetadata();\n newFrame['layers'] = []; // list of objects\n frame.canvasList.forEach(function(layer){\n // get layer metadata\n const newLayer = {\n 'id': layer.id,\n 'width': layer.getAttribute(\"width\"),\n 'height': layer.getAttribute(\"height\"),\n 'zIndex': layer.style.zIndex,\n 'opacity': layer.style.opacity,\n };\n // add layer image data\n newLayer['imageData'] = layer.toDataURL();\n newFrame.layers.push(newLayer);\n });\n savedData.push(JSON.stringify(newFrame));\n });\n let json = \"[\\n\";\n json += savedData.join(\",\\n\"); // put a line break between each new object, which represents a frame\n json += \"\\n]\";\n // make a blob so it can be downloaded \n const blob = new Blob([json], { type: \"application/json\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = name + \".json\";\n link.click();\n });\n }", "function saveAsPNG() {\n // draw to canvas...\n drawingCanvas.toBlob(function(blob) {\n saveAs(blob, \"canvas.png\");\n });\n }", "function saveGraphSettings() {\n\n var scaleInput = document.getElementById(\"scale-input\");\n Y_AXIS.scale = parseFloat(scaleInput.value);\n\n var startlineInput = document.getElementById(\"line-input\");\n Y_AXIS.startLine = parseFloat(startlineInput.value);\n if(selectedElement != null)\n Graph.setEntity(selectedElement);\n else\n alert(\"Bitte Element auswählen!\");\n\n}", "function saveSigning() {\t\n saveToServer();\n}", "function save( dataBlob, filesize ){\n saveAs( dataBlob, 'plot.png' ); // FileSaver.js function\n }", "function saveTextAsSVG() {\n\t\t\"use strict\";\n\t\t//var textToWrite = document.getElementById(\"inputTextToSave\").value;\n\t\tvar json = editor.get();\n\t\tvar textToWrite = myDoc.getElementById(\"drawing1\").innerHTML;\n\n\t\tvar textFileAsBlob = new Blob([textToWrite], {\n\t\t\ttype: 'text/plain'\n\t\t});\n\t\tvar fileNameToSaveAs = json.Header.Name + \"_svg.svg\";\n\n\t\tvar downloadLink = document.createElement(\"a\");\n\t\tdownloadLink.download = fileNameToSaveAs;\n\t\tdownloadLink.innerHTML = \"Download File\";\n\t\tif (typeof window.webkitURL !== \"undefined\") {\n\t\t\t// Chrome allows the link to be clicked\n\t\t\t// without actually adding it to the DOM.\n\t\t\tdownloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);\n\t\t} else {\n\t\t\t// Firefox requires the link to be added to the DOM\n\t\t\t// before it can be clicked.\n\n\t\t\tdownloadLink.href = window.URL.createObjectURL(textFileAsBlob);\n\t\t\tdownloadLink.onclick = destroyClickedElement;\n\t\t\tdownloadLink.style.display = \"none\";\n\t\t\tdocument.body.appendChild(downloadLink);\n\n\t\t}\n\t\tsimulateClick(downloadLink);\n\t}", "SaveSimulation() {\r\n this.savedSimulationGrid = this.simulationGrid;\r\n }", "function save( dataBlob, filesize ){\n\t\tsaveAs( dataBlob, 'D3 vis exported to PNG.png' ); // FileSaver.js function\n\t}", "function saveHds() {\n\tvar filename = d3.select(\"input#filename\").attr(\"value\");\n\tvar ds = currHds();\n\tvar text = JSON.stringify(ds.toJSON());\n var blob = new Blob([text], {type: \"text/plain;charset=utf-8\"});\n saveAs(blob, filename);\n}", "function SaveView() {\n $('#AnnotationEditMenu').hide();\n var cam = VIEWER1.GetCamera();\n\n var messageObj = {};\n messageObj.db = DBID;\n messageObj.viewid = VIEWID;\n messageObj.cam = {};\n \n if (cam.Mirror) {\n messageObj.cam.height = - cam.Height;\n } else {\n messageObj.cam.height = cam.Height;\n }\n \n // Copy values not pointer reference.\n messageObj.cam.center = [cam.FocalPoint[0], cam.FocalPoint[1]];\n messageObj.cam.rotation = 180.0 * cam.Roll / 3.14159265;\n\n $.ajax({\n type: \"post\",\n url: \"/webgl-viewer/save-view\",\n data: {\"message\" : JSON.stringify( messageObj ),\n success: function(data,status){\n //alert(data + \"\\nStatus: \" + status);\n },\n error: function() { alert( \"AJAX - error(): save View\" ); }\n }});\n}", "save_to(path) {\n fs.writeFileSync(path, JSON.stringify(this.data));\n }", "function doSaveDocument() {\n var presenter = new mindmaps.SaveDocumentPresenter(eventBus,\n mindmapModel, new mindmaps.SaveDocumentView(), autosaveController, filePicker);\n presenter.go();\n }", "function saveDrawnInstituteToDatabase() {\n // test, if textfields are filled out properly\n if(checkInput()){\n // retrieve the geometry out of the drawnItems\n var institutgeoJSON = drawnItems.toGeoJSON();\n // add properties\n institutgeoJSON.features[0].properties.name=neu.myName;\n institutgeoJSON.features[0].properties.img=neu.url;\n // create new databaseobject-object and later will the param json\n neu.json = JSON.stringify(institutgeoJSON);\n sendData();\n }\n}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp][0];\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idPagina\").val(id);\n\t$(\"#contenido\").val($(\"#contenido\").sceditor(\"instance\").val());\n\t\n\t\n\t$(\"#subirPagina\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\t\tprincipalCerrarPopUp(pagina_cerrarPopUp);\n\t\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t\t}\n\t});\n}", "function updateDiagram() {\n // remove current mesh from scene to be replaced\n if (_mesh) {\n _scene.remove(_mesh);\n _mesh.geometry.dispose();\n _mesh.material.dispose();\n _mesh = null;\n }\n\n // re - generate diagram\n return this.generateDiagram().renderDiagram().animate();\n }", "function save(e) {\n render();\n let url = canvas.toDataURL();\n let image = new Image();\n image.src = url;\n let w = window.open();\n let a = document.createElement(\"a\");\n a.href = url;\n a.download = \"graph\";\n a.textContent = \"Download\";\n a.id = \"download\";\n setTimeout(function(){\n w.document.write(\"<title>Saved Image</title>\")\n w.document.write(image.outerHTML);\n w.document.write(a.outerHTML);\n w.document.write(`\n <style>\n body {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n }\n img {\n margin: 1em;\n }\n #download {\n border-radius: .25em;\n padding: .5em;\n color: black; /*rgb(80, 235, 126)*/\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Noto Sans, sans-serif;\n background: white;\n box-shadow: 2px 2px 5px 0 #0004;\n height: min-content;\n width: min-content;\n display: block;\n text-decoration: none;\n }\n #download:hover {\n box-shadow: 1px 1px 3px 0 #0004;\n }\n </style>\n `);\n }, 0);\n }", "function saveImage()\n{\n var link = document.createElement('a');\n link.href = canvas.toDataURL();\n link.download = \"machine.png\";\n link.click();\n\n //call function to save the machine as a json\n exportToJsonFile(json)\n}", "_save() {\n const detail = this.serializeForm();\n this.dispatchEvent(new CustomEvent('save', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail\n }));\n }", "function save() {\n\n // stops the loop so that it will not automatically get more updates\n stop_loop();\n loading();\n\n // display deployments again so that it disables Save button and site buttons at the same time\n saving = true;\n document.getElementById(\"save\").disabled = true;\n console.log(\"saving...\");\n obj.init = \"False\";\n display_deployments();\n\n dep = {};\n dep['new_deployments'] = new_deployments;\n DATA['deployments'] = dep;\n api.request(\"update\", \"deployments\");\n\n}", "function saveData() {\n\tstate.save();\n}", "function guardarComImatge() {\n document.getElementById(\"descargarImagen\").download = \"canvas.png\";\n document.getElementById(\"descargarImagen\").href = document\n .getElementById(\"canvas\")\n .toDataURL(\"image/png\");\n }", "save() {\n this.node.insertBefore(defs, this.node.firstChild);\n this.node.save();\n }", "function save() {\n\t\tif (editorInterface) {\n\t\t\tvar content = editorInterface.getContent();\n\t\t\tconsole.log('saving', content);\n\t\t\tres.setContent(content, true, function(status){\n\t\t\t\tif (status && status.isError) console.error('Couldn\\'t save Resource:', status);\n\t\t\t\telse console.log('Resource saved!');\n\t\t\t});\n\t\t}\n\t}", "function saveFrame() {\n\t\t\n\t\tif(isUndefined(actual_frame)) {\n\t\t\treturn;\n\t\t}\n\t\t// blocks operation if image of previous frame did not \n\t\t// complete loading yet.\n\t\tvar ret = IsCreationOfSegmentsAllowed();\n\t\tif (!ret) {\n\t\t\treturn;\n\t\t}\n\t\tis_loaded = false;\n\t\t\n\t\tvar img = new Image();\n\t\timg.src = actual_frame.canvas.toDataURL();\n\t\timg.onload = function() {\n\t\t\tvar frame = new Frame(actual_frame.second, null, false, this);\n\t\t\tsaved_frames.push(frame);\n\t\t\tif (saved_frames.length > 0 && saved_frames.length % 2 == 0) {\n\t\t\t\tvar frame1 = saved_frames.shift();\n\t\t\t\tvar frame2 = saved_frames.shift();\n\t\t\t\tvar segment = new Segment(frame1.older(frame2), frame1.younger(frame2));\n\t\t\t\tsegments.push(segment);\n\t\t\t\tsegment.id = getNextSegmentId();\n\t\t\t\trepaintSegments();\n\t\t\t}\n\t\t\t// enables grabbing next frame\n\t\t\tis_loaded = true;\n\t\t}\n\t\t\n\t}", "function saveGeofences() {\n\n if (draw.getAll().features.length == 0) {\n alert(\"Debe dibujar el poligono primero\");\n } else {\n\n socket.emit('saveGeofences', draw.getAll());\n alert(\"Success\");\n draw.deleteAll().getAll();\n popup.remove();\n }\n}", "function save() {\n Bar.createWithConfig(dataForm.name, dataForm.frequency, PoP.getFinalStatements().getItem(dataForm.final_statement))\n .then(() => {\n goBack();\n return Promise.resolve()\n })\n .catch(error => {\n console.log(error);\n console.dir(error);\n console.trace();\n\n Dialog.alert({\n title: \"Error\",\n message: error,\n okButtonText: \"Ok\"\n });\n\n return Promise.reject(error);\n });\n\n\n\n\n}", "function saveEditsOnto(){\n var node=obj1Onto;\n if(editingOnto&&node!=null){\n editingOnto=false;\n node.select('text').text(currentStringOnto);\n node.select('circle').style('fill','#69f');\n node.each(function(d){\n d.name=currentStringOnto;\n node_dataOnto[d.index].name = currentStringOnto;\n });\n currentStringOnto=\"\";\n editingOnto=false;\n updateGraphOnto(node_dataOnto,link_dataOnto);\n }\n}", "function saveTransaccion() {\n\t$(\"#btnGuardar5\").hide();\n\t$(\"#mensajeTemporal5\").show();\n\t$(\"#inmueble_abrirModificarTransacciones\").css({cursor:\"wait\"});\n\t\n\t\n\tvar arrayTransacciones = Array();\n\t\n\t$(\"#contenedorInmuebleTransacciones input[type='checkbox']:checked\").each(function(){\n\t\tarrayTransacciones.push($(this).val());\n\t});\n\t\n\t\n\t$.ajax({\n\t\turl: \"lib_php/updInmuebleTransaccion.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: {\n\t\t\tid: positions[pos_comp].id,\n\t\t\tmodificar: 1,\n\t\t\ttransacciones: arrayTransacciones.toString()\n\t\t}\n\t}).always(function(respuesta_json){\n\t\tif (respuesta_json.isExito == 1) {\n\t\t\t$(\"#btnGuardar5\").show();\n\t\t\t$(\"#mensajeTemporal5\").hide();\n\t\t\t$(\"#inmueble_abrirModificarTransacciones\").css({cursor:\"default\"});\n\t\t\t\n\t\t\tinmueble_transaccionInmuebleCampos(pos_comp, respuesta_json.datos);\n\t\t}\n\t});\n}", "function saveTransaccion() {\n\t$(\"#btnGuardar5\").hide();\n\t$(\"#mensajeTemporal5\").show();\n\t$(\"#inmueble_abrirModificarTransacciones\").css({cursor:\"wait\"});\n\t\n\t\n\tvar arrayTransacciones = Array();\n\t\n\t$(\"#contenedorInmuebleTransacciones input[type='checkbox']:checked\").each(function(){\n\t\tarrayTransacciones.push($(this).val());\n\t});\n\t\n\t\n\t$.ajax({\n\t\turl: \"lib_php/updInmuebleTransaccion.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: {\n\t\t\tid: positions[pos_comp].id,\n\t\t\tmodificar: 1,\n\t\t\ttransacciones: arrayTransacciones.toString()\n\t\t}\n\t}).always(function(respuesta_json){\n\t\tif (respuesta_json.isExito == 1) {\n\t\t\t$(\"#btnGuardar5\").show();\n\t\t\t$(\"#mensajeTemporal5\").hide();\n\t\t\t$(\"#inmueble_abrirModificarTransacciones\").css({cursor:\"default\"});\n\t\t\t\n\t\t\tinmueble_transaccionInmuebleCampos(pos_comp, respuesta_json.datos);\n\t\t}\n\t});\n}", "function createDiagram(extJsObj, labId, readOnly, config) {\n\tconsole.log('createDiagram', arguments);\n\n\tvar trashMinSize = 25;\n\tvar trashMaxSize = 50;\n\tvar trashMaxRegion = 50;\n\tvar trashFadeInterval = 2000;\n\tvar doubleClickInterval = 500;\n\tvar minWidth = 600;\n\tvar maxWidth = 2000;\n\tvar minHeight = 400;\n\tvar maxHeight = 1000;\n\tvar devWidth = 50;\n\tvar devHeight = 50;\n\tvar linkSLabel = 0.15;\n\tvar linkNLabel = 0.85;\n\tvar linkLabel = 0.5;\n\tvar fullRefresh = 30000;\n\tvar offlineOpacity = 0.4;\n\tvar myIdPfx = 'xxxdiagram';\n\n\tvar suspendEvents = false; // If true, there will be no update to the server\n\n\tvar el = extJsObj.el;\n\n\tvar width = extJsObj.getWidth();\n\tvar height = extJsObj.getHeight();\n\n\tvar socket;\n\n\t// Create the diagram\n\tvar graph = new joint.dia.Graph();\n\n\tdocument.getElementById(el.id).innerHTML = \"<DIV ID='\" + myIdPfx + labId + \"'></DIV>\"; // Force delete and rebuild of an element that will be deleted later because of a joint.js bug\n\n\tvar paper = new joint.dia.Paper({\n\t\t// el : $('#' + el.id),\n\t\tel : $('#' + myIdPfx + labId),\n\t\twidth : (width > minWidth && width < maxWidth) ? width : maxWidth,\n\t\theight : (height > minHeight && height < maxHeight) ? height : maxHeight,\n\t\tgridSize : 1,\n\t\tmodel : graph\n\t});\n\n\tvar diag = {\n\t\tclick : {},\n\t\tobjs : {},\n\t\tgraph : graph,\n\t\tpaper : paper\n\t};\n\n\tvar objs = {};\n\n\tgraph.on('all', function() {\n\t\t// console.log('graph>>', arguments);\n\t});\n\n\tpaper.on('all', function(e, child, jq, x, y) {\n\t\tconsole.log('paper>>', arguments);\n\t\tvar elId;\n\n\t\tif (e == 'cell:pointerup') {\n\t\t\telId = child.model.id;\n\t\t\tjq.stopPropagation();\n\t\t\tvar d = new Date();\n\t\t\tif (!diag.click[elId])\n\t\t\t\tdiag.click[elId] = new Date(0);\n\t\t\tif (d - diag.click[elId] < doubleClickInterval) {\n\t\t\t\tconsole.log(arguments[2]);\n\t\t\t\t// arguments[2].stopPropagation(); // Stop propagating it\n\t\t\t\tobjs[elId].trigger('cell:doubleclick', objs[elId], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]); // propagate the event\n\t\t\t}\n\n\t\t\tdiag.click[elId] = new Date(); // Set for the double click\n\n\t\t\tif (diag.trashObj && diag.trashSize >= trashMaxSize && x <= trashMaxSize && y <= trashMaxSize) { // Delete the object\n\t\t\t\tvar obj = objs[elId];\n\t\t\t\tobj.remove();\n\t\t\t\tdelete objs[elId];\n\t\t\t\tconsole.log('Object elId', elId, 'removed');\n\t\t\t}\n\t\t}\n\n\t\tif (e == 'cell:pointerdown') { // Not used for the moment\n\t\t\telId = child.model.id;\n\t\t}\n\n\t\tif ((!readOnly) && e == 'cell:pointermove') { // Draw trash\n\t\t\tif (!diag.trashObj)\n\t\t\t\taddTrash();\n\t\t\tif ((x < trashMaxRegion && y < trashMaxRegion) && diag.trashSize < trashMaxSize)\n\t\t\t\taddTrash(trashMaxSize);\n\t\t\tif ((x > trashMaxRegion || y > trashMaxRegion) && diag.trashSize >= trashMaxSize)\n\t\t\t\taddTrash(trashMinSize);\n\t\t\tif (diag.trash)\n\t\t\t\tclearTimeout(diag.trash);\n\t\t\tdiag.trash = setTimeout(function() {\n\t\t\t\tif (diag.trashObj)\n\t\t\t\t\tdiag.trashObj.remove();\n\t\t\t\tdelete (diag.trashObj);\n\t\t\t}, trashFadeInterval);\n\n\t\t\t// Lets check are we talking for a a figure object?\n\t\t\tvar attr = child.model.attributes;\n\t\t\tif ((attr.type == \"basic.Rect\" && Math.abs(attr.position.x + attr.size.width - x) < 10 && Math.abs(attr.position.y + attr.size.height - y) < 10)\n\t\t\t\t\t|| (attr.type == \"basic.Circle\" && Math.abs(attr.position.x + attr.size.width - x) < 10)) {\n\t\t\t\telId = child.model.id;\n\t\t\t\tvar pattr = child.model._previousAttributes;\n\t\t\t\tvar objModel = objs[elId];\n\t\t\t\tobjModel.set('size', {\n\t\t\t\t\twidth : Math.max(20, attr.size.width + attr.position.x - pattr.position.x),\n\t\t\t\t\theight : Math.max(20, attr.size.height + attr.position.y - pattr.position.y)\n\t\t\t\t});\n\t\t\t\tobjModel.set('position', pattr.position);\n\t\t\t}\n\t\t}\n\t});\n\n\textJsObj.on('resize', function(comp, w, h) {\n\t\tconsole.log('Resize', w, h);\n\t\twidth = w;\n\t\theight = h;\n\t\tpaper.setDimensions(w, h); // Resize the diagram\n\t});\n\n\tfunction sendMsg(t, msg) {\n\t\tconsole.log('sendMsg', t, msg);\n\t\tif (!suspendEvents)\n\t\t\tsocket.emit(t, msg);\n\t}\n\n\tfunction addObj(obj) {\n\t\tconsole.log('addObj', arguments);\n\t\tobj.on('all', function() {\n\t\t\tconsole.log('element>>', arguments);\n\t\t});\n\t\tobj.on('cell:doubleclick', function(obj, child, jq, x, y) {\n\t\t\tif (obj.oType == 'device' && config.deviceDoubleClick)\n\t\t\t\tconfig.deviceDoubleClick(obj, x, y);\n\t\t\tif (obj.oType == 'link' && config.linkDoubleClick)\n\t\t\t\tconfig.linkDoubleClick(obj, x, y);\n\t\t\tif (obj.oType == 'object' && config.objectDoubleClick)\n\t\t\t\tconfig.objectDoubleClick(obj, x, y);\n\t\t});\n\n\t\tif (readOnly) {\n\t\t\tobj.on('change:position', function(child) {\n\t\t\t\tconsole.log('Change position in read-only', arguments);\n\t\t\t\tif (!obj.forceUpdate)\n\t\t\t\t\tobj.attributes = obj._previousAttributes;\n\t\t\t\tdelete (obj.forceUpdate);\n\t\t\t});\n\t\t}\n\n\t\tif (!readOnly)\n\t\t\tobj.on('change', function(child) {\n\t\t\t\tconsole.log('element>>change>>', child, obj, arguments);\n\t\t\t\tif (obj.oType == 'device') {\n\t\t\t\t\tobj.oMsg.z = obj.attributes.z;\n\t\t\t\t\tobj.oMsg.x = obj.attributes.position.x;\n\t\t\t\t\tobj.oMsg.y = obj.attributes.position.y;\n\t\t\t\t\tsendMsg('updateDevice', obj.oMsg);\n\t\t\t\t}\n\t\t\t\tif (obj.oType == 'link') {\n\t\t\t\t\tobj.oMsg.z = obj.attributes.z;\n\t\t\t\t\tobj.oMsg.source.id = obj.attributes.source.id;\n\t\t\t\t\tobj.oMsg.source.x = obj.attributes.source.x;\n\t\t\t\t\tobj.oMsg.source.y = obj.attributes.source.y;\n\t\t\t\t\tobj.oMsg.target.id = obj.attributes.target.id;\n\t\t\t\t\tobj.oMsg.target.x = obj.attributes.target.x;\n\t\t\t\t\tobj.oMsg.target.y = obj.attributes.target.y;\n\t\t\t\t\tobj.oMsg.vertices = obj.attributes.vertices;\n\t\t\t\t\tsendMsg('updateLink', obj.oMsg);\n\t\t\t\t}\n\t\t\t\tif (obj.oType == 'object') {\n\t\t\t\t\tobj.oMsg.z = obj.attributes.z;\n\t\t\t\t\tobj.oMsg.x = obj.attributes.position.x;\n\t\t\t\t\tobj.oMsg.y = obj.attributes.position.y;\n\t\t\t\t\tif (obj.attributes.size) {\n\t\t\t\t\t\tobj.oMsg.width = obj.attributes.size.width;\n\t\t\t\t\t\tobj.oMsg.height = obj.attributes.size.height;\n\t\t\t\t\t}\n\t\t\t\t\tsendMsg('updateObject', obj.oMsg);\n\t\t\t\t}\n\t\t\t});\n\t\tif (!readOnly)\n\t\t\tobj.on('remove', function(type, child) { // Automatic handle of the remove\n\t\t\t\tconsole.log('we shall remove', child, obj);\n\t\t\t\tif (obj.oType == 'device')\n\t\t\t\t\tsendMsg('removeDevice', {\n\t\t\t\t\t\tlab : labId,\n\t\t\t\t\t\tid : obj.id\n\t\t\t\t\t});\n\t\t\t\tif (obj.oType == 'link')\n\t\t\t\t\tsendMsg('removeLink', {\n\t\t\t\t\t\tlab : labId,\n\t\t\t\t\t\tid : obj.id\n\t\t\t\t\t});\n\t\t\t\tif (obj.oType == 'object') {\n\t\t\t\t\tsendMsg('removeObject', {\n\t\t\t\t\t\tlab : labId,\n\t\t\t\t\t\tid : obj.id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\tobjs[obj.id] = obj;\n\n\t\treturn graph.addCell(obj);\n\t}\n\n\tfunction rawAddDevice(msg) {\n\t\tconsole.log('rawAddDevice', arguments);\n\t\tmsg.status = msg.status || 'offline';\n\n\t\tvar image = new joint.shapes.basic.Image({\n\t\t\tid : msg.id,\n\t\t\tposition : {\n\t\t\t\tx : msg.x,\n\t\t\t\ty : msg.y\n\t\t\t},\n\t\t\tsize : {\n\t\t\t\twidth : devWidth,\n\t\t\t\theight : devHeight\n\t\t\t},\n\t\t\tattrs : {\n\t\t\t\ttext : {\n\t\t\t\t\ttext : msg.name || \"\",\n\t\t\t\t\tfill : 'black'\n\t\t\t\t},\n\t\t\t\timage : {\n\t\t\t\t\t'xlink:href' : msg.icon,\n\t\t\t\t\topacity : msg.status == 'offline' ? offlineOpacity : 1,\n\t\t\t\t\twidth : devWidth,\n\t\t\t\t\theight : devHeight\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmsg.lab = labId;\n\t\timage.oType = 'device';\n\t\timage.oMsg = msg;\n\t\tif (readOnly)\n\t\t\timage.attr({\n\t\t\t\t'image' : {\n\t\t\t\t\t'pointer-events' : 'fill'\n\t\t\t\t},\n\t\t\t\t'text' : {\n\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t}\n\t\t\t}); // Not working\n\t\taddObj(image);\n\t\tvar objModel = paper.findViewByModel(image);\n\t\tif (objModel)\n\t\t\tobjModel.$el.hover(function(evt) {\n\t\t\t\t// console.log('Hover in');\n\t\t\t\tif (config.deviceHoverIn)\n\t\t\t\t\tconfig.deviceHoverIn(image, evt, objModel);\n\t\t\t}, function(evt) {\n\t\t\t\t// console.log('Hover in');\n\t\t\t\tif (config.deviceHoverOut)\n\t\t\t\t\tconfig.deviceHoverOut(image, evt, objModel);\n\t\t\t})\n\t\tsendMsg('addDevice', msg);\n\t\treturn image;\n\t}\n\n\tfunction addDevice(x, y, type, name) {\n\t\tconsole.log('addDevice', arguments);\n\t\tvar s = Ext.StoreMgr.get('iouTemplates');\n\t\tvar r = s.getById(type);\n\t\tvar text = name || r.get('name');\n\t\tvar icon = r.get('icon');\n\n\t\tExt.Ajax.request({\n\t\t\turl : '/rest/allocate/deviceId',\n\t\t\tsuccess : function(res) {\n\t\t\t\tvar msg = Ext.JSON.decode(res.responseText);\n\t\t\t\trawAddDevice({\n\t\t\t\t\tid : msg.id,\n\t\t\t\t\tx : x,\n\t\t\t\t\ty : y,\n\t\t\t\t\ticon : icon,\n\t\t\t\t\ttype : type,\n\t\t\t\t\tname : text,\n\t\t\t\t\tstatus : 'offline'\n\t\t\t\t});\n\t\t\t},\n\t\t\tfailure : function() {\n\t\t\t\tconsole.error('No device ID!!!');\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction addTrash(big) {\n\t\tconsole.log('addTrash', arguments);\n\t\tvar size = big || 30;\n\t\tif (diag.trashObj)\n\t\t\tdiag.trashObj.remove();\n\t\tvar image = new joint.shapes.basic.Image({\n\t\t\tid : 'trashObjId',\n\t\t\tposition : {\n\t\t\t\tx : 0,\n\t\t\t\ty : 0\n\t\t\t},\n\t\t\tsize : {\n\t\t\t\twidth : size,\n\t\t\t\theight : size\n\t\t\t},\n\t\t\tattrs : {\n\t\t\t\timage : {\n\t\t\t\t\t'xlink:href' : 'icons/trash-256-lgreen.png',\n\t\t\t\t\twidth : size,\n\t\t\t\t\theight : size\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tgraph.addCell(image);\n\t\tdiag.trashObj = image;\n\t\tdiag.trashSize = size;\n\t\treturn image;\n\t}\n\n\tfunction rawAddLink(msg) {\n\t\tconsole.log('rawAddLink', arguments);\n\n\t\tif (typeof msg.source == 'undefined')\n\t\t\tmsg.source = {\n\t\t\t\tname : \"\"\n\t\t\t};\n\t\tif (typeof msg.target == 'undefined')\n\t\t\tmsg.target = {\n\t\t\t\tname : \"\"\n\t\t\t};\n\t\tif (typeof msg.source.name == 'undefined')\n\t\t\tmsg.source.name = \"\";\n\t\tif (typeof msg.target.name == 'undefined')\n\t\t\tmsg.target.name = \"\";\n\t\tif (typeof msg.source.id == 'undefined') {\n\t\t\tmsg.source.x = msg.source.x || 100 + parseInt(Math.random() * 100);\n\t\t\tmsg.source.y = msg.source.y || 100 + parseInt(Math.random() * 100);\n\t\t}\n\t\tif (typeof msg.target.id == 'undefined') {\n\t\t\tmsg.target.x = msg.target.x || 100 + parseInt(Math.random() * 100);\n\t\t\tmsg.target.y = msg.target.y || 100 + parseInt(Math.random() * 100);\n\t\t}\n\t\tif (typeof msg.vertices == 'undefined')\n\t\t\tmsg.vertices = [];\n\n\t\tlink = new joint.dia.Link({\n\t\t\tid : msg.id,\n\t\t\tsource : msg.source,\n\t\t\ttarget : msg.target,\n\t\t\tvertices : msg.vertices,\n\t\t\tattrs : {\n\t\t\t\t'.connection' : {\n\t\t\t\t\t'stroke-width' : 1.5\n\t\t\t\t}\n\t\t\t},\n\t\t\tlabels : [ {\n\t\t\t\tposition : linkSLabel,\n\t\t\t\tattrs : {\n\t\t\t\t\ttext : {\n\t\t\t\t\t\ttext : msg.source.name,\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tposition : linkLabel,\n\t\t\t\tattrs : {\n\t\t\t\t\ttext : {\n\t\t\t\t\t\ttext : msg.name,\n\t\t\t\t\t\t'font-weight' : 'bold',\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tposition : linkNLabel,\n\t\t\t\tattrs : {\n\t\t\t\t\ttext : {\n\t\t\t\t\t\ttext : msg.target.name,\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} ],\n\t\t\tsmooth : true\n\t\t});\n\n\t\ttry {\n\t\t\tif (msg.type == 'serial')\n\t\t\t\tlink.attr({\n\t\t\t\t\t'.connection' : {\n\t\t\t\t\t\t'stroke-dasharray' : 3\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t\t;\n\n\t\ttry {\n\t\t\tif (readOnly)\n\t\t\t\tlink.attr({\n\t\t\t\t\t'.labels' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t},\n\t\t\t\t\t'.link-tools' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t},\n\t\t\t\t\t'.marker-source' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t},\n\t\t\t\t\t'.marker-target' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t},\n\t\t\t\t\t'.marker-vertices' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t},\n\t\t\t\t\t'.marker-arrowheads' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t},\n\t\t\t\t\t'.connection' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t},\n\t\t\t\t\t'.connection-wrap' : {\n\t\t\t\t\t\t'pointer-events' : 'none'\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t\t;\n\n\t\t/*\n\t\t * link.attr({ '.connection': { stroke: 'blue' }, // '.marker-source': { fill: 'red', d: 'M 10 0 L 0 5 L 10 10 z' }, // '.marker-target': { fill: 'yellow', d: 'M 10 0 L 0 5 L 10 10 z' } });\n\t\t */\n\n\t\tlink.oType = 'link';\n\t\tlink.oMsg = msg;\n\t\tmsg.lab = labId;\n\t\taddObj(link);\n\t\tsendMsg('addLink', msg);\n\t\treturn link;\n\t}\n\n\tfunction addLink(x, y, type, name, id1, id2) {\n\t\tconsole.log('addLink', arguments);\n\n\t\tExt.Ajax.request({\n\t\t\turl : '/rest/allocate/linkId',\n\t\t\tsuccess : function(res) {\n\t\t\t\tvar msg = Ext.JSON.decode(res.responseText);\n\t\t\t\tif (id1 && id2)\n\t\t\t\t\trawAddLink({\n\t\t\t\t\t\tid : msg.id,\n\t\t\t\t\t\tsource : {\n\t\t\t\t\t\t\tid : id1\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttarget : {\n\t\t\t\t\t\t\tid : id2\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttype : type,\n\t\t\t\t\t\tname : name || type\n\t\t\t\t\t});\n\t\t\t\telse\n\t\t\t\t\trawAddLink({\n\t\t\t\t\t\tid : msg.id,\n\t\t\t\t\t\tsource : {\n\t\t\t\t\t\t\tx : x,\n\t\t\t\t\t\t\ty : y\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttarget : {\n\t\t\t\t\t\t\tx : x + 100,\n\t\t\t\t\t\t\ty : y\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttype : type,\n\t\t\t\t\t\tname : name || type\n\t\t\t\t\t})\n\t\t\t},\n\t\t\tfailure : function() {\n\t\t\t\tconsole.error('No Link ID!!!');\n\t\t\t}\n\t\t});\n\t}\n\n\tvar pId = 100000;\n\n\tfunction rawAddObject(msg) {\n\t\tvar obj;\n\n\t\tmsg.color = msg.color || '#000000';\n\t\tif (typeof msg.opacity == 'undefined')\n\t\t\tmsg.opacity = (msg.type == 'text' ? 1 : 0);\n\t\tmsg.fill = msg.fill || '#FFFFFF';\n\t\tmsg.z = msg.z || (msg.type == 'text' ? -1 : -2);\n\t\tmsg.width = msg.width || 100;\n\t\tmsg.height = msg.height || 100;\n\t\tmsg.fontSize = msg.fontSize || 7;\n\t\tmsg.dashArray = msg.dashArray || 0;\n\t\tif (typeof msg.round == 'undefined')\n\t\t\tmsg.round = 2;\n\t\tif (typeof msg.strokeWidth == 'undefined')\n\t\t\tmsg.strokeWidth = 1;\n\n\t\tswitch (msg.type) {\n\t\t\tcase 'rect':\n\t\t\t\tobj = new joint.shapes.basic.Rect({\n\t\t\t\t\tid : msg.id,\n\t\t\t\t\tposition : {\n\t\t\t\t\t\tx : msg.x,\n\t\t\t\t\t\ty : msg.y\n\t\t\t\t\t},\n\t\t\t\t\tsize : {\n\t\t\t\t\t\twidth : msg.width,\n\t\t\t\t\t\theight : msg.height\n\t\t\t\t\t},\n\t\t\t\t\tattrs : {\n\t\t\t\t\t\trect : {\n\t\t\t\t\t\t\trx : (msg.round / msg.width),\n\t\t\t\t\t\t\try : (msg.round / msg.height),\n\t\t\t\t\t\t\t'stroke-dasharray' : msg.dashArray,\n\t\t\t\t\t\t\tfill : msg.fill,\n\t\t\t\t\t\t\t'fill-opacity' : msg.opacity,\n\t\t\t\t\t\t\tstroke : msg.color,\n\t\t\t\t\t\t\t'stroke-width' : msg.strokeWidth,\n\t\t\t\t\t\t\t'pointer-events' : readOnly ? 'none' : 'fill'\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttext : {\n\t\t\t\t\t\t\t'font-size' : msg.fontSize,\n\t\t\t\t\t\t\ttext : msg.text,\n\t\t\t\t\t\t\tfill : msg.color,\n\t\t\t\t\t\t\t'pointer-events' : readOnly ? 'none' : 'fill'\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tz : msg.z\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'oval':\n\t\t\t\tobj = new joint.shapes.basic.Circle({\n\t\t\t\t\tid : msg.id,\n\t\t\t\t\tposition : {\n\t\t\t\t\t\tx : msg.x,\n\t\t\t\t\t\ty : msg.y\n\t\t\t\t\t},\n\t\t\t\t\tsize : {\n\t\t\t\t\t\twidth : msg.width,\n\t\t\t\t\t\theight : msg.height\n\t\t\t\t\t},\n\t\t\t\t\tattrs : {\n\t\t\t\t\t\tcircle : {\n\t\t\t\t\t\t\t'stroke-dasharray' : msg.dashArray,\n\t\t\t\t\t\t\tfill : msg.fill,\n\t\t\t\t\t\t\t'fill-opacity' : msg.opacity,\n\t\t\t\t\t\t\tstroke : msg.color,\n\t\t\t\t\t\t\t'stroke-width' : msg.strokeWidth,\n\t\t\t\t\t\t\t'pointer-events' : readOnly ? 'none' : 'fill'\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttext : {\n\t\t\t\t\t\t\t'font-size' : msg.fontSize,\n\t\t\t\t\t\t\ttext : msg.text,\n\t\t\t\t\t\t\tfill : msg.color,\n\t\t\t\t\t\t\t'pointer-events' : readOnly ? 'none' : 'fill'\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tz : msg.z\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\tobj = new joint.shapes.basic.Text({\n\t\t\t\t\tid : msg.id,\n\t\t\t\t\tposition : {\n\t\t\t\t\t\tx : msg.x,\n\t\t\t\t\t\ty : msg.y\n\t\t\t\t\t},\n\t\t\t\t\tsize : {\n\t\t\t\t\t\twidth : msg.width,\n\t\t\t\t\t\theight : msg.height\n\t\t\t\t\t},\n\t\t\t\t\tattrs : {\n\t\t\t\t\t\ttext : {\n\t\t\t\t\t\t\t'stroke-dasharray' : msg.dashArray,\n\t\t\t\t\t\t\topacity : msg.opacity,\n\t\t\t\t\t\t\ttext : msg.text,\n\t\t\t\t\t\t\tfill : msg.color,\n\t\t\t\t\t\t\t'font-size' : msg.fontSize,\n\t\t\t\t\t\t\t'pointer-events' : readOnly ? 'none' : 'fill'\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tz : msg.z\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t}\n\n\t\tobj.oMsg = msg;\n\t\tobj.oType = 'object';\n\t\tmsg.lab = labId;\n\n\t\taddObj(obj);\n\t\tsendMsg('addObject', msg);\n\t\treturn obj;\n\t}\n\n\tfunction addFigure(type, x, y, text, width, height) {\n\t\tconsole.log('addFigure', arguments);\n\n\t\tif (type != 'rect' && type != 'oval' && type != 'text')\n\t\t\treturn;\n\n\t\tExt.Ajax.request({\n\t\t\turl : '/rest/allocate/objectId',\n\t\t\tsuccess : function(res) {\n\t\t\t\tvar msg = Ext.JSON.decode(res.responseText);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'rect':\n\t\t\t\t\t\trawAddObject({\n\t\t\t\t\t\t\tid : msg.id,\n\t\t\t\t\t\t\ttype : 'rect',\n\t\t\t\t\t\t\tx : x,\n\t\t\t\t\t\t\ty : y,\n\t\t\t\t\t\t\twidth : width,\n\t\t\t\t\t\t\theight : height,\n\t\t\t\t\t\t\ttext : text\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'oval':\n\t\t\t\t\t\trawAddObject({\n\t\t\t\t\t\t\tid : msg.id,\n\t\t\t\t\t\t\ttype : 'oval',\n\t\t\t\t\t\t\tx : x,\n\t\t\t\t\t\t\ty : y,\n\t\t\t\t\t\t\twidth : width,\n\t\t\t\t\t\t\theight : height,\n\t\t\t\t\t\t\ttext : text\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\trawAddObject({\n\t\t\t\t\t\t\tid : msg.id,\n\t\t\t\t\t\t\ttype : 'text',\n\t\t\t\t\t\t\tx : x,\n\t\t\t\t\t\t\ty : y,\n\t\t\t\t\t\t\twidth : width,\n\t\t\t\t\t\t\theight : height,\n\t\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\t\theight : 50\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfailure : function() {\n\t\t\t\tconsole.error('No object ID!!!');\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction getPaper() {\n\t\tconsole.log('getPaper', arguments);\n\t\treturn paper;\n\t}\n\n\tfunction getGraph() {\n\t\tconsole.log('getGraph', arguments);\n\t\treturn graph;\n\t}\n\n\tfunction getObjById(id) {\n\t\tconsole.log('getObjById', arguments);\n\t\treturn diag.obj[id];\n\t}\n\n\tfunction setScale(sx, sy) {\n\t\tconsole.log('setScale', arguments);\n\t\tif (!readOnly)\n\t\t\tsendMsg('setScale', {\n\t\t\t\tlab : labId,\n\t\t\t\tx : sx,\n\t\t\t\ty : sy\n\t\t\t});\n\t\treturn paper.scale(sx, sy);\n\t}\n\n\tfunction setScaleQuiet(sx, sy) {\n\t\tconsole.log('setScaleQuiet', arguments);\n\t\treturn paper.scale(sx, sy);\n\t}\n\n\tfunction destroy() {\n\t\tconsole.log('destroy', arguments);\n\t\tsuspendEvents = true;\n\t\tif (diag.getAllId)\n\t\t\tclearInterval(diag.getAllId); // Stop the periodic refresh\n\t\tdelete (diag.getAllId);\n\t\tgraph.clear(); // Clear the graph\n\t\tsuspendEvents = false;\n\t\tsendMsg('quit');\n\t\tpaper.remove();\n\t\t// socket.disconnect();\n\t\t// socket = null;\n\t\t// el.update(''); // Remove the diagram from the ExtJs\n\t}\n\n\t// Create the socket.io interface\n\n\t// TODO: Generic suppress socket.io send of events is necessary. I will use suspendEvents for it\n\tfunction sockAddDevice(msg) {\n\t\tconsole.log('sockAddDevice', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (objs[msg.id])\n\t\t\treturn sockUpdateDevice(msg); // It exists, so instead we shall do an update\n\n\t\tsuspendEvents = true;\n\t\trawAddDevice(msg);\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockAddDevice)\n\t\t\tconfig.sockAddDevice(msg);\n\t}\n\n\tfunction sockAddLink(msg) {\n\t\tconsole.log('sockAddLink', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (objs[msg.id])\n\t\t\treturn sockUpdateLink(msg); // It exists, so instead we shall do an update\n\n\t\tsuspendEvents = true;\n\t\trawAddLink(msg);\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockAddLink)\n\t\t\tconfig.sockAddLink(msg);\n\t}\n\n\tfunction sockAddObject(msg) {\n\t\tconsole.log('sockAddObject', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (objs[msg.id])\n\t\t\treturn sockUpdateObject(msg); // It exists, so instead we shall do an update\n\n\t\tsuspendEvents = true;\n\t\trawAddObject(msg);\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockAddObject)\n\t\t\tconfig.sockAddObject(msg);\n\t}\n\n\t// TODO: May be width and height should be also maintained by the server?\n\tfunction sockUpdateDevice(msg) {\n\t\tconsole.log('sockUpdateDevice', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\t\tif (!objs[msg.id])\n\t\t\treturn; // Does not exists, exit\n\n\t\tsuspendEvents = true;\n\n\t\tvar d = objs[msg.id];\n\t\td.oMsg = msg;\n\t\td.forceUpdate = true;\n\n\t\td.set('position', {\n\t\t\tx : msg.x,\n\t\t\ty : msg.y\n\t\t});\n\n\t\td.set('z', msg.z);\n\n\t\tif (msg.status)\n\t\t\td.oStatus = msg.status;\n\n\t\tif (msg.icon) {\n\t\t\tsetTimeout(function() {\n\t\t\t\td.attr({\n\t\t\t\t\ttext : {\n\t\t\t\t\t\ttext : msg.name || \"\"\n\t\t\t\t\t},\n\t\t\t\t\timage : {\n\t\t\t\t\t\t'xlink:href' : msg.icon,\n\t\t\t\t\t\topacity : msg.status == 'offline' ? offlineOpacity : 1\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, 50);\n\t\t}\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockUpdateDevice)\n\t\t\tconfig.sockUpdateDevice(msg);\n\t}\n\n\tfunction sockUpdateObject(msg) {\n\t\tconsole.log('sockUpdateObject', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (!objs[msg.id])\n\t\t\treturn; // Does not exists, exist\n\n\t\tsuspendEvents = true;\n\n\t\tvar d = objs[msg.id];\n\t\td.set('size', {\n\t\t\twidth : msg.width,\n\t\t\theight : msg.height\n\t\t});\n\t\td.set('position', {\n\t\t\tx : msg.x,\n\t\t\ty : msg.y\n\t\t});\n\t\td.set('z', msg.z);\n\n\t\tswitch (msg.type) {\n\t\t\tcase 'rect':\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\td.attr({\n\t\t\t\t\t\trect : {\n\t\t\t\t\t\t\trx : (msg.round / msg.width),\n\t\t\t\t\t\t\try : (msg.round / msg.height),\n\t\t\t\t\t\t\t'stroke-dasharray' : msg.dashArray,\n\t\t\t\t\t\t\tfill : msg.fill,\n\t\t\t\t\t\t\t'fill-opacity' : msg.opacity,\n\t\t\t\t\t\t\t'stroke-width' : msg.strokeWidth,\n\t\t\t\t\t\t\tstroke : msg.color\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttext : {\n\t\t\t\t\t\t\t'font-size' : msg.fontSize,\n\t\t\t\t\t\t\ttext : msg.text,\n\t\t\t\t\t\t\tfill : msg.color\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, 50);\n\t\t\t\tbreak;\n\t\t\tcase 'oval':\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\td.attr({\n\t\t\t\t\t\tcircle : {\n\t\t\t\t\t\t\t'stroke-dasharray' : msg.dashArray,\n\t\t\t\t\t\t\tfill : msg.fill,\n\t\t\t\t\t\t\t'fill-opacity' : msg.opacity,\n\t\t\t\t\t\t\t'stroke-width' : msg.strokeWidth,\n\t\t\t\t\t\t\tstroke : msg.color\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttext : {\n\t\t\t\t\t\t\t'font-size' : msg.fontSize,\n\t\t\t\t\t\t\ttext : msg.text,\n\t\t\t\t\t\t\tfill : msg.color\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, 50);\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\td.attr({\n\t\t\t\t\t\ttext : {\n\t\t\t\t\t\t\t'stroke-dasharray' : msg.dashArray,\n\t\t\t\t\t\t\topacity : msg.opacity,\n\t\t\t\t\t\t\ttext : msg.text,\n\t\t\t\t\t\t\tfill : msg.color,\n\t\t\t\t\t\t\t'font-size' : msg.fontSize\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, 50);\n\t\t\t\tbreak;\n\t\t}\n\n\t\td.oMsg = msg;\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockUpdateObject)\n\t\t\tconfig.sockUpdateObject(msg);\n\t}\n\n\tfunction sockUpdateLink(msg) {\n\t\tconsole.log('sockUpdateLink', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (!objs[msg.id])\n\t\t\treturn; // Does not exists, exist\n\n\t\tsuspendEvents = true;\n\n\t\tvar d = objs[msg.id];\n\n\t\tif (typeof msg.source == 'undefined')\n\t\t\tmsg.source = {\n\t\t\t\tname : \"\"\n\t\t\t};\n\t\tif (typeof msg.target == 'undefined')\n\t\t\tmsg.target = {\n\t\t\t\tname : \"\"\n\t\t\t};\n\t\tif (typeof msg.source.name == 'undefined')\n\t\t\tmsg.source.name = \"\";\n\t\tif (typeof msg.target.name == 'undefined')\n\t\t\tmsg.target.name = \"\";\n\t\tif (typeof msg.source.id == 'undefined') {\n\t\t\tmsg.source.x = msg.source.x || 100 + parseInt(Math.random() * 100);\n\t\t\tmsg.source.y = msg.source.y || 100 + parseInt(Math.random() * 100);\n\t\t}\n\t\tif (typeof msg.target.id == 'undefined') {\n\t\t\tmsg.target.x = msg.target.x || 100 + parseInt(Math.random() * 100);\n\t\t\tmsg.target.y = msg.target.y || 100 + parseInt(Math.random() * 100);\n\t\t}\n\t\tif (typeof msg.vertices == 'undefined')\n\t\t\tmsg.vertices = [];\n\n\t\td.set('vertices', msg.vertices);\n\t\td.set('source', msg.source);\n\t\td.set('target', msg.target);\n\t\td.set('z', msg.z);\n\n\t\tsetTimeout(function() {\n\t\t\td.label(0, {\n\t\t\t\tposition : linkSLabel,\n\t\t\t\tattrs : {\n\t\t\t\t\ttext : {\n\t\t\t\t\t\ttext : msg.source.name || \"\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}, 50);\n\n\t\tsetTimeout(function() {\n\t\t\td.label(1, {\n\t\t\t\tposition : linkLabel,\n\t\t\t\tattrs : {\n\t\t\t\t\ttext : {\n\t\t\t\t\t\ttext : msg.name || \"\",\n\t\t\t\t\t\t'font-weight' : 'bold'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}, 65);\n\n\t\tsetTimeout(function() {\n\t\t\td.label(2, {\n\t\t\t\tposition : linkNLabel,\n\t\t\t\tattrs : {\n\t\t\t\t\ttext : {\n\t\t\t\t\t\ttext : msg.target.name || \"\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}, 85);\n\n\t\td.oMsg = msg;\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockUpdateLink)\n\t\t\tconfig.sockUpdateLink(msg);\n\t}\n\n\tfunction sockRemoveDevice(msg) {\n\t\tconsole.log('sockRemoveDevice', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (!objs[msg.id])\n\t\t\treturn; // Does not exists, exist\n\n\t\tsuspendEvents = true;\n\t\tobjs[msg.id].remove({\n\t\t\tdisconnectLinks : true\n\t\t}); // No disconnections to avoid waterfall of events\n\t\tdelete objs[msg.id];\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockRemoveDevice)\n\t\t\tconfig.sockRemoveDevice(msg);\n\t}\n\n\tfunction sockRemoveLink(msg) {\n\t\tconsole.log('sockRemoveLink', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (!objs[msg.id])\n\t\t\treturn; // Does not exists, exist\n\n\t\tsuspendEvents = true;\n\t\tobjs[msg.id].remove();\n\t\tdelete objs[msg.id];\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockRemoveLink)\n\t\t\tconfig.sockRemoveLink(msg);\n\t}\n\n\tfunction sockRemoveObject(msg) {\n\t\tconsole.log('sockRemoveObject', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (!objs[msg.id])\n\t\t\treturn; // Does not exists, exist\n\n\t\tsuspendEvents = true;\n\t\tobjs[msg.id].remove();\n\t\tdelete objs[msg.id];\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockRemoveObject)\n\t\t\tconfig.sockRemoveObject(msg);\n\t}\n\n\tfunction sockSetScale(msg) {\n\t\tconsole.log('sockSetScale', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tsuspendEvents = true;\n\t\tsetScale(msg.x, msg.y);\n\t\tsuspendEvents = false;\n\t\tif (config && config.sockSetScale)\n\t\t\tconfig.sockSetScale(msg);\n\t}\n\n\tfunction sockGetAll(msg) {\n\t\tconsole.log('sockGetAll', arguments);\n\n\t\tif (msg.lab != labId)\n\t\t\treturn;\n\n\t\tif (msg) {\n\t\t\tvar garbage = {};\n\t\t\tvar k;\n\t\t\tfor (k in objs)\n\t\t\t\tgarbage[k] = objs[k];\n\n\t\t\tif (msg.devices) {\n\t\t\t\tExt.Array.each(msg.devices, function(n) {\n\t\t\t\t\tsockAddDevice(n);\n\t\t\t\t\tdelete garbage[n.id];\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (msg.links) {\n\t\t\t\tExt.Array.each(msg.links, function(n) {\n\t\t\t\t\tsockAddLink(n);\n\t\t\t\t\tdelete garbage[n.id];\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (msg.objects) {\n\t\t\t\tExt.Array.each(msg.objects, function(n) {\n\t\t\t\t\tsockAddObject(n);\n\t\t\t\t\tdelete garbage[n.id];\n\t\t\t\t});\n\t\t\t}\n\t\t\tfor (k in garbage)\n\t\t\t\tsockRemoveDevice({\n\t\t\t\t\tlab : labId,\n\t\t\t\t\tid : k\n\t\t\t\t}); // This is how we clean the garbage. Should remove link as well.\n\t\t\tif (msg.scale)\n\t\t\t\tsockSetScale(msg.scale);\n\t\t}\n\n\t\tif (config && config.sockGetAll)\n\t\t\tconfig.sockGetAll(msg);\n\t}\n\n\tfunction refresh() {\n\t\tsendMsg('getAll', {\n\t\t\tlab : labId\n\t\t});\n\t}\n\n\t// Set the socket event handlers\n\t// TODO: Error handling\n\tsocket = io.connect('/labs'); // Join the Labs interface\n\tsocket.on('getAll', sockGetAll);\n\tsocket.on('addDevice', sockAddDevice);\n\tsocket.on('addLink', sockAddLink);\n\tsocket.on('addObject', sockAddObject);\n\tsocket.on('updateDevice', sockUpdateDevice);\n\tsocket.on('updateLink', sockUpdateLink);\n\tsocket.on('updateObject', sockUpdateObject);\n\tsocket.on('removeDevice', sockRemoveDevice);\n\tsocket.on('removeLink', sockRemoveLink);\n\tsocket.on('removeObject', sockRemoveObject);\n\tsocket.on('setScale', sockSetScale);\n\tconsole.log('Try to do connect!');\n\tsocket.on('connect', function() { // Implement the Socket Interface\n\t\tconsole.log('Socket connectedm join lab', labId);\n\t\t// socket.emit('joinLab', labId); // Join this lab only\n\t\t// setTimeout(function() {\n\t\t// sendMsg('getAll', { lab: labId });\n\t\t// }, 50); // In 50ms do a full refresh\n\t});\n\n\tsetTimeout(function() {\n\t\tsocket.emit('joinLab', labId); // Join this lab only\n\t\tsendMsg('getAll', {\n\t\t\tlab : labId\n\t\t});\n\t}, 300); // First refresh after one second\n\n\tdiag.getAllId = setInterval(function() {\n\t\tsendMsg('getAll', {\n\t\t\tlab : labId\n\t\t});\n\t}, fullRefresh);\n\n\t// Add the public methods of that class\n\t// diag.addObj = addObj;\n\tdiag.addDevice = addDevice;\n\tdiag.addLink = addLink;\n\tdiag.addFigure = addFigure;\n\t// diag.rawAddDevice = rawAddDevice;\n\t// diag.rawAddLink = rawAddLink;\n\tdiag.getPaper = getPaper;\n\tdiag.getGraph = getGraph;\n\tdiag.getObjById = getObjById;\n\tdiag.setScale = setScale;\n\tdiag.setScaleQuiet = setScaleQuiet;\n\tdiag.destroy = destroy;\n\tdiag.refresh = refresh;\n\n\treturn diag;\n}", "function save() {\n var dataURL = canvas.toDataURL();\n downloadImage(dataURL, 'image.png');\n}", "function save() {\n\t var imgg=canvas.toDataURL(\"image/png\");\n\t window.location = imgg;\n}", "function saveDrawing() {\n var canvas5 = document.getElementById(\"demo5\");\n window.open(canvas5.toDataURL(\"image/png\"));\n}", "function saveSVG(callback) {\n\n\t//~console.log('Save graph image file...')\n\toutFileIndex++\n\t\n\tlet outputFileName = filePrefix + '-' + ('' + outFileIndex).padStart(4, '0') + '.svg'\n\t\n\tfs.writeFile(__dirname + '/../data/staging/svg/' + outputFileName, d3n.svgString(), function(err, res) {\n\t\tif (err)\n\t\t\tthrow err\n\t\t\n\t\tif (outFileIndex % 100 === 0)\n\t\t\tconsole.log('...' + outputFileName + ' saved')\n\t\t\n\t\tif (callback)\n\t\t\tcallback()\n\t\t\n\t})\n\n}", "function saveTransfer() {\n retrieveValues();\n saveToServer();\n}", "function save() {\n vm.donateModel.post().then(function () {\n Materialize.toast('Animal cadastrado com sucesso.', 3000);\n $location.path('/core/animals');\n });\n }", "function saveToServer(){\n var dataURL = canvas.toDataURL();\n\n $.ajax({\n type: \"POST\",\n url: \"ul\",\n data: {\n imgBase64: dataURL\n }\n }).done(function(o) {\n console.log('saved');\n getGallery();\n });\n}" ]
[ "0.76054215", "0.75719994", "0.74055564", "0.73952335", "0.73097754", "0.7122141", "0.70828223", "0.69763", "0.6846896", "0.63646907", "0.62558776", "0.6166972", "0.60879004", "0.6026668", "0.5977074", "0.591396", "0.5821651", "0.5797262", "0.56753016", "0.566378", "0.5663197", "0.5638382", "0.5593568", "0.5588876", "0.5567316", "0.5540348", "0.55373335", "0.5510849", "0.5508594", "0.54991055", "0.54946566", "0.5484686", "0.5471175", "0.5471175", "0.5460056", "0.5432621", "0.54257965", "0.54152673", "0.541385", "0.5370754", "0.5352861", "0.53472316", "0.53175944", "0.53118944", "0.5306852", "0.530573", "0.5298921", "0.5257814", "0.52551454", "0.52543944", "0.52511287", "0.52499366", "0.52429074", "0.52395576", "0.52377164", "0.52366805", "0.5231573", "0.52269596", "0.52269596", "0.52269596", "0.52269596", "0.5221863", "0.5198655", "0.5197461", "0.51941574", "0.5183651", "0.5174054", "0.5165276", "0.5161052", "0.51527196", "0.5147026", "0.5143384", "0.51367444", "0.51356494", "0.5133612", "0.5124053", "0.5123912", "0.5121591", "0.51199883", "0.511054", "0.5097273", "0.509038", "0.50805897", "0.5080493", "0.50780725", "0.50762314", "0.5074428", "0.5070869", "0.50657344", "0.5065122", "0.5062522", "0.5062522", "0.50575626", "0.5044723", "0.5038055", "0.5024767", "0.50184697", "0.50184417", "0.50177735", "0.5017499" ]
0.74915594
2
Add listeners to elements on the page TODO: set dblclick handler for mobile (touches)
function addListeners() { var canvas = getCanvas(); //add event handlers for Document document.addEventListener("keypress", onKeyPress, false); document.addEventListener("keydown", onKeyDown, false); document.addEventListener("keyup", onKeyUp, false); document.addEventListener("selectstart", stopselection, false); //add event handlers for Canvas canvas.addEventListener("mousemove", onMouseMove, false); canvas.addEventListener("mousedown", onMouseDown, false); canvas.addEventListener("mouseup", onMouseUp, false); canvas.addEventListener("dblclick", onDblClick, false); if (false) { //add listeners for iPad/iPhone //As this was only an experiment (for now) it is not well supported nor optimized ontouchstart = "touchStart(event);"; ontouchmove = "touchMove(event);"; ontouchend = "touchEnd(event);"; ontouchcancel = "touchCancel(event);"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addHandlers() {\n this.onDoubleClick = this.onDoubleClick.bind(this);\n document.addEventListener(\"dblclick\", this.onDoubleClick);\n }", "function attachEvents() {\n // Add custom events to the window\n window.addEventListener(\"touch\", handleInteruption, false);\n window.addEventListener(\"mousewheel\", handleInteruption, false);\n window.addEventListener(\"mousedown\", handleInteruption, false);\n}", "_bindMouseAndTouchEvents() {\n var self = this;\n\n /* Mouse events */\n this._element.addEventListener(\"mousedown\", (ev) => {\n self._onMouseDown(ev);\n }, false);\n this._element.addEventListener(\"mouseup\", (ev) => {\n self._onMouseUp(ev);\n }, false);\n this._element.addEventListener(\"mouseleave\", (ev) => {\n self._onMouseUp(ev);\n }, false);\n this._element.addEventListener(\"mousemove\", (ev) => {\n self._onMouseMove(ev);\n }, false);\n\n /* Scroll event */\n this._element.addEventListener(\"wheel\", (ev) => {\n self._onWheel(ev);\n }, false);\n\n /* Touch events */\n this._element.addEventListener(\"touchstart\", (ev) => {\n self._onTouchStart(ev);\n }, false);\n this._element.addEventListener(\"touchend\", (ev) => {\n self._onTouchEnd(ev);\n }, false);\n this._element.addEventListener(\"touchmove\", (ev) => {\n self._onTouchMove(ev);\n }, false);\n\n /* Context menu event, this will cause the context menu\n to no longer pop up on right clicks. */\n this._element.oncontextmenu = (ev) => {\n ev.preventDefault();\n return false;\n }\n }", "bind() {\n this.window.addEventListener('resize', this.onResize, false);\n this.window.addEventListener('keyup', this.onKeyUp, false);\n\n // Binding both touch and click results in popup getting shown and then immediately get hidden.\n // Adding the check to not bind the click event if the touch is supported i.e. on mobile devices\n // Issue: https://github.com/kamranahmedse/driver.js/issues/150\n if (!('ontouchstart' in document.documentElement)) {\n this.window.addEventListener('click', this.onClick, false);\n }\n\n this.window.addEventListener('touchstart', this.onClick, false);\n }", "_addMouseDownListeners() {\n // Listen on the document so that dragging outside of viewport works\n if (this._screenElement.ownerDocument) {\n this._screenElement.ownerDocument.addEventListener('mousemove', this._mouseMoveListener);\n this._screenElement.ownerDocument.addEventListener('mouseup', this._mouseUpListener);\n }\n this._dragScrollIntervalTimer = window.setInterval(() => this._dragScroll(), DRAG_SCROLL_INTERVAL);\n }", "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE);\n window.addEventListener('blur', onWindowBlur);\n}", "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE);\n window.addEventListener('blur', onWindowBlur);\n }", "bindMouseEvents ()\n {\n // Set drag scroll on the viewport object\n this.viewerState.viewportObject.classList.add('dragscroll');\n\n gestureEvents.onDoubleClick(this.viewerState.viewportObject, (event, coords) =>\n {\n debug('Double click at %s, %s', coords.left, coords.top);\n this.viewerState.viewHandler.onDoubleClick(event, coords);\n });\n }", "function bindEvents() {\n element.addEventListener(\"mousemove\", onMouseMove);\n element.addEventListener(\"touchmove\", onTouchMove, { passive: true });\n element.addEventListener(\"touchstart\", onTouchMove, { passive: true });\n window.addEventListener(\"resize\", onWindowResize);\n }", "attach() {\n for (const container of this.containers) {\n container.addEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.addEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.addEventListener('mousedown', this[onMouseDown], true);\n container.addEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.addEventListener('mousemove', this[onMouseMove]);\n document.addEventListener('mouseup', this[onMouseUp]);\n }", "function init() {\n document.addEventListener(\"touchstart\", touchHandler, true);\n document.addEventListener(\"touchmove\", touchHandler, true);\n document.addEventListener(\"touchend\", touchHandler, true);\n document.addEventListener(\"touchcancel\", touchHandler, true);\n }", "function addListenersTo(elementToListenTo) {window.addEventListener(\"keydown\",kdown);window.addEventListener(\"keyup\",kup);elementToListenTo.addEventListener(\"mousedown\",mdown);elementToListenTo.addEventListener(\"mouseup\",mup);elementToListenTo.addEventListener(\"mousemove\",mmove);elementToListenTo.addEventListener(\"contextmenu\",cmenu);elementToListenTo.addEventListener(\"wheel\",scrl);}", "attach() {\n document.addEventListener('mousedown', this[onMouseDown], true);\n }", "attach() {\n document.addEventListener('mousedown', this[onMouseDown], true);\n }", "function bindEvents() {\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('touchmove', onTouchMove);\n document.addEventListener('touchstart', onTouchMove);\n window.addEventListener('resize', onWindowResize);\n }", "function bindEventListeners() {\n var onDocumentTouch = function onDocumentTouch() {\n if (browser.usingTouch) return;\n\n browser.usingTouch = true;\n\n if (browser.iOS) {\n document.body.classList.add('tippy-touch');\n }\n\n if (browser.dynamicInputDetection && window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n\n browser.onUserInputChange('touch');\n };\n\n var onDocumentMouseMove = function () {\n var time = void 0;\n\n return function () {\n var now = performance.now();\n\n // Chrome 60+ is 1 mousemove per animation frame, use 20ms time difference\n if (now - time < 20) {\n browser.usingTouch = false;\n document.removeEventListener('mousemove', onDocumentMouseMove);\n if (!browser.iOS) {\n document.body.classList.remove('tippy-touch');\n }\n browser.onUserInputChange('mouse');\n }\n\n time = now;\n };\n }();\n\n var onDocumentClick = function onDocumentClick(event) {\n // Simulated events dispatched on the document\n if (!(event.target instanceof Element)) {\n return hideAllPoppers();\n }\n\n var reference = closest(event.target, selectors.REFERENCE);\n var popper = closest(event.target, selectors.POPPER);\n\n if (popper && popper._tippy && popper._tippy.options.interactive) {\n return;\n }\n\n if (reference && reference._tippy) {\n var options = reference._tippy.options;\n\n var isClickTrigger = options.trigger.indexOf('click') > -1;\n var isMultiple = options.multiple;\n\n // Hide all poppers except the one belonging to the element that was clicked\n if (!isMultiple && browser.usingTouch || !isMultiple && isClickTrigger) {\n return hideAllPoppers(reference._tippy);\n }\n\n if (options.hideOnClick !== true || isClickTrigger) {\n return;\n }\n }\n\n hideAllPoppers();\n };\n\n var onWindowBlur = function onWindowBlur() {\n var _document = document,\n el = _document.activeElement;\n\n if (el && el.blur && matches$1.call(el, selectors.REFERENCE)) {\n el.blur();\n }\n };\n\n var onWindowResize = function onWindowResize() {\n toArray(document.querySelectorAll(selectors.POPPER)).forEach(function (popper) {\n var tippyInstance = popper._tippy;\n if (tippyInstance && !tippyInstance.options.livePlacement) {\n tippyInstance.popperInstance.scheduleUpdate();\n }\n });\n };\n\n document.addEventListener('click', onDocumentClick);\n document.addEventListener('touchstart', onDocumentTouch);\n window.addEventListener('blur', onWindowBlur);\n window.addEventListener('resize', onWindowResize);\n\n if (!browser.supportsTouch && (navigator.maxTouchPoints || navigator.msMaxTouchPoints)) {\n document.addEventListener('pointerdown', onDocumentTouch);\n }\n }", "function addEventListeners() {\n\n eventsAreBound = true;\n\n window.addEventListener('hashchange', onWindowHashChange, false);\n window.addEventListener('resize', onWindowResize, false);\n\n if (config.touch) {\n dom.wrapper.addEventListener('touchstart', onTouchStart, false);\n dom.wrapper.addEventListener('touchmove', onTouchMove, false);\n dom.wrapper.addEventListener('touchend', onTouchEnd, false);\n\n // Support pointer-style touch interaction as well\n if (window.navigator.msPointerEnabled) {\n dom.wrapper.addEventListener('MSPointerDown', onPointerDown, false);\n dom.wrapper.addEventListener('MSPointerMove', onPointerMove, false);\n dom.wrapper.addEventListener('MSPointerUp', onPointerUp, false);\n }\n }\n\n if (config.keyboard) {\n document.addEventListener('keydown', onDocumentKeyDown, false);\n }\n\n if (config.progress && dom.progress) {\n dom.progress.addEventListener('click', onProgressClicked, false);\n }\n\n if (config.controls && dom.controls) {\n ['touchstart', 'click'].forEach(function (eventName) {\n dom.controlsLeft.forEach(function (el) {\n el.addEventListener(eventName, onNavigateLeftClicked, false);\n });\n dom.controlsRight.forEach(function (el) {\n el.addEventListener(eventName, onNavigateRightClicked, false);\n });\n dom.controlsUp.forEach(function (el) {\n el.addEventListener(eventName, onNavigateUpClicked, false);\n });\n dom.controlsDown.forEach(function (el) {\n el.addEventListener(eventName, onNavigateDownClicked, false);\n });\n dom.controlsPrev.forEach(function (el) {\n el.addEventListener(eventName, onNavigatePrevClicked, false);\n });\n dom.controlsNext.forEach(function (el) {\n el.addEventListener(eventName, onNavigateNextClicked, false);\n });\n });\n }\n\n }", "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouchStart, _extends({}, PASSIVE, {\n capture: true\n }));\n window.addEventListener('blur', onWindowBlur);\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown)); // Older IE's will not fire a second mousedown for a double click\n\n if (ie && ie_version < 11) {\n on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) {\n return;\n }\n\n var pos = posFromMouse(cm, e);\n\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) {\n return;\n }\n\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n } else {\n on(d.scroller, \"dblclick\", function (e) {\n return signalDOMEvent(cm, e) || e_preventDefault(e);\n });\n } // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n\n\n on(d.scroller, \"contextmenu\", function (e) {\n return onContextMenu(cm, e);\n });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) {\n onContextMenu(cm, e);\n }\n }); // Used to suppress mouse event handling when a touch happens\n\n var touchFinished,\n prevTouch = {\n end: 0\n };\n\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () {\n return d.activeTouch = null;\n }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date();\n }\n }\n\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) {\n return false;\n }\n\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n\n function farAway(touch, other) {\n if (other.left == null) {\n return true;\n }\n\n var dx = other.left - touch.left,\n dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date();\n d.activeTouch = {\n start: now,\n moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null\n };\n\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) {\n d.activeTouch.moved = true;\n }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n\n if (touch && !eventInWidget(d, e) && touch.left != null && !touch.moved && new Date() - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"),\n range;\n\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n {\n range = new Range(pos, pos);\n } else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n {\n range = cm.findWordAt(pos);\n } else // Triple tap\n {\n range = new Range(Pos(pos.line, 0), _clipPos(cm.doc, Pos(pos.line + 1, 0)));\n }\n\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch); // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n }); // Listen to wheel events in order to try and update the viewport on time.\n\n on(d.scroller, \"mousewheel\", function (e) {\n return onScrollWheel(cm, e);\n });\n on(d.scroller, \"DOMMouseScroll\", function (e) {\n return onScrollWheel(cm, e);\n }); // Prevent wrapper from ever scrolling\n\n on(d.wrapper, \"scroll\", function () {\n return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0;\n });\n d.dragFunctions = {\n enter: function enter(e) {\n if (!signalDOMEvent(cm, e)) {\n e_stop(e);\n }\n },\n over: function over(e) {\n if (!signalDOMEvent(cm, e)) {\n onDragOver(cm, e);\n e_stop(e);\n }\n },\n start: function start(e) {\n return onDragStart(cm, e);\n },\n drop: operation(cm, onDrop),\n leave: function leave(e) {\n if (!signalDOMEvent(cm, e)) {\n clearDragCursor(cm);\n }\n }\n };\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) {\n return onKeyUp.call(cm, e);\n });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) {\n return onFocus(cm, e);\n });\n on(inp, \"blur\", function (e) {\n return onBlur(cm, e);\n });\n }", "function addEventListeners()\n\t{\n\t\t// window event\n\t\t$(window).resize(callbacks.windowResize);\n\t\t$(window).keydown(callbacks.keyDown);\n\t\t\n\t\t// click handler\n\t\t$(document.body).mousedown(callbacks.mouseDown);\n\t\t$(document.body).mouseup(callbacks.mouseUp);\n\t\t$(document.body).click(callbacks.mouseClick);\n\n\t\t$(document.body).bind('touchstart',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchstart(e);\n\t\t});\n\t\t$(document.body).bind('touchend',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchend(e);\n\t\t});\n\t\t$(document.body).bind('touchmove',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchmove(e);\n\t\t});\n\t\t\n\t\tvar container = $container[0];\n\t\tcontainer.addEventListener('dragover', cancel, false);\n\t\tcontainer.addEventListener('dragenter', cancel, false);\n\t\tcontainer.addEventListener('dragexit', cancel, false);\n\t\tcontainer.addEventListener('drop', dropFile, false);\n\t\t\n\t\t// GUI events\n\t\t$(\".gui-set a\").click(callbacks.guiClick);\n\t\t$(\".gui-set a.default\").trigger('click');\n\t}", "function addDoubleTapListener(obj, handler, id) {\r\n \tvar last, touch$$1,\r\n \t doubleTap = false,\r\n \t delay = 250;\r\n\r\n \tfunction onTouchStart(e) {\r\n\r\n \t\tif (pointer) {\r\n \t\t\tif (!e.isPrimary) { return; }\r\n \t\t\tif (e.pointerType === 'mouse') { return; } // mouse fires native dblclick\r\n \t\t} else if (e.touches.length > 1) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tvar now = Date.now(),\r\n \t\t delta = now - (last || now);\r\n\r\n \t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n \t\tdoubleTap = (delta > 0 && delta <= delay);\r\n \t\tlast = now;\r\n \t}\r\n\r\n \tfunction onTouchEnd(e) {\r\n \t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n \t\t\tif (pointer) {\r\n \t\t\t\tif (e.pointerType === 'mouse') { return; }\r\n \t\t\t\t// work around .type being readonly with MSPointer* events\r\n \t\t\t\tvar newTouch = {},\r\n \t\t\t\t prop, i;\r\n\r\n \t\t\t\tfor (i in touch$$1) {\r\n \t\t\t\t\tprop = touch$$1[i];\r\n \t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n \t\t\t\t}\r\n \t\t\t\ttouch$$1 = newTouch;\r\n \t\t\t}\r\n \t\t\ttouch$$1.type = 'dblclick';\r\n \t\t\ttouch$$1.button = 0;\r\n \t\t\thandler(touch$$1);\r\n \t\t\tlast = null;\r\n \t\t}\r\n \t}\r\n\r\n \tobj[_pre + _touchstart + id] = onTouchStart;\r\n \tobj[_pre + _touchend + id] = onTouchEnd;\r\n \tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n \tobj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);\r\n \tobj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);\r\n\r\n \t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n \t// the browser doesn't fire touchend/pointerup events but does fire\r\n \t// native dblclicks. See #4127.\r\n \t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n \tobj.addEventListener('dblclick', handler, false);\r\n\r\n \treturn this;\r\n }", "function bindEvents() {\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('touchmove', onTouchMove);\n document.addEventListener('touchstart', onTouchMove);\n \n window.addEventListener('resize', onWindowResize);\n }", "function addListeners() {\n\n var target = focus || root;\n\n target.addEventListener(\"wheel\", wheelEvt);\n target.addEventListener(\"mousewheel\", wheelEvt);\n\n }", "function addDragHandlers () {\n if (supportsTouch) {\n element.addEventListener('touchmove', handleTouchMove, false)\n } else {\n element.addEventListener('mouseover', handleDragEnter, false)\n element.addEventListener('mouseout', handleDragLeave, false)\n }\n\n // document.addEventListener(\"selectstart\", prevent, false);\n }", "function ListBox_Line_TouchDoubleClick(event)\n{\n\t//ask the browser whether this is a double click\n\tif (Brower_TouchIsDoubleClick(event))\n\t{\n\t\t//call out method\n\t\tListBox_Line_Mousedown(event);\n\t}\n}", "function addTouchHandler(){\r\n if(isTouchDevice || isTouch){\r\n if(options.autoScrolling){\r\n $body.removeEventListener(events.touchmove, preventBouncing, {passive: false});\r\n $body.addEventListener(events.touchmove, preventBouncing, {passive: false});\r\n }\r\n\r\n $(WRAPPER_SEL)[0].removeEventListener(events.touchstart, touchStartHandler);\r\n $(WRAPPER_SEL)[0].removeEventListener(events.touchmove, touchMoveHandler, {passive: false});\r\n\r\n $(WRAPPER_SEL)[0].addEventListener(events.touchstart, touchStartHandler);\r\n $(WRAPPER_SEL)[0].addEventListener(events.touchmove, touchMoveHandler, {passive: false});\r\n }\r\n }", "function requirement3() {\n var imgs = document.querySelectorAll(\"div#top>img , div#middle>img\");\n for (let i = 0; i < imgs.length; ++i) {\n imgs[i].ondblclick = doubleClickOnImg;\n }\n}", "bindTouchEvents ()\n {\n // Block the user from moving the window only if it's not integrated\n if (this.settings.blockMobileMove)\n {\n document.body.addEventListener('touchmove', (event) =>\n {\n const e = event.originalEvent;\n e.preventDefault();\n\n return false;\n });\n }\n\n // Touch events for swiping in the viewport to scroll pages\n // this.viewerState.viewportObject.addEventListener('scroll', this.scrollFunction.bind(this));\n\n gestureEvents.onPinch(this.viewerState.viewportObject, function (event, coords, start, end)\n {\n debug('Pinch %s at %s, %s', end - start, coords.left, coords.top);\n this.viewerState.viewHandler.onPinch(event, coords, start, end);\n });\n\n gestureEvents.onDoubleTap(this.viewerState.viewportObject, function (event, coords)\n {\n debug('Double tap at %s, %s', coords.left, coords.top);\n this.viewerState.viewHandler.onDoubleClick(event, coords);\n });\n }", "function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch$$1,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (pointer) {\r\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n\t\t\tif (pointer) {\r\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch$$1) {\r\n\t\t\t\t\tprop = touch$$1[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch$$1 = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch$$1.type = 'dblclick';\r\n\t\t\ttouch$$1.button = 0;\r\n\t\t\thandler(touch$$1);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}", "function addEventListeners() {\r document.getElementById(\"clickTag\").addEventListener(\"click\", clickthrough);\r\tdocument.getElementById(\"clickTag\").addEventListener(\"mouseover\", mouseOver);\r\tdocument.getElementById(\"clickTag\").addEventListener(\"mouseout\", mouseOff);\r}", "function addTouchHandler() {\n if (isTouchDevice || isTouch) {\n if (options.autoScrolling) {\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\n }\n\n $(WRAPPER_SEL)\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\n }\n }", "function addInitialPointerMoveListeners(){document.addEventListener('mousemove',onInitialPointerMove);document.addEventListener('mousedown',onInitialPointerMove);document.addEventListener('mouseup',onInitialPointerMove);document.addEventListener('pointermove',onInitialPointerMove);document.addEventListener('pointerdown',onInitialPointerMove);document.addEventListener('pointerup',onInitialPointerMove);document.addEventListener('touchmove',onInitialPointerMove);document.addEventListener('touchstart',onInitialPointerMove);document.addEventListener('touchend',onInitialPointerMove);}", "function addclickEvents(){\n document.getElementById(\"flask\").addEventListener(\"click\", function() {\n callFlask();\n }, false);\n document.getElementById(\"magnet\").addEventListener(\"click\", function() {\n \tcallMagnet();\n }, false);\n document.getElementById(\"heater_button\").addEventListener(\"click\", function() {\n \tcallHeater();\n }, false);\n document.getElementById(\"stir_button\").addEventListener(\"click\", function() {\n \tcallStir();\n }, false);\n document.getElementById(\"pipette\").addEventListener(\"click\", function() {\n \tcallPipette();\n }, false);\n}", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n if(options.autoScrolling){\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\n }\n\n $(WRAPPER_SEL)\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\n }\n }", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n if(options.autoScrolling){\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\n }\n\n $(WRAPPER_SEL)\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\n }\n }", "function addDoubleTapListener(obj, handler, id) {\n \tvar last, touch$$1,\n \t doubleTap = false,\n \t delay = 250;\n\n \tfunction onTouchStart(e) {\n\n \t\tif (pointer) {\n \t\t\tif (!e.isPrimary) { return; }\n \t\t\tif (e.pointerType === 'mouse') { return; } // mouse fires native dblclick\n \t\t} else if (e.touches.length > 1) {\n \t\t\treturn;\n \t\t}\n\n \t\tvar now = Date.now(),\n \t\t delta = now - (last || now);\n\n \t\ttouch$$1 = e.touches ? e.touches[0] : e;\n \t\tdoubleTap = (delta > 0 && delta <= delay);\n \t\tlast = now;\n \t}\n\n \tfunction onTouchEnd(e) {\n \t\tif (doubleTap && !touch$$1.cancelBubble) {\n \t\t\tif (pointer) {\n \t\t\t\tif (e.pointerType === 'mouse') { return; }\n \t\t\t\t// work around .type being readonly with MSPointer* events\n \t\t\t\tvar newTouch = {},\n \t\t\t\t prop, i;\n\n \t\t\t\tfor (i in touch$$1) {\n \t\t\t\t\tprop = touch$$1[i];\n \t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\n \t\t\t\t}\n \t\t\t\ttouch$$1 = newTouch;\n \t\t\t}\n \t\t\ttouch$$1.type = 'dblclick';\n \t\t\ttouch$$1.button = 0;\n \t\t\thandler(touch$$1);\n \t\t\tlast = null;\n \t\t}\n \t}\n\n \tobj[_pre + _touchstart + id] = onTouchStart;\n \tobj[_pre + _touchend + id] = onTouchEnd;\n \tobj[_pre + 'dblclick' + id] = handler;\n\n \tobj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);\n \tobj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);\n\n \t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\n \t// the browser doesn't fire touchend/pointerup events but does fire\n \t// native dblclicks. See #4127.\n \t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\n \tobj.addEventListener('dblclick', handler, false);\n\n \treturn this;\n }", "function addDoubleTapListener(obj, handler, id) {\n \tvar last, touch$$1,\n \t doubleTap = false,\n \t delay = 250;\n\n \tfunction onTouchStart(e) {\n\n \t\tif (pointer) {\n \t\t\tif (!e.isPrimary) { return; }\n \t\t\tif (e.pointerType === 'mouse') { return; } // mouse fires native dblclick\n \t\t} else if (e.touches.length > 1) {\n \t\t\treturn;\n \t\t}\n\n \t\tvar now = Date.now(),\n \t\t delta = now - (last || now);\n\n \t\ttouch$$1 = e.touches ? e.touches[0] : e;\n \t\tdoubleTap = (delta > 0 && delta <= delay);\n \t\tlast = now;\n \t}\n\n \tfunction onTouchEnd(e) {\n \t\tif (doubleTap && !touch$$1.cancelBubble) {\n \t\t\tif (pointer) {\n \t\t\t\tif (e.pointerType === 'mouse') { return; }\n \t\t\t\t// work around .type being readonly with MSPointer* events\n \t\t\t\tvar newTouch = {},\n \t\t\t\t prop, i;\n\n \t\t\t\tfor (i in touch$$1) {\n \t\t\t\t\tprop = touch$$1[i];\n \t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\n \t\t\t\t}\n \t\t\t\ttouch$$1 = newTouch;\n \t\t\t}\n \t\t\ttouch$$1.type = 'dblclick';\n \t\t\ttouch$$1.button = 0;\n \t\t\thandler(touch$$1);\n \t\t\tlast = null;\n \t\t}\n \t}\n\n \tobj[_pre + _touchstart + id] = onTouchStart;\n \tobj[_pre + _touchend + id] = onTouchEnd;\n \tobj[_pre + 'dblclick' + id] = handler;\n\n \tobj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);\n \tobj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);\n\n \t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\n \t// the browser doesn't fire touchend/pointerup events but does fire\n \t// native dblclicks. See #4127.\n \t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\n \tobj.addEventListener('dblclick', handler, false);\n\n \treturn this;\n }", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n //Microsoft pointers\n var MSPointer = getMSPointer();\n\n $(WRAPPER_SEL).off('touchstart ' + MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);\n $(WRAPPER_SEL).off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);\n }\n }", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n //Microsoft pointers\n var MSPointer = getMSPointer();\n\n $(WRAPPER_SEL).off('touchstart ' + MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);\n $(WRAPPER_SEL).off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);\n }\n }", "function addEventListeners() {\n\t$(\"#maple-apple\").click(addMapleApple);\n\t$(\"#cinnamon-o\").click(addCinnamon);\n}", "function addTouchHandler(){\n if(isTablet){\n $(document).off('touchstart MSPointerDown').on('touchstart MSPointerDown', touchStartHandler);\n $(document).off('touchmove MSPointerMove').on('touchmove MSPointerMove', touchMoveHandler);\n }\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop)\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "attach() {\n document.addEventListener('touchstart', this[onTouchStart]);\n }", "function registerEventHandlers(cm) {\n\t\t var d = cm.display;\n\t\t on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n\t\t // Older IE's will not fire a second mousedown for a double click\n\t\t if (ie && ie_version < 11)\n\t\t on(d.scroller, \"dblclick\", operation(cm, function(e) {\n\t\t if (signalDOMEvent(cm, e)) return;\n\t\t var pos = posFromMouse(cm, e);\n\t\t if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n\t\t e_preventDefault(e);\n\t\t var word = cm.findWordAt(pos);\n\t\t extendSelection(cm.doc, word.anchor, word.head);\n\t\t }));\n\t\t else\n\t\t on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n\t\t // Some browsers fire contextmenu *after* opening the menu, at\n\t\t // which point we can't mess with it anymore. Context menu is\n\t\t // handled in onMouseDown for these browsers.\n\t\t if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\t\t\n\t\t // Used to suppress mouse event handling when a touch happens\n\t\t var touchFinished, prevTouch = {end: 0};\n\t\t function finishTouch() {\n\t\t if (d.activeTouch) {\n\t\t touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n\t\t prevTouch = d.activeTouch;\n\t\t prevTouch.end = +new Date;\n\t\t }\n\t\t };\n\t\t function isMouseLikeTouchEvent(e) {\n\t\t if (e.touches.length != 1) return false;\n\t\t var touch = e.touches[0];\n\t\t return touch.radiusX <= 1 && touch.radiusY <= 1;\n\t\t }\n\t\t function farAway(touch, other) {\n\t\t if (other.left == null) return true;\n\t\t var dx = other.left - touch.left, dy = other.top - touch.top;\n\t\t return dx * dx + dy * dy > 20 * 20;\n\t\t }\n\t\t on(d.scroller, \"touchstart\", function(e) {\n\t\t if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n\t\t clearTimeout(touchFinished);\n\t\t var now = +new Date;\n\t\t d.activeTouch = {start: now, moved: false,\n\t\t prev: now - prevTouch.end <= 300 ? prevTouch : null};\n\t\t if (e.touches.length == 1) {\n\t\t d.activeTouch.left = e.touches[0].pageX;\n\t\t d.activeTouch.top = e.touches[0].pageY;\n\t\t }\n\t\t }\n\t\t });\n\t\t on(d.scroller, \"touchmove\", function() {\n\t\t if (d.activeTouch) d.activeTouch.moved = true;\n\t\t });\n\t\t on(d.scroller, \"touchend\", function(e) {\n\t\t var touch = d.activeTouch;\n\t\t if (touch && !eventInWidget(d, e) && touch.left != null &&\n\t\t !touch.moved && new Date - touch.start < 300) {\n\t\t var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n\t\t if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n\t\t range = new Range(pos, pos);\n\t\t else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n\t\t range = cm.findWordAt(pos);\n\t\t else // Triple tap\n\t\t range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n\t\t cm.setSelection(range.anchor, range.head);\n\t\t cm.focus();\n\t\t e_preventDefault(e);\n\t\t }\n\t\t finishTouch();\n\t\t });\n\t\t on(d.scroller, \"touchcancel\", finishTouch);\n\t\t\n\t\t // Sync scrolling between fake scrollbars and real scrollable\n\t\t // area, ensure viewport is updated when scrolling.\n\t\t on(d.scroller, \"scroll\", function() {\n\t\t if (d.scroller.clientHeight) {\n\t\t setScrollTop(cm, d.scroller.scrollTop);\n\t\t setScrollLeft(cm, d.scroller.scrollLeft, true);\n\t\t signal(cm, \"scroll\", cm);\n\t\t }\n\t\t });\n\t\t\n\t\t // Listen to wheel events in order to try and update the viewport on time.\n\t\t on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n\t\t on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\t\t\n\t\t // Prevent wrapper from ever scrolling\n\t\t on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\t\t\n\t\t d.dragFunctions = {\n\t\t enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n\t\t over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n\t\t start: function(e){onDragStart(cm, e);},\n\t\t drop: operation(cm, onDrop),\n\t\t leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n\t\t };\n\t\t\n\t\t var inp = d.input.getField();\n\t\t on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n\t\t on(inp, \"keydown\", operation(cm, onKeyDown));\n\t\t on(inp, \"keypress\", operation(cm, onKeyPress));\n\t\t on(inp, \"focus\", bind(onFocus, cm));\n\t\t on(inp, \"blur\", bind(onBlur, cm));\n\t\t }", "function addTouchHandler(){\r\n if(isTouchDevice || isTouch){\r\n if(options.autoScrolling){\r\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\r\n }\r\n\r\n $(WRAPPER_SEL)\r\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\r\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\r\n }\r\n }", "function addTouchHandler(){\r\n if(isTouchDevice || isTouch){\r\n if(options.autoScrolling){\r\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\r\n }\r\n\r\n $(WRAPPER_SEL)\r\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\r\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\r\n }\r\n }", "function addTouchHandler(){\r\n if(isTouchDevice || isTouch){\r\n if(options.autoScrolling){\r\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\r\n }\r\n\r\n $(WRAPPER_SEL)\r\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\r\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\r\n }\r\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function bindEventListeners() {\n var touchHandler = function touchHandler() {\n _globals.Browser.touch = true;\n\n if (_globals.Browser.iOS()) {\n document.body.classList.add('tippy-touch');\n }\n\n if (_globals.Browser.dynamicInputDetection && window.performance) {\n document.addEventListener('mousemove', mousemoveHandler);\n }\n };\n\n var mousemoveHandler = function () {\n var time = void 0;\n\n return function () {\n var now = performance.now();\n\n // Chrome 60+ is 1 mousemove per rAF, use 20ms time difference\n if (now - time < 20) {\n _globals.Browser.touch = false;\n document.removeEventListener('mousemove', mousemoveHandler);\n if (!_globals.Browser.iOS()) {\n document.body.classList.remove('tippy-touch');\n }\n }\n\n time = now;\n };\n }();\n\n var clickHandler = function clickHandler(event) {\n // Simulated events dispatched on the document\n if (!(event.target instanceof Element)) {\n return (0, _hideAllPoppers2.default)();\n }\n\n var el = (0, _closest2.default)(event.target, _globals.Selectors.TOOLTIPPED_EL);\n var popper = (0, _closest2.default)(event.target, _globals.Selectors.POPPER);\n\n if (popper) {\n var ref = (0, _find2.default)(_globals.Store, function (ref) {\n return ref.popper === popper;\n });\n if (!ref) return;\n\n var interactive = ref.settings.interactive;\n\n if (interactive) return;\n }\n\n if (el) {\n var _ref = (0, _find2.default)(_globals.Store, function (ref) {\n return ref.el === el;\n });\n if (!_ref) return;\n\n var _ref$settings = _ref.settings,\n hideOnClick = _ref$settings.hideOnClick,\n multiple = _ref$settings.multiple,\n trigger = _ref$settings.trigger;\n\n // Hide all poppers except the one belonging to the element that was clicked IF\n // `multiple` is false AND they are a touch user, OR\n // `multiple` is false AND it's triggered by a click\n\n if (!multiple && _globals.Browser.touch || !multiple && trigger.indexOf('click') !== -1) {\n return (0, _hideAllPoppers2.default)(_ref);\n }\n\n // If hideOnClick is not strictly true or triggered by a click don't hide poppers\n if (hideOnClick !== true || trigger.indexOf('click') !== -1) return;\n }\n\n // Don't trigger a hide for tippy controllers, and don't needlessly run loop\n if ((0, _closest2.default)(event.target, _globals.Selectors.CONTROLLER) || !document.querySelector(_globals.Selectors.POPPER)) return;\n\n (0, _hideAllPoppers2.default)();\n };\n\n var blurHandler = function blurHandler(event) {\n var _document = document,\n el = _document.activeElement;\n\n if (el && el.blur && _matches.matches.call(el, _globals.Selectors.TOOLTIPPED_EL)) {\n el.blur();\n }\n };\n\n // Hook events\n document.addEventListener('click', clickHandler);\n document.addEventListener('touchstart', touchHandler);\n window.addEventListener('blur', blurHandler);\n\n if (!_globals.Browser.SUPPORTS_TOUCH && (navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0)) {\n document.addEventListener('pointerdown', touchHandler);\n }\n}", "function addDoubleTapListener(obj, handler, id) {\r\n \tvar last, touch$$1,\r\n \t doubleTap = false,\r\n \t delay = 250;\r\n\r\n \tfunction onTouchStart(e) {\r\n\r\n \t\tif (pointer) {\r\n \t\t\tif (!e.isPrimary) { return; }\r\n \t\t\tif (e.pointerType === 'mouse') { return; } // mouse fires native dblclick\r\n \t\t} else if (e.touches.length > 1) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tvar now = Date.now(),\r\n \t\t delta = now - (last || now);\r\n\r\n \t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n \t\tdoubleTap = (delta > 0 && delta <= delay);\r\n \t\tlast = now;\r\n \t}\r\n\r\n \tfunction onTouchEnd(e) {\r\n \t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n \t\t\tif (pointer) {\r\n \t\t\t\tif (e.pointerType === 'mouse') { return; }\r\n \t\t\t\t// work around .type being readonly with MSPointer* events\r\n \t\t\t\tvar newTouch = {},\r\n \t\t\t\t prop, i;\r\n\r\n \t\t\t\tfor (i in touch$$1) {\r\n \t\t\t\t\tprop = touch$$1[i];\r\n \t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n \t\t\t\t}\r\n \t\t\t\ttouch$$1 = newTouch;\r\n \t\t\t}\r\n \t\t\ttouch$$1.type = 'dblclick';\r\n \t\t\ttouch$$1.button = 0;\r\n \t\t\thandler(touch$$1);\r\n \t\t\tlast = null;\r\n \t\t}\r\n \t}\r\n\r\n \tobj[_pre + _touchstart + id] = onTouchStart;\r\n \tobj[_pre + _touchend + id] = onTouchEnd;\r\n \tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n \tobj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);\r\n \tobj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);\r\n\r\n \t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n \t// the browser doesn't fire touchend/pointerup events but does fire\r\n \t// native dblclicks. See #4127.\r\n \t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n \tobj.addEventListener('dblclick', handler, false);\r\n\r\n \treturn this;\r\n }", "function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch$$1,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (pointer) {\r\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n\t\t\tif (pointer) {\r\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch$$1) {\r\n\t\t\t\t\tprop = touch$$1[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch$$1 = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch$$1.type = 'dblclick';\r\n\t\t\thandler(touch$$1);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}", "function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch$$1,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (pointer) {\r\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n\t\t\tif (pointer) {\r\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch$$1) {\r\n\t\t\t\t\tprop = touch$$1[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch$$1 = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch$$1.type = 'dblclick';\r\n\t\t\thandler(touch$$1);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}", "function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch$$1,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (pointer) {\r\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n\t\t\tif (pointer) {\r\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch$$1) {\r\n\t\t\t\t\tprop = touch$$1[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch$$1 = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch$$1.type = 'dblclick';\r\n\t\t\thandler(touch$$1);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}", "function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch$$1,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (pointer) {\r\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n\t\t\tif (pointer) {\r\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch$$1) {\r\n\t\t\t\t\tprop = touch$$1[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch$$1 = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch$$1.type = 'dblclick';\r\n\t\t\thandler(touch$$1);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}", "function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch$$1,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (pointer) {\r\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n\t\t\tif (pointer) {\r\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch$$1) {\r\n\t\t\t\t\tprop = touch$$1[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch$$1 = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch$$1.type = 'dblclick';\r\n\t\t\thandler(touch$$1);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}", "function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch$$1,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (pointer) {\r\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n\t\t\tif (pointer) {\r\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch$$1) {\r\n\t\t\t\t\tprop = touch$$1[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch$$1 = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch$$1.type = 'dblclick';\r\n\t\t\thandler(touch$$1);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}", "control(){\n document.addEventListener(\"mousemove\", (e) => {\n this.mouse_x = e.clientX;\n this.mouse_y = e.clientY;\n })\n\n document.addEventListener(\"touchmove\", (e) => {\n this.mouse_x = e.touches[0].clientX+30; //Ajuste para a nave ficar a frente do dedo\n this.mouse_y = e.touches[0].clientY;\n })\n\n document.addEventListener(\"click\", (e) => {\n if(e.button == 0){\n this.shotFire();\n }\n })\n\n document.addEventListener(\"touchstart\", (e) => {\n this.shotFire();\n })\n }", "function bindEventListeners() {\n var touchHandler = function touchHandler() {\n _globals.Browser.touch = true;\n\n if (_globals.Browser.iOS()) {\n document.body.classList.add('tippy-touch');\n }\n\n if (_globals.Browser.dynamicInputDetection && window.performance) {\n document.addEventListener('mousemove', mousemoveHandler);\n }\n };\n\n var mousemoveHandler = function () {\n var time = void 0;\n\n return function () {\n var now = performance.now();\n\n // Chrome 60+ is 1 mousemove per rAF, use 20ms time difference\n if (now - time < 20) {\n _globals.Browser.touch = false;\n document.removeEventListener('mousemove', mousemoveHandler);\n if (!_globals.Browser.iOS()) {\n document.body.classList.remove('tippy-touch');\n }\n }\n\n time = now;\n };\n }();\n\n var clickHandler = function clickHandler(event) {\n // Simulated events dispatched on the document\n if (!(event.target instanceof Element)) {\n return (0, _hideAllPoppers2.default)();\n }\n\n var el = (0, _closest2.default)(event.target, _globals.Selectors.TOOLTIPPED_EL);\n var popper = (0, _closest2.default)(event.target, _globals.Selectors.POPPER);\n\n if (popper) {\n var ref = (0, _find2.default)(_globals.Store, function (ref) {\n return ref.popper === popper;\n });\n var interactive = ref.settings.interactive;\n\n if (interactive) return;\n }\n\n if (el) {\n var _ref = (0, _find2.default)(_globals.Store, function (ref) {\n return ref.el === el;\n });\n var _ref$settings = _ref.settings,\n hideOnClick = _ref$settings.hideOnClick,\n multiple = _ref$settings.multiple,\n trigger = _ref$settings.trigger;\n\n // Hide all poppers except the one belonging to the element that was clicked IF\n // `multiple` is false AND they are a touch user, OR\n // `multiple` is false AND it's triggered by a click\n\n if (!multiple && _globals.Browser.touch || !multiple && trigger.indexOf('click') !== -1) {\n return (0, _hideAllPoppers2.default)(_ref);\n }\n\n // If hideOnClick is not strictly true or triggered by a click don't hide poppers\n if (hideOnClick !== true || trigger.indexOf('click') !== -1) return;\n }\n\n // Don't trigger a hide for tippy controllers, and don't needlessly run loop\n if ((0, _closest2.default)(event.target, _globals.Selectors.CONTROLLER) || !document.querySelector(_globals.Selectors.POPPER)) return;\n\n (0, _hideAllPoppers2.default)();\n };\n\n var blurHandler = function blurHandler(event) {\n var _document = document,\n el = _document.activeElement;\n\n if (el && el.blur && _matches.matches.call(el, _globals.Selectors.TOOLTIPPED_EL)) {\n el.blur();\n }\n };\n\n // Hook events\n document.addEventListener('click', clickHandler);\n document.addEventListener('touchstart', touchHandler);\n window.addEventListener('blur', blurHandler);\n\n if (!_globals.Browser.SUPPORTS_TOUCH && (navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0)) {\n document.addEventListener('pointerdown', touchHandler);\n }\n}", "function setTouchListeners() {\n gElCanvas.addEventListener('touchstart', (ev) => {\n ev.preventDefault()\n onSwitchLine(event)\n })\n gElCanvas.addEventListener('touchend', (ev) => {\n ev.preventDefault()\n toggleDrag();\n })\n gElCanvas.addEventListener('touchmove', (ev) => {\n dragLines(ev)\n })\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "function addDoubleTapListener(obj, handler, id) {\n\tvar last, touch$$1,\n\t doubleTap = false,\n\t delay = 250;\n\n\tfunction onTouchStart(e) {\n\t\tvar count;\n\n\t\tif (pointer) {\n\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\n\t\t\tcount = _pointersCount;\n\t\t} else {\n\t\t\tcount = e.touches.length;\n\t\t}\n\n\t\tif (count > 1) { return; }\n\n\t\tvar now = Date.now(),\n\t\t delta = now - (last || now);\n\n\t\ttouch$$1 = e.touches ? e.touches[0] : e;\n\t\tdoubleTap = (delta > 0 && delta <= delay);\n\t\tlast = now;\n\t}\n\n\tfunction onTouchEnd(e) {\n\t\tif (doubleTap && !touch$$1.cancelBubble) {\n\t\t\tif (pointer) {\n\t\t\t\tif ((!edge) || e.pointerType === 'mouse') { return; }\n\t\t\t\t// work around .type being readonly with MSPointer* events\n\t\t\t\tvar newTouch = {},\n\t\t\t\t prop, i;\n\n\t\t\t\tfor (i in touch$$1) {\n\t\t\t\t\tprop = touch$$1[i];\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\n\t\t\t\t}\n\t\t\t\ttouch$$1 = newTouch;\n\t\t\t}\n\t\t\ttouch$$1.type = 'dblclick';\n\t\t\ttouch$$1.button = 0;\n\t\t\thandler(touch$$1);\n\t\t\tlast = null;\n\t\t}\n\t}\n\n\tobj[_pre + _touchstart + id] = onTouchStart;\n\tobj[_pre + _touchend + id] = onTouchEnd;\n\tobj[_pre + 'dblclick' + id] = handler;\n\n\tobj.addEventListener(_touchstart, onTouchStart, false);\n\tobj.addEventListener(_touchend, onTouchEnd, false);\n\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\n\t// the browser doesn't fire touchend/pointerup events but does fire\n\t// native dblclicks. See #4127.\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\n\tobj.addEventListener('dblclick', handler, false);\n\n\treturn this;\n}", "setEventListeners() {\n $('body').on('touchend click','.menu__option--mode',this.onModeToggleClick.bind(this));\n $('body').on('touchend',this.onTouchEnd.bind(this));\n this.app.on('change:mode',this.onModeChange.bind(this));\n this.app.on('show:menu',this.show.bind(this));\n this.book.on('load:book',this.setTitleBar.bind(this));\n this.book.on('pageSet',this.onPageSet.bind(this));\n this.tutorial.on('done',this.onTutorialDone.bind(this));\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "_addEventListeners() {\n\n window.addEventListener('resize', this._onResizeBound);\n window.addEventListener('orientationchange', this._onResizeBound);\n\n this.tabListEl.addEventListener('click', this._onTabListClickBound);\n\n this.tabListEl.addEventListener('touchstart', this._onTouchStartBound);\n this.tabListEl.addEventListener('mousedown', this._onMouseDownBound);\n this.tabListEl.addEventListener('mousewheel', this._onScrollBound);\n this.tabListEl.addEventListener('DOMMouseScroll', this._onScrollBound);\n\n this.tabListEl.addEventListener('focus', this._onFocusBound, true);\n this.tabListEl.addEventListener('blur', this._onBlurBound, true);\n\n if (this.leftEl) {\n this.leftEl.addEventListener('click', this._onLeftClickBound);\n }\n\n if (this.rightEl) {\n this.rightEl.addEventListener('click', this._onRightClickBound);\n }\n }", "_addEventListeners() {\n\n this.el.addEventListener('click', this._onClickBound);\n window.addEventListener('scroll', this._onScrollBound);\n window.addEventListener('orientationchange', this._onScrollBound);\n document.addEventListener('spark.visible-children', this._onVisibleBound, true);\n\n if (canObserve)\n this._addMutationObserver();\n else\n window.addEventListener('resize', this._onResizeBound, false);\n }", "function addEventListenerToStation() {\n // var station_symbols = document.getElementsByClassName(\"leaflet-div-icon\");\n var station_symbols = document.getElementsByClassName(\"circleSymbolSmall\");\n for (i = 0; i < station_symbols.length; i++) {\n station_symbols[i].addEventListener(\"mousedown\", tapOrClickStart, false);\n station_symbols[i].addEventListener(\"touchstart\", tapOrClickStart, false);\n station_symbols[i].addEventListener(\"mouseup\", tapOrClickEnd, false);\n station_symbols[i].addEventListener(\"touchend\", tapOrClickEnd, false);\n }\n}", "function registerEventHandlers(cm) {\n\t\t var d = cm.display;\n\t\t on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n\t\t // Older IE's will not fire a second mousedown for a double click\n\t\t if (ie && ie_version < 11)\n\t\t { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n\t\t if (signalDOMEvent(cm, e)) { return }\n\t\t var pos = posFromMouse(cm, e);\n\t\t if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n\t\t e_preventDefault(e);\n\t\t var word = cm.findWordAt(pos);\n\t\t extendSelection(cm.doc, word.anchor, word.head);\n\t\t })); }\n\t\t else\n\t\t { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n\t\t // Some browsers fire contextmenu *after* opening the menu, at\n\t\t // which point we can't mess with it anymore. Context menu is\n\t\t // handled in onMouseDown for these browsers.\n\t\t on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\t\t on(d.input.getField(), \"contextmenu\", function (e) {\n\t\t if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n\t\t });\n\n\t\t // Used to suppress mouse event handling when a touch happens\n\t\t var touchFinished, prevTouch = {end: 0};\n\t\t function finishTouch() {\n\t\t if (d.activeTouch) {\n\t\t touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n\t\t prevTouch = d.activeTouch;\n\t\t prevTouch.end = +new Date;\n\t\t }\n\t\t }\n\t\t function isMouseLikeTouchEvent(e) {\n\t\t if (e.touches.length != 1) { return false }\n\t\t var touch = e.touches[0];\n\t\t return touch.radiusX <= 1 && touch.radiusY <= 1\n\t\t }\n\t\t function farAway(touch, other) {\n\t\t if (other.left == null) { return true }\n\t\t var dx = other.left - touch.left, dy = other.top - touch.top;\n\t\t return dx * dx + dy * dy > 20 * 20\n\t\t }\n\t\t on(d.scroller, \"touchstart\", function (e) {\n\t\t if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n\t\t d.input.ensurePolled();\n\t\t clearTimeout(touchFinished);\n\t\t var now = +new Date;\n\t\t d.activeTouch = {start: now, moved: false,\n\t\t prev: now - prevTouch.end <= 300 ? prevTouch : null};\n\t\t if (e.touches.length == 1) {\n\t\t d.activeTouch.left = e.touches[0].pageX;\n\t\t d.activeTouch.top = e.touches[0].pageY;\n\t\t }\n\t\t }\n\t\t });\n\t\t on(d.scroller, \"touchmove\", function () {\n\t\t if (d.activeTouch) { d.activeTouch.moved = true; }\n\t\t });\n\t\t on(d.scroller, \"touchend\", function (e) {\n\t\t var touch = d.activeTouch;\n\t\t if (touch && !eventInWidget(d, e) && touch.left != null &&\n\t\t !touch.moved && new Date - touch.start < 300) {\n\t\t var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n\t\t if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n\t\t { range = new Range(pos, pos); }\n\t\t else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n\t\t { range = cm.findWordAt(pos); }\n\t\t else // Triple tap\n\t\t { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n\t\t cm.setSelection(range.anchor, range.head);\n\t\t cm.focus();\n\t\t e_preventDefault(e);\n\t\t }\n\t\t finishTouch();\n\t\t });\n\t\t on(d.scroller, \"touchcancel\", finishTouch);\n\n\t\t // Sync scrolling between fake scrollbars and real scrollable\n\t\t // area, ensure viewport is updated when scrolling.\n\t\t on(d.scroller, \"scroll\", function () {\n\t\t if (d.scroller.clientHeight) {\n\t\t updateScrollTop(cm, d.scroller.scrollTop);\n\t\t setScrollLeft(cm, d.scroller.scrollLeft, true);\n\t\t signal(cm, \"scroll\", cm);\n\t\t }\n\t\t });\n\n\t\t // Listen to wheel events in order to try and update the viewport on time.\n\t\t on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n\t\t on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n\t\t // Prevent wrapper from ever scrolling\n\t\t on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n\t\t d.dragFunctions = {\n\t\t enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n\t\t over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n\t\t start: function (e) { return onDragStart(cm, e); },\n\t\t drop: operation(cm, onDrop),\n\t\t leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n\t\t };\n\n\t\t var inp = d.input.getField();\n\t\t on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n\t\t on(inp, \"keydown\", operation(cm, onKeyDown));\n\t\t on(inp, \"keypress\", operation(cm, onKeyPress));\n\t\t on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n\t\t on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n\t\t }", "function registerEventHandlers(cm) {\r\n var d = cm.display;\r\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\r\n // Older IE's will not fire a second mousedown for a double click\r\n if (ie && ie_version < 11)\r\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\r\n if (signalDOMEvent(cm, e)) { return }\r\n var pos = posFromMouse(cm, e);\r\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\r\n e_preventDefault(e);\r\n var word = cm.findWordAt(pos);\r\n extendSelection(cm.doc, word.anchor, word.head);\r\n })); }\r\n else\r\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\r\n // Some browsers fire contextmenu *after* opening the menu, at\r\n // which point we can't mess with it anymore. Context menu is\r\n // handled in onMouseDown for these browsers.\r\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\r\n\r\n // Used to suppress mouse event handling when a touch happens\r\n var touchFinished, prevTouch = {end: 0};\r\n function finishTouch() {\r\n if (d.activeTouch) {\r\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\r\n prevTouch = d.activeTouch;\r\n prevTouch.end = +new Date;\r\n }\r\n }\r\n function isMouseLikeTouchEvent(e) {\r\n if (e.touches.length != 1) { return false }\r\n var touch = e.touches[0];\r\n return touch.radiusX <= 1 && touch.radiusY <= 1\r\n }\r\n function farAway(touch, other) {\r\n if (other.left == null) { return true }\r\n var dx = other.left - touch.left, dy = other.top - touch.top;\r\n return dx * dx + dy * dy > 20 * 20\r\n }\r\n on(d.scroller, \"touchstart\", function (e) {\r\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\r\n d.input.ensurePolled();\r\n clearTimeout(touchFinished);\r\n var now = +new Date;\r\n d.activeTouch = {start: now, moved: false,\r\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\r\n if (e.touches.length == 1) {\r\n d.activeTouch.left = e.touches[0].pageX;\r\n d.activeTouch.top = e.touches[0].pageY;\r\n }\r\n }\r\n });\r\n on(d.scroller, \"touchmove\", function () {\r\n if (d.activeTouch) { d.activeTouch.moved = true; }\r\n });\r\n on(d.scroller, \"touchend\", function (e) {\r\n var touch = d.activeTouch;\r\n if (touch && !eventInWidget(d, e) && touch.left != null &&\r\n !touch.moved && new Date - touch.start < 300) {\r\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\r\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\r\n { range = new Range(pos, pos); }\r\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\r\n { range = cm.findWordAt(pos); }\r\n else // Triple tap\r\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\r\n cm.setSelection(range.anchor, range.head);\r\n cm.focus();\r\n e_preventDefault(e);\r\n }\r\n finishTouch();\r\n });\r\n on(d.scroller, \"touchcancel\", finishTouch);\r\n\r\n // Sync scrolling between fake scrollbars and real scrollable\r\n // area, ensure viewport is updated when scrolling.\r\n on(d.scroller, \"scroll\", function () {\r\n if (d.scroller.clientHeight) {\r\n updateScrollTop(cm, d.scroller.scrollTop);\r\n setScrollLeft(cm, d.scroller.scrollLeft, true);\r\n signal(cm, \"scroll\", cm);\r\n }\r\n });\r\n\r\n // Listen to wheel events in order to try and update the viewport on time.\r\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\r\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\r\n\r\n // Prevent wrapper from ever scrolling\r\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\r\n\r\n d.dragFunctions = {\r\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\r\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\r\n start: function (e) { return onDragStart(cm, e); },\r\n drop: operation(cm, onDrop),\r\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\r\n };\r\n\r\n var inp = d.input.getField();\r\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\r\n on(inp, \"keydown\", operation(cm, onKeyDown));\r\n on(inp, \"keypress\", operation(cm, onKeyPress));\r\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\r\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\r\n}", "registerDomEvents() {\n\t\tgetComponentElementById(this,\"DataListSearchInput\").on(\"keyup\", function() {\n\t\t\tlet search_text = getComponentElementById(this,\"DataListSearchInput\").val();\n\t\t\tsetTimeout(function() {\n\t\t\t\tif (search_text == getComponentElementById(this,\"DataListSearchInput\").val()) {\n\t\t\t\t\tgetComponentElementById(this,\"DataList\").html(\"\");\n\t\t\t\t\tthis.current_page_array = [];\n\t\t\t\t\tthis.current_list_offset = 0;\n\t\t\t\t\tthis.loadPage();\n\t\t\t\t}\n\t\t\t}.bind(this),500);\n\t\t}.bind(this));\n\t\tgetComponentElementById(this,\"btnResetSearch\").on(\"click\", function() {\n\t\t\tgetComponentElementById(this,\"DataListSearchInput\").val(\"\");\n\t\t\tgetComponentElementById(this,\"DataList\").html(\"\");\n\t\t\tthis.current_page_array = [];\n\t\t\tthis.current_list_offset = 0;\n\t\t\tthis.loadPage();\n\t\t}.bind(this));\n\t\tgetComponentElementById(this,\"DataListMoreButton\").on(\"click\", function() {\n\t\t\tthis.current_list_offset += this.list_offset_increment;\n\t\t\tthis.loadPage();\n\t\t}.bind(this));\n\t\tthis.handleOnClassEvent(\"click\",\"data_list_item_\"+this.getUid(),\"_row_item_\",\"on_item_clicked\");\n\t}", "function contextListener() {\r\n $(document).on(\"scroll\", function () { toggleMenuOff(); });\r\n $(document).on(\"contextmenu\", function (e) {\r\n fireContext(e);\r\n });\r\n $(document).on(\"taphold\", function (e) {\r\n if (isTouchDevice()) {\r\n fireContext(e);\r\n }\r\n });\r\n }", "function startup() {\n for(var i = 0; i < 9; i++) { // loop through the divs containing images and add event listeners\n var el = document.getElementById(\"image\"+i);\n el.addEventListener(\"touchstart\", handleStart, false);\n el.addEventListener(\"touchend\", handleEnd, false);\n el.addEventListener(\"touchcancel\", handleCancel, false);\n el.addEventListener(\"touchmove\", handleMove, false);\n }\n for(var i = 0; i < 9; i++) { // loop through the divs containing images and add event listeners\n var el = document.getElementById(\"image\"+i);\n el.addEventListener(\"mousedown\", handleMouseDown);\n el.addEventListener(\"mouseup\", handleMouseUp);\n }\n\n document.addEventListener('keydown', handleKeyDown); //add listener for keyboard input\n document.addEventListener('keyup', handleKeyUp); //add listener for keyboard input\n\n}", "function registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}", "function registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}", "setEvents(){\n const listElements = this.el.childNodes;\n for(let i = 0; i < listElements.length; i++){\n listElements[i].addEventListener('mousedown',this.onItemClickedEvent,true);\n }\n }" ]
[ "0.71597743", "0.6721561", "0.6620845", "0.65840065", "0.65599203", "0.65308076", "0.6507334", "0.64538497", "0.6447369", "0.638994", "0.6366394", "0.6336338", "0.6318422", "0.6318422", "0.63073736", "0.62941426", "0.6277823", "0.6256468", "0.62488306", "0.623616", "0.6215588", "0.62033325", "0.61828136", "0.6180482", "0.6173055", "0.6167827", "0.61496747", "0.6142508", "0.61402917", "0.61331594", "0.6129463", "0.6127832", "0.6115922", "0.61138403", "0.61138403", "0.61126333", "0.61126333", "0.6107363", "0.6107363", "0.61001366", "0.60914147", "0.607662", "0.6076223", "0.6073634", "0.6073173", "0.6073173", "0.6073173", "0.60662675", "0.60662675", "0.60662675", "0.60662675", "0.60662675", "0.60662675", "0.60662675", "0.60662675", "0.6060038", "0.6058928", "0.6053155", "0.6053155", "0.6053155", "0.6053155", "0.6053155", "0.6053155", "0.6051768", "0.60509425", "0.60448074", "0.60384196", "0.60384196", "0.60384196", "0.60384196", "0.60384196", "0.60384196", "0.60384196", "0.60384196", "0.60384196", "0.60372204", "0.60343444", "0.6033827", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6032309", "0.6028045", "0.6019766", "0.6017797", "0.60112786", "0.6001171", "0.60010314", "0.5996263", "0.5992326", "0.5983672", "0.5983672", "0.59691995" ]
0.64970464
7
Returns a text containing all the URL in a diagram
function linkMap() { var csvBounds = ''; var first = true; for (var f in STACK.figures) { var figure = STACK.figures[f]; if (figure.url != '') { var bounds = figure.getBounds(); if (first) { first = false; } else { csvBounds += "\n"; } csvBounds += bounds[0] + ',' + bounds[1] + ',' + bounds[2] + ',' + bounds[3] + ',' + figure.url; } } Log.info("editor.php->linkMap()->csv bounds: " + csvBounds); return csvBounds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "function _decorate_urls(text) {\n var pattern = XRegExp('[a-zA-z]+://[^\\\\s]*', 'g');\n return _decorate_process(text, pattern, function(m) {\n return '<span onclick=\"window.open(\\''+m+'\\', \\'_blank\\');\" class=\"content-link\">' + m + '</span>';\n });\n\n\n }", "function toString(){\n\t\treturn this.url;\n\t}", "function formatSourceHTML(text, url) {\n return `<b>Source: </b>${formatHyperlink(text, url)}`;\n}", "function linkInfo(d) { // Tooltip info for a link data object\n return \"Link:\\nfrom \" + d.from + \" to \" + d.to;\n}", "function drawLink() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "function visualize() {\r\n var a = d.getElementsByTagName('a');\r\n var a_text = '';\r\n for ( var i=0; i<a.length; i++ ) {\r\n match = '';\r\n if ( a[i].innerHTML.indexOf('<img') > -1 ) continue; // Skip Image Link\r\n if ( a[i].getAttribute('vid') ) continue; // Skip checked Link\r\n if ( a[i].getAttribute('class') == 'yt-button' ) continue; // Skip Button Link\r\n if ( a[i].href.match(/#$/) ) continue; // Skip functional Link\r\n if ( a[i].href.match(/watch\\?v=([a-zA-Z0-9_-]*)/) ) {\r\n match = RegExp.$1;\r\n a[i].setAttribute('vid',1);\r\n strong = d.createElement('strong');\r\n strong.setAttribute('class',match);\r\n a[i].parentNode.insertBefore(strong, a[i]);\r\n }\r\n }\r\n \r\n var s = d.getElementsByTagName('strong');\r\n \r\n var c = '';\r\n for ( var i=0; i<s.length; i++ ) {\r\n if ( !s[i].innerHTML && s[i].getAttribute('class') && c.indexOf(s[i].getAttribute('class')) < 0 ) {\r\n c += ' ' + s[i].getAttribute('class');\r\n checkURL( s[i].getAttribute('class') );\r\n }\r\n }\r\n }", "function showUrl(url) {\n url = encodeURI(url);\n var txt = '<a href=\"' + url + '\" target=\"_blank\">' + url + '</a>';\n var element = document.getElementById(SOLR_CONFIG[\"urlElementId\"]);\n element.innerHTML = txt;\n}", "function showUrl(url) {\n url = encodeURI(url);\n var txt = '<a href=\"' + url + '\" target=\"_blank\">' + url + '</a>';\n var element = document.getElementById(SOLR_CONFIG[\"urlElementId\"]);\n element.innerHTML = txt;\n}", "getUrl(name) { return \"\"; }", "function detectUrl(text) {\n let urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n return text.replace(urlRegex, (url) => {\n if (isImageURL(text)) return ( '<p><img src=\"' + url + '\" alt=\"img\" width=\"200\" height=\"auto\"/></p>' ); \n return ( '<a id=\"chat-msg-a\" href=\"' + url + '\" target=\"_blank\">' + url + \"</a>\" );\n });\n}", "function detectUrl(text) {\n let urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n return text.replace(urlRegex, (url) => {\n if (isImageURL(text)) return ( '<p><img src=\"' + url + '\" alt=\"img\" width=\"200\" height=\"auto\"/></p>' ); \n return ( '<a id=\"chat-msg-a\" href=\"' + url + '\" target=\"_blank\">' + url + \"</a>\" );\n });\n}", "function url() {\n var u = a + b + c + d\n return u\n }", "toString() {\n return this.url();\n }", "toString() {\n return this.url();\n }", "async getOutputHref(data) {\n this.bench.get(\"(count) getOutputHref\").incrementCount();\n let link = await this._getLink(data);\n return link.toHref();\n }", "getProjectUrlElement () {\n const url = this.props.url;\n if (!url) {\n return null;\n }\n\n if (!url.urlTarget) {\n return <p>{url.urlDisplay}</p>;\n }\n\n return <p><a href={url.urlTarget} target=\"_blank\">{url.urlDisplay}</a></p>;\n }", "function getURLForAnnotationControl(element) {\n return element.parents(\".result-div\").find(\".content .result-title a\").attr(\"href\");\n }", "function markupHyperLinks(str){\n\t\t\t\tvar reg = new RegExp(/[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?/gi);\n\t\t\t\tvar match = str.match(reg);\n\t\t\t\tvar res = \"\";\n\t\t\t\tif(match != null)\n\t\t\t\t\tmatch.forEach(\n\t\t\t\t\t\tfunction(e){\n\t\t\t\t\t\t\tvar tmp = str.split(e)[0];\n\t\t\t\t\t\t\tif(tmp != \"\")\n\t\t\t\t\t\t\t\tres += \"<pre>\" + tmp + \"</pre>\";\n\t\t\t\t\t\t\tvar m = e.match(new RegExp(/.*jpg|.*bmp|.*gif|.*png|.*jpeg/));\n\t\t\t\t\t\t\tif(m != null && m.indexOf(e) != -1)\n\t\t\t\t\t\t\t\tres += \"<img style='width:100px; height:auto' src='\" + e + \"'></img>\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tres += \"<a href='\" + e + \"'>\" + e + \"</a>\";\n\t\t\t\t\t\t\tvar i = str.indexOf(tmp + e) + (tmp + e).length;\n\t\t\t\t\t\t\tstr = str.substring(i,str.length);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\tif(str != \"\")\n\t\t\t\t\tres += \"<pre>\" + str + \"</pre>\"\n\t\t\t\tconsole.log(res);\n\t\t\t\treturn res;\n\t\t\t}", "function PdfTextWebLink(){var _this=_super.call(this)||this;// Fields\n/**\n * Internal variable to store `Url`.\n * @default ''\n * @private\n */_this.uniformResourceLocator='';/**\n * Internal variable to store `Uri Annotation` object.\n * @default null\n * @private\n */_this.uriAnnotation=null;/**\n * Checks whether the drawTextWebLink method with `PointF` overload is called or not.\n * If it set as true, then the start position of each lines excluding firest line is changed as (0, Y).\n * @private\n * @hidden\n */_this.recalculateBounds=false;_this.defaultBorder=new PdfArray();for(var i=0;i<3;i++){_this.defaultBorder.add(new PdfNumber(0));}return _this;}", "function addLinkText(par, url) {\r\n try {\r\n // add blue color to url text\r\n var color = [0, 0, 0.85];\r\n var urlText = addColorText(par, url, color);\r\n urlText.helpTip = loc_linkTextTip;\r\n\r\n // open url by click\r\n with(par) {\r\n urlText.onClick = function() {\r\n var os = ($.os.indexOf('Win') != -1) ? 'Win' : 'Mac';\r\n if (os == 'Win') {\r\n system('explorer ' + url);\r\n } else {\r\n system('open ' + url);\r\n }\r\n };\r\n }\r\n return urlText;\r\n } catch (e) {\r\n var urlText = addStaticText(par, url);\r\n return urlText;\r\n }\r\n}", "function tableFormat(str) {\n // Regular Expression for URIs in table specifically\n const tableexp = /(https|http|mailto|tel|dav|ftp|ftps)[:^/s]/i;\n var graph = gAppState.checkValue(\"docNameID\", \"docNameID2\");\n var strLabel = str; // variable for what is show on screen in the href\n\n if (str.includes(\"https://linkeddata.uriburner.com/describe/?url=\")) {// of str is in fct format\n strLabel = strLabel.replace(\"https://linkeddata.uriburner.com/describe/?url=\", \"\");\n strLabel = strLabel.replace(\"%23\", \"#\");\n }\n\n\n if (DOC.iSel(\"uriID\").checked == true) { //if user wants short URIs\n if (strLabel.includes(graph)) { //if str is in fct format it still includes the docname\n strLabel = strLabel.replace(graph, \"\"); //remove the docName from string\n }\n if (strLabel.includes(\"nodeID://\")) {\n strLabel = strLabel.replace(\"nodeID://\", \"_:\");\n } else if (strLabel.includes(\"#\")) {\n strLabel = strLabel.split('#')[1];\n } else if (strLabel.includes(\"/\")) {\n var strList = strLabel.split(\"/\");\n strLabel = strList.pop();\n }\n }\n\n if (tableexp.test(str)) { // if str is an absolute or relative uri\n str = '<a href=\"' + str + '\">' + strLabel + '</a>'\n return str\n }\n else {\n return strLabel\n }\n}", "function urlRenderer() {\n\treturn function(value) {\n\t\tif (value) {\n\t\t\tvar url = \"\";\n\t\t\tvar label = \"\";\n\t\t\tvar s = value.split(\"\\n\");\n\t\t\tif (s.length == 2) {\n\t\t\t\turl = Ext.util.Format.htmlEncode(s[1]);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(s[0]) || url;\n\t\t\t}\n\t\t\telse {\n\t\t\t\turl = Ext.util.Format.htmlEncode(value);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(value);\n\t\t\t}\n\t\t\treturn \"<a href=\\\"\" + url + \"\\\" target=\\\"_blank\\\">\" + label + \"</a>\";\n\t\t}\n\t\treturn \"\";\n\t};\n}", "function renderUrl(url) {\n var divurl = document.querySelector('#url');\n var urltext = (url.length < 45) ? url : url.substr(0, 42) + '...';\n var anchor = document.createElement('a');\n anchor.href = url;\n anchor.innerText = urltext;\n divurl.appendChild(anchor);\n}", "function getLink(url, term, label) {\n formattedTerm = term.split(' ').join('+');\n return \"<a target=\\\"_blank\\\" href=\\\"\" + url + formattedTerm + \"\\\" title=\\\"View results on \" + label + \"\\\"\\\">\" + term + \"</a>\";\n}", "function formatHyperlink(text, url) {\n return `<a href=\"${url}\">${text}</a>`;\n}", "function highlightURL(str) {\n if (!str) return;\n var tempArr = str.split(\" \");\n var retString = '';\n return tempArr.reduce(function(acc, value) {\n\t\tvar temp;\n if (isURL(value)) {\n temp =acc + ' \\<span class=\"isLink\"\\>' + value + '\\<\\/span\\> ';\n } else {\n temp= acc + ' ' + value + ' ';\n }\n\t\treturn temp;\n }, '');\n}", "function gatherLinks(p) {\n\tvar tokens = getBracketedItems(p.text());\n\tvar myJsonString = \"\";\n\n\t$.each(tokens, function(k, v) {\n\t\tif(v.content.length <= 2)\n\t\t\tmyJsonString += '\"' + v.content + '\", ';\n\t});\n\n\treturn myJsonString;\n}", "function getURL(c){\n\t\tvar oldURL = $('#target').attr('src');\n\t\tvar split = oldURL.split('/');\n\t\tvar sc = scaleCoords(c, oldURL); // scaled coordinates\n\t\tvar tc = translateCoords(sc, oldURL);\n \n /////////////////////////////////////////////////\n /* / */\n /*var coordStr = tc.x.toString() + \",\"+ tc.y.toString()+\",\"+tc.w.toString()+\",\"+tc.h.toString();\n\t\tsplit[split.length - 4] = coordStr;\n\t\tvar newURL = split.join(\"/\");\n\t\t$('#output').val(newURL);*/\n var widthL = $('#target').prop('naturalWidth');\n var heightL = $('#target').prop('naturalHeight');\n var px=Math.round(tc.x/parseInt(widthL)*1000)/10;\n var py=Math.round(tc.y/parseInt(heightL)*1000)/10;\n var pw=Math.round(tc.w/parseInt(widthL)*1000)/10;\n var ph=Math.round(tc.h/parseInt(heightL)*1000)/10;\n var coordStr = \"pct:\"+px + \",\"+ py +\",\"+pw+\",\"+ph;\n $('#output').val(coordStr);\n split[split.length - 4] = coordStr;\n\t\tvar newURL = split.join(\"/\");\n\t\tvar txt='<a href=\"'+newURL+'\">link</a>';\n\t\t$('#fragment').val(newURL);\n\t\t$('#linkfragment').html(txt);\n /* / */\n /////////////////////////////////////////////////\n\t}", "function createURL(urlText){\n const URL= \"https://api.funtranslations.com/translate/klingon.json\" + \"?\"+\"text=\" + urlText;//The text act as a Key and the value is urlText.\n return URL; \n}", "function buildDpSearhUrl ( text ) {\n return \"http://www.dianping.com/search/keyword/1/0_\"+text;\n}", "function makeDescUrl(title, startDom) {\n return \"https://\" + startDom + \".wikipedia.org/w/api.php?action=query&formatversion=2&prop=pageterms&titles=\" + encodeURIComponent(title) + \"&format=json\";\n}", "function url_encode_cb (){\r\n\t drawcontrol.show_tree_url();\r\n\t}", "get url() { return this.serializeUrl(this.currentUrlTree); }", "function formatUrl(word) {\n return encodeURI(JISHO + word);\n}", "function getTextContent(graphic){\n var attr = graphic.attributes;\n\n var content = '<table width=\"100%\" class=\"nomenclature-info\">';\n\n content += '<tr><th>Name:</th><td>' + attr['SLIDESHOWT'] + '</td></tr>';\n content += '<tr><th>X :</th><td>' + graphic.geometry.x + '</td></tr>';\n content += '<tr><th>Y :</th><td>' + graphic.geometry.y + '</td></tr>';\n\n\n // for (var i=0;i<keys.length; i++) {\n // if (keys[i].toLowerCase() == \"link\") {\n // if (/\\S/.test(attr.link)) {\n // content += '<tr><th></th><td><a href=\"' + attr.link + '\" target=\"_blank\">Additional Info</a></td></tr>';\n // }\n // } else {\n // content += '<tr><th>' + fieldTable[keys[i]] + ':</th><td>' + attr[keys[i]] + '</td></tr>';\n // }\n // }\n\n content += \"</table>\";\n content += '<p class=\"popupButtonContainerP\"><button type=\"button\" value=\"' + attr[\"SLIDESHOWI\"] + '\" class=\"btn btn-link popupShowSlideshowInSidebarBtn' + self.getPole(layer, config) + '\">More</button></p>';\n return content;\n }", "function createLinks(txt){\n let xp =/((?:https?|ftp):\\/\\/[\\-A-Z0-9+\\u0026\\u2019@#\\/%?=()~_|!:,.;]*[\\-A-Z0-9+\\u0026@#\\/%=~(_|])/gi\n \n if (_.isString(txt)){\n return txt.replace(xp, \"<br><a target='_blank' href='$1'>$1</a>\") \n }\n}", "function drawLink(editor) {\n var cm = editor.codemirror;\n var stat = editor.getCMTextState(cm);\n //var options = editor.options;\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "toString(){let url=this.url==null?\"\":this.url.url;return\"\".concat(this.total,\" | \").concat(this.progress,\" :: tested: \").concat(url)}", "function displayShortenedUrl(res) {\n link.textContext = res.data.shortUrl;\n link.setAttribute('href', res.data.shortUrl);\n shrBox.style.opacity = '1';\n urlBox.value = '';\n}", "get url() { return this.link.url; }", "toString(): string {\n const message = this.url != null ? this.url.url : \"\";\n return `${this.total} | ${this.progress} :: retrieving: ${message}`;\n }", "function getURL(){\n\tvar html = document.getElementById(\"report\")\n\tvar share = document.getElementById(\"share\")\n\tvar url = window.location.href\n\thtml.innerHTML += \"<a href=\\\"mailto:[email protected]?subject=Reported%20Image&body=\"+ encodeURIComponent(url) +\"\\\">Report offensive image here</a>\"\n\tshare.innerHTML += \"<a href=\\\"mailto:?subject=Check%20out%20this%20image%20on%20PhotoSect!&body=\"+ encodeURIComponent(url) +\"\\\">Share with friends!</a>\"\n}", "function generateUrlGlyphs(glyphs) {\n var url = [];\n\n for (var g in glyphs) {\n if (glyphs[g]) {\n url.push(glyphs[g].uid);\n }\n }\n\n return url.join(':');\n }", "function newDiagramLink(text, href) {\n const element = document.createElement('a');\n element.className = 'diagram';\n element.textContent = text;\n element.href = href;\n return element;\n}", "function createLink(url,text){\r\n\treturn \"<a href=\\\"\"+url+\"\\\"\"+Target+\">\"+text+\"</a>\";\r\n}", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "function getArticleOriginalSourceOptionalURL(articleData) {\n if (articleData.original_source_url != null && articleData.original_source_url != \"\") {\n return \"<a id='articleOriginalSourceURL' href='\"+articleData.original_source_url+\"'><i class='fa fa-external-link'> \" + LABEL_SHOW_ARTICLE_SOURCE + \" </i></a>\";\n }\n return \"\";\n}", "function mirrorbrain_getTupel( href ) {\n\tvar retVal = \"\";\n\tvar file;\n\tfile = mirrorbrain_getTagFileName( href );\n if ( file != null ) {\n\t\tvar product, os, lang, version;\n\t\tproduct = mirrorbrain_getTagProduct( file );\n\t\tversion = mirrorbrain_getTagVersion( file );\n\t\tos = mirrorbrain_getTagOS( file );\n\t\tlang = mirrorbrain_getTagLang( file );\n\t\tretVal = product + \" \" + version + \"-\" + os + \"-\" + lang + \"-\" + version;\n }\n return retVal;\n}", "_toLinkUrl() {\r\n return this._stringifyPathMatrixAuxPrefixed() +\r\n (isPresent(this.child) ? this.child._toLinkUrl() : '');\r\n }", "function uutrimurl(source) { // @param String: ' url(\"http://...\") '\r\n // @return String: \"http://...\"\r\n return (!source.indexOf(\"url(\") && source.indexOf(\")\") === source.length - 1) ?\r\n source.slice(4, -1).replace(uutrim._QUOTE, \"\") : source;\r\n}", "function branchHyperlink(ix){\n var br = tx.rowinfo[ix].br\n var dest = tx.baseUrl + \"/timeline?r=\" + encodeURIComponent(br)\n dest += tx.fileDiff ? \"&m&cf=\" : \"&m&c=\"\n dest += encodeURIComponent(tx.rowinfo[ix].h)\n return dest\n }", "escapeLinks(description) {\n\n\t\t// <a href=\";\n\t\tvar aStartPos = description.search(\"<a\"); // Next\n\t\tvar descriptionArr = [];\n\t\tvar key = 0;\n\n\t\t// Contains links\n\t\tif (aStartPos !== -1) {\n\n\t\t\twhile (aStartPos !== -1) {\n\n\t\t\t\t// Add text segment if any\n\t\t\t\tvar textSeg = description.substring(0, aStartPos);\n\t\t\t\tif(aStartPos !== 0) descriptionArr.push(textSeg);\n\n\t\t\t\t// Establishing Positions\n\t\t\t\tvar targetPos = description.search(\"target\");\n\t\t\t\tvar aEndPos = description.search(\"</a>\");\n\n\t\t\t\t// Adding the a tag\n\t\t\t\t// e.g. <a href=\"https://www.straitstimes.com/singapore/health/ip-insurers-losses-raise-possibility-of-premium-hikes\" target=\"_blank\">IP insurers' losses raise </a>\n\t\t\t\tvar link, text;\n\n\t\t\t\tif (targetPos !== -1 && targetPos < aEndPos) { // Contains target\n\n\t\t\t\t\tlink = description.substring(aStartPos + 9, targetPos - 2);\n\t\t\t\t\ttext = description.substring(targetPos + 16, aEndPos);\n\n\t\t\t\t} else { // Doesn;t contain target\n\n\t\t\t\t\tvar aStartBracketPos = description.search(\">\");\n\n\t\t\t\t\tlink = description.substring(aStartPos + 9, aStartBracketPos - 1);\n\t\t\t\t\ttext = description.substring(aStartBracketPos + 1, aEndPos);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdescriptionArr.push(<a href={link} target=\"_blank\" key={key} rel=\"noopener noreferrer\">{text}</a>);\n\n\t\t\t\t// Trim a tag\n\t\t\t\tdescription = description.substring(aEndPos + 4);\n\n\t\t\t\t// Update counters\n\t\t\t\taStartPos = description.search(\"<a\");\n\t\t\t\tkey++;\n\t\t\t}\n\n\t\t\t// Add text segment if any\n\t\t\tif(description !== \"\") descriptionArr.push(description);\n\t\t\treturn descriptionArr;\n\n\t\t// No links\n\t\t} else {\n\n\t\t\tdescriptionArr.push(description);\n\t\t\treturn descriptionArr;\n\t\t}\n\n\t}", "getAspectText(asp) {\n let info = {}\n let ref = this.getReferenceById(asp.id)\n\n info.name = ref.name;\n info.nodesText = []\n \n for (let x in asp.nodes) {\n let nodeSubIndex = asp.nodes[x]\n let node = {parent: null, subNode: null, subNodeIndex: null,}\n \n node.parent = ref.nodesText[x].parent\n\n node.subNode = ref.nodesText[x].subNodes[nodeSubIndex]\n node.subNodeIndex = nodeSubIndex\n\n info.nodesText.push(node)\n }\n\n return info;\n }", "function getUrl(tweet) {\n console.log(\"---> getUrl <---\");\n // console.log(tweet.entities.urls);\n if (!tweet.entities) {\n return;\n }\n if (!tweet.entities.urls[0]) {\n return;\n }\n const link = tweet.entities.urls[0].url;\n return link;\n}", "function viewList(info, tab) {\n var aler = \"\";\n for(var i=0; i<urls.length; i++)\n aler = aler + \"\\n\" + urls[i];\n\n alert(aler);\n}", "function TextToMarkdown(gDocText){\n var gDocTextMarkdown = '';\n \n var textString = gDocText.getText();\n \n var currentURLLink = undefined;\n var currentLinkText = undefined;\n \n for(var i=0 ; i<textString.length ; i++){\n var characterLink = gDocText.getLinkUrl(i);\n \n var currentCharacter = textString[i];\n \n if(!characterLink){ // no link\n if(currentURLLink){ // end of previous link\n var linkMarkdown = '['+currentLinkText+']('+currentURLLink+')'\n gDocTextMarkdown += linkMarkdown;\n \n currentLinkText = undefined\n currentURLLink = undefined\n }\n \n gDocTextMarkdown += currentCharacter;\n }\n else{ // link\n if(!currentURLLink){ // there was no link being tracked\n currentLinkText = currentCharacter\n currentURLLink = characterLink\n }\n else{ // previous link being tracked\n if(characterLink === currentURLLink){ // same link\n currentLinkText += currentCharacter\n }\n else{ // different link\n // créer le lien en markdown\n var linkMarkdown = '['+currentLinkText+']('+currentURLLink+')'\n gDocTextMarkdown += linkMarkdown;\n \n // tracker le nouveau lien\n currentLinkText = currentCharacter\n currentURLLink = characterLink\n }\n } \n }\n }\n \n if(currentLinkText && currentURLLink){\n var linkMarkdown = '['+currentLinkText+']('+currentURLLink+')'\n gDocTextMarkdown += linkMarkdown;\n }\n\n return gDocTextMarkdown;\n}", "function searchResultDisplayHtmlString(venue){\n\n \n let venue_name = venue.name?venue.name:\"\"\n let address = venue.location.formattedAddress?venue.location.formattedAddress:\"\"\n let descriptions = venue.categories?venue.categories:\"\"\n let location_description=[]\n for(let description of descriptions){\n\n location_description.push(description.name)\n\n }\n\n return `\n <style>\n .search-result p{\n\n font-family: var(--font-family-main);\n margin:10px;\n \n \n }\n \n .search-result p a{\n \n text-decoration:none;\n color:black;\n \n }\n\n .location-name-link{\n\n font-size:17px;\n\n }\n\n .address-link{\n\n font-size:15px;\n\n }\n\n .description-link{\n\n font-size:12px;\n\n }\n\n \n .line{\n \n background-image:linear-gradient(90deg,transparent, var(--primary-color),transparent);\n width:auto;\n height:2px;\n \n }\n \n </style>\n <div class=\"search-result\" onClick=\"stopCallingApi()\">\n <p>\n <a class=\"location-name-link\" href=\"#\">${venue_name}</a> \n </p>\n <p>\n <a class=\"address-link\" href=\"#\">${address.join(\" \")}</a> \n </p>\n <p>\n <a class=\"description-link\" href=\"#\">${location_description.join(\" \")}</a> \n </p>\n\n <div class=\"line\"></div>\n </div>`\n}", "domain() {\n const domain = this.props.notice.DOMN;\n if (!domain || !Array.isArray(domain) || !domain.length) {\n return null;\n }\n const links = domain\n .map(d => (\n <a href={`/search/list?domn=[\"${d}\"]`} key={d}>\n {d}\n </a>\n ))\n .reduce((p, c) => [p, \", \", c]);\n return <React.Fragment>{links}</React.Fragment>;\n }", "function mostrarLinks(inicio, fin){\n\tvar s = '';\n\tfor(var i=inicio; i<=fin && link[i]!==undefined; i++){\n\t\tif(i==posActual) s+= '\\n<<--actual-->>\\n';//'<actual>\\n\\t';\n\t\ts += i + ':\\t' +\n\t\t\t(link[i] && typeof(link[i])=='object' ? link[i][0]+' ; '+link[i][1] : link[i]) +\n\t\t\t'\\n\\t' + imagen[i] + '\\n';\n\t\tif(i==posActual) s+= '<<--actual-->>\\n\\n';//'</actual>\\n';\n\t}\n\treturn s;\n}", "function fetch_links(str){\n var links=[]\n var tmp=str.match(/\\[\\[(.{2,80}?)\\]\\](\\w{0,10})/g)//regular links\n if(tmp){\n tmp.forEach(function(s){\n var link, txt;\n if(s.match(/\\|/)){ //replacement link [[link|text]]\n s=s.replace(/\\[\\[(.{2,80}?)\\]\\](\\w{0,10})/g,\"$1$2\") //remove ['s and keep suffix\n link=s.replace(/(.{2,60})\\|.{0,200}/,\"$1\")//replaced links\n txt=s.replace(/.{2,60}?\\|/,'')\n //handle funky case of [[toronto|]]\n if(!txt && link.match(/\\|$/)){\n link=link.replace(/\\|$/,'')\n txt=link\n }\n }else{ // standard link [[link]]\n link=s.replace(/\\[\\[(.{2,60}?)\\]\\](\\w{0,10})/g,\"$1\") //remove ['s\n }\n //kill off non-wikipedia namespaces\n if(link.match(/^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media|special|wp|wikipedia|help|user|mediawiki|portal|talk|template|book|draft|module|topic|wiktionary|wikisource):/i)){\n return\n }\n //kill off just anchor links [[#history]]\n if(link.match(/^#/i)){\n return\n }\n //remove anchors from end [[toronto#history]]\n link=link.replace(/#[^ ]{1,100}/,'')\n link=helpers.capitalise(link)\n var obj={\n page:link,\n src: txt\n }\n links.push(obj)\n })\n }\n links=links.filter(helpers.onlyUnique)\n if(links.length==0){\n return undefined\n }\n return links\n }", "function drawLink(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n _replaceSelection(cm, stat.link, '[', '](http://)');\n}", "function wikipedia_fetch_url() {\n\tvar article_name = $('#article_name').val();\n\tvar language = $('#language').val();\n var base_url = \"https://\" + language + \".wikipedia.org/w/api.php\";\n var data_format = \"&format=json\";\n var request_url = \"?action=parse&prop=text&page=\" + article_name;\n var url = base_url + request_url + data_format;\n return url;\n}", "function er_extractPdfUrlOf(servery, diningHTML) {\n\tconst regex = new RegExp(\"<p>(\\\\r\\\\n\\\\s)*<a href=\\\"([^\\\"]+)\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\">\"+buildingName+\"<\\\\/a>\");\n\tconst matchesArray = diningHTML.match(regex);\n\tconst matches = matchesArray !== null ? matchesArray.length : 0;\n\n\t// 0 = entire match, 1 = first parenthesis, 2 = URL parenthesis\n\tif (matchesArray !== null && matches === 3)\n\t\treturn matchesArray[2];\n\t\n\tconsole.error(\"Unexpected number instances of \\\"\"+buildingName+\"\\\" found. Expected 1 but got \"+matches+\".\");\n\treturn \"\";\n}", "function createOptionLabel(Text,URL){\n if ( URL && !isAllWhite(URL) )\n return ( Text + \" (\" + URL + \")\" );\n else\n return Text ;\n}", "get link() {\n return this.getText('link');\n }", "function createLink() {\n const editor = document.querySelector(`.editor-wrap`);\n const text = document.querySelector(`.editor`).innerText;\n const encoded = encodeUnicode(text);\n\n html2canvas(editor, {width: 700}).then((canvas) => {\n document.body.querySelector(`.result`).appendChild(canvas);\n });\n document.querySelector(`#text`).innerHTML = `<a href=\"/?text=${encoded}\">Copy link for plaintext</a>`;\n}", "function buildLink(xx,yy,ii,jj,kk,ll,colonyData){\r\n\tgetCell(xx,yy,ii,jj).innerHTML = createLink(constructionUrl(kk,ll,colonyData),getCell(xx,yy,ii,jj).innerHTML);\r\n}", "function demoTemplate({\n url\n}) {\n return `Go here to see a demo <a href=\"${url}\">${url}</a>.`;\n}", "function citekit_getUrlString( elementId ){\n\t\tvar thisURN = \"\";\n\t\tvar thisType = \"\";\n\t\tvar thisService = \"\";\n\t\tvar thisString = \"\";\n\n\t\t// identify the type of link\n\t for ( whichClass in citekit_var_classNames ){\n\t\t\t\tif ( $(\"#\" + elementId).hasClass(citekit_var_classNames[whichClass])) {\n\t\t\t\t\tthisType = whichClass;\n\t\t\t\t}\n\t\t}\n\n\t\t// Get the plain URN from the attribute\n\t\tif ( $(\"#\" + elementId).attr(\"src\")) {\n\t\t\t\tthisURN = $(\"#\" + elementId).attr(\"src\");\n\t\t} else if ( $(\"#\" + elementId).attr(\"cite\")) {\n\t\t\t\tthisURN = $(\"#\" + elementId).attr(\"cite\");\n\t\t} else if ( $(\"#\" + elementId).attr(\"href\")) {\n\t\t\t\tthisURN = $(\"#\" + elementId).attr(\"href\");\n\t\t}\n\n\t\t//If a service is specified, grab that URL-string\n\t\tfor (whichService in citekit_var_services){\n\t\t\t\tif ( $(\"#\" + elementId).hasClass(whichService) ){\n\t\t\t\t\tswitch (thisType) {\n\t\t\t\t\t\t\tcase \"cts\":\n\t\t\t\t\t\t\t\t\tthisString = citekit_var_services[whichService] + citekit_var_qs_GetPassagePlus;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"citeimg\":\n\t\t\t\t\t\t\t\t\tthisString = citekit_var_services[whichService] + citekit_var_qs_GetImagePlus;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"cite\":\n\t\t\t\t\t\t\t\t\tthisString = citekit_var_services[whichService] + citekit_var_qs_GetObjectPlus;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\t//Otherwise, grab the default URL-string\n\t\tif ( thisString == \"\"){ \n\t\t\t\tswitch (thisType) {\n\t\t\t\t\t\tcase \"cts\":\n\t\t\t\t\t\t\t\tthisString = citekit_var_services[citekit_var_default_cts] + citekit_var_qs_GetPassagePlus;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"citeimg\":\n\t\t\t\t\t\t\t\tthisString = citekit_var_services[citekit_var_default_img] + citekit_var_qs_GetImagePlus;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"cite\":\n\t\t\t\t\t\t\t\tthisString = citekit_var_services[citekit_var_default_coll] + citekit_var_qs_GetObjectPlus;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\n\t\t//Assemble and return\n\t\treturn thisString + thisURN;\n}", "function lineTemplate({\n config\n}) {\n let url = \"\";\n const {\n line\n } = config; // If the line should not be there we just return an empty string.\n\n if (line === exports.LineColor.NONE) {\n return ``;\n } // Construct the URL.\n\n\n if (isValidURL(line)) {\n url = line;\n } else {\n url = `https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/${line}.png`;\n }\n\n return `![-----------------------------------------------------](${url})`;\n}", "function delicious2text(links, linkFormat, linkSeparator){\n var linkTexts = [];\n links.forEach(function(link){\n var linkText = linkFormat.replace(/%([\\w]+)/g, function(match, linkAttribute){\n return link[linkAttribute];\n });\n linkTexts.push(linkText);\n });\n return linkTexts.join(linkSeparator);\n}", "function datafunction(quesion) {\n let pricearray = document.querySelectorAll(quesion);\n let details = [];\n for (let i = 0; i < pricearray.length; i++) {\n let name = pricearray[i].textContent.trim()\n let url = \"https://leetcode.com\" + pricearray[i].getAttribute('href');\n details.push(`<td><a target=\"_blank\" href=${url}>${name}</a></td>`)\n }\n \n return details;\n }", "function formatLink(text, link, rel, isImg) {\n if (typeof isImg === 'undefined') {\n isImg = false;\n }\n if (typeof rel === 'undefined') {\n rel = false;\n }\n var lnk = '';\n if (prg.markdown) {\n if (isImg) {\n lnk = \"!\";\n }\n lnk += \"[\" + text + \"](\" + link + \")\";\n } else if (prg.json) {\n lnk = {\"text\": text, \"link\": link, \"isImg\": isImg, \"rel\": rel};\n } else {\n lnk = text + \"\\t\" + link;\n }\n return lnk;\n}", "function diagramInfo(model) { // Tooltip info for the diagram's model\n return \"Model:\\n\" + model.nodeDataArray.length + \" nodes, \" + model.linkDataArray.length + \" links\";\n }", "function lc_Linkify(){\r\n var urlRegex = /_?((h\\S\\Sp)?(:\\/\\/|rapidshare\\.)[^\\s+\\\"\\<\\>]+)/ig;\r\n var snapTextElements = document.evaluate(\"//text()[\"+\r\n \"not(ancestor::a) and not(ancestor::script) and (\"+\r\n \"contains(translate(., 'RAPIDSHE', 'rapidshe'), 'rapidshare.')\"+\r\n \" or contains(translate(., 'RAPIDSFENT', 'rapidsfent'), 'rapidsafe.net/')\"+\r\n \" or contains(translate(., 'LIXN', 'lixn'), '://lix.in/')\"+\r\n \")]\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0; i < snapTextElements.snapshotLength; i++) {\r\n var elmText = snapTextElements.snapshotItem(i);\r\n if (urlRegex.test(elmText.nodeValue)) {\r\n var sURLText = elmText.nodeValue;\r\n var elmSpan = document.createElement(\"span\");\r\n // add class name\r\n elmSpan.className = \"rs_linkcheck_linked\";\r\n elmText.parentNode.replaceChild(elmSpan, elmText);\r\n urlRegex.lastIndex = 0;\r\n for(var match = null, lastLastIndex = 0; (match = urlRegex.exec(sURLText)); ) {\r\n // skip truncated links\r\n if(match[0].indexOf(\"...\") != -1) continue;\r\n // skip bare domains\r\n if(match[0].indexOf(\"/\") == -1) continue;\r\n elmSpan.appendChild(document.createTextNode(sURLText.substring(lastLastIndex, match.index)));\r\n lastLastIndex = urlRegex.lastIndex;\r\n var elmLink = document.createElement(\"a\");\r\n // make sure there's an http:\r\n elmLink.href = match[1].replace(/^((h\\S\\Sp)?:\\/\\/)?rapidshare\\./, \"http://rapidshare.\");\r\n var nextPart = \"\";\r\n // Check if there was a space\r\n if(/\\brapidshare\\.(com|de)\\/files\\/.*[^\\.]{5}$/i .test(match[0]) &&\r\n /^\\s.*\\.\\w/.test(sURLText.substring(urlRegex.lastIndex))){\r\n nextPart = sURLText.substring(urlRegex.lastIndex);\r\n nextPart = nextPart.match(/^\\s[^\\s+\\\"\\<\\>]*\\.\\w+(\\.html)?/i)[0];\r\n lastLastIndex += nextPart.length;\r\n elmLink.href += nextPart.replace(/\\s/, \"\");\r\n }\r\n // open in new window or tab\r\n elmLink.target = \"_blank\";\r\n // tool-tip to indicate Linkified\r\n elmLink.title = \"[linked]\";\r\n elmLink.appendChild(document.createTextNode(match[0] + nextPart));\r\n elmSpan.appendChild(elmLink);\r\n }\r\n elmSpan.appendChild(document.createTextNode(\r\n sURLText.substring(lastLastIndex)));\r\n elmSpan.normalize();\r\n // stop events on new links, like pop-ups and cookies\r\n elmSpan.addEventListener(\"click\", function(e){ e.stopPropagation(); }, true);\r\n }\r\n }\r\n}", "function printInfo(text) {\n var str = '';\n for(var index in info_text) {\n if(str != '' && info_text[index] != '') {\n str += \" - \";\n }\n str += info_text[index];\n }\n document.getElementById(\"graph-info\").innerHTML = str;\n }", "function resolve_links(line){\n // categories, images, files\n var re= /\\[\\[:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف):[^\\]\\]]{2,80}\\]\\]/gi\n line=line.replace(re, \"\")\n\n // [[Common links]]\n line=line.replace(/\\[\\[:?([^|]{2,80}?)\\]\\](\\w{0,5})/g, \"$1$2\")\n // [[Replaced|Links]]\n line=line.replace(/\\[\\[:?(.{2,80}?)\\|([^\\]]+?)\\]\\](\\w{0,5})/g, \"$2$3\")\n // External links\n line=line.replace(/\\[(https?|news|ftp|mailto|gopher|irc):\\/\\/[^\\]\\| ]{4,1500}([\\| ].*?)?\\]/g, \"$2\")\n return line\n }", "function linkURL(formula){\n return formula.match(/=hyperlink\\(\"([^\"]+)\"/i)[1]\n}", "function display(str, wx, wy, strtitle, source, sourceURL, add) {\n var sourceHTML = \"\";\n var showleft=mouseX;\n var showtop=mouseY;\n if (source != undefined) {\n if (sourceURL != undefined) {\n sourceHTML = '<div><center>Structure from:<a target=\"_blank\" style=\"text-decoration: underline;\" href=\"$URL$\">$SOURCE$</a></center></div>'.replace(\"$SOURCE$\", source).replace(\"$URL$\", sourceURL);\n } else {\n sourceHTML = '<div><center>Structure from:<span style=\"text-decoration: underline;\" >$SOURCE$</span></center></div>'.replace(\"$SOURCE$\", source);\n }\n }\n if(add.inchikey){\n \tvar ikey = add.inchikey.split(\"=\")[1];\n //https://www.google.com/search?q=BSYNRYMUTXBXSQ-UHFFFAOYSA-N\n \tsourceHTML += '<div style=\"text-align: center;font-size:small;\"><a href=\"https://www.google.com/search?q=' + ikey + '\" target=\"_blank\">' + ikey +'</a></div>';\n }\n //https://ginas.ncats.nih.gov/ginas/app/substances?q=CC(%3DO)OC1%3DC(C%3DCC%3DC1)C(O)%3DO&type=FLEX\n if (str == \"\" || str == undefined) {\n notify(\"No structure found for : \" + strtitle);\n return;\n }\n sourceHTML += '<div style=\"text-align: center;font-size:small;\"><a href=\"https://ginas.ncats.nih.gov/ginas/app/substances?q=' + encodeIt(str) + '&type=FLEX\" target=\"_blank\">Search GSRS</a></div>';\n \n if (strtitle == undefined) strtitle = str;\n var strtitlem = '<img style=\"margin-bottom: 2px;margin-right: 10px;border-radius: 5px; margin-left: -10px; padding: 4px; vertical-align: bottom; background: none repeat scroll 0% 0% white;/* clear: none; *//* display: inline; */\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRUlEQVR42p1STYhSURTWoimmrOQlRZM/D/+fz/+f0HkzI8ODx2slbgyGiEanoBzLGCpahLqRhIpctHBTK2cbudClCyEIQtonGc7KRYskeqHv1fceNOCQUh243HvPPd93vnPuUanmmMlkOkZR1ILqf4ym6bN+v5/1er2czWZb+mugTqc7EQqFWIC3PR5PDusmzjksHopOz8MeRrZIIBDYcblcW8jKQL7f7XZf8vl8y9g3sO9gX0XskX0UgiiLxXI0HA5vIMsjs9m8rNFozuDpEPwnoeAqSJ/Z7XYP7i4kuY/7dfiPKwTxePwLJL+G8x6C1kFAH1CmdjqdNN5fYt2SE4JkE2QXlNd8Pj+uVCrfOI57D+mXEfQU7sU/lLhgMBgoOQEIrmHXK95isSj2ej2xXq8LyWSyAYJduGc2C9LJKYJSqSQOh0NpNBpJjUZD4Hn+E+St/QuBBIKfMEkQBKnT6UxQThelMgewiwCv4BccswgUk2Ddbvc7y7JvAbDLTYxEIuto9C6G64rVasVv+jL7BIVCQRwMBmK/35+02+1JIpGYxGKxj/jSV3L3g8HgXfl7jUZjgCTJFfToMQi2tFrtKYUgk8kItVrtazqd3mu1WkI2mx1D5hMExZDR6XA41lAOD98NSH+AabwImDwDaoWAYZjnqPkFJD6sVqufm83mGFk+IHgbJLdxvgOiHGaEQzghT+xUZ5CBAOs5uaZUKvWmXC7/AOgdJJMoYRWzwREEsTQ1vjNMjaxMNBrd1Ov153/75JGeB/oFDjDMFWlNFx4AAAAASUVORK5CYII=\"><span class=\"\" style=\"' +\n 'overflow: hidden;text-overflow: ellipsis;width: 80%;display: inline-block;\">' + strtitle + \"</span>\";\n\n jQuery(\"<div class='mystr'><a name='righthere' class='shosmi' href='#righthere' style=\\\"\\\n margin: auto;\\\n display: block;\\\n text-align: center;\\\n font-size: 8pt;\\\n\\\">(show smiles)</a><input style='display:none;width: 100%;font-size: smaller;font-family: monospace;' type='textbox' value='\" + str + \"'/>\" + \n\t \"<img title='Click to get structure' style='cursor: pointer;\\\nheight: 100%;\\\nmargin: auto;\\\nmax-width: 100%;\\\ndisplay: block;\\\nmargin-bottom: -40px;' src='\" + structureImgURL(str) + \"'>\" +\n sourceHTML +\n \"</div>\")\n .dialog({\n dialogClass: 'NCATSFindDialog',\n closeText: \"hide\",\n title: strtitle,\n position: 'top',\n show: {\n effect: 'fade',\n duration: 350\n },\n hide: {\n effect: 'fade',\n duration: 250\n }\n });\n jQuery(\".NCATSFindDialog\").css('z-index', 99999);\n jQuery(\".NCATSFindDialog\").css('border', \"none\");\n jQuery(\".NCATSFindDialog\").css('border-radius', 0);\n jQuery(\".NCATSFindDialog\").css('box-shadow', \"rgba(0, 0, 0, 0.329412) 5px 5px 5px\");\n jQuery(\".NCATSFindDialog\").css('position', 'fixed');\n jQuery(\".NCATSFindDialog\").css('padding', 0);\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('border', 'none');\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('color', 'white');\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('border-radius', 0);\n jQuery(\".NCATSFindDialog .ui-dialog-titlebar\").css('background', \"rgb(158, 158, 158)\");\n\n jQuery(\".NCATSFindDialog\").not(\".setup\").css('top', showtop+ 'px');\n jQuery(\".NCATSFindDialog\").not(\".setup\").css('left', showleft+ 'px');\n jQuery(\".NCATSFindDialog\").not(\".setup\").addClass(\"setup\");\n\n\n jQuery(\".mystr a.shosmi\").click(function() {\n\tjQuery(this).parent().find(\"input\").show();\n\tjQuery(this).hide();\n });\n jQuery(\".mystr img\").click(function() {\n var smi = jQuery(this).parent().find(\"input\").val();\n var mole = {\n \"smiles\": smi\n };\n editMolecule(mole);\n });\n\n jQuery(\".ui-dialog .ui-dialog-content\").css(\"overflow\", \"hidden\");\n jQuery(\".ui-dialog-title\").css(\"overflow\", \"visible\");\n jQuery(\".ui-dialog-title\").not(\".active\").html(strtitlem);\n jQuery(\".ui-dialog-title\").addClass(\"active\");\n}", "function short(){\n shorten.shortenLink()\n .then((data)=>{\n //paint it to the DOM\n ui.paint(data)\n })\n .catch((err)=>{\n console.log(err)\n })\n}", "function e(t){return t.replace(s,function(s,e){var d=(e.match(l)||[])[1]||\"\",m=i[d];e=e.replace(l,\"\"),e.split(m).length>e.split(d).length&&(e+=d,d=\"\");var o=e,p=e;return 100<e.length&&(p=p.substr(0,100)+\"...\"),\"www.\"===o.substr(0,4)&&(o=\"http://\"+o),\"<a href=\\\"\"+o+\"\\\">\"+p+\"</a>\"+d})}", "function getUrl() { \n var uri = createUriParams(), \n url = document.URL.split(\"#\")[0]; \n \n url += \"#\" + uri \n dojo.byId(\"url\").value = url; \n \n dijit.byId(\"urlDialog\").show(); \n}", "function generateUrl(el) {\n\tvar generatedUrl = assembleUrl();\n\n\t// ADD TO CLIPBOARD add it to the dom\n\tcopyToClipboard(generatedUrl);\n\tdomElements.wrapperUrl.el.html(generatedUrl);\n}", "function constructURL(text){\n return \"https://api.funtranslations.com/translate/minion.json\" +\"?\" + \"text=\" +text;\n}", "function toUrl(string) {\n return string.indexOf('//') === -1 ? '//' + string : string;\n }", "function _getLinkEquivText(Aelt) {\n var text = '';\n var nodes = Aelt.childNodes;\n for (var i=0; i<nodes.length; i++) {\n var node = nodes[i];\n if (node.nodeType == Node.TEXT_NODE) {\n text += stripString(node.data);\n } else if (node.tagName == 'IMG') {\n var img_alt = node.getAttribute('alt');\n if (isDefinedAttr(img_alt)) {\n img_alt = stripString(img_alt);\n text += img_alt;\n }\n } else\n text += _getLinkEquivText(node);\n }\n return text;\n}", "getURL()\n {\n return this.url;\n }", "function loadLinkData(url, result) {\n // build output\n var text = \"<div class='row link_preview'>\";\n // link title\n if (result.title) {\n text += \"<h3>\" + result.title + \"</h3>\";\n text += \"<input type='hidden' name='link_title' value='\" + result.title + \"'/>\";\n }\n // link url\n //text += \"<div class='url'><em><a href='\" + url + \"' target='_blank'>\" + url + \"</a></em></div>\";\n text += \"<input type='hidden' name='link' value='\" + url + \"'/>\";\n if (result.img) {\n text += \"<img src='\" + result.img + \"' class='thumb'/>\";\n text += \"<input type='hidden' name='link_img' value='\" + result.img + \"'/>\";\n }\n // link description\n if (result.description) {\n text += \"<p>\" + result.description + \"</p>\";\n text += \"<input type='hidden' name='link_description' value='\" + result.description + \"'/>\";\n }\n text += \"</div>\";\n return text;\n}", "function plot_html(path,tree){\n\tvar node = tree;\n\tif (path != \"/null\")\n\tfor (var i = 1; i < path.length; ++i)\n\tnode = (path.charAt(i)=='1') ? node.left: node.right;\n\tvar output = '<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>Corresponding Logs</title></head><body><p>';\n\tfor (x in node.value)\n\toutput += node.value[x]+\"<br>\";\n\treturn output+\"</p></body></html>\";\n}", "rawLink () {\n const ua = navigator.userAgent.toLowerCase()\n\n /**\n * On IOS, SMS sharing link need a special formatting\n * Source: https://weblog.west-wind.com/posts/2013/Oct/09/Prefilling-an-SMS-on-Mobile-Devices-with-the-sms-Uri-Scheme#Body-only\n */\n if (this.key === 'sms' && (ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1)) {\n return this.networks[this.key].replace(':?', ':&')\n }\n\n return this.networks[this.key]\n }", "function copiarURL(text) {\r\n const textOculto = document.createElement(\"textarea\");\r\n document.body.appendChild(textOculto);\r\n textOculto.value = text;\r\n textOculto.select();\r\n document.execCommand(\"copy\");\r\n document.body.removeChild(textOculto);\r\n}", "function link_generator(data){\n\n var i = 0,\n title = data[1],\n description = data[2],\n link = data[3];\n\n for(i; i < data[3].length; i++){\n var list_link = '<a href=\"'+link[i]+'\">'+title[i]+'</a><br/>';\n list_description = list_link+description[i]+'<hr>';\n links.append(list_description);\n }\n }", "url(urls: Array<string>, scheme: ?string) {\n const bbox = WhooTS.getTileBBox(this.x, this.y, this.z);\n const quadkey = getQuadkey(this.z, this.x, this.y);\n\n return urls[(this.x + this.y) % urls.length]\n .replace('{prefix}', (this.x % 16).toString(16) + (this.y % 16).toString(16))\n .replace('{z}', String(this.z))\n .replace('{x}', String(this.x))\n .replace('{y}', String(scheme === 'tms' ? (Math.pow(2, this.z) - this.y - 1) : this.y))\n .replace('{quadkey}', quadkey)\n .replace('{bbox-epsg-3857}', bbox);\n }", "function combineDescription(node) {\n \n desc = node.description + \"\\n\\n\" \n \n links = node.stuff.filter((e) => {\n return e.text != \"Episode:\"\n });\n\n for (const e of links) {\n desc += e.text + \"\\n\" + e.url + \"\\n\\n\"\n }\n\n return desc\n\n}", "text_processor(wikitext, page_data) {\n\t\t\t// console.log(wikitext);\n\t\t\t// console.log(page_data);\n\t\t\treturn wikitext.replace(/(\\|\\s*)url-status(\\s*=\\s*)(dead|live)/g,\n\t\t\t\t(all, prefix, equal, status) => prefix + 'dead-url' + equal + (status === 'dead' ? 'yes' : 'no')\n\t\t\t).replace(/(\\|\\s*)url-status(\\s*=\\s*)(\\||}})/g, '$3');\n\t\t}", "get url() {\n return internalSlots.get(this).url.href;\n }", "function bp_ont_link(ont_acronym){\n return \"/ontologies/\" + ont_acronym;\n}", "function showPhrase(link, path, trans, lang, explan) {\r\n}" ]
[ "0.6156959", "0.61050373", "0.60797405", "0.60788804", "0.6025713", "0.5868673", "0.5726307", "0.56856424", "0.56799144", "0.56799144", "0.56794894", "0.5679213", "0.5679213", "0.56786865", "0.56637883", "0.56637883", "0.56197673", "0.55572665", "0.5548418", "0.5536193", "0.55271834", "0.5513606", "0.5489538", "0.5457801", "0.5445117", "0.5445112", "0.5416914", "0.541058", "0.5400947", "0.5396122", "0.5395802", "0.53820074", "0.5369913", "0.5366257", "0.5356924", "0.5353525", "0.5347521", "0.5340483", "0.5332629", "0.5318485", "0.53094405", "0.53070873", "0.527687", "0.52568966", "0.5238239", "0.5229468", "0.5226649", "0.52257466", "0.5218958", "0.5212471", "0.5211106", "0.5201405", "0.51954323", "0.5193024", "0.51860136", "0.5175793", "0.51752317", "0.51708895", "0.5168969", "0.51608914", "0.51568586", "0.51559937", "0.51484567", "0.5146733", "0.51283056", "0.5123773", "0.51230246", "0.5122071", "0.5112887", "0.5111336", "0.51101863", "0.5109677", "0.5107977", "0.51012737", "0.50898963", "0.5086963", "0.5081768", "0.5081353", "0.5071776", "0.50667715", "0.5061454", "0.50547135", "0.5051098", "0.5046106", "0.50460833", "0.50441706", "0.5041942", "0.5038728", "0.5036416", "0.5036199", "0.5035436", "0.50326484", "0.5031134", "0.50310445", "0.5028118", "0.5024585", "0.50227857", "0.5022241", "0.50136644", "0.5011724", "0.50116026" ]
0.0
-1
Genera la primera linea del diagrama
function lineaPrincipal() { if (!primer) { figureBuild(window.figure_LineInit, coor[0] - tamFig, coor[1]); coor[1] += 70; lineas[0]++;//Numero de lineas de entrada lineas[1]++;//Linea de entrada actual y principal = 1 primer = true; resetToNoneState(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line(){}", "function pointLineaire() {\n\tpoint1 = board.create('point', [1, (ordonnee + pente)], {\n\t\tstyle : 6,\n\t\tname : 'p1'\n\t});\n\tpoint1.setAttribute({\n\t\tstrokeColor : 'blue',\n\t\tfillColor : 'yellow',\n\t\tsize : 4\n\t});\n\tpoint2 = board.create('point', [(ordonnee / -pente), 0], {\n\t\tstyle : 6,\n\t\tname : 'p2'\n\t});\n\tpoint2.setAttribute({\n\t\tstrokeColor : 'blue',\n\t\tfillColor : 'yellow',\n\t\tsize : 4\n\t});\n\tpoint3 = board.create('point', [0, (ordonnee)], {\n\t\tvisible : false,\n\t\tstyle : 6\n\t});\n\tvar ligne = board.create('line', [point1, point2]);\n\t// affichage dynamique de l'équation à l'extérieur du graphe\n\tboard.on('update', function() {\n\t\tdocument.getElementById('equationGraph').innerHTML = \"y = \" + dynamiqueA() + 'x + ' + dynamiqueB();\n\t});\n\t//creation triangle de la pente pour equation de premier degree/\n\ttriangle = board.create('slopetriangle', [ligne, point1], {\n\t\tvisible : false\n\t});\n\ttriangle.label.setAttribute({\n\t\tvisible : false\n\t});\n\taffichageEquationLineairePoint(point1, point2);\n\tdocument.getElementById(\"equationGraph\").innerHTML = \" Équation linéaire: y = \" + pente + \"x\" + \" + \" + ordonnee;\n\tmisajour();\n}", "function render_lineOngemak() {\n var plotLine = hgiLine().margin({\n 'top': 20,\n 'right': 140,\n 'bottom': 40,\n 'left': 50\n }).mapping(['meetmoment', 'ik_ben_van_slag', 'lichamelijk_ongemak']).yDomain([0, 100]).legend(['Ik ben van slag', 'Lichamelijk ongemak']).yTicks(5).xTicks(5).xLabel('Meetmoment');\n d3.select('#lineOngemak').datum(data).call(plotLine);\n}", "function drawLines() {\n}", "function drawLines() {\n}", "drawLine() {\n ctx.moveTo(this.u0, this.v0);\n ctx.lineTo(this.u1, this.v1);\n ctx.stroke();\n }", "function line_positions() {\n\n line_one_x = win_width * .7;\n line_one_y = win_height * .8;\n\n line_two_x = win_width * .75;\n line_two_y = -(line_two.getBBox().height / 2);\n\n line_three_x = win_width * .65;\n line_three_y = win_height * .6;\n\n line_one.attr({\n transform: 't' + line_one_x + ' ' + line_one_y\n });\n line_two.attr({\n transform: 't' + line_two_x + ' ' + line_two_y\n });\n line_three.attr({\n transform: 't' + line_three_x + ' ' + line_three_y\n })\n }", "function draw_first_line(){\n points.push(start);\n points.push(end);\n}", "function lines()\n{\n //line colour\n stroke(255);\n strokeWeight(5);\n //vertical lines\n line(100,200,400,200)\n line(100,300,400,300)\n //horizontal lines\n line(200,100,200,400)\n line(300,100,300,400)\n \n \n}", "function drawLine() {\n var i = term.width;\n while(i--) {\n term.blue(\"-\");\n }\n term.blue(\"\\n\");\n}", "function render_linePositief() {\n var plotLine = hgiLine().mapping(['meetmoment', 'opgewektheid', 'ontspanning']).yDomain([0, 100]).legend(['Opgewektheid', 'Ontspanning']).yTicks(5).xLabel('Meetmoment').yLabel('Positieve gevoelens');\n //plotLine.overlayScale(0.75).overlayOffset(11);\n d3.select('#linePositief').datum(data).call(plotLine);\n}", "function line(obj) {\n var x1 = obj.x1;\n var y1 = obj.y1;\n var x2 = obj.x2;\n var y2 = obj.y2;\n\n return \"M\" + parseInt(x1) + \" \" + parseInt(y1) + \" L\" + parseInt(x2) + \" \" + parseInt(y2);\n}", "function draw() {\n let w = width / 3;\n let h = height / 3;\n\n // Toutes les prochains traits auront une épaisseur de 4\n strokeWeight(4);\n line(w, 0, w, height);\n line(w * 2, 0, w * 2, height);\n line(0, h, width, h);\n line(0, h * 2, width, h * 2);\n\n}", "function createGoalLine()\n{\n // lower goal line\n line(0, goalFrequency + goalLineDifference, canvasWidth, goalFrequency + goalLineDifference);\n\n // upper goal line\n line(0, goalFrequency - goalLineDifference, canvasWidth, goalFrequency - goalLineDifference);\n\n // display the current note\n text(goalNote, width / 2.15, goalFrequency - 30);\n\n // display number of the current octave next to the current note\n text(currentOctave, width / 1.85, goalFrequency - 30);\n}", "setLineCoordinates() {\n if (this.shown) {\n //if not self link && not linker modified pep\n if (!this.crosslink.isSelfLink() && this.crosslink.toProtein) {\n let x, y;\n const source = this.renderedFromProtein.getRenderedInteractor();\n const target = this.renderedToProtein.getRenderedInteractor();\n if (!source.ix || !source.iy) {\n console.log(\"NOT\");\n }\n // from end\n if (source.type === \"group\" || !source.expanded) {\n x = source.ix;\n y = source.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.fromResidue, this.renderedFromProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x1\", x);\n this.line.setAttribute(\"y1\", y);\n this.highlightLine.setAttribute(\"x1\", x);\n this.highlightLine.setAttribute(\"y1\", y);\n\n // to end\n if (target.type === \"group\" || !target.expanded) {\n x = target.ix;\n y = target.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.toResidue, this.renderedToProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x2\", x);\n this.line.setAttribute(\"y2\", y);\n this.highlightLine.setAttribute(\"x2\", x);\n this.highlightLine.setAttribute(\"y2\", y);\n\n }\n }\n }", "function line(sx, sy, tx, ty) {\n return 'M' + sx + ',' + sy +\n 'L' + tx + ',' + ty;\n}", "function line(sx, sy, tx, ty) {\n return 'M' + sx + ',' + sy +\n 'L' + tx + ',' + ty;\n}", "function dibujarLinea(color, xinicial, yinicial, xfinal, yfinal,lienzo)\n{\n lienzo.beginPath();\n lienzo.strokeStyle = color;\n lienzo.linewidth = 2;\n // linewidth nos define el grosor de linea.\n lienzo.moveTo(xinicial, yinicial);\n lienzo.lineTo(xfinal, yfinal);\n lienzo.stroke();\n lienzo.closePath();\n}", "function dibujarLinea(color,x_inicial,y_inicial,x_final,y_final) \n{\n lienzo.beginPath(); // Comienza el dibujo\n lienzo.strokeStyle = color; // Escoger el color de la línea\n lienzo.lineWidth = 3;\n lienzo.moveTo(x_inicial,y_inicial); // Dónde va a iniciar mi trazo\n lienzo.lineTo(x_final,y_final) // Dónde va a terminar mi trazo\n lienzo.stroke(); // Realizar el trazo\n lienzo.closePath(); // Acaba el dibujo \n}", "function draw_line(x1,y1,x2,y2,width) { \n pos1 = [x1,y1];\n pos2 = [x2,y2];\n \n direction = get_direction_vector(pos1,pos2);\n rot = rotate90(direction);\n\n x1 = pos1[0] + width/2 * rot[0];\n y1 = pos1[1] + width/2 * rot[1];\n\n x2 = pos2[0] + width/2 * rot[0];\n y2 = pos2[1] + width/2 * rot[1];\n\n x3 = pos2[0] - width/2 * rot[0];\n y3 = pos2[1] - width/2 * rot[1];\n\n x4 = pos1[0] - width/2 * rot[0];\n y4 = pos1[1] - width/2 * rot[1];\n\n var st = paper.path(\"M \" + x1 + \" \" + y1 + \" L \"\n\t\t\t+ x2 + \" \" + y2 + \" L \"\n\t\t\t+ x3 + \" \" + y3 + \" L \"\n\t\t\t+ x4 + \" \" + y4 + \" z\");\n st.attr(\"fill\", \"black\");\n return st;\n}", "function lineas(color, xinicial, yinicial, xfinal, yfinal) {\r\n lienzo.beginPath();\r\n lienzo.strokeStyle = color;\r\n lienzo.lineWidth = 4;\r\n lienzo.moveTo(xinicial, yinicial);\r\n lienzo.lineTo(xfinal, yfinal);\r\n lienzo.stroke();\r\n lienzo.closePath;\r\n}", "function line (x1, y1, x2, y2, c, w) {\n newPath(); // Neuer Grafikpfad (Standardwerte)\n if (c) ctx.strokeStyle = c; // Linienfarbe festlegen\n if (w) ctx.lineWidth = w; // Liniendicke festlegen\n ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); // Linie vorbereiten\n ctx.stroke(); // Linie zeichnen\n }", "displayLines() {\n var counter = -1;\n return this.state.cases.map( line => {\n counter+=1;\n return (<g><path d={line} fill='none' text=\"he\" stroke={this.state.color(counter)} strokeWidth='2' /></g>);\n });\n }", "static createLines(){\n Point.clearLines();\n \n \n \n //For each line, create a line between the two vertices\n for(var i = 0; i < points.length; i++){ //For every point\n for(var j = 0; j < points[i].connectedVertices.length; j++){ //For every connected vertex of the point\n var vert = Point.findPoint(String(points[i].connectedVertices[j])); //Point object of vertex\n \n if(!Point.edgeExists(points[i].name, vert.name)){ //If the edge between the two does not exist\n if(String(points[i].name).localeCompare(String(vert.name)) < 0){ //If p1 < p2\n edges[edges.length] = String(points[i].name) + String(vert.name);\n \n }else if(String(points[i].name).localeCompare(String(vert.name))){ //If p1 > p2\n edges[edges.length] = String(vert.name) + String(points[i].name);\n }\n \n //Create the line between the two\n lines[lines.length] = two.makeLine(points[i].x, points[i].y, vert.x, vert.y);\n lines[lines.length-1].stroke = '#2196F3';\n lines[lines.length-1].linewidth = 5;\n }\n }\n }\n }", "function dibujarLineas(color, x_init, y_init, x_end, y_end){\r\n\r\n\tlienzo.beginPath();\r\n\tlienzo.strokeStyle = color;\r\n\tlienzo.moveTo(x_init, y_init);\r\n\tlienzo.lineTo(x_end, y_end);\r\n\tlienzo.stroke();\r\n\tlienzo.closePath();\r\n\r\n}", "function toLine(item) {\nreturn [\"M\", item.a.x, item.a.y, \"L\", item.b.x, item.b.y].join(\" \"); }", "function lines(){\n\n\tsetColors();\n\tstroke(colorOne,colorTwo,colorThree);\n\t//lines used to divide the space\n\t//line(0,0,500,500);\n\t//line(0,500,500,0);\n\t//line(0,250,500,250);\n\t//line(250,0,250,500);\n\n\t\n}", "function strline(begin_l,begin_t,end_l,end_t){ \n ctx.beginPath();\n ctx.moveTo(begin_l,begin_t);\n ctx.lineTo(end_l,end_t);\n ctx.strokeStyle=\"#7f7e7e\";\n ctx.stroke();\n }", "function dibujarLineaGrosor(color, grosor, x_inicial, y_inicial, x_final, y_final)\n{\n lienzo.beginPath();\n lienzo.strokeStyle = color;\n lienzo.lineWidth = grosor;\n lienzo.lineCap = \"round\";\n lienzo.moveTo(x_inicial, y_inicial);\n lienzo.lineTo(x_final, y_final);\n lienzo.stroke();\n lienzo.closePath();\n}", "function render_lineEigenwaarde() {\n var plotLine = hgiLine().mapping(['meetmoment', 'piekeren', 'eigenwaarde']).yDomain([0, 100]).legend(['Gepieker', 'Eigenwaarde']).xLabel('Meetmoment').yTicks(5);\n d3.select('#lineEigenwaarde').datum(data).call(plotLine);\n}", "function dibujarlinea(color, x_inicial, y_inicial, x_final, y_final)\n{\n lienzo.beginPath();\n lienzo.strokeStyle = color;\n lienzo.moveTo(x_inicial, y_inicial);\n lienzo.lineTo(x_final, y_final);\n lienzo.stroke();\n lienzo.closePath();\n}", "function line (u1, v1, u2, v2) {\n newPath(); // Neuer Pfad (Standardwerte)\n ctx.moveTo(u1,v1); ctx.lineTo(u2,v2); // Linie vorbereiten\n ctx.stroke(); // Linie zeichnen\n }", "function makelabyrinth(){\n\t// dibujando el borde\n\tlines.push(new line(10, 10, 580, 20));\n\tlines.push(new line(10, 570, 580, 20));\n\tlines.push(new line(10, 10, 20, 290));\n\tlines.push(new line(0, 280, 20, 20));\n\tlines.push(new line(0, 340, 20, 20));\n\tlines.push(new line(10, 340, 20, 250));\n\tlines.push(new line(570, 340, 20, 250));\n\tlines.push(new line(570, 10, 20, 290));\n\tlines.push(new line(570, 340, 40, 20));\n\tlines.push(new line(570, 280, 40, 20));\n\n\t// dibujando dentro\n\t// t rara\n\tlines.push(new line(60, 60, 70, 20));\n\tlines.push(new line(130, 60, 20, 100));\n\tlines.push(new line(180, 60, 90, 100));\n\tlines.push(new line(60, 110, 40, 50));\n\n\t// bordes que sobresalen\n\tlines.push(new line(300, 10, 20, 150));\n\tlines.push(new line(300, 460, 20, 110));\n\n\t// cuadrados\n\tlines.push(new line(250, 195, 120, 30));\n\tlines.push(new line(350, 120, 190, 40));\n\tlines.push(new line(350, 60, 190, 30));\n\tlines.push(new line(400, 195, 140, 30));\n\tlines.push(new line(60, 195, 160, 30));\n\tlines.push(new line(350, 460, 90, 80));\n\tlines.push(new line(170, 460, 100, 80));\n\tlines.push(new line(110, 460, 30, 110));\n\tlines.push(new line(65, 460, 10, 80));\n\tlines.push(new line(470, 460, 30, 110));\n\tlines.push(new line(530, 460, 10, 80));\n\tlines.push(new line(60, 260, 120, 130));\n\tlines.push(new line(440, 260, 100, 130));\n\n\n\t// centro de salida de fantasmas\n\tlines.push(new line(250, 340, 120, 10));\n\tlines.push(new line(250, 260, 10, 80));\n\tlines.push(new line(250, 260, 40, 10));\n\tlines.push(new line(330, 260, 40, 10));\n\tlines.push(new line(360, 260, 10, 80));\n\n\t// relleno luego del centro\n\tlines.push(new line(210, 340, 10, 80));\n\tlines.push(new line(210, 220, 10, 80));\n\tlines.push(new line(250, 390, 120, 40));\n\tlines.push(new line(250, 195, 120, 0));\n\tlines.push(new line(60, 420, 160, 10));\n\tlines.push(new line(400, 220, 140, 10));\n\tlines.push(new line(60, 220, 160, 10));\n\tlines.push(new line(400, 220, 10, 80));\n\tlines.push(new line(400, 340, 10, 80));\n\tlines.push(new line(400, 420, 140, 10));\n\n}", "function addOneDash(){\n ctx.beginPath();\n ctx.moveTo(0, height-(rows*step));\n ctx.lineTo((width/2), height-((rows-1)*step));\n ctx.stroke();\n\n ctx.beginPath();\n ctx.setLineDash([5]);\n ctx.moveTo((width/2), height-((rows-1)*step));\n ctx.lineTo(width, height-(step*rows));\n ctx.stroke();\n ctx.setLineDash([]);\n }", "_getLinePath() {\n const graph = this.graph;\n const width = graph.getWidth();\n const height = graph.getHeight();\n const tl = graph.getPoint({\n x: 0,\n y: 0\n });\n const br = graph.getPoint({\n x: width,\n y: height\n });\n const cell = this.cell;\n const flooX = Math.ceil(tl.x / cell) * cell;\n const flooY = Math.ceil(tl.y / cell) * cell;\n const path = [];\n for (let i = 0; i <= br.x - tl.x; i += cell) {\n const x = flooX + i;\n path.push([ 'M', x, tl.y ]);\n path.push([ 'L', x, br.y ]);\n }\n for (let j = 0; j <= br.y - tl.y; j += cell) {\n const y = flooY + j;\n path.push([ 'M', tl.x, y ]);\n path.push([ 'L', br.x, y ]);\n }\n return path;\n }", "function draw_line(p1, p2) {\n var dist = Math.sqrt((p1.x - p2.x) * (p1.x - p2.x)\n + (p1.y - p2.y) * (p1.y - p2.y));\n var line = document.createElement(\"div\");\n line.className = \"line\";\n line.style.width = dist + \"px\";\n line.style.backgroundColor = \"#bbbbbb\";\n lines_div.appendChild(line);\n var m = (p1.y - p2.y) / (p1.x - p2.x);\n var ang = Math.atan(m);\n var ps = [p1, p2];\n var left = ps[0].x < ps[1].x ? 0 : 1;\n var top = ps[0].y < ps[1].y ? 0 : 1;\n if (left == top) {\n line.style.transformOrigin = \"top left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n else {\n line.style.transformOrigin = \"bottom left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[1 - top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n}", "display() {\n line(this.start.x, this.start.y, this.end.x, this.end.y);\n }", "generateHor(h,w)\n\t{\n\t\tfor(var y = 0; y < h ; y++)\n\t\t{\n\t\t\tfor(var x = 0; x < w-1 ; x++)\n\t\t\t{\n\t\t\t\tvar a = new Dot(x,y);\n\t\t\t\tvar b = new Dot(x+1,y);\n\t\t\t\tvar l = new Line(a,b);\n\t\t\t\tthis.lines.set(l.toString(), l);\n\t\t\t}\n\t\t}\n\t}", "function generate_line()\n{\n\tlet x={};\n\tx.NUM_STEP=200;\n\tx.step_size=1/x.NUM_STEP;\n\tx.linepoints = new Float32Array(x.NUM_STEP);\n\tfor(let n=0; n <x.NUM_STEP ; n++)\n\t{\n\t\tx.linepoints[n] = x.step_size*n;\n\t}\n\treturn x;\n}", "function SVGLineChart() {\r\n }", "function drawlines(){\n stroke(0);\n for(var i = 0; i < 450; i = i + 45){\n line(298, 135 + i, 380, 135 + i);\n }\n}", "generateVer(h,w)\n\t{\n \n\t\tfor(var y = 0; y <h-1 ; y++)\n\t\t{\n\t\t\tfor(var x = 0; x < w ; x++)\n\t\t\t{\n\t\t\t\tvar a = new Dot(x,y);\n\t\t\t\tvar b = new Dot(x,y+1);\n\t\t\t\tvar l = new Line(a,b);\n\t\t\t\tthis.lines.set(l.toString(),l);\n\t\t\t}\n\t\t}\n\t}", "function line (x1, y1, x2, y2) {\n newPath(); // Neuer Grafikpfad (Standardwerte)\n ctx.moveTo(x1,y1); // Anfangspunkt\n ctx.lineTo(x2,y2); // Weiter zum Endpunkt\n ctx.stroke(); // Linie zeichnen\n }", "drawLineSegment(line, circle){\n // this.lineGraphics.lineStyle(10, 0xfdfd96, 0.7);\n // this.lineGraphics.strokeLineShape(line);\n // this.lineGraphics.fillStyle(0xfdfd96, 0.7);\n // this.lineGraphics.fillCircleShape(circle);\n\n\n }", "function lines() {\n let gapSize = 40;\n let numColumns = displayWidth / gapSize;\n let numRows = displayHeight / gapSize;\n let x = 0;\n let y = 0;\n\n strokeWeight( 1 );\n stroke(\"#eaeaea\");\n\n for( let i = 0; i < numRows; i++ ) {\n y += gapSize;\n line( 0, y, displayWidth, y );\n }\n \n for( let i = 0; i < numColumns; i++){\n x += gapSize;\n line( x, 0, x, displayHeight );\n }\n}", "drawLines() {\n stroke(this.lineColor);\n line(this.startLine, this.top, this.startLine, this.bottom); // start line\n line(this.endLine, this.top, this.endLine, this.bottom); // end line\n }", "function drawline() {\n\n if (isDrawing) {\n linePoint2 = d3.mouse(this);\n gContainer.select('line').remove();\n gContainer.append('line')\n .attr(\"x1\", linePoint1.x)\n .attr(\"y1\", linePoint1.y)\n .attr(\"x2\", linePoint2[0] - 2) //arbitary value must be substracted due to circle cursor hover not working\n .attr(\"y2\", linePoint2[1] - 2); // arbitary values must be tested\n\n }\n }", "function custom_line(specs) {\n // Store relevant variables\n var delta_x = specs.Point_b.x - specs.Point_a.x;\n var delta_y = specs.Point_b.y - specs.Point_a.y;\n var increment_x = delta_x / specs.nsegments;\n var increment_y = delta_y / specs.nsegments;\n\n // Calculate the points\n var points = [];\n points.push(specs.Point_a);\n for (var i = 1; i < specs.nsegments; i++) {\n this_point = [\n specs.Point_a.x +\n increment_x * i +\n randFBtwn(-specs.wobble, specs.wobble),\n specs.Point_a.y +\n increment_y * i +\n randFBtwn(-specs.wobble, specs.wobble),\n ];\n points.push(this_point);\n }\n points.push(specs.Point_b);\n\n // Create path\n var myPath = new Path({\n segments: points,\n });\n\n // Style path\n myPath.strokeWidth = specs.stroke_width;\n myPath.strokeColor = specs.stroke_color;\n myPath.strokeCap = specs.stroke_cap;\n myPath.smooth();\n\n // myPath.parent = specs.parent;\n}", "async drawFinalLines(){\n let that = this;\n let FinalLines = [0, 1];\n let FLines = d3.select(\"#Final-Lines\").selectAll('line');\n let joined = FLines.data(FinalLines).join('line')\n joined.attr(\"x1\", d =>{\n if(d == 0)\n return that.buffer + that.lineLength * 3;\n else\n return that.buffer + that.lineLength * 4;})\n .attr(\"y1\", d =>{\n if(d == 0)\n return that.buffer + that.R16Separation * 7 / 2;\n else\n return that.buffer + that.R16Separation * 7 / 2 - that.lineLength;})\n .attr(\"x2\", d =>{\n if(d == 0)\n return that.buffer + that.lineLength * 5;\n else\n return that.buffer + that.lineLength * 4;})\n .attr(\"y2\", d =>{\n if(d == 0)\n return that.buffer + that.R16Separation * 7 / 2;\n else\n return that.buffer + that.R16Separation * 7 / 2;})\n .attr(\"class\", \"bracket-line\"); \n }", "function line (x1, y1, x2, y2, c, w) {\n ctx.beginPath(); // Neuer Pfad\n if (c) ctx.strokeStyle = c; // Linienfarbe, falls angegeben\n ctx.lineWidth = (w ? w : 1); // Liniendicke, falls angegeben\n ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); // Linie vorbereiten\n ctx.stroke(); // Linie zeichnen\n }", "drawLineFunction(){\n //Using the pre set variables (this.) from the constructor, this.fillcolour will equal to the random values of this.Green/Red/Blue/Alpha\n this.fillcolour = color(this.Red, this.Green, this.Blue, this.Alpha);\n fill(this.fillcolour);//This then fills a line with the a random colour \n stroke(this.fillcolour);//This then fills a lines stroke with the a random colour \n \n //This creates a new operator (this.x2) and maps it to the value of x1 with a range of 0 to width to width to 0.\n this.x2 = map(this.x1, 0, width, width, 0);\n //This creates a new operator (this.y2) and maps it to the value of y1 with a range of 0 to height to height to 0.\n this.y2 = map(this.y1, 0, height, height, 0);\n \n //this is creating the lines and their partners to refelect\n line(this.x1, this.y1, this.size, this.size);\n line(this.x2, this.y2, this.size, this.size);\n line(this.x2, this.y1, this.size, this.size);\n line(this.x1, this.y2, this.size, this.size);\n \n }", "function get_line_x1(step) {\n\treturn 75 + step * 50;\n}", "function diagram (u, v) {\n newPath(); // Neuer Grafikpfad (Standardwerte)\n arrow(u-10,v,u+215,v); // Waagrechte Achse (Zeit t)\n var pixT = 4; // Umrechnungsfaktor (Pixel pro Sekunde)\n for (var i=1; i<=5; i++) { // Für alle Ticks der t-Achse (im Abstand 10 s) ...\n var uT = u+i*10*pixT; // Waagrechte Bildschirmkoordinate (Pixel) \n line(uT,v-3,uT,v+3); // Tick zeichnen\n }\n ctx.fillStyle = \"#000000\"; // Schriftfarbe schwarz\n ctx.textAlign = \"center\"; // Textausrichtung zentriert\n ctx.fillText(symbolTime,u+210,v+15); // Beschriftung t-Achse\n arrow(u,v+45,u,v-45); // Senkrechte Achse (Spannung U)\n for (i=-2; i<=2; i++) { // Für alle Ticks der U-Achse ...\n var vT = v+i*15; // Senkrechte Bildschirmkoordinate (Pixel)\n line(u-3,vT,u+3,vT); // Tick zeichnen\n }\n ctx.textAlign = \"right\"; // Textausrichtung rechtsbündig\n ctx.fillText(symbolVoltage,u-5,v-35); // Beschriftung U-Achse\n var a = 75*omega/PI; // Amplitude (Pixel)\n var f1 = omega/pixT; // Faktor für Zeitachse\n newPath(); // Neuer Grafikpfad (Standardwerte)\n ctx.moveTo(u,v-direction*a); // Anfangspunkt des Polygonzugs\n var uu = u; // Waagrechte Bildschirmkoordinate\n while (uu < u+200) { // Solange rechtes Ende noch nicht erreicht ...\n uu += 0.5; // Waagrechte Bildschirmkoordinate erhöhen\n var vv = v-dvDiagram(uu-u,f1,a); // Senkrechte Bildschirmkoordinate\n // Korrektur für Unterbrechung durch Isolierschicht des Kommutators\n ctx.lineTo(uu,vv); // Linie des Polygonzugs vorbereiten\n }\n ctx.stroke(); // Polygonzug zeichnen (Näherung für Kurve)\n var u0 = u+t*pixT; // Waagrechte Bildschirmkoordinate für aktuelle Zeit\n var v0 = v-dvDiagram(u0-u,f1,a); // Senkrechte Bildschirmkoordinate für aktuelle Spannung\n circle(u0,v0,2.5,colorVoltage); // Markierung für aktuelle Werte\n }", "draw() {\n if (!this.lines[1]) { return; }\n let left = this.endpoints[0].x;\n let right = this.endpoints[1].x + this.endpoints[1].boxWidth;\n\n let lOffset = -this.endpoints[0].boxWidth / 2;\n let rOffset = this.endpoints[1].boxWidth / 2;\n\n if (this.endpoints[0].row === this.endpoints[1].row) {\n // draw left side of the brace and align text\n let center = (-left + right) / 2;\n this.x = center + lOffset;\n this.svgText.x(center + lOffset);\n this.lines[0].plot('M' + lOffset + ',33c0,-10,' + [center,0,center,-8]);\n this.lines[1].plot('M' + rOffset + ',33c0,-10,' + [-center,0,-center,-8]);\n }\n else {\n // draw right side of brace extending to end of row and align text\n let center = (-left + this.endpoints[0].row.rw) / 2 + 10;\n this.x = center + lOffset;\n this.svgText.x(center + lOffset);\n\n this.lines[0].plot('M' + lOffset\n + ',33c0,-10,' + [center,0,center,-8]\n + 'c0,10,' + [center,0,center,8]\n );\n this.lines[1].plot('M' + rOffset\n + ',33c0,-10,' + [-right + 8, 0, -right + 8, -8]\n + 'c0,10,' + [-right + 8, 0, -right + 8, 8]\n );\n }\n\n // propagate draw command to parent links\n this.links.forEach(l => l.draw(this));\n }", "function dibujarLinea(color, xinicial, yinicial, xfinal, yfinal)\n{\n lienzo.beginPath();\n lienzo.strokeStyle = color;\n lienzo.moveTo(xinicial, yinicial);\n lienzo.lineTo(xfinal, yfinal);\n lienzo.stroke();\n lienzo.closePath();\n}", "function drawLine(blocks, lineNo) {\n return blocks.map(function(block) {\n return block[lineNo];\n }).join(\" \");\n }", "function createLine() {\n\t\tlet element = document.createElement('span')\n\t\telement.className = 'line'\n\t\treturn element\n\t}", "function createDiagramMoney(categoriesArr, linesArr, textTitle) {\n // plugin options \n\n Highcharts.setOptions({\n colors: ['green', 'blue', 'red', 'aqua', 'black', 'gray']\n })\n\n $('#container_diagram_money').highcharts({\n plotOptions: {\n series: {\n lineWidth: 3,\n marker: {\n symbol: 'circle',\n\n }\n }\n },\n title: {\n text: textTitle\n },\n chart: {\n type: 'line',\n\n },\n subtitle: {\n\n },\n xAxis: {\n categories: categoriesArr,\n gridLineDashStyle: 'ShortDot',\n gridLineWidth: 1\n },\n yAxis: {\n gridLineDashStyle: 'ShortDot',\n title: {\n text: ''\n }\n },\n tooltip: {\n valueSuffix: ' грн.'\n },\n legend: {\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'bottom',\n y: 50,\n padding: 3,\n itemMarginTop: 5,\n itemMarginBottom: 5,\n itemStyle: {\n lineHeight: '14px'\n }\n },\n series: linesArr\n });\n }", "function lineType(){\n $('#linesolid').click(function(){\n context.setLineDash([0]);\n\n });\n\n $('#linedash').click(function(){\n context.setLineDash([2,30]);\n \n\n });\n }", "function intializeLine() {\n var svg = document.getElementsByTagName('svg')[0];\n svgLine.setAttribute('stroke', 'black');\n svgLine.setAttribute('x1', line.x1);\n svgLine.setAttribute('y1', line.y1);\n svg.appendChild(svgLine);\n}", "function dibujarLinea(color, xinicial, yinicial, xfinal, yfinal)\n{\n lienzo.beginPath(); //inicializacion del trazo\n lienzo.strokeStyle = color; //establece el color del dibujo\n lienzo.moveTo(xinicial, yinicial); //inicializa la ubicacion dentro del canvas donde va a comenzar el trazo\n lienzo.lineTo(xfinal, yfinal); //ubicacion donde termina el trazo\n lienzo.stroke(); //finaliza el trazo \n lienzo.closePath(); //finalizacion del dibujo\n}", "drawLine(){\n for (var index in this.draw){\n this.draw[index] = this.fracToPixel(this.draw[index])\n }\n canvas.beginPath();\n canvas.moveTo(this.draw[\"rightX\"],this.draw[\"rightY\"]);\n canvas.lineTo(this.draw[\"leftX\"],this.draw[\"leftY\"]);\n canvas.stroke();\n }", "toLine() {\n return {\n x1: this[0][0],\n y1: this[0][1],\n x2: this[1][0],\n y2: this[1][1]\n }\n }", "function single(){\n ctx.moveTo(0, height-(rows*step));\n ctx.lineTo((width/2), height-((rows-1)*step));\n }", "show () {\n stroke(255);\n line(this.initial.x, this.initial.y, this.final.x, this.final.y)\n }", "function addOnePer(){\n ctx.beginPath();\n single();\n ctx.lineTo(width, height-(step*rows));\n ctx.stroke();\n }", "function addLine(){\n\t\t\tvar x = unCheck();\n\t\t\tvar y = check5(num, line, fill);\n\t\t\tswitch (y){\n\t\t\t\tcase \"diagonal1\":\n\t\t\t\t\t$(x + \".TL\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".BR\").addClass(\"diagonal1\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"diagonal2\":\n\t\t\t\t\t$(x + \".TR\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".BL\").addClass(\"diagonal2\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"horizontal\":\n\t\t\t\t\tif(num%9 < 3){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%9 < 6){\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"vertical\":\n\t\t\t\t\tif (num%3 == 0){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%3 == 1){\n\t\t\t\t\t\t\t$(x + \".TM\").addClass(\"vertical\");\n\t\t\t\t\t\t\t$(x + \".MM\").addClass(\"vertical\");\n\t\t\t\t\t\t\t$(x + \".BM\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function addLine(){\n\t\t\tvar x = unCheck();\n\t\t\tvar y = check5(num3, line, W.spaces[num2]);\n\t\t\tswitch (y){\n\t\t\t\tcase \"diagonal1\":\n\t\t\t\t\t$(x + \".TL\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal1\");\n\t\t\t\t\t$(x + \".BR\").addClass(\"diagonal1\");\n\t\t\t\t\tline2 = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"diagonal2\":\n\t\t\t\t\t$(x + \".TR\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".MM\").addClass(\"diagonal2\");\n\t\t\t\t\t$(x + \".BL\").addClass(\"diagonal2\");\n\t\t\t\t\tline2 = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"horizontal\":\n\t\t\t\t\tif(num%9 < 3){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%9 < 6){\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BM\").addClass(\"horizontal\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"horizontal\");\n\t\t\t\t\t}\n\t\t\t\t\tline2 = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"vertical\":\n\t\t\t\t\tif (num%3 == 0){\n\t\t\t\t\t\t$(x + \".TL\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".ML\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BL\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(num%3 == 1){\n\t\t\t\t\t\t$(x + \".TM\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".MM\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BM\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(x + \".TR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".MR\").addClass(\"vertical\");\n\t\t\t\t\t\t$(x + \".BR\").addClass(\"vertical\");\n\t\t\t\t\t}\n\t\t\t\t\tline2 = 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function addOnePerDash(){\n ctx.beginPath();\n ctx.setLineDash([5]);\n single();\n ctx.lineTo(width, height-(step*rows));\n ctx.stroke();\n ctx.setLineDash([]);\n }", "function render_lineNegatief() {\n var plotLine = hgiLine().mapping(['meetmoment', 'somberheid', 'onrust']).yDomain([0, 100]).legend(['Somberheid', 'Onrust']).yTicks(5).xLabel('Meetmoment').yLabel(\"Negatieve gevoelens\");\n d3.select('#lineNegatief').datum(data).call(plotLine);\n}", "function addLine () {\n\tconst linksCoords = this.getBoundingClientRect();\n\tline.style.width = `${linksCoords.width}px`;\n\tline.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`;\n\tline.style.opacity = 1;\n}", "function drawLine(blocks, lineNo) {\n return blocks.map(block => {\n return block[lineNo];\n }).join(\" \");\n }", "toLine() {\n return {\n x1: this[0][0],\n y1: this[0][1],\n x2: this[1][0],\n y2: this[1][1]\n };\n }", "lineRender(){\n d3.select('.circle-legend').select('svg').append('line').attr('x1',0).attr('x2',180).attr('y1',0).attr('y2',0)\n .attr('transform','translate(0,55)').classed('legendLine',true)\n }", "function dibujarLinea(color, xinicial, yinicial, xfinal, yfinal, lienzo) //función que dibuja líneas\n{\n lienzo.beginPath(); //inicia el trazo\n lienzo.strokeStyle = color; //Color\n lienzo.moveTo(xinicial,yinicial); //punto de inicio\n lienzo.lineTo(xfinal, yfinal); //punto final\n lienzo.stroke(); //traza la raya\n lienzo.closePath(); //termina el trazo\n}", "function addline() {\n line(0,sz,sz*3,sz);\n line(0,sz*2,sz*3,sz*2);\n line(sz,0,sz,sz*3);\n line(sz*2,0,sz*2,sz*3);\n}", "function draw_line(svg1, data, xScale, yScale,class_name){\r\n\tvar valueline = d3.svg.line();\r\n\t//Tracer la ligne \r\n\tvalueline.x(function (d) { return xScale(d.annee) + (xScale.rangeBand() / 2); })\r\n .y(function (d) { return yScale(d.chiffre_af); });\r\n\t// On appelle ici la fonction valueline qui donne les coordonnées à relier à la ligne.\r\n\t// On les append à notre path\t\r\n\tsvg1.append(\"path\") \r\n .data(data)\r\n\t\t.attr(\"class\",class_name)\r\n\t\t.attr(\"fill\", \"none\")\r\n .attr(\"d\", valueline(data));\r\n}", "function drawLine(v1, v2) {\n push();\n strokeWeight(rez * 0.2);\n stroke(255, randomG, randomB);\n line(v1.x, v1.y, v2.x, v2.y);\n pop();\n}", "function drawLines(n){\n\t\t/** Traverses the text's length */\n\t\tfor (var i = 0; i < n.length; i++){\n\t\t\t/** Creates a space for each letter in the argument */\n\t\t\tlines.push(\"_\");\n\t\t}\n\t\t/** This is the product */\n\t\t\n\t\treturn lines.join(\"\");\n\t}", "function vlini(p) {\n if (!isNaN(p.a)) {\n return 'M 0,0 m '+p.a+',0 h -'+2*p.a+ \n ' a '+p.a+','+p.a+' 0 1,0 '+2*p.a+',0 a '+p.a+','+p.a+\n ' 0 1,0 -'+2*p.a+',0 m '+p.a+',-'+p.a+' v '+2*p.a;\n } else {\n return 'M 0,0'+' l '+-p.a.x*twidth+','+p.a.y*theight +\n ' M 0,0'+' l '+p.a.x*twidth +','+-p.a.y*theight;\n }\n}", "addLine() {\n this.chart.append(\"path\")\n .datum(this.dataset) // Binds data to the line \n .attr(\"class\", \"line\") // Assign a class for styling \n .attr(\"d\", this.generateLine()) // d is the path to be drawn. Pass the function to call to generate path.\n .style('stroke', this.lineColor || '#ffab00'); // set line color\n }", "function line (x1, y1, x2, y2, c) {\r\n newPath(); // Neuer Grafikpfad (Standardwerte)\r\n if (c) ctx.strokeStyle = c; // Linienfarbe festlegen, falls angegeben\r\n ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); // Linie vorbereiten\r\n ctx.stroke(); // Linie zeichnen\r\n }", "function CalculationStepLine(options) {\n // TODO: CLEAN ALL OF THIS CODE\n // TODO: GET RID OF CONSTANT COLUMN POSITIONS\n\n const leftColumnPosition = 100;\n const middleColumnPosition = 100;\n\n let barHeight,\n color,\n domain,\n fontFamily,\n fontSize,\n labelText,\n line,\n scale,\n where;\n\n line = this;\n\n init(options);\n\n return line;\n\n /* INTIIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n scale = defineScale();\n\n line.group = addGroup();\n line.columns = addColumns();\n\n line.label = addLabel()\n .update(labelText);\n\n line.bar = addBar();\n\n }\n\n /* PRIVATE METHODS */\n function _defaults(options) {\n\n barHeight = options.barHeight ? options.barHeight : 10;\n color = options.color ? options.color : \"black\";\n fontSize = options.fontSize ? options.fontSize : \"15pt\";\n fontFamily = options.fontFamily ? options.fontFamily : \"\";\n labelText = options.label ? options.label +\" =\" : \"=\";\n domain = options.domain ? options.domain : [0,1];\n line.lineHeight = options.lineHeight ? options.lineHeight : 25;\n\n }\n\n function _required(options) {\n\n where = options.where;\n\n }\n\n function addBar() {\n let bar;\n\n bar = new CalculationStepLinearIndicator({\n \"where\":line.columns.middle,\n \"color\":color,\n \"scale\":scale,\n \"fontSize\":fontSize,\n \"fontFamily\":fontFamily,\n \"height\":barHeight\n });\n\n return bar;\n }\n\n function addColumns() {\n let groupObject;\n\n groupObject = {};\n\n groupObject.left = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+leftColumnPosition+\",0)\");\n\n\n groupObject.middle = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+middleColumnPosition+\",0)\");\n\n\n return groupObject;\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n })\n .attr(\"transform\",\"translate(0,50)\");\n\n return group;\n }\n\n\n function addLabel() {\n let label;\n\n // TODO: DOES COLUMNS REALLY NEED TO BE PUBLIC?\n label = new ExplorableHintedText({\n \"where\":line.columns.left,\n \"textAnchor\":\"end\",\n \"foregroundColor\":color,\n \"fontFamily\":fontFamily,\n \"fontWeight\":\"normal\",\n \"fontSize\":fontSize\n })\n .move({\n \"x\":-5,\n \"y\":0\n });\n\n return label;\n }\n\n\n function defineScale() {\n let scale;\n\n //TODO: DONT HARD CODE DOMAIN AND RANGE\n scale = d3.scaleLinear()\n .domain(domain)\n .range([0,100]);\n\n return scale;\n }\n\n}", "function CalculationStepLine(options) {\n // TODO: CLEAN ALL OF THIS CODE\n // TODO: GET RID OF CONSTANT COLUMN POSITIONS\n\n const leftColumnPosition = 100;\n const middleColumnPosition = 100;\n\n let barHeight,\n color,\n domain,\n fontFamily,\n fontSize,\n labelText,\n line,\n scale,\n where;\n\n line = this;\n\n init(options);\n\n return line;\n\n /* INTIIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n scale = defineScale();\n\n line.group = addGroup();\n line.columns = addColumns();\n\n line.label = addLabel()\n .update(labelText);\n\n line.bar = addBar();\n\n }\n\n /* PRIVATE METHODS */\n function _defaults(options) {\n\n barHeight = options.barHeight ? options.barHeight : 10;\n color = options.color ? options.color : \"black\";\n fontSize = options.fontSize ? options.fontSize : \"15pt\";\n fontFamily = options.fontFamily ? options.fontFamily : \"\";\n labelText = options.label ? options.label +\" =\" : \"=\";\n domain = options.domain ? options.domain : [0,1];\n line.lineHeight = options.lineHeight ? options.lineHeight : 25;\n\n }\n\n function _required(options) {\n\n where = options.where;\n\n }\n\n function addBar() {\n let bar;\n\n bar = new CalculationStepLinearIndicator({\n \"where\":line.columns.middle,\n \"color\":color,\n \"scale\":scale,\n \"fontSize\":fontSize,\n \"fontFamily\":fontFamily,\n \"height\":barHeight\n });\n\n return bar;\n }\n\n function addColumns() {\n let groupObject;\n\n groupObject = {};\n\n groupObject.left = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+leftColumnPosition+\",0)\");\n\n\n groupObject.middle = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+middleColumnPosition+\",0)\");\n\n\n return groupObject;\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n })\n .attr(\"transform\",\"translate(0,50)\");\n\n return group;\n }\n\n\n function addLabel() {\n let label;\n\n // TODO: DOES COLUMNS REALLY NEED TO BE PUBLIC?\n label = new ExplorableHintedText({\n \"where\":line.columns.left,\n \"textAnchor\":\"end\",\n \"foregroundColor\":color,\n \"fontFamily\":fontFamily,\n \"fontWeight\":\"normal\",\n \"fontSize\":fontSize\n })\n .move({\n \"x\":-5,\n \"y\":0\n });\n\n return label;\n }\n\n\n function defineScale() {\n let scale;\n\n //TODO: DONT HARD CODE DOMAIN AND RANGE\n scale = d3.scaleLinear()\n .domain(domain)\n .range([0,100]);\n\n return scale;\n }\n\n}", "function line() {\n var inlineHtml =\n '<hr style=\"height:5px; width:100%; border-width:0; color:red; background-color:#fff\">'\n\n return inlineHtml\n }", "function dibujarLineas(color, xinicial, yinicial, xfinal, yfinal) { // funciones de javascript\n lienzo.beginPath(); //arrancar dibujo invocado no tienen parametros\n lienzo.strokeStyle = color; //color del lapiz - atributo o porpiedad del objeto llamado\n lienzo.moveTo(xinicial, yinicial); //funcion de mover de un punto x y\n lienzo.lineTo(xfinal, yfinal); // funcion de trazar linea en punto x y\n lienzo.stroke(); // funcion de trazar linea\n lienzo.closePath(); // funcion de cerrar dibujo\n }", "function line (x1, y1, x2, y2, c) {\n newPath(); // Neuer Grafikpfad (Standardwerte)\n if (c) ctx.strokeStyle = c; // Linienfarbe festlegen, falls angegeben\n ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); // Linie vorbereiten\n ctx.stroke(); // Linie zeichnen\n }", "function generaAhorcado(){\n var c = document.getElementById(\"myCanvas\");\n var ctx = c.getContext(\"2d\");\n ctx.beginPath();\n ctx.lineWidth=10;\n ctx.lineCap=\"round\";\n ctx.moveTo(10,390);\n ctx.lineTo(120,390);\n ctx.stroke();\n ctx.beginPath();\n ctx.lineWidth=10;\n ctx.lineCap=\"round\";\n ctx.moveTo(65,390);\n ctx.lineTo(65,20);\n ctx.stroke();\n ctx.beginPath();\n ctx.lineWidth=10;\n ctx.lineCap=\"round\";\n ctx.moveTo(65,20);\n ctx.lineTo(250,20);\n ctx.stroke();\n ctx.beginPath();\n ctx.lineWidth=10;\n ctx.lineCap=\"round\";\n ctx.moveTo(250,20);\n ctx.lineTo(250,70);\n ctx.stroke();\n}", "function dibujarLineaGrosor(color, grosor, x_inicial, y_inicial, x_final, y_final) {\n lienzo.beginPath();\n lienzo.strokeStyle = color;\n lienzo.lineWidth = grosor;\n lienzo.lineCap = \"round\";\n lienzo.moveTo(x_inicial, y_inicial);\n lienzo.lineTo(x_final, y_final);\n lienzo.stroke();\n lienzo.closePath();\n}", "function makeLine(x1, y1, x2, y2){\n\tlet color;\n\tlet lineClass = \"l\" + selCurve;\n\tif(lineCB.checked) color = \"#a832a0\";\n\telse color = \"#00000000\";\n\tvar l = document.createElementNS(web, \"line\");\n\tl.setAttribute(\"x1\", x1);\n\tl.setAttribute(\"y1\", y1);\n\tl.setAttribute('x2', x2);\n\tl.setAttribute('y2', y2);\n\tl.setAttribute('style', 'stroke : ' + color + '; stroke-width : 2');\n\tl.setAttribute(\"class\", lineClass);\n\tmainCanvas.appendChild(l);\n}", "function drawLines () {\n lineX1 = random(110, 860);\n lineY1 = random(110, 410);\n lineX2 = random(110, 860);\n lineY2 = random(110, 410);\n stroke(100, 65, 0, random(255));\n strokeWeight(2);\n line(lineX1, lineY1, lineX2, lineY2);\n}", "function dibujarLinea(color, x_inicial, y_inicial, x_final, y_final)\n{\n lienzo.beginPath(); //empezar un trazo\n lienzo.strokeStyle = color;\n lienzo.moveTo(x_inicial,y_inicial); //mover el lapiz donde arranca la linea. Arranca en el punto x=100, y=100\n lienzo.lineTo(x_final,y_final); //hasta donde va la linea\n lienzo.stroke(); //es el \"dibujar\" la linea\n lienzo.closePath();\n}", "function lineP (u, v, p, i) {\n line(u,v,p[i].u,p[i].v); // Linie zeichnen\n }", "function handerLines() {\n if (lines) {\n return Object.keys(lines).forEach(key => {\n var row = lines[key];\n var start = lines[key].start;\n var end = lines[key].end;\n\n if (start) {\n // For now we focus on the horiztonal and vertical first. \n if (start.x === '0' && start.y === '0') {\n x1 = DEFAULT_X;\n y1 = DEFAULT_Y;\n }\n\n else if (start.y !== '0') {\n x1 = (parseInt(start.x) * 80) + DEFAULT_X;\n y1 = (parseInt(start.y) * 72) + (DEFAULT_Y * parseInt(start.y));\n }\n\n // For some reason, second and fourth row in ys are showing off the corridation. \n else {\n x1 = (parseInt(start.x) * 80) + DEFAULT_X;\n y1 = (parseInt(start.y) * 72) + DEFAULT_Y;\n }\n }\n\n if (end) {\n if (end.x === '0' && end.y === '0') {\n x2 = DEFAULT_X;\n y2 = DEFAULT_Y;\n }\n else if (end.y !== '0') {\n x2 = parseInt(end.x) * 80 + DEFAULT_X;\n y2 = (parseInt(end.y) * 72) + (DEFAULT_Y * parseInt(end.y));\n }\n else {\n x2 = parseInt(end.x) * 80 + DEFAULT_X;\n y2 = (parseInt(end.y) * 72) + DEFAULT_Y;\n }\n }\n return temp.push([x1, y1, x2, y2]);\n // temp.push(<line x1={x1} y1={y1} x2={x2} y2={y2} />) // DON'T TOUCH THIS!\n });\n\n }\n // setTest(prevState => [prevState, x1])\n }", "function line(x1, y1, x2, y2) {\n let line = document.createElementNS(Svg.svgNS, \"line\");\n line.setAttribute(\"x1\", x1.toString());\n line.setAttribute(\"y1\", y1.toString());\n line.setAttribute(\"x2\", x2.toString());\n line.setAttribute(\"y2\", y2.toString());\n return line;\n }" ]
[ "0.6938589", "0.6938589", "0.6938589", "0.6938589", "0.6938589", "0.6933891", "0.6909618", "0.6823741", "0.6751427", "0.6751427", "0.6687149", "0.66588855", "0.6650898", "0.66465145", "0.6600003", "0.65716404", "0.6552641", "0.647582", "0.63751143", "0.63714963", "0.63619417", "0.63619417", "0.6355405", "0.6345796", "0.63453895", "0.63449645", "0.63447726", "0.6344072", "0.6339093", "0.6317361", "0.63165194", "0.6313476", "0.63131493", "0.6303675", "0.6303324", "0.63030076", "0.630198", "0.62998617", "0.6285898", "0.62755215", "0.6263322", "0.6262643", "0.6255777", "0.62464225", "0.6234627", "0.6231831", "0.6219807", "0.6214017", "0.6213153", "0.62122947", "0.6207963", "0.6201922", "0.61995703", "0.6199447", "0.6188673", "0.61755073", "0.6174229", "0.6168723", "0.61685354", "0.61668664", "0.6155573", "0.6150822", "0.61287445", "0.6127742", "0.61268497", "0.61251336", "0.61179453", "0.61106086", "0.6101091", "0.6100447", "0.60973233", "0.6094467", "0.6092449", "0.60899794", "0.60800725", "0.6071208", "0.6069683", "0.6069674", "0.60661244", "0.6063953", "0.6061827", "0.6044924", "0.6040901", "0.60389787", "0.6037792", "0.6035809", "0.603523", "0.60346806", "0.60346806", "0.6027846", "0.6027838", "0.6023749", "0.6015692", "0.6012465", "0.60103536", "0.6005535", "0.6004128", "0.5998761", "0.5992315", "0.59895706" ]
0.6413608
18
Cierra el textarea presente en el lienzo
function closeText() { if (state == STATE_TEXT_EDITING) { currentTextEditor.destroy(); currentTextEditor = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTextarea()\n {\n var element = $('<textarea/>',{\n 'style': 'display:none;',\n 'name': settings.name\n });\n component.append(element);\n textarea = component.find('textarea');\n }", "function fillTextarea(){\n\n Storage.get('text', function(items){\n if(items.text && !chrome.runtime.lastError){\n var val = items.text.trim();\n\n if(val !== ''){\n //this makes the textarea focus on the first line\n textarea.value = '\\n'+val;\n }\n\n setHeight();\n }\n\n if(chrome.runtime.lastError){\n message('Text coudn\\'t be rendered by chrome. Try again and reload the extension.');\n _gaq.push(['_trackEvent', 'Errors', 'fillTextarea get failed']);\n }\n });\n\n }", "function changeToTextarea() {\n var divHTML = jQuery(this).html(),\n $editableText = jQuery(\"<textarea style='width: 100%; height: 300px'/>\");\n $editableText.html(divHTML);\n jQuery(this).replaceWith($editableText);\n $editableText.focus();\n $editableText.blur(revertDiv);\n }", "function setTextarea(e) {\n e.preventDefault();\n var textarea = document.querySelector('.arrow_box textarea');\n var fullText = textarea.value;\n var code = formatSend(fullText);\n textarea.value = code;\n }", "function modalTextarea(buffer, type, title, text, cont) {\n var dlg = buffer.createDialog({\n title : title,\n quitBtn : \"destroy\",\n modal : true\n });\n var layout = new DlLayout({ parent: dlg, outerSpace: 5 });\n var entry = new DlEntry({ type: \"textarea\", fillParent: true, value: text });\n dlg._focusedWidget = entry;\n if (type == \"copy\") {\n entry.addEventListener(\"onCopy\", function(ev){\n dlg.destroy();\n cont();\n }.clearingTimeout(0));\n } else if (type == \"paste\") {\n entry.addEventListener(\"onPaste\", function(ev){\n // var code = entry.getValue().replace(/\\t/g, \" \");\n var code = entry.getValue();\n dlg.destroy();\n cont(code);\n }.clearingTimeout(0));\n }\n layout.packWidget(entry, { pos: \"top\", fill: \"*\" });\n layout.setSize({ x: 350, y: 250 });\n dlg.show(true);\n entry.select();\n }", "function set_textarea_content() {\n for (const textarea of document.querySelectorAll(\"textarea\")) {\n textarea.innerHTML = encode_html(textarea.value);\n }\n }", "createTextareaAndSelect(text) {\n // Create a fake element to hold the contents to copy\n this.textarea = document.createElement('textarea');\n // Prevent zooming on iOS\n this.textarea.style.fontSize = '12pt';\n // Hide the element\n this.textarea.classList.add('cdk-visually-hidden');\n // Move element to the same position vertically\n const yPosition = window.pageYOffset || document.documentElement.scrollTop;\n this.textarea.style.top = `${yPosition}px`;\n this.textarea.setAttribute('readonly', '');\n this.textarea.value = text;\n document.body.appendChild(this.textarea);\n this.textarea.select();\n this.textarea.setSelectionRange(0, this.textarea.value.length);\n }", "function updateTextArea(n) {\r\n document.getElementById(n).value = document.getElementById(\"wysiwyg\" + n).contentWindow.document.body.innerHTML;\r\n}", "function setTxtArea(id) {\n let txtArea = \"#txt-\" + id;\n //se modifica è falso, allora significa che la funzione jQuery chiamante è \"salva\"\n if (modifica == false) {\n //disabilito la possibilità di poter scrivere nella textarea\n $(txtArea).prop(\"disabled\", true);\n //do una dimensione del 75% di altezza di tutta la note alla textarea\n $(txtArea).css(\"height\", \"75%\");\n } else {\n //in questo caso significa che la funzione jQuery chiamante è \"modifica\"\n //riabilito la textArea in modo tale da poter effettuare modifiche alla nota\n $(txtArea).prop(\"disabled\", false);\n /* riduco la dimensione della textarea al 40% sulla dimensione totale per fare spazio\n ai bottoni per la dimensione del font e del colore */\n $(txtArea).css(\"height\", \"40%\");\n }\n //se fontSize è = 0 allora il valore della dimensione del font non è cambiata, non devo far nulla\n if (fontSize != 0) {\n //se fontSize è diverso da 0, verifico qual è il suo valore\n let setSize = 0;\n if (fontSize == \"btns\") setSize = \"10px\";\n else if (fontSize == \"btnm\") setSize = \"18px\";\n else setSize = \"25px\";\n // dopo aver salvato il valore scelto dall'utente in setSize, procedo ad inserirlo nel css della nota corrispondente\n $(txtArea).css(\"font-size\", setSize);\n //re-inizializzo fontSize a 0 per gli inserimenti e le modifiche successive\n fontSize = 0;\n }\n //molto simile a fontSize, se bgColor è zero allora il colore di sfondo della nota resta quello assegnato di default\n if (bgColor != 0) {\n // se bgColor è diverso da 0, allora recupero l'id di col (il div contenitore di tutta la nota)\n let colId = \"#col-\" + id;\n //assegno lo stesso colore di sfondo sia al div con id col-idcorrente, sia alla sua textarea\n $(colId).css(\"background-color\", bgColor);\n $(txtArea).css(\"background-color\", bgColor);\n //re-inizializzo bgColor a 0 per gli inserimenti e le modifiche successive\n bgColor = 0;\n }\n //come valore di ritorno passo l'id alfanumerico della textarea interessata\n return txtArea;\n}", "function save() {\n this.textarea.value = this.content();\n }", "render() {\n const { mod } = this.props;\n const { valueCache } = this.state;\n return (React.createElement(\"textarea\", {\n value: valueCache !== null ? valueCache : '',\n cols: TEXTAREA_COLS,\n rows: TEXTAREA_ROWS,\n id: mod.id,\n className: 'textarea-readme',\n readonly: true\n }));\n }", "handleChangeTextArea(event) {\n this.setState({content: event.target.value});\n }", "addToTextArea(value){\n let field = document.getElementById('formControlTextarea');\n this.insertAtCursor(field, value);\n }", "function trocaTexto(elemento, novo_texto) // javascript\n{\n\n\t// obtain the object reference for the textarea>\n\tvar txtarea = document.getElementById(elemento);\n\t// console.log(\"Elemento\", txtarea);\n\t// obtain the index of the first selected character\n\tvar start = document.getSelection().anchorOffset;\n\t// console.log(\"Início\", start);\n\t// obtain the index of the last selected character\n\tvar finish = document.getSelection().focusOffset;\n\t// console.log(\"Finício\", finish);\n\t//obtain all Text\n\tvar allText = txtarea.innerHTML;\n\t// console.log(\"Todo Texto\", allText);\n\n\t//append te text;\n\tvar newText=allText.substring(0, start)+novo_texto+allText.substring(finish, allText.length);\n\t// console.log(\"Novo texto\", newText);\n\n\ttxtarea.innerHTML=newText;\n}", "function save() {\r\n this.textarea.value = this.content();\r\n }", "createTextarea(architect) {\n let root = architect.createDiv(this.getWrapperClass);\n let control = architect.createDiv(this.getControlClass); // The control element\n control.addClass(\"align-items-start\");\n\n this.createIcon(root, this.iconPosition.left, \"is-textarea\");\n // Creating the html input element\n let textarea = architect.createElement(\"textarea\", this.getTextareaClass);\n textarea.setId(this.id);\n let textareaAttrs = {\n placeholder: this.placeholder,\n value: this.value,\n disabled: this.disabled,\n validationScope: this.validationScope,\n readonly: this.readonly,\n rows: this.rows,\n cols: this.cols,\n min: this.min,\n max: this.max\n };\n textarea.value(this.value);\n textarea.setAttrs(textareaAttrs);\n textarea.setRef(\"inputField\");\n textarea.addChange(this.onChange);\n textarea.addInput(this.onInput);\n textarea.addFocus(this.onFocus);\n textarea.addBlur(this.onBlur);\n textarea.addKeyup({\n key: architect.keycode.enter,\n handler: this.onKeyup\n });\n control.addChild(textarea);\n\n let labelParent = this.classic ? architect : control;\n this.createLabel(labelParent, \"is-textarea\");\n root.addChild(control);\n this.createStateIcon(root);\n this.createIcon(root, this.iconPosition.right, \"is-textarea\");\n this.createErrorHelpers(root);\n architect.addChild(root);\n }", "function sendTextarea(text) {\n io.sockets.emit('textArea', text);\n }", "function changeTextArea( e ) {\n let noteInputColumn = document.getElementById( 'note-input-column' );\n let formButtonsColumn = document.getElementById( 'form-buttons-column' );\n if ( e.type === 'focus' ) {\n formButtonsColumn.classList.replace( 's5', 's1' );\n formButtonsColumn.classList.replace( 'm3', 'm1' );\n formButtonsColumn.classList.toggle( 'offset-m2' );\n formButtonsColumn.classList.toggle( 'offset-l3' );\n noteInputColumn.classList.replace( 's6', 's9' );\n this.style.overflowY = 'scroll';\n\n }\n else if ( e.type === 'blur' ) {\n noteInputColumn.classList.replace( 's9', 's6' );\n formButtonsColumn.classList.replace( 's1', 's5' );\n formButtonsColumn.classList.replace( 'm1', 'm3' );\n formButtonsColumn.classList.toggle( 'offset-m2' );\n formButtonsColumn.classList.toggle( 'offset-l3' );\n this.style.overflowY = 'hidden';\n }\n }", "replaceTextArea()\n {\n var oTA = document.getElementById(this.config.CKEditor.editorID);\n if (!oTA) {\n if (typeof displayJSError === \"function\") {\n displayJSError('Element [' + this.config.CKEditor.editorID + 'to be replaced by CKEditor not exists!', 'error');\n }\n return;\n }\n // get initial size of textarea to replace\n var iHeight = oTA.offsetHeight;\n var iWidth = oTA.offsetWidth;\n this.oEditor = this.editor.replace(this.config.CKEditor.editorID, this.config.CKEditor.editorOptions);\n // resize to desired size\n this.oEditor.on('instanceReady', function(event) {event.editor.resize(iWidth, iHeight);});\n }", "function appendText() {\n var currentItem = $('.select');\n if(currentItem.hasClass('resize'))\n currentItem.html(remover + '<textarea id=\"textarea' + (++textareaNum) + '\" class=\"tinyMCETextArea\"></textarea><div class=\"tinyMCETextAreaDisplay\"></div>'+inputs);\n else\n currentItem.html(shiftLeft+shiftRight+remover + '<textarea id=\"textarea' + (++textareaNum) + '\" class=\"tinyMCETextArea\"></textarea><div class=\"tinyMCETextAreaDisplay\"></div>'+inputs);\n\n if(currentItem.parents('#active').size() == 1)\n createTextAreaTinyMCE('textarea'+textareaNum);\n else\n removeTextAreaTinyMCE('textarea'+textareaNum);\n\n currentItem.removeClass('select');\n hideLateralArrows();\n}", "function createTextArea(save) {\r\n\t\tif (save) {\r\n\t\t\t$('table#overview_menu').after('<h3>Sablon mentése</h3><p>A szövegmező tartalmát másold ki, és mentsd le egy fájlba módosítás nélkül.</p><textarea id=\"script_output\" cols=\"40\" rows=\"20\"></textarea>');\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$('table#overview_menu').after('<h3>Sablon importálása</h3><p>Az alábbi szövegmezőbe másold be a betöltendő sablont.</p><textarea id=\"script_input\" cols=\"40\" rows=\"20\"></textarea><br><button id=\"script_import\">Sablon betöltése</button>');\r\n\t\t}\r\n\t}", "function updateTextarea()\n {\n var JSONstring = JSON.stringify(parseTokens());\n textarea.val(JSONstring);\n }", "@action handleTextareaBlur() {\n let that = this;\n let textComponent = document.getElementById(that.textareaId);\n let selection = '';\n let startPos = '';\n let endPos = '';\n let lastchar = '\\n';\n\n startPos = textComponent.selectionStart;\n endPos = textComponent.selectionEnd;\n selection = textComponent.value.substring(startPos, endPos);\n\n if (startPos) {\n lastchar = textComponent.value.substring(startPos - 1, startPos);\n }\n\n that.startPos = startPos;\n that.endPos = endPos;\n that.selection = selection;\n that.lastchar = lastchar;\n }", "function copiarTextoConSaltoDeLinea(objeto) {\n //En caso de que uses un elemento que de por sí tiene saltos de línea como un parrafo o un textarea descomenta lo siguiente\n $(objeto).text(($(objeto).text().replace(\"<br>\", \"\\n\")));\n $(objeto).text(($(objeto).text().replace(\"/<br>\", \"\\n\")));\n $(objeto).val(($(objeto).val().replace(\"<br>\", \"\\n\")));\n $(objeto).val(($(objeto).val().replace(\"/<br>\", \"\\n\")));\n \n //Aquí establecemos qué datos usaremos, este esta pensado para un onclick cambia el this por '#id-del-objeto' para hacerlo dinámico\n let id = $(objeto).attr('id');\n let texto = $(objeto).text();\n let name = $(objeto).attr('name');\n let value = $(objeto).val();\n \n //Se establece lo que se va a copiar\n let valorCopiado = 'Id: '+id+'\\nNombre: '+name+'\\nValor: '+value;\n \n //Se establece lo que se va a copiar\n element = $('<textarea>').appendTo('body').val(valorCopiado).select();\n document.execCommand('copy');\n element.remove();\n}", "function load() {\n this.setContent(this.textarea.value);\n }", "renderForm() {\n\t\treturn (\n\t\t\t<div className=\"note\" \n \t style={this.style}>\n \t<textarea ref=\"newText\" defaultValue={this.props.children}></textarea>\n \t<button onClick={this.handleSave}>SAVE</button>\n </div>\n\t\t);\t\n\t}", "function textEditor(container, options) {\n $('<textarea class=\"library_textarea\" data-bind=\"value: ' + options.field + '\"></textarea>').appendTo(container);\n }", "function textarea(){\r\n if (current_txt){\r\n $('#write').val(current_txt)\r\n }\r\n // Save text when minimizing\r\n $('#power-btn, .const-btn').one('mousedown', function(){\r\n current_txt = $('#write').val()\r\n })\r\n}", "function Textarea(parent_id, item = {}) {\n item.type = \"textarea\";\n item.id = item.id || \"{0}_{1}\".format(item.type, __TEXTAREA++);\n InputTextField.call(this, parent_id, item);\n\n this.name = item.name || this.id;\n this.placeholder = item.placeholder || \"Text lines\";\n if (!this.needQuestion && this.star != \"\")\n this.placeholder += this.star;\n this.cols = item.cols || \"30\";\n this.rows = item.rows || \"10\";\n this.wrap = (item.wrap) ? 'wrap=\"' + item.wrap + '\" ' : \"\";\n\n this.html = this._generate();\n this.render();\n }", "function textToEditor() {\n\t\t$(editor.text_panel)\n\t\t\t.html(\"\")\n\t\t\t.append(window.TheEditor.highlighter(text_area.value));\n\t\t$(editor.text_panel)\n\t\t\t.css('minWidth', (editor.outer.clientWidth - 44) + 'px')\n\t\t\t.css('minHeight', (editor.outer.clientHeight - 4) + 'px');\n\t\t$(editor.back_panel)\n\t\t\t.css('minWidth', (editor.outer.clientWidth - 44) + 'px');\n\t}", "function typeInTextarea(newText) {\n var el = document.querySelector(\"#msgEdit\");\n var start = el.selectionStart\n var end = el.selectionEnd\n var text = el.value\n var before = text.substring(0, start)\n var after = text.substring(end, text.length)\n el.value = (before + newText + after)\n el.selectionStart = el.selectionEnd = start + newText.length\n el.focus()\n }", "renderEntry() {\n return (\n <textarea id=\"capture\" name=\"capture\" rows=\"25\" cols=\"100\" onInput={(event) => this.handleCapture(event.target.value)}></textarea>\n );\n }", "function saveTextarea(){\n Storage.set({\n 'text': textarea.value\n }, function(items){\n if(chrome.runtime.lastError){\n message('Text coudn\\'t be saved by chrome.');\n _gaq.push(['_trackEvent', 'Errors', 'saveTextarea set failed']);\n }\n });\n //check amount of data\n\n }", "render() {\n return (\n <div className=\"compose-body\">\n <textarea\n className=\"comment-textarea\"\n placeholder=\"write your comment here\"\n value= {this.state.text}\n onChange= { (e) => this.updateText(e.target.value) }\n ></textarea> \n \n\n <button className=\"comment-button\" onClick={this.createPost}>Comment</button>\n </div>\n )\n }", "function Textarea(props) {\n const { label, name, rte, value, ...rest } = props;\n return (\n <FormInput className=\"form-control\">\n <label htmlFor={name}>{label}</label>\n {rte ? (\n <Field\n as=\"textarea\"\n id={name}\n name={name}\n value={value}\n component={EditorField}\n // component={RichTextEditor}\n {...rest}\n />\n ) : (\n <Field as=\"textarea\" id={name} name={name} value={value} {...rest} />\n )}\n\n <ErrorMessage component={TextError} name={name} />\n </FormInput>\n );\n}", "function eventoLimiteTextarea() {\n\n\t\tif( $(textarea).length === 0 )\n\t\t\treturn false;\n\n\t\t$(contador).text(limite);\n\n\t\tverificaLimite( textarea, limite, contador );\n\n\t\t$(textarea).on('input propertychange', function() {\n\t\t\tverificaLimite( textarea, limite, contador );\n\t\t});\n\n\t}", "function agregarTextArea(){\n contProcesos += 1;\n let idEntrada= document.getElementById(\"procesos\");\n let job = document.createElement(\"text\");\n job.innerHTML = `<div class=\"${ contProcesos % 2 ? \"jobc\" : \"jobc\" }\">\n <p>Proceso ${contProcesos}</p>\n <textarea class=\"midpro\"></textarea>\n </div>`;\n idEntrada.appendChild( job ); /*es una referencia a un nodo existente en el documento.*/\n}", "function tarea() {\n var boxTextoValue = getInputValue();\n if (boxTextoValue !== \"\") {\n doTarea(boxTextoValue);\n clean();\n }\n}", "function save() {\n editors.forEach(function (editor, index) {\n textareas[index].value = editor.querySelector('.text').innerHTML;\n });\n }", "function selectToTextArea(id, idFrase) {\n var frase = document.getElementById(idFrase).value;\n if (frase != 'NULL') {\n putTextarea(id, frase);\n }\n}", "render() {\n return(\n <div className='container' style={{ marginTop: '50px' }}>\n <div className='col-lg-8 col-lg-offset-2 form-group'>\n <textarea\n value={this.state.text}\n onChange={this.updateText.bind(this)}\n className='form-control'\n style={{ height: '500px', resize: 'none' }}>\n </textarea>\n </div>\n <ReadingTime text={this.state.text} className='col-lg-2 well' />\n </div>\n )\n }", "function createDescription(component, change) {\n let rows = component.data.text.split(\"\\n\").length;\n rows = rows >= 5 ? rows : 5;\n return <FormControl\n type=\"textarea\"\n placeholder=\"Beschreibung...\"\n value={component.data.text}\n onChange={onChange}\n rows={rows}\n className=\"textarea description\"\n />;\n function onChange(oEvent) {\n component.data.text = oEvent.target.value;\n change(component)\n }\n}", "function fixTextarea(){\n\t$('textarea.long-field').each(function(){\n\t\telement = this;\n\t\telement.style.height = \"5px\";\n\t\telement.style.height = (element.scrollHeight)+\"px\";\n\t});\n}", "function readTextArea(elm){\r\n\tvar sentence = elm.value.split(\" \");\r\n\tvar XPos = 0;\r\n\tfor(var i = 0; i < sentence.length; i++){\r\n\t\tvar YPos = 0;\r\n\t\t\r\n\t\tcurNode = addNodeToCy(sentence[i], 0, YPos);\r\n\t\t\r\n\t\tXPos = XPos + curNode.width()/2;\r\n\t\tcurNode.position(\"x\", XPos);\r\n\t\t// calculate next node position using the current node for next node position to get even spacing on center\r\n\t\tXPos = XPos + X_NODE_SPACING + curNode.width()/2;\r\n\t\tif($(\"#snapControl\").prop(\"checked\")){\r\n\t\t\tcurNode.emit(\"free\");\r\n\t\t}\t\r\n\t}\r\n\t\r\n\r\n\t\r\n\tcy.center();\r\n}", "checkEditingMode(){\n let textArea = document.querySelector(\"textarea.rm-block-input\");\n if (!textArea || textArea.getAttribute(\"zotero-tribute\") != null) return;\n\n document.querySelectorAll('.zotero-roam-tribute').forEach(d=>d.remove());\n\n textArea.setAttribute(\"zotero-tribute\", \"active\");\n\n var tribute = new Tribute(zoteroRoam.config.tribute);\n tribute.attach(textArea);\n\n textArea.addEventListener('tribute-replaced', (e) => {\n let item = e.detail.item;\n if(item.original.source == \"zotero\"){\n let textArea = document.querySelector('textarea.rm-block-input');\n let trigger = e.detail.context.mentionTriggerChar + e.detail.context.mentionText;\n let triggerPos = e.detail.context.mentionPosition;\n\n let replacement = e.detail.item.original.value;\n let blockContents = e.target.defaultValue;\n\n let escapedTrigger = zoteroRoam.utils.escapeRegExp(trigger);\n let triggerRegex = new RegExp(escapedTrigger, 'g');\n let newText = blockContents.replaceAll(triggerRegex, (match, pos) => (pos == triggerPos) ? replacement : match );\n\n // Store info about the replacement, to help debug\n zoteroRoam.interface.tributeTrigger = trigger;\n zoteroRoam.interface.tributeBlockTrigger = textArea;\n zoteroRoam.interface.tributeNewText = newText;\n\n var setValue = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set;\n setValue.call(textArea, newText);\n\n var ev = new Event('input', { bubbles: true });\n textArea.dispatchEvent(ev); \n }\n });\n\n }", "function load() {\r\n this.setContent(this.textarea.value);\r\n }", "get editorDomElement() {\n return this._$textarea;\n }", "function CanopTextarea(client, editor) {\n this.canopClient = client;\n this.editor = editor;\n\n this.editorChange = this.editorChange.bind(this);\n this.remoteChange = this.remoteChange.bind(this);\n\n this.canopClient.on('change', this.remoteChange);\n this.editor.addEventListener('input', this.editorChange);\n}", "function newTextbox(){ \n idOfQuestion++;\n questionDetails.push(0);\n\n // <label class=\"questionLabel\" for=\"questiofn`+idOfQuestion +`\" contenteditable=\"true\">Example textarea</label>\n document.getElementById(\"forma\").innerHTML += `\n <div xd=\"Text\" id=\"EntireQuestionNo`+idOfQuestion+`\">\n\n <button type=\"button\" class=\"btn btn-danger deleteButton\" onclick=\"deleteQuestion(`+idOfQuestion+`)\">USUŃ TO PYTANIE</button> \n <label class=\"questionLabel \" id=\"questionLabel`+idOfQuestion +`\" contenteditable=\"true\">Example textarea</label>\n\n <div id=\"divOfQuestion`+idOfQuestion+`\" class=\"form-group col-md-8\"> \n \n \n <br>\n <textarea class=\"form-control\" id=\"question`+idOfQuestion +`\" rows=\"1\"></textarea>\n </div><br>\n\n </div>\n `;\n}", "render() {\n return (\n <div className=\"card-editor\">\n <textarea \n className=\"title-input\" \n value={this.state.title} \n onChange={e => this.setState({ title: e.target.value })}\n />\n <textarea \n className=\"content-input\" \n value={this.state.body} \n onChange={e => this.setState({ body: e.target.value })}\n />\n </div>\n )\n }", "writeTextInEditor(textVal) {\n cy\n .getIframeBody('.cke_wysiwyg_frame.cke_reset')\n .find('p').type(textVal)\n\n }", "function iisadvanceeditor_textarea_attach(elem){\n\tvar element=$(elem);\n\tif (elem.htmlarea==undefined) {\n\t\telem.htmlarea = function(){ element.htmlarea( {'size':300} );};\n\t\telem.htmlarea();\n\t}\n}", "processChannelTextAreaForm (e) {\n\t\tif (!BDFDB.ModuleUtils.isPatched(this, e.instance, \"handleSendMessage\")) BDFDB.ModuleUtils.patch(this, e.instance, \"handleSendMessage\", {before: e2 => {\n\t\t\tlet channel = BDFDB.LibraryModules.ChannelStore.getChannel(BDFDB.LibraryModules.LastChannelStore.getChannelId());\n\t\t\tif (channel && channel.type == BDFDB.DiscordConstants.ChannelTypes.DM) {\n\t\t\t\tlet settings = BDFDB.DataUtils.get(this, \"settings\");\n\t\t\t\tlet inputs = BDFDB.DataUtils.get(this, \"inputs\");\n\t\t\t\te2.methodArguments[0] = this.formatPrefix(inputs.messagePrefix, channel) + (settings.captializeWords ? this.capitalize(e2.methodArguments[0]) : e2.methodArguments[0]);\n\t\t\t}\n\t\t}}, true);\n\t}", "function TextAreaWidget(initVal,rows,cols) {\n\tInputWidget.apply(this,[TEXTAREA({rows:rows,cols:cols},initVal)]);\n}", "function createNoteTextarea(editNode, file)\n{\n editNode.append('<span class=\"displaySubheader\">Notes:</span><br />');\n notesBox = $('<textarea rows=\"6\" class=\"notesBox\"></textarea>');\n noteText = file.find(\".noteContainer > .displayText\").html();\n if (typeof noteText !== \"undefined\")\n {\n noteText = noteText.replace(/<br( \\/)?>/g, \"\\n\");\n notesBox.val(noteText);\n }\n editNode.append(notesBox);\n}", "function Edit(index)\n{\n let notecard=document.getElementsByClassName(\"notecard\");\n let edit=notecard[index].getElementsByTagName(\"p\")[0];\n let text=edit.innerText;\n // console.log(text);\n edit.innerHTML=`<textarea id=\"text_area\" name=\"w3review\" rows=\"4\" cols=\"50\">\n ${text}\n </textarea>`;\n let p=edit.querySelector(\"#text_area\");\n p.addEventListener(\"blur\",function(){\n edit.innerText=p.value;\n let notes=localStorage.getItem(\"notes\");\n if(notes==null)\n noteobj=[];\n else\n noteobj=JSON.parse(notes);\n\n noteobj[index]=p.value;\n localStorage.setItem(\"notes\",JSON.stringify(noteobj));\n })\n \n \n}", "function Textarea(element, completer, option) {\n this.initialize(element, completer, option);\n }", "function TextEditor() {}", "function makeRichEditor(textarea) {\n\tif (!textarea || !textarea.type || textarea.type != 'textarea' || textarea.richEditor != null) {\n\t\ttry {\n\t\t\treturn textarea.richEditor;\n\t\t} catch (e) {\n\t\t\treturn null;\n\t\t}\n\t}\n\tvar id = elementId(textarea);\n\tvar editor = new FCKeditor(id);\n\teditor.BasePath = context + \"/pages/scripts/\";\n\teditor.ToolbarSet = 'Cyclos';\n\teditor.Config['DefaultLanguage'] = fckLanguage;\n\teditor.ReplaceTextarea();\n\tif (is.ie) {\n\t\t// Avoid memory leak in IE\n\t\tEvent.observe(self, \"unload\", function() {\n\t\t\ttextarea.fckEditor = null;\n\t\t});\n\t}\n\ttextarea.richEditor = editor;\n\ttextarea.supportedRichEditor = !isEmpty($(elementId(textarea) + \"___Frame\"));\n\t// Ensure that browsers without support will submit line breaks as <br>\n\tif (!textarea.supportedRichEditor) {\n\t\ttextarea.innerHTML = replaceAll(textarea.value, \"<br>\", \"\\n\").stripTags();\n\t}\n\tvar form = textarea.form;\n\tEvent.observe(form, \"submit\", function () {\n\t\tif (form.willSubmit && !textarea.supportedRichEditor) {\n\t\t\ttextarea.value = replaceAll(textarea.value, \"\\n\", \"<br>\");\n\t\t}\n\t});\n\treturn editor;\n}", "function save() {\n $editors.find('.text').each(function () {\n $(this).closest('.fields').find('textarea').val(this.innerHTML);\n });\n }", "function persistToTextArea() {\n //create column headers row\n \n var jsonData = [];\n for(var i = 0; i < saveHistory.length; i++) {\n jsonData.push(JSON.parse(saveHistory.options[i].text));\n }\n persistTextarea.value = JSON.stringify(jsonData);\n}", "function updateTextArea(editor, checkForChange) {\n\n var html = $(editor.doc.body).html(),\n options = editor.options,\n updateTextAreaCallback = options.updateTextArea,\n $area = editor.$area;\n\n // Check for iframe change to avoid unnecessary firing\n // of potentially heavy updateTextArea callbacks.\n if (updateTextAreaCallback) {\n var sum = checksum(html);\n if (checkForChange && editor.frameChecksum === sum)\n return;\n editor.frameChecksum = sum;\n }\n\n // Convert the iframe html into textarea source code\n var code = updateTextAreaCallback ? updateTextAreaCallback(html) : html;\n\n\t\t// insert enter code for readable\n\t\tcode.replace(\"&#10;<br>&#10;\",\"<br>\").replace(\"&#10;<br />&#10;\",\"<br>\")\n\t\t\t.replace(\"<br>\",\"&#10;<br>&#10;\").replace(\"<br>\",\"&#10;<br />&#10;\");\n\t\t\n // Update the textarea checksum\n if (options.updateFrame)\n editor.areaChecksum = checksum(code);\n\n // Update the textarea and trigger the change event\n if (code !== $area.val()) {\n $area.val(code);\n $(editor).triggerHandler(CHANGE);\n }\n\n }", "function getEditTextAreaHtml(paramId, value, width, maxLength) {\n if (!value) {\n value = '';\n }\n value = b.encodeHTML(value);\n return \"<textarea id='\" + ELEMENT_ID.EDIT_INPUT + \"' class='edit-input form-control' type='text' style='width: \" + \n \t\twidth +\"px' maxlength='\" + maxLength + \"' onblur='param.finishEdit();'\" + \"oldValue='\" + value + \"' paramId='\" + paramId + \"'>\" + value + \"</textarea>\";\n }", "constructor() {\n super(...arguments);\n /* Generate textarea ID for the instance. */\n let textComponents = document.getElementsByClassName('markdown-editor');\n let newId = textComponents.length + 1;\n this.textareaId = 'markdowneditor' + newId;\n\n this.previousValue = '';\n this.undoHistory = A();\n this.modal = false;\n this.result = '';\n this.dialog = '';\n this.regex = '';\n this.enter = '';\n this.promptText = '';\n this.tooltip = '';\n this.lastchar = '';\n this.selection = '';\n this.endPos = '';\n this.startPos = '';\n }", "function l(p) {\n window.open(p+document.URL.replace(/(%3Ctextarea.*%3E)([^]*)(%3C%2Ftextarea%3E)/, function(z, a, b, c) {\n t.textContent = t.value; // Do this so we can access an escaped version of the content\n // Replace the old textarea content with what the user has supplied\n return a + encodeURIComponent(t.innerHTML) + c;\n // Open in a new tab\n }),'_blank');\n}", "focus() {\n this.refs.textarea.focus();\n }", "function addTextarea() {\n var thhis = document.getElementById('dynamic');\n if (!thhis.hasChildNodes()) {\n var div = document.getElementById('dynamic');\n var addTA = document.createElement('input');\n addTA.placeholder = 'Order Number';\n div.appendChild(addTA);\n }\n}", "_setEditorContentOnFormSubmit() {\n document.querySelector('#submit').addEventListener('click', () => {\n let ckeditorContent = this.editor.getData();\n $(\"textarea#entry_content\").val(ckeditorContent);\n\n return true;\n });\n }", "function allowBriefingAndRemarksChange() {\n\n\n // cacher les p\n$('.briefingOuRemarqueP').addClass('textzoneHidden')\n // Montrer les textarea\n$('.briefingOuRemarqueTextarea').removeClass('textzoneHidden')\n// donner la meme hauteur que le div à la textarea\nlet heightOfBriefingP = $('.briefingP').height()\n\nif (heightOfBriefingP > 100) { // empêche la textarea de valoir 0 de haut lorsque le p est vide\n $('.briefingTextarea').css(\"height\", heightOfBriefingP+\"px\")\n}\n\nlet heightOfRemarqueP = $('.remarqueP').height()\nif (heightOfRemarqueP > 100) {\n $('.remarqueTextarea').css(\"height\", heightOfRemarqueP+\"px\")\n}\n\n // Insérer le texte de p dans textarea\n$('.briefingTextarea').html($('.briefingP').html().replace(/<br\\s*[\\/]?>/gi, \"\\n\")); // remplacement des <br> par des <\\n>, le remplacement inverse s'effectue aussi\n$('.remarqueTextarea').html($('.remarqueP').html().replace(/<br\\s*[\\/]?>/gi, \"\\n\"));\n // cacher bouton +\n $('.modifyButton').addClass('changeStateButtonHidden')\n // montrer bouton OK\n $('.commitButton').removeClass('changeStateButtonHidden')\n}", "function updateTextAreas() {\n MAPP.editors.htmlmixed.save();\n MAPP.editors.javascript.save();\n MAPP.editors.css.save();\n}", "function TextArea(props) {\n\t var rest = (0, _lib.getUnhandledProps)(TextArea, props);\n\t var ElementType = (0, _lib.getElementType)(TextArea, props);\n\n\t return _react2.default.createElement(ElementType, rest);\n\t}", "function readViewText() {\n var html = element.html();\n\n // When we clear the content editable the browser leaves a <br> behind\n // If strip-br attribute is provided then we strip this out\n if (attrs.stripBr && html == '<br>') {\n html = '';\n }\n ngModel.$setViewValue(html); //ngModel == linea.cantidad OR linea.descripcion\n //scope.lnUpdate = 'UPDATED';\n console.log(ngModel);\n }", "function mkEditor(str, f){\n var wrap = document.createElement(\"div\");\n var iwrap = document.createElement(\"div\");\n var text = document.createElement(\"textarea\");\n wrap.style.width = \"100%\";\n wrap.style.height = \"100%\";\n wrap.style.backgroundColor = \"rgba(0, 0, 0, 0.7)\";\n wrap.style.position = \"fixed\";\n wrap.style.top = \"0\";\n wrap.style.zIndex = \"3939\";\n iwrap.style.width = \"640px\";\n iwrap.style.top = \"0\";\n iwrap.style.margin = \"10% auto auto auto\";\n text.style.maxWidth = \"640px\";\n text.style.maxHeight = \"480px\";\n text.style.width = \"640px\";\n text.style.height = \"480px\";\n text.style.display = \"block\";\n text.align = \"center\";\n text.value = str;\n\n wrap.addEventListener(\"click\", f);\n text.addEventListener(\"click\", function(e){\n if (e && e.stopPropagation) e.stopPropagation();\n else e.cancelBubble = true;\n return false;\n });\n\n iwrap.appendChild(text);\n wrap.appendChild(iwrap);\n document.getElementsByTagName(\"body\")[0].appendChild(wrap);\n text.focus();\n text.select();\n}", "function selectTextarea() {\n\t$('.exporter').on('click focus','#exportcode',function() {\n\t\tthis.focus();\n\t\tthis.select();\n\t});\n}", "function Instructions(props){\n return(\n <div className=\"form-group\">\n <div className=\"label\">\n <textarea className=\"form-control\" onChange={props.setInstructions} value={props.instructions}> </textarea>\n </div>\n <button className=\"btn btn-primary float-right text-edit-buttons\" onClick={props.save}><i class=\"fas fa-save\"></i> Save </button>\n </div>\n )\n}", "function _fix_textarea_height( el ) {\n\textraLineHeight = 15;\n\tscrollHeight = el[0].scrollHeight;\n\tclientHeight = el[0].clientHeight;\n\tif ( clientHeight < scrollHeight ) {\n\t\tel.css({\n\t\t\theight: (scrollHeight + extraLineHeight)\n\t\t});\n\t}\n}", "function getText(event) {\n event.preventDefault();\n // Get user textarea input:\n var text = document.getElementById(\"textArea\").value;\n // remove all punctuation\n text = text.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()@\\+\\?><\\[\\]\\+]/gm, \"\");\n\n // Get user line input:\n let lineInput = document.querySelector('input[name=\"lines\"]:checked').value;\n\n var lines = Number(lineInput);\n\n // Get user word input\n var words = Number(document.getElementById(\"wordInput\").value);\n\n //get user vowel input\n var vowels = Number(document.getElementById(\"vowelInput\").value);\n\n //Determine if textarea input has line breaks:\n let test = checkLineBreaks(text); // call check line breaks function\n if (test === true) {\n textArr = splitText(text);\n } else {\n // add line breaks based on whitespace\n textArr = stringLines(text); // call function to format text lines\n }\n\n // identify the which lines will be parsed.\n activeLines(textArr, lines, words, vowels);\n}", "function stylizeEditor(ui, txt, view, mode){\n if(ui){\n var cmConfig = ui.pluginAvailable(\"codemirror\");\n if(!(cmConfig)) return;\n var cm = new Codemirror(txt, mode, cmConfig);\n }\n else{\n var cm = new Codemirror(txt, mode, {});\n }\n\tvar ar = cm.colorizeTextArea(view);\n\tcm.updateTextArea(ar);\n}", "function aef_editor() {\n this.wysiwyg_id = 'aefwysiwyg';\n this.textarea_id = 'post';\n this.text = '';\n this.on = false;\n this.flashw = 200;\n this.flashh = 200;\n this.toggle = function () {\n if (this.on) {\n this.to_normal()\n } else {\n this.to_wysiwyg()\n }\n };\n\n this.onsubmit = function () {\n if (this.on) {\n return this.to_normal(false)\n }\n };\n\n this.to_wysiwyg = function (dontalert) {\n var pos = findelpos($(this.textarea_id));\n if (!document.getElementById || !document.designMode) {\n if (dontalert != true) {\n alert('Your Browser does not support WYSIWYG.')\n }\n return false\n }\n $(this.wysiwyg_id).style.left = pos[0] + 'px';\n $(this.wysiwyg_id).style.top = pos[1] + 'px';\n hideel(this.textarea_id);\n showel(this.wysiwyg_id);\n this.wysiwyg = $(this.wysiwyg_id).contentWindow.document;\n this.wysiwyg.open();\n this.wysiwyg.write('<html><head><style>p{margin: 1px; padding: 0px;} img{border: 0px solid #000000;vertical-align: middle;}</style></head><body style=\"font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;\"></body></html>');\n this.wysiwyg.close();\n if (this.wysiwyg.body.contentEditable) {\n this.wysiwyg.body.contentEditable = true\n } else {\n this.wysiwyg.designMode = 'On'\n }\n this.wysiwyg.body.innerHTML = bbc_html($(this.textarea_id).value);\n this.on = true;\n return true\n };\n\n this.to_normal = function (tryfocus) {\n hideel(this.wysiwyg_id);\n showel(this.textarea_id);\n $(this.textarea_id).value = html_bbc(this.wysiwyg.body.innerHTML);\n this.wysiwyg.body.innerHTML = '';\n this.on = false;\n if (tryfocus != false) {\n $(this.textarea_id).focus()\n }\n return true\n };\n\n this.format = function (tag) {\n if (tag == '[b]') {\n this.exec('Bold', false, null)\n } else if (tag == '[i]') {\n this.exec('Italic', false, null)\n } else if (tag == '[u]') {\n this.exec('Underline', false, null)\n } else if (tag == '[s]') {\n this.exec('Strikethrough', false, null)\n } else if (tag == '[left]') {\n this.exec('Justifyleft', false, null)\n } else if (tag == '[center]') {\n this.exec('Justifycenter', false, null)\n } else if (tag == '[right]') {\n this.exec('Justifyright', false, null)\n } else if (/\\[size=(\\d){1}\\]/.test(tag)) {\n this.exec('FontSize', false, RegExp.$1)\n } else if (/\\[font=(.+)\\]/.test(tag)) {\n this.exec('FontName', false, RegExp.$1)\n } else if (/\\[color=(\\#.{6})\\]/.test(tag)) {\n this.exec('ForeColor', false, RegExp.$1)\n } else if (tag == '[img]') {\n var img = prompt(\"Please enter the URL of the image\", \"http://\");\n if (img) {\n this.exec('InsertImage', false, img)\n }\n } else if (/\\[flash=([0-9]+),([0-9]+)\\]/.test(tag)) {\n this.wrap(tag, '[/flash]')\n } else if (tag == '[ol]\\n[li][/li]\\n') {\n this.exec('InsertOrderedList', false, null)\n } else if (tag == '[ul]\\n[li][/li]\\n') {\n this.exec('InsertUnorderedList', false, null)\n } else if (tag == '[li]') {\n } else if (tag == '[sup]') {\n this.exec('Superscript', false, null)\n } else if (tag == '[sub]') {\n this.exec('Subscript', false, null)\n } else if (tag == '[hr]') {\n this.exec('InsertHorizontalRule', false, null)\n } else if (tag == '[quote]') {\n this.wrap('[quote]', '[/quote]')\n } else if (tag == '[code]') {\n this.wrap('[code]', '[/code]')\n } else if (tag == '[php]') {\n this.wrap('[php]', '[/php]')\n }\n };\n\n this.insertemot = function (emotcode, url) {\n $(this.wysiwyg_id).contentWindow.focus();\n this.wrap('&nbsp;<img src=\"' + url + '\">&nbsp;', '', true)\n };\n\n this.exec = function (command, ui, value) {\n $(this.wysiwyg_id).contentWindow.focus();\n this.wysiwyg.execCommand(command, ui, value)\n };\n\n this.wrap = function (starttag, endtag, replace) {\n var doc = $(this.wysiwyg_id).contentWindow;\n doc.focus();\n if (window.ActiveXObject) {\n var txt = starttag + ((replace == true) ? '' : this.wysiwyg.selection.createRange().text) + endtag;\n this.wysiwyg.selection.createRange().pasteHTML(txt)\n } else {\n var txt = starttag + ((replace == true) ? '' : $(this.wysiwyg_id).contentWindow.getSelection()) + endtag;\n this.exec('insertHTML', false, txt)\n }\n };\n\n this.insertlink = function (url) {\n var txt;\n if (!url) {\n return\n }\n if (window.ActiveXObject) {\n txt = this.wysiwyg.selection.createRange().text\n } else {\n txt = $(this.wysiwyg_id).contentWindow.getSelection()\n }\n if (txt.toString().length != 0) {\n try {\n this.exec('Unlink', false, null);\n this.exec('CreateLink', false, url)\n } catch (e) {\n }\n } else {\n this.wrap('<a href=\"' + url + '\">' + url, '</a>')\n }\n };\n\n this.wrap_bbc = function (starttag, endtag) {\n if (this.on) {\n this.format(starttag);\n return\n }\n var field = $(this.textarea_id);\n if (typeof(field.caretPos) != \"undefined\" && field.createTextRange) {\n field.focus();\n var sel = field.caretPos;\n var tmp_len = sel.text.length;\n sel.text = sel.text.charAt(sel.text.length - 1) == ' ' ? starttag + sel.text + endtag + ' ' : starttag + sel.text + endtag;\n if (tmp_len == 0) {\n sel.moveStart(\"character\", -endtag.length);\n sel.moveEnd(\"character\", -endtag.length);\n sel.select()\n } else {\n field.focus(sel)\n }\n } else if (field.selectionStart || field.selectionStart == '0') {\n var startPos = field.selectionStart;\n var endPos = field.selectionEnd;\n field.value = field.value.substring(0, startPos) + starttag + field.value.substring(startPos, endPos) + endtag + field.value.substring(endPos, field.value.length)\n } else {\n field.value += starttag + endtag;\n field.focus(field.value.length - 1)\n }\n };\n\n this.insertemot_code = function (emotcode, url) {\n if (this.on) {\n this.insertemot(emotcode, url);\n return\n }\n emotcode = ' ' + emotcode + ' ';\n var field = $(this.textarea_id);\n if (typeof(field.caretPos) != \"undefined\" && field.createTextRange) {\n var sel = field.caretPos;\n var tmp_len = sel.text.length;\n sel.text = sel.text.charAt(sel.text.length - 1) == ' ' ? emotcode + ' ' : emotcode;\n field.focus(sel)\n } else if (field.selectionStart || field.selectionStart == '0') {\n var startPos = field.selectionStart;\n var endPos = field.selectionEnd;\n field.value = field.value.substring(0, startPos) + emotcode + field.value.substring(endPos, field.value.length)\n } else {\n field.value += emotcode\n }\n }\n}", "function create_text_area(text) {\n var paragraph = document.createElement(\"p\");\n paragraph.classList.add(\"text\");\n paragraph.innerHTML = text;\n $('.project_content').prepend(paragraph);\n $('.close_cross').click(function() {\n paragraph.remove();\n });\n\n $('.close_text').click(function() {\n paragraph.remove();\n });\n}", "function initTextareaType() {\n var group = $('.scenario_block_origin .textarea_box').clone();\n group.insertBefore($('.message_bot_area .fixedsidebar-content .text_button_next'));\n // $('.message_bot_area .fixedsidebar-content').append(group);\n}", "function processCode(content) { \n var slide = '\\n' \n slide += '\\t<textarea class=\"textareaCode\" onfocus=\"selectEdit(this.id)\" onBlur=\"deselectEdit(this.id)\">'\n for(var line of content)\n slide += line.replace('<', '&lt;').replace('>', '&gt;') +'\\n'\n slide += '\\t</textarea>'\n slide += '\\t<div class=\"iframewrapper\"></div>'\n slide += '\\t</div>'\n return slide\n }", "function textareaAutoResize (e) {\n var target = ('style' in e) ? e : this;\n target.style.height = 'auto';\n target.style.height = target.scrollHeight + 'px';\n}", "function add_textarea_cell(row, rows, cols, text, readonly, cls) {\n var node = null;\n node = document.createElement(\"textarea\");\n if (rows>0) node.setAttribute(\"rows\", rows);\n if (cols>0) node.setAttribute(\"cols\", cols);\n if (readonly) node.setAttribute(\"readonly\", true);\n //node.setAttribute(\"data-role\", \"none\");\n node.value = text;\n add_cell(row, node, cls);\n} // add_textarea_cell", "function postgen() {\r\n var Copyrights = \"©Copyright by giObanii. ©Copyright by toxigeek.com. All Rights Reserved.\";\r\n var txt = '';\r\n document.getElementById('text_editor_textarea').value = \"\"; {\r\n txt += '<div class=\"notice\"><div class=\"img-new\"><div class=\"img\">[img]';\r\n txt += document.getElementById('imagenew').value;\r\n txt += '[/img]</div><div class=\"imgleer\"><a rel=\"nofollow\" target=\"_blank\" href=\"http://{FORUMURL}/';\r\n txt += document.getElementById('urlnew').value;\r\n txt += '\">[img]http://scripts-giobanii.googlecode.com/svn/trunk/images/notice-pespcedit-image.png[/img]</a></div>\\n';\r\n txt += '</div><div class=\"des\">[b]Descripcion de la noticia:[/b]\\n\\n';\r\n txt += document.getElementById('descripcionnew').value;\r\n txt += '\\n</div></div>';\r\n document.getElementById('text_editor_textarea').value += txt\r\n }\r\n}", "function LimitTextAreaMaxLength() {\n $(function () {\n $(\"textarea\").bind('input propertychange', function () {\n if ($(this).val().length > MAXNOTELENGTH) {\n $(this).val($(this).val().substring(0, MAXNOTELENGTH));\n }\n })\n });\n}", "function textareaUpdate(wysiwyg) {\n var html = wysiwyg.control.contentWindow.document.body.innerHTML;\n for (var foo = 0; foo < wysiwyg_elementMap.length; foo++) {\n html = html.replace(wysiwyg_elementMap[foo][0], wysiwyg_elementMap[foo][1]);\n }\n\thtml = html.replace(/&amp;/g, \"&\").replace(/&gt;/g, \">\").replace(/&lt;/g, \"<\").replace(/&quot;/g, \"\\\"\");\n wysiwyg.textarea.value = html;\n }", "function openModalContent (canvasState) {\n return h('div', [\n h('form', {\n on: {\n submit: ev => {\n ev.preventDefault()\n const code = ev.currentTarget.querySelector('textarea').value\n canvasState.restoreCompressed(code)\n canvasState.openModal.close()\n }\n }\n }, [\n h('p', 'Paste the code for a polygram:'),\n saveLoadTextarea({ props: { rows: 8 } }),\n button('button', { class: { ma1: false, mt2: true } }, 'Load')\n ])\n ])\n}", "drawTextArea() {\n return (\n <TextField\n className=\"tyyli1\"\n onChange={event => {\n // this.state.fieldvalue = event.target.value;\n this.setState({ fieldvalue: event.target.value });\n }}\n >\n {' '}\n </TextField>\n );\n }", "function textareaSelect(el, start, end) {\n el.focus();\n if (el.setSelectionRange) { \n el.setSelectionRange(start, end);\n } \n else { \n if(el.createTextRange) { \n var normalizedValue = el.value.replace(/\\r\\n/g, \"\\n\");\n start -= normalizedValue.slice(0, start).split(\"\\n\").length - 1;\n end -= normalizedValue.slice(0, end).split(\"\\n\").length - 1;\n range=el.createTextRange(); \n range.collapse(true);\n range.moveEnd('character', end);\n range.moveStart('character', start); \n range.select();\n } \n }\n}", "function resizeTextarea (object) {\n\t\tvar a = object;\n\t\ta.style.height = 'auto';\n\t\ta.style.height = a.scrollHeight+'px';\n\t}", "function setMessageArea(text, type) {\n $('#message-area > div').text(text);\n}", "function appendOptsInTextArea(){\n db.opts.toArray().then(e=>{\n if(!e){return}\n document.querySelector('#export-data').value = JSON.parse(e[0].optionData);\n db.routes.toArray().then(res=>{\n if(!res){return}\n exportDataInTextarea(res);\n })\n })\n }", "function addEditBox(container, txt) {\r\n\tvar tmp_link=document.createElement('textarea');\r\n\ttmp_link.id = \"editbox\";\r\n\ttmp_link.name = \"txt\";\r\n\ttmp_link.maxLength = editMaxLength;\r\n\ttmp_link.cols = editCol;\r\n\ttmp_link.rows = editRow;\r\n\ttmp_link.value = txt;\r\n\ttmp_link.style.fontSize='11px';\r\n\ttmp_link.style.width='100%';\r\n\ttmp_link.style.height='100%';\r\n\tcontainer.appendChild (tmp_link);\r\n//\tcontainer.style.resize='none';\r\n\ttmp_link.select();\r\n\t\r\n\tif (txt.length >= editMaxLength) {\r\n\t\talert(\"Warning! you need to increase the Max length to something above \" +txt.length + \" in the settings dialog to display the entire list\");\r\n\t}\r\n}", "function textAreaSize() {\n $('textarea').each(function() {\n $(this).height($(this).prop('scrollHeight'));\n });\n}", "function enableFormTextArea() {\n is_text_area_disabled = false;\n txt_description.removeAttr('disabled');\n}", "function renderTextarea() {\n\n //For loop the schedule times and dynamically create local storage variables\n for (var i = 0; i < scheduleTimes.length; ++i) {\n this[\"txt\" + scheduleTimes[i] + \"stored\"] = localStorage.getItem(scheduleTimes[i]);\n this[\"txt\" + scheduleTimes[i]].val(this[\"txt\" + scheduleTimes[i] + \"stored\"])\n }\n\n var stickyNoteStored = localStorage.getItem(\"stickyNote\");\n stickyNote.val(stickyNoteStored);\n}", "constructor(id, isTextArea) {\n\t\tif(isTextArea === undefined) {\n\t\t\tisTextArea = false;\n\t\t}\n\n\t\t// Create input\n\t\tthis.input = document.createElement(!isTextArea ? \"input\" : \"textarea\");\n\t\tthis.input.setAttribute(\"id\", id);\n\t\tthis.input.setAttribute(\"type\", \"text\");\n\t\tthis.input.value = \"\";\n\t\t\n\t\t// Append input to parent\n\t\tvar parentNode = canvas.parentElement;\n\t\tparentNode.appendChild(this.input);\n\t\t\n\t\t// Apply initial style\n\t\tthis.style = this.input.style;\n\t\tthis.style.position = \"absolute\";\n\t\tthis.style.left = 0;\n\t\tthis.style.top = 0;\n\t\tthis.style.background = \"none\";\n\t\tthis.style.border = \"none\";\n\t\tthis.style.padding = \"0\";\n\t\tthis.style.margin = \"0\";\n\t\tthis.style.boxSizing = \"border-box\";\n\t\tif(isTextArea) {\n\t\t\tthis.style.resize = \"vertical\";\n\t\t}\n\n\t\t// Set default offset\n\t\tthis.setOffset(0, 0);\n\t\t\n\t\t// Input focus event\n\t\tthis.input.addEventListener(\"focus\", function () {\n\t\t\tthis.style.outline = \"none\";\n\t\t\tif(!renko.isNullOrUndefined(this.onFocus))\n\t\t\t\tthis.onFocus(this);\n\t\t}.bind(this));\n\n\t\t// Input change event\n\t\tthis.input.addEventListener(\"change\", function () {\n\t\t\tif(!renko.isNullOrUndefined(this.onChange))\n\t\t\t\tthis.onChange(this);\n\t\t}.bind(this));\n\n\t\t// Input input event\n\t\tthis.input.addEventListener(\"input\", function (e) {\n\t\t\tvar value = this.getValue();\n\t\t\tvar isModified = false;\n\t\t\t// Apply max limit\n\t\t\tif(typeof this.maxLength === \"number\" && this.maxLength > 0) {\n\t\t\t\tif(value.length > this.maxLength) {\n\t\t\t\t\tisModified = true;\n\t\t\t\t\tvalue = value.substring(0, this.maxLength);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Apply input character restriction\n\t\t\tif(!renko.isNullOrUndefined(this.inputRangeChecker)) {\n\t\t\t\twhile(!this.inputRangeChecker(value)) {\n\t\t\t\t\tisModified = true;\n\t\t\t\t\tvalue = value.substring(0, value.length - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If the value was modified due to some restraints, apply those changes.\n\t\t\tif(isModified) {\n\t\t\t\tthis.setValue(value);\n\t\t\t}\n\n\t\t\t// Handle event\n\t\t\tif(!renko.isNullOrUndefined(this.onInput))\n\t\t\t\tthis.onInput(this);\n\t\t}.bind(this));\n\t\t\n\t\t// Setup resizing interval\n\t\tthis.nextUpdate = 1;\n\t\tthis.updateID = renko.monoUpdate.addAction(function(deltaTime) {\n\t\t\tthis.nextUpdate -= deltaTime;\n\t\t\tif(this.nextUpdate <= 0) {\n\t\t\t\tthis.nextUpdate = 1;\n\t\t\t\t\n\t\t\t\t// Refresh input rect and font size for current resolution.\n\t\t\t\tthis.refreshRect();\n\t\t\t\tthis.refreshFontSize();\n\n\t\t\t\t// Handle custom callback event.\n\t\t\t\tif(!renko.isNullOrUndefined(this.onResize)) {\n\t\t\t\t\tthis.onResize(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}.bind(this));\n\t}", "addMarkdownDiv() {\n var t_a = document.getElementById('actual_text_area');\n socket.emit('text-addition', new Markdown(Date.now(), t_a.value, 641, 210));\n }", "function TextArea(font) {\n TextControl();\n this.setupHandlers();\n this.setFont(font);\n this.setWrapping(true);\n this.view.layout();\n}", "function textAr(){\n const textArea1 = document.createElement('div');\n textArea1.id = \"textArea\";\n app.appendChild(textArea1);\n const textMover = document.createElement('h1');\n textMover.id = 'textMove';\n textArea1.appendChild(textMover);\n const textMandatory = document.createElement('h2');\n textMandatory.id = \"textMand\";\n textArea1.appendChild(textMandatory);\n}" ]
[ "0.7129017", "0.7024952", "0.7012515", "0.68993825", "0.6883092", "0.6699164", "0.66545093", "0.66404516", "0.66322494", "0.6594109", "0.658965", "0.65861285", "0.6565012", "0.6509018", "0.64856935", "0.64623934", "0.6448295", "0.6441324", "0.64378947", "0.64338857", "0.64324623", "0.64287466", "0.641862", "0.63930506", "0.6364309", "0.63629806", "0.6342734", "0.6332386", "0.6328102", "0.63194174", "0.63130766", "0.6291557", "0.62790996", "0.6268306", "0.6263163", "0.6261196", "0.62601954", "0.6246652", "0.6236703", "0.6235084", "0.62321544", "0.62279725", "0.6220855", "0.62187445", "0.6217132", "0.61951846", "0.61831266", "0.61725694", "0.6165203", "0.61596256", "0.6147448", "0.6146925", "0.61385715", "0.6133942", "0.6122539", "0.61206776", "0.6104552", "0.60963786", "0.60961944", "0.6091217", "0.6091186", "0.60754365", "0.6063729", "0.6054896", "0.60283", "0.60182965", "0.5999851", "0.5993046", "0.5991629", "0.597971", "0.59735614", "0.59727925", "0.59666574", "0.59659415", "0.595133", "0.59413826", "0.59349924", "0.5929752", "0.5927832", "0.5922437", "0.5921048", "0.5920858", "0.59201676", "0.5915767", "0.5913322", "0.591086", "0.59006673", "0.5876582", "0.5867364", "0.58648705", "0.5862896", "0.5861303", "0.585068", "0.58436435", "0.582672", "0.5819321", "0.5814358", "0.580946", "0.5808965", "0.58006454", "0.5800545" ]
0.0
-1
Limpia figura que esta siendo arrastrada si no se coloca en el lienzo
function dropFigure() { createFigureFunction = null; selectedFigureThumb = null; state = STATE_NONE; if (document.getElementById('draggingThumb') != null) { document.getElementById('draggingThumb').style.display = 'none'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dibujarFigura1(){\n //Limpiamos las areas para volver a dibujar\n figura1.clearRect(0,0,200,200);\n idFig1 = numeroAleatoreoFigura();\n console.log(\"id de la figura 1:\"+figura[idFig1]);\n if(idFig1 === 0){\n crearCuadroAleatoreo1();\n }\n if(idFig1 === 1){\n crearCirculoAleatoreo1();\n }\n if(idFig1 === 2){\n crearTrianguloAleatoreo1();\n }\n}", "function dibujarFigura2(){\n figura2.clearRect(0,0,200,200);\n idFig2 = numeroAleatoreoFigura();\n if(idFig2 === 0){\n crearCuadroAleatoreo2();\n }\n if(idFig2 === 1){\n crearCirculoAleatoreo2();\n }\n if(idFig2 === 2){\n crearTrianguloAleatoreo2();\n }\n}", "function desclickear(e){\n movible = false;\n figura = null;\n}", "function detectarFigura(e){\n var eX = e.layerX;\n var eY = e.layerY;\n figura = poligono.detectarClick(eX, eY);\n if(figura!=null){\n movible = true;\n }\n\n}", "function nuevoInicio(){\n let previo = inicio;\n inicio = mapa[inputInicioX.value()][inputInicioY.value()];\n inicio.obstaculo = false;\n inicio.corrienteFuerte = false;\n inicio.corriente = false;\n inicio.pintar(0);\n previo.pintar(255);\n}", "function dibujarPoligono(elem) {\n\n\tif(elem != undefined){\n\n\t\tlet hover; //LO USO POR SI EN ALGÚN MODULO DEBO CAMBIAR EL COLOR AL HACER UN CAMBIO DE COLOR EN EL HOVER\n\t\tlet label; //LO USO PARA EL MODULO DE ASIGNAR EN BARRIOS\n\t\t\n\t\tif(moduloActivado == \"NINGUNO\" ){\n\t\t\t//LIMPIO SI HAY UN POLIGONO MARCADO\n\t\t\thighlightLayerSource.clear('');\n\t\t}\n\t\t\n\t\tif(moduloActivado == \"BARRIOS-VER-PARCELA\"){\n\t\t\t\n\t\t\tlabel = elem;\n\t\t\thover = JSON.parse($(elem).attr(\"hover\"));\n\t\t\telem = JSON.parse($(elem).attr(\"poligono\"))\n\t\t}\n\t\t\n\t\tcoord= [];\n\t\t\n\t\t\n\t\t\n\t\tif(elem.features[0].geometry != null){\n\t\t\t\n\t\t\tfor(i=0; i < elem.features[0].geometry.coordinates[0][0].length; i++){\n\t\t\t\t\n\t\t\t\tCoorx = elem.features[0].geometry.coordinates[0][0][i][0];\n\t\t\t\tCoory = elem.features[0].geometry.coordinates[0][0][i][1];\n\t\t\t\tcoord.push([Coorx, Coory]);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tvar thing = new ol.geom.Polygon([coord]);\n\t\t\tvar featurething = new ol.Feature({\n\t\t\t\tgeometry: thing\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(moduloActivado == \"BARRIOS-VER-PARCELA\" && hover){\n\t\t\t\t\n\t\t\t\thighlightLayerSourceHover.addFeature(featurething);\n\t\t\t\t\n\t\t\t\t/* ESTO HACE ZOOM SOBRE LA PARCELA SELECCIONADA EN BARRIOS\n\t\t\t\t\t\tLO DEJO COMENTADO PORQUE VISUALMENTE QUE CABIARA EL EXTENT \n\t\t\t\t\t\tNO ERA AGRADABLE.\n\n\t\t\t\t\t\tvar extent = highlightLayerSourceHover.getExtent();\n\t\t\t\t\t\tmap.getView().fit(extent, map.getSize());\n\t\t\t\t\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t\n\t\t\t}else if(moduloActivado == \"BARRIOS-VER-PARCELA\" && !hover){\n\t\t\t\t\n\t\t\t\t$(label).attr('hover','true')\n\t\t\t\thighlightLayerSourceHover.clear('');\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\thighlightLayerSource.addFeature(featurething);\n\t\t\t\t\n\t\t\t\tvar extent = highlightLayerSource.getExtent();\n\t\t\t\t\n\t\t\t\tmap.getView().fit(extent, map.getSize());\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n}", "function nuevoFin(){\n let previo = fin;\n fin = mapa[inputFinalX.value()][inputFinalY.value()];\n fin.obstaculo = false;\n fin.corrienteFuerte = false;\n fin.corriente = false;\n fin.pintar(0);\n previo.pintar(255);\n}", "function visUre() {\n container.textContent = \"\";\n alleUre.forEach((ur) => {\n if (filter == ur.Farve || filter == \"alle\") {\n let klon = temp.cloneNode(true).content;\n klon.querySelector(\"img\").src = \"images/\" + ur.Billede + \".webp\";\n klon.querySelector(\".navn\").textContent = ur.Navn;\n klon.querySelector(\".farve\").textContent = ur.Farve;\n klon.querySelector(\".pris\").textContent = ur.Pris + \",-\";\n klon.querySelector(\"article\").addEventListener(\"click\", () => {\n location.href = \"produkter_detaljer.html?id=\" + ur._id;\n });\n\n container.appendChild(klon);\n }\n });\n}", "function isDisplayDescriptionMissEarth() {\n if(descriptionMissionEarth.classList.contains('displayNone')) {\n // display it\n descriptionMissionEarth.classList.remove('displayNone')\n descriptionMissionEarth.classList.add('displayYes')\n imgChevronMissEarth.src = 'images/earthChevron2.png'\n \n } else if(descriptionMissionEarth.classList.contains('displayYes')) {\n // remove display\n descriptionMissionEarth.classList.remove('displayYes')\n descriptionMissionEarth.classList.add('displayNone')\n imgChevronMissEarth.src = 'images/earthChevron.png'\n }\n}", "function avantiDiUno(){\n\t\tvar fotoCorrente = $(\"img.active\");\n var fotoSuccessiva = fotoCorrente.next(\"img\");\n // devo valutare se l img successiva esiste, in caso contrario riparto dalla prima,poi faro l incontrario per il precedente..sfrutto le classi first e last assegnate.. uso .length per valutare l esistenza!!!\n if (fotoSuccessiva.length == 0) {\n fotoSuccessiva = $(\"img.first\");\n }\n fotoCorrente.removeClass(\"active\");\n fotoSuccessiva.addClass(\"active\");\n // faccio la stessa cosa con i pallini\n var pallinoCorrente = $(\"i.active\");\n var pallinoSuccessivo = pallinoCorrente.next(\"i\");\n if (pallinoSuccessivo.length == 0) {\n pallinoSuccessivo = $(\"i.first\");\n }\n pallinoCorrente.removeClass(\"active\");\n pallinoSuccessivo.addClass(\"active\");\n // faccio variare anche qui l avariabile creata sopra per allinere i cambiamenti di frecce e pallini...vorrei tornare indietro nel tempo e dirlo al me stesso di un ora fa!!!\n if(current_img<3)\n\t\t\tcurrent_img++;\n\t\telse\n\t\t\tcurrent_img=0;\n\n\t}", "function mostraNotas(){}", "default() {\n return !this.filled && !this.stroke && !this.text && !this.subtle;\n }", "function IndicadorGradoAcademico () {}", "function initInterfaz() {\n let status = this.g.options.status;\n\n function reflejarOpciones(opts) {\n for(const ajuste of this.ajustes.$children) {\n const input = ajuste.$el.querySelector(\"input\");\n if(opts[input.name]) {\n input.checked = true;\n input.dispatchEvent(new Event(\"change\"));\n }\n }\n }\n\n // Nos aseguramos de que al (des)aplicarse\n // un filtro o corrección se refleja en la interfaz.\n this.g.Centro.on(\"filter:* unfilter:*\", reflejarFiltro.bind(this));\n this.g.Centro.on(\"correct:* uncorrect:*\", reflejarCorreccion.bind(this));\n\n let opciones = {};\n if(status) {\n this.g.setStatus(); // Aplicamos el estado del mapa.\n // Lo único que queda por reflejar son las opciones\n // exclusivas de la interfaz virtual.\n for(const o in defaults_v) {\n const name = o.substring(0, 3);\n if(status.visual.hasOwnProperty(name)) {\n opciones[o] = status.visual[name];\n }\n }\n if(status.esp) this.selector.cambiarSidebar(status.esp);\n }\n else opciones = this.options;\n\n reflejarOpciones.call(this, opciones);\n\n // Si no se incluyen vacantes telefónicas, entonces\n // debe deshabilitarse la corrección por adjudicaciones no telefónicas.\n if(!this.options[\"correct:vt+\"]) {\n for(const f of this.filtrador.$children) {\n if(f.c.tipo === \"correct\" && f.c.nombre === \"vt\") {\n f.$children[0].disabled = true;\n break;\n }\n }\n }\n\n // Una vez aplicados todos los cambios iniciales, definimos\n // el disparador para que vaya apuntando en local los cambios de estado.\n // TODO: Esto quizás se pueda pasar a un sitio más adecuando, haciendo uso de statusset\n this.g.on(\"statuschange\", e => {\n if(localStorage && this.options.recordar) localStorage.setItem(\"status\", this.status);\n });\n\n this.g.fire(\"statusset\", {status: !!status});\n // Guardamos el estado final de la inicialización.\n this.g.fire(\"statuschange\");\n }", "function aplicarAnchoOcupadoAGuifo() {\r\n if (imageHeight / imageWidth < 0.6) {\r\n imagenCont280.classList.add(\"imagenCont280x280OcupaDosColumnas\");\r\n imgBusqueda.style.paddingBottom = \"50%\";\r\n } else {\r\n imagenCont280.classList.add(\"imagenCont280x280V2OcupaUnaColumna\");\r\n }\r\n }", "function precipitacion() {\n if ($(this).is(\":checked\"))\n {\n if ($(this).val() !== 'todos') {\n capa_actual = $(this).val();\n }\n conmutar_cobertura($(this).val(), true);\n $(\"#div_leyenda\").show();\n } else {\n capa_actual = '';\n conmutar_cobertura($(this).val(), false);\n if (listado_capas.length <= 1) {\n $(\"#div_leyenda\").hide();\n }\n }\n actualizar_coberturas();\n map.data.setStyle(style_bf);\n}", "function aplicarAnchoOcupadoAGuifo() {\r\n if (imageHeight / imageWidth < 0.6) {\r\n imagenCont280.classList.add(\"imagenCont280x280OcupaDosColumnas\");\r\n imgBusqueda.style.paddingBottom = \"50%\";\r\n } else {\r\n imagenCont280.classList.add(\"imagenCont280x280V2OcupaUnaColumna\");\r\n }\r\n }", "function aplicarAnchoOcupadoAGuifo() {\r\n if (imageHeight / imageWidth < 0.6) {\r\n imagenCont280.classList.add(\"imagenCont280x280OcupaDosColumnas\");\r\n imgBusqueda.style.paddingBottom = \"50%\";\r\n } else {\r\n imagenCont280.classList.add(\"imagenCont280x280V2OcupaUnaColumna\");\r\n }\r\n }", "function recorrerTablero(tablero, fin, col, pos) {\n\n\t//Almacena los elementos div que contienen las piezas del tablero, los tesoros y las fichas\n\tlet images = [];\n\n\tlet numImages = tablero.rows.length - 1;\n\tif (pos === 'izq' || pos === 'der') \n\t\tnumImages = tablero.rows[0].cells.length - 1;\n \n\n\tfor (let row = 1; row < numImages; row++) {\n\n\t\tlet cell;\n\t\tlet translation;\n\t\tlet img;\n\n\t\t// Se obtiene la celda, y se recorre en columnas o filas\n\t\t// Se asigna X o Y dependiendo del movimiento que se debe hacer\n\t\tif (pos === 'arriba' || pos === 'abajo') {\n\t\t\tcell = tablero.rows[row].cells[col];\n\t\t\ttranslation = 'Y';\n\t\t} else {\n\t\t\tcell = tablero.rows[col].cells[row];\n\t\t\ttranslation = 'X';\n\t\t}\n\n\t\t// Obtiene el div que está en el td, el cual contiene las imágenes\n\t\timg = cell.getElementsByTagName('div')[0];\n\n\t\t// Se obtiene la altura del div que contiene las imágenes\n\t\tlet height = getComputedStyle(img).height;\n\t\theight = (fin === 1) ? height : '-' + height;\n\n\t\t// Se le asigna la duración a la animación\n\t\timg.style.transition = `transform ${seconds}s ease-in-out`;\n\n\t\t// Hace que se mueva hacia abajo, o hacia el lado un espacio (de tamaño del div)\n\t\timg.style.transform = `translate${translation}(${height}) `;\n\n\t\t// Se almacena el elemento div en el arreglo\n\t\timages.push(img);\n\t}\n\n\t//Cuando se desliza de izquierda a derecha o de abajo para arriba\n\tif (pos === 'arriba' || pos === 'izq')\n\t\timages.reverse();\n\n\n\t//Recorrer el arreglo images para poder intercambiar los elementos div\n\tsetTimeout(function() {\n\t\tconst lastSrc = images[images.length - 1];\n\t\tfor (let index = images.length - 1; index > 0; --index)\n\t\t\tendAnimation(images[index - 1], images[index]);\n\n\t\t//Se elimina el formato de la pieza extra y se le agrega la clase de las piezas del tablero\n\t\textraPieceDiv.classList.remove('extra');\n\t\textraPieceDiv.classList.add('boardPieceContainer');\n\n\t\textraPieceDiv.getElementsByClassName('extraPiece')[0].classList.remove('extraPiece');\n\n\t\t//Se llama al método para intercambiar las piezas\n\t\tchangeExtraPiece(tablero, images[0], extraPieceDiv);\n\t\tendAnimation(images[0], extraPieceDiv);\n\n\t}, 1000);\n\n}", "function visualizza() {\n for (let i = 0; i < parola_length; i++) {\n lettere[i].innerHTML = parola_scelta[i];\n if (!trovate[i]) {\n lettere[i].style.transition = \".8s\";\n lettere[i].style.transform = \"translateY(1rem)\";\n lettere[i].style.backgroundColor = \"var(--non-indovinata)\";\n }\n }\n res.style.display = \"none\";\n return false;\n}", "function lineaPrincipal() {\n if (!primer) {\n figureBuild(window.figure_LineInit, coor[0] - tamFig, coor[1]);\n coor[1] += 70;\n lineas[0]++;//Numero de lineas de entrada\n lineas[1]++;//Linea de entrada actual y principal = 1\n primer = true;\n resetToNoneState();\n }\n}", "function alternaReinicia(tipoDisplay) {\n $reiniciaDom.css({\n display: tipoDisplay\n });\n\n }", "function seleccionaPieza() {\n if (turno == 1){\n if(!piezaMovilSeleccionada && this.firstElementChild) {\n casilla = this; \n piezaMovil = casilla.innerHTML;\n this.querySelector('img[alt=\"Pieza_Blanca\"]').classList.add(\"pintado\"); \n piezaMovilSeleccionada = true;\n \n //Pinta la ficha del titulo del jugador de turno\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.add(\"pintado\");\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.remove(\"pintado\");\n \n //Pinta el nombre del jugador de turno y despinta al otro\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = 'lightblue';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = '';\n \n }\n else if(piezaMovilSeleccionada && !this.querySelector('img[alt=\"Pieza_Blanca\"]') ){\n casilla.innerHTML= ''; \n this.innerHTML = piezaMovil;\n piezaMovilSeleccionada = false;\n posicion = this;\n if (posicion != casilla ){\n turno = 2;\n\n //Despinta ficha de titulo cuando ya no es tu turno\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.remove(\"pintado\");\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.add(\"pintado\");\n\n //Despinta nombre cuando ya no es tu turno\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = '';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = 'lightblue';\n } \n }\n \n} //Turno 2 Piezas Rojas\n else if (turno == 2){\n if(!piezaMovilSeleccionada && this.firstElementChild) {\n casilla = this; \n piezaMovil = casilla.innerHTML; \n this.querySelector('img[alt=\"Pieza_Roja\"]').classList.add(\"pintado\"); \n piezaMovilSeleccionada = true;\n \n //Pinta la ficha del titulo del jugador de turno\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.add(\"pintado\");\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.remove(\"pintado\");\n //Pinta el nombre del jugador de turno y despinta al otro\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = '';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = 'lightblue'; \n \n }\n else if(piezaMovilSeleccionada && !this.querySelector('img[alt=\"Pieza_Roja\"]')){\n casilla.innerHTML= ''; \n this.innerHTML = piezaMovil; \n piezaMovilSeleccionada = false;\n posicion = this;\n console.log(casilla.id);\n if (posicion != casilla){\n turno = 1;\n //Despinta ficha de titulo cuando ya no es tu turno\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.remove(\"pintado\");\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.add(\"pintado\");\n\n //Despinta nombre cuando ya no es tu turno\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = 'lightblue';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = '';\n } \n } \n }\n \n}", "function capaRecorridos(){\r\n /**\r\n * Inicializar la capa para los recorridos\r\n */\r\n lienzoRecorridos = new OpenLayers.Layer.Vector(\"Recorridos\");\r\n markerInicioFin = new OpenLayers.Layer.Markers( \"Inicio-Fin\" );\r\n map.addLayer(lienzoRecorridos);\r\n map.addLayer(markerInicioFin);\r\n}", "function VisulizzaAnnunci(Cancella = false){\n let Vetrina = document.querySelector(\"#blocco-vetrina\");\n let ColoreAnnuncio = document.querySelector(\"#colore1\").value;\n let AnnXPagina = (parseInt)(document.querySelector(\"#limite-annunci\").value);\n\n if(Cancella){\n IndiceRicerca = 0;\n let AnnunciDOM = Vetrina.querySelectorAll(\"div\");\n AnnunciDOM.forEach(function(AnnuncioDOM){\n AnnuncioDOM.remove();\n });\n } else {\n IndiceRicerca = (parseInt)(IndiceRicerca + AnnXPagina);\n let MostraAltroDOM = Vetrina.querySelector(\"#mostra-altro\");\n MostraAltroDOM.remove();\n }\n\n // Creiamo attraverso JS l'annuncio\n for(let i=IndiceRicerca; i<((parseInt)(IndiceRicerca)+(parseInt)(AnnXPagina)); i++){\n if(AnnunciRicerca.length <= i) return;\n // Creazione Blocco che contiene l'annuncio\n let ContainerDOM = document.createElement(\"div\");\n ContainerDOM.style.backgroundImage = \"-webkit-linear-gradient(left, #F0F0F0 0%, \"+ColoreAnnuncio+\" 200%)\";\n Vetrina.appendChild(ContainerDOM);\n\n // Inserimento foto annuncio\n let ImmagineDOM = document.createElement(\"div\");\n ImmagineDOM.id = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000IdAnnuncio\"];\n ImmagineDOM.setAttribute(\"onclick\", \"PaginaAnnuncio(this)\");\n ImmagineDOM.className = \"fotografia\";\n if(AnnunciRicerca[i][\"Foto\"] != undefined){\n ImmagineDOM.style.backgroundImage = \"url(\"+AnnunciRicerca[i][\"Foto\"][0]+\")\";\n } else {\n ImmagineDOM.style.backgroundImage = \"url(\"+NO_FOTO+\")\";\n }\n ContainerDOM.appendChild(ImmagineDOM);\n\n // Inserimento Provincia\n let ProvinciaDOM = document.createElement(\"div\");\n ProvinciaDOM.className = \"casella-testo-doppia\";\n ProvinciaDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Comune\"]+\" (\"+AnnunciRicerca[i][\"\\u0000Annuncio\\u0000SiglaProvincia\"]+\")\";\n ContainerDOM.appendChild(ProvinciaDOM);\n\n // Inserimento Categoria\n let CategoriaDOM = document.createElement(\"div\");\n CategoriaDOM.className = \"casella-testo-semplice\";\n CategoriaDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Categoria\"];\n ContainerDOM.appendChild(CategoriaDOM);\n\n // Inserimento Descrizione\n let DescrizioneDOM = document.createElement(\"div\");\n DescrizioneDOM.className = \"casella-descrizione\";\n DescrizioneDOM.innerHTML = \"<i>[Rif: \"+AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Rif\"]+\"]</i></br>\";\n DescrizioneDOM.innerHTML += AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Descrizione\"];\n ContainerDOM.appendChild(DescrizioneDOM);\n\n // Inserimento Contratto\n let ContrattoDOM = document.createElement(\"div\");\n ContrattoDOM.className = \"casella-testo-semplice\";\n ContrattoDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Contratto\"];\n ContainerDOM.appendChild(ContrattoDOM);\n\n // Inserimento Prezzo\n let PrezzoDOM = document.createElement(\"div\");\n PrezzoDOM.className = \"prezzo-annuncio\";\n PrezzoDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Prezzo\"];\n ContainerDOM.appendChild(PrezzoDOM);\n }\n\n let MostraAltroDOM = document.createElement(\"div\");\n MostraAltroDOM.id = \"mostra-altro\";\n MostraAltroDOM.setAttribute(\"onclick\", \"VisulizzaAnnunci();\");\n MostraAltroDOM.innerHTML = \"Mostra altro\";\n Vetrina.appendChild(MostraAltroDOM);\n}", "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = IMAGENES.length - 1;\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "function borrarPunto(e){\n figura = null;\n let eX = e.layerX;\n let eY= e.layerY;\n figura = poligono.detectarClick(eX,eY);\n if((figura != null)&&(poligono.getCentro()!=null)){\n poligono.borrarCirculo(figura);\n}\n}", "function esconderNotaRodape(){\n\t\tasideContent.css('width', asideContent.innerWidth()).removeClass('visivel');\n\t\tareaAside.addClass('easing-reverso');\n\t\tareaAside.removeClass('visivel');\n\t\tsetTimeout(function(){\n\t\t\ttodoCorpo.removeClass('blockscroll apenas_mobile');\n\t\t\tdomArticle.find('div.overlay-fechar').removeClass('db');\n\t\t\tasideContent.remove();\n\t\t\tareaAside.removeClass('db easing-reverso');\n\t\t\tindexRodapeClicado = '';\n\t\t\trodapeRevelado = false;\n\t\t\t\n\t\t},200);\n\t}", "expandidoTotalmente(){\n for (let hijo of this.hijos.values()){\n if(hijo.nodo === null) return false\n }\n\n return true\n }", "function colorearNotas(nombreClase)\n{\n\t$('.'+nombreClase).each(function(){\n\t\t\n\t\tif ($(this).hasClass(\"cancelacion\")) $(this).addClass(\"nota-color\").addClass(\"nota-color-habilita\");\n\t\telse if ($(this).text()+0 >= 3)\n\t\t{\n\t\t\t//$(this).parent().css(\"background-color\", \"rgb(185, 223, 187)\");\n\t\t\t$(this).addClass(\"nota-color\").addClass(\"nota-color-gana\");\n\t\t}\n\t\telse if($(this).text()+0 < 3 || $(this).text() == 'N')\n\t\t{\n\t\t\t//$(this).parent().css(\"background-color\", \"rgb(248, 192, 203)\");\n\t\t\t//Esta parte es para poner el trailing zero en las notas definitivas.\n\t\t\tif ($(this).text()+0 < 1) $(this).text(\"0\"+$.trim($(this).text()));\n\t\t\t$(this).addClass(\"nota-color\").addClass(\"nota-color-pierde\");\n\t\t}\n\t\telse if ($(this).text() == 'A')\n\t\t{\n\t\t\t//$(this).parent().css(\"background-color\", \"rgb(185, 223, 187)\");\n\t\t\t$(this).addClass(\"nota-color\").addClass(\"nota-color-gana\");\n\t\t}\n\t\telse if ($(this).text() == 'NC' || $(this).text() == 'CA' )\n\t\t{\n\t\t\t//$(this).parent().css(\"background-color\", \"rgb(185, 223, 187)\");\n\t\t\t$(this).addClass(\"nota-color\").addClass(\"nota-color-habilita\");\n\t\t}\n\t});\n}", "function AbreJanela(largura) {\n if (!largura) {\n largura = .25;\n }\n\n var janela = Dom('div-janela');\n RemoveFilhos(janela);\n janela.style.top = (((1 - .25) / 2.0) * 100) + '%';\n janela.style.left = (((1 - largura) / 2.0) * 100) + '%';\n janela.style.width = (largura * 100) + '%';\n HabilitaOverlay();\n janela.style.display = 'block';\n return janela;\n}", "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = imagenes.length -1;\n\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "isDataVizEmpty() {\n return document.querySelector(\"[data-viz='wrapper']\").getElementsByTagName(\"svg\").length === 0\n }", "function turnoPc(){\n //Recibe el numero aleatorio\n let jugadaPc = enviarNumero()\n //Quitar opacidad \n let opacidad = document.querySelector(\".overlay\")\n //opacidad.className = \"escondite\"\n //En base al numero carga la imagen que le representa\n if (jugadaPc == 0){\n let cloncito = document.createElement(\"img\")\n cloncito.src= \"./images/piedra.jpg\"\n document.querySelector(\".box_loader\").appendChild(cloncito)\n return 0\n }\n if (jugadaPc == 1){\n let cloncito = document.createElement(\"img\")\n cloncito.src= \"./images/papel.jpg\"\n document.querySelector(\".box_loader\").appendChild(cloncito)\n return 1\n }\n if (jugadaPc == 2){\n let cloncito = document.createElement(\"img\")\n cloncito.src= \"./images/tijera.jpg\"\n document.querySelector(\".box_loader\").appendChild(cloncito)\n return 2\n }\n}", "function rimuoviPreferiti(event) {\n const icona = event.currentTarget;\n const sezionePreferiti = document.querySelector(\"#preferiti\");\n icona.src = \"img/aggiungipreferiti.png\";\n icona.removeEventListener(\"click\", rimuoviPreferiti);\n icona.addEventListener(\"click\", aggiungiPreferiti);\n icona.parentNode.parentNode.remove();\n if (sezionePreferiti.childNodes.length === 0) {\n sezionePreferiti.parentNode.classList.add(\"hidden\");\n }\n let nodi = document.querySelectorAll(\"#container .item\");\n for (let nodo of nodi) { //Cerco l'elemento tra tutti i cerchi per poter modificare l'icona e riassegnare il giusto listener\n if (nodo.querySelector(\".item h1\").textContent === icona.parentNode.querySelector(\"h1\").textContent) {\n nodo.querySelector(\".titolo img\").src = \"img/aggiungipreferiti.png\";\n nodo.querySelector(\".titolo img\").removeEventListener(\"click\", rimuoviDaiPreferiti);\n nodo.querySelector(\".titolo img\").addEventListener(\"click\", aggiungiPreferiti);\n }\n }\n}", "verificarPerdida(){\n if(this.grillaLlena()){\n let aux = this.clone();\n aux.grafica = new GraficaInactiva();\n //simulo movimiento a derecha\n aux.mover(new MovimientoDerecha(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a izquierda\n aux.mover(new MovimientoIzquierda(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a abajo\n aux.mover(new MovimientoAbajo(aux));\n if(aux.compareTo(this)){ \n //simulo movimiento a arriba\n aux.mover(new MovimientoArriba(aux));\n if(aux.compareTo(this))\n this.grafica.setPerdida();\n }\n } \n }\n }\n }", "function QuandoColidirPeixeAnzol (anzol, peixe) {\n if (anzol.children.length == 0) {\n peixe.tint = (anzol == anzolJ1) ? corJ1 : corJ2;\n peixe.body.velocity.setTo(0,0);\n peixe.body.enable = false;\n anzol.addChild (peixe);\n peixe.x = 0;\n peixe.y = 15;\n if (!somFisgou.isPlaying) somFisgou.play();\n }\n else {\n if (!somTrombou.isPlaying) somTrombou.play();\n }\n} // fim: QuandoColidirPeixeAnzol", "function fro_lat() {\n\t// attraper le conteneur\n\tvar o=document.getElementById('article');\n\t// sortir sans laisser d'erreur\n\tif (!o) return;\n\tif (o.className==\"fro\") o.className=\"\";\n\telse o.className=\"fro\";\n\treturn false;\n}", "function checked() {\n let checked = document.querySelectorAll('.container-tipo a');\n\n if (checked[0].querySelector('input').hasAttribute('checked')) {\n const frete = document.querySelector('.preco-frete');\n const valorFrete = frete.querySelector('h3');\n const diasFrete = frete.querySelector('span');\n\n const valorFreteAtual = document.createElement('h3');\n\n frete.removeChild(valorFrete);\n valorFreteAtual.appendChild(document.createTextNode('Grátis'));\n frete.insertBefore(valorFreteAtual, diasFrete);\n return 'gratis';\n } else {\n const frete = document.querySelector('.preco-frete');\n const valorFrete = frete.querySelector('h3');\n const diasFrete = frete.querySelector('span');\n\n const valorFreteAtual = document.createElement('h3');\n\n frete.removeChild(valorFrete);\n valorFreteAtual.appendChild(document.createTextNode('R$10,90'));\n frete.insertBefore(valorFreteAtual, diasFrete);\n return 10.9;\n }\n}", "function revelarSumario(){\n\t\tsumario.removeClass('easing-invertido');\n\t\tsetTimeout(function(){\n\t\t\tsumario.addClass('visivel');\n\t\t\tsumarioAberto = true;\n\t\t}, 20)\n\t}", "function pasarFoto() {\n if(posicionActual >= IMAGENES.length - 1) {\n posicionActual = 0; \n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "function colocar_dulce(fila,modo=\"aleatorio\",nombre_imagen=0){\r\nvar html_para_agregar=\"\";\r\n if(modo === \"aleatorio\"){\r\n nombre_imagen = numero_entero_al_azar(1,4);\r\n }\r\n html_para_agregar = '<div class=\"candycru fila'+fila+'\"><img src=\"image/'+nombre_imagen+'.png\" alt=\"\"></div>'\r\n return html_para_agregar\r\n}", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "function loadTarefas(tarefas) {\n \n if($('article').children().length > 0){\n $('article').children().remove();\n }\n\n for (let i = 0; i < tarefas.length; i++) {\n //Criação do cabeçalho da tarefa\n const cab = document.createElement('div'); // Cabeçalho do cartao\n const imgCab = document.createElement('img'); // imagem do card\n const textCab = document.createElement('span'); //Texto do cabeçalho\n\n\n if(tarefas[i].concluida == 0){\n cab.classList.add(\"cabCartaoNaoConcluido\"); // Cabeçalho do cartao não concluido\n imgCab.src = 'public/assets/unchecked.png'; // imagem do card não concluido\n textCab.innerText = 'Não concluido'; //Texto do cabeçalho nao concluido\n }else if(tarefas[i].concluida == 1){\n cab.classList.add(\"cabCartaoConcluido\"); // Cabeçalho do cartao concluido\n imgCab.src = 'public/assets/checked.png'; // imagem do card concluido\n textCab.innerText = 'Concluido'; //Texto do cabeçalho concluido\n }\n cab.appendChild(imgCab);\n cab.appendChild(textCab); \n\n\n //Criação do corpo (descricao) da tarefa\n let textDescricao = document.createElement('div');\n\n if(tarefas[i].arquivada == 0){ \n textDescricao.classList.add('textoDescricao');\n }else if(tarefas[i].arquivada == 1){\n textDescricao.classList.add('textoDescricaoRiscado');\n }\n\n textDescricao.innerText = tarefas[i].descricao;\n \n //criação do rodapé\n const rodape = document.createElement('footer');\n\n const rodapeAcao = document.createElement('img');\n rodapeAcao.src = \"public/assets/archive-color.png\";\n\n if(tarefas[i].concluida == 0){\n rodapeAcao.addEventListener('click', function() {\n concluir(tarefas[i].idTarefa);\n });\n }else if(tarefas[i].concluida == 1){\n rodapeAcao.addEventListener('click', function() {\n arquivar(tarefas[i].idTarefa);\n });\n }\n \n\n const rodapeLixo = document.createElement('img');\n rodapeLixo.src = \"public/assets/trash-gray-scale.png\";\n rodapeLixo.addEventListener('click', function() {\n excluir(tarefas[i].idTarefa, tarefas[i].descricao);\n });\n\n rodape.appendChild(rodapeAcao);\n rodape.appendChild(rodapeLixo);\n\n //Criação do cartão inteiro\n const cardInteiro = document.createElement('div');\n cardInteiro.classList.add(\"cartaoConcluido\");\n\n const cor = document.createElement('div');\n\n if(tarefas[i].cor == '#daf5fa'){\n cor.classList.add(\"azul\");\n }else if(tarefas[i].cor == '#d1fecb'){\n cor.classList.add(\"verde\");\n }else if(tarefas[i].cor == '#f6d0f6'){\n cor.classList.add(\"rosa\");\n }else if(tarefas[i].cor == '#dcd0f3'){\n cor.classList.add(\"roxo\");\n }else if(tarefas[i].cor == '#fcfccb'){\n cor.classList.add(\"amarelo\");\n }else if(tarefas[i].cor == '#fbd4b4'){\n cor.classList.add(\"laranja\");\n }else if(tarefas[i].cor == '#fff'){\n cor.classList.add(\"branco\");\n }\n\n //Montagem\n cardInteiro.appendChild(cor);\n cor.appendChild(cab);\n cor.appendChild(textDescricao);\n cor.appendChild(rodape);\n\n //Adicionando na pagina html\n $('article').append(cardInteiro);\n }\n \n}", "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = imagenesp.length - 1;\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "function controlloArrocco(colp)\n{\n\t\n\tif(colp==\"n\" && arrocco[0]==true) //nero\n\t{\n\t\tif(arrocco[1]==true && document.getElementById(\"12\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"13\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"14\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo sinistra libera\n\t\t\tdocument.getElementById(\"13\").className=\"selezionato\"; isArrocco=true;\n\t\tif(arrocco[2]==true && document.getElementById(\"16\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"17\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo destra libera\n\t\t\tdocument.getElementById(\"17\").className=\"selezionato\"; isArrocco=true;\n\t}\n\telse if(colp==\"b\" && arrocco[3]==true) //bianco\n\t{\n\t\tif(arrocco[4]==true && document.getElementById(\"82\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"83\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"84\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo sinistra libera\n\t\t\tdocument.getElementById(\"83\").className=\"selezionato\"; isArrocco=true;\n\t\tif(arrocco[5]==true && document.getElementById(\"86\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"87\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo destra libera\n\t\t\tdocument.getElementById(\"87\").className=\"selezionato\"; isArrocco=true;\n\t}\n}", "function exibirLogoBranca(){\n let logo = $('#logo-dute.colorida');\n if ( logo.length > 0 ){\n logo.removeClass('colorida').addClass('branca');\n }\n}", "function analisaTablero () {\n rac = analisisColumnas()\n raf = analisisFilas()\n if (rac == true || raf == true) {\n eliminarDulces()\n } else {\n mueveDulces()\n }\n }", "function mark(el) \n\t{\n\n\t/* la variable dos prend comme valeur le chemin vers l'image que l'on a choisi */\n\n\tdos = el.src;\n\n\t/* gestion du cadre bleu autour des images dans la modale des options */\n\n\tfor (var a = 1; a < 7; a++)\n\t\t{\n\t\tdocument.getElementById(a).style.border = \"0px solid blue\";\n\t\t}\n\n\t\tel.style.border = \"2px solid blue\";\n\n\t/* on change le deck dans la partie en cours */\t\n\n\tfor (var y = 0; y < 6; y++)\n\t\t{\t\n\t\tfor (var x = 0; x < 6; x++)\n\t\t\t{\n\t\t\t\tif (grille[x][y] == \"O\")\n\t\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"carte\" + x.toString() + y.toString()).src = dos;\n\t\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}", "function trasformaLingua(lingua) {\n var contenitoreLingue = [\"it\",\"en\",\"fr\"]\n var bandiera = lingua;\n if (contenitoreLingue.includes(lingua)) {\n bandiera = '<img src=\"img/' + lingua + '.png\" alt=\"' + lingua + '\">';\n }\n return bandiera;\n }", "function leerCurso(curso){\r\n \r\n const infoCurso = {\r\n id: curso.querySelector('a').getAttribute('data-id'),\r\n imagen: curso.querySelector('img').src,\r\n nombre: curso.querySelector('h4').textContent,\r\n autor: curso.querySelector('.autor-curso').textContent,\r\n calificacion: curso.querySelector('.estrellas-curso span').textContent,\r\n precio: curso.querySelector('.precio span').textContent,\r\n cantidad: 1\r\n\r\n\r\n }\r\n\r\n const cursoDuplicado = articulosCarrito.some( curso => curso.id === infoCurso.id);\r\n if(cursoDuplicado){\r\n const i = articulosCarrito.map(curso =>{\r\n if(curso.id === infoCurso.id){\r\n curso.cantidad++;\r\n return curso;\r\n }else{\r\n return curso;\r\n }\r\n });\r\n articulosCarrito = [...i];\r\n }else{\r\n articulosCarrito = [...articulosCarrito, infoCurso];\r\n //console.log(articulosCarrito);\r\n\r\n\r\n }\r\n\r\n llenarCarrito();\r\n \r\n}", "_proximaImgVivo() {\n\t\t//mudar index (como vetor circular)\n\t\tthis._indexImgVivo = (this._indexImgVivo + 1) % this._vetorImgsVivo.length;\n\t\t//mudar img em formaGeometrica\n\t\tthis._colocarImgVivoAtual();\n\t}", "function dibujarVacas(){\n papel.drawImage(vaca, 15, 25)\n}", "function IndicadorAntiguedad () {}", "function retrocederFoto() {\r\n // se incrementa el indice (posicionActual)\r\n\r\n // ...y se muestra la imagen que toca.\r\n }", "function noHayDevoluciones(tipo, proveedor){\n elementos.mensajePanel.find('h3').text('No hay devoluciones disponibles para el '+tipo+' ' + proveedor);\n elementos.mensajePanel.find('.overlay').addClass('hide');\n elementos.mensajePanel.removeClass('hide');\n elementos.devolucionesTabla.addClass('hide');\n }", "function restartCargaArchivo() {\n\n handleMapCursor();\n\n _editToolbar.deactivate();\n _toolEditionActivada = false;\n\n if (_capa != \"NINGUNA\") {\n $(\"#editorFeatures\").addClass(\"ocultar\");//[data-capa='\" + _capa + \"']\n $(\"#currentFeatures\" + _capa).html(\"?\");\n $(\"#cantFeatures\" + _capa).html(\"?\");\n }\n\n $(\"#barraEdicion\").addClass(\"ocultar\");\n $(\".herramientaDibujo\").removeClass(\"ocultar\");\n\n if (_esCargaShape == 0) {\n\n if (_shapeFileLayer) {\n _map.removeLayer(_shapeFileLayer);\n _shapeFileLayer = undefined\n }\n\n }\n else if (_esCargaShape == 1) {\n if (_kmlLayer) {\n _map.removeLayer(_kmlLayer);\n _kmlLayer = undefined\n }\n }\n else if (_esCargaShape == 2) {\n _editionLayer.clear();\n _drawToolBar.deactivate()\n }\n\n _esCargaShape = -1;\n _fileName = \"\";\n _capa = \"NINGUNA\";\n _current = -1;\n _selectedGraphic = undefined;\n _kmlCurrent = -1;\n _layerkml = undefined;\n\n\n}", "function Filtros(filtros){\n\n if(filtros==\"Normal\"){\n var ctx = canvasF.getContext('2d');\n ctx.drawImage(imgEspejo,0,0,canvasW, canvasH);\n \n }\n \n else if(filtros==\"Blanco y Negro\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for(let i =0; i<data.data.length; i++){\n let red= data.data[i*4];\n let blue= data.data[i*4+1];\n let green= data.data[i*4+2];\n let valor=(red+blue+green)/3\n\n data.data[i*4]=valor;\n data.data[i*4+1]=valor;\n data.data[i*4+2]=valor;\n }\n contextF.putImageData(data,0,0);\n \n }\n else if(filtros==\"Negativo\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = 255 - data.data[i]; // rojo\n data.data[i + 1] = 255 - data.data[i + 1]; // verde\n data.data[i + 2] = 255 - data.data[i + 2]; // azul\n }\n contextF.putImageData(data,0,0);\n \n }\n\n else if(filtros==\"Espejo\"){\n var ctx = canvasF.getContext('2d');\n ctx.translate(canvasW,0);\n ctx.scale(-1,1);\n ctx.drawImage(imgEspejo,0,0,canvasW, canvasH);\n normalway();\n }\n else if(filtros==\"Sepia\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n \n for (var i = 0; i < data.data.length; i += 4) {\n var r, g, b;\n r = data.data[i];\n g = data.data[i + 1];\n b = data.data[i + 2];\n\n data.data[i] = 0.3 * (r + g + b);\n data.data[i + 1] = 0.25 * (r + g + b);\n data.data[i + 2] = 0.20 * (r + g + b);\n }\n contextF.putImageData(data,0,0);\n\n }\n\n else if(filtros==\"Rojo\"){\n //este es rojo con detalles negros\n //para hacer rojo con detalles \"normales\"/blancos se cambia el rojo quitando el 255 y agregando el +\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = + data.data[i]; // rojo\n data.data[i + 1] = - data.data[i]; // verde\n data.data[i + 2] = - data.data[i]; // azul\n\n }\n contextF.putImageData(data,0,0);\n\n }\n else if(filtros==\"Rojo/Azul\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] =255 - data.data[i]; // rojo\n data.data[i + 1] = - data.data[i]; // verde\n data.data[i + 2] = 255- data.data[i]; // azul\n\n }\n contextF.putImageData(data,0,0);\n\n }\n\n \n else if(filtros==\"Rojo Menta\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = 255- data.data[i]; // rojo\n data.data[i + 1] = 255- data.data[i]; // verde\n data.data[i + 2] = 255 - data.data[i]; // azul\n \n }\n contextF.putImageData(data,0,0);\n\n }\n else if(filtros==\"Rayos X\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] =255 - data.data[i]; // rojo\n data.data[i + 1] = + data.data[i]; // verde\n data.data[i + 2] = + data.data[i]; // azul\n \n }\n contextF.putImageData(data,0,0);\n\n }\n }", "function anterior () {\n \n if (aux_2 == 0){\n \n aux_2 = 0;\n \n }\n\n else{\n\n aux_2 = aux_2-1;\n\n }\n\n document.images.Diapositiva.src = Fotos[aux_2];\n }", "auxiliarPredicado(tipo, nombre, valor, objeto) {\n //Verificamos si lo que se buscó en el predicado es un atributo o etiqueta\n if (tipo == \"atributo\") {\n //Recorremos los atributos del objecto en cuestion\n for (let att of objeto.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Cierre for para recorrer atributos\n for (let entry of objeto.hijos) {\n for (let att of entry.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Ci\n }\n }\n else {\n //Si lo que se busca es una etiqueta en el predicado\n for (let entry of objeto.hijos) {\n //Recorremos cada uno de los hijos y verificamos el nombre de la etiqueta\n if (entry.dameID() == nombre) {\n //Sí hay concidencia, se procede a examinar si el valor es el buscado\n if (entry.dameValor().substring(1) == valor) {\n //Agregamos el objeto a la consola de salida\n this.consolaSalidaXPATH.push(objeto);\n //Al iguar que n fragmento anteriores, se establece el nuevo punto de inicio\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n } //cierreControladorInicio\n } //CIERRE VALOR\n } //CIERREID\n } //CIERRE RECORRIDO DE HIJOS\n }\n //La siguiente linea comentada es para recursividad, pendiente de uso.\n }", "function rotarFigura() {\n ctx.rotate(0.17);\n ctx.restore(); //dibuja la figura\n\n }", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosActuales[\"carga\"] = styles.marcadorCarga();\n //corregir esto\n estilosActuales[\"Taxi/Remis\"] = styles.marcadorTraslado();\n // default\n estilosActuales[\"default\"] = styles.marcadorDefault();\n }", "function ocultarAviso() {\n aviso.classList.add('ocultar');\n }", "function resetear(){\r\n imagen = document.getElementsByClassName('huecos');\r\n contador = 0;\r\n \r\n for(let i = 0; i<imagen.length; i++){\r\n imagen[i].style.display= '';\r\n }\r\n\r\n for(let j = 0; j<estrellas3.length; j++){\r\n estrellas2[j].style.display = '';\r\n estrellas3[j].style.display = '';\r\n }\r\n}", "function sonraki()\n{\n $('.elaman').hide();\n if (glb_siradakiEleman == ($('.elaman').length - 1)){\n glb_siradakiEleman = 0;\n }\n else{\n glb_siradakiEleman++;\n }\n \n $('.elaman:eq(' + glb_siradakiEleman + ') img').attr(\"src\", elemanlar[glb_siradakiEleman].resim);\n $('.elaman:eq(' + glb_siradakiEleman + ') h3').text(elemanlar[glb_siradakiEleman].baslik);\n $('.elaman:eq(' + glb_siradakiEleman + ') p').text(elemanlar[glb_siradakiEleman].yazi);\n \n \n $('.elaman:eq(' + glb_siradakiEleman + ')').show();\n}", "function DesenhaPlaca() {\n origemx = centroX - (placa.width / 2);\n origemy = centroY - (placa.height / 2);\n ctx.drawImage(placa, origemx, origemy);\n}", "function ativaCarregando(Texto) {\n\tfixH();\n\tif ($('div.Direita div.Carregando')) {\n\t\tif (Texto) {\n\t\t\t$('div.Direita div.Carregando span b').html(Texto);\n\t\t}\n\t\tif ($('div.Direita div.Carregando').css('display') == 'none') {\n\t\t\t$('div.Direita div.Carregando').css('display','table');\n\t\t} else {\n\t\t\t$('div.Direita div.Carregando').css('display','none');\n\t\t}\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function pintarDeportes(deporte = \"\") {\n let eventos = listaDeportes(data, deporte);\n let logosDeportes = document.getElementById(\"logosDeportes\");\n if (logosDeportes) {\n logosDeportes.innerHTML = \"\";\n eventos.forEach(function (disciplina) {\n const imagen = document.createElement(\"img\");\n imagen.setAttribute(\"src\", `./assets/depOlimpicos/${disciplina}.svg`);\n const cajaDisciplina = document.createElement(\"div\");\n cajaDisciplina.classList.add(\"tipoDeporte\");\n const titulo = document.createElement(\"h3\");\n titulo.innerHTML = disciplina.replace(\"_\", \" \");\n cajaDisciplina.insertAdjacentElement(\"beforeend\", imagen);\n cajaDisciplina.insertAdjacentElement(\"beforeend\", titulo);\n logosDeportes.insertAdjacentElement(\"beforeend\", cajaDisciplina);\n });\n }\n}", "function exibirLogoColorida(){\n let logo = $('#logo-dute.branca');\n if ( logo.length > 0 ){\n logo.removeClass('branca').addClass('colorida');\n }\n}", "function ondea(){\n /* REFIERE AL TÍTULO */ \n var titulo = document.querySelector(\"h1\"); \n /* CAPTURA EL CONTENIDO DEL TÍTULO */\n var texto = titulo.innerHTML; \n /* MIDE EL TAMAÑO DEL TÍTULO */\n var ancho = 700; \n var alto = 120; \n\n /*SIEMPRE AJUSTA EL ancho COMO MÚLTIPLO DE anchoFaja EN PIXELES*/\n ancho = ancho+(anchoFaja-ancho%anchoFaja); \n /* FIJA EL TAMAÑO DEL TÍTULO */\n titulo.style.width = ancho+\"px\"; \n titulo.style.height = alto+\"px\"; \n\n /* LA CANTIDAD DE BANDAS ES EL ANCHO DE TÍTULO SOBRE ANCHO DE CLIP */\n var totalFajas = ancho/1.4; \n\n /* VACÍA EL TÍTULO CONTENEDOR DE TEXTO */\n titulo.innerHTML = \"\"; \n\n /* CREA LAS BANDAS Y LES DA FORMATO */\n for(i=0; i<totalFajas; i++) {\n /* UN DIV PARA CADA FAJA */\n faja = document.createElement(\"div\"); \n // $(\"div\").addClass( \"fulljit\" );\n /* LE ASIGNA LA MISMA ALTURA DEL TÍTULO */\n faja.style.height = alto+\"px\"; \n faja.style.width = ancho+\"px;\"\n /* PONE EL MISMO TEXTO ORIGINAL */\n faja.innerHTML = texto; \n /* DEJA VISIBLE UN CLIP DE 2px DE ANCHO, CADA UNO 2px A LA IZQUIERDA DEL ANTERIOR PARA QUE PAREZCA UNA IMAGEN DE TÍTULO COMPLETA SIN CORTES */\n faja.style.clip = \"rect(0, \"+((i+1)*anchoFaja)+\"px, \"+alto+\"px, \"+(i*anchoFaja)+\"px)\"; \n /* RETRASA LA ANIMACIÓN CSS DE CADA FAJA SIGUIENDO UNA ONDA DE TIEMPO SENOIDE */\n faja.style.animationDelay = (Math.cos(i)+i*anchoOnda)+\"ms\"; \n /* AGREGA LA CAPA AL CONTENEDOR */\n titulo.appendChild(faja);\n }\n}", "function descubrir(x,y,array){\n\n if(!(x < 0 || x >= Juego.nivelActual.ancho ||\n y < 0 || y >= Juego.nivelActual.alto))\n {\n var actual = document.querySelector(\"div.fila-buscaminas div[data-x='\"+x+\"'][data-y='\"+y+\"']\");\n if(actual.getAttribute(\"value\") == \"blank\"){\n\n actual.setAttribute(\"value\",\"descubierto\");\n actual.classList.remove(\"sin-descubrir\");\n actual.classList.add(\"descubierto\");\n\n\n descubrir(x+1, y+1, array);\n descubrir(x-1, y+1, array);\n descubrir(x , y+1, array);\n descubrir(x+1, y-1, array);\n descubrir(x-1, y-1, array);\n descubrir(x , y-1, array);\n descubrir(x+1, y, array);\n descubrir(x-1, y, array);\n\n }else if(actual.getAttribute(\"value\") == \"limite\"){\n\n actual.classList.remove(\"sin-descubrir\");\n actual.classList.add(\"descubierto\");\n }\n }\n}", "function algoritmo() {\r\n\r\n if (terminado != true) { //seguimos hasta encontrar solucion\r\n\r\n if (openSet.length > 0) { //seguimos mientras haya algo en openSet\r\n var ganador = 0; //indice/posicion del ganador\r\n\r\n for (let i = 0; i < openSet.length; i++) { //evaluamos que openSet teine menor costo/esfuerzo\r\n if (openSet[i].f < openSet[ganador].f) {\r\n ganador = i;\r\n }\r\n }\r\n\r\n\r\n var actual = openSet[ganador]; //analizamos la casilla ganadora\r\n\r\n\r\n if (actual === fin) { //si se llego al final se busca el camino de regreso\r\n var temporal = actual;\r\n camino.push(temporal);\r\n\r\n while (temporal.padre != null) {\r\n temporal = temporal.padre;\r\n camino.push(temporal);\r\n }\r\n console.log(\"ACA ESTA EL CAMINO\");\r\n terminado = true;\r\n }\r\n else { //si no llegamos al final, seguimos \"caminando\"\r\n borrarDelArray(openSet, actual); //saco de openSet\r\n closeSet.push(actual); //meto en closeSet\r\n\r\n var vecinos = actual.vecinos;\r\n\r\n for (let i = 0; i < vecinos.length; i++) { //recorro los vecinos de mi ganador\r\n var vecino = vecinos[i];\r\n\r\n //si el vecino no esta en closeSet ni es tipo 1 calculamos los pasos\r\n if (!closeSet.includes(vecino) && vecino.tipo != 1) {\r\n var tempG = actual.g + 1;\r\n\r\n if (openSet.includes(vecino)) { // si el vecino esta en openSet y tiene mayor peso\r\n if (tempG < vecino.g) { //se encontro un camino mas corto\r\n vecino.g = tempG; //camino mas corto\r\n }\r\n }\r\n else {\r\n vecino.g = tempG;\r\n openSet.push(vecino);\r\n }\r\n\r\n\r\n //actualizamos los valores\r\n vecino.h = heuristica(vecino, fin);\r\n vecino.f = vecino.g + vecino.h;\r\n\r\n\r\n //guardamos el padre(de donde venimos)\r\n vecino.padre = actual;\r\n\r\n }\r\n\r\n }\r\n \r\n }\r\n \r\n \r\n }\r\n else { //ya no hay nada en openSet, es decir, no hay mas camino\r\n console.log(\"NO SE ENCONTRO EL CAMINO\");\r\n terminado = true;\r\n }\r\n \r\n }\r\n\r\n\r\n}", "function sobrePage(do_sobre) {\r\n function startAnimation(element) {\r\n var animationData = {\r\n assets: [],\r\n v: \"4.2.0\",\r\n ddd: 0,\r\n layers: [{\r\n ddd: 0,\r\n ind: 0,\r\n ty: 4,\r\n nm: \"mask\",\r\n td: 1,\r\n ks: {\r\n o: {\r\n k: 100\r\n },\r\n r: {\r\n k: 0\r\n },\r\n p: {\r\n k: [9, 9, 0]\r\n },\r\n a: {\r\n k: [0, 0, 0]\r\n },\r\n s: {\r\n k: [50, 50, 100]\r\n }\r\n },\r\n shapes: [{\r\n ty: \"gr\",\r\n it: [{\r\n ind: 0,\r\n ty: \"sh\",\r\n closed: !0,\r\n ks: {\r\n k: [{\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 0,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [0, -24.375],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [17.125, -.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }]\r\n }, {\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 4,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [17.125, -.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [.125, 26.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }]\r\n }, {\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 8,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [.125, 26.625],\r\n [25.913, -1.203],\r\n [35, -8.5]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [-28.5, -.125],\r\n [7.538, 38.672],\r\n [35.125, 33.875]\r\n ]\r\n }]\r\n }, {\r\n i: {\r\n x: .833,\r\n y: .833\r\n },\r\n o: {\r\n x: .167,\r\n y: .167\r\n },\r\n n: \"0p833_0p833_0p167_0p167\",\r\n t: 12,\r\n s: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [-28.5, -.125],\r\n [7.538, 38.672],\r\n [35.125, 33.875]\r\n ]\r\n }],\r\n e: [{\r\n i: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n o: [\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0],\r\n [0, 0]\r\n ],\r\n v: [\r\n [23.25, -18.375],\r\n [0, -18.125],\r\n [0, 0],\r\n [.375, -18.25],\r\n [-50.212, 7.672],\r\n [19.75, 38]\r\n ]\r\n }]\r\n }, {\r\n t: 16.0000006516934\r\n }]\r\n },\r\n nm: \"Path 1\"\r\n }, {\r\n ty: \"fl\",\r\n fillEnabled: !0,\r\n c: {\r\n k: [.05, 1, 0, 1]\r\n },\r\n o: {\r\n k: 100\r\n },\r\n nm: \"Fill 1\"\r\n }, {\r\n ty: \"tr\",\r\n p: {\r\n k: [0, 0],\r\n ix: 2\r\n },\r\n a: {\r\n k: [0, 0],\r\n ix: 1\r\n },\r\n s: {\r\n k: [100, 100],\r\n ix: 3\r\n },\r\n r: {\r\n k: 0,\r\n ix: 6\r\n },\r\n o: {\r\n k: 100,\r\n ix: 7\r\n },\r\n sk: {\r\n k: 0,\r\n ix: 4\r\n },\r\n sa: {\r\n k: 0,\r\n ix: 5\r\n },\r\n nm: \"Transform\"\r\n }],\r\n nm: \"Shape 1\"\r\n }],\r\n bounds: {\r\n l: -51,\r\n t: -25,\r\n b: 39,\r\n r: 36\r\n },\r\n ip: 0,\r\n op: 600.000024438501,\r\n st: 0\r\n }, {\r\n ddd: 0,\r\n ind: 1,\r\n ty: 4,\r\n nm: \"circle cheio\",\r\n tt: 1,\r\n ks: {\r\n o: {\r\n k: 100\r\n },\r\n r: {\r\n k: 0\r\n },\r\n p: {\r\n k: [9.01, 9.045, 0]\r\n },\r\n a: {\r\n k: [-12.49, -7.08, 0]\r\n },\r\n s: {\r\n k: [50, 50, 100]\r\n }\r\n },\r\n shapes: [{\r\n ty: \"gr\",\r\n it: [{\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n ty: \"fl\",\r\n fillEnabled: !0,\r\n c: {\r\n k: [1, 1, 1, 1]\r\n },\r\n o: {\r\n k: 100\r\n },\r\n nm: \"Fill 1\"\r\n }, {\r\n ty: \"tr\",\r\n p: {\r\n k: [-12.49, -7.08],\r\n ix: 2\r\n },\r\n a: {\r\n k: [0, 0],\r\n ix: 1\r\n },\r\n s: {\r\n k: [100, 100],\r\n ix: 3\r\n },\r\n r: {\r\n k: 0,\r\n ix: 6\r\n },\r\n o: {\r\n k: 100,\r\n ix: 7\r\n },\r\n sk: {\r\n k: 0,\r\n ix: 4\r\n },\r\n sa: {\r\n k: 0,\r\n ix: 5\r\n },\r\n nm: \"Transform\"\r\n }],\r\n nm: \"Ellipse 1\"\r\n }],\r\n bounds: {\r\n l: -31,\r\n t: -26,\r\n b: 11,\r\n r: 6\r\n },\r\n ip: 1.00000004073083,\r\n op: 128.000005213547,\r\n st: 1.00000004073083\r\n }, {\r\n ddd: 0,\r\n ind: 2,\r\n ty: 4,\r\n nm: \"circle\",\r\n ks: {\r\n o: {\r\n k: 100\r\n },\r\n r: {\r\n k: 0\r\n },\r\n p: {\r\n k: [9.01, 9.045, 0]\r\n },\r\n a: {\r\n k: [-12.49, -7.08, 0]\r\n },\r\n s: {\r\n k: [50, 50, 100]\r\n }\r\n },\r\n shapes: [{\r\n ty: \"gr\",\r\n it: [{\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n d: 1,\r\n ty: \"el\",\r\n s: {\r\n k: [26.84, 26.84]\r\n },\r\n p: {\r\n k: [0, 0]\r\n },\r\n nm: \"Ellipse Path 1\",\r\n closed: !0\r\n }, {\r\n ty: \"st\",\r\n fillEnabled: !0,\r\n c: {\r\n k: [1, 1, 1, 1]\r\n },\r\n o: {\r\n k: 100\r\n },\r\n w: {\r\n k: 2\r\n },\r\n lc: 1,\r\n lj: 1,\r\n ml: 4,\r\n nm: \"Stroke 1\"\r\n }, {\r\n ty: \"tr\",\r\n p: {\r\n k: [-12.49, -7.08],\r\n ix: 2\r\n },\r\n a: {\r\n k: [0, 0],\r\n ix: 1\r\n },\r\n s: {\r\n k: [100, 100],\r\n ix: 3\r\n },\r\n r: {\r\n k: 0,\r\n ix: 6\r\n },\r\n o: {\r\n k: 100,\r\n ix: 7\r\n },\r\n sk: {\r\n k: 0,\r\n ix: 4\r\n },\r\n sa: {\r\n k: 0,\r\n ix: 5\r\n },\r\n nm: \"Transform\"\r\n }],\r\n nm: \"Ellipse 1\"\r\n }],\r\n bounds: {\r\n l: -33,\r\n t: -28,\r\n b: 13,\r\n r: 8\r\n },\r\n ip: 0,\r\n op: 127.000005172816,\r\n st: 0\r\n }],\r\n ip: 0,\r\n op: 17.0000006924242,\r\n fr: 29.9700012207031,\r\n w: 18,\r\n h: 18\r\n };\r\n loaderHighPic = bodymovin.loadAnimation({\r\n container: element,\r\n renderer: \"svg\",\r\n loop: !1,\r\n autoplay: !1,\r\n animationData: animationData\r\n })\r\n } /*functions*/\r\n function initHeaderAnim(type) {\r\n \"init\" == type && (TweenMax.set($pageHeader.find(\"h2\"), {\r\n opacity: 0,\r\n y: \"50px\"\r\n }), TweenMax.set($pageHeader.find(\".circle-btn\"), {\r\n scale: 0,\r\n opacity: 1\r\n })), \"start\" == type && (TweenMax.to($pageHeader.find(\"h2\"), 1, {\r\n opacity: 1,\r\n y: \"0px\",\r\n ease: Circ.easeOut\r\n }, .1), TweenMax.to($pageHeader.find(\".circle-btn\"), 1, {\r\n scale: 1,\r\n delay: .5,\r\n ease: Elastic.easeOut.config(1, 1),\r\n onComplete: function() {\r\n TweenMax.set($pageHeader.find(\".circle-btn\"), {\r\n clearProps: \"scale\"\r\n })\r\n }\r\n }), $.doTimeout(700, function() {\r\n $pageHeader.find(\".circle-btn .arrow-down path\").addClass(\"active\")\r\n }))\r\n }\r\n\r\n function scrollTweens() {\r\n 0 == window.pageYOffset ? ($jsMaskDownWrapper.each(function() {\r\n var $this = $(this),\r\n $mask = $(\"<span class='mask-bg'></span>\");\r\n $mask.css({\r\n display: \"block\",\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n \"background-color\": \"#ffffff\"\r\n }), $this.find(\".js-mask-down\").append($mask)\r\n }), $jsMaskLeftWrapper.each(function() {\r\n var $this = $(this),\r\n $mask = $(\"<span class='mask-bg'></span>\");\r\n $mask.css({\r\n display: \"block\",\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n \"background-color\": \"#ffbb02\"\r\n }), $this.find(\".js-mask-left\").append($mask)\r\n }), $jsAnimUpGroup.each(function() {\r\n var $this = $(this);\r\n TweenMax.set($this.children(), {\r\n y: \"50px\",\r\n opacity: 0\r\n })\r\n }), $jsAnimUp.each(function() {\r\n var $this = $(this);\r\n TweenMax.set($this, {\r\n y: \"50px\",\r\n opacity: 0\r\n })\r\n }), $jsAnimReveal.each(function() {\r\n var $this = $(this);\r\n if (\"left\" == $this.attr(\"data-from\")) var offset_x = \"100px\",\r\n offset_y = \"0px\";\r\n if (\"right\" == $this.attr(\"data-from\")) var offset_x = \"-100px\",\r\n offset_y = \"0px\";\r\n if (\"top\" == $this.attr(\"data-from\")) var offset_y = \"100px\",\r\n offset_x = \"0px\";\r\n if (\"down\" == $this.attr(\"data-from\")) var offset_y = \"-100px\",\r\n offset_x = \"0px\";\r\n TweenMax.set($this, {\r\n x: offset_x,\r\n y: offset_y,\r\n opacity: 0\r\n })\r\n })) : ($jsMaskLeftWrapper.addClass(\"js-animated\"), $jsMaskDownWrapper.addClass(\"js-animated\"))\r\n } /*Animation Loop*/\r\n function sobrePage_scroll() {\r\n _raf_loop_id = _rAF_loop(sobrePage_scroll_rAF)\r\n }\r\n\r\n function sobrePage_scroll_rAF() {\r\n var $pageScrollHeader = $(\".page-scroll-header\");\r\n // Avoid calculations if not needed\r\n lastPosition != window.pageYOffset && (window.pageYOffset > lastPosition ? direction = \"down\" : direction = \"up\", lastPosition = window.pageYOffset, $thumbnail.hasClass(\"js-hover\") && $thumbnail.trigger(\"mouseleave\"), lastPosition > 10 && \"down\" == direction && !$_body.hasClass(\"js-scrolled-down\") && ($_body.addClass(\"js-scrolled-down\"), $pageScrollHeader.addClass(\"active\")), lastPosition < 10 && ($_body.removeClass(\"js-scrolled-down\"), $pageScrollHeader.removeClass(\"active\")), verge.inY($sobreTitle, -300) && $sobreTitle.find(\".picto\").addClass(\"active\"), $jsAnimUpGroup.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this.children(), 1, {\r\n y: 0,\r\n opacity: 1,\r\n ease: Power2.easeOut\r\n }, .2))\r\n }), $jsAnimUp.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this, 1, {\r\n y: 0,\r\n opacity: 1,\r\n ease: Power2.easeOut\r\n }, .2))\r\n }), $jsAnimReveal.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated active\"), TweenMax.staggerTo($this, 1, {\r\n x: 0,\r\n y: 0,\r\n opacity: 1,\r\n ease: Expo.easeOut\r\n }, .2))\r\n }), $jsMaskDownWrapper.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -100) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this.find(\".mask-bg\"), 1, {\r\n y: \"100%\",\r\n ease: Circ.easeInOut\r\n }, .2))\r\n }), $jsMaskLeftWrapper.each(function() {\r\n var $this = $(this);\r\n $this.hasClass(\"js-animated\") || verge.inY($this, -700) && ($this.addClass(\"js-animated\"), TweenMax.staggerTo($this.find(\".mask-bg\"), .8, {\r\n x: \"101%\",\r\n ease: Circ.easeInOut\r\n }, .1))\r\n }))\r\n }\r\n if (!do_sobre) return $_window.off(\"scroll.sobrePage\"), $_body.removeClass(\"sobre-page\"), !1;\r\n $_window.on(\"scroll.sobrePage\", sobrePage_scroll), $_body.addClass(\"sobre-page\");\r\n var loaderHighPic, lastPosition = -1,\r\n $pageHeader = $(\".page-header\"),\r\n $fullImages = $(\".full-images\"),\r\n $thumbnail = $(\".thumbnail\"),\r\n $jsMaskDownWrapper = ($(\".slideshow-container\"), $(\".js-mask-down-wrapper\")),\r\n $jsMaskLeftWrapper = $(\".js-mask-left-wrapper\"),\r\n $hiddenProtocols = $(\".hidden-protocols\"),\r\n $showHideProtocols = $(\".show-more-protocols\");\r\n $sobreTitle = $(\".sobre-title\"), $jsAnimUpGroup = $(\".js-anim-up-group\"), $jsAnimUp = $(\".js-anim-up\"), $jsAnimReveal = $(\".js-anim-reveal\"), /*Initializations*/\r\n initHeaderAnim(\"init\"), initHeaderAnim(\"start\"), pressAnime(), scrollTweens(), /*events*/\r\n $_body.hasClass(\"mobile\") ? (window.innerWidth > 767 ? $(\".slideshow-container\").vTicker({\r\n speed: 500,\r\n pause: 1500,\r\n height: 60,\r\n mousePause: !1\r\n }) : $(\".slideshow-container\").vTicker({\r\n speed: 500,\r\n pause: 1500,\r\n height: 40,\r\n mousePause: !1\r\n }), $thumbnail.on(\"click\", function() {\r\n var $this = $(this),\r\n $bgHover = $this.find(\".bg-hover\"),\r\n $goAnime = $this.find(\".go-anime\"),\r\n $closeToolTip = $this.find(\".close-tooltip\");\r\n if (!$this.hasClass(\"active\")) {\r\n if ($.each($thumbnail, function() {\r\n $(this).hasClass(\"active\") && ($(this).toggleClass(\"active\"), TweenMax.to($(this).find(\".close-tooltip\"), .1, {\r\n autoAlpha: 0,\r\n y: 0\r\n }), TweenMax.to($(this).find(\".bg-hover\"), .1, {\r\n delay: .35,\r\n autoAlpha: 0\r\n }), TweenMax.staggerTo($(this).find(\".go-anime\"), .4, {\r\n opacity: 0,\r\n y: 0\r\n }, .2))\r\n }), $this.addClass(\"js-hover\"), !$this.hasClass(\"js-hover\")) return !1;\r\n $this.hasClass(\"active\") || ($this.toggleClass(\"active\"), TweenMax.set($closeToolTip, {\r\n y: 10\r\n }), TweenMax.to($closeToolTip, .1, {\r\n delay: .25,\r\n autoAlpha: 1,\r\n y: 0\r\n }), TweenMax.to($bgHover, .1, {\r\n autoAlpha: 1\r\n }), TweenMax.staggerTo($goAnime, .4, {\r\n opacity: 1,\r\n y: -10,\r\n delay: .15\r\n }, .2))\r\n }\r\n }), $(document).on(\"click\", \".thumbnail.active .close-tooltip\", function() {\r\n var $this = $(this),\r\n $thisThumb = $this.parent(\".thumbnail\"),\r\n $bgHover = $this.parent(\".thumbnail\").find(\".bg-hover\"),\r\n $goAnime = $this.parent(\".thumbnail\").find(\".go-anime\");\r\n $thisThumb.toggleClass(\"active\"), TweenMax.to($this, .1, {\r\n autoAlpha: 0,\r\n y: 10\r\n }), TweenMax.to($bgHover, .1, {\r\n delay: .35,\r\n autoAlpha: 0\r\n }), TweenMax.staggerTo($goAnime, .4, {\r\n opacity: 0,\r\n y: 0\r\n }, .2)\r\n })) : ($(\".slideshow-container\").vTicker({\r\n speed: 500,\r\n pause: 1500,\r\n height: 60,\r\n mousePause: !1\r\n }), $thumbnail.on(\"mouseenter\", function(e) {\r\n var $this = $(this),\r\n $bgHover = $this.find(\".bg-hover\"),\r\n $goAnime = $this.find(\".go-anime\"),\r\n imageTarget = $this.attr(\"data-image-target\"),\r\n $loader = $this.find(\".loader\"),\r\n offset = $(this).offset();\r\n e.pageX - offset.left, e.pageY - offset.top;\r\n // relativeX = relativeX-$bgHover.width()/2;\r\n // relativeY = relativeY-$bgHover.height()/2;\r\n // $bgHover.css({\r\n // \"left\": 0,\r\n // \"top\": 0,\r\n // 'width':'100%',\r\n // 'height':'100%'\r\n // \"transform\": \"scale(2)\",\r\n // \"-webkit-transform\": \"scale(2)\"\r\n // });\r\n //TweenMax.to($bgHover, .1, {autoAlpha:.9});\r\n return startAnimation($loader[0]), $this.find(\"img\").hide(), $this.addClass(\"js-hover\"), !!$this.hasClass(\"js-hover\") && (TweenMax.to($bgHover, .1, {\r\n opacity: .9,\r\n visibility: \"visible\"\r\n }), TweenMax.staggerTo($goAnime, .4, {\r\n opacity: 1,\r\n y: 0,\r\n delay: .15\r\n }, .2), void $.doTimeout(0, function() {\r\n return !!$this.hasClass(\"js-hover\") && ($loader.css(\"opacity\", 1), loaderHighPic.play(), void loaderHighPic.addEventListener(\"complete\", function() {\r\n $(\".titles-columns\").css(\"opacity\", 0), $thumbnail.css(\"opacity\", .15), $this.css(\"opacity\", 1), $loader.css(\"opacity\", 0), TweenMax.to($fullImages.find(\".image-wrapper[data-image='\" + imageTarget + \"']\"), .2, {\r\n autoAlpha: 1,\r\n ease: Power4.easeOut,\r\n onComplete: function() {\r\n $fullImages.find(\".image-wrapper[data-image='\" + imageTarget + \"']\").addClass(\"js-scale\")\r\n }\r\n })\r\n }))\r\n }))\r\n }).on(\"mouseleave\", function(e) {\r\n var $this = $(this),\r\n $bgHover = $this.find(\".bg-hover\"),\r\n $loader = $this.find(\".loader\"),\r\n $goAnime = $this.find(\".go-anime\");\r\n $this.find(\".close-tooltip\");\r\n $this.removeClass(\"js-hover\"), $this.find(\"img\").show(), $(\".titles-columns\").css(\"opacity\", 1), TweenMax.to($bgHover, .1, {\r\n autoAlpha: 0\r\n }), TweenMax.killTweensOf($goAnime), TweenMax.killTweensOf($fullImages.find(\".image-wrapper\")), $thumbnail.css(\"opacity\", \"\"), TweenMax.to($fullImages.find(\".image-wrapper\"), .2, {\r\n autoAlpha: 0,\r\n ease: Power4.easeOut\r\n }), $fullImages.find(\".image-wrapper\").removeClass(\"js-scale\"), $loader.css(\"opacity\", 0), loaderHighPic.destroy(),\r\n // $bgHover.css({\r\n // \"transform\": \"scale(0)\",\r\n // \"-webkit-transform\": \"scale(0)\"\r\n // });\r\n TweenMax.to($goAnime, .2, {\r\n opacity: 0,\r\n y: 10\r\n })\r\n })), $showHideProtocols.on(\"click\", function() {\r\n var $this = $(this);\r\n $hiddenProtocols.toggleClass(\"active\"), TweenMax.set($hiddenProtocols.find(\"p\"), {\r\n y: \"20px\"\r\n }), $hiddenProtocols.hasClass(\"active\") ? ($this.text(\"Esconder\"), TweenMax.to($hiddenProtocols, 1.2, {\r\n autoAlpha: 1,\r\n height: $hiddenProtocols.find(\"p\").height() * $hiddenProtocols.find(\"p\").length,\r\n ease: Expo.easeOut\r\n }), TweenMax.staggerTo($hiddenProtocols.find(\"p\"), .5, {\r\n y: \"0px\",\r\n autoAlpha: 1,\r\n ease: Power4.easeOut\r\n }, .05)) : ($this.text(\"Mostrar Mais\"), TweenMax.set($hiddenProtocols.find(\"p\"), {\r\n y: \"20px\",\r\n autoAlpha: 0\r\n }), TweenMax.to($hiddenProtocols, .3, {\r\n autoAlpha: 0,\r\n height: \"0\"\r\n }))\r\n })\r\n}", "function pasarFoto() {\n if(posicionActual >= imagenes.length -1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "function dibujar(evento) {\r\n if (fondo.cargaOk) {\r\n papel.drawImage(fondo.imagen, 0, 0);\r\n }\r\n if (vaca.cargaOk) {\r\n for (var i = 0; i < numVacas; i++) {\r\n var x = posicionVaca[i][0];\r\n var y = posicionVaca[i][1];\r\n papel.drawImage(vaca.imagen, x, y);\r\n }\r\n }\r\n if (pollo.cargaOk) {\r\n for (var i = 0; i < numPollos; i++) {\r\n var x = posicionPollo[i][0];\r\n var y = posicionPollo[i][1];\r\n papel.drawImage(pollo.imagen, x, y);\r\n }\r\n }\r\n if (cerdo.cargaOk) {\r\n papel.drawImage(cerdo.imagen, cerdo.x, cerdo.y);\r\n }\r\n}", "function dibujarFresado107(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t//Puntos trayectoria \n\t\t\t//Son los mismos puntos que la figura 001 (el unico que cambia es fresado6 y fresado14)\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\t\n\t\n\t\n\t\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y) //punto fresado abajo a la izquierda [hay que corregirlo]\n\t\n\t\n\t\n\t\n\tvar fresado9 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado5 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado19 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t op_fresado.addObject(line,false);\n }\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\t\t\n\t\tvar fresado23 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado22 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\n\t\tif (crearFresado==1){\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado28 , fresado27 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado31 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior*2){\n\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado14 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n\t}\n\t\n\t\n\t\n\treturn op_fresado;\n\n}", "static getDefaults() {\n return {frame:'basic center-view', y:0, size:'15', path:'/nopath/', sym:'noimg'}\n }", "function montaNoLayer(codigo,indice){\n\tvar conteudo = \"&nbsp;<img style=\\\"position:relative;cursor:pointer;top:0px\\\" onclick=\\\"sobeDesce('sobe','layer','\"+codigo+\"','\"+indice+\"')\\\" title=\"+ $trad(\"sobe\",i3GEOadmin.core.dicionario) +\" src=\\\"../imagens/34.png\\\" />\";\n\tconteudo += \"&nbsp;<img style=\\\"position:relative;cursor:pointer;top:0px\\\" onclick=\\\"sobeDesce('desce','layer','\"+codigo+\"','\"+indice+\"')\\\" title=\"+ $trad(\"desce\",i3GEOadmin.core.dicionario) +\" src=\\\"../imagens/33.png\\\" />\";\n\tconteudo += \"&nbsp;<img style=\\\"position:relative;cursor:pointer;top:0px\\\" onclick=\\\"excluirLayer('\"+codigo+\"','\"+indice+\"')\\\" title=\"+ $trad(\"excluir\",i3GEOadmin.core.dicionario) +\" width='10px' heigth='10px' src=\\\"../imagens/01.png\\\" />&nbsp;<span>\"+indice+\"</span>\";\n\tvar d = {html:conteudo,id:codigo+\"_\"+indice,codigoMap:codigo,codigoLayer:indice};\n\treturn d;\n}", "function selecaoLivro(i, livros) {\n\n\n //Variavel para armazenar a quantidade de incones de estrelas de acordo com a nota do livro \n let qntEstrelas = ''\n //Quantas estrelas inteiras o livro tem \n for (var j = 1; j < livros[i][2]; j++) {\n console.log(j)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n console.log(qntEstrelas)\n }\n\n //Se a nota do livro tiver parte decimal...\n if (livros[i][2] % 1 != 0) {\n //Se a parte decimal for maior do que 0,5 o livro ganha uma estrela completa(arredonda pra cima)\n if (livros[i][2] % 1 > 0.5) {\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n //Se não o livro ganha meia estrela\n } else {\n qntEstrelas += `\n <img src=\"icones/star-half-full.svg\" alt=\"icone de strela quase cheia\">\n `\n console.log(qntEstrelas)\n }\n } else {\n //Atribuindo a estrela caso livro não tenha parte decimal\n //A ultima estrela é atribuida depois para que caso o livro tenha parte decimal ela não seja atribuida 2 vezes\n //Uma pela parte decimal no for\n //E outra na validação se a parte decimal é maior que 0.5(Estrela interia), ou menor ou igual(Meia estrela)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n }\n\n //Pagina do livro pra detalhes\n //Não troca de pagina para entrar em detalher a pagina apenas alteras suas infos\n let paginaCompleta = `\n\n <div class=\"root\">\n <div class=\"livroEscolido\">\n <div>\n <img src=${livros[i][6]}>\n </div>\n <div class=\"centralize\">\n <div>\n <div>\n <h3>${livros[i][0]}</h3>\n <h3>${livros[i][1]}</h3>\n </div>\n <p>\n ${livros[i][5]}\n </p>\n <h4>${livros[i][4]}</h4>\n\n <div class=\"addLista\">\n <button id=\"${i}\" onclick=\"inserirLivro(this.id, minhaLista)\">Adicionar á minha lista</button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"detalhes\">\n <header class=\"titulo\">\n <a href=\"index.html\">\n <img class=\"retorno\" src=\"icones/arrow-left-circle.svg\">\n </a>\n <img class=\"logo\" src=\"imagens/logotipo.png\">\n </header>\n\n <div>\n <div>\n <h1>${livros[i][0]} - ${livros[i][1]}</h1>\n </div>\n <div>\n <div class=\"areaAvaliacao\">\n `\n //Definindo cor do quadrado de avaliação \n if (livros[i][2] >= 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota verde\">${livros[i][2]}</div>\n `} else if (livros[i][2] > 1.5 && livros[i][2] < 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota amarelo\">${livros[i][2]}</div>\n `} else {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota vermelho\">${livros[i][2]}</div>\n `}\n\n paginaCompleta = paginaCompleta + `\n <div class=\"avaliacao\">\n <div>\n ${qntEstrelas}\n </div>\n <p>\n ${livros[i][3]} avaliações\n </p>\n </div>\n </div>\n\n <div class=\"resenha\">\n <h3>Resenha</h3>\n <p>\n ${livros[i][7]}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n <script type=\"text/javascript\" src=\"funcoes.js\"></script>\n </script>\n\n \n `\n //Esperando transição de tela\n setTimeout(function () {\n //Chamando função reponsavel pela atualização dos dados da pagina \n criarPagina(paginaCompleta)\n }, 1000);\n}", "function recorrerTablero(figura){\n let figuras = Array.from(document.querySelectorAll(\".figura\"));\n let result = [];\n for (let i = 0; i < figuras.length; i++){\n let listaClases = figuras[i].classList;\n if(listaClases.contains(figura)){\n result.push(i);\n }\n }\n return result;\n //arreglo con elementos\n //chequear si el elemento tiene la clase\n}", "function layoutIntacto(){\n\t// make the links to the previous pages / sgte work like the back / next buttons\n\tif(confBool('overwrite_links', true)){\n\t\ttry{\n\t\t\tvar next = contenido(document.documentElement.innerHTML, getNext, 0);\n\t\t\tvar linksNext = xpath('//*[@href=\"'+next+'\"]', document, true);\n\t\t\tfor(var i=0;i<linksNext.length;i++){\n\t\t\t\tlinksNext[i].href = '#next';\n\t\t\t\tsetEvt(linksNext[i], 'click', btnnext);\n\t\t\t}\n\t\t}catch(e){}\n\t\ttry{\n\t\t\tvar back = contenido(document.documentElement.innerHTML, getBack, 0);\n\t\t\tvar linksBack = xpath('//*[@href=\"'+back+'\"]', document, true);\n\t\t\tfor(var i=0;i<linksBack.length;i++){\n\t\t\t\tlinksBack[i].href = '#back';\n\t\t\t\tsetEvt(linksBack[i], 'click', btnback);\n\t\t\t}\n\t\t}catch(e){}\n\t}\n\n\t// replace the image with the default layout\n\tvar img;\n\tif(layoutElement) img = xpath(layoutElement);\n\telse{\n\t\timg = contenido(document.documentElement.innerHTML, getImagen, 0);\n\t\tvar src = typeof(img)=='string' ? match(img, /src=\"(.+?)\"/i, 1, img) : xpath('@src', img);\n\t\ttry{ img = xpath('//img[@src=\"'+src+'\"]'); }\n\t\tcatch(e){ img = xpath('//img[@src=\"'+decodeURI(src)+'\"]'); }\n\t}\n\n\tvar padre = img.parentNode;\n\tvar div = document.createElement('div');\n\tdiv.innerHTML = layoutDefault;\n\tpadre.insertBefore(div, img);\n\tpadre.removeChild(img);\n\n\t// if I am inside a link, I delete it\n\twhile(padre){\n\t\tif(padre.href){\n\t\t\twhile(padre.childNodes.length) padre.parentNode.insertBefore(padre.childNodes[0], padre);\n\t\t\tpadre.parentNode.removeChild(padre);\n\t\t\tbreak;\n\t\t}\n\t\telse if(padre == document.body) break;\n\t\tpadre = padre.parentNode;\n\t}\n\n\tget('wcr_btnlayout').innerHTML = 'Use Minimalistic Layout';\n}", "function getDesempenho(){\n init(1200, 500,\"#infos2\");\n executa(dados_atuais, 0,10,4);\n showLegendasRepetencia(false);\n showLegendasDesempenho(true);\n showLegendasAgrupamento(false);\n}", "function arConstructorImg() { \n constructorBases.forEach((base) => {\n // Change the main image\n let container = base.parentNode;\n let kovrikBase = container.getElementsByTagName('img')[1];\n let kovrikOkantovka = container.getElementsByTagName('img')[0];\n \n kovrikBase.src = urlBase + currentKovrikColor + ((standartImg.checked)? '_rombi' : '_3D') + '_kovrik.png';\n kovrikOkantovka.src = urlBase + currentOkantovkaColor + ((standartImg.checked)? \"\" : \"_3D\") + '_okantovka.png';\n\n //Change the class of images for shildiks and podpatniks\n if(!standartImg.checked) {\n let shildik = container.getElementsByClassName('dynamic-shildik')[0];\n if(shildik) {\n shildik.classList.add('dynamic-3D-shildik');\n shildik.src = urlBase + shildik.dataset.threedimg;\n }\n\n let podpatnik = container.getElementsByClassName('dynamic-podpatnik')[0];\n if(podpatnik) {\n podpatnik.classList.add('dynamic-3D-podpatnik');\n podpatnik.src = urlBase + podpatnik.dataset.threedimg;\n }\n } else {\n let shildik = container.getElementsByClassName('dynamic-shildik')[0];\n if(shildik) {\n shildik.classList.remove('dynamic-3D-shildik');\n shildik.src = urlBase + shildik.dataset.img;\n }\n\n let podpatnik = container.getElementsByClassName('dynamic-podpatnik')[0];\n if(podpatnik) {\n podpatnik.classList.remove('dynamic-3D-podpatnik');\n podpatnik.src = urlBase + podpatnik.dataset.img;\n }\n }\n });\n\n // Change the number of schemes\n if(standartImg.checked) {\n complectOptions[complectOptions.length - 1].style.visibility = 'visible';\n complectOptions[complectOptions.length - 2].style.visibility = 'visible';\n complectOptions[complectOptions.length - 3].style.visibility = 'visible';\n\n complectOptions[complectOptions.length - 1].getElementsByTagName('input')[0].disabled = false;\n complectOptions[complectOptions.length - 2].getElementsByTagName('input')[0].disabled = false;\n complectOptions[complectOptions.length - 3].getElementsByTagName('input')[0].disabled = false;\n } else {\n complectOptions[complectOptions.length - 1].style.visibility = 'hidden';\n complectOptions[complectOptions.length - 2].style.visibility = 'hidden';\n complectOptions[complectOptions.length - 3].style.visibility = 'hidden';\n\n complectOptions[complectOptions.length - 1].getElementsByTagName('input')[0].checked = false;\n complectOptions[complectOptions.length - 2].getElementsByTagName('input')[0].checked = false;\n complectOptions[complectOptions.length - 3].getElementsByTagName('input')[0].checked = false;\n\n complectOptions[complectOptions.length - 1].getElementsByTagName('input')[0].disabled = true;\n complectOptions[complectOptions.length - 2].getElementsByTagName('input')[0].disabled = true;\n complectOptions[complectOptions.length - 3].getElementsByTagName('input')[0].disabled = true;\n\n complectOptions[complectOptions.length - 1].style.backgroundColor = '';\n complectOptions[complectOptions.length - 2].style.backgroundColor = '';\n complectOptions[complectOptions.length - 3].style.backgroundColor = '';\n }\n}", "function dibujarFresado116(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tanchura4=0\n\tanchura5=0\n\t\n\t//Puntos trayectoria \n\t\t\t//Son los mismos puntos que la figura 001 (el unico que cambia es fresado6 y fresado14)\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\tvar fresado6 = new RVector(pos.x+alaIzquierda,pos.y) //punto fresado abajo a la izquierda\n\t\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior)\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado14 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior+alturaPlaca)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\n\t\t\n\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior){\n\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function renderizarImagen () {\n $imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;\n RADIO_VALUES[posicionActual].checked = true;\n console.log(posicionActual);\n }", "function pasarFoto() {\n if(posicionActual >= imagenesp.length - 1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "function Barreiras(altura, largura, abertura, espaco, notificarPonto) {\n this.pares = [\n new ParDeBarreiras(altura, abertura, largura),\n new ParDeBarreiras(altura, abertura, largura + espaco),\n new ParDeBarreiras(altura, abertura, largura + espaco * 2),\n new ParDeBarreiras(altura, abertura, largura + espaco * 3)\n ]\n\n const deslocamento = 3//deslocamento das barrerias em px\n this.animar = () => {\n this.pares.forEach(par => {\n par.setX(par.getX() - deslocamento)\n\n // quando o elemento sair da área do jogo\n if (par.getX() < -par.getLargura()) { //a barreira sumiu completamente da tela\n par.setX(par.getX() + espaco * this.pares.length) //move a barreira que saiu da tela para a fila de barreiras inicial\n par.sortearAbertura() //gera uma nova abertura para a barreira incluída na fila\n }\n\n const meio = largura / 2\n const cruzouOMeio = par.getX() + deslocamento >= meio\n && par.getX() < meio\n if(cruzouOMeio) notificarPonto() //se cruzou o meio da tela, adiciona o ponto no contador\n })\n }\n}", "function IndicadorRangoEdad () {}", "function graficar(conjunto,relacion) \n{\n\t//arreglo de los nodos y las arista o relacion de pares\n\tvar nodes_object = [];\n\tvar edges_object = [];\n\tfor(var i=0;i<conjunto.length;i++)\n\t{\n\t\tnodes_object.push({id: conjunto[i], label:conjunto[i]})\n\t}\n\tfor(var j=0;j<relacion.length;j++)\n\t{\n\t\tvar aux = relacion[j].entrada;\n\t\tif(relacion[j].salida!=\"n\")\n\t\t\taux = relacion[j].entrada + \", \" + relacion[j].salida;\n\t\tedges_object.push({from:relacion[j].de, to: relacion[j].a, label: aux, arrows:'to'})\n\t}\n\n\t//grafica \n\tvar nodes = new vis.DataSet(nodes_object);\n var edges = new vis.DataSet(edges_object);\n crearPopup(1,ventanaGrafica);\n\tvar container = ventanaGrafica.document.getElementById('visualization');\n \tvar data = {nodes: nodes,edges: edges};\n var options = {};\n var network = new vis.Network(container, data, options);\n}", "cambio(){\n\n productos.forEach(producto => {\n if(producto.nombre === this.productoSeleccionado) this.productoActual = producto;\n });\n\n //Ver si el producto actual tiene varios precios\n if(this.productoActual.variosPrecios){\n //Verificar si sobrepasa algun precio extra\n\n //Si es menor al tope del primer precio\n if(this.cantidadActual < this.productoActual.precios.primerPrecio.hasta){\n this.precioActual = this.productoActual.precios.primerPrecio.precio;\n //Seteamos el precio tachado a 0 de nuevo\n this.precioPorUnidadTachado = 0;\n }\n //Si es mayor o igual al tope del primer precio pero menor al tope del segundo\n else if(this.cantidadActual >= this.productoActual.precios.primerPrecio.hasta && this.cantidadActual < this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.segundoPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n //Si es igual o mayor al tope del segundo precio\n else if(this.cantidadActual >= this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.tercerPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n }\n }", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosMarcadores[\"carga\"] = styles.marcadorCarga();\n estilosMarcadores[\"traslado\"] = styles.marcadorTraslado();\n }", "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "function pintarPresionado(e){\n if (mousePrecionado === true) {\n cambiarColorGrilla(e);\n }\n}", "function dibujarFresado115(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=1 ; n<4 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]) {\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1) {\n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)) {\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)) {\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4) {\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function limpiarSeleccion() {\n \"use strict\";\n\n map.setView(new L.LatLng(4.5, -73.0), 6);\n map.eachLayer(function (layer) {\n map.removeLayer(layer);\n });\n map.addLayer(positron);\n map.addLayer(positronLabels);\n map.addLayer(NodosLayer);\n}", "function Avanti() {\n container.style.height=\"100%\"; \n container_testo.style.height=\"auto\";\n cliccato=true;\n NEW_IMGR.style.display=\"none\";\n NEW_IMGR2.style.display=\"none\";\n NEW_IMGR3.style.display=\"none\";\n R1.style.display=\"none\";\n R2.style.display=\"none\";\n R3.style.display=\"none\";\n \n if (src==\"7694-112F.jpg\" ) { \n notaCorbella.style.display=\"inline-block\";\n nota_Corbella.style.display=\"inline-block\"; \n \n container_fronte.appendChild(NEW_IMG);\n NEW_IMG.style.display=\"inline-block\";\n NEW_IMG.style.transform= \"rotate(0deg)\";\n \n EditoreDisegno.style.display=\"none\";\n PubPlaceDisegno.style.display=\"none\";\n\n TEXT3t.style.display=\"none\";\n TEXT2t.style.display=\"none\"; \n TEXT1t.style.display=\"none\"; \n TEXT1.style.display=\"none\"; \n \n bottoneruota.setAttribute(\"onclick\", \"Ruota(NEW_IMG);\");\n\n } else if (src == \"7694-176F.jpg\") { \n \n container_fronte.appendChild(NEW_IMG2);\n NEW_IMG2.style.display=\"inline-block\";\n NEW_IMG2.style.transform= \"rotate(0deg)\";\n \n container_testo.appendChild(EditoreDisegno);\n EditoreDisegno.style.display=\"inline-block\";\n container_testo.appendChild(PubPlaceDisegno);\n PubPlaceDisegno.style.display=\"inline-block\";\n \n TEXT2.style.display=\"none\"; \n TEXT3t.style.display=\"none\";\n TEXT2t.style.display=\"none\"; \n TEXT1t.style.display=\"none\";\n \n nota_facsimile_seconda_cartolina.style.display=\"block\";\n bottoneruota.setAttribute(\"onclick\", \"Ruota(NEW_IMG2);\");\n return;\n } else if (src == \"7694-122F.jpg\") { \n notaFacsTerzaCartolina.style.display=\"inline-block\";\n \n container_fronte.appendChild(NEW_IMG3);\n NEW_IMG3.style.display=\"inline-block\"\n TEXT3.style.display=\"none\"; \n TEXT3t.style.display=\"none\";\n TEXT2t.style.display=\"none\"; \n TEXT1t.style.display=\"none\";\n \n bottoneruota.setAttribute(\"onclick\", \"Ruota(NEW_IMG3);\");\n return;\n }\n }", "function zeichneKreis() {\n let circle = new Zauberbild.Element(); // Superklasse\n Zauberbild.kreisArray.push(circle); // Alle Elemente des Zauberbildes werden nachdem sie erstellt wurden im Kreisarray abgespeichert\n }", "function Analog_humec() {\r\n let newDataset = {\r\n label: 'HumEC',\r\n func: Analog_humec,\r\n backgroundColor: \"rgb(12, 1, 90)\",\r\n borderColor: \"rgb(12, 1, 90)\",\r\n data: [],\r\n fill: false\r\n };\r\n if (config.data.datasets.find( element =>element.label === newDataset.label) ){\r\n console.log ( \"Ya existe esta grafica\");\r\n }else{\r\n for (const prop in LocalDatabase_analog){\r\n if(LocalDatabase_analog[prop].humCap){\r\n newDataset.data.push({x:LocalDatabase_analog[prop].timestamps.substr(11,5), y:LocalDatabase_analog[prop].humEC.rawData});\r\n }\r\n }\r\n config.data.datasets.push(newDataset);\r\n updateChart();\r\n }\r\n}", "function show(str){\n //se str==1 (cioè gruppo proteine allora: \n if(str==1){\n //se gli alimenti sono visibili allora metti tutti i gruppi invisibili\n if(coll_proteine.css(\"display\")==\"flex\"){\n coll_carboidrati.css(\"display\",\"none\");\n coll_proteine.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n //altrimenti (quindi nel caso in cui il gruppo di aliemnti delle proteine non era visibilie)\n //lo metti visibile e metti tutti gli altri a non visibili\n else{\n coll_proteine.css(\"display\",\"flex\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n }\n //stesso ragionamento di sopra ma riguardo agli alimenti del gruppo CARBOIDRATI\n if(str==2){\n if(coll_carboidrati.css(\"display\")==\"flex\"){\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n else{\n coll_carboidrati.css(\"display\",\"flex\");\n coll_proteine.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n }\n if(str==3){\n if(coll_grassi.css(\"display\")==\"flex\"){\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n else{\n coll_grassi.css(\"display\",\"flex\");\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n } \n if(str==4){\n if(coll_calorie.css(\"display\")==\"flex\"){\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n else{\n coll_calorie.css(\"display\",\"flex\");\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n }\n } \n}", "static getDefaults(cfg) {\n return {frame:'chart center-container > view', feature:'[feature]', attr:{\n stroke:\"black\", 'stroke-width':3\n }, opt:{clip:false}\n // projectionOpts:{center:[-73.9679163, 40.7495461], scale:100000}\n };\n }" ]
[ "0.6208168", "0.60805744", "0.60698456", "0.57871723", "0.55384135", "0.5441895", "0.54364634", "0.5318159", "0.52919024", "0.52850217", "0.5283082", "0.5281477", "0.51958317", "0.5180829", "0.5158558", "0.51471287", "0.512842", "0.512842", "0.5123518", "0.50895613", "0.50739807", "0.5063437", "0.5054856", "0.5053412", "0.50515985", "0.5041287", "0.5014963", "0.4998814", "0.49866316", "0.4985383", "0.4984189", "0.49820668", "0.49815747", "0.49785322", "0.49672022", "0.4965522", "0.49647126", "0.49616703", "0.4961543", "0.49596283", "0.49580532", "0.49556807", "0.49541003", "0.49514765", "0.4950556", "0.49373928", "0.49355137", "0.4934634", "0.4930517", "0.4927506", "0.4927044", "0.4924143", "0.4923242", "0.49169746", "0.49128896", "0.48981336", "0.4896694", "0.48951358", "0.48949718", "0.48919857", "0.48747382", "0.4868391", "0.48587933", "0.48537374", "0.4848493", "0.48464534", "0.4842023", "0.48408303", "0.4839628", "0.48391482", "0.48367864", "0.48213693", "0.48196775", "0.48187193", "0.48168567", "0.48146358", "0.48069403", "0.4806918", "0.48067567", "0.480605", "0.480279", "0.48014775", "0.47991374", "0.47959054", "0.47954497", "0.479343", "0.47917694", "0.47897673", "0.47874045", "0.47872868", "0.47864702", "0.4785667", "0.4785251", "0.47797602", "0.4778288", "0.47732028", "0.47699913", "0.4769185", "0.47679758", "0.47662562", "0.47648183" ]
0.0
-1
Gestion la innabilidad del selector de especiales
function especialSelect(bool) { var select = document.getElementById('espSelect'); bool ? select.disabled = (disEspSel = true) : select.disabled = (disEspSel = false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get selector() {\n if(!this.exists)\n if(this.publication.pmetadata.title)\n return m(\"span#br-chapter\", this.publication.pmetadata.title);\n else\n return null;\n\n return m(\"select#br-chapter\", {\n title: __(\"Chapter selection\"),\n onchange: (e) => {\n const st = e.target;\n m.route.set(\"/:id\", { id: st[st.selectedIndex].value, }, { replace: false });\n }\n }, this.volumes.map(volume => {\n const chapters = [];\n volume.chapters.forEach(chapter => {\n chapters.push(m(\"option\", {\n value: chapter.uuid,\n selected: this.isSelected(chapter)\n }, chapter.title));\n });\n if(volume.title)\n return m(\"optgroup\", {\n label: volume.title\n }, chapters);\n else\n return chapters;\n \n }));\n }", "function show_selectors(ndx) {\n var disciplineDimNation = ndx.dimension(dc.pluck(\"Nation\"));\n var disciplineSelectNation = disciplineDimNation.group();\n\n var disciplineDimLevel = ndx.dimension(dc.pluck(\"Level\"));\n var disciplineSelectLevel = disciplineDimLevel.group();\n\n var disciplineDimType = ndx.dimension(dc.pluck(\"Type\"));\n var disciplineSelectType = disciplineDimType.group();\n \n dc.selectMenu(\"#Nation_selector\")\n .dimension(disciplineDimNation)\n .group(disciplineSelectNation);\n \n dc.selectMenu(\"#Tier_selector\")\n .dimension(disciplineDimLevel)\n .group(disciplineSelectLevel)\n \n dc.selectMenu(\"#Type_selector\")\n .dimension(disciplineDimType)\n .group(disciplineSelectType);\n}", "function loadSelector() {\n for (var i = 0; i < core.n_; i++) {\n $('#page-selector').append(\n [\"<option value='\", i, \"'>\", i + 1, '</option>'].join('')\n );\n }\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\" );\n}", "function imprimeSelector(clase){\n\tvar claseIcono = iconoSelector();\n\t$('.'+clase).addClass(claseIcono+' chkIcoSel');\n}", "constructor(){\n this.checkBoxOne = Selector(\"\");\n const selectors =[\n \"\",\n ]\n }", "function initSelector() {\n\n var userAgent = (window.navigator.userAgent||window.navigator.vendor||window.opera),\n isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(userAgent),\n mobileState = isMobile ? ' ___is-mobile' : '',\n isFirefox = /Firefox/i.test(userAgent);\n \n function buildSelector() {\n // Build selector out of each 'select' that is found\n $dataSelector.each(function(index) {\n var selectorClass = '';\n if ( $(this).attr('data-selector') ) {\n selectorClass = ' ___'+ $(this).attr('data-selector');\n }\n\n var tabIndex = 0;\n if ( $(this).attr('tabindex') ) {\n tabIndex = $(this).attr('tabindex');\n }\n\n $(this).attr('tabindex', -1);\n // Wrap the 'select' element in a new stylable selector\n $(this).wrap('<div class=\"selector' + mobileState + selectorClass + '\"></div>');\n // Fill the selector with a stylable 'select'\n $(this).parent().append('<div class=\"selector__select\" tabindex=\"'+ tabIndex + '\"></div><div class=\"selector__options\"><ul class=\"selector__list\"></ul></div>');\n\n var optionSelectedText = '';\n $(this).children('option').each(function() {\n var optionText = $(this).text(),\n optionValue = $(this).attr('value'),\n optionSelected = '';\n\n // Check if option is selected\n if ( $(this).attr('selected') ) {\n optionSelected = ' ___is-selected';\n optionSelectedText = optionText;\n }\n \n if ( $(this).attr('disabled') ) {\n optionSelected += ' ___is-disabled';\n optionValue = '';\n if (optionSelectedText.length === 0) {\n optionSelectedText = optionText;\n }\n }\n\n // Fill the selector with stylable 'options'\n if ( selectorClass === ' ___reversed' ) {\n $(this).closest('.selector')\n .find('.selector__list')\n .prepend('<li class=\"selector__option'+ optionSelected +'\" data-value=\"'+ optionValue +'\">'+ optionText +'</li>');\n } else {\n $(this).closest('.selector')\n .find('.selector__list')\n .append('<li class=\"selector__option'+ optionSelected +'\" data-value=\"'+ optionValue +'\">'+ optionText +'</li>');\n }\n });\n // Set our selector to the disabled ('Make a choice..') or selected text\n $(this).closest('.selector').children('.selector__select').text(optionSelectedText)\n });\n }\n \n buildSelector();\n \n // Original select changes on mobile\n $dataSelector.change(function() {\n $(this).children('option:selected').each(function() {\n $(this).closest('.selector').children('.selector__select').text( $(this).text() );\n });\n });\n\n // SELECTOR : the \"new\" select consisting of li's\n var $selector = $('.selector'),\n $selectorSelect = $('.selector__select'),\n $selectorOption = $('.selector__option'),\n openState = '___is-open';\n\n\n // Show options\n $selectorSelect.on('click', function(e) {\n e.preventDefault();\n $(this).parent('.selector').addClass(openState);\n });\n\n // Add and remove a .___has-focus class when selected with keyboard\n $selectorSelect.on('focusin', function(){\n $(this).addClass('___has-focus');\n }).on('focusout', function(){\n $(this).removeClass('___has-focus');\n $(this).parent('.selector').removeClass('___is-open');\n });\n\n // Remove .___is-open and close our selector when navigating outside of this element\n $(document).mouseup(function(e) {\n // If the target of the click isn't the container nor a descendant of the container\n if ( !$('.selector.___is-open').is(e.target) && $('.selector.___is-open').has(e.target).length === 0 ) {\n $('.selector.___is-open').removeClass(openState);\n }\n });\n\n // Select option\n $selectorOption.on('click', function(e) {\n e.preventDefault();\n if ( $(this).hasClass('___is-disabled') ) {\n return;\n }\n selectOption(this);\n });\n \n var selectedState = '___is-selected';\n \n /**\n * Actions to perform when selection one of the options with either mouse, keyboard.\n * @param HtmlElement el the selected option\n * @param Boolean close whether to close after selecting\n */\n\n function selectOption(el, close) {\n \n var $selectedOption = $(el);\n var selectedOptionText = $selectedOption.text();\n \n // Add selected state\n $selectedOption.siblings().removeClass(selectedState);\n $selectedOption.addClass(selectedState);\n\n // Update selected value\n $selectedOption.closest('.selector').children('.selector__select').text(selectedOptionText);\n\n // Select option in the original 'select' element\n var selectedValue = $selectedOption.attr('data-value');\n $selectedOption.closest('.selector').find('select')\n .val(selectedValue)\n .trigger('change');\n\n // Hide options\n if (close) {\n $selectedOption.closest('.selector').removeClass(openState);\n }\n\n if ( $(el).attr('data-value').indexOf('.html') > 0 ) {\n var optionLink = $(el).attr('data-value');\n window.location.href = optionLink;\n }\n }\n \n $selector.on('keydown', function(ev) {\n \n if (ev.keyCode === 13) { // enter key\n\n var found = $(this).find('.___is-selected');\n selectOption(found, true);\n \n } else if ( ev.keyCode !== 9 && (!ev.metaKey && !ev.altKey && !ev.ctrlKey && !ev.shiftKey) ) {\n \n ev.preventDefault();\n ev.stopPropagation();\n \n var found = $(this).find('.' + selectedState);\n if (found.length === 0) {\n found = $(this).find('.selector__option')[0];\n }\n \n if (ev.keyCode === 38) { // up\n var prev = $(found).prev('.selector__option:not(.___is-disabled)');\n if (prev.length) {\n $(this).find('.selector__option').removeClass(selectedState);\n $(prev).addClass(selectedState);\n selectOption(prev);\n }\n \n } else if (ev.keyCode === 40) { // down\n var next = $(found).next('.selector__option:not(.___is-disabled)');\n if (next.length) {\n $(this).find('.selector__option').removeClass(selectedState);\n $(next).addClass(selectedState);\n selectOption(next);\n }\n }\n }\n \n });\n \n }", "function init_inpt_formulario_cargar_categoria_icono() {\n var selectIcono = mdc.select.MDCSelect.attachTo(document.querySelector('#slc-icono'));\n\n selectIcono.listen('MDCSelect:change', () => {\n $(\"#slc-icono .mdc-select__selected-text\").css(\"display\", \"none\");\n $(\"#slc-icono .mdc-select__selected-text\").empty();\n\n var indexOfChild = selectIcono.foundation_.selectedIndex_ + 1;\n var liSelected = $(\"#slc-icono li[name='categoria-icono']:nth-child(\" + indexOfChild + \")\");\n var icono = liSelected.find(\"i:first\")[0];\n var newIcono = $(icono).clone();\n\n newIcono.css(\"color\", $(\"#slc-color\").css(\"background-color\"));\n newIcono.appendTo(\"#slc-icono .mdc-select__selected-text\");\n\n $(\"#slc-icono .mdc-select__selected-text\").css(\"display\", \"block\");\n });\n\n // icono seleccionado\n var icono_seleccionado = $('#slc-icono').attr('data-icono');\n var iIconoSelected = $(\"#slc-icono i[name='\" + icono_seleccionado + \"']\");\n iIconoSelected.closest(\"li\").attr('aria-selected', 'true');\n selectIcono.foundation_.selectedIndex_ = parseInt(iIconoSelected.attr(\"data-index\"));\n selectIcono.foundation_.adapter_.notifyChange();\n}", "get selectors () {\n return _.extend(super.selectors, {\n node: '.arc',\n highlight: '.highlight',\n })\n }", "function cambiaTipo(sel){\n\tvar clave = sel.id.substr('wcr_sitio_tipo_'.length), tipo = sel.value;\n\tvar elems = xpath('//*[starts-with(@id,\"wcr_sitio_valor_'+clave+'\")]', document, true);\n\tfor(var i=0; i<elems.length; i++)\n\t\telems[i].style.display = elems[i].id.indexOf('_'+tipo)>0 ? '' : 'none';\n}", "function SelectorGadget() {\n this.border_width = 5;\n this.border_padding = 2;\n this.b_top = null;\n this.b_left = null;\n this.b_right = null;\n this.b_bottom = null;\n this.selected = [];\n this.sg_div = null;\n this.unbound = false;\n// this.restricted_elements = jQuery.map(['html', 'body', 'head', 'base', 'table', 'ul', 'ol'], function(selector) {\n// return jQuery(selector).get(0);\n// });\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\", \"option\" );\n}", "function addSelCtgs() {\n // reset these properties couse after delete it is displayed 1st list\n optID = 0;\n slevel = 1;\n\n // if items in Root, shows 1st <select>, else, resets properties to initial value\n if(optHierarchy[0].length > 0) document.getElementById('n_sl'+slevel).innerHTML = getSelect(optHierarchy[0]);\n else {\n optHierarchy = {'0':[]};\n optData = {'0':{'value':'Root', 'content':'', 'parent':-1}};\n document.getElementById('n_sl'+slevel).innerHTML = '';\n }\n }", "function updateCustomSelects()\n {\n // Get rid of the customSelect <span> elements\n $(\"span.shs-select\", \".views-widget-filter-shs_term_node_tid_depth\").remove();\n\n // Reset the <select> elements (remove all customSelect styles and clases), then re-apply customSelect\n// 20140728 ISC-J 項目を翻訳する START\n// $(\"select.shs-select\", \"#edit-shs-term-node-tid-depth-wrapper\").removeClass(\"hasCustomSelect\").attr(\"style\", \"\").customSelect();\n $(\"select.shs-select\", \".views-widget-filter-shs_term_node_tid_depth\")\n .removeClass(\"hasCustomSelect\")\n .attr(\"style\", \"\")\n .customSelect();\n// 20140728 ISC-J 項目を翻訳する END\n }", "function selectArticulo()\n{\n var mi_obj = {\n campos : \"idArticulo, nombre\",\n table : \"articulo\",\n order : \"nombre\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='articulo']\" );\n}", "function get_natures_selector()\n { \n var natures_selector = $(\"#additional_nature_set-group\").find(\"select\").add(\"#id_primary_nature\") \n natures_selector.off(\"change\") // removes the existing change callbacks, as they would otherwise accumulate\n natures_selector.change({\"natures_selector\": natures_selector} , // dictionary forwarded into event.data\n function(event){ request_concept_specifics(event.data.natures_selector) } )\n return natures_selector\n }", "function activarSelectorDeElementosControl() {\n\n console.log(\"Activando SelectorDeElementosControl\");\n actualizarSelectorDeCapasConCapasExportalbles();\n $('#selectorCapaExportacion').dialog(\"open\");\n var capaSeleccionada = $(\"#capaSeleccionadaSelectorCapaExportacioin\").val();\n\n // como el control depende de la capa seleccionada lo creamos desde aqui...\n pasarSelectorDeElementosControlACapa(capaSeleccionada);\n capaSeleccion.removeAllFeatures();\n selectorDeElementosControl.activate();\n\n}", "columnSelector() {\n /** The drop down selector for the column of the csv data to use as the alternate column filter */\n this.altColSelect = document.createElement(\"select\")\n // the column names of the csv\n this.altColSelect.id = \"colname\"\n for (let colOption in this.paneOb.csvData) {\n //\n let option = document.createElement(\"option\")\n this.altColSelect.append(option)\n option.value = colOption\n option.innerHTML = colOption\n }\n this.holder.append(this.altColSelect)\n // on change, replace the other elements with new operation and selector\n // run it once to set options for default selection\n this.generateOperations()\n this.altColSelect.onchange = this.generateOperations.bind(this)\n\n }", "get selectors () {\n return _.extend(super.selectors, {\n node: '.arc',\n active: '.active',\n })\n }", "setup_selectors() {\n var block = this.block\n var _this = this\n this.res_type_changed($('#admin_user_access_control_resource_type'));\n block.on('change', '#admin_user_access_control_resource_type', function () {\n _this.res_type_changed($(this))\n })\n }", "function selectCliente()\n{\n var mi_obj = {\n campos : \"idCliente, nombre\",\n order : \"nombre\",\n table : \"cliente\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='cliente']\")\n}", "_findSelectors() {\n this._container = document.querySelector(this._settings.targetSelector);\n this._items = Array.from(\n document.querySelectorAll(`.${this._container.firstElementChild.className}`)\n );\n this._relatedSliders = this._settings.relatedSlidersSelectors\n .map(selector => document.querySelector(selector));\n this._leftControl = document.querySelector(this._settings.leftSelector);\n this._rightControl = document.querySelector(this._settings.rightSelector);\n }", "selectable() {\n return this.dropdown_content.querySelectorAll('[data-selectable]');\n }", "function listarImpresoras(){\n\n $(\"#selectImpresora\").html(\"\");\n navigator.notification.activityStart(\"Buscando impresoras...\", \"Por favor espere\");\n\n ImpresoraBixolonSPPR300ySPPR310.buscar((devices)=>{\n\n var lista = devices.map((device)=>{\n\n var id = device.MAC + \"_\" + device.Nombre;\n var texto = device.Nombre + \"(\" + device.MAC + \")\";\n\n $('#selectImpresora').append($('<option>', {\n value: id,\n text : texto\n }));\n\n });\n\n navigator.notification.activityStop();\n $('#selectImpresora').selectmenu('enable');\n $('#selectImpresora').selectmenu('refresh');\n\n });\n\n }", "function showSelectElements(docObj)\n{\n //var e = formObj.elements\n var e = docObj.forms[0].elements; // get the document form elements\n for(var i=0; i < e.length; i++)\n {\n // if select object\n var eType = e[i].type.substr(0,6);\n var eName = e[i].name;\n // the select objects\n if(eType.toUpperCase() == \"SELECT\" && eName.toUpperCase().indexOf(\"SEARCH\") == -1\n && eName.toUpperCase().indexOf(\"SRCH\") == -1)\n {\n e[i].style.visibility = 'visible';\n }\n }\n\n} // End function showSelectElements", "function show_facility_type_selector(ndx) {\n\n\n serviceSelectorDim = ndx.dimension(dc.pluck('type'));\n serviceSelectorGroup = serviceSelectorDim.group()\n dc.selectMenu(\"#service_type_selector\")\n .dimension(serviceSelectorDim)\n .group(serviceSelectorGroup)\n .promptText('All Sites');\n \n}", "function definisciCaricamentoSelectViaAjax() {\n $.each(selects, function(key, value) {\n value.data.forEach(function(val) {\n var fnc = caricaSelect.bind(undefined, $('#' + val.prefix + key + val.suffix), $('#' + val.prefix + value.figlioName + val.suffixFiglio),\n $('#' + val.prefix + value.nipoteName + val.suffixNipote), value.url, value.jsonName);\n $('#' + val.prefix + key + val.suffix).change(fnc).change();\n });\n });\n }", "makeSelector() {\n this.nodes.selector_wrapper = this.makeElement(\"div\", [\n this.makeClass(\"selector_wrapper\")\n ]);\n const selector = (this.nodes.selector = this.makeElement(\"select\", [\n this.makeClass(\"selector\")\n ]));\n this.nodes.selector_wrapper.appendChild(selector);\n for (let component of this.config.components) {\n const option = this.makeElement(\n \"option\",\n [this.makeClass(\"option\")],\n {\n value: component.name\n }\n );\n option.innerText = component.alias || component.name;\n this.nodes.options.push(option);\n selector.appendChild(option);\n }\n selector.value = this.data.component || this.config.components[0].name;\n selector.addEventListener(\"change\", event =>\n this.changeComponent(event.target)\n );\n this.changeComponent(selector);\n return this.nodes.selector_wrapper;\n }", "function Selector(selector) {\n this.elements = document.querySelectorAll('[data-widget-id=\"countries-autocomplete\"]');\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "function formmask() {\n $('.select .h').click(function (event) {\n s = $(this).parent();\n b = $(this).next();\n label = $(this).children('label');\n option = $(b).find('li');\n select = $('#' + $(s).attr('id').replace('select-', ''));\n if (!$(b).hasClass('on')) {\n $('.select').removeClass('on');\n $('.select .b').removeClass('on').slideUp('fast');\n $(b).addClass('on').slideDown('fast');\n $(s).addClass('on');\n }\n else {\n $(b).removeClass('on').slideUp('fast');\n $(s).removeClass('on');\n }\n $(option).click(function () {\n $(b).removeClass('on').slideUp('fast');\n $(label).html($(this).html());\n $(option).removeAttr('data-selected');\n $(this).attr('data-selected', 'on');\n $(select).val($(this).attr('data-value'));\n $(s).removeClass('on');\n });\n })\n $('.fmask.select').clickoutside(function () {\n fmask_select_close();\n });\n $(document).keydown(function (e) {\n if (e.keyCode == 27) {\n fmask_select_close();\n }\n });\n }", "function crearSelectBox(activaSelect) {\n var table = \"\";\n var conte = document.getElementById('ContenedorPrincipal');\n\n var element = conte.querySelectorAll('div[persist]');\n\n for (var i = 0; i < element.length; i++) {\n $('#' + element[i].id).dxSelectBox({\n dataSource: [\"\"],\n searchEnabled: true,\n placeholder: \"Seleciona\",\n });\n if (propSource || propSourceDetalle) {\n\n var keyDataSource;// = JSON.stringify(propSource[element[i].getAttribute('source')]);\n var keySrc;// = JSON.parse(keyDataSource);\n if (propSource[element[i].getAttribute('source')]) {\n keyDataSource = JSON.stringify(propSource[element[i].getAttribute('source')]);\n keySrc = JSON.parse(keyDataSource);\n } else if (propSourceDetalle[element[i].getAttribute('source')]) {\n keyDataSource = JSON.stringify(propSourceDetalle[element[i].getAttribute('source')]);\n keySrc = JSON.parse(keyDataSource);\n }\n if (keySrc[\"requerido\"]) {\n // sele.inputAttr({ required: keySrc[\"requerido\"] });\n $(\"#\" + element[i].id + \" input\").attr(\"required\", keySrc[\"requerido\"]);\n }\n if (keySrc[\"llave\"]) {\n //sele.inputAttr({ isKey: keySrc[\"llave\"] });\n $(\"#\" + element[i].id + \" input\").attr(\"isKey\", keySrc[\"llave\"]);\n // element.setAttribute(\"isKey\", keySrc[\"llave\"]);\n }\n //var datos = new Array();\n //if (keySrc[\"campo\"]) {\n // var campo = keySrc[\"campo\"].toString();\n // if (campo.includes(\"_ID\")) {\n // table = campo.replace(\"_ID\", \"\");\n // table = table.charAt(0).toUpperCase() + table.slice(1);\n // if (table === \"Empleado\") {\n // table = table + \"s\";\n // }\n // $(\"#\" + element[i].id + \" input\").attr(\"Table\", table);\n // var resultado = undefined;\n // if (keySrc[\"campo\"] !== \"periodosNomina_ID\" && keySrc[\"campo\"] !== \"concepNomDefi_ID\") {\n // resultado = searchAll(table);\n // }\n // if (resultado !== undefined && resultado.length > 0) {\n\n // var configCaptura = JSON.parse(keySrc['configuracionTipoCaptura']);\n // var valores = configCaptura['origenes'];\n // for (var j = 0; j < resultado.length; j++) {\n // if (campo === 'tipoNomina_ID' || campo === 'tipoCorrida_ID') {\n // if (valores['campovalor1'] !== \"\" && valores['campovalor2'] !== \"\") {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2[valores['campovalor1'] + valores['campovalor2']] = resultado[j][valores['campovalor1']] + \"-\" + resultado[j][valores['campovalor2']];\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: valores['campovalor1'] + valores['campovalor2'],\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // } else if (valores['campovalor1'] !== \"\") {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2[valores['campovalor1']] = resultado[j][valores['campovalor1']];\n\n // datos[i] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: valores['campovalor1'],\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // } else {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2['descripcion'] = resultado[j]['descripcion'];\n\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: \"descripcion\",\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // }\n // } else {\n // if (tabla === 'Empleados') {\n // if (valores['campovalor1'] !== \"\" && valores['campovalor2'] !== \"\") {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2[valores['campovalor1'] + valores['campovalor2']] = resultado[j][valores['campovalor1']] + \"-\" + resultado[j][valores['campovalor2']];\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: valores['campovalor1'] + valores['campovalor2'],\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // } else if (valores['campovalor1'] !== \"\") {\n // var datos2 = {};\n // datos2['id'] = resultado[i]['id'];\n // datos2[valores['campovalor1']] = resultado[j][valores['campovalor1']];\n\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: valores['campovalor1'],\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // } else {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2['nombre'] = resultado[j]['nombre'];\n\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: \"nombre\",\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // }\n\n // } else {\n\n // if (valores['campovalor1'] !== \"\" && valores['campovalor2'] !== \"\") {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2[valores['campovalor1'] + valores['campovalor2']] = resultado[j][valores['campovalor1']] + \"-\" + resultado[j][valores['campovalor2']];\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: valores['campovalor1'] + valores['campovalor2'],\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // } else if (valores['campovalor1'] !== \"\") {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2[valores['campovalor1']] = resultado[j][valores['campovalor1']];\n\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: valores['campovalor1'],\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // } else {\n // var datos2 = {};\n // datos2['id'] = resultado[j]['id'];\n // datos2['descripcion'] = resultado[j]['descripcion'];\n\n // datos[j] = datos2;\n // $('#' + element[i].id).dxSelectBox({\n // valueExpr: \"id\",\n // displayExpr: \"descripcion\",\n // valueChangeEvent: 'id',\n // searchEnabled: true\n\n // });\n // }\n\n // }\n // }\n // }\n // //console.log(element[i].getAttribute('Selector'));\n // if (element[i].getAttribute('Selector') === \"true\") {\n // $('#' + element[i].id).dxSelectBox({\n // dataSource: datos,\n // searchEnabled: true,\n // onValueChanged: function(e) {\n // busquedaFiltros(table, activaSelect);\n // }\n\n // });\n // } else {\n // $('#' + element[i].id).dxSelectBox({\n // dataSource: datos,\n // searchEnabled: true,\n // //onValueChanged: function (e) {\n // // busquedaFiltros(table, activaSelect);\n // //}\n\n // });\n // }\n // }\n // } else {\n // var configu = JSON.parse(keySrc['configuracionTipoCaptura']);\n // if (configu['tipoCaptura'] === \"2\") {\n // var valores = configu['lista'];\n // for (var j = 0; j < valores.length; j++) {\n // var datos2 = {};\n // datos2['id'] = valores[j];\n // datos2[valores[j]] = valores[j];\n\n // datos[j] = datos2;\n // // datos[i] = valores[i];\n // }\n // $('#' + element[i].id).dxSelectBox({\n // dataSource: datos,\n // searchEnabled: true,\n // valueExpr: \"id\",\n // valueChangeEvent: 'id'\n // //onValueChanged: function (e) {\n // // busquedaFiltros(table, activaSelect);\n // //}\n\n // });\n // } else if (configu['tipoCaptura'] === \"3\") {\n // var valores = configu['equivalencias'];\n // for (var key in valores) {\n // var datos2 = {};\n // datos2['id'] = key;\n // datos2[valores[key]] = valores[key];\n\n // //datos[j] = datos2;\n // datos[datos.length] = datos2;\n // }\n // }\n // $('#' + element[i].id).dxSelectBox({\n // dataSource: datos,\n // searchEnabled: true,\n // valueExpr: \"id\",\n // valueChangeEvent: 'id'\n // //onValueChanged: function (e) {\n // // busquedaFiltros(table, activaSelect);\n // //}\n\n // });\n\n // }\n\n //}\n\n }\n\n $(\"#\" + element[i].id + \" input\").attr(\"source\", element[i].getAttribute('source'));\n $(\"#\" + element[i].id + \" input\").attr(\"persist\", element[i].getAttribute('persist'));\n }\n\n\n\n}", "static get selectors() {\n return (0, _reselectTree.createNestedSelector)({\n ast: _selectors4.default,\n data: _selectors2.default,\n trace: _selectors6.default,\n evm: _selectors8.default,\n solidity: _selectors10.default,\n session: _selectors12.default,\n controller: _selectors14.default\n });\n }", "function generateSelectors(product) {\r\n\t var elements = product.options.map(function(option) {\r\n\t return '<select name=\"' + option.name + '\">' + option.values.map(function(value) {\r\n\t return '<option value=\"' + value + '\">' + value + '</option>';\r\n\t }) + '</select>';\r\n\t });\r\n\r\n\t return elements;\r\n\t }", "function selectArticulo()\n{\n var mi_obj = {\n campos : \"idArticulo, nombre\",\n table : \"articulo\",\n order : \"nombre\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='articulo']\", \"option\" );\n}", "function selectControlElements() {\n\t\t\teditor.on('click', function(e) {\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\n\t\t\t\t// WebKit can't even do simple things like selecting an image\n\t\t\t\t// Needs to be the setBaseAndExtend or it will fail to select floated images\n\t\t\t\tif (/^(IMG|HR)$/.test(target.nodeName)) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.getSel().setBaseAndExtent(target, 0, target, 1);\n\t\t\t\t\teditor.nodeChanged();\n\t\t\t\t}\n\n\t\t\t\tif (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.select(target);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function roboxSelector(mode)\n{\n var selector = $('#topDivSelector');\n \n selector.find('td').removeClass('selected');\n \n switch(mode) {\n case 'challenge':\tselector.find('td.selectorChallenges').addClass('selected'); break;\n case 'testing':\tselector.find('td.selectorTesting').addClass('selected'); break;\n case 'driving': selector.find('td.selectorDriving').addClass('selected'); break;\n case 'competition':\tselector.find('td.selectorDriving').addClass('selected'); break;\n }\n}", "setSelectorGroup(currentPathSet) {\n let allowGroupCreate = window.user.isEditor;\n html(this.host, \"\");\n currentPathSet.split(\"¬\").forEach((currentPath) => {\n let parent = c(null, \"DIV\", this.host);\n let pathSplit = currentPath.split(\"/\");\n let tree = index.groupTree(null, false); // exclude generated alpha groupings\n let clevel = tree;\n let groupSelectors = \"\";\n for (let i = 0; i < pathSplit.length || clevel && currentPath; i++) {\n if (i < pathSplit.length || clevel.keys.length > 0 || allowGroupCreate) {\n let selector = c(null, \"SELECT\", parent);\n selector.setAttribute(\"title\", i < pathSplit.length ? s(\"selectGroup\", \"Select group\") : s(\"putIntoSubgroup\", \"Put into a subgroup\"));\n {\n // First option in the menu\n let option = new Option(\"-\", \"\", false, i >= pathSplit.length);\n selector[selector.options.length] = option;\n }\n let keys = clevel.keys;\n let selectionFound = false;\n /*if (clevel.autoSubsKeys && clevel.autoSubsKeys.length > 0) {\n clevel.autoSubsKeys.forEach(ask => {\n let option = c(null, \"OPTION\", selector);\n option.setAttribute(\"value\", ask);\n html(option, ask);\n });\n } else*/ {\n keys.forEach(k => {\n let selected = i < pathSplit.length && k == pathSplit[i];\n selectionFound |= selected;\n if (k.length > 0) {\n let option = new Option(k, k, false, selected);\n selector[selector.options.length] = option;\n }\n });\n }\n if (!selectionFound && i < pathSplit.length && pathSplit[i]) {\n // New option only known in this instance\n let option = new Option(pathSplit[i], pathSplit[i], false, true);\n selector[selector.options.length] = option;\n }\n if (allowGroupCreate || i + 1 == pathSplit.length) {\n let option = new Option(`(${s('createNew', 'create new')})`, '(new)', false, false);\n selector[selector.options.length] = option;\n }\n }\n clevel = i < pathSplit.length ? clevel.subs[pathSplit[i]] : null;\n }\n });\n //if (allowGroupCreate) {\n // Add extra group control:\n let addGroupUi = c(null, \"DIV\", this.host);\n addGroupUi.style = \"position:absolute;top:0;right:4px;\";\n addGroupUi.title = s(\"addToMultipleGroups\", \"Add to multiple groups\");\n html(addGroupUi, \"+\");\n addGroupUi.addEventListener(\"click\", e => { this.setGroup(this.Path + \"¬\"); });\n //}\n }", "function setupSelector(episodeList){\n let episodeSelect = document.getElementById(\"episodeSelect\");\n episodeList.forEach(episode => {\n setSelectorEpisode(episode, episodeSelect);\n });\n}", "function selectControlElements() {\n\t\t\teditor.on('click', function(e) {\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\n\t\t\t\t// WebKit can't even do simple things like selecting an image\n\t\t\t\t// Needs to be the setBaseAndExtend or it will fail to select floated images\n\t\t\t\tif (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== \"false\") {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.getSel().setBaseAndExtent(target, 0, target, 1);\n\t\t\t\t\teditor.nodeChanged();\n\t\t\t\t}\n\n\t\t\t\tif (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.select(target);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function boxSelector(list,action)\n{\n action = (action == 'select') ? true : (action == 'unselect') ? false : action;\n for ( var i=0;i<list.length;i++ )\n {\n var group = 'bbDomUtil.getInputElementByName(\"'+list[i]+'\")';\n if ( typeof (group = eval(group)) != 'undefined' )\n {\n var j;\n if ( action == 'invert' )\n {\n for ( j=0;j<group.length;j++ )\n {\n group[j].checked = !group[j].checked;\n }\n }\n else\n {\n for ( j=0;j<group.length;j++ )\n {\n group[j].checked = action;\n }\n }\n }\n }\n}", "function OpenSelector(cmp) {\n var getBtnSelect = $(cmp).attr(\"functEdit\");\n var parSel = customSearchObject['customFunction'](getBtnSelect);\n createTableSelector(parSel);\n var exito = searchRanges(0, parSel);\n if (exito) {\n openSelectorTable(parSel);\n }\n}", "toggSel (c, i) {\r\n const O = this;\r\n let opt = null;\r\n if (typeof (i) === \"number\") {\r\n O.vRange(i);\r\n opt = O.E.find('option')[i];\r\n }\r\n else {\r\n opt = O.E.find(`option[value=\"${i}\"]`)[0] || 0;\r\n }\r\n if (!opt || opt.disabled)\r\n return;\r\n\r\n if (opt.selected !== c) {\r\n if ((settings.max && !opt.selected && O.selectedCount < settings.max) || opt.selected || (!settings.max && !opt.selected)) {\r\n opt.selected = c;\r\n if (!O.mob) $(opt).data('li').toggleClass('selected', c);\r\n\r\n O.callChange();\r\n O.setPstate();\r\n O.setText();\r\n O.selAllState();\r\n }\r\n }\r\n }", "function ponerDatosSelect(q,sel,t,nodes)\r\n{\r\n document.getElementById(q).innerHTML=t;\r\n var select = document.getElementById(sel);\r\n var result = nodes.iterateNext();\r\n i=0;\r\n while (result)\r\n {\r\n var option = document.createElement(\"option\");\r\n option.text = result.innerHTML;\r\n option.value=i; i++;\r\n select.add(option);\r\n result = nodes.iterateNext();\r\n } \r\n}", "function init_inpt_formulario_cargar_categoria_color() {\n var selectColor = mdc.select.MDCSelect.attachTo(document.querySelector('#slc-color'));\n\n selectColor.listen('MDCSelect:change', () => {\n var indexOfChild = selectColor.foundation_.selectedIndex_ + 1;\n var liSelected = $(\"#slc-color li[name='categoria-color']:nth-child(\" + indexOfChild + \")\");\n var divColor = liSelected.find(\"div:first\")[0];\n var color = $(divColor).attr(\"data-color\");\n\n $('#slc-color').find('li').attr('aria-selected', 'false');\n liSelected.attr('aria-selected', 'true');\n\n $(\"#slc-color\").css(\"background-color\", color);\n $(\"#slc-icono .mdc-select__selected-text i\").css(\"color\", color);\n });\n\n // color seleccionado\n var color_seleccionado = $('#slc-color').attr('data-color');\n var divColorSelected = $('#slc-color div[data-color=\"' + color_seleccionado + '\"]');\n divColorSelected.closest(\"li\").attr('aria-selected', 'true');\n selectColor.foundation_.selectedIndex_ = parseInt(divColorSelected.attr(\"data-index\"));\n selectColor.foundation_.adapter_.notifyChange();\n}", "function create_select () {\n var contenedor = $(self.container);\n // Div principal MySelect\n var div_principal = $('<div class=\"myselect container '+self.type+'\"></div>');\n div_principal.css({\n 'width': self.width,\n 'font-size': self.font_size,\n 'z-index':self.z_index,\n 'color':self.color,\n 'font-weight': self.font_weight\n });\n // Div de la caja de opciones\n var div_options_box = create_options_box();\n // Div de la caja de seleccion\n var div_select_box = create_select_box(div_principal, div_options_box);\n // Evento de contraer/expandir\n if (self.collapsable)\n div_select_box.on('click', function(){\n div_principal.toggleClass('active');\n div_options_box.stop();\n div_options_box.animate(toggle_animation(div_options_box),self.transition);\n });\n // Añadir las cajas al contenedor\n div_principal.append(div_select_box);\n div_principal.append(div_options_box);\n contenedor.append(div_principal);\n }", "function CargarColletIDs(){\n\n var sql = \"SELECT ID_Colecciones,Nombre FROM Colecciones\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n function querySuccess(tx, results) {\n var len = results.rows.length;\n for (var i=0; i<len; i++)\n $('#SelectorColecciones').append('<option value=\"' + results.rows.item(i).ID_Colecciones + '\">' + results.rows.item(i).Nombre + '</option>');\n\n }\n\n function errorCB(err) {\n alert(\"Error al rellenar selector de coleciones: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n\n}", "select(value) {\n\n \n let selectables = this.object_item(value).selectables;\n let selections = this.object_item(value).selections;\n\n\n\n if (selectables.length > 0) {\n\n selectables.addClass('OPTION-selected')\n .hide(1000);\n\n selections.addClass('OPTION-selected')\n .show(1000);\n\n this.object_item(value).options.prop('selected', true); // active selected original select\n\n // effacer class css SELECT-hover de cursur chaque changement\n this.$newSelect.find(this.elemsSelector).removeClass('SELECT-hover');\n\n\n\n\n if (this.options.keepOrder) { // order de position des item( asec or none)\n var selectionLiLast = this.$selectionUl.find('.OPTION-selected'); //les elements non hide =>show\n if ((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {\n selections.insertAfter(selectionLiLast.last());\n }\n }\n\n\n this.$originalSelect.trigger('change'); // start onchange de element original\n this.afterSelect(value);\n\n }\n }", "function selectCliente()\n{\n var mi_obj = {\n campos : \"idCliente, nombre\",\n order : \"nombre\",\n table : \"cliente\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='cliente']\", \"option\" );\n}", "function updateSelectors(type){\n\t\n\t//Steps to do:\n\t//\t1. Call the function based on the type.\n\t//\t2. Update the multi selects.\n\t\n\tif ('picks' == type){\n\t\tupdatePicksSelectors(type);\n\t}\n\telse if ('standings' == type){\n\t\tupdateStandingsSelectors(type);\n\t}\n\telse if ('divisionStandings' == type){\n\t\tupdateDivisionStandingsSelectors(type);\n\t}\n\telse if ('stats' == type){\n\t\tupdateStatsSelectors(type);\n\t}\n}", "function seleccionar_cantones(identificador){\n\t$(identificador).on('change', function(e){\n\t\t$('#id_canton option').remove();\n\t\t$('#id_canton').prop('disabled', true);\n\t\t$('#id_parroquia option').remove();\n\t\t$('#id_parroquia').append('<option>-- Seleccione --</option>')\n\t\t$('#id_parroquia').prop('disabled', true);\n\n\t\te.preventDefault();\n\t\tvar url = '/api/ciudades/select/';\n\t\tvar provincia = $(identificador + ' option:selected').text();\n\t\tvar ctx = {'provincia': provincia}\n\n\t\t$.get(url, ctx, function(data){\n\t\t\tconsole.log(data.cantones)\n\t\t\t$.each(data.cantones, function(index, element){\n\t\t\t\tconsole.log(element);\n\t\t\t\t$('#id_canton').prop('disabled', false);\n\t\t\t\t$('#id_canton').append(element.option)\n\t\t\t});\n\t\t});\n\t})\n}", "constructor() {\n this.construirSelect();\n }", "function LlenarListaProveedores(){\r\n cargarDatosProveedores();\r\n var selector =\"\";\r\n\r\n for (let index = 0; index < proveedores.length; index++ ){ \r\n selector += '<option value=' + proveedores[index].nombre + '>'+proveedores[index].nombre+'</option>';\r\n } \r\n document.getElementById(\"idProveedoresOrden\").innerHTML = selector;\r\n}", "function make_selector(settings) {\n\tvar dv = document.createElement(\"div\");\n\tif(settings.div_id) dv.id = settings.div_id;\n\tif(settings.div_class) dv.className = settings.div_class;\n\tif(settings.caption) {\n\t\tvar cap = document.createTextNode(settings.caption);\n\t\tdv.appendChild(cap);\n\t}\n\tvar sel = document.createElement(\"select\");\n\tif(settings.select_id) sel.id = settings.select_id;\n\tif(settings.dataindex) sel.dataindex = settings.dataindex;\n\tif(settings.onchange) {\n\t\tsel.onchange = settings.onchange;\n\t}\n\tfor(var i in settings.selector_options) {\n\t\tvar opt = document.createElement(\"option\");\n\t\topt.text = settings.selector_options[i][0];\n\t\topt.value = i;\n\t\tif(settings.default_option) {\n\t\t\tif(i==default_option) opt.selected = true;\n\t\t}\n\t\tsel.add(opt);\n\t}\n\tdv.appendChild(sel);\n\tif(settings.post_caption) {\n\t\tvar cap2 = document.createTextNode(settings.post_caption);\n\t\tdv.appendChild(cap2);\n\t}\n\tif(settings.attach_to_id) {\n\t\tdocument.getElementById(settings.attach_to_id).appendChild(dv);\n\t} else if(settings.attach_to_element) {\n\t\tdocument[settings.attach_to_element].appendChild(dv);\n\t}\n}", "function setShowSelector(){\n const allShows = getAllShows();\n allShows.sort(compare);\n let showSelect = document.getElementById(\"showsSelect\");\n allShows.forEach(show => {\n setSelectorShow(show, showSelect);\n });\n}", "function selectInterface(c) {\r\n // Because NGL is incredibly clutsy, we have to do this..\r\n\r\n let radius = 5.0;\r\n let selection = '';\r\n let neighborsE;\r\n let neighborsB;\r\n\r\n // neighbors of B belonging to A\r\n nglsele = new NGL.Selection(\":B\");\r\n neighborsB = c.structure.getAtomSetWithinSelection(nglsele, radius);\r\n neighborsB = c.structure.getAtomSetWithinGroup(neighborsB);\r\n selection += \"((\" + neighborsB.toSeleString() + \") and :A)\"\r\n\r\n nglsele = new NGL.Selection(\":A\");\r\n neighborsA = c.structure.getAtomSetWithinSelection(nglsele, radius);\r\n neighborsA = c.structure.getAtomSetWithinGroup(neighborsA);\r\n selection += \"or ((\" + neighborsA.toSeleString() + \") and :B)\"\r\n\r\n return selection\r\n\r\n}", "function initSelects() {\n $(\".mdc-select\").each(\n function() {\n const mdcSelect = new mdc.select.MDCSelect(this);\n $(this).data(\"mdcSelect\", mdcSelect);\n });\n}", "function set_selector(selector, selected) {\n\n clean();\n\n window.setSelector = selector;\n\n var element = iframe.find(get_foundable_query(selector, true, false, false));\n\n body.attr(\"data-clickable-select\", selector);\n\n if (iframe.find(\".yp-will-selected\").length > 0) {\n iframe.find(\".yp-will-selected\").trigger(\"mouseover\").trigger(\"click\");\n iframe.find(\".yp-will-selected\").removeClass(\"yp-will-selected\");\n } else if (selected !== null) {\n selected.trigger(\"mouseover\").trigger(\"click\");\n } else {\n element.filter(\":visible\").first().trigger(\"mouseover\").trigger(\"click\");\n }\n\n if (element.length > 1) {\n element.addClass(\"yp-selected-others\");\n get_selected_element().removeClass(\"yp-selected-others\");\n }\n\n body.addClass(\"yp-content-selected\");\n\n if ($(\".advanced-info-box\").css(\"display\") == 'block' && $(\".element-btn\").hasClass(\"active\")) {\n update_design_information(\"element\");\n }\n\n var tooltip = iframe.find(\".yp-selected-tooltip\");\n tooltip.html(\"<small class='yp-tooltip-small'>\" + iframe.find(\".yp-selected-tooltip small\").html() + \"</small> \" + selector);\n\n // Use native hover system\n if (selector.match(/:hover/g)) {\n\n body.addClass(\"yp-selector-hover\");\n body.attr(\"data-yp-selector\", \":hover\");\n $(\".yp-contextmenu-hover\").addClass(\"yp-active-contextmenu\");\n iframe.find(\".yp-selected-tooltip span\").remove();\n selector = selector.replace(/:hover/g, \"\");\n\n }\n\n // Use native focus system\n if (selector.match(/:focus/g)) {\n\n body.addClass(\"yp-selector-focus\");\n body.attr(\"data-yp-selector\", \":focus\");\n $(\".yp-contextmenu-focus\").addClass(\"yp-active-contextmenu\");\n iframe.find(\".yp-selected-tooltip span\").remove();\n selector = selector.replace(/:focus/g, \"\");\n\n }\n\n css_editor_toggle(true); // show if hide\n\n body.attr(\"data-clickable-select\", selector);\n\n insert_default_options();\n\n gui_update();\n\n draw();\n\n // Update the element informations.\n if ($(\".advanced-info-box\").css(\"display\") == 'block' && $(\".element-btn\").hasClass(\"active\")) {\n update_design_information(\"element\");\n }\n\n window.setSelector = false;\n\n }", "function createSelectors() {\n var selectors = {ids: {}, classes: {} };\n\n $.each(cfg.ids, function (key, value) {\n selectors.ids[key] = '#' + value;\n });\n $.each(cfg.classes, function (key, value) {\n selectors.classes[key] = '.' + value;\n });\n\n return selectors;\n }", "function datalistArticulo()\n{\n var mi_obj = {\n campos : \"idArticulo, nombre\",\n table : \"articulo\",\n order : \"nombre\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"[id='articulos']\", \"option\" );\n}", "function salary_type_selector(ndx){\n var salary_type_selector_dim = ndx.dimension(dc.pluck('Type'));\n var salary_type_selector_group = salary_type_selector_dim.group();\n\n dc.selectMenu(\".salary-type-selector\")\n .dimension(salary_type_selector_dim)\n .group(salary_type_selector_group);\n}", "function caricaElencoScritture() {\n var selectCausaleEP = $(\"#uidCausaleEP\");\n caricaElencoScrittureFromAction(\"_ottieniListaConti\", {\"causaleEP.uid\": selectCausaleEP.val()});\n }", "function selectorChange(obj,ruta,cargaSelect){\n\tcargaSelect.forEach(function(index){\n\t\tvar carga = index;\n\t\tvar valor = $(obj).val();\n\t\tvar _token = document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content');\n\t\tvar URLdomain = window.location.origin;\n\t\t$.ajax({\n\t\t\ttype:'POST',\n\t\t\turl:ruta,\n\t\t\tdata:{_token:_token, carga:carga, valor:valor},\n\t\t\theaders:{'Access-Control-Allow-Origin':URLdomain},\n\t\t\tsuccess:function(listado){\n\t\t\t\tcargaOptionsSelector(carga,listado);\n\t\t\t}\n\t\t});\n\t});\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "function selItem(c){\n CargarVentana('buscador4','Nuevo Usuario del Sistema','../../ccontrol/control/control.php?p1=MostrarPersona&idformula=&estado=nuevo&c='+c,'500','300',false,true,'',1,'',10,10,10,10);\n}", "function createOwnershipSelector(selection) {\n\n\tvar tptr = document.createElement(\"select\");\n\todef.forEach(function attachOption(info) {\n\t\tvar option = document.createElement(\"option\");\n\t\toption.value = info[0];\n\t\toption.text = info[1];\n\t\toption.selected = (selection == info[0]);\n\t\ttptr.appendChild(option);\n\t});\n\treturn tptr;\n}", "function request_concept_specifics(natures_selector)\n {\n var natures = []\n natures_selector.each(function(index, element)\n {\n if (element.value)\n {\n natures.push(element.value)\n }\n })\n $.ajax(\"/\" + window.collecster_app_name + \"/ajax/concept_admin_formsets/html/\",\n {\n data: $.param({ nature: natures }, true),\n success: div_replacer\n })\n }", "function getTypeFields(){\n let $selectfields = $('#cmb_fields');\n $selectfields.prop(\"disabled\", true);\n \n let _queryt = new QueryTask({\n url: __url_query\n }),\n _qparams = new Query();\n\n _qparams.where = '1<>1';\n _qparams.outFields = ['*'];\n _qparams.returnGeometry = false;\n _queryt.execute(_qparams).then(function (response) {\n __fields=response.fields;\n let nfields = response.fields.length,\n fields = response.fields,\n cmb = '<option value=\"\">--Elija un campo--</option>';\n for (let i = 0; i < nfields; i++) {\n let field = fields[i],\n fieldlabel = (field.alias).toUpperCase();\n\n if ($.inArray(field.name, Helper.getFieldsHide()) == -1) { // no poder los fields reservados\n if (field.type != 'oid'){\n cmb += `<option value=\"${field.name}\" data-typedata=${field.type}> ${fieldlabel}</option>`;\n }\n }\n\n }\n $('#cmb_fields').html(cmb);\n $('#btn_searchadvanced').addClass('visible').removeClass('notvisible');\n $selectfields.prop(\"disabled\", false);\n\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error: \"+ error);\n });\n }", "function generateSelector(config) {\n var defaultPrefixCls = config.prefixCls,\n OptionList = config.components.optionList,\n convertChildrenToData = config.convertChildrenToData,\n flattenOptions = config.flattenOptions,\n getLabeledValue = config.getLabeledValue,\n filterOptions = config.filterOptions,\n isValueDisabled = config.isValueDisabled,\n findValueOption = config.findValueOption,\n warningProps = config.warningProps,\n fillOptionsWithMissingValue = config.fillOptionsWithMissingValue,\n omitDOMProps = config.omitDOMProps; // Use raw define since `React.FC` not support generic\n\n function Select(props, ref) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls,\n className = props.className,\n id = props.id,\n open = props.open,\n defaultOpen = props.defaultOpen,\n options = props.options,\n children = props.children,\n mode = props.mode,\n value = props.value,\n defaultValue = props.defaultValue,\n labelInValue = props.labelInValue,\n showSearch = props.showSearch,\n inputValue = props.inputValue,\n searchValue = props.searchValue,\n filterOption = props.filterOption,\n filterSort = props.filterSort,\n _props$optionFilterPr = props.optionFilterProp,\n optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n onSearch = props.onSearch,\n allowClear = props.allowClear,\n clearIcon = props.clearIcon,\n showArrow = props.showArrow,\n inputIcon = props.inputIcon,\n menuItemSelectedIcon = props.menuItemSelectedIcon,\n disabled = props.disabled,\n loading = props.loading,\n defaultActiveFirstOption = props.defaultActiveFirstOption,\n _props$notFoundConten = props.notFoundContent,\n notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,\n optionLabelProp = props.optionLabelProp,\n backfill = props.backfill;\n props.tabIndex;\n var getInputElement = props.getInputElement,\n getRawInputElement = props.getRawInputElement,\n getPopupContainer = props.getPopupContainer,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n animation = props.animation,\n transitionName = props.transitionName,\n virtual = props.virtual,\n dropdownStyle = props.dropdownStyle,\n dropdownClassName = props.dropdownClassName,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n dropdownRender = props.dropdownRender,\n dropdownAlign = props.dropdownAlign,\n _props$showAction = props.showAction,\n showAction = _props$showAction === void 0 ? [] : _props$showAction,\n direction = props.direction,\n tokenSeparators = props.tokenSeparators,\n tagRender = props.tagRender,\n onPopupScroll = props.onPopupScroll,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onKeyUp = props.onKeyUp,\n onKeyDown = props.onKeyDown,\n onMouseDown = props.onMouseDown,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n onClear = props.onClear,\n _props$internalProps = props.internalProps,\n internalProps = _props$internalProps === void 0 ? {} : _props$internalProps,\n restProps = (0, _objectWithoutProperties2.default)(props, [\"prefixCls\", \"className\", \"id\", \"open\", \"defaultOpen\", \"options\", \"children\", \"mode\", \"value\", \"defaultValue\", \"labelInValue\", \"showSearch\", \"inputValue\", \"searchValue\", \"filterOption\", \"filterSort\", \"optionFilterProp\", \"autoClearSearchValue\", \"onSearch\", \"allowClear\", \"clearIcon\", \"showArrow\", \"inputIcon\", \"menuItemSelectedIcon\", \"disabled\", \"loading\", \"defaultActiveFirstOption\", \"notFoundContent\", \"optionLabelProp\", \"backfill\", \"tabIndex\", \"getInputElement\", \"getRawInputElement\", \"getPopupContainer\", \"listHeight\", \"listItemHeight\", \"animation\", \"transitionName\", \"virtual\", \"dropdownStyle\", \"dropdownClassName\", \"dropdownMatchSelectWidth\", \"dropdownRender\", \"dropdownAlign\", \"showAction\", \"direction\", \"tokenSeparators\", \"tagRender\", \"onPopupScroll\", \"onDropdownVisibleChange\", \"onFocus\", \"onBlur\", \"onKeyUp\", \"onKeyDown\", \"onMouseDown\", \"onChange\", \"onSelect\", \"onDeselect\", \"onClear\", \"internalProps\"]);\n var useInternalProps = internalProps.mark === INTERNAL_PROPS_MARK;\n var domProps = omitDOMProps ? omitDOMProps(restProps) : restProps;\n DEFAULT_OMIT_PROPS.forEach(function (prop) {\n delete domProps[prop];\n });\n var containerRef = (0, React.useRef)(null);\n var triggerRef = (0, React.useRef)(null);\n var selectorRef = (0, React.useRef)(null);\n var listRef = (0, React.useRef)(null);\n var tokenWithEnter = (0, React.useMemo)(function () {\n return (tokenSeparators || []).some(function (tokenSeparator) {\n return ['\\n', '\\r\\n'].includes(tokenSeparator);\n });\n }, [tokenSeparators]);\n /** Used for component focused management */\n\n var _useDelayReset = useDelayReset(),\n _useDelayReset2 = (0, _slicedToArray2.default)(_useDelayReset, 3),\n mockFocused = _useDelayReset2[0],\n setMockFocused = _useDelayReset2[1],\n cancelSetMockFocused = _useDelayReset2[2]; // Inner id for accessibility usage. Only work in client side\n\n\n var _useState = (0, React.useState)(),\n _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n innerId = _useState2[0],\n setInnerId = _useState2[1];\n\n (0, React.useEffect)(function () {\n setInnerId(\"rc_select_\".concat(getUUID$1()));\n }, []);\n var mergedId = id || innerId; // optionLabelProp\n\n var mergedOptionLabelProp = optionLabelProp;\n\n if (mergedOptionLabelProp === undefined) {\n mergedOptionLabelProp = options ? 'label' : 'children';\n } // labelInValue\n\n\n var mergedLabelInValue = mode === 'combobox' ? false : labelInValue;\n var isMultiple = mode === 'tags' || mode === 'multiple';\n var mergedShowSearch = showSearch !== undefined ? showSearch : isMultiple || mode === 'combobox'; // ======================== Mobile ========================\n\n var _useState3 = (0, React.useState)(false),\n _useState4 = (0, _slicedToArray2.default)(_useState3, 2),\n mobile = _useState4[0],\n setMobile = _useState4[1];\n\n (0, React.useEffect)(function () {\n // Only update on the client side\n setMobile(isMobile());\n }, []); // ============================== Ref ===============================\n\n var selectorDomRef = (0, React.useRef)(null);\n React.useImperativeHandle(ref, function () {\n var _selectorRef$current, _selectorRef$current2, _listRef$current;\n\n return {\n focus: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.focus,\n blur: (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur,\n scrollTo: (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo\n };\n }); // ============================= Value ==============================\n\n var _useMergedState = useControlledState(defaultValue, {\n value: value\n }),\n _useMergedState2 = (0, _slicedToArray2.default)(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setMergedValue = _useMergedState2[1];\n /** Unique raw values */\n\n\n var _useMemo = (0, React.useMemo)(function () {\n return toInnerValue(mergedValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [mergedValue, mergedLabelInValue]),\n _useMemo2 = (0, _slicedToArray2.default)(_useMemo, 2),\n mergedRawValue = _useMemo2[0],\n mergedValueMap = _useMemo2[1];\n /** We cache a set of raw values to speed up check */\n\n\n var rawValues = (0, React.useMemo)(function () {\n return new Set(mergedRawValue);\n }, [mergedRawValue]); // ============================= Option =============================\n // Set by option list active, it will merge into search input when mode is `combobox`\n\n var _useState5 = (0, React.useState)(null),\n _useState6 = (0, _slicedToArray2.default)(_useState5, 2),\n activeValue = _useState6[0],\n setActiveValue = _useState6[1];\n\n var _useState7 = (0, React.useState)(''),\n _useState8 = (0, _slicedToArray2.default)(_useState7, 2),\n innerSearchValue = _useState8[0],\n setInnerSearchValue = _useState8[1];\n\n var mergedSearchValue = innerSearchValue;\n\n if (mode === 'combobox' && mergedValue !== undefined) {\n mergedSearchValue = mergedValue;\n } else if (searchValue !== undefined) {\n mergedSearchValue = searchValue;\n } else if (inputValue) {\n mergedSearchValue = inputValue;\n }\n\n var mergedOptions = (0, React.useMemo)(function () {\n var newOptions = options;\n\n if (newOptions === undefined) {\n newOptions = convertChildrenToData(children);\n }\n /**\n * `tags` should fill un-list item.\n * This is not cool here since TreeSelect do not need this\n */\n\n\n if (mode === 'tags' && fillOptionsWithMissingValue) {\n newOptions = fillOptionsWithMissingValue(newOptions, mergedValue, mergedOptionLabelProp, labelInValue);\n }\n\n return newOptions || [];\n }, [options, children, mode, mergedValue]);\n var mergedFlattenOptions = (0, React.useMemo)(function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]);\n var getValueOption = useCacheOptions(mergedFlattenOptions); // Display options for OptionList\n\n var displayOptions = (0, React.useMemo)(function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return (0, _toConsumableArray2.default)(mergedOptions);\n }\n\n var filteredOptions = filterOptions(mergedSearchValue, mergedOptions, {\n optionFilterProp: optionFilterProp,\n filterOption: mode === 'combobox' && filterOption === undefined ? function () {\n return true;\n } : filterOption\n });\n\n if (mode === 'tags' && filteredOptions.every(function (opt) {\n return opt[optionFilterProp] !== mergedSearchValue;\n })) {\n filteredOptions.unshift({\n value: mergedSearchValue,\n label: mergedSearchValue,\n key: '__RC_SELECT_TAG_PLACEHOLDER__'\n });\n }\n\n if (filterSort && Array.isArray(filteredOptions)) {\n return (0, _toConsumableArray2.default)(filteredOptions).sort(filterSort);\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode, mergedShowSearch, filterSort]);\n var displayFlattenOptions = (0, React.useMemo)(function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n (0, React.useEffect)(function () {\n if (listRef.current && listRef.current.scrollTo) {\n listRef.current.scrollTo(0);\n }\n }, [mergedSearchValue]); // ============================ Selector ============================\n\n var displayValues = (0, React.useMemo)(function () {\n var tmpValues = mergedRawValue.map(function (val) {\n var valueOptions = getValueOption([val]);\n var displayValue = getLabeledValue(val, {\n options: valueOptions,\n prevValueMap: mergedValueMap,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n });\n return (0, _objectSpread5.default)((0, _objectSpread5.default)({}, displayValue), {}, {\n disabled: isValueDisabled(val, valueOptions)\n });\n });\n\n if (!mode && tmpValues.length === 1 && tmpValues[0].value === null && tmpValues[0].label === null) {\n return [];\n }\n\n return tmpValues;\n }, [mergedValue, mergedOptions, mode]); // Polyfill with cache label\n\n displayValues = useCacheDisplayValue(displayValues);\n\n var triggerSelect = function triggerSelect(newValue, isSelect, source) {\n var newValueOption = getValueOption([newValue]);\n var outOption = findValueOption([newValue], newValueOption)[0];\n\n if (!internalProps.skipTriggerSelect) {\n // Skip trigger `onSelect` or `onDeselect` if configured\n var selectValue = mergedLabelInValue ? getLabeledValue(newValue, {\n options: newValueOption,\n prevValueMap: mergedValueMap,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n }) : newValue;\n\n if (isSelect && onSelect) {\n onSelect(selectValue, outOption);\n } else if (!isSelect && onDeselect) {\n onDeselect(selectValue, outOption);\n }\n } // Trigger internal event\n\n\n if (useInternalProps) {\n if (isSelect && internalProps.onRawSelect) {\n internalProps.onRawSelect(newValue, outOption, source);\n } else if (!isSelect && internalProps.onRawDeselect) {\n internalProps.onRawDeselect(newValue, outOption, source);\n }\n }\n }; // We need cache options here in case user update the option list\n\n\n var _useState9 = (0, React.useState)([]),\n _useState10 = (0, _slicedToArray2.default)(_useState9, 2),\n prevValueOptions = _useState10[0],\n setPrevValueOptions = _useState10[1];\n\n var triggerChange = function triggerChange(newRawValues) {\n if (useInternalProps && internalProps.skipTriggerChange) {\n return;\n }\n\n var newRawValuesOptions = getValueOption(newRawValues);\n var outValues = toOuterValues(Array.from(newRawValues), {\n labelInValue: mergedLabelInValue,\n options: newRawValuesOptions,\n getLabeledValue: getLabeledValue,\n prevValueMap: mergedValueMap,\n optionLabelProp: mergedOptionLabelProp\n });\n var outValue = isMultiple ? outValues : outValues[0]; // Skip trigger if prev & current value is both empty\n\n if (onChange && (mergedRawValue.length !== 0 || outValues.length !== 0)) {\n var outOptions = findValueOption(newRawValues, newRawValuesOptions, {\n prevValueOptions: prevValueOptions\n }); // We will cache option in case it removed by ajax\n\n setPrevValueOptions(outOptions.map(function (option, index) {\n var clone = (0, _objectSpread5.default)({}, option);\n Object.defineProperty(clone, '_INTERNAL_OPTION_VALUE_', {\n get: function get() {\n return newRawValues[index];\n }\n });\n return clone;\n }));\n onChange(outValue, isMultiple ? outOptions : outOptions[0]);\n }\n\n setMergedValue(outValue);\n };\n\n var onInternalSelect = function onInternalSelect(newValue, _ref) {\n var selected = _ref.selected,\n source = _ref.source;\n\n if (disabled) {\n return;\n }\n\n var newRawValue;\n\n if (isMultiple) {\n newRawValue = new Set(mergedRawValue);\n\n if (selected) {\n newRawValue.add(newValue);\n } else {\n newRawValue.delete(newValue);\n }\n } else {\n newRawValue = new Set();\n newRawValue.add(newValue);\n } // Multiple always trigger change and single should change if value changed\n\n\n if (isMultiple || !isMultiple && Array.from(mergedRawValue)[0] !== newValue) {\n triggerChange(Array.from(newRawValue));\n } // Trigger `onSelect`. Single mode always trigger select\n\n\n triggerSelect(newValue, !isMultiple || selected, source); // Clean search value if single or configured\n\n if (mode === 'combobox') {\n setInnerSearchValue(String(newValue));\n setActiveValue('');\n } else if (!isMultiple || autoClearSearchValue) {\n setInnerSearchValue('');\n setActiveValue('');\n }\n };\n\n var onInternalOptionSelect = function onInternalOptionSelect(newValue, info) {\n onInternalSelect(newValue, (0, _objectSpread5.default)((0, _objectSpread5.default)({}, info), {}, {\n source: 'option'\n }));\n };\n\n var onInternalSelectionSelect = function onInternalSelectionSelect(newValue, info) {\n onInternalSelect(newValue, (0, _objectSpread5.default)((0, _objectSpread5.default)({}, info), {}, {\n source: 'selection'\n }));\n }; // ============================= Input ==============================\n // Only works in `combobox`\n\n\n var customizeInputElement = mode === 'combobox' && typeof getInputElement === 'function' && getInputElement() || null; // Used for customize replacement for `rc-cascader`\n\n var customizeRawInputElement = typeof getRawInputElement === 'function' && getRawInputElement(); // ============================== Open ==============================\n\n var _useMergedState3 = useControlledState(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState4 = (0, _slicedToArray2.default)(_useMergedState3, 2),\n innerOpen = _useMergedState4[0],\n setInnerOpen = _useMergedState4[1];\n\n var mergedOpen = innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty\n\n var emptyListContent = !notFoundContent && !displayOptions.length;\n\n if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {\n mergedOpen = false;\n }\n\n var triggerOpen = emptyListContent ? false : mergedOpen;\n\n var onToggleOpen = function onToggleOpen(newOpen) {\n var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;\n\n if (innerOpen !== nextOpen && !disabled) {\n setInnerOpen(nextOpen);\n\n if (onDropdownVisibleChange) {\n onDropdownVisibleChange(nextOpen);\n }\n }\n }; // Used for raw custom input trigger\n\n\n var onTriggerVisibleChange;\n\n if (customizeRawInputElement) {\n onTriggerVisibleChange = function onTriggerVisibleChange(newOpen) {\n onToggleOpen(newOpen);\n };\n }\n\n useSelectTriggerControl(function () {\n var _triggerRef$current;\n\n return [containerRef.current, (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getPopupElement()];\n }, triggerOpen, onToggleOpen); // ============================= Search =============================\n\n var triggerSearch = function triggerSearch(searchText, fromTyping, isCompositing) {\n var ret = true;\n var newSearchText = searchText;\n setActiveValue(null); // Check if match the `tokenSeparators`\n\n var patchLabels = isCompositing ? null : getSeparatedContent(searchText, tokenSeparators);\n var patchRawValues = patchLabels;\n\n if (mode === 'combobox') {\n // Only typing will trigger onChange\n if (fromTyping) {\n triggerChange([newSearchText]);\n }\n } else if (patchLabels) {\n newSearchText = '';\n\n if (mode !== 'tags') {\n patchRawValues = patchLabels.map(function (label) {\n var item = mergedFlattenOptions.find(function (_ref2) {\n var data = _ref2.data;\n return data[mergedOptionLabelProp] === label;\n });\n return item ? item.data.value : null;\n }).filter(function (val) {\n return val !== null;\n });\n }\n\n var newRawValues = Array.from(new Set([].concat((0, _toConsumableArray2.default)(mergedRawValue), (0, _toConsumableArray2.default)(patchRawValues))));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n }); // Should close when paste finish\n\n onToggleOpen(false); // Tell Selector that break next actions\n\n ret = false;\n }\n\n setInnerSearchValue(newSearchText);\n\n if (onSearch && mergedSearchValue !== newSearchText) {\n onSearch(newSearchText);\n }\n\n return ret;\n }; // Only triggered when menu is closed & mode is tags\n // If menu is open, OptionList will take charge\n // If mode isn't tags, press enter is not meaningful when you can't see any option\n\n\n var onSearchSubmit = function onSearchSubmit(searchText) {\n // prevent empty tags from appearing when you click the Enter button\n if (!searchText || !searchText.trim()) {\n return;\n }\n\n var newRawValues = Array.from(new Set([].concat((0, _toConsumableArray2.default)(mergedRawValue), [searchText])));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n });\n setInnerSearchValue('');\n }; // Close dropdown when disabled change\n\n\n (0, React.useEffect)(function () {\n if (innerOpen && !!disabled) {\n setInnerOpen(false);\n }\n }, [disabled]); // Close will clean up single mode search text\n\n (0, React.useEffect)(function () {\n if (!mergedOpen && !isMultiple && mode !== 'combobox') {\n triggerSearch('', false, false);\n }\n }, [mergedOpen]); // ============================ Keyboard ============================\n\n /**\n * We record input value here to check if can press to clean up by backspace\n * - null: Key is not down, this is reset by key up\n * - true: Search text is empty when first time backspace down\n * - false: Search text is not empty when first time backspace down\n */\n\n var _useLock = useLock(),\n _useLock2 = (0, _slicedToArray2.default)(_useLock, 2),\n getClearLock = _useLock2[0],\n setClearLock = _useLock2[1]; // KeyDown\n\n\n var onInternalKeyDown = function onInternalKeyDown(event) {\n var clearLock = getClearLock();\n var which = event.which;\n\n if (which === KeyCode.ENTER) {\n // Do not submit form when type in the input\n if (mode !== 'combobox') {\n event.preventDefault();\n } // We only manage open state here, close logic should handle by list component\n\n\n if (!mergedOpen) {\n onToggleOpen(true);\n }\n }\n\n setClearLock(!!mergedSearchValue); // Remove value by `backspace`\n\n if (which === KeyCode.BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = removeLastEnabledValue(displayValues, mergedRawValue);\n\n if (removeInfo.removedValue !== null) {\n triggerChange(removeInfo.values);\n triggerSelect(removeInfo.removedValue, false, 'input');\n }\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current2;\n\n (_listRef$current2 = listRef.current).onKeyDown.apply(_listRef$current2, [event].concat(rest));\n }\n\n if (onKeyDown) {\n onKeyDown.apply(void 0, [event].concat(rest));\n }\n }; // KeyUp\n\n\n var onInternalKeyUp = function onInternalKeyUp(event) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current3;\n\n (_listRef$current3 = listRef.current).onKeyUp.apply(_listRef$current3, [event].concat(rest));\n }\n\n if (onKeyUp) {\n onKeyUp.apply(void 0, [event].concat(rest));\n }\n }; // ========================== Focus / Blur ==========================\n\n /** Record real focus status */\n\n\n var focusRef = (0, React.useRef)(false);\n\n var onContainerFocus = function onContainerFocus() {\n setMockFocused(true);\n\n if (!disabled) {\n if (onFocus && !focusRef.current) {\n onFocus.apply(void 0, arguments);\n } // `showAction` should handle `focus` if set\n\n\n if (showAction.includes('focus')) {\n onToggleOpen(true);\n }\n }\n\n focusRef.current = true;\n };\n\n var onContainerBlur = function onContainerBlur() {\n setMockFocused(false, function () {\n focusRef.current = false;\n onToggleOpen(false);\n });\n\n if (disabled) {\n return;\n }\n\n if (mergedSearchValue) {\n // `tags` mode should move `searchValue` into values\n if (mode === 'tags') {\n triggerSearch('', false, false);\n triggerChange(Array.from(new Set([].concat((0, _toConsumableArray2.default)(mergedRawValue), [mergedSearchValue]))));\n } else if (mode === 'multiple') {\n // `multiple` mode only clean the search value but not trigger event\n setInnerSearchValue('');\n }\n }\n\n if (onBlur) {\n onBlur.apply(void 0, arguments);\n }\n };\n\n var activeTimeoutIds = [];\n (0, React.useEffect)(function () {\n return function () {\n activeTimeoutIds.forEach(function (timeoutId) {\n return clearTimeout(timeoutId);\n });\n activeTimeoutIds.splice(0, activeTimeoutIds.length);\n };\n }, []);\n\n var onInternalMouseDown = function onInternalMouseDown(event) {\n var _triggerRef$current2;\n\n var target = event.target;\n var popupElement = (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.getPopupElement(); // We should give focus back to selector if clicked item is not focusable\n\n if (popupElement && popupElement.contains(target)) {\n var timeoutId = setTimeout(function () {\n var index = activeTimeoutIds.indexOf(timeoutId);\n\n if (index !== -1) {\n activeTimeoutIds.splice(index, 1);\n }\n\n cancelSetMockFocused();\n\n if (!mobile && !popupElement.contains(document.activeElement)) {\n var _selectorRef$current3;\n\n (_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 ? void 0 : _selectorRef$current3.focus();\n }\n });\n activeTimeoutIds.push(timeoutId);\n }\n\n if (onMouseDown) {\n for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n restArgs[_key3 - 1] = arguments[_key3];\n }\n\n onMouseDown.apply(void 0, [event].concat(restArgs));\n }\n }; // ========================= Accessibility ==========================\n\n\n var _useState11 = (0, React.useState)(0),\n _useState12 = (0, _slicedToArray2.default)(_useState11, 2),\n accessibilityIndex = _useState12[0],\n setAccessibilityIndex = _useState12[1];\n\n var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n\n var onActiveValue = function onActiveValue(active, index) {\n var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n _ref3$source = _ref3.source,\n source = _ref3$source === void 0 ? 'keyboard' : _ref3$source;\n\n setAccessibilityIndex(index);\n\n if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {\n setActiveValue(String(active));\n }\n }; // ============================= Popup ==============================\n\n\n var _useState13 = (0, React.useState)(null),\n _useState14 = (0, _slicedToArray2.default)(_useState13, 2),\n containerWidth = _useState14[0],\n setContainerWidth = _useState14[1];\n\n var _useState15 = (0, React.useState)({}),\n _useState16 = (0, _slicedToArray2.default)(_useState15, 2),\n forceUpdate = _useState16[1]; // We need force update here since popup dom is render async\n\n\n function onPopupMouseEnter() {\n forceUpdate({});\n }\n\n useLayoutEffect(function () {\n if (triggerOpen) {\n var _containerRef$current;\n\n var newWidth = Math.ceil((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth);\n\n if (containerWidth !== newWidth && !Number.isNaN(newWidth)) {\n setContainerWidth(newWidth);\n }\n }\n }, [triggerOpen]);\n var popupNode = /*#__PURE__*/React.createElement(OptionList, {\n ref: listRef,\n prefixCls: prefixCls,\n id: mergedId,\n open: mergedOpen,\n childrenAsData: !options,\n options: displayOptions,\n flattenOptions: displayFlattenOptions,\n multiple: isMultiple,\n values: rawValues,\n height: listHeight,\n itemHeight: listItemHeight,\n onSelect: onInternalOptionSelect,\n onToggleOpen: onToggleOpen,\n onActiveValue: onActiveValue,\n defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n notFoundContent: notFoundContent,\n onScroll: onPopupScroll,\n searchValue: mergedSearchValue,\n menuItemSelectedIcon: menuItemSelectedIcon,\n virtual: virtual !== false && dropdownMatchSelectWidth !== false,\n onMouseEnter: onPopupMouseEnter\n }); // ============================= Clear ==============================\n\n var clearNode;\n\n var onClearMouseDown = function onClearMouseDown() {\n // Trigger internal `onClear` event\n if (useInternalProps && internalProps.onClear) {\n internalProps.onClear();\n }\n\n if (onClear) {\n onClear();\n }\n\n triggerChange([]);\n triggerSearch('', false, false);\n };\n\n if (!disabled && allowClear && (mergedRawValue.length || mergedSearchValue)) {\n clearNode = /*#__PURE__*/React.createElement(TransBtn, {\n className: \"\".concat(prefixCls, \"-clear\"),\n onMouseDown: onClearMouseDown,\n customizeIcon: clearIcon\n }, \"\\xD7\");\n } // ============================= Arrow ==============================\n\n\n var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !isMultiple && mode !== 'combobox';\n var arrowNode;\n\n if (mergedShowArrow) {\n arrowNode = /*#__PURE__*/React.createElement(TransBtn, {\n className: (0, _classnames2.default)(\"\".concat(prefixCls, \"-arrow\"), (0, _defineProperty2.default)({}, \"\".concat(prefixCls, \"-arrow-loading\"), loading)),\n customizeIcon: inputIcon,\n customizeIconProps: {\n loading: loading,\n searchValue: mergedSearchValue,\n open: mergedOpen,\n focused: mockFocused,\n showSearch: mergedShowSearch\n }\n });\n } // ============================ Warning =============================\n\n\n if (process.env.NODE_ENV !== 'production' && warningProps) {\n warningProps(props);\n } // ============================= Render =============================\n\n\n var mergedClassName = (0, _classnames2.default)(prefixCls, className, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n var selectorNode = /*#__PURE__*/React.createElement(RefSelectTrigger, {\n ref: triggerRef,\n disabled: disabled,\n prefixCls: prefixCls,\n visible: triggerOpen,\n popupElement: popupNode,\n containerWidth: containerWidth,\n animation: animation,\n transitionName: transitionName,\n dropdownStyle: dropdownStyle,\n dropdownClassName: dropdownClassName,\n direction: direction,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n dropdownRender: dropdownRender,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n empty: !mergedOptions.length,\n getTriggerDOMNode: function getTriggerDOMNode() {\n return selectorDomRef.current;\n },\n onPopupVisibleChange: onTriggerVisibleChange\n }, customizeRawInputElement ? /*#__PURE__*/React.cloneElement(customizeRawInputElement, {\n ref: composeRef$2(selectorDomRef, customizeRawInputElement.props.ref)\n }) : /*#__PURE__*/React.createElement(ForwardSelector, (0, _extends3.default)({}, props, {\n domRef: selectorDomRef,\n prefixCls: prefixCls,\n inputElement: customizeInputElement,\n ref: selectorRef,\n id: mergedId,\n showSearch: mergedShowSearch,\n mode: mode,\n accessibilityIndex: accessibilityIndex,\n multiple: isMultiple,\n tagRender: tagRender,\n values: displayValues,\n open: mergedOpen,\n onToggleOpen: onToggleOpen,\n searchValue: mergedSearchValue,\n activeValue: activeValue,\n onSearch: triggerSearch,\n onSearchSubmit: onSearchSubmit,\n onSelect: onInternalSelectionSelect,\n tokenWithEnter: tokenWithEnter\n }))); // Render raw\n\n if (customizeRawInputElement) {\n return selectorNode;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", (0, _extends3.default)({\n className: mergedClassName\n }, domProps, {\n ref: containerRef,\n onMouseDown: onInternalMouseDown,\n onKeyDown: onInternalKeyDown,\n onKeyUp: onInternalKeyUp,\n onFocus: onContainerFocus,\n onBlur: onContainerBlur\n }), mockFocused && !mergedOpen && /*#__PURE__*/React.createElement(\"span\", {\n style: {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0\n },\n \"aria-live\": \"polite\"\n }, \"\".concat(mergedRawValue.join(', '))), selectorNode, arrowNode, clearNode);\n }\n\n var RefSelect = /*#__PURE__*/React.forwardRef(Select);\n return RefSelect;\n}", "function generateSelector(config) {\n var defaultPrefixCls = config.prefixCls,\n OptionList = config.components.optionList,\n convertChildrenToData = config.convertChildrenToData,\n flattenOptions = config.flattenOptions,\n getLabeledValue = config.getLabeledValue,\n filterOptions = config.filterOptions,\n isValueDisabled = config.isValueDisabled,\n findValueOption = config.findValueOption,\n warningProps = config.warningProps,\n fillOptionsWithMissingValue = config.fillOptionsWithMissingValue,\n omitDOMProps = config.omitDOMProps; // Use raw define since `React.FC` not support generic\n\n function Select(props, ref) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls,\n className = props.className,\n id = props.id,\n open = props.open,\n defaultOpen = props.defaultOpen,\n options = props.options,\n children = props.children,\n mode = props.mode,\n value = props.value,\n defaultValue = props.defaultValue,\n labelInValue = props.labelInValue,\n showSearch = props.showSearch,\n inputValue = props.inputValue,\n searchValue = props.searchValue,\n filterOption = props.filterOption,\n filterSort = props.filterSort,\n _props$optionFilterPr = props.optionFilterProp,\n optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n onSearch = props.onSearch,\n allowClear = props.allowClear,\n clearIcon = props.clearIcon,\n showArrow = props.showArrow,\n inputIcon = props.inputIcon,\n menuItemSelectedIcon = props.menuItemSelectedIcon,\n disabled = props.disabled,\n loading = props.loading,\n defaultActiveFirstOption = props.defaultActiveFirstOption,\n _props$notFoundConten = props.notFoundContent,\n notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,\n optionLabelProp = props.optionLabelProp,\n backfill = props.backfill,\n tabIndex = props.tabIndex,\n getInputElement = props.getInputElement,\n getPopupContainer = props.getPopupContainer,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n animation = props.animation,\n transitionName = props.transitionName,\n virtual = props.virtual,\n dropdownStyle = props.dropdownStyle,\n dropdownClassName = props.dropdownClassName,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n dropdownRender = props.dropdownRender,\n dropdownAlign = props.dropdownAlign,\n _props$showAction = props.showAction,\n showAction = _props$showAction === void 0 ? [] : _props$showAction,\n direction = props.direction,\n tokenSeparators = props.tokenSeparators,\n tagRender = props.tagRender,\n onPopupScroll = props.onPopupScroll,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onKeyUp = props.onKeyUp,\n onKeyDown = props.onKeyDown,\n onMouseDown = props.onMouseDown,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n onClear = props.onClear,\n _props$internalProps = props.internalProps,\n internalProps = _props$internalProps === void 0 ? {} : _props$internalProps,\n restProps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_objectWithoutProperties__[\"a\" /* default */])(props, [\"prefixCls\", \"className\", \"id\", \"open\", \"defaultOpen\", \"options\", \"children\", \"mode\", \"value\", \"defaultValue\", \"labelInValue\", \"showSearch\", \"inputValue\", \"searchValue\", \"filterOption\", \"filterSort\", \"optionFilterProp\", \"autoClearSearchValue\", \"onSearch\", \"allowClear\", \"clearIcon\", \"showArrow\", \"inputIcon\", \"menuItemSelectedIcon\", \"disabled\", \"loading\", \"defaultActiveFirstOption\", \"notFoundContent\", \"optionLabelProp\", \"backfill\", \"tabIndex\", \"getInputElement\", \"getPopupContainer\", \"listHeight\", \"listItemHeight\", \"animation\", \"transitionName\", \"virtual\", \"dropdownStyle\", \"dropdownClassName\", \"dropdownMatchSelectWidth\", \"dropdownRender\", \"dropdownAlign\", \"showAction\", \"direction\", \"tokenSeparators\", \"tagRender\", \"onPopupScroll\", \"onDropdownVisibleChange\", \"onFocus\", \"onBlur\", \"onKeyUp\", \"onKeyDown\", \"onMouseDown\", \"onChange\", \"onSelect\", \"onDeselect\", \"onClear\", \"internalProps\"]);\n\n var useInternalProps = internalProps.mark === __WEBPACK_IMPORTED_MODULE_13__interface_generator__[\"a\" /* INTERNAL_PROPS_MARK */];\n var domProps = omitDOMProps ? omitDOMProps(restProps) : restProps;\n DEFAULT_OMIT_PROPS.forEach(function (prop) {\n delete domProps[prop];\n });\n var containerRef = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var triggerRef = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var selectorRef = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var listRef = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n var tokenWithEnter = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return (tokenSeparators || []).some(function (tokenSeparator) {\n return ['\\n', '\\r\\n'].includes(tokenSeparator);\n });\n }, [tokenSeparators]);\n /** Used for component focused management */\n\n var _useDelayReset = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_17__hooks_useDelayReset__[\"a\" /* default */])(),\n _useDelayReset2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useDelayReset, 3),\n mockFocused = _useDelayReset2[0],\n setMockFocused = _useDelayReset2[1],\n cancelSetMockFocused = _useDelayReset2[2]; // Inner id for accessibility usage. Only work in client side\n\n\n var _useState = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(),\n _useState2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState, 2),\n innerId = _useState2[0],\n setInnerId = _useState2[1];\n\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n setInnerId(\"rc_select_\".concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__utils_commonUtil__[\"b\" /* getUUID */])()));\n }, []);\n var mergedId = id || innerId; // optionLabelProp\n\n var mergedOptionLabelProp = optionLabelProp;\n\n if (mergedOptionLabelProp === undefined) {\n mergedOptionLabelProp = options ? 'label' : 'children';\n } // labelInValue\n\n\n var mergedLabelInValue = mode === 'combobox' ? false : labelInValue;\n var isMultiple = mode === 'tags' || mode === 'multiple';\n var mergedShowSearch = showSearch !== undefined ? showSearch : isMultiple || mode === 'combobox'; // ======================== Mobile ========================\n\n var _useState3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(false),\n _useState4 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState3, 2),\n mobile = _useState4[0],\n setMobile = _useState4[1];\n\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n // Only update on the client side\n setMobile(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_rc_util_es_isMobile__[\"a\" /* default */])());\n }, []); // ============================== Ref ===============================\n\n var selectorDomRef = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(null);\n __WEBPACK_IMPORTED_MODULE_6_react__[\"useImperativeHandle\"](ref, function () {\n var _selectorRef$current, _selectorRef$current2, _listRef$current;\n\n return {\n focus: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.focus,\n blur: (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur,\n scrollTo: (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo\n };\n }); // ============================= Value ==============================\n\n var _useMergedState = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_hooks_useMergedState__[\"a\" /* default */])(defaultValue, {\n value: value\n }),\n _useMergedState2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setMergedValue = _useMergedState2[1];\n /** Unique raw values */\n\n\n var _useMemo = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__utils_commonUtil__[\"c\" /* toInnerValue */])(mergedValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [mergedValue, mergedLabelInValue]),\n _useMemo2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useMemo, 2),\n mergedRawValue = _useMemo2[0],\n mergedValueMap = _useMemo2[1];\n /** We cache a set of raw values to speed up check */\n\n\n var rawValues = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return new Set(mergedRawValue);\n }, [mergedRawValue]); // ============================= Option =============================\n // Set by option list active, it will merge into search input when mode is `combobox`\n\n var _useState5 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(null),\n _useState6 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState5, 2),\n activeValue = _useState6[0],\n setActiveValue = _useState6[1];\n\n var _useState7 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(''),\n _useState8 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState7, 2),\n innerSearchValue = _useState8[0],\n setInnerSearchValue = _useState8[1];\n\n var mergedSearchValue = innerSearchValue;\n\n if (mode === 'combobox' && mergedValue !== undefined) {\n mergedSearchValue = mergedValue;\n } else if (searchValue !== undefined) {\n mergedSearchValue = searchValue;\n } else if (inputValue) {\n mergedSearchValue = inputValue;\n }\n\n var mergedOptions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n var newOptions = options;\n\n if (newOptions === undefined) {\n newOptions = convertChildrenToData(children);\n }\n /**\n * `tags` should fill un-list item.\n * This is not cool here since TreeSelect do not need this\n */\n\n\n if (mode === 'tags' && fillOptionsWithMissingValue) {\n newOptions = fillOptionsWithMissingValue(newOptions, mergedValue, mergedOptionLabelProp, labelInValue);\n }\n\n return newOptions || [];\n }, [options, children, mode, mergedValue]);\n var mergedFlattenOptions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]);\n var getValueOption = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_22__hooks_useCacheOptions__[\"a\" /* default */])(mergedFlattenOptions); // Display options for OptionList\n\n var displayOptions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(mergedOptions);\n }\n\n var filteredOptions = filterOptions(mergedSearchValue, mergedOptions, {\n optionFilterProp: optionFilterProp,\n filterOption: mode === 'combobox' && filterOption === undefined ? function () {\n return true;\n } : filterOption\n });\n\n if (mode === 'tags' && filteredOptions.every(function (opt) {\n return opt[optionFilterProp] !== mergedSearchValue;\n })) {\n filteredOptions.unshift({\n value: mergedSearchValue,\n label: mergedSearchValue,\n key: '__RC_SELECT_TAG_PLACEHOLDER__'\n });\n }\n\n if (filterSort && Array.isArray(filteredOptions)) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(filteredOptions).sort(filterSort);\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode, mergedShowSearch, filterSort]);\n var displayFlattenOptions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n if (listRef.current && listRef.current.scrollTo) {\n listRef.current.scrollTo(0);\n }\n }, [mergedSearchValue]); // ============================ Selector ============================\n\n var displayValues = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useMemo\"])(function () {\n var tmpValues = mergedRawValue.map(function (val) {\n var valueOptions = getValueOption([val]);\n var displayValue = getLabeledValue(val, {\n options: valueOptions,\n prevValueMap: mergedValueMap,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n });\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])({}, displayValue), {}, {\n disabled: isValueDisabled(val, valueOptions)\n });\n });\n\n if (!mode && tmpValues.length === 1 && tmpValues[0].value === null && tmpValues[0].label === null) {\n return [];\n }\n\n return tmpValues;\n }, [mergedValue, mergedOptions, mode]); // Polyfill with cache label\n\n displayValues = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__hooks_useCacheDisplayValue__[\"a\" /* default */])(displayValues);\n\n var triggerSelect = function triggerSelect(newValue, isSelect, source) {\n var newValueOption = getValueOption([newValue]);\n var outOption = findValueOption([newValue], newValueOption)[0];\n\n if (!internalProps.skipTriggerSelect) {\n // Skip trigger `onSelect` or `onDeselect` if configured\n var selectValue = mergedLabelInValue ? getLabeledValue(newValue, {\n options: newValueOption,\n prevValueMap: mergedValueMap,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n }) : newValue;\n\n if (isSelect && onSelect) {\n onSelect(selectValue, outOption);\n } else if (!isSelect && onDeselect) {\n onDeselect(selectValue, outOption);\n }\n } // Trigger internal event\n\n\n if (useInternalProps) {\n if (isSelect && internalProps.onRawSelect) {\n internalProps.onRawSelect(newValue, outOption, source);\n } else if (!isSelect && internalProps.onRawDeselect) {\n internalProps.onRawDeselect(newValue, outOption, source);\n }\n }\n }; // We need cache options here in case user update the option list\n\n\n var _useState9 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])([]),\n _useState10 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState9, 2),\n prevValueOptions = _useState10[0],\n setPrevValueOptions = _useState10[1];\n\n var triggerChange = function triggerChange(newRawValues) {\n if (useInternalProps && internalProps.skipTriggerChange) {\n return;\n }\n\n var newRawValuesOptions = getValueOption(newRawValues);\n var outValues = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__utils_commonUtil__[\"d\" /* toOuterValues */])(Array.from(newRawValues), {\n labelInValue: mergedLabelInValue,\n options: newRawValuesOptions,\n getLabeledValue: getLabeledValue,\n prevValueMap: mergedValueMap,\n optionLabelProp: mergedOptionLabelProp\n });\n var outValue = isMultiple ? outValues : outValues[0]; // Skip trigger if prev & current value is both empty\n\n if (onChange && (mergedRawValue.length !== 0 || outValues.length !== 0)) {\n var outOptions = findValueOption(newRawValues, newRawValuesOptions, {\n prevValueOptions: prevValueOptions\n }); // We will cache option in case it removed by ajax\n\n setPrevValueOptions(outOptions.map(function (option, index) {\n var clone = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])({}, option);\n\n Object.defineProperty(clone, '_INTERNAL_OPTION_VALUE_', {\n get: function get() {\n return newRawValues[index];\n }\n });\n return clone;\n }));\n onChange(outValue, isMultiple ? outOptions : outOptions[0]);\n }\n\n setMergedValue(outValue);\n };\n\n var onInternalSelect = function onInternalSelect(newValue, _ref) {\n var selected = _ref.selected,\n source = _ref.source;\n\n if (disabled) {\n return;\n }\n\n var newRawValue;\n\n if (isMultiple) {\n newRawValue = new Set(mergedRawValue);\n\n if (selected) {\n newRawValue.add(newValue);\n } else {\n newRawValue.delete(newValue);\n }\n } else {\n newRawValue = new Set();\n newRawValue.add(newValue);\n } // Multiple always trigger change and single should change if value changed\n\n\n if (isMultiple || !isMultiple && Array.from(mergedRawValue)[0] !== newValue) {\n triggerChange(Array.from(newRawValue));\n } // Trigger `onSelect`. Single mode always trigger select\n\n\n triggerSelect(newValue, !isMultiple || selected, source); // Clean search value if single or configured\n\n if (mode === 'combobox') {\n setInnerSearchValue(String(newValue));\n setActiveValue('');\n } else if (!isMultiple || autoClearSearchValue) {\n setInnerSearchValue('');\n setActiveValue('');\n }\n };\n\n var onInternalOptionSelect = function onInternalOptionSelect(newValue, info) {\n onInternalSelect(newValue, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])({}, info), {}, {\n source: 'option'\n }));\n };\n\n var onInternalSelectionSelect = function onInternalSelectionSelect(newValue, info) {\n onInternalSelect(newValue, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_objectSpread2__[\"a\" /* default */])({}, info), {}, {\n source: 'selection'\n }));\n }; // ============================= Input ==============================\n // Only works in `combobox`\n\n\n var customizeInputElement = mode === 'combobox' && getInputElement && getInputElement() || null; // ============================== Open ==============================\n\n var _useMergedState3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_hooks_useMergedState__[\"a\" /* default */])(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState4 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useMergedState3, 2),\n innerOpen = _useMergedState4[0],\n setInnerOpen = _useMergedState4[1];\n\n var mergedOpen = innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty\n\n var emptyListContent = !notFoundContent && !displayOptions.length;\n\n if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {\n mergedOpen = false;\n }\n\n var triggerOpen = emptyListContent ? false : mergedOpen;\n\n var onToggleOpen = function onToggleOpen(newOpen) {\n var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;\n\n if (innerOpen !== nextOpen && !disabled) {\n setInnerOpen(nextOpen);\n\n if (onDropdownVisibleChange) {\n onDropdownVisibleChange(nextOpen);\n }\n }\n };\n\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__hooks_useSelectTriggerControl__[\"a\" /* default */])([containerRef.current, triggerRef.current && triggerRef.current.getPopupElement()], triggerOpen, onToggleOpen); // ============================= Search =============================\n\n var triggerSearch = function triggerSearch(searchText, fromTyping, isCompositing) {\n var ret = true;\n var newSearchText = searchText;\n setActiveValue(null); // Check if match the `tokenSeparators`\n\n var patchLabels = isCompositing ? null : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_19__utils_valueUtil__[\"b\" /* getSeparatedContent */])(searchText, tokenSeparators);\n var patchRawValues = patchLabels;\n\n if (mode === 'combobox') {\n // Only typing will trigger onChange\n if (fromTyping) {\n triggerChange([newSearchText]);\n }\n } else if (patchLabels) {\n newSearchText = '';\n\n if (mode !== 'tags') {\n patchRawValues = patchLabels.map(function (label) {\n var item = mergedFlattenOptions.find(function (_ref2) {\n var data = _ref2.data;\n return data[mergedOptionLabelProp] === label;\n });\n return item ? item.data.value : null;\n }).filter(function (val) {\n return val !== null;\n });\n }\n\n var newRawValues = Array.from(new Set([].concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(mergedRawValue), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(patchRawValues))));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n }); // Should close when paste finish\n\n onToggleOpen(false); // Tell Selector that break next actions\n\n ret = false;\n }\n\n setInnerSearchValue(newSearchText);\n\n if (onSearch && mergedSearchValue !== newSearchText) {\n onSearch(newSearchText);\n }\n\n return ret;\n }; // Only triggered when menu is closed & mode is tags\n // If menu is open, OptionList will take charge\n // If mode isn't tags, press enter is not meaningful when you can't see any option\n\n\n var onSearchSubmit = function onSearchSubmit(searchText) {\n // prevent empty tags from appearing when you click the Enter button\n if (!searchText || !searchText.trim()) {\n return;\n }\n\n var newRawValues = Array.from(new Set([].concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(mergedRawValue), [searchText])));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n });\n setInnerSearchValue('');\n }; // Close dropdown when disabled change\n\n\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n if (innerOpen && !!disabled) {\n setInnerOpen(false);\n }\n }, [disabled]); // Close will clean up single mode search text\n\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n if (!mergedOpen && !isMultiple && mode !== 'combobox') {\n triggerSearch('', false, false);\n }\n }, [mergedOpen]); // ============================ Keyboard ============================\n\n /**\n * We record input value here to check if can press to clean up by backspace\n * - null: Key is not down, this is reset by key up\n * - true: Search text is empty when first time backspace down\n * - false: Search text is not empty when first time backspace down\n */\n\n var _useLock = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__hooks_useLock__[\"a\" /* default */])(),\n _useLock2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useLock, 2),\n getClearLock = _useLock2[0],\n setClearLock = _useLock2[1]; // KeyDown\n\n\n var onInternalKeyDown = function onInternalKeyDown(event) {\n var clearLock = getClearLock();\n var which = event.which;\n\n if (which === __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__[\"a\" /* default */].ENTER) {\n // Do not submit form when type in the input\n if (mode !== 'combobox') {\n event.preventDefault();\n } // We only manage open state here, close logic should handle by list component\n\n\n if (!mergedOpen) {\n onToggleOpen(true);\n }\n }\n\n setClearLock(!!mergedSearchValue); // Remove value by `backspace`\n\n if (which === __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__[\"a\" /* default */].BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__utils_commonUtil__[\"e\" /* removeLastEnabledValue */])(displayValues, mergedRawValue);\n\n if (removeInfo.removedValue !== null) {\n triggerChange(removeInfo.values);\n triggerSelect(removeInfo.removedValue, false, 'input');\n }\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current2;\n\n (_listRef$current2 = listRef.current).onKeyDown.apply(_listRef$current2, [event].concat(rest));\n }\n\n if (onKeyDown) {\n onKeyDown.apply(void 0, [event].concat(rest));\n }\n }; // KeyUp\n\n\n var onInternalKeyUp = function onInternalKeyUp(event) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current3;\n\n (_listRef$current3 = listRef.current).onKeyUp.apply(_listRef$current3, [event].concat(rest));\n }\n\n if (onKeyUp) {\n onKeyUp.apply(void 0, [event].concat(rest));\n }\n }; // ========================== Focus / Blur ==========================\n\n /** Record real focus status */\n\n\n var focusRef = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useRef\"])(false);\n\n var onContainerFocus = function onContainerFocus() {\n setMockFocused(true);\n\n if (!disabled) {\n if (onFocus && !focusRef.current) {\n onFocus.apply(void 0, arguments);\n } // `showAction` should handle `focus` if set\n\n\n if (showAction.includes('focus')) {\n onToggleOpen(true);\n }\n }\n\n focusRef.current = true;\n };\n\n var onContainerBlur = function onContainerBlur() {\n setMockFocused(false, function () {\n focusRef.current = false;\n onToggleOpen(false);\n });\n\n if (disabled) {\n return;\n }\n\n if (mergedSearchValue) {\n // `tags` mode should move `searchValue` into values\n if (mode === 'tags') {\n triggerSearch('', false, false);\n triggerChange(Array.from(new Set([].concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_toConsumableArray__[\"a\" /* default */])(mergedRawValue), [mergedSearchValue]))));\n } else if (mode === 'multiple') {\n // `multiple` mode only clean the search value but not trigger event\n setInnerSearchValue('');\n }\n }\n\n if (onBlur) {\n onBlur.apply(void 0, arguments);\n }\n };\n\n var activeTimeoutIds = [];\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useEffect\"])(function () {\n return function () {\n activeTimeoutIds.forEach(function (timeoutId) {\n return clearTimeout(timeoutId);\n });\n activeTimeoutIds.splice(0, activeTimeoutIds.length);\n };\n }, []);\n\n var onInternalMouseDown = function onInternalMouseDown(event) {\n var target = event.target;\n var popupElement = triggerRef.current && triggerRef.current.getPopupElement(); // We should give focus back to selector if clicked item is not focusable\n\n if (popupElement && popupElement.contains(target)) {\n var timeoutId = setTimeout(function () {\n var index = activeTimeoutIds.indexOf(timeoutId);\n\n if (index !== -1) {\n activeTimeoutIds.splice(index, 1);\n }\n\n cancelSetMockFocused();\n\n if (!mobile && !popupElement.contains(document.activeElement)) {\n var _selectorRef$current3;\n\n (_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 ? void 0 : _selectorRef$current3.focus();\n }\n });\n activeTimeoutIds.push(timeoutId);\n }\n\n if (onMouseDown) {\n for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n restArgs[_key3 - 1] = arguments[_key3];\n }\n\n onMouseDown.apply(void 0, [event].concat(restArgs));\n }\n }; // ========================= Accessibility ==========================\n\n\n var _useState11 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(0),\n _useState12 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState11, 2),\n accessibilityIndex = _useState12[0],\n setAccessibilityIndex = _useState12[1];\n\n var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n\n var onActiveValue = function onActiveValue(active, index) {\n var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n _ref3$source = _ref3.source,\n source = _ref3$source === void 0 ? 'keyboard' : _ref3$source;\n\n setAccessibilityIndex(index);\n\n if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {\n setActiveValue(String(active));\n }\n }; // ============================= Popup ==============================\n\n\n var _useState13 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])(null),\n _useState14 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState13, 2),\n containerWidth = _useState14[0],\n setContainerWidth = _useState14[1];\n\n var _useState15 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react__[\"useState\"])({}),\n _useState16 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_slicedToArray__[\"a\" /* default */])(_useState15, 2),\n forceUpdate = _useState16[1]; // We need force update here since popup dom is render async\n\n\n function onPopupMouseEnter() {\n forceUpdate({});\n }\n\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_18__hooks_useLayoutEffect__[\"a\" /* default */])(function () {\n if (triggerOpen) {\n var newWidth = Math.ceil(containerRef.current.offsetWidth);\n\n if (containerWidth !== newWidth) {\n setContainerWidth(newWidth);\n }\n }\n }, [triggerOpen]);\n var popupNode = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](OptionList, {\n ref: listRef,\n prefixCls: prefixCls,\n id: mergedId,\n open: mergedOpen,\n childrenAsData: !options,\n options: displayOptions,\n flattenOptions: displayFlattenOptions,\n multiple: isMultiple,\n values: rawValues,\n height: listHeight,\n itemHeight: listItemHeight,\n onSelect: onInternalOptionSelect,\n onToggleOpen: onToggleOpen,\n onActiveValue: onActiveValue,\n defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n notFoundContent: notFoundContent,\n onScroll: onPopupScroll,\n searchValue: mergedSearchValue,\n menuItemSelectedIcon: menuItemSelectedIcon,\n virtual: virtual !== false && dropdownMatchSelectWidth !== false,\n onMouseEnter: onPopupMouseEnter\n }); // ============================= Clear ==============================\n\n var clearNode;\n\n var onClearMouseDown = function onClearMouseDown() {\n // Trigger internal `onClear` event\n if (useInternalProps && internalProps.onClear) {\n internalProps.onClear();\n }\n\n if (onClear) {\n onClear();\n }\n\n triggerChange([]);\n triggerSearch('', false, false);\n };\n\n if (!disabled && allowClear && (mergedRawValue.length || mergedSearchValue)) {\n clearNode = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_15__TransBtn__[\"a\" /* default */], {\n className: \"\".concat(prefixCls, \"-clear\"),\n onMouseDown: onClearMouseDown,\n customizeIcon: clearIcon\n }, \"\\xD7\");\n } // ============================= Arrow ==============================\n\n\n var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !isMultiple && mode !== 'combobox';\n var arrowNode;\n\n if (mergedShowArrow) {\n arrowNode = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_15__TransBtn__[\"a\" /* default */], {\n className: __WEBPACK_IMPORTED_MODULE_9_classnames___default()(\"\".concat(prefixCls, \"-arrow\"), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])({}, \"\".concat(prefixCls, \"-arrow-loading\"), loading)),\n customizeIcon: inputIcon,\n customizeIconProps: {\n loading: loading,\n searchValue: mergedSearchValue,\n open: mergedOpen,\n focused: mockFocused,\n showSearch: mergedShowSearch\n }\n });\n } // ============================ Warning =============================\n\n\n if (process.env.NODE_ENV !== 'production' && warningProps) {\n warningProps(props);\n } // ============================= Render =============================\n\n\n var mergedClassName = __WEBPACK_IMPORTED_MODULE_9_classnames___default()(prefixCls, className, (_classNames2 = {}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n return /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](\"div\", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n className: mergedClassName\n }, domProps, {\n ref: containerRef,\n onMouseDown: onInternalMouseDown,\n onKeyDown: onInternalKeyDown,\n onKeyUp: onInternalKeyUp,\n onFocus: onContainerFocus,\n onBlur: onContainerBlur\n }), mockFocused && !mergedOpen && /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](\"span\", {\n style: {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0\n },\n \"aria-live\": \"polite\"\n }, \"\".concat(mergedRawValue.join(', '))), /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_12__SelectTrigger__[\"a\" /* default */], {\n ref: triggerRef,\n disabled: disabled,\n prefixCls: prefixCls,\n visible: triggerOpen,\n popupElement: popupNode,\n containerWidth: containerWidth,\n animation: animation,\n transitionName: transitionName,\n dropdownStyle: dropdownStyle,\n dropdownClassName: dropdownClassName,\n direction: direction,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n dropdownRender: dropdownRender,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n empty: !mergedOptions.length,\n getTriggerDOMNode: function getTriggerDOMNode() {\n return selectorDomRef.current;\n }\n }, /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"](__WEBPACK_IMPORTED_MODULE_11__Selector__[\"a\" /* default */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({}, props, {\n domRef: selectorDomRef,\n prefixCls: prefixCls,\n inputElement: customizeInputElement,\n ref: selectorRef,\n id: mergedId,\n showSearch: mergedShowSearch,\n mode: mode,\n accessibilityIndex: accessibilityIndex,\n multiple: isMultiple,\n tagRender: tagRender,\n values: displayValues,\n open: mergedOpen,\n onToggleOpen: onToggleOpen,\n searchValue: mergedSearchValue,\n activeValue: activeValue,\n onSearch: triggerSearch,\n onSearchSubmit: onSearchSubmit,\n onSelect: onInternalSelectionSelect,\n tokenWithEnter: tokenWithEnter\n }))), arrowNode, clearNode);\n }\n\n var RefSelect = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_6_react__[\"forwardRef\"](Select);\n return RefSelect;\n}", "function generateSelector(config) {\n var defaultPrefixCls = config.prefixCls,\n OptionList = config.components.optionList,\n convertChildrenToData = config.convertChildrenToData,\n flattenOptions = config.flattenOptions,\n getLabeledValue = config.getLabeledValue,\n filterOptions = config.filterOptions,\n isValueDisabled = config.isValueDisabled,\n findValueOption = config.findValueOption,\n warningProps = config.warningProps,\n fillOptionsWithMissingValue = config.fillOptionsWithMissingValue,\n omitDOMProps = config.omitDOMProps; // Use raw define since `React.FC` not support generic\n\n function Select(props, ref) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls,\n className = props.className,\n id = props.id,\n open = props.open,\n defaultOpen = props.defaultOpen,\n options = props.options,\n children = props.children,\n mode = props.mode,\n value = props.value,\n defaultValue = props.defaultValue,\n labelInValue = props.labelInValue,\n showSearch = props.showSearch,\n inputValue = props.inputValue,\n searchValue = props.searchValue,\n filterOption = props.filterOption,\n filterSort = props.filterSort,\n _props$optionFilterPr = props.optionFilterProp,\n optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n onSearch = props.onSearch,\n allowClear = props.allowClear,\n clearIcon = props.clearIcon,\n showArrow = props.showArrow,\n inputIcon = props.inputIcon,\n menuItemSelectedIcon = props.menuItemSelectedIcon,\n disabled = props.disabled,\n loading = props.loading,\n defaultActiveFirstOption = props.defaultActiveFirstOption,\n _props$notFoundConten = props.notFoundContent,\n notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,\n optionLabelProp = props.optionLabelProp,\n backfill = props.backfill,\n tabIndex = props.tabIndex,\n getInputElement = props.getInputElement,\n getPopupContainer = props.getPopupContainer,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n animation = props.animation,\n transitionName = props.transitionName,\n virtual = props.virtual,\n dropdownStyle = props.dropdownStyle,\n dropdownClassName = props.dropdownClassName,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n dropdownRender = props.dropdownRender,\n dropdownAlign = props.dropdownAlign,\n _props$showAction = props.showAction,\n showAction = _props$showAction === void 0 ? [] : _props$showAction,\n direction = props.direction,\n tokenSeparators = props.tokenSeparators,\n tagRender = props.tagRender,\n onPopupScroll = props.onPopupScroll,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onKeyUp = props.onKeyUp,\n onKeyDown = props.onKeyDown,\n onMouseDown = props.onMouseDown,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n onClear = props.onClear,\n _props$internalProps = props.internalProps,\n internalProps = _props$internalProps === void 0 ? {} : _props$internalProps,\n restProps = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__.default)(props, [\"prefixCls\", \"className\", \"id\", \"open\", \"defaultOpen\", \"options\", \"children\", \"mode\", \"value\", \"defaultValue\", \"labelInValue\", \"showSearch\", \"inputValue\", \"searchValue\", \"filterOption\", \"filterSort\", \"optionFilterProp\", \"autoClearSearchValue\", \"onSearch\", \"allowClear\", \"clearIcon\", \"showArrow\", \"inputIcon\", \"menuItemSelectedIcon\", \"disabled\", \"loading\", \"defaultActiveFirstOption\", \"notFoundContent\", \"optionLabelProp\", \"backfill\", \"tabIndex\", \"getInputElement\", \"getPopupContainer\", \"listHeight\", \"listItemHeight\", \"animation\", \"transitionName\", \"virtual\", \"dropdownStyle\", \"dropdownClassName\", \"dropdownMatchSelectWidth\", \"dropdownRender\", \"dropdownAlign\", \"showAction\", \"direction\", \"tokenSeparators\", \"tagRender\", \"onPopupScroll\", \"onDropdownVisibleChange\", \"onFocus\", \"onBlur\", \"onKeyUp\", \"onKeyDown\", \"onMouseDown\", \"onChange\", \"onSelect\", \"onDeselect\", \"onClear\", \"internalProps\"]);\n\n var useInternalProps = internalProps.mark === _interface_generator__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_PROPS_MARK;\n var domProps = omitDOMProps ? omitDOMProps(restProps) : restProps;\n DEFAULT_OMIT_PROPS.forEach(function (prop) {\n delete domProps[prop];\n });\n var containerRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(null);\n var triggerRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(null);\n var selectorRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(null);\n var listRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(null);\n var tokenWithEnter = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n return (tokenSeparators || []).some(function (tokenSeparator) {\n return ['\\n', '\\r\\n'].includes(tokenSeparator);\n });\n }, [tokenSeparators]);\n /** Used for component focused management */\n\n var _useDelayReset = (0,_hooks_useDelayReset__WEBPACK_IMPORTED_MODULE_15__.default)(),\n _useDelayReset2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useDelayReset, 3),\n mockFocused = _useDelayReset2[0],\n setMockFocused = _useDelayReset2[1],\n cancelSetMockFocused = _useDelayReset2[2]; // Inner id for accessibility usage. Only work in client side\n\n\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(),\n _useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useState, 2),\n innerId = _useState2[0],\n setInnerId = _useState2[1];\n\n (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n setInnerId(\"rc_select_\".concat((0,_utils_commonUtil__WEBPACK_IMPORTED_MODULE_12__.getUUID)()));\n }, []);\n var mergedId = id || innerId; // optionLabelProp\n\n var mergedOptionLabelProp = optionLabelProp;\n\n if (mergedOptionLabelProp === undefined) {\n mergedOptionLabelProp = options ? 'label' : 'children';\n } // labelInValue\n\n\n var mergedLabelInValue = mode === 'combobox' ? false : labelInValue;\n var isMultiple = mode === 'tags' || mode === 'multiple';\n var mergedShowSearch = showSearch !== undefined ? showSearch : isMultiple || mode === 'combobox'; // ============================== Ref ===============================\n\n var selectorDomRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(null);\n react__WEBPACK_IMPORTED_MODULE_5__.useImperativeHandle(ref, function () {\n var _listRef$current;\n\n return {\n focus: selectorRef.current.focus,\n blur: selectorRef.current.blur,\n scrollTo: (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo\n };\n }); // ============================= Value ==============================\n\n var _useMergedState = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_8__.default)(defaultValue, {\n value: value\n }),\n _useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setMergedValue = _useMergedState2[1];\n /** Unique raw values */\n\n\n var _useMemo = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n return (0,_utils_commonUtil__WEBPACK_IMPORTED_MODULE_12__.toInnerValue)(mergedValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [mergedValue, mergedLabelInValue]),\n _useMemo2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useMemo, 2),\n mergedRawValue = _useMemo2[0],\n mergedValueMap = _useMemo2[1];\n /** We cache a set of raw values to speed up check */\n\n\n var rawValues = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n return new Set(mergedRawValue);\n }, [mergedRawValue]); // ============================= Option =============================\n // Set by option list active, it will merge into search input when mode is `combobox`\n\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(null),\n _useState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useState3, 2),\n activeValue = _useState4[0],\n setActiveValue = _useState4[1];\n\n var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(''),\n _useState6 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useState5, 2),\n innerSearchValue = _useState6[0],\n setInnerSearchValue = _useState6[1];\n\n var mergedSearchValue = innerSearchValue;\n\n if (mode === 'combobox' && mergedValue !== undefined) {\n mergedSearchValue = mergedValue;\n } else if (searchValue !== undefined) {\n mergedSearchValue = searchValue;\n } else if (inputValue) {\n mergedSearchValue = inputValue;\n }\n\n var mergedOptions = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n var newOptions = options;\n\n if (newOptions === undefined) {\n newOptions = convertChildrenToData(children);\n }\n /**\n * `tags` should fill un-list item.\n * This is not cool here since TreeSelect do not need this\n */\n\n\n if (mode === 'tags' && fillOptionsWithMissingValue) {\n newOptions = fillOptionsWithMissingValue(newOptions, mergedValue, mergedOptionLabelProp, labelInValue);\n }\n\n return newOptions || [];\n }, [options, children, mode, mergedValue]);\n var mergedFlattenOptions = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]);\n var getValueOption = (0,_hooks_useCacheOptions__WEBPACK_IMPORTED_MODULE_20__.default)(mergedFlattenOptions); // Display options for OptionList\n\n var displayOptions = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__.default)(mergedOptions);\n }\n\n var filteredOptions = filterOptions(mergedSearchValue, mergedOptions, {\n optionFilterProp: optionFilterProp,\n filterOption: mode === 'combobox' && filterOption === undefined ? function () {\n return true;\n } : filterOption\n });\n\n if (mode === 'tags' && filteredOptions.every(function (opt) {\n return opt[optionFilterProp] !== mergedSearchValue;\n })) {\n filteredOptions.unshift({\n value: mergedSearchValue,\n label: mergedSearchValue,\n key: '__RC_SELECT_TAG_PLACEHOLDER__'\n });\n }\n\n if (filterSort && Array.isArray(filteredOptions)) {\n return (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__.default)(filteredOptions).sort(filterSort);\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode, mergedShowSearch, filterSort]);\n var displayFlattenOptions = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n if (listRef.current && listRef.current.scrollTo) {\n listRef.current.scrollTo(0);\n }\n }, [mergedSearchValue]); // ============================ Selector ============================\n\n var displayValues = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n var tmpValues = mergedRawValue.map(function (val) {\n var valueOptions = getValueOption([val]);\n var displayValue = getLabeledValue(val, {\n options: valueOptions,\n prevValueMap: mergedValueMap,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n });\n return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.default)({}, displayValue), {}, {\n disabled: isValueDisabled(val, valueOptions)\n });\n });\n\n if (!mode && tmpValues.length === 1 && tmpValues[0].value === null && tmpValues[0].label === null) {\n return [];\n }\n\n return tmpValues;\n }, [mergedValue, mergedOptions, mode]); // Polyfill with cache label\n\n displayValues = (0,_hooks_useCacheDisplayValue__WEBPACK_IMPORTED_MODULE_19__.default)(displayValues);\n\n var triggerSelect = function triggerSelect(newValue, isSelect, source) {\n var newValueOption = getValueOption([newValue]);\n var outOption = findValueOption([newValue], newValueOption)[0];\n\n if (!internalProps.skipTriggerSelect) {\n // Skip trigger `onSelect` or `onDeselect` if configured\n var selectValue = mergedLabelInValue ? getLabeledValue(newValue, {\n options: newValueOption,\n prevValueMap: mergedValueMap,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n }) : newValue;\n\n if (isSelect && onSelect) {\n onSelect(selectValue, outOption);\n } else if (!isSelect && onDeselect) {\n onDeselect(selectValue, outOption);\n }\n } // Trigger internal event\n\n\n if (useInternalProps) {\n if (isSelect && internalProps.onRawSelect) {\n internalProps.onRawSelect(newValue, outOption, source);\n } else if (!isSelect && internalProps.onRawDeselect) {\n internalProps.onRawDeselect(newValue, outOption, source);\n }\n }\n }; // We need cache options here in case user update the option list\n\n\n var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)([]),\n _useState8 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useState7, 2),\n prevValueOptions = _useState8[0],\n setPrevValueOptions = _useState8[1];\n\n var triggerChange = function triggerChange(newRawValues) {\n if (useInternalProps && internalProps.skipTriggerChange) {\n return;\n }\n\n var newRawValuesOptions = getValueOption(newRawValues);\n var outValues = (0,_utils_commonUtil__WEBPACK_IMPORTED_MODULE_12__.toOuterValues)(Array.from(newRawValues), {\n labelInValue: mergedLabelInValue,\n options: newRawValuesOptions,\n getLabeledValue: getLabeledValue,\n prevValueMap: mergedValueMap,\n optionLabelProp: mergedOptionLabelProp\n });\n var outValue = isMultiple ? outValues : outValues[0]; // Skip trigger if prev & current value is both empty\n\n if (onChange && (mergedRawValue.length !== 0 || outValues.length !== 0)) {\n var outOptions = findValueOption(newRawValues, newRawValuesOptions, {\n prevValueOptions: prevValueOptions\n }); // We will cache option in case it removed by ajax\n\n setPrevValueOptions(outOptions.map(function (option, index) {\n var clone = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.default)({}, option);\n\n Object.defineProperty(clone, '_INTERNAL_OPTION_VALUE_', {\n get: function get() {\n return newRawValues[index];\n }\n });\n return clone;\n }));\n onChange(outValue, isMultiple ? outOptions : outOptions[0]);\n }\n\n setMergedValue(outValue);\n };\n\n var onInternalSelect = function onInternalSelect(newValue, _ref) {\n var selected = _ref.selected,\n source = _ref.source;\n\n if (disabled) {\n return;\n }\n\n var newRawValue;\n\n if (isMultiple) {\n newRawValue = new Set(mergedRawValue);\n\n if (selected) {\n newRawValue.add(newValue);\n } else {\n newRawValue.delete(newValue);\n }\n } else {\n newRawValue = new Set();\n newRawValue.add(newValue);\n } // Multiple always trigger change and single should change if value changed\n\n\n if (isMultiple || !isMultiple && Array.from(mergedRawValue)[0] !== newValue) {\n triggerChange(Array.from(newRawValue));\n } // Trigger `onSelect`. Single mode always trigger select\n\n\n triggerSelect(newValue, !isMultiple || selected, source); // Clean search value if single or configured\n\n if (mode === 'combobox') {\n setInnerSearchValue(String(newValue));\n setActiveValue('');\n } else if (!isMultiple || autoClearSearchValue) {\n setInnerSearchValue('');\n setActiveValue('');\n }\n };\n\n var onInternalOptionSelect = function onInternalOptionSelect(newValue, info) {\n onInternalSelect(newValue, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.default)({}, info), {}, {\n source: 'option'\n }));\n };\n\n var onInternalSelectionSelect = function onInternalSelectionSelect(newValue, info) {\n onInternalSelect(newValue, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.default)({}, info), {}, {\n source: 'selection'\n }));\n }; // ============================= Input ==============================\n // Only works in `combobox`\n\n\n var customizeInputElement = mode === 'combobox' && getInputElement && getInputElement() || null; // ============================== Open ==============================\n\n var _useMergedState3 = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_8__.default)(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useMergedState3, 2),\n innerOpen = _useMergedState4[0],\n setInnerOpen = _useMergedState4[1];\n\n var mergedOpen = innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty\n\n var emptyListContent = !notFoundContent && !displayOptions.length;\n\n if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {\n mergedOpen = false;\n }\n\n var triggerOpen = emptyListContent ? false : mergedOpen;\n\n var onToggleOpen = function onToggleOpen(newOpen) {\n var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;\n\n if (innerOpen !== nextOpen && !disabled) {\n setInnerOpen(nextOpen);\n\n if (onDropdownVisibleChange) {\n onDropdownVisibleChange(nextOpen);\n }\n }\n };\n\n (0,_hooks_useSelectTriggerControl__WEBPACK_IMPORTED_MODULE_18__.default)([containerRef.current, triggerRef.current && triggerRef.current.getPopupElement()], triggerOpen, onToggleOpen); // ============================= Search =============================\n\n var triggerSearch = function triggerSearch(searchText, fromTyping, isCompositing) {\n var ret = true;\n var newSearchText = searchText;\n setActiveValue(null); // Check if match the `tokenSeparators`\n\n var patchLabels = isCompositing ? null : (0,_utils_valueUtil__WEBPACK_IMPORTED_MODULE_17__.getSeparatedContent)(searchText, tokenSeparators);\n var patchRawValues = patchLabels;\n\n if (mode === 'combobox') {\n // Only typing will trigger onChange\n if (fromTyping) {\n triggerChange([newSearchText]);\n }\n } else if (patchLabels) {\n newSearchText = '';\n\n if (mode !== 'tags') {\n patchRawValues = patchLabels.map(function (label) {\n var item = mergedFlattenOptions.find(function (_ref2) {\n var data = _ref2.data;\n return data[mergedOptionLabelProp] === label;\n });\n return item ? item.data.value : null;\n }).filter(function (val) {\n return val !== null;\n });\n }\n\n var newRawValues = Array.from(new Set([].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__.default)(mergedRawValue), (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__.default)(patchRawValues))));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n }); // Should close when paste finish\n\n onToggleOpen(false); // Tell Selector that break next actions\n\n ret = false;\n }\n\n setInnerSearchValue(newSearchText);\n\n if (onSearch && mergedSearchValue !== newSearchText) {\n onSearch(newSearchText);\n }\n\n return ret;\n }; // Only triggered when menu is closed & mode is tags\n // If menu is open, OptionList will take charge\n // If mode isn't tags, press enter is not meaningful when you can't see any option\n\n\n var onSearchSubmit = function onSearchSubmit(searchText) {\n var newRawValues = Array.from(new Set([].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__.default)(mergedRawValue), [searchText])));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n });\n setInnerSearchValue('');\n }; // Close dropdown when disabled change\n\n\n (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n if (innerOpen && !!disabled) {\n setInnerOpen(false);\n }\n }, [disabled]); // Close will clean up single mode search text\n\n (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n if (!mergedOpen && !isMultiple && mode !== 'combobox') {\n triggerSearch('', false, false);\n }\n }, [mergedOpen]); // ============================ Keyboard ============================\n\n /**\n * We record input value here to check if can press to clean up by backspace\n * - null: Key is not down, this is reset by key up\n * - true: Search text is empty when first time backspace down\n * - false: Search text is not empty when first time backspace down\n */\n\n var _useLock = (0,_hooks_useLock__WEBPACK_IMPORTED_MODULE_14__.default)(),\n _useLock2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useLock, 2),\n getClearLock = _useLock2[0],\n setClearLock = _useLock2[1]; // KeyDown\n\n\n var onInternalKeyDown = function onInternalKeyDown(event) {\n var clearLock = getClearLock();\n var which = event.which; // We only manage open state here, close logic should handle by list component\n\n if (!mergedOpen && which === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__.default.ENTER) {\n onToggleOpen(true);\n }\n\n setClearLock(!!mergedSearchValue); // Remove value by `backspace`\n\n if (which === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__.default.BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = (0,_utils_commonUtil__WEBPACK_IMPORTED_MODULE_12__.removeLastEnabledValue)(displayValues, mergedRawValue);\n\n if (removeInfo.removedValue !== null) {\n triggerChange(removeInfo.values);\n triggerSelect(removeInfo.removedValue, false, 'input');\n }\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current2;\n\n (_listRef$current2 = listRef.current).onKeyDown.apply(_listRef$current2, [event].concat(rest));\n }\n\n if (onKeyDown) {\n onKeyDown.apply(void 0, [event].concat(rest));\n }\n }; // KeyUp\n\n\n var onInternalKeyUp = function onInternalKeyUp(event) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current3;\n\n (_listRef$current3 = listRef.current).onKeyUp.apply(_listRef$current3, [event].concat(rest));\n }\n\n if (onKeyUp) {\n onKeyUp.apply(void 0, [event].concat(rest));\n }\n }; // ========================== Focus / Blur ==========================\n\n /** Record real focus status */\n\n\n var focusRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(false);\n\n var onContainerFocus = function onContainerFocus() {\n setMockFocused(true);\n\n if (!disabled) {\n if (onFocus && !focusRef.current) {\n onFocus.apply(void 0, arguments);\n } // `showAction` should handle `focus` if set\n\n\n if (showAction.includes('focus')) {\n onToggleOpen(true);\n }\n }\n\n focusRef.current = true;\n };\n\n var onContainerBlur = function onContainerBlur() {\n setMockFocused(false, function () {\n focusRef.current = false;\n onToggleOpen(false);\n });\n\n if (disabled) {\n return;\n }\n\n if (mergedSearchValue) {\n // `tags` mode should move `searchValue` into values\n if (mode === 'tags') {\n triggerSearch('', false, false);\n triggerChange(Array.from(new Set([].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__.default)(mergedRawValue), [mergedSearchValue]))));\n } else if (mode === 'multiple') {\n // `multiple` mode only clean the search value but not trigger event\n setInnerSearchValue('');\n }\n }\n\n if (onBlur) {\n onBlur.apply(void 0, arguments);\n }\n };\n\n var activeTimeoutIds = [];\n (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n return function () {\n activeTimeoutIds.forEach(function (timeoutId) {\n return clearTimeout(timeoutId);\n });\n activeTimeoutIds.splice(0, activeTimeoutIds.length);\n };\n }, []);\n\n var onInternalMouseDown = function onInternalMouseDown(event) {\n var target = event.target;\n var popupElement = triggerRef.current && triggerRef.current.getPopupElement(); // We should give focus back to selector if clicked item is not focusable\n\n if (popupElement && popupElement.contains(target)) {\n var timeoutId = setTimeout(function () {\n var index = activeTimeoutIds.indexOf(timeoutId);\n\n if (index !== -1) {\n activeTimeoutIds.splice(index, 1);\n }\n\n cancelSetMockFocused();\n\n if (!popupElement.contains(document.activeElement)) {\n selectorRef.current.focus();\n }\n });\n activeTimeoutIds.push(timeoutId);\n }\n\n if (onMouseDown) {\n for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n restArgs[_key3 - 1] = arguments[_key3];\n }\n\n onMouseDown.apply(void 0, [event].concat(restArgs));\n }\n }; // ========================= Accessibility ==========================\n\n\n var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(0),\n _useState10 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useState9, 2),\n accessibilityIndex = _useState10[0],\n setAccessibilityIndex = _useState10[1];\n\n var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n\n var onActiveValue = function onActiveValue(active, index) {\n var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n _ref3$source = _ref3.source,\n source = _ref3$source === void 0 ? 'keyboard' : _ref3$source;\n\n setAccessibilityIndex(index);\n\n if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {\n setActiveValue(String(active));\n }\n }; // ============================= Popup ==============================\n\n\n var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(null),\n _useState12 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useState11, 2),\n containerWidth = _useState12[0],\n setContainerWidth = _useState12[1];\n\n var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)({}),\n _useState14 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__.default)(_useState13, 2),\n forceUpdate = _useState14[1]; // We need force update here since popup dom is render async\n\n\n function onPopupMouseEnter() {\n forceUpdate({});\n }\n\n (0,_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_16__.default)(function () {\n if (triggerOpen) {\n var newWidth = Math.ceil(containerRef.current.offsetWidth);\n\n if (containerWidth !== newWidth) {\n setContainerWidth(newWidth);\n }\n }\n }, [triggerOpen]);\n var popupNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(OptionList, {\n ref: listRef,\n prefixCls: prefixCls,\n id: mergedId,\n open: mergedOpen,\n childrenAsData: !options,\n options: displayOptions,\n flattenOptions: displayFlattenOptions,\n multiple: isMultiple,\n values: rawValues,\n height: listHeight,\n itemHeight: listItemHeight,\n onSelect: onInternalOptionSelect,\n onToggleOpen: onToggleOpen,\n onActiveValue: onActiveValue,\n defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n notFoundContent: notFoundContent,\n onScroll: onPopupScroll,\n searchValue: mergedSearchValue,\n menuItemSelectedIcon: menuItemSelectedIcon,\n virtual: virtual !== false && dropdownMatchSelectWidth !== false,\n onMouseEnter: onPopupMouseEnter\n }); // ============================= Clear ==============================\n\n var clearNode;\n\n var onClearMouseDown = function onClearMouseDown() {\n // Trigger internal `onClear` event\n if (useInternalProps && internalProps.onClear) {\n internalProps.onClear();\n }\n\n if (onClear) {\n onClear();\n }\n\n triggerChange([]);\n triggerSearch('', false, false);\n };\n\n if (!disabled && allowClear && (mergedRawValue.length || mergedSearchValue)) {\n clearNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_TransBtn__WEBPACK_IMPORTED_MODULE_13__.default, {\n className: \"\".concat(prefixCls, \"-clear\"),\n onMouseDown: onClearMouseDown,\n customizeIcon: clearIcon\n }, \"\\xD7\");\n } // ============================= Arrow ==============================\n\n\n var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !isMultiple && mode !== 'combobox';\n var arrowNode;\n\n if (mergedShowArrow) {\n arrowNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_TransBtn__WEBPACK_IMPORTED_MODULE_13__.default, {\n className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(\"\".concat(prefixCls, \"-arrow\"), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)({}, \"\".concat(prefixCls, \"-arrow-loading\"), loading)),\n customizeIcon: inputIcon,\n customizeIconProps: {\n loading: loading,\n searchValue: mergedSearchValue,\n open: mergedOpen,\n focused: mockFocused,\n showSearch: mergedShowSearch\n }\n });\n } // ============================ Warning =============================\n\n\n if ( true && warningProps) {\n warningProps(props);\n } // ============================= Render =============================\n\n\n var mergedClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefixCls, className, (_classNames2 = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(\"div\", Object.assign({\n className: mergedClassName\n }, domProps, {\n ref: containerRef,\n onMouseDown: onInternalMouseDown,\n onKeyDown: onInternalKeyDown,\n onKeyUp: onInternalKeyUp,\n onFocus: onContainerFocus,\n onBlur: onContainerBlur\n }), mockFocused && !mergedOpen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(\"span\", {\n style: {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0\n },\n \"aria-live\": \"polite\"\n }, \"\".concat(mergedRawValue.join(', '))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_SelectTrigger__WEBPACK_IMPORTED_MODULE_10__.default, {\n ref: triggerRef,\n disabled: disabled,\n prefixCls: prefixCls,\n visible: triggerOpen,\n popupElement: popupNode,\n containerWidth: containerWidth,\n animation: animation,\n transitionName: transitionName,\n dropdownStyle: dropdownStyle,\n dropdownClassName: dropdownClassName,\n direction: direction,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n dropdownRender: dropdownRender,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n empty: !mergedOptions.length,\n getTriggerDOMNode: function getTriggerDOMNode() {\n return selectorDomRef.current;\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_Selector__WEBPACK_IMPORTED_MODULE_9__.default, Object.assign({}, props, {\n domRef: selectorDomRef,\n prefixCls: prefixCls,\n inputElement: customizeInputElement,\n ref: selectorRef,\n id: mergedId,\n showSearch: mergedShowSearch,\n mode: mode,\n accessibilityIndex: accessibilityIndex,\n multiple: isMultiple,\n tagRender: tagRender,\n values: displayValues,\n open: mergedOpen,\n onToggleOpen: onToggleOpen,\n searchValue: mergedSearchValue,\n activeValue: activeValue,\n onSearch: triggerSearch,\n onSearchSubmit: onSearchSubmit,\n onSelect: onInternalSelectionSelect,\n tokenWithEnter: tokenWithEnter\n }))), arrowNode, clearNode);\n }\n\n var RefSelect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.forwardRef(Select);\n return RefSelect;\n}", "function updateSelectedNes() {\n\t\tif (this.dottedSelection.x != 0 && this.dottedSelection.y != 0) {\n\t\t\tvar mapScL = document.getElementById(\"MAP\").scrollLeft;\n\t\t\tvar mapScT = document.getElementById(\"MAP\").scrollTop;\n\t\t\tfor (var i = 0; i < this.selectedNetworkElements.getLength(); i++) {\n\t\t\t\tvar ne = this.selectedNetworkElements.get(i);\n\t\t\t\tif (this.dottedSelection.isHidden()) {\n\t\t\t\t\tne.allocate(ne.x + this.dottedSelection.x + mapScL, ne.y + this.dottedSelection.y + mapScT);\n\t\t\t\t} else {\n\t\t\t\t\tne.allocate(ne.x + this.dottedSelection.x - BORDER_WH + mapScL, ne.y + this.dottedSelection.y - BORDER_WH + mapScT);\n\t\t\t\t}\n\t\t\t\tif (ne.miniNE != null) {\n\t\t\t\t\tne.miniNE.writeMiniNetworkElement(ne);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i = 0; i < this.selectedNetworkElements.getLength(); i++) {\n\t\t\t\tthis.selectedNetworkElements.get(i).updatePorts();\n\t\t\t}\n\t\t}\n\t\tthis.dottedSelection.release();\n\t\tthis.setDottedSelection();\n\t}", "function selectorFilaColumnaCasos(miSelect){\n return(\"<select class='form-control' id='\"+miSelect+\"'><option value=1>Porcentaje de Fila</option><option value=2>Porcentaje de Columna</option><option value=3>Total de casos</option></select>\");\n}", "function selectorOrganismo()\n{ \n $('#ente').autocomplete({\n minLength:1, //le indicamos que busque a partir de haber escrito dos o mas caracteres en el input\n delay:1,\n position:{my: \"left top\", at: \"left bottom\", collision: \"none\"},\n source: function(request, response)\n {\n var url=$('#base_url').val()+\"registrar/listar_organismos\"; //url donde buscará los organismos\n $.post(url,{'frase':request.term,'tipo_organismo':$(\"#tipo_organismo\").val()}, response, 'json');\n },\n select: function( event, ui ) \n { \n $(\"#ente\").val( ui.item.organismo ); \n $(\"#id_organismo\").val(ui.item.id_organismo); \n return false;\n }\n }).data( \"autocomplete\" )._renderItem = function( ul, item ) {\n return $( \"<li></li>\" ) \n .data( \"item.autocomplete\", item )\n\t\t.append( \"<a>\" + ((item.organismo==undefined)?'Sin coincidencias':item.organismo) +\n \"<br/><span style='font-size:10px;'>\" +\n ((item.pertenece_a==undefined)?'':item.pertenece_a) + \"</span></a>\" )\n\t\t.appendTo( ul );\n\t };\n}", "function cambiarMapas()\r\n{\r\n\t opcion = sel.value();\r\n}", "function generateSelector(config) {\n var defaultPrefixCls = config.prefixCls,\n OptionList = config.components.optionList,\n convertChildrenToData = config.convertChildrenToData,\n flattenOptions = config.flattenOptions,\n getLabeledValue = config.getLabeledValue,\n filterOptions = config.filterOptions,\n isValueDisabled = config.isValueDisabled,\n findValueOption = config.findValueOption,\n warningProps = config.warningProps,\n fillOptionsWithMissingValue = config.fillOptionsWithMissingValue,\n omitDOMProps = config.omitDOMProps; // Use raw define since `React.FC` not support generic\n\n function Select(props, ref) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls,\n className = props.className,\n id = props.id,\n open = props.open,\n defaultOpen = props.defaultOpen,\n options = props.options,\n children = props.children,\n mode = props.mode,\n value = props.value,\n defaultValue = props.defaultValue,\n labelInValue = props.labelInValue,\n showSearch = props.showSearch,\n inputValue = props.inputValue,\n searchValue = props.searchValue,\n filterOption = props.filterOption,\n _props$optionFilterPr = props.optionFilterProp,\n optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n onSearch = props.onSearch,\n allowClear = props.allowClear,\n clearIcon = props.clearIcon,\n showArrow = props.showArrow,\n inputIcon = props.inputIcon,\n menuItemSelectedIcon = props.menuItemSelectedIcon,\n disabled = props.disabled,\n loading = props.loading,\n defaultActiveFirstOption = props.defaultActiveFirstOption,\n _props$notFoundConten = props.notFoundContent,\n notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,\n optionLabelProp = props.optionLabelProp,\n backfill = props.backfill,\n getInputElement = props.getInputElement,\n getPopupContainer = props.getPopupContainer,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n animation = props.animation,\n transitionName = props.transitionName,\n dropdownStyle = props.dropdownStyle,\n dropdownClassName = props.dropdownClassName,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n dropdownRender = props.dropdownRender,\n dropdownAlign = props.dropdownAlign,\n _props$showAction = props.showAction,\n showAction = _props$showAction === void 0 ? [] : _props$showAction,\n tokenSeparators = props.tokenSeparators,\n onPopupScroll = props.onPopupScroll,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onKeyUp = props.onKeyUp,\n onKeyDown = props.onKeyDown,\n onMouseDown = props.onMouseDown,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n _props$internalProps = props.internalProps,\n internalProps = _props$internalProps === void 0 ? {} : _props$internalProps,\n restProps = _objectWithoutProperties(props, [\"prefixCls\", \"className\", \"id\", \"open\", \"defaultOpen\", \"options\", \"children\", \"mode\", \"value\", \"defaultValue\", \"labelInValue\", \"showSearch\", \"inputValue\", \"searchValue\", \"filterOption\", \"optionFilterProp\", \"autoClearSearchValue\", \"onSearch\", \"allowClear\", \"clearIcon\", \"showArrow\", \"inputIcon\", \"menuItemSelectedIcon\", \"disabled\", \"loading\", \"defaultActiveFirstOption\", \"notFoundContent\", \"optionLabelProp\", \"backfill\", \"getInputElement\", \"getPopupContainer\", \"listHeight\", \"listItemHeight\", \"animation\", \"transitionName\", \"dropdownStyle\", \"dropdownClassName\", \"dropdownMatchSelectWidth\", \"dropdownRender\", \"dropdownAlign\", \"showAction\", \"tokenSeparators\", \"onPopupScroll\", \"onDropdownVisibleChange\", \"onFocus\", \"onBlur\", \"onKeyUp\", \"onKeyDown\", \"onMouseDown\", \"onChange\", \"onSelect\", \"onDeselect\", \"internalProps\"]);\n\n var domProps = omitDOMProps ? omitDOMProps(restProps) : restProps;\n DEFAULT_OMIT_PROPS.forEach(function (prop) {\n delete domProps[prop];\n });\n var selectorRef = React.useRef(null);\n var listRef = React.useRef(null);\n /** Used for component focused management */\n\n var _useDelayReset = (0, _useDelayReset3.default)(),\n _useDelayReset2 = _slicedToArray(_useDelayReset, 3),\n mockFocused = _useDelayReset2[0],\n setMockFocused = _useDelayReset2[1],\n cancelSetMockFocused = _useDelayReset2[2]; // Inner id for accessibility usage. Only work in client side\n\n\n var _React$useState = React.useState(),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n innerId = _React$useState2[0],\n setInnerId = _React$useState2[1];\n\n React.useEffect(function () {\n setInnerId(\"rc_select_\".concat((0, _commonUtil.getUUID)()));\n }, []);\n var mergedId = id || innerId; // optionLabelProp\n\n var mergedOptionLabelProp = optionLabelProp;\n\n if (mergedOptionLabelProp === undefined) {\n mergedOptionLabelProp = options ? 'label' : 'children';\n } // labelInValue\n\n\n var mergedLabelInValue = mode === 'combobox' ? false : labelInValue;\n var isMultiple = mode === 'tags' || mode === 'multiple';\n var mergedShowSearch = showSearch !== undefined ? showSearch : isMultiple || mode === 'combobox'; // ============================== Ref ===============================\n\n React.useImperativeHandle(ref, function () {\n return {\n focus: selectorRef.current.focus,\n blur: selectorRef.current.blur\n };\n }); // ============================= Value ==============================\n\n var _React$useState3 = React.useState(value || defaultValue),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n innerValue = _React$useState4[0],\n setInnerValue = _React$useState4[1];\n\n var baseValue = value !== undefined && value !== null ? value : innerValue;\n /** Unique raw values */\n\n var mergedRawValue = React.useMemo(function () {\n return (0, _commonUtil.toInnerValue)(baseValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [baseValue, mergedLabelInValue]);\n /** We cache a set of raw values to speed up check */\n\n var rawValues = React.useMemo(function () {\n return new Set(mergedRawValue);\n }, [mergedRawValue]); // ============================= Option =============================\n // Set by option list active, it will merge into search input when mode is `combobox`\n\n var _React$useState5 = React.useState(null),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n activeValue = _React$useState6[0],\n setActiveValue = _React$useState6[1];\n\n var _React$useState7 = React.useState(''),\n _React$useState8 = _slicedToArray(_React$useState7, 2),\n innerSearchValue = _React$useState8[0],\n setInnerSearchValue = _React$useState8[1];\n\n var mergedSearchValue = innerSearchValue;\n\n if (searchValue !== undefined) {\n mergedSearchValue = searchValue;\n } else if (inputValue) {\n mergedSearchValue = inputValue;\n }\n\n var mergedOptions = React.useMemo(function () {\n var newOptions = options;\n\n if (newOptions === undefined) {\n newOptions = convertChildrenToData(children);\n }\n /**\n * `tags` should fill un-list item.\n * This is not cool here since TreeSelect do not need this\n */\n\n\n if (mode === 'tags' && fillOptionsWithMissingValue) {\n newOptions = fillOptionsWithMissingValue(newOptions, baseValue, mergedOptionLabelProp, labelInValue);\n }\n\n return newOptions;\n }, [options, children, mode, baseValue]);\n var mergedFlattenOptions = React.useMemo(function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]); // Display options for OptionList\n\n var displayOptions = React.useMemo(function () {\n if (!mergedSearchValue) {\n return _toConsumableArray(mergedOptions);\n }\n\n var filteredOptions = filterOptions(mergedSearchValue, mergedOptions, {\n optionFilterProp: optionFilterProp,\n filterOption: mode === 'combobox' && filterOption === undefined ? function () {\n return true;\n } : filterOption\n });\n\n if (mode === 'tags' && filteredOptions.every(function (opt) {\n return opt.value !== mergedSearchValue;\n })) {\n filteredOptions.unshift({\n value: mergedSearchValue,\n label: mergedSearchValue,\n key: '__RC_SELECT_TAG_PLACEHOLDER__'\n });\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode]);\n var displayFlattenOptions = React.useMemo(function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]); // ============================ Selector ============================\n\n var displayValues = React.useMemo(function () {\n return mergedRawValue.map(function (val) {\n var displayValue = getLabeledValue(val, {\n options: mergedFlattenOptions,\n prevValue: baseValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n });\n return _objectSpread({}, displayValue, {\n disabled: isValueDisabled(val, mergedFlattenOptions)\n });\n });\n }, [baseValue, mergedOptions]);\n\n var triggerSelect = function triggerSelect(newValue, isSelect) {\n var selectValue = mergedLabelInValue ? getLabeledValue(newValue, {\n options: mergedFlattenOptions,\n prevValue: baseValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n }) : newValue;\n var outOption = findValueOption([newValue], mergedFlattenOptions)[0];\n\n if (isSelect && onSelect) {\n onSelect(selectValue, outOption);\n } else if (!isSelect && onDeselect) {\n onDeselect(selectValue, outOption);\n }\n };\n\n var triggerChange = function triggerChange(newRawValues) {\n var outValues = (0, _commonUtil.toOuterValues)(Array.from(newRawValues), {\n labelInValue: mergedLabelInValue,\n options: mergedFlattenOptions,\n getLabeledValue: getLabeledValue,\n prevValue: baseValue,\n optionLabelProp: mergedOptionLabelProp\n });\n var outValue = isMultiple ? outValues : outValues[0]; // Skip trigger if prev & current value is both empty\n\n if (onChange && (mergedRawValue.length !== 0 || outValues.length !== 0)) {\n var outOptions = findValueOption(newRawValues, mergedFlattenOptions);\n onChange(outValue, isMultiple ? outOptions : outOptions[0]);\n }\n\n setInnerValue(outValue);\n };\n\n var onInternalSelect = function onInternalSelect(newValue, _ref) {\n var selected = _ref.selected;\n\n if (disabled) {\n return;\n }\n\n var newRawValue;\n\n if (isMultiple) {\n newRawValue = new Set(mergedRawValue);\n\n if (selected) {\n newRawValue.add(newValue);\n } else {\n newRawValue.delete(newValue);\n }\n } else {\n newRawValue = new Set();\n newRawValue.add(newValue);\n } // Multiple always trigger change and single should change if value changed\n\n\n if (isMultiple || !isMultiple && Array.from(mergedRawValue)[0] !== newValue) {\n triggerChange(Array.from(newRawValue));\n } // Trigger `onSelect`. Single mode always trigger select\n\n\n triggerSelect(newValue, !isMultiple || selected); // Clean search value if single or configured\n\n if (mode === 'combobox') {\n setInnerSearchValue(String(newValue));\n setActiveValue('');\n } else if (!isMultiple || autoClearSearchValue) {\n setInnerSearchValue('');\n setActiveValue('');\n }\n }; // ============================= Input ==============================\n // Only works in `combobox`\n\n\n var customizeInputElement = mode === 'combobox' && getInputElement && getInputElement() || null; // ============================== Open ==============================\n\n var _React$useState9 = React.useState(defaultOpen),\n _React$useState10 = _slicedToArray(_React$useState9, 2),\n innerOpen = _React$useState10[0],\n setInnerOpen = _React$useState10[1];\n\n var mergedOpen = open !== undefined ? open : innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty\n\n if (mergedOpen && mode === 'combobox' && !notFoundContent && !displayOptions.length) {\n mergedOpen = false;\n }\n\n var onToggleOpen = function onToggleOpen(newOpen) {\n var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;\n\n if (mergedOpen !== nextOpen && !disabled) {\n setInnerOpen(nextOpen);\n\n if (onDropdownVisibleChange) {\n onDropdownVisibleChange(nextOpen);\n }\n }\n }; // ============================= Search =============================\n\n\n var triggerSearch = function triggerSearch(searchText) {\n var fromTyping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ret = true;\n var newSearchText = searchText;\n setActiveValue(null); // Check if match the `tokenSeparators`\n\n var patchLabels = (0, _valueUtil.getSeparatedContent)(searchText, tokenSeparators);\n var patchRawValues = patchLabels;\n\n if (mode === 'combobox') {\n // Only typing will trigger onChange\n if (fromTyping) {\n triggerChange([newSearchText]);\n }\n } else if (patchLabels) {\n newSearchText = '';\n\n if (mode !== 'tags') {\n patchRawValues = patchLabels.map(function (label) {\n var item = mergedFlattenOptions.find(function (_ref2) {\n var data = _ref2.data;\n return data[mergedOptionLabelProp] === label;\n });\n return item ? item.data.value : null;\n }).filter(function (val) {\n return val !== null;\n });\n }\n\n var newRawValues = Array.from(new Set([].concat(_toConsumableArray(mergedRawValue), _toConsumableArray(patchRawValues))));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true);\n }); // Should close when paste finish\n\n onToggleOpen(false); // Tell Selector that break next actions\n\n ret = false;\n }\n\n setInnerSearchValue(newSearchText);\n\n if (onSearch && mergedSearchValue !== newSearchText) {\n onSearch(newSearchText);\n }\n\n return ret;\n }; // Close will clean up single mode search text\n\n\n React.useEffect(function () {\n if (!mergedOpen && !isMultiple && mode !== 'combobox') {\n triggerSearch('', false);\n }\n }, [mergedOpen]); // ============================ Keyboard ============================\n\n /**\n * We record input value here to check if can press to clean up by backspace\n * - null: Key is not down, this is reset by key up\n * - true: Search text is empty when first time backspace down\n * - false: Search text is not empty when first time backspace down\n */\n\n var _useLock = (0, _useLock3.default)(),\n _useLock2 = _slicedToArray(_useLock, 2),\n getClearLock = _useLock2[0],\n setClearLock = _useLock2[1];\n\n var clearLock = getClearLock(); // KeyDown\n\n var onInternalKeyDown = function onInternalKeyDown(event) {\n var which = event.which; // We only manage open state here, close logic should handle by list component\n\n if (!mergedOpen && which === _KeyCode.default.ENTER) {\n onToggleOpen(true);\n }\n\n setClearLock(!!mergedSearchValue); // Remove value by `backspace`\n\n if (which === _KeyCode.default.BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = (0, _commonUtil.removeLastEnabledValue)(displayValues, mergedRawValue);\n\n if (removeInfo.removedValue !== null) {\n triggerChange(removeInfo.values);\n triggerSelect(removeInfo.removedValue, false);\n }\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current;\n\n (_listRef$current = listRef.current).onKeyDown.apply(_listRef$current, [event].concat(rest));\n }\n\n if (onKeyDown) {\n onKeyDown.apply(void 0, [event].concat(rest));\n }\n }; // KeyUp\n\n\n var onInternalKeyUp = function onInternalKeyUp(event) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current2;\n\n (_listRef$current2 = listRef.current).onKeyUp.apply(_listRef$current2, [event].concat(rest));\n }\n\n if (onKeyUp) {\n onKeyUp.apply(void 0, [event].concat(rest));\n }\n }; // ========================== Focus / Blur ==========================\n\n\n var triggerRef = React.useRef(null);\n /** Record real focus status */\n\n var focusRef = React.useRef(false);\n\n var onContainerFocus = function onContainerFocus() {\n setMockFocused(true);\n\n if (!disabled) {\n if (onFocus && !focusRef.current) {\n onFocus.apply(void 0, arguments);\n } // `showAction` should handle `focus` if set\n\n\n if (showAction.includes('focus')) {\n onToggleOpen(true);\n }\n }\n\n focusRef.current = true;\n };\n\n var onContainerBlur = function onContainerBlur() {\n setMockFocused(false, function () {\n focusRef.current = false;\n onToggleOpen(false);\n });\n\n if (disabled) {\n return;\n }\n\n if (mergedSearchValue) {\n // `tags` mode should move `searchValue` into values\n if (mode === 'tags') {\n triggerSearch('', false);\n triggerChange(Array.from(new Set([].concat(_toConsumableArray(mergedRawValue), [mergedSearchValue]))));\n } else if (mode === 'multiple') {\n // `multiple` mode only clean the search value but not trigger event\n setInnerSearchValue('');\n }\n }\n\n if (onBlur) {\n onBlur.apply(void 0, arguments);\n }\n };\n\n var onInternalMouseDown = function onInternalMouseDown(event) {\n var target = event.target;\n var popupElement = triggerRef.current && triggerRef.current.getPopupElement(); // We should give focus back to selector if clicked item is not focusable\n\n if (popupElement && popupElement.contains(target)) {\n setTimeout(function () {\n cancelSetMockFocused();\n\n if (!popupElement.contains(document.activeElement)) {\n selectorRef.current.focus();\n }\n });\n }\n\n if (onMouseDown) {\n for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n restArgs[_key3 - 1] = arguments[_key3];\n }\n\n onMouseDown.apply(void 0, [event].concat(restArgs));\n }\n }; // ========================= Accessibility ==========================\n\n\n var _React$useState11 = React.useState(0),\n _React$useState12 = _slicedToArray(_React$useState11, 2),\n accessibilityIndex = _React$useState12[0],\n setAccessibilityIndex = _React$useState12[1];\n\n var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n\n var onActiveValue = function onActiveValue(active, index) {\n setAccessibilityIndex(index);\n\n if (backfill && mode === 'combobox' && active !== null) {\n setActiveValue(String(active));\n }\n }; // ============================= Popup ==============================\n\n\n var containerRef = React.useRef(null);\n\n var _React$useState13 = React.useState(null),\n _React$useState14 = _slicedToArray(_React$useState13, 2),\n containerWidth = _React$useState14[0],\n setContainerWidth = _React$useState14[1];\n\n (0, _useLayoutEffect.default)(function () {\n var newWidth = Math.ceil(containerRef.current.offsetWidth);\n\n if (containerWidth !== newWidth) {\n setContainerWidth(newWidth);\n }\n });\n var popupNode = React.createElement(OptionList, {\n ref: listRef,\n prefixCls: prefixCls,\n id: mergedId,\n open: mergedOpen,\n childrenAsData: !options,\n options: displayOptions,\n flattenOptions: displayFlattenOptions,\n multiple: isMultiple,\n values: rawValues,\n height: listHeight,\n itemHeight: listItemHeight,\n onSelect: onInternalSelect,\n onToggleOpen: onToggleOpen,\n onActiveValue: onActiveValue,\n defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n notFoundContent: notFoundContent,\n onScroll: onPopupScroll,\n searchValue: mergedSearchValue,\n menuItemSelectedIcon: menuItemSelectedIcon\n }); // ============================= Clear ==============================\n\n var clearNode;\n\n var onClearMouseDown = function onClearMouseDown() {\n // Trigger internal `onClear` event\n if (internalProps.mark === _generator.INTERNAL_PROPS_MARK && internalProps.onClear) {\n internalProps.onClear();\n }\n\n triggerChange([]);\n triggerSearch('', false);\n };\n\n if (allowClear && (mergedRawValue.length || mergedSearchValue)) {\n clearNode = React.createElement(_TransBtn.default, {\n className: \"\".concat(prefixCls, \"-clear\"),\n onMouseDown: onClearMouseDown,\n customizeIcon: clearIcon\n }, \"\\xD7\");\n } // ============================= Arrow ==============================\n\n\n var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !isMultiple && mode !== 'combobox';\n var arrowNode;\n\n if (mergedShowArrow) {\n arrowNode = React.createElement(_TransBtn.default, {\n className: (0, _classnames.default)(\"\".concat(prefixCls, \"-arrow\"), _defineProperty({}, \"\".concat(prefixCls, \"-arrow-loading\"), loading)),\n customizeIcon: inputIcon\n });\n } // ============================ Warning =============================\n\n\n if (\"development\" !== 'production') {\n warningProps(props);\n } // ============================= Render =============================\n\n\n var mergedClassName = (0, _classnames.default)(prefixCls, className, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n return React.createElement(\"div\", Object.assign({\n className: mergedClassName\n }, domProps, {\n ref: containerRef,\n onMouseDown: onInternalMouseDown,\n onKeyDown: onInternalKeyDown,\n onKeyUp: onInternalKeyUp,\n onFocus: onContainerFocus,\n onBlur: onContainerBlur\n }), mockFocused && !mergedOpen && React.createElement(\"span\", {\n style: {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0\n },\n \"aria-live\": \"polite\"\n }, \"\".concat(mergedRawValue.join(', '))), React.createElement(_SelectTrigger.default, {\n ref: triggerRef,\n disabled: disabled,\n prefixCls: prefixCls,\n visible: mergedOpen,\n popupElement: popupNode,\n containerWidth: containerWidth,\n animation: animation,\n transitionName: transitionName,\n dropdownStyle: dropdownStyle,\n dropdownClassName: dropdownClassName,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n dropdownRender: dropdownRender,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n empty: !mergedOptions.length\n }, React.createElement(_Selector.default, Object.assign({}, props, {\n prefixCls: prefixCls,\n inputElement: customizeInputElement,\n ref: selectorRef,\n id: mergedId,\n showSearch: mergedShowSearch,\n mode: mode,\n accessibilityIndex: accessibilityIndex,\n multiple: isMultiple,\n values: displayValues,\n open: mergedOpen,\n onToggleOpen: onToggleOpen,\n searchValue: mergedSearchValue,\n activeValue: activeValue,\n onSearch: triggerSearch,\n onSelect: onInternalSelect\n }))), arrowNode, clearNode);\n }\n\n var RefSelect = React.forwardRef(Select);\n return RefSelect;\n}", "function generateSelector(config) {\n var defaultPrefixCls = config.prefixCls,\n OptionList = config.components.optionList,\n convertChildrenToData = config.convertChildrenToData,\n flattenOptions = config.flattenOptions,\n getLabeledValue = config.getLabeledValue,\n filterOptions = config.filterOptions,\n isValueDisabled = config.isValueDisabled,\n findValueOption = config.findValueOption,\n warningProps = config.warningProps,\n fillOptionsWithMissingValue = config.fillOptionsWithMissingValue,\n omitDOMProps = config.omitDOMProps; // Use raw define since `React.FC` not support generic\n\n function Select(props, ref) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls,\n className = props.className,\n id = props.id,\n open = props.open,\n defaultOpen = props.defaultOpen,\n options = props.options,\n children = props.children,\n mode = props.mode,\n value = props.value,\n defaultValue = props.defaultValue,\n labelInValue = props.labelInValue,\n showSearch = props.showSearch,\n inputValue = props.inputValue,\n searchValue = props.searchValue,\n filterOption = props.filterOption,\n _props$optionFilterPr = props.optionFilterProp,\n optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n onSearch = props.onSearch,\n allowClear = props.allowClear,\n clearIcon = props.clearIcon,\n showArrow = props.showArrow,\n inputIcon = props.inputIcon,\n menuItemSelectedIcon = props.menuItemSelectedIcon,\n disabled = props.disabled,\n loading = props.loading,\n defaultActiveFirstOption = props.defaultActiveFirstOption,\n _props$notFoundConten = props.notFoundContent,\n notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,\n optionLabelProp = props.optionLabelProp,\n backfill = props.backfill,\n getInputElement = props.getInputElement,\n getPopupContainer = props.getPopupContainer,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n animation = props.animation,\n transitionName = props.transitionName,\n virtual = props.virtual,\n dropdownStyle = props.dropdownStyle,\n dropdownClassName = props.dropdownClassName,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n dropdownRender = props.dropdownRender,\n dropdownAlign = props.dropdownAlign,\n _props$showAction = props.showAction,\n showAction = _props$showAction === void 0 ? [] : _props$showAction,\n direction = props.direction,\n tokenSeparators = props.tokenSeparators,\n tagRender = props.tagRender,\n onPopupScroll = props.onPopupScroll,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onKeyUp = props.onKeyUp,\n onKeyDown = props.onKeyDown,\n onMouseDown = props.onMouseDown,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n _props$internalProps = props.internalProps,\n internalProps = _props$internalProps === void 0 ? {} : _props$internalProps,\n restProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(props, [\"prefixCls\", \"className\", \"id\", \"open\", \"defaultOpen\", \"options\", \"children\", \"mode\", \"value\", \"defaultValue\", \"labelInValue\", \"showSearch\", \"inputValue\", \"searchValue\", \"filterOption\", \"optionFilterProp\", \"autoClearSearchValue\", \"onSearch\", \"allowClear\", \"clearIcon\", \"showArrow\", \"inputIcon\", \"menuItemSelectedIcon\", \"disabled\", \"loading\", \"defaultActiveFirstOption\", \"notFoundContent\", \"optionLabelProp\", \"backfill\", \"getInputElement\", \"getPopupContainer\", \"listHeight\", \"listItemHeight\", \"animation\", \"transitionName\", \"virtual\", \"dropdownStyle\", \"dropdownClassName\", \"dropdownMatchSelectWidth\", \"dropdownRender\", \"dropdownAlign\", \"showAction\", \"direction\", \"tokenSeparators\", \"tagRender\", \"onPopupScroll\", \"onDropdownVisibleChange\", \"onFocus\", \"onBlur\", \"onKeyUp\", \"onKeyDown\", \"onMouseDown\", \"onChange\", \"onSelect\", \"onDeselect\", \"internalProps\"]);\n\n var useInternalProps = internalProps.mark === _interface_generator__WEBPACK_IMPORTED_MODULE_10__[\"INTERNAL_PROPS_MARK\"];\n var domProps = omitDOMProps ? omitDOMProps(restProps) : restProps;\n DEFAULT_OMIT_PROPS.forEach(function (prop) {\n delete domProps[prop];\n });\n var containerRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n var triggerRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n var selectorRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n var listRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n /** Used for component focused management */\n\n var _useDelayReset = Object(_hooks_useDelayReset__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(),\n _useDelayReset2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useDelayReset, 3),\n mockFocused = _useDelayReset2[0],\n setMockFocused = _useDelayReset2[1],\n cancelSetMockFocused = _useDelayReset2[2]; // Inner id for accessibility usage. Only work in client side\n\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](),\n _React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState, 2),\n innerId = _React$useState2[0],\n setInnerId = _React$useState2[1];\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n setInnerId(\"rc_select_\".concat(Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"getUUID\"])()));\n }, []);\n var mergedId = id || innerId; // optionLabelProp\n\n var mergedOptionLabelProp = optionLabelProp;\n\n if (mergedOptionLabelProp === undefined) {\n mergedOptionLabelProp = options ? 'label' : 'children';\n } // labelInValue\n\n\n var mergedLabelInValue = mode === 'combobox' ? false : labelInValue;\n var isMultiple = mode === 'tags' || mode === 'multiple';\n var mergedShowSearch = showSearch !== undefined ? showSearch : isMultiple || mode === 'combobox'; // ============================== Ref ===============================\n\n var selectorDomRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n react__WEBPACK_IMPORTED_MODULE_4__[\"useImperativeHandle\"](ref, function () {\n return {\n focus: selectorRef.current.focus,\n blur: selectorRef.current.blur\n };\n }); // ============================= Value ==============================\n\n var _React$useState3 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](value || defaultValue),\n _React$useState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState3, 2),\n innerValue = _React$useState4[0],\n setInnerValue = _React$useState4[1];\n\n var baseValue = value !== undefined ? value : innerValue; // Should reset when controlled to be uncontrolled\n\n var prevValueRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](value);\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (prevValueRef.current !== value && (value === undefined || value === null)) {\n setInnerValue(undefined);\n }\n\n prevValueRef.current = value;\n }, [value]);\n /** Unique raw values */\n\n var mergedRawValue = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"toInnerValue\"])(baseValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [baseValue, mergedLabelInValue]);\n /** We cache a set of raw values to speed up check */\n\n var rawValues = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return new Set(mergedRawValue);\n }, [mergedRawValue]); // ============================= Option =============================\n // Set by option list active, it will merge into search input when mode is `combobox`\n\n var _React$useState5 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](null),\n _React$useState6 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState5, 2),\n activeValue = _React$useState6[0],\n setActiveValue = _React$useState6[1];\n\n var _React$useState7 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](''),\n _React$useState8 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState7, 2),\n innerSearchValue = _React$useState8[0],\n setInnerSearchValue = _React$useState8[1];\n\n var mergedSearchValue = innerSearchValue;\n\n if (mode === 'combobox' && value !== undefined) {\n mergedSearchValue = value;\n } else if (searchValue !== undefined) {\n mergedSearchValue = searchValue;\n } else if (inputValue) {\n mergedSearchValue = inputValue;\n }\n\n var mergedOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n var newOptions = options;\n\n if (newOptions === undefined) {\n newOptions = convertChildrenToData(children);\n }\n /**\n * `tags` should fill un-list item.\n * This is not cool here since TreeSelect do not need this\n */\n\n\n if (mode === 'tags' && fillOptionsWithMissingValue) {\n newOptions = fillOptionsWithMissingValue(newOptions, baseValue, mergedOptionLabelProp, labelInValue);\n }\n\n return newOptions || [];\n }, [options, children, mode, baseValue]);\n var mergedFlattenOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]); // Display options for OptionList\n\n var displayOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(mergedOptions);\n }\n\n var filteredOptions = filterOptions(mergedSearchValue, mergedOptions, {\n optionFilterProp: optionFilterProp,\n filterOption: mode === 'combobox' && filterOption === undefined ? function () {\n return true;\n } : filterOption\n });\n\n if (mode === 'tags' && filteredOptions.every(function (opt) {\n return opt.value !== mergedSearchValue;\n })) {\n filteredOptions.unshift({\n value: mergedSearchValue,\n label: mergedSearchValue,\n key: '__RC_SELECT_TAG_PLACEHOLDER__'\n });\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode, mergedShowSearch]);\n var displayFlattenOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (listRef.current && listRef.current.scrollTo) {\n listRef.current.scrollTo(0);\n }\n }, [mergedSearchValue]); // ============================ Selector ============================\n\n var displayValues = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return mergedRawValue.map(function (val) {\n var displayValue = getLabeledValue(val, {\n options: mergedFlattenOptions,\n prevValue: baseValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n });\n return _objectSpread(_objectSpread({}, displayValue), {}, {\n disabled: isValueDisabled(val, mergedFlattenOptions)\n });\n });\n }, [baseValue, mergedOptions]); // Polyfill with cache label\n\n displayValues = Object(_hooks_useCacheDisplayValue__WEBPACK_IMPORTED_MODULE_18__[\"default\"])(displayValues);\n\n var triggerSelect = function triggerSelect(newValue, isSelect, source) {\n var outOption = findValueOption([newValue], mergedFlattenOptions)[0];\n\n if (!internalProps.skipTriggerSelect) {\n // Skip trigger `onSelect` or `onDeselect` if configured\n var selectValue = mergedLabelInValue ? getLabeledValue(newValue, {\n options: mergedFlattenOptions,\n prevValue: baseValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n }) : newValue;\n\n if (isSelect && onSelect) {\n onSelect(selectValue, outOption);\n } else if (!isSelect && onDeselect) {\n onDeselect(selectValue, outOption);\n }\n } // Trigger internal event\n\n\n if (useInternalProps) {\n if (isSelect && internalProps.onRawSelect) {\n internalProps.onRawSelect(newValue, outOption, source);\n } else if (!isSelect && internalProps.onRawDeselect) {\n internalProps.onRawDeselect(newValue, outOption, source);\n }\n }\n };\n\n var triggerChange = function triggerChange(newRawValues) {\n if (useInternalProps && internalProps.skipTriggerChange) {\n return;\n }\n\n var outValues = Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"toOuterValues\"])(Array.from(newRawValues), {\n labelInValue: mergedLabelInValue,\n options: mergedFlattenOptions,\n getLabeledValue: getLabeledValue,\n prevValue: baseValue,\n optionLabelProp: mergedOptionLabelProp\n });\n var outValue = isMultiple ? outValues : outValues[0]; // Skip trigger if prev & current value is both empty\n\n if (onChange && (mergedRawValue.length !== 0 || outValues.length !== 0)) {\n var outOptions = findValueOption(newRawValues, mergedFlattenOptions);\n onChange(outValue, isMultiple ? outOptions : outOptions[0]);\n }\n\n setInnerValue(outValue);\n };\n\n var onInternalSelect = function onInternalSelect(newValue, _ref) {\n var selected = _ref.selected,\n source = _ref.source;\n\n if (disabled) {\n return;\n }\n\n var newRawValue;\n\n if (isMultiple) {\n newRawValue = new Set(mergedRawValue);\n\n if (selected) {\n newRawValue.add(newValue);\n } else {\n newRawValue.delete(newValue);\n }\n } else {\n newRawValue = new Set();\n newRawValue.add(newValue);\n } // Multiple always trigger change and single should change if value changed\n\n\n if (isMultiple || !isMultiple && Array.from(mergedRawValue)[0] !== newValue) {\n triggerChange(Array.from(newRawValue));\n } // Trigger `onSelect`. Single mode always trigger select\n\n\n triggerSelect(newValue, !isMultiple || selected, source); // Clean search value if single or configured\n\n if (mode === 'combobox') {\n setInnerSearchValue(String(newValue));\n setActiveValue('');\n } else if (!isMultiple || autoClearSearchValue) {\n setInnerSearchValue('');\n setActiveValue('');\n }\n };\n\n var onInternalOptionSelect = function onInternalOptionSelect(newValue, info) {\n onInternalSelect(newValue, _objectSpread(_objectSpread({}, info), {}, {\n source: 'option'\n }));\n };\n\n var onInternalSelectionSelect = function onInternalSelectionSelect(newValue, info) {\n onInternalSelect(newValue, _objectSpread(_objectSpread({}, info), {}, {\n source: 'selection'\n }));\n }; // ============================= Input ==============================\n // Only works in `combobox`\n\n\n var customizeInputElement = mode === 'combobox' && getInputElement && getInputElement() || null; // ============================== Open ==============================\n\n var _useMergedState = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useMergedState, 2),\n innerOpen = _useMergedState2[0],\n setInnerOpen = _useMergedState2[1];\n\n var mergedOpen = innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty\n\n var emptyListContent = !notFoundContent && !displayOptions.length;\n\n if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {\n mergedOpen = false;\n }\n\n var triggerOpen = emptyListContent ? false : mergedOpen;\n\n var onToggleOpen = function onToggleOpen(newOpen) {\n var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;\n\n if (innerOpen !== nextOpen && !disabled) {\n setInnerOpen(nextOpen);\n\n if (onDropdownVisibleChange) {\n onDropdownVisibleChange(nextOpen);\n }\n }\n };\n\n Object(_hooks_useSelectTriggerControl__WEBPACK_IMPORTED_MODULE_17__[\"default\"])([containerRef.current, triggerRef.current && triggerRef.current.getPopupElement()], triggerOpen, onToggleOpen); // ============================= Search =============================\n\n var triggerSearch = function triggerSearch(searchText) {\n var fromTyping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ret = true;\n var newSearchText = searchText;\n setActiveValue(null); // Check if match the `tokenSeparators`\n\n var patchLabels = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_16__[\"getSeparatedContent\"])(searchText, tokenSeparators);\n var patchRawValues = patchLabels;\n\n if (mode === 'combobox') {\n // Only typing will trigger onChange\n if (fromTyping) {\n triggerChange([newSearchText]);\n }\n } else if (patchLabels) {\n newSearchText = '';\n\n if (mode !== 'tags') {\n patchRawValues = patchLabels.map(function (label) {\n var item = mergedFlattenOptions.find(function (_ref2) {\n var data = _ref2.data;\n return data[mergedOptionLabelProp] === label;\n });\n return item ? item.data.value : null;\n }).filter(function (val) {\n return val !== null;\n });\n }\n\n var newRawValues = Array.from(new Set([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(mergedRawValue), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(patchRawValues))));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n }); // Should close when paste finish\n\n onToggleOpen(false); // Tell Selector that break next actions\n\n ret = false;\n }\n\n setInnerSearchValue(newSearchText);\n\n if (onSearch && mergedSearchValue !== newSearchText) {\n onSearch(newSearchText);\n }\n\n return ret;\n }; // Close dropdown when disabled change\n\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (innerOpen && !!disabled) {\n setInnerOpen(false);\n }\n }, [disabled]); // Close will clean up single mode search text\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (!mergedOpen && !isMultiple && mode !== 'combobox') {\n triggerSearch('', false);\n }\n }, [mergedOpen]); // ============================ Keyboard ============================\n\n /**\n * We record input value here to check if can press to clean up by backspace\n * - null: Key is not down, this is reset by key up\n * - true: Search text is empty when first time backspace down\n * - false: Search text is not empty when first time backspace down\n */\n\n var _useLock = Object(_hooks_useLock__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(),\n _useLock2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useLock, 2),\n getClearLock = _useLock2[0],\n setClearLock = _useLock2[1]; // KeyDown\n\n\n var onInternalKeyDown = function onInternalKeyDown(event) {\n var clearLock = getClearLock();\n var which = event.which; // We only manage open state here, close logic should handle by list component\n\n if (!mergedOpen && which === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_5__[\"default\"].ENTER) {\n onToggleOpen(true);\n }\n\n setClearLock(!!mergedSearchValue); // Remove value by `backspace`\n\n if (which === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_5__[\"default\"].BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"removeLastEnabledValue\"])(displayValues, mergedRawValue);\n\n if (removeInfo.removedValue !== null) {\n triggerChange(removeInfo.values);\n triggerSelect(removeInfo.removedValue, false, 'input');\n }\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current;\n\n (_listRef$current = listRef.current).onKeyDown.apply(_listRef$current, [event].concat(rest));\n }\n\n if (onKeyDown) {\n onKeyDown.apply(void 0, [event].concat(rest));\n }\n }; // KeyUp\n\n\n var onInternalKeyUp = function onInternalKeyUp(event) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current2;\n\n (_listRef$current2 = listRef.current).onKeyUp.apply(_listRef$current2, [event].concat(rest));\n }\n\n if (onKeyUp) {\n onKeyUp.apply(void 0, [event].concat(rest));\n }\n }; // ========================== Focus / Blur ==========================\n\n /** Record real focus status */\n\n\n var focusRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](false);\n\n var onContainerFocus = function onContainerFocus() {\n setMockFocused(true);\n\n if (!disabled) {\n if (onFocus && !focusRef.current) {\n onFocus.apply(void 0, arguments);\n } // `showAction` should handle `focus` if set\n\n\n if (showAction.includes('focus')) {\n onToggleOpen(true);\n }\n }\n\n focusRef.current = true;\n };\n\n var onContainerBlur = function onContainerBlur() {\n setMockFocused(false, function () {\n focusRef.current = false;\n onToggleOpen(false);\n });\n\n if (disabled) {\n return;\n }\n\n if (mergedSearchValue) {\n // `tags` mode should move `searchValue` into values\n if (mode === 'tags') {\n triggerSearch('', false);\n triggerChange(Array.from(new Set([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(mergedRawValue), [mergedSearchValue]))));\n } else if (mode === 'multiple') {\n // `multiple` mode only clean the search value but not trigger event\n setInnerSearchValue('');\n }\n }\n\n if (onBlur) {\n onBlur.apply(void 0, arguments);\n }\n };\n\n var activeTimeoutIds = [];\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n return function () {\n activeTimeoutIds.forEach(function (timeoutId) {\n return clearTimeout(timeoutId);\n });\n activeTimeoutIds.splice(0, activeTimeoutIds.length);\n };\n }, []);\n\n var onInternalMouseDown = function onInternalMouseDown(event) {\n var target = event.target;\n var popupElement = triggerRef.current && triggerRef.current.getPopupElement(); // We should give focus back to selector if clicked item is not focusable\n\n if (popupElement && popupElement.contains(target)) {\n var timeoutId = setTimeout(function () {\n var index = activeTimeoutIds.indexOf(timeoutId);\n\n if (index !== -1) {\n activeTimeoutIds.splice(index, 1);\n }\n\n cancelSetMockFocused();\n\n if (!popupElement.contains(document.activeElement)) {\n selectorRef.current.focus();\n }\n });\n activeTimeoutIds.push(timeoutId);\n }\n\n if (onMouseDown) {\n for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n restArgs[_key3 - 1] = arguments[_key3];\n }\n\n onMouseDown.apply(void 0, [event].concat(restArgs));\n }\n }; // ========================= Accessibility ==========================\n\n\n var _React$useState9 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](0),\n _React$useState10 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState9, 2),\n accessibilityIndex = _React$useState10[0],\n setAccessibilityIndex = _React$useState10[1];\n\n var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n\n var onActiveValue = function onActiveValue(active, index) {\n setAccessibilityIndex(index);\n\n if (backfill && mode === 'combobox' && active !== null) {\n setActiveValue(String(active));\n }\n }; // ============================= Popup ==============================\n\n\n var _React$useState11 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](null),\n _React$useState12 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState11, 2),\n containerWidth = _React$useState12[0],\n setContainerWidth = _React$useState12[1];\n\n Object(_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_15__[\"default\"])(function () {\n if (triggerOpen) {\n var newWidth = Math.ceil(containerRef.current.offsetWidth);\n\n if (containerWidth !== newWidth) {\n setContainerWidth(newWidth);\n }\n }\n }, [triggerOpen]);\n var popupNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](OptionList, {\n ref: listRef,\n prefixCls: prefixCls,\n id: mergedId,\n open: mergedOpen,\n childrenAsData: !options,\n options: displayOptions,\n flattenOptions: displayFlattenOptions,\n multiple: isMultiple,\n values: rawValues,\n height: listHeight,\n itemHeight: listItemHeight,\n onSelect: onInternalOptionSelect,\n onToggleOpen: onToggleOpen,\n onActiveValue: onActiveValue,\n defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n notFoundContent: notFoundContent,\n onScroll: onPopupScroll,\n searchValue: mergedSearchValue,\n menuItemSelectedIcon: menuItemSelectedIcon,\n virtual: virtual !== false && dropdownMatchSelectWidth !== false\n }); // ============================= Clear ==============================\n\n var clearNode;\n\n var onClearMouseDown = function onClearMouseDown() {\n // Trigger internal `onClear` event\n if (useInternalProps && internalProps.onClear) {\n internalProps.onClear();\n }\n\n triggerChange([]);\n triggerSearch('', false);\n };\n\n if (!disabled && allowClear && (mergedRawValue.length || mergedSearchValue)) {\n clearNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_TransBtn__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n className: \"\".concat(prefixCls, \"-clear\"),\n onMouseDown: onClearMouseDown,\n customizeIcon: clearIcon\n }, \"\\xD7\");\n } // ============================= Arrow ==============================\n\n\n var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !isMultiple && mode !== 'combobox';\n var arrowNode;\n\n if (mergedShowArrow) {\n arrowNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_TransBtn__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(\"\".concat(prefixCls, \"-arrow\"), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, \"\".concat(prefixCls, \"-arrow-loading\"), loading)),\n customizeIcon: inputIcon,\n customizeIconProps: {\n loading: loading,\n searchValue: mergedSearchValue,\n open: mergedOpen,\n focused: mockFocused,\n showSearch: mergedShowSearch\n }\n });\n } // ============================ Warning =============================\n\n\n if (false) {} // ============================= Render =============================\n\n\n var mergedClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()(prefixCls, className, (_classNames2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n return react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](\"div\", Object.assign({\n className: mergedClassName\n }, domProps, {\n ref: containerRef,\n onMouseDown: onInternalMouseDown,\n onKeyDown: onInternalKeyDown,\n onKeyUp: onInternalKeyUp,\n onFocus: onContainerFocus,\n onBlur: onContainerBlur\n }), mockFocused && !mergedOpen && react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](\"span\", {\n style: {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0\n },\n \"aria-live\": \"polite\"\n }, \"\".concat(mergedRawValue.join(', '))), react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_SelectTrigger__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n ref: triggerRef,\n disabled: disabled,\n prefixCls: prefixCls,\n visible: triggerOpen,\n popupElement: popupNode,\n containerWidth: containerWidth,\n animation: animation,\n transitionName: transitionName,\n dropdownStyle: dropdownStyle,\n dropdownClassName: dropdownClassName,\n direction: direction,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n dropdownRender: dropdownRender,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n empty: !mergedOptions.length,\n getTriggerDOMNode: function getTriggerDOMNode() {\n return selectorDomRef.current;\n }\n }, react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_Selector__WEBPACK_IMPORTED_MODULE_8__[\"default\"], Object.assign({}, props, {\n domRef: selectorDomRef,\n prefixCls: prefixCls,\n inputElement: customizeInputElement,\n ref: selectorRef,\n id: mergedId,\n showSearch: mergedShowSearch,\n mode: mode,\n accessibilityIndex: accessibilityIndex,\n multiple: isMultiple,\n tagRender: tagRender,\n values: displayValues,\n open: mergedOpen,\n onToggleOpen: onToggleOpen,\n searchValue: mergedSearchValue,\n activeValue: activeValue,\n onSearch: triggerSearch,\n onSelect: onInternalSelectionSelect\n }))), arrowNode, clearNode);\n }\n\n var RefSelect = react__WEBPACK_IMPORTED_MODULE_4__[\"forwardRef\"](Select);\n return RefSelect;\n}", "function generateSelector(config) {\n var defaultPrefixCls = config.prefixCls,\n OptionList = config.components.optionList,\n convertChildrenToData = config.convertChildrenToData,\n flattenOptions = config.flattenOptions,\n getLabeledValue = config.getLabeledValue,\n filterOptions = config.filterOptions,\n isValueDisabled = config.isValueDisabled,\n findValueOption = config.findValueOption,\n warningProps = config.warningProps,\n fillOptionsWithMissingValue = config.fillOptionsWithMissingValue,\n omitDOMProps = config.omitDOMProps; // Use raw define since `React.FC` not support generic\n\n function Select(props, ref) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls,\n className = props.className,\n id = props.id,\n open = props.open,\n defaultOpen = props.defaultOpen,\n options = props.options,\n children = props.children,\n mode = props.mode,\n value = props.value,\n defaultValue = props.defaultValue,\n labelInValue = props.labelInValue,\n showSearch = props.showSearch,\n inputValue = props.inputValue,\n searchValue = props.searchValue,\n filterOption = props.filterOption,\n _props$optionFilterPr = props.optionFilterProp,\n optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n onSearch = props.onSearch,\n allowClear = props.allowClear,\n clearIcon = props.clearIcon,\n showArrow = props.showArrow,\n inputIcon = props.inputIcon,\n menuItemSelectedIcon = props.menuItemSelectedIcon,\n disabled = props.disabled,\n loading = props.loading,\n defaultActiveFirstOption = props.defaultActiveFirstOption,\n _props$notFoundConten = props.notFoundContent,\n notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,\n optionLabelProp = props.optionLabelProp,\n backfill = props.backfill,\n getInputElement = props.getInputElement,\n getPopupContainer = props.getPopupContainer,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n animation = props.animation,\n transitionName = props.transitionName,\n virtual = props.virtual,\n dropdownStyle = props.dropdownStyle,\n dropdownClassName = props.dropdownClassName,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n dropdownRender = props.dropdownRender,\n dropdownAlign = props.dropdownAlign,\n _props$showAction = props.showAction,\n showAction = _props$showAction === void 0 ? [] : _props$showAction,\n direction = props.direction,\n tokenSeparators = props.tokenSeparators,\n tagRender = props.tagRender,\n onPopupScroll = props.onPopupScroll,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onKeyUp = props.onKeyUp,\n onKeyDown = props.onKeyDown,\n onMouseDown = props.onMouseDown,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n _props$internalProps = props.internalProps,\n internalProps = _props$internalProps === void 0 ? {} : _props$internalProps,\n restProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(props, [\"prefixCls\", \"className\", \"id\", \"open\", \"defaultOpen\", \"options\", \"children\", \"mode\", \"value\", \"defaultValue\", \"labelInValue\", \"showSearch\", \"inputValue\", \"searchValue\", \"filterOption\", \"optionFilterProp\", \"autoClearSearchValue\", \"onSearch\", \"allowClear\", \"clearIcon\", \"showArrow\", \"inputIcon\", \"menuItemSelectedIcon\", \"disabled\", \"loading\", \"defaultActiveFirstOption\", \"notFoundContent\", \"optionLabelProp\", \"backfill\", \"getInputElement\", \"getPopupContainer\", \"listHeight\", \"listItemHeight\", \"animation\", \"transitionName\", \"virtual\", \"dropdownStyle\", \"dropdownClassName\", \"dropdownMatchSelectWidth\", \"dropdownRender\", \"dropdownAlign\", \"showAction\", \"direction\", \"tokenSeparators\", \"tagRender\", \"onPopupScroll\", \"onDropdownVisibleChange\", \"onFocus\", \"onBlur\", \"onKeyUp\", \"onKeyDown\", \"onMouseDown\", \"onChange\", \"onSelect\", \"onDeselect\", \"internalProps\"]);\n\n var useInternalProps = internalProps.mark === _interface_generator__WEBPACK_IMPORTED_MODULE_10__[\"INTERNAL_PROPS_MARK\"];\n var domProps = omitDOMProps ? omitDOMProps(restProps) : restProps;\n DEFAULT_OMIT_PROPS.forEach(function (prop) {\n delete domProps[prop];\n });\n var containerRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n var triggerRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n var selectorRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n var listRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n /** Used for component focused management */\n\n var _useDelayReset = Object(_hooks_useDelayReset__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(),\n _useDelayReset2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useDelayReset, 3),\n mockFocused = _useDelayReset2[0],\n setMockFocused = _useDelayReset2[1],\n cancelSetMockFocused = _useDelayReset2[2]; // Inner id for accessibility usage. Only work in client side\n\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](),\n _React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState, 2),\n innerId = _React$useState2[0],\n setInnerId = _React$useState2[1];\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n setInnerId(\"rc_select_\".concat(Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"getUUID\"])()));\n }, []);\n var mergedId = id || innerId; // optionLabelProp\n\n var mergedOptionLabelProp = optionLabelProp;\n\n if (mergedOptionLabelProp === undefined) {\n mergedOptionLabelProp = options ? 'label' : 'children';\n } // labelInValue\n\n\n var mergedLabelInValue = mode === 'combobox' ? false : labelInValue;\n var isMultiple = mode === 'tags' || mode === 'multiple';\n var mergedShowSearch = showSearch !== undefined ? showSearch : isMultiple || mode === 'combobox'; // ============================== Ref ===============================\n\n var selectorDomRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](null);\n react__WEBPACK_IMPORTED_MODULE_4__[\"useImperativeHandle\"](ref, function () {\n return {\n focus: selectorRef.current.focus,\n blur: selectorRef.current.blur\n };\n }); // ============================= Value ==============================\n\n var _React$useState3 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](value || defaultValue),\n _React$useState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState3, 2),\n innerValue = _React$useState4[0],\n setInnerValue = _React$useState4[1];\n\n var baseValue = value !== undefined ? value : innerValue; // Should reset when controlled to be uncontrolled\n\n var prevValueRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](value);\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (prevValueRef.current !== value && (value === undefined || value === null)) {\n setInnerValue(undefined);\n }\n\n prevValueRef.current = value;\n }, [value]);\n /** Unique raw values */\n\n var mergedRawValue = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"toInnerValue\"])(baseValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [baseValue, mergedLabelInValue]);\n /** We cache a set of raw values to speed up check */\n\n var rawValues = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return new Set(mergedRawValue);\n }, [mergedRawValue]); // ============================= Option =============================\n // Set by option list active, it will merge into search input when mode is `combobox`\n\n var _React$useState5 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](null),\n _React$useState6 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState5, 2),\n activeValue = _React$useState6[0],\n setActiveValue = _React$useState6[1];\n\n var _React$useState7 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](''),\n _React$useState8 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState7, 2),\n innerSearchValue = _React$useState8[0],\n setInnerSearchValue = _React$useState8[1];\n\n var mergedSearchValue = innerSearchValue;\n\n if (mode === 'combobox' && value !== undefined) {\n mergedSearchValue = value;\n } else if (searchValue !== undefined) {\n mergedSearchValue = searchValue;\n } else if (inputValue) {\n mergedSearchValue = inputValue;\n }\n\n var mergedOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n var newOptions = options;\n\n if (newOptions === undefined) {\n newOptions = convertChildrenToData(children);\n }\n /**\n * `tags` should fill un-list item.\n * This is not cool here since TreeSelect do not need this\n */\n\n\n if (mode === 'tags' && fillOptionsWithMissingValue) {\n newOptions = fillOptionsWithMissingValue(newOptions, baseValue, mergedOptionLabelProp, labelInValue);\n }\n\n return newOptions || [];\n }, [options, children, mode, baseValue]);\n var mergedFlattenOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]);\n var optionMap = Object(_hooks_useCacheOptions__WEBPACK_IMPORTED_MODULE_19__[\"default\"])(mergedRawValue, mergedFlattenOptions); // Display options for OptionList\n\n var displayOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(mergedOptions);\n }\n\n var filteredOptions = filterOptions(mergedSearchValue, mergedOptions, {\n optionFilterProp: optionFilterProp,\n filterOption: mode === 'combobox' && filterOption === undefined ? function () {\n return true;\n } : filterOption\n });\n\n if (mode === 'tags' && filteredOptions.every(function (opt) {\n return opt.value !== mergedSearchValue;\n })) {\n filteredOptions.unshift({\n value: mergedSearchValue,\n label: mergedSearchValue,\n key: '__RC_SELECT_TAG_PLACEHOLDER__'\n });\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode, mergedShowSearch]);\n var displayFlattenOptions = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (listRef.current && listRef.current.scrollTo) {\n listRef.current.scrollTo(0);\n }\n }, [mergedSearchValue]); // ============================ Selector ============================\n\n var displayValues = react__WEBPACK_IMPORTED_MODULE_4__[\"useMemo\"](function () {\n return mergedRawValue.map(function (val) {\n var displayValue = getLabeledValue(val, {\n optionMap: optionMap,\n prevValue: baseValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n });\n return _objectSpread(_objectSpread({}, displayValue), {}, {\n disabled: isValueDisabled(val, optionMap)\n });\n });\n }, [baseValue, mergedOptions]); // Polyfill with cache label\n\n displayValues = Object(_hooks_useCacheDisplayValue__WEBPACK_IMPORTED_MODULE_18__[\"default\"])(displayValues);\n\n var triggerSelect = function triggerSelect(newValue, isSelect, source) {\n var outOption = findValueOption([newValue], optionMap)[0];\n\n if (!internalProps.skipTriggerSelect) {\n // Skip trigger `onSelect` or `onDeselect` if configured\n var selectValue = mergedLabelInValue ? getLabeledValue(newValue, {\n optionMap: optionMap,\n prevValue: baseValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n }) : newValue;\n\n if (isSelect && onSelect) {\n onSelect(selectValue, outOption);\n } else if (!isSelect && onDeselect) {\n onDeselect(selectValue, outOption);\n }\n } // Trigger internal event\n\n\n if (useInternalProps) {\n if (isSelect && internalProps.onRawSelect) {\n internalProps.onRawSelect(newValue, outOption, source);\n } else if (!isSelect && internalProps.onRawDeselect) {\n internalProps.onRawDeselect(newValue, outOption, source);\n }\n }\n };\n\n var triggerChange = function triggerChange(newRawValues) {\n if (useInternalProps && internalProps.skipTriggerChange) {\n return;\n }\n\n var outValues = Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"toOuterValues\"])(Array.from(newRawValues), {\n labelInValue: mergedLabelInValue,\n optionMap: optionMap,\n getLabeledValue: getLabeledValue,\n prevValue: baseValue,\n optionLabelProp: mergedOptionLabelProp\n });\n var outValue = isMultiple ? outValues : outValues[0]; // Skip trigger if prev & current value is both empty\n\n if (onChange && (mergedRawValue.length !== 0 || outValues.length !== 0)) {\n var outOptions = findValueOption(newRawValues, optionMap);\n onChange(outValue, isMultiple ? outOptions : outOptions[0]);\n }\n\n setInnerValue(outValue);\n };\n\n var onInternalSelect = function onInternalSelect(newValue, _ref) {\n var selected = _ref.selected,\n source = _ref.source;\n\n if (disabled) {\n return;\n }\n\n var newRawValue;\n\n if (isMultiple) {\n newRawValue = new Set(mergedRawValue);\n\n if (selected) {\n newRawValue.add(newValue);\n } else {\n newRawValue.delete(newValue);\n }\n } else {\n newRawValue = new Set();\n newRawValue.add(newValue);\n } // Multiple always trigger change and single should change if value changed\n\n\n if (isMultiple || !isMultiple && Array.from(mergedRawValue)[0] !== newValue) {\n triggerChange(Array.from(newRawValue));\n } // Trigger `onSelect`. Single mode always trigger select\n\n\n triggerSelect(newValue, !isMultiple || selected, source); // Clean search value if single or configured\n\n if (mode === 'combobox') {\n setInnerSearchValue(String(newValue));\n setActiveValue('');\n } else if (!isMultiple || autoClearSearchValue) {\n setInnerSearchValue('');\n setActiveValue('');\n }\n };\n\n var onInternalOptionSelect = function onInternalOptionSelect(newValue, info) {\n onInternalSelect(newValue, _objectSpread(_objectSpread({}, info), {}, {\n source: 'option'\n }));\n };\n\n var onInternalSelectionSelect = function onInternalSelectionSelect(newValue, info) {\n onInternalSelect(newValue, _objectSpread(_objectSpread({}, info), {}, {\n source: 'selection'\n }));\n }; // ============================= Input ==============================\n // Only works in `combobox`\n\n\n var customizeInputElement = mode === 'combobox' && getInputElement && getInputElement() || null; // ============================== Open ==============================\n\n var _useMergedState = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useMergedState, 2),\n innerOpen = _useMergedState2[0],\n setInnerOpen = _useMergedState2[1];\n\n var mergedOpen = innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty\n\n var emptyListContent = !notFoundContent && !displayOptions.length;\n\n if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {\n mergedOpen = false;\n }\n\n var triggerOpen = emptyListContent ? false : mergedOpen;\n\n var onToggleOpen = function onToggleOpen(newOpen) {\n var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;\n\n if (innerOpen !== nextOpen && !disabled) {\n setInnerOpen(nextOpen);\n\n if (onDropdownVisibleChange) {\n onDropdownVisibleChange(nextOpen);\n }\n }\n };\n\n Object(_hooks_useSelectTriggerControl__WEBPACK_IMPORTED_MODULE_17__[\"default\"])([containerRef.current, triggerRef.current && triggerRef.current.getPopupElement()], triggerOpen, onToggleOpen); // ============================= Search =============================\n\n var triggerSearch = function triggerSearch(searchText) {\n var fromTyping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ret = true;\n var newSearchText = searchText;\n setActiveValue(null); // Check if match the `tokenSeparators`\n\n var patchLabels = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_16__[\"getSeparatedContent\"])(searchText, tokenSeparators);\n var patchRawValues = patchLabels;\n\n if (mode === 'combobox') {\n // Only typing will trigger onChange\n if (fromTyping) {\n triggerChange([newSearchText]);\n }\n } else if (patchLabels) {\n newSearchText = '';\n\n if (mode !== 'tags') {\n patchRawValues = patchLabels.map(function (label) {\n var item = mergedFlattenOptions.find(function (_ref2) {\n var data = _ref2.data;\n return data[mergedOptionLabelProp] === label;\n });\n return item ? item.data.value : null;\n }).filter(function (val) {\n return val !== null;\n });\n }\n\n var newRawValues = Array.from(new Set([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(mergedRawValue), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(patchRawValues))));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n }); // Should close when paste finish\n\n onToggleOpen(false); // Tell Selector that break next actions\n\n ret = false;\n }\n\n setInnerSearchValue(newSearchText);\n\n if (onSearch && mergedSearchValue !== newSearchText) {\n onSearch(newSearchText);\n }\n\n return ret;\n }; // Close dropdown when disabled change\n\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (innerOpen && !!disabled) {\n setInnerOpen(false);\n }\n }, [disabled]); // Close will clean up single mode search text\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (!mergedOpen && !isMultiple && mode !== 'combobox') {\n triggerSearch('', false);\n }\n }, [mergedOpen]); // ============================ Keyboard ============================\n\n /**\n * We record input value here to check if can press to clean up by backspace\n * - null: Key is not down, this is reset by key up\n * - true: Search text is empty when first time backspace down\n * - false: Search text is not empty when first time backspace down\n */\n\n var _useLock = Object(_hooks_useLock__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(),\n _useLock2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useLock, 2),\n getClearLock = _useLock2[0],\n setClearLock = _useLock2[1]; // KeyDown\n\n\n var onInternalKeyDown = function onInternalKeyDown(event) {\n var clearLock = getClearLock();\n var which = event.which; // We only manage open state here, close logic should handle by list component\n\n if (!mergedOpen && which === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_5__[\"default\"].ENTER) {\n onToggleOpen(true);\n }\n\n setClearLock(!!mergedSearchValue); // Remove value by `backspace`\n\n if (which === rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_5__[\"default\"].BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = Object(_utils_commonUtil__WEBPACK_IMPORTED_MODULE_11__[\"removeLastEnabledValue\"])(displayValues, mergedRawValue);\n\n if (removeInfo.removedValue !== null) {\n triggerChange(removeInfo.values);\n triggerSelect(removeInfo.removedValue, false, 'input');\n }\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current;\n\n (_listRef$current = listRef.current).onKeyDown.apply(_listRef$current, [event].concat(rest));\n }\n\n if (onKeyDown) {\n onKeyDown.apply(void 0, [event].concat(rest));\n }\n }; // KeyUp\n\n\n var onInternalKeyUp = function onInternalKeyUp(event) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current2;\n\n (_listRef$current2 = listRef.current).onKeyUp.apply(_listRef$current2, [event].concat(rest));\n }\n\n if (onKeyUp) {\n onKeyUp.apply(void 0, [event].concat(rest));\n }\n }; // ========================== Focus / Blur ==========================\n\n /** Record real focus status */\n\n\n var focusRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](false);\n\n var onContainerFocus = function onContainerFocus() {\n setMockFocused(true);\n\n if (!disabled) {\n if (onFocus && !focusRef.current) {\n onFocus.apply(void 0, arguments);\n } // `showAction` should handle `focus` if set\n\n\n if (showAction.includes('focus')) {\n onToggleOpen(true);\n }\n }\n\n focusRef.current = true;\n };\n\n var onContainerBlur = function onContainerBlur() {\n setMockFocused(false, function () {\n focusRef.current = false;\n onToggleOpen(false);\n });\n\n if (disabled) {\n return;\n }\n\n if (mergedSearchValue) {\n // `tags` mode should move `searchValue` into values\n if (mode === 'tags') {\n triggerSearch('', false);\n triggerChange(Array.from(new Set([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(mergedRawValue), [mergedSearchValue]))));\n } else if (mode === 'multiple') {\n // `multiple` mode only clean the search value but not trigger event\n setInnerSearchValue('');\n }\n }\n\n if (onBlur) {\n onBlur.apply(void 0, arguments);\n }\n };\n\n var activeTimeoutIds = [];\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n return function () {\n activeTimeoutIds.forEach(function (timeoutId) {\n return clearTimeout(timeoutId);\n });\n activeTimeoutIds.splice(0, activeTimeoutIds.length);\n };\n }, []);\n\n var onInternalMouseDown = function onInternalMouseDown(event) {\n var target = event.target;\n var popupElement = triggerRef.current && triggerRef.current.getPopupElement(); // We should give focus back to selector if clicked item is not focusable\n\n if (popupElement && popupElement.contains(target)) {\n var timeoutId = setTimeout(function () {\n var index = activeTimeoutIds.indexOf(timeoutId);\n\n if (index !== -1) {\n activeTimeoutIds.splice(index, 1);\n }\n\n cancelSetMockFocused();\n\n if (!popupElement.contains(document.activeElement)) {\n selectorRef.current.focus();\n }\n });\n activeTimeoutIds.push(timeoutId);\n }\n\n if (onMouseDown) {\n for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n restArgs[_key3 - 1] = arguments[_key3];\n }\n\n onMouseDown.apply(void 0, [event].concat(restArgs));\n }\n }; // ========================= Accessibility ==========================\n\n\n var _React$useState9 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](0),\n _React$useState10 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState9, 2),\n accessibilityIndex = _React$useState10[0],\n setAccessibilityIndex = _React$useState10[1];\n\n var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n\n var onActiveValue = function onActiveValue(active, index) {\n setAccessibilityIndex(index);\n\n if (backfill && mode === 'combobox' && active !== null) {\n setActiveValue(String(active));\n }\n }; // ============================= Popup ==============================\n\n\n var _React$useState11 = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](null),\n _React$useState12 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_React$useState11, 2),\n containerWidth = _React$useState12[0],\n setContainerWidth = _React$useState12[1];\n\n Object(_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_15__[\"default\"])(function () {\n if (triggerOpen) {\n var newWidth = Math.ceil(containerRef.current.offsetWidth);\n\n if (containerWidth !== newWidth) {\n setContainerWidth(newWidth);\n }\n }\n }, [triggerOpen]);\n var popupNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](OptionList, {\n ref: listRef,\n prefixCls: prefixCls,\n id: mergedId,\n open: mergedOpen,\n childrenAsData: !options,\n options: displayOptions,\n flattenOptions: displayFlattenOptions,\n multiple: isMultiple,\n values: rawValues,\n height: listHeight,\n itemHeight: listItemHeight,\n onSelect: onInternalOptionSelect,\n onToggleOpen: onToggleOpen,\n onActiveValue: onActiveValue,\n defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n notFoundContent: notFoundContent,\n onScroll: onPopupScroll,\n searchValue: mergedSearchValue,\n menuItemSelectedIcon: menuItemSelectedIcon,\n virtual: virtual !== false && dropdownMatchSelectWidth !== false\n }); // ============================= Clear ==============================\n\n var clearNode;\n\n var onClearMouseDown = function onClearMouseDown() {\n // Trigger internal `onClear` event\n if (useInternalProps && internalProps.onClear) {\n internalProps.onClear();\n }\n\n triggerChange([]);\n triggerSearch('', false);\n };\n\n if (!disabled && allowClear && (mergedRawValue.length || mergedSearchValue)) {\n clearNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_TransBtn__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n className: \"\".concat(prefixCls, \"-clear\"),\n onMouseDown: onClearMouseDown,\n customizeIcon: clearIcon\n }, \"\\xD7\");\n } // ============================= Arrow ==============================\n\n\n var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !isMultiple && mode !== 'combobox';\n var arrowNode;\n\n if (mergedShowArrow) {\n arrowNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_TransBtn__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(\"\".concat(prefixCls, \"-arrow\"), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, \"\".concat(prefixCls, \"-arrow-loading\"), loading)),\n customizeIcon: inputIcon,\n customizeIconProps: {\n loading: loading,\n searchValue: mergedSearchValue,\n open: mergedOpen,\n focused: mockFocused,\n showSearch: mergedShowSearch\n }\n });\n } // ============================ Warning =============================\n\n\n if (false) {} // ============================= Render =============================\n\n\n var mergedClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()(prefixCls, className, (_classNames2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n return react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](\"div\", Object.assign({\n className: mergedClassName\n }, domProps, {\n ref: containerRef,\n onMouseDown: onInternalMouseDown,\n onKeyDown: onInternalKeyDown,\n onKeyUp: onInternalKeyUp,\n onFocus: onContainerFocus,\n onBlur: onContainerBlur\n }), mockFocused && !mergedOpen && react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](\"span\", {\n style: {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0\n },\n \"aria-live\": \"polite\"\n }, \"\".concat(mergedRawValue.join(', '))), react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_SelectTrigger__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n ref: triggerRef,\n disabled: disabled,\n prefixCls: prefixCls,\n visible: triggerOpen,\n popupElement: popupNode,\n containerWidth: containerWidth,\n animation: animation,\n transitionName: transitionName,\n dropdownStyle: dropdownStyle,\n dropdownClassName: dropdownClassName,\n direction: direction,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n dropdownRender: dropdownRender,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n empty: !mergedOptions.length,\n getTriggerDOMNode: function getTriggerDOMNode() {\n return selectorDomRef.current;\n }\n }, react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_Selector__WEBPACK_IMPORTED_MODULE_8__[\"default\"], Object.assign({}, props, {\n domRef: selectorDomRef,\n prefixCls: prefixCls,\n inputElement: customizeInputElement,\n ref: selectorRef,\n id: mergedId,\n showSearch: mergedShowSearch,\n mode: mode,\n accessibilityIndex: accessibilityIndex,\n multiple: isMultiple,\n tagRender: tagRender,\n values: displayValues,\n open: mergedOpen,\n onToggleOpen: onToggleOpen,\n searchValue: mergedSearchValue,\n activeValue: activeValue,\n onSearch: triggerSearch,\n onSelect: onInternalSelectionSelect\n }))), arrowNode, clearNode);\n }\n\n var RefSelect = react__WEBPACK_IMPORTED_MODULE_4__[\"forwardRef\"](Select);\n return RefSelect;\n}", "function generateSelector(config) {\n var defaultPrefixCls = config.prefixCls,\n OptionList = config.components.optionList,\n convertChildrenToData = config.convertChildrenToData,\n flattenOptions = config.flattenOptions,\n getLabeledValue = config.getLabeledValue,\n filterOptions = config.filterOptions,\n isValueDisabled = config.isValueDisabled,\n findValueOption = config.findValueOption,\n warningProps = config.warningProps,\n fillOptionsWithMissingValue = config.fillOptionsWithMissingValue,\n omitDOMProps = config.omitDOMProps; // Use raw define since `React.FC` not support generic\n\n function Select(props, ref) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls,\n className = props.className,\n id = props.id,\n open = props.open,\n defaultOpen = props.defaultOpen,\n options = props.options,\n children = props.children,\n mode = props.mode,\n value = props.value,\n defaultValue = props.defaultValue,\n labelInValue = props.labelInValue,\n showSearch = props.showSearch,\n inputValue = props.inputValue,\n searchValue = props.searchValue,\n filterOption = props.filterOption,\n _props$optionFilterPr = props.optionFilterProp,\n optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n onSearch = props.onSearch,\n allowClear = props.allowClear,\n clearIcon = props.clearIcon,\n showArrow = props.showArrow,\n inputIcon = props.inputIcon,\n menuItemSelectedIcon = props.menuItemSelectedIcon,\n disabled = props.disabled,\n loading = props.loading,\n defaultActiveFirstOption = props.defaultActiveFirstOption,\n _props$notFoundConten = props.notFoundContent,\n notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,\n optionLabelProp = props.optionLabelProp,\n backfill = props.backfill,\n getInputElement = props.getInputElement,\n getPopupContainer = props.getPopupContainer,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n animation = props.animation,\n transitionName = props.transitionName,\n virtual = props.virtual,\n dropdownStyle = props.dropdownStyle,\n dropdownClassName = props.dropdownClassName,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n dropdownRender = props.dropdownRender,\n dropdownAlign = props.dropdownAlign,\n _props$showAction = props.showAction,\n showAction = _props$showAction === void 0 ? [] : _props$showAction,\n direction = props.direction,\n tokenSeparators = props.tokenSeparators,\n tagRender = props.tagRender,\n onPopupScroll = props.onPopupScroll,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onKeyUp = props.onKeyUp,\n onKeyDown = props.onKeyDown,\n onMouseDown = props.onMouseDown,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n _props$internalProps = props.internalProps,\n internalProps = _props$internalProps === void 0 ? {} : _props$internalProps,\n restProps = (0, _objectWithoutProperties2.default)(props, [\"prefixCls\", \"className\", \"id\", \"open\", \"defaultOpen\", \"options\", \"children\", \"mode\", \"value\", \"defaultValue\", \"labelInValue\", \"showSearch\", \"inputValue\", \"searchValue\", \"filterOption\", \"optionFilterProp\", \"autoClearSearchValue\", \"onSearch\", \"allowClear\", \"clearIcon\", \"showArrow\", \"inputIcon\", \"menuItemSelectedIcon\", \"disabled\", \"loading\", \"defaultActiveFirstOption\", \"notFoundContent\", \"optionLabelProp\", \"backfill\", \"getInputElement\", \"getPopupContainer\", \"listHeight\", \"listItemHeight\", \"animation\", \"transitionName\", \"virtual\", \"dropdownStyle\", \"dropdownClassName\", \"dropdownMatchSelectWidth\", \"dropdownRender\", \"dropdownAlign\", \"showAction\", \"direction\", \"tokenSeparators\", \"tagRender\", \"onPopupScroll\", \"onDropdownVisibleChange\", \"onFocus\", \"onBlur\", \"onKeyUp\", \"onKeyDown\", \"onMouseDown\", \"onChange\", \"onSelect\", \"onDeselect\", \"internalProps\"]);\n var useInternalProps = internalProps.mark === _generator.INTERNAL_PROPS_MARK;\n var domProps = omitDOMProps ? omitDOMProps(restProps) : restProps;\n DEFAULT_OMIT_PROPS.forEach(function (prop) {\n delete domProps[prop];\n });\n var containerRef = (0, React.useRef)(null);\n var triggerRef = (0, React.useRef)(null);\n var selectorRef = (0, React.useRef)(null);\n var listRef = (0, React.useRef)(null);\n var tokenWithEnter = (0, React.useMemo)(function () {\n return (tokenSeparators || []).some(function (tokenSeparator) {\n return ['\\n', '\\r\\n'].includes(tokenSeparator);\n });\n }, [tokenSeparators]);\n /** Used for component focused management */\n\n var _useDelayReset = (0, _useDelayReset3.default)(),\n _useDelayReset2 = (0, _slicedToArray2.default)(_useDelayReset, 3),\n mockFocused = _useDelayReset2[0],\n setMockFocused = _useDelayReset2[1],\n cancelSetMockFocused = _useDelayReset2[2]; // Inner id for accessibility usage. Only work in client side\n\n\n var _useState = (0, React.useState)(),\n _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n innerId = _useState2[0],\n setInnerId = _useState2[1];\n\n (0, React.useEffect)(function () {\n setInnerId(\"rc_select_\".concat((0, _commonUtil.getUUID)()));\n }, []);\n var mergedId = id || innerId; // optionLabelProp\n\n var mergedOptionLabelProp = optionLabelProp;\n\n if (mergedOptionLabelProp === undefined) {\n mergedOptionLabelProp = options ? 'label' : 'children';\n } // labelInValue\n\n\n var mergedLabelInValue = mode === 'combobox' ? false : labelInValue;\n var isMultiple = mode === 'tags' || mode === 'multiple';\n var mergedShowSearch = showSearch !== undefined ? showSearch : isMultiple || mode === 'combobox'; // ============================== Ref ===============================\n\n var selectorDomRef = (0, React.useRef)(null);\n React.useImperativeHandle(ref, function () {\n return {\n focus: selectorRef.current.focus,\n blur: selectorRef.current.blur\n };\n }); // ============================= Value ==============================\n\n var _useMergedState = (0, _useMergedState5.default)(defaultValue, {\n value: value\n }),\n _useMergedState2 = (0, _slicedToArray2.default)(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setMergedValue = _useMergedState2[1];\n /** Unique raw values */\n\n\n var mergedRawValue = (0, React.useMemo)(function () {\n return (0, _commonUtil.toInnerValue)(mergedValue, {\n labelInValue: mergedLabelInValue,\n combobox: mode === 'combobox'\n });\n }, [mergedValue, mergedLabelInValue]);\n /** We cache a set of raw values to speed up check */\n\n var rawValues = (0, React.useMemo)(function () {\n return new Set(mergedRawValue);\n }, [mergedRawValue]); // ============================= Option =============================\n // Set by option list active, it will merge into search input when mode is `combobox`\n\n var _useState3 = (0, React.useState)(null),\n _useState4 = (0, _slicedToArray2.default)(_useState3, 2),\n activeValue = _useState4[0],\n setActiveValue = _useState4[1];\n\n var _useState5 = (0, React.useState)(''),\n _useState6 = (0, _slicedToArray2.default)(_useState5, 2),\n innerSearchValue = _useState6[0],\n setInnerSearchValue = _useState6[1];\n\n var mergedSearchValue = innerSearchValue;\n\n if (mode === 'combobox' && mergedValue !== undefined) {\n mergedSearchValue = mergedValue;\n } else if (searchValue !== undefined) {\n mergedSearchValue = searchValue;\n } else if (inputValue) {\n mergedSearchValue = inputValue;\n }\n\n var mergedOptions = (0, React.useMemo)(function () {\n var newOptions = options;\n\n if (newOptions === undefined) {\n newOptions = convertChildrenToData(children);\n }\n /**\n * `tags` should fill un-list item.\n * This is not cool here since TreeSelect do not need this\n */\n\n\n if (mode === 'tags' && fillOptionsWithMissingValue) {\n newOptions = fillOptionsWithMissingValue(newOptions, mergedValue, mergedOptionLabelProp, labelInValue);\n }\n\n return newOptions || [];\n }, [options, children, mode, mergedValue]);\n var mergedFlattenOptions = (0, React.useMemo)(function () {\n return flattenOptions(mergedOptions, props);\n }, [mergedOptions]);\n var getValueOption = (0, _useCacheOptions.default)(mergedRawValue, mergedFlattenOptions); // Display options for OptionList\n\n var displayOptions = (0, React.useMemo)(function () {\n if (!mergedSearchValue || !mergedShowSearch) {\n return (0, _toConsumableArray2.default)(mergedOptions);\n }\n\n var filteredOptions = filterOptions(mergedSearchValue, mergedOptions, {\n optionFilterProp: optionFilterProp,\n filterOption: mode === 'combobox' && filterOption === undefined ? function () {\n return true;\n } : filterOption\n });\n\n if (mode === 'tags' && filteredOptions.every(function (opt) {\n return opt.value !== mergedSearchValue;\n })) {\n filteredOptions.unshift({\n value: mergedSearchValue,\n label: mergedSearchValue,\n key: '__RC_SELECT_TAG_PLACEHOLDER__'\n });\n }\n\n return filteredOptions;\n }, [mergedOptions, mergedSearchValue, mode, mergedShowSearch]);\n var displayFlattenOptions = (0, React.useMemo)(function () {\n return flattenOptions(displayOptions, props);\n }, [displayOptions]);\n (0, React.useEffect)(function () {\n if (listRef.current && listRef.current.scrollTo) {\n listRef.current.scrollTo(0);\n }\n }, [mergedSearchValue]); // ============================ Selector ============================\n\n var displayValues = (0, React.useMemo)(function () {\n var tmpValues = mergedRawValue.map(function (val) {\n var valueOptions = getValueOption([val]);\n var displayValue = getLabeledValue(val, {\n options: valueOptions,\n prevValue: mergedValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n });\n return _objectSpread(_objectSpread({}, displayValue), {}, {\n disabled: isValueDisabled(val, valueOptions)\n });\n });\n\n if (!mode && tmpValues.length === 1 && tmpValues[0].value === null && tmpValues[0].label === null) {\n return [];\n }\n\n return tmpValues;\n }, [mergedValue, mergedOptions, mode]); // Polyfill with cache label\n\n displayValues = (0, _useCacheDisplayValue.default)(displayValues);\n\n var triggerSelect = function triggerSelect(newValue, isSelect, source) {\n var newValueOption = getValueOption([newValue]);\n var outOption = findValueOption([newValue], newValueOption)[0];\n\n if (!internalProps.skipTriggerSelect) {\n // Skip trigger `onSelect` or `onDeselect` if configured\n var selectValue = mergedLabelInValue ? getLabeledValue(newValue, {\n options: newValueOption,\n prevValue: mergedValue,\n labelInValue: mergedLabelInValue,\n optionLabelProp: mergedOptionLabelProp\n }) : newValue;\n\n if (isSelect && onSelect) {\n onSelect(selectValue, outOption);\n } else if (!isSelect && onDeselect) {\n onDeselect(selectValue, outOption);\n }\n } // Trigger internal event\n\n\n if (useInternalProps) {\n if (isSelect && internalProps.onRawSelect) {\n internalProps.onRawSelect(newValue, outOption, source);\n } else if (!isSelect && internalProps.onRawDeselect) {\n internalProps.onRawDeselect(newValue, outOption, source);\n }\n }\n };\n\n var triggerChange = function triggerChange(newRawValues) {\n if (useInternalProps && internalProps.skipTriggerChange) {\n return;\n }\n\n var newRawValuesOptions = getValueOption(newRawValues);\n var outValues = (0, _commonUtil.toOuterValues)(Array.from(newRawValues), {\n labelInValue: mergedLabelInValue,\n options: newRawValuesOptions,\n getLabeledValue: getLabeledValue,\n prevValue: mergedValue,\n optionLabelProp: mergedOptionLabelProp\n });\n var outValue = isMultiple ? outValues : outValues[0]; // Skip trigger if prev & current value is both empty\n\n if (onChange && (mergedRawValue.length !== 0 || outValues.length !== 0)) {\n var outOptions = findValueOption(newRawValues, newRawValuesOptions);\n onChange(outValue, isMultiple ? outOptions : outOptions[0]);\n }\n\n setMergedValue(outValue);\n };\n\n var onInternalSelect = function onInternalSelect(newValue, _ref) {\n var selected = _ref.selected,\n source = _ref.source;\n\n if (disabled) {\n return;\n }\n\n var newRawValue;\n\n if (isMultiple) {\n newRawValue = new Set(mergedRawValue);\n\n if (selected) {\n newRawValue.add(newValue);\n } else {\n newRawValue.delete(newValue);\n }\n } else {\n newRawValue = new Set();\n newRawValue.add(newValue);\n } // Multiple always trigger change and single should change if value changed\n\n\n if (isMultiple || !isMultiple && Array.from(mergedRawValue)[0] !== newValue) {\n triggerChange(Array.from(newRawValue));\n } // Trigger `onSelect`. Single mode always trigger select\n\n\n triggerSelect(newValue, !isMultiple || selected, source); // Clean search value if single or configured\n\n if (mode === 'combobox') {\n setInnerSearchValue(String(newValue));\n setActiveValue('');\n } else if (!isMultiple || autoClearSearchValue) {\n setInnerSearchValue('');\n setActiveValue('');\n }\n };\n\n var onInternalOptionSelect = function onInternalOptionSelect(newValue, info) {\n onInternalSelect(newValue, _objectSpread(_objectSpread({}, info), {}, {\n source: 'option'\n }));\n };\n\n var onInternalSelectionSelect = function onInternalSelectionSelect(newValue, info) {\n onInternalSelect(newValue, _objectSpread(_objectSpread({}, info), {}, {\n source: 'selection'\n }));\n }; // ============================= Input ==============================\n // Only works in `combobox`\n\n\n var customizeInputElement = mode === 'combobox' && getInputElement && getInputElement() || null; // ============================== Open ==============================\n\n var _useMergedState3 = (0, _useMergedState5.default)(undefined, {\n defaultValue: defaultOpen,\n value: open\n }),\n _useMergedState4 = (0, _slicedToArray2.default)(_useMergedState3, 2),\n innerOpen = _useMergedState4[0],\n setInnerOpen = _useMergedState4[1];\n\n var mergedOpen = innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty\n\n var emptyListContent = !notFoundContent && !displayOptions.length;\n\n if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {\n mergedOpen = false;\n }\n\n var triggerOpen = emptyListContent ? false : mergedOpen;\n\n var onToggleOpen = function onToggleOpen(newOpen) {\n var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;\n\n if (innerOpen !== nextOpen && !disabled) {\n setInnerOpen(nextOpen);\n\n if (onDropdownVisibleChange) {\n onDropdownVisibleChange(nextOpen);\n }\n }\n };\n\n (0, _useSelectTriggerControl.default)([containerRef.current, triggerRef.current && triggerRef.current.getPopupElement()], triggerOpen, onToggleOpen); // ============================= Search =============================\n\n var triggerSearch = function triggerSearch(searchText, fromTyping, isCompositing) {\n var ret = true;\n var newSearchText = searchText;\n setActiveValue(null); // Check if match the `tokenSeparators`\n\n var patchLabels = isCompositing ? null : (0, _valueUtil.getSeparatedContent)(searchText, tokenSeparators);\n var patchRawValues = patchLabels;\n\n if (mode === 'combobox') {\n // Only typing will trigger onChange\n if (fromTyping) {\n triggerChange([newSearchText]);\n }\n } else if (patchLabels) {\n newSearchText = '';\n\n if (mode !== 'tags') {\n patchRawValues = patchLabels.map(function (label) {\n var item = mergedFlattenOptions.find(function (_ref2) {\n var data = _ref2.data;\n return data[mergedOptionLabelProp] === label;\n });\n return item ? item.data.value : null;\n }).filter(function (val) {\n return val !== null;\n });\n }\n\n var newRawValues = Array.from(new Set([].concat((0, _toConsumableArray2.default)(mergedRawValue), (0, _toConsumableArray2.default)(patchRawValues))));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n }); // Should close when paste finish\n\n onToggleOpen(false); // Tell Selector that break next actions\n\n ret = false;\n }\n\n setInnerSearchValue(newSearchText);\n\n if (onSearch && mergedSearchValue !== newSearchText) {\n onSearch(newSearchText);\n }\n\n return ret;\n }; // Only triggered when menu is closed & mode is tags\n // If menu is open, OptionList will take charge\n // If mode isn't tags, press enter is not meaningful when you can't see any option\n\n\n var onSearchSubmit = function onSearchSubmit(searchText) {\n var newRawValues = Array.from(new Set([].concat((0, _toConsumableArray2.default)(mergedRawValue), [searchText])));\n triggerChange(newRawValues);\n newRawValues.forEach(function (newRawValue) {\n triggerSelect(newRawValue, true, 'input');\n });\n setInnerSearchValue('');\n }; // Close dropdown when disabled change\n\n\n (0, React.useEffect)(function () {\n if (innerOpen && !!disabled) {\n setInnerOpen(false);\n }\n }, [disabled]); // Close will clean up single mode search text\n\n (0, React.useEffect)(function () {\n if (!mergedOpen && !isMultiple && mode !== 'combobox') {\n triggerSearch('', false, false);\n }\n }, [mergedOpen]); // ============================ Keyboard ============================\n\n /**\n * We record input value here to check if can press to clean up by backspace\n * - null: Key is not down, this is reset by key up\n * - true: Search text is empty when first time backspace down\n * - false: Search text is not empty when first time backspace down\n */\n\n var _useLock = (0, _useLock3.default)(),\n _useLock2 = (0, _slicedToArray2.default)(_useLock, 2),\n getClearLock = _useLock2[0],\n setClearLock = _useLock2[1]; // KeyDown\n\n\n var onInternalKeyDown = function onInternalKeyDown(event) {\n var clearLock = getClearLock();\n var which = event.which; // We only manage open state here, close logic should handle by list component\n\n if (!mergedOpen && which === _KeyCode.default.ENTER) {\n onToggleOpen(true);\n }\n\n setClearLock(!!mergedSearchValue); // Remove value by `backspace`\n\n if (which === _KeyCode.default.BACKSPACE && !clearLock && isMultiple && !mergedSearchValue && mergedRawValue.length) {\n var removeInfo = (0, _commonUtil.removeLastEnabledValue)(displayValues, mergedRawValue);\n\n if (removeInfo.removedValue !== null) {\n triggerChange(removeInfo.values);\n triggerSelect(removeInfo.removedValue, false, 'input');\n }\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current;\n\n (_listRef$current = listRef.current).onKeyDown.apply(_listRef$current, [event].concat(rest));\n }\n\n if (onKeyDown) {\n onKeyDown.apply(void 0, [event].concat(rest));\n }\n }; // KeyUp\n\n\n var onInternalKeyUp = function onInternalKeyUp(event) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n if (mergedOpen && listRef.current) {\n var _listRef$current2;\n\n (_listRef$current2 = listRef.current).onKeyUp.apply(_listRef$current2, [event].concat(rest));\n }\n\n if (onKeyUp) {\n onKeyUp.apply(void 0, [event].concat(rest));\n }\n }; // ========================== Focus / Blur ==========================\n\n /** Record real focus status */\n\n\n var focusRef = (0, React.useRef)(false);\n\n var onContainerFocus = function onContainerFocus() {\n setMockFocused(true);\n\n if (!disabled) {\n if (onFocus && !focusRef.current) {\n onFocus.apply(void 0, arguments);\n } // `showAction` should handle `focus` if set\n\n\n if (showAction.includes('focus')) {\n onToggleOpen(true);\n }\n }\n\n focusRef.current = true;\n };\n\n var onContainerBlur = function onContainerBlur() {\n setMockFocused(false, function () {\n focusRef.current = false;\n onToggleOpen(false);\n });\n\n if (disabled) {\n return;\n }\n\n if (mergedSearchValue) {\n // `tags` mode should move `searchValue` into values\n if (mode === 'tags') {\n triggerSearch('', false, false);\n triggerChange(Array.from(new Set([].concat((0, _toConsumableArray2.default)(mergedRawValue), [mergedSearchValue]))));\n } else if (mode === 'multiple') {\n // `multiple` mode only clean the search value but not trigger event\n setInnerSearchValue('');\n }\n }\n\n if (onBlur) {\n onBlur.apply(void 0, arguments);\n }\n };\n\n var activeTimeoutIds = [];\n (0, React.useEffect)(function () {\n return function () {\n activeTimeoutIds.forEach(function (timeoutId) {\n return clearTimeout(timeoutId);\n });\n activeTimeoutIds.splice(0, activeTimeoutIds.length);\n };\n }, []);\n\n var onInternalMouseDown = function onInternalMouseDown(event) {\n var target = event.target;\n var popupElement = triggerRef.current && triggerRef.current.getPopupElement(); // We should give focus back to selector if clicked item is not focusable\n\n if (popupElement && popupElement.contains(target)) {\n var timeoutId = setTimeout(function () {\n var index = activeTimeoutIds.indexOf(timeoutId);\n\n if (index !== -1) {\n activeTimeoutIds.splice(index, 1);\n }\n\n cancelSetMockFocused();\n\n if (!popupElement.contains(document.activeElement)) {\n selectorRef.current.focus();\n }\n });\n activeTimeoutIds.push(timeoutId);\n }\n\n if (onMouseDown) {\n for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n restArgs[_key3 - 1] = arguments[_key3];\n }\n\n onMouseDown.apply(void 0, [event].concat(restArgs));\n }\n }; // ========================= Accessibility ==========================\n\n\n var _useState7 = (0, React.useState)(0),\n _useState8 = (0, _slicedToArray2.default)(_useState7, 2),\n accessibilityIndex = _useState8[0],\n setAccessibilityIndex = _useState8[1];\n\n var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n\n var onActiveValue = function onActiveValue(active, index) {\n setAccessibilityIndex(index);\n\n if (backfill && mode === 'combobox' && active !== null) {\n setActiveValue(String(active));\n }\n }; // ============================= Popup ==============================\n\n\n var _useState9 = (0, React.useState)(null),\n _useState10 = (0, _slicedToArray2.default)(_useState9, 2),\n containerWidth = _useState10[0],\n setContainerWidth = _useState10[1];\n\n var _useState11 = (0, React.useState)({}),\n _useState12 = (0, _slicedToArray2.default)(_useState11, 2),\n forceUpdate = _useState12[1]; // We need force update here since popup dom is render async\n\n\n function onPopupMouseEnter() {\n forceUpdate({});\n }\n\n (0, _useLayoutEffect.default)(function () {\n if (triggerOpen) {\n var newWidth = Math.ceil(containerRef.current.offsetWidth);\n\n if (containerWidth !== newWidth) {\n setContainerWidth(newWidth);\n }\n }\n }, [triggerOpen]);\n var popupNode = React.createElement(OptionList, {\n ref: listRef,\n prefixCls: prefixCls,\n id: mergedId,\n open: mergedOpen,\n childrenAsData: !options,\n options: displayOptions,\n flattenOptions: displayFlattenOptions,\n multiple: isMultiple,\n values: rawValues,\n height: listHeight,\n itemHeight: listItemHeight,\n onSelect: onInternalOptionSelect,\n onToggleOpen: onToggleOpen,\n onActiveValue: onActiveValue,\n defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n notFoundContent: notFoundContent,\n onScroll: onPopupScroll,\n searchValue: mergedSearchValue,\n menuItemSelectedIcon: menuItemSelectedIcon,\n virtual: virtual !== false && dropdownMatchSelectWidth !== false,\n onMouseEnter: onPopupMouseEnter\n }); // ============================= Clear ==============================\n\n var clearNode;\n\n var onClearMouseDown = function onClearMouseDown() {\n // Trigger internal `onClear` event\n if (useInternalProps && internalProps.onClear) {\n internalProps.onClear();\n }\n\n triggerChange([]);\n triggerSearch('', false, false);\n };\n\n if (!disabled && allowClear && (mergedRawValue.length || mergedSearchValue)) {\n clearNode = React.createElement(_TransBtn.default, {\n className: \"\".concat(prefixCls, \"-clear\"),\n onMouseDown: onClearMouseDown,\n customizeIcon: clearIcon\n }, \"\\xD7\");\n } // ============================= Arrow ==============================\n\n\n var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !isMultiple && mode !== 'combobox';\n var arrowNode;\n\n if (mergedShowArrow) {\n arrowNode = React.createElement(_TransBtn.default, {\n className: (0, _classnames.default)(\"\".concat(prefixCls, \"-arrow\"), (0, _defineProperty2.default)({}, \"\".concat(prefixCls, \"-arrow-loading\"), loading)),\n customizeIcon: inputIcon,\n customizeIconProps: {\n loading: loading,\n searchValue: mergedSearchValue,\n open: mergedOpen,\n focused: mockFocused,\n showSearch: mergedShowSearch\n }\n });\n } // ============================ Warning =============================\n\n\n if (process.env.NODE_ENV !== 'production' && warningProps) {\n warningProps(props);\n } // ============================= Render =============================\n\n\n var mergedClassName = (0, _classnames.default)(prefixCls, className, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-focused\"), mockFocused), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-multiple\"), isMultiple), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-single\"), !isMultiple), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-allow-clear\"), allowClear), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-show-arrow\"), mergedShowArrow), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-loading\"), loading), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-open\"), mergedOpen), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-customize-input\"), customizeInputElement), (0, _defineProperty2.default)(_classNames2, \"\".concat(prefixCls, \"-show-search\"), mergedShowSearch), _classNames2));\n return React.createElement(\"div\", Object.assign({\n className: mergedClassName\n }, domProps, {\n ref: containerRef,\n onMouseDown: onInternalMouseDown,\n onKeyDown: onInternalKeyDown,\n onKeyUp: onInternalKeyUp,\n onFocus: onContainerFocus,\n onBlur: onContainerBlur\n }), mockFocused && !mergedOpen && React.createElement(\"span\", {\n style: {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0\n },\n \"aria-live\": \"polite\"\n }, \"\".concat(mergedRawValue.join(', '))), React.createElement(_SelectTrigger.default, {\n ref: triggerRef,\n disabled: disabled,\n prefixCls: prefixCls,\n visible: triggerOpen,\n popupElement: popupNode,\n containerWidth: containerWidth,\n animation: animation,\n transitionName: transitionName,\n dropdownStyle: dropdownStyle,\n dropdownClassName: dropdownClassName,\n direction: direction,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n dropdownRender: dropdownRender,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n empty: !mergedOptions.length,\n getTriggerDOMNode: function getTriggerDOMNode() {\n return selectorDomRef.current;\n }\n }, React.createElement(_Selector.default, Object.assign({}, props, {\n domRef: selectorDomRef,\n prefixCls: prefixCls,\n inputElement: customizeInputElement,\n ref: selectorRef,\n id: mergedId,\n showSearch: mergedShowSearch,\n mode: mode,\n accessibilityIndex: accessibilityIndex,\n multiple: isMultiple,\n tagRender: tagRender,\n values: displayValues,\n open: mergedOpen,\n onToggleOpen: onToggleOpen,\n searchValue: mergedSearchValue,\n activeValue: activeValue,\n onSearch: triggerSearch,\n onSearchSubmit: onSearchSubmit,\n onSelect: onInternalSelectionSelect,\n tokenWithEnter: tokenWithEnter\n }))), arrowNode, clearNode);\n }\n\n var RefSelect = React.forwardRef(Select);\n return RefSelect;\n}", "selectTheatre(){\n browser.click('#cmbComplejos')\n browser.click('#cmbComplejos > option:nth-child(2)');\n }", "function SelectionUtil() {\n}", "function buildNetworkSelector() {\n networkSelector = $('<div style=\"top: 50%; left: 50%; position: absolute; z-index: 99999;\">' + \n '<div style=\"position: relative; width: 300px; margin-left: -150px; padding: .5em 1em 0 1em; height: 400px; margin-top: -190px; background-color: #FAFAFA; border: 1px solid #CCC; font.size: 1.2em;\">'+\n '<h3>Select Network Methods</h3>' +\n '<div id=\"ss-net-opts\"></div>' + \n '<div id=\"ss-net-prot-warning\" style=\"color: #44B\">'+(supports_html5_storage()?'':\"These network settings can only be configured in browsers that support HTML5 Storage. Please update your browser or unblock storage for this domain.\")+'</div>' +\n '<div style=\"float: right;\">' +\n '<input type=\"button\" value=\"Reset\" onclick=\"ShinyServer.enableAll()\"></input>' +\n '<input type=\"button\" value=\"OK\" onclick=\"ShinyServer.toggleNetworkSelector();\" style=\"margin-left: 1em;\" id=\"netOptOK\"></input>' +\n '</div>' +\n '</div></div>');\n\n networkOptions = $('#ss-net-opts', networkSelector);\n $.each(availableOptions, function(index, val){\n var checked = ($.inArray(val, whitelist) >= 0);\n var opt = $('<label><input type=\"checkbox\" id=\"ss-net-opt-'+val+'\" name=\"shiny-server-proto-checkbox\" value=\"'+index+'\" '+\n (ShinyServer.supports_html5_storage()?'':'disabled=\"disabled\"')+\n '> '+val+'</label>').appendTo(networkOptions);\n var checkbox = $('input', opt);\n checkbox.change(function(evt){\n ShinyServer.setOption(val, $(evt.target).prop('checked'));\n });\n if (checked){\n checkbox.prop('checked', true);\n }\n });\n }", "function CarregaPrimeiroSelect () {\n let select = document.querySelector(\"#produtosVenda > div > div.div-2 > select\");\n let options = criaOptionSelectVenda(produtos)\n options.forEach(element => {\n select.appendChild(element)\n })\n}", "function assignOptions(neighborhood, selector) {\n for (var i = 0; i < neighborhood.length; i++) {\n if (neighborhood[i] !== null) {\n var currentOption = document.createElement('option');\n currentOption.text = neighborhood[i];\n selector.appendChild(currentOption);\n } else {\n console.log(\"skipped neighborhood\")\n }\n }\n }", "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "function elim_seleccionados(cmb1)\n{\n\tvar k = 0;\t//para recorrer el vector cod_elim\n\t//<<--------- envia registros seleccionados al cuadro2 -------->>\\\\\t\n\tfor(i=cmb1.options.length-1; i>=0; i--){\n\t\tif(cmb1.options[i].selected == true){\n\t\t\tif(navigator.appName == \"Netscape\") \tcmb1.options[i] = null;\t\t\n\t\t\telse \t\t\t\t\t\t\t\t\tcmb1.remove(i);\n\t\t}\n\t}\n\tcmb1.selectedIndex = 0;\n}", "function setup_selection_table(ilist){\r\n\t\t\tvar item,\r\n\t\t\tparts = that.finder.prepare_parts(ancelt, \r\n\t\t\t\t[\"キーワード/この資料内の図表から<strong>\"+nxdl[0]+\"で類似画像を</strong>検索\",\r\n\t\t\t\t\"Find <strong>similar images</strong> from keyword / figures in this item w/ \"+nxdl[1]][that.langidx]),\r\n\t\t\tkwdbx = Util.dom.element(\"span\", [\"キーワード\", \"keyword\"][that.langidx] + \": \"),\r\n\t\t\tkwdanc = Util.dom.element(\"a\", titlekwd, [[\"href\", kwdlink]]);\r\n\t\t\tkwdanc.setAttribute(\"title\", tip[0] + tip[2]);\r\n\t\t\tkwdbx.appendChild(kwdanc);\r\n\t\t\tparts.fbox.appendChild(kwdbx);\r\n\t\t\tfor(var i=0; i<5; i++){\r\n\t\t\t\tif(!(item = ilist[i])) break;\r\n\t\t\t\tthat.finder.set_ibox(parts, iseach + \"image=\" + item.id, \r\n\t\t\t\t\t\"https://www.dl.ndl.go.jp/api/iiif/\" + bid + \"/R\" + (\"0000000\" + item.page).slice(-7) +\r\n\t\t\t\t\t\"/pct:\" + [item.x, item.y, item.w, item.h].join(\",\") + \"/,128/0/default.jpg\",\r\n\t\t\t\t\ttipttl\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\treturn parts.finder;\r\n\t\t}", "findControls() {\n\t\tthis.hiderElement = this.container.querySelector(this.hiderElementSelector);\n\t\tthis.showerElement = this.container.querySelector(this.showerElementSelector);\n\t}", "function populateSelect() {\r\n//\tIn base al numero di diversi tipi di icone presenti nell'array\r\n//\tPopola la <select> nell'HTML\t\r\n\tvar types = getUniqueTypes(iconsAll);\r\n\tselect.innerHTML = `<option value=\"all\">Mostra Tutto</option>`;\r\n\tfor(let i = 0; i < types.length; i++) {\r\n\t\tselect.innerHTML += `<option value=\"${types[i]}\">Mostra \"${types[i]}\"</option>`;\r\n\t}\r\n}", "function createSelector(data, elemName) {\n\tvar selector = document.getElementById(elemName);\n\tremoveOptions(selector);\n\tfor (var i=0; i < data.length; i++) {\n\t\tvar opt = document.createElement(\"option\");\n\t\topt.value = data[i].id;\n\t\topt.text = data[i].name;\n\t\tselector.add(opt);\n\t}\n\treturn selector;\n}", "function ponerDatosChb_Rad(q,sel,t,nodes,ty)\r\n{\r\n document.getElementById(q).innerHTML = t;\r\n var checkboxContainer=document.getElementById(sel);\r\n var result = nodes.iterateNext();\r\n i=0;\r\n while (result)\r\n {\r\n var input = document.createElement(\"input\");\r\n var label = document.createElement(\"label\");\r\n label.innerHTML=result.innerHTML;\r\n input.type=ty;\r\n input.name=ty;\r\n input.value=i; i++;\r\n checkboxContainer.appendChild(input);\r\n checkboxContainer.appendChild(label);\r\n checkboxContainer.appendChild(document.createElement(\"br\"));\r\n result = nodes.iterateNext();\r\n }\r\n}", "function ponerDatosChb_Rad(q,sel,t,nodes,ty)\r\n{\r\n document.getElementById(q).innerHTML = t;\r\n var checkboxContainer=document.getElementById(sel);\r\n var result = nodes.iterateNext();\r\n i=0;\r\n while (result)\r\n {\r\n var input = document.createElement(\"input\");\r\n var label = document.createElement(\"label\");\r\n label.innerHTML=result.innerHTML;\r\n input.type=ty;\r\n input.name=ty;\r\n input.value=i; i++;\r\n checkboxContainer.appendChild(input);\r\n checkboxContainer.appendChild(label);\r\n checkboxContainer.appendChild(document.createElement(\"br\"));\r\n result = nodes.iterateNext();\r\n }\r\n}", "_format_vernacular_selector(selected) {\n var url = '/admin/v1/all_species_vernacular';\n var json = this.dao.httpGet(url);\n console.log(json)\n var obj = JSON.parse(json);\n \n var resp = \"\";\n for (var i in obj) {\n var option = obj[i];\n if (selected == option.ott_id) {\n resp += `<option value=\"${option.ott_id}\" selected>${option.vernacular_name_english}</option>`\n } else {\n resp += `<option value=\"${option.ott_id}\">${option.vernacular_name_english}</option>`\n }\n }\n return `\n <label class=\"filter_label\" for=\"vernacular_selector\">Species (English name)</label>\n <select id=\"vernacular_selector\">\n ${resp}\n </select>`;\n }", "onSelectAll (name) {\n const f = this.dimProp.find((d) => d.name === name)\n if (!f) return\n\n // if options not filtered then all select items in dimension\n // else append to current selection items from the filter\n if (f.options.length === f.enums.length) {\n f.selection = Array.from(f.options)\n } else {\n const a = f.options.filter(ov => f.selection.findIndex(sv => sv.value === ov.value) < 0)\n f.selection = f.selection.concat(a)\n f.selection.sort(\n (left, right) => (left.value === right.value) ? 0 : ((left.value < right.value) ? -1 : 1)\n )\n }\n\n f.singleSelection = f.selection.length > 0 ? f.selection[0] : {}\n f.options = f.enums\n\n this.updateSelectOrClearView(name)\n }", "function nlobjSelectOption() {\n}", "function consultarRangosBD(){ \n\tvar selector = $('#selectBands').val();\n\t$.post(\"gestionEspectro/php/resultadosConsultas.php\", { accion: 'rangosBD', idConsulta: selector }, function(data){\n\t\t$(\"#rangosBD\").html(data);\n\t}); \n}" ]
[ "0.59749305", "0.5941935", "0.58718026", "0.58161175", "0.57846206", "0.57777786", "0.5777662", "0.5720195", "0.56921345", "0.5686847", "0.5662255", "0.56360984", "0.5609886", "0.55947244", "0.5592715", "0.5587383", "0.5587178", "0.557877", "0.557322", "0.5543146", "0.5531236", "0.5524284", "0.5509804", "0.5497438", "0.5468562", "0.54337907", "0.5426299", "0.5425667", "0.5424373", "0.540401", "0.540401", "0.540401", "0.540401", "0.53955895", "0.5392888", "0.53888214", "0.5383957", "0.53757256", "0.5374613", "0.53640354", "0.53547525", "0.5347689", "0.5329787", "0.53163236", "0.53137326", "0.5313722", "0.52974933", "0.5296386", "0.52947724", "0.5292694", "0.5289009", "0.52885085", "0.52875257", "0.5284577", "0.5271228", "0.52582055", "0.52577543", "0.5242921", "0.5229864", "0.5227378", "0.52237654", "0.5220483", "0.5218349", "0.5212675", "0.52121735", "0.52002525", "0.51963407", "0.5195735", "0.5187851", "0.5187276", "0.51841474", "0.5182721", "0.5182721", "0.5182721", "0.5181338", "0.5180279", "0.51788664", "0.51779366", "0.5177016", "0.5177016", "0.5177016", "0.5177016", "0.5169903", "0.51651037", "0.5165068", "0.5162476", "0.5161513", "0.5157916", "0.5157916", "0.5157916", "0.5156597", "0.5151597", "0.5146363", "0.51433444", "0.5139347", "0.5133642", "0.5133642", "0.51307446", "0.51306796", "0.51278424", "0.5124585" ]
0.0
-1
Gestiona el div de error
function errorDiv(textError) { var div = document.getElementById('error'); if (textError != '') { div.innerHTML = textError; div.style.display = 'block'; } else if (div.style.display != 'none') { div.style.display = 'none'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeToErrorDiv(message){\n document.getElementById('errorDiv').innerHTML = message;\n}", "error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "function error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "function error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "function error() {\n $(\".content\").html(\"Failedtoloadcontent!\");\n }", "function onError(){\n\t\n\t$('#erro').show();\n\t$('#sombra').show();\n\t$('#fechar_erro').show();\n\t\n}", "function error_dis(error) {\n if (error !== undefined) {\n var err = document.createElement(\"div\");\n err.className = \"err\";\n var err_mes = \"Error! \" + error;\n err.innerHTML = err_mes;\n error_display.appendChild(err);\n } else return;\n\n }", "showError(error) {\n const errorNode = document.createElement(\"div\");\n errorNode.innerText = error;\n errorNode.style.position = \"absolute\";\n errorNode.style.left = \"50%\";\n errorNode.style.top = \"40%\";\n errorNode.style.transform = \"translate(-50%, 0)\";\n errorNode.style.whiteSpace = \"nowrap\";\n errorNode.style.fontFamily = `\"TreasureMIII64C\", monospace`;\n errorNode.style.fontSize = \"48px\";\n errorNode.style.padding = \"20px 30px 0 30px\";\n errorNode.style.color = \"white\";\n errorNode.style.backgroundColor = \"rgba(40, 40, 40, 0.8)\";\n errorNode.style.borderRadius = \"999px\";\n errorNode.style.opacity = \"0\";\n errorNode.style.transition = \"opacity .20s ease-in-out\";\n this.editorNode.append(errorNode);\n setTimeout(() => {\n errorNode.style.opacity = \"1\";\n setTimeout(() => {\n errorNode.style.opacity = \"0\";\n setTimeout(() => {\n errorNode.remove();\n }, 500);\n }, 2000);\n }, 0);\n }", "function onerror(e){\n\t\t$('#errors').text(e.message);\n\t}", "function buildErrorContainer() {\n\t\n\tvar error = \"<div class=\\\"row equal-col-height error-msg txt-left m-r-0 m-l-0\\\" id=\\\"\\\">\" +\n\t\t\t\t\t\"<div class=\\\"col-md-1 col-sm-1 col-xs-1 img-container\\\">\" +\n\t\t\t\t\t\t\"<i class=\\\"fa fa-times-circle font-20\\\" aria-hidden=\\\"true\\\"></i>\" +\n\t\t\t\t\t\"</div>\" +\n\t\t\t\t\t\"<div class=\\\"col-md-11 col-sm-11 col-xs-11\\\">\" +\n\t\t\t\t\t\t\"<span class=\\\"\\\"></span>\" +\n\t\t\t\t\t\"</div>\" +\n\t\t\t\t\"</div>\";\n\t\n\treturn error;\n}", "function affiche_error_connexion(ERROR){\n\t$(\".msg_error\").html(ERROR);\n}", "function errorMessage() {\n document.querySelector(\"#content\").innerHTML = `\n <div class=\"error\">\n <h1><strong>No recipes found please search again.</strong><h1>\n </div>\n `;\n }", "function edropx_display_error(element_id, message) {\n\n\t$(\"#\" + element_id).html(\"<div class=\\\"alert alert-danger\\\"><strong>Error:</strong>\" + message + \"</div>\");\n\n}", "function error(s, obj)\n{\n if ($(\"#error\").length == 0) {\n const div = $(\"<div></div>\");\n div.addClass(\"error\");\n div.attr(\"id\",\"error\");\n let errorTextSpan = makeSpan();\n errorTextSpan.attr(\"id\", \"error-text\");\n setHTML(errorTextSpan,s);\n const button = makeButton(\"OK\");\n button.click(function() {\n errorOkHandler(this);\n });\n div.append(errorTextSpan);\n div.append(\" \");\n div.append(button);\n obj.append(div);\n }\n else\n {\n let errorTextSpan = $(\"#error-text\");\n setHTML(errorTextSpan,s);\n }\n}", "function callErrorSocial(errorToShow){\n\t$(\"#registrazione-social-err\").remove();\n\t$(\"#lcom_pop .container_socialn\").prepend('<div id=\"registrazione-social-err\"><h6>ATTENZIONE: </h6><p>'+errorToShow+'</p></div>');\n}", "function showError(error){\n togglediv.style.display=\"block\";\n dateElement.style.display=\"none\";\n notificationElement.style.display=\"block\";\n notificationElement.innerHTML = `<p>${error.message}</p>`;\n iconElement.innerHTML = `<img src=\"icons/unknown.png\" alt=\"\"/>`;\n tempElement.innerHTML = `-°<span>C</span>`;\n descElement.innerHTML = `<p>-</p>`;\n locationElement.style.display=\"none\";\n\n temp_minElement.innerHTML = `-°<span>C</span>`;\n temp_maxElement.innerHTML = `-°<span>C</span>`;\n humidityElement.innerHTML = `-`;\n pressureElement.innerHTML = `-`;\n windElement.innerHTML = `-`;\n\n forecastdiv.style.display=\"none\";\n\n}", "function errorHandler () {\n\t\tif ( !document.querySelector( '#zemez-core-error' ) ) {\n\t\t\tlet node = document.createElement( 'div' );\n\t\t\tnode.setAttribute( 'id', 'zemez-core-error' );\n\t\t\tnode.setAttribute( 'style', 'position: fixed; bottom: 1vh; left: 1vw; z-index: 1000; max-width: 98vw; padding: 10px 15px; border-radius: 4px; font-family: monospace; background: #f2564d; color: white;' );\n\t\t\tnode.innerText = 'There was an error on this page, please try again later.';\n\t\t\tdocument.body.appendChild( node );\n\t\t}\n\t}", "showError(msg) {\n showError($(`#${this.idDOM}`).children('.article-big-content'), msg)\n }", "function showError(message) {\n errorDiv = document.querySelector(\"#error\");\n errorDiv.innerHTML += \"<p>\" + message + \"</p>\";\n}", "function handleError(event) {\n\n\t var item = event.data;\n\t //var div = document.getElementById(item.id);\n\t //if (div != null) {\n\t // div.innerHTML = \"<label>Error \" + (item.id == \"NoFileHere.png\" ? \":)\" : \":(\") + \"</label>\";\n\t // div.className = \"gridBox error\";\n\t //}\n\t console.log(\"handleError error\");\n\t}", "function errorHtml(data){\n var success = 'success';\n if (!data.success) {\n success = 'error';\n }\n return '<div class=\"message-'+success+' alert-'+success+'\">'+\n '<div class=\"message\"> <i class=\"icon\"></i> <span>'+data.message+'</span>'+\n '</div>';\n\n }", "function errorMessage() {\n\t\n\t$loader.html('<span class=\"error typeIt2\">Purrrlease make a selection...... You can do that right meoewwwwermmmm thanks.</span>');\n\n\t//typeIt effect\n\t$('.typeIt2').typeIt({\n\t\tcursor: false,\n\t});\n\n}", "function error() {\r\n\r\n \t$('#ir-anim-container').addClass('error');\r\n\t\t$('#ir-anim-container #congrats h1').text('Sorry, there was an error');\r\n\t\t$('#ir-anim-container #congrats p').text('Please, try again later');\r\n\t\t$('#ir-anim-container #gift-copy').remove();\r\n\t\t$('#ir-anim-container #gift-image').remove();\r\n\t\t$('#ir-anim-container #congrats').append('<img src=\"img/prize-error.png\" alt=\"Sorry, there was an error\" width=\"200\" height=\"190\" />');\r\n }", "function imgextensionerror(){\n var cont1 = '<div class=\"errormsg row text-center alert alert-danger\" role=\"alert\">';\n cont1 += '<span class=\"help-block text-center\"><strong class=\"text-danger\">';\n cont1 += 'Slika mora imati png, jpeg ili jpg ekstenziju.'\n cont1 += '</strong></span></div>';\n return cont1;\n}", "function showNetError(){\n var msgDivLength = jQuery(\".fixedAlert\").length;\n if(msgDivLength == 0){\n jQuery('.bot-div-page').prepend('<div class=\"fixedAlert\"></div>');\n jQuery(\".fixedAlert\").prepend('<div class=\"alert alert-danger\"><strong>Error! </strong>No Internet Connection!</div>');\n }\n }", "function error() {\r\n\t\tlet error = document.createElement(\"h3\");\r\n\t\terror.innerHTML = \"Sorry there are no recipes with \"+errorName+\", try again!\";\r\n\t\tdocument.getElementById(\"error\").appendChild(error);\r\n\t}", "function onError(err) {\n $('#err').html(err);\n}", "function marcarInputComoErroneo(input,divErrores,textoError){\r\n\tinput.className = 'incorrecto';\r\n\tlet padre = input.parentNode;\r\n\tlet spanError = document.querySelectorAll(`#${input.id} + span`);\r\n\tif(spanError.length === 0){\r\n\t\tlet spanNuevo = document.createElement(\"span\");\r\n\t\tspanNuevo.className = 'error';\r\n\t\tspanNuevo.innerHTML = textoError;\r\n\t\tdivErrores.appendChild(spanNuevo.cloneNode(true));\r\n\t}\r\n}", "function throw_error(el,msg){\n \t$(el).addClass('error');\n \t$(el).parent().find('.error_box').html(msg).addClass('error');\n }", "function displayerr(){\n\t\t \tif(!document.querySelector(\"#loginerror\"))\n\t\t \t{\n\t\t\t \tvar invalid = document.createElement(\"p\");\n\t\t\t \tinvalid.innerHTML =\"Invalid Username or Password!\";\n\t\t\t \tinvalid.setAttribute('id', \"loginerror\");\n\t\t\t \tinvalid.setAttribute('class',\"error\");\n\t\t\t \tdocument.querySelector(\"#userdiv\").appendChild(invalid);\n\t\t \t}\n\t\t }", "function displayErrorMsg(error) {\n $(\".errorOverlay\", selector).text(tr(error));\n $(selector).addClass(\"error\");\n }", "function drawError () {\n var container = document.getElementById('output');\n container.innerHTML = 'Error en AJAX';\n}", "function showFailedMessage() {\n\tlet html = `\n\t\t<div class=\"fail msg\">Sorry! Something went wrong. The API could not load. <br> Please try again later.</div>\n\t`;\n\n\t$('body').append(html);\n\n\t$('.fail').css('left', '10px');\n}", "function setRestrauntDataError(){\n resNameElement.innerHTML = \"Error unknown restraunt\";\n}", "showError() {\n showError($('#articles').children('#articles-big-list'), 'Error downloading articles');\n }", "function show_message(res, container){\n if (res.status == 0 ) {\n $(container).addClass('error');\n } else {\n $(container).removeClass('error');\n }\n $(container).show().html(res.message);\n }", "function displayError() {\n if(originalError instanceof ValidationError) {\n $(\".validation-message--error\").text(`Validation Error: ${originalError.message}`);\n }\n else if(originalError instanceof LocationError) {\n $(\".validation-message--error\").text(`Location Error: ${originalError.message}`);\n }\n else {\n $(\".validation-message--error\").text(`Error: ${originalError.message}`);\n }\n }", "function DisplayError(pMsg) {\n let domainArea = document.getElementById('v-token-results');\n domainArea.innerHTML = '';\n let div = document.createElement('div');\n div.setAttribute('class', 'v-errorText');\n let message = document.createTextNode('ERROR: ' + pMsg);\n div.appendChild(message);\n domainArea.appendChild(div);\n }", "function renderErrorPage() {\n var page = $('.error');\n page.addClass('visible');\n }", "function errorMessage(err){\n const h2 = document.createElement('h2');\n h2.className = 'error';\n h2.textContent = \"There was an error loading the users. Try refreshing the page\";\n bodyDiv.appendChild(h2);\n console.log(err);\n}", "error() {\n $(\".content\").html(\"Failed to load the sidebar!\");\n }", "function error() {\r\n $(\"#city\").html(\"There has been an error.</br>Try again later!\");\r\n $(\"#description\").html(\"\");\r\n}", "function showErrorISBN(data){\n\tvar error = document.getElementById(\"alertError1\"); \n\terror.className = 'alert alert-danger';\n\terror.innerHTML = data;\n\tdocument.getElementById(\"divISBN\").className = 'form-group has-error';\n\t\n}", "function createErrorDiv(errorType, errorMessage) {\n\n\n var serverErrorDiv = document.getElementById('server_error_div');\n\n /* Remove server error message div if its existing */\n if (serverErrorDiv != null) {\n var existingServerErrorMessageDiv = document.getElementById('server_message_div');\n if (existingServerErrorMessageDiv != null) {\n serverErrorDiv.removeChild(existingServerErrorMessageDiv);\n\n }\n }\n\n var errorDiv = document.getElementById('error_div');\n\n /* Remove client error div if its existing */\n var existingErrorMessageDiv = document.getElementById('message_div');\n if (existingErrorMessageDiv != null) {\n errorDiv.removeChild(existingErrorMessageDiv);\n\n }\n\n var messageDivElement = document.createElement('span');\n messageDivElement.setAttribute('id', 'message_div');\n //messageDivElement.setAttribute('class',errorType);\n messageDivElement.className = errorType;\n\n var imgElement = document.createElement('img');\n imgElement.setAttribute('src', 'page-resources/img/' + errorType +'.jpg');\n\n var newDivElement = document.createElement('div');\n newDivElement.className = 'jsErrorMessage';\n newDivElement.innerHTML = errorMessage;\n\n messageDivElement.appendChild(imgElement);\n messageDivElement.appendChild(newDivElement);\n errorDiv.appendChild(messageDivElement);\n\n}", "function afficherErreur(){\n\tconst carte=document.createElement(\"div\")\n\tcarte.className = 'card mb-3 col-8 col-md-8 col-lg-8'\n\tcarte.setAttribute(\"id\", \"erreur\");\n\tconst messageErreur=document.createElement(\"h2\")\n\tmessageErreur.textContent = \"Le serveur est indisponible pour le moment, veuillez réessayer plus tard\"\n\tcarte.appendChild(messageErreur)\n\tmain.appendChild(carte)\n}", "function handleErrorView () {\n document.getElementById(\"backButtonDiv\").innerHTML = \"\";\n document.getElementById(\"sortByDropdownDiv\").innerHTML = \"\";\n document.getElementById(\"modifyStudentDiv\").innerHTML = \"\";\n document.getElementById(\"toggleChangesDiv\").innerHTML = \"\";\n document.getElementById(\"uploadChangesDiv\").innerHTML = \"\";\n document.getElementById(\"selectedGroupDiv\").innerHTML = \"\";\n}", "function showError(error) {\n hideResults();\n hideLoading();\n const errorDiv = document.createElement('div');\n const card = document.querySelector('.card');\n const heading = document.querySelector('.heading');\n errorDiv.className = 'alert alert-danger';\n errorDiv.appendChild(document.createTextNode(error));\n card.insertBefore(errorDiv, heading);\n\n //Clear error after 3 sec\n setTimeout(clearError, 3000);\n}", "function displayError() {\n mainEl.empty();\n mainEl.append(`\n <section class=\"row\">\n <div id=\"details\" class=\"card col s10 m6 offset-s1 offset-m3 black white-text\">\n <div class=\"card-content center\">\n <h1 class=\"center\">An error occured.</h1>\n <h5>This can happen when something other than a ZIP code is entered, or when services used on this site are unavailable.</h5>\n </div>\n </div>\n </section>\n `);\n}", "function rendererror(resp) {\n document.removeEventListener('touchmove', handleTouchMove);\n $(\"#statustitle\").text(\"Réponse de l'API\");\n $(\"#mapdiv\").hide();\n $(\"#rendercontent\").html(\"<div style='height: 55px;'></div>\" + resp);\n}", "function errorDisplayFailed(el) {\n\t\tvar parentEl = el.parentElement;\n\t\tparentEl.removeAttribute('class', 'required')\n\t\tparentEl.className += 'input-wrap failed';\n\t}", "function mostrarError(mensaje) {\n // Creamos el parrafo de error\n const mensajeError = document.createElement('p');\n\n // Dentro de la etiqueta <p> </p> colocamos el texto\n mensajeError.textContent = mensaje;\n\n // Añadimos las clases de talwindcss a la etiqueta <p class=\"....\">\n mensajeError.classList.add(\n 'border',\n 'border-red-500',\n 'bg-red-100',\n 'text-red-500',\n 'p-3',\n 'mt-5',\n 'text-center',\n 'error'\n );\n\n // Me devuelve un array con todos los elementos que tengan la clase \"error\"\n const errores = document.querySelectorAll('.error');\n\n // Se coloca errores.length === 0 porque todavia no hemos añadido la clase \"error\" con el appendChild, ya que primero evaluamos si tiene la clase \"error\", luego si no lo tiene recien colocamos el mensajeError con SU CLASE \"error\"\n if (errores.length === 0) {\n formulario.appendChild(mensajeError);\n }\n}", "function draw_error() {\n\tdocument.getElementById(\"raw_output\").innerHTML = \"ERROR!\";\n}", "insertErrorMessage(){\n\t\t$(this.element + \"Error\").html(this.errorMessage);\n\t}", "function returnErrorMessage() {\n $('.result-line').text(\"That is not a valid response\");\n }", "function displayError() {\n\t\t// Hide loading animations\n\t\tdocument.getElementById(\"loadingmeaning\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadinggraph\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"none\";\n\t\t\n\t\t// Display error at bottom of the page\n\t\tdocument.getElementById(\"errors\").innerHTML =\n\t\t\t\"Sorry, but an error occured during your server request.\";\n\t}", "function createUploadErrorContainerDiv(uploadInputId) {\n if (!elementExist(uploadErrorContainerDivSelector)) {\n let html = '<div class=\"alert alert-danger\"' +\n ` id=\"${uploadErrorContainerDivId}\"` +\n ' style=\"display:none\" role=\"alert\"></div>';\n $(uploadContainerDivSelector).append(html);\n }\n }", "function showError(error) {\n\t//hide the loader image\n\tdocument.getElementById('loading').classList.remove('d-block');\n\n\t// create the div\n\tconst errorDiv = document.createElement('div');\n\n\t//grab the elements for inserting\n\tconst card = document.querySelector('.card');\n\tconst heading = document.querySelector('.heading');\n\n\t// add boostrap classes\n\terrorDiv.className = 'alert alert-danger';\n\n\t// create a text node from the passed in arg and append it to the div\n\terrorDiv.appendChild(document.createTextNode(error));\n\n\t// insert error above heading\n\tcard.insertBefore(errorDiv, heading);\n\n\t// Clear the error from the DOM after 1 seconds\n\tsetTimeout(clearError, 1000);\n}", "function displayError (errMsg) {\n $(\"#error-msg\").text(errMsg);\n $(\"#url-form,#loading,#content\").hide();\n $(\"#error\").show();\n}", "function oculta(){\n$(\"#errores\").html(\" \");\n}", "function throwErr(error) {\n document.getElementById('errors').innerHTML =\n document.getElementById('errors').innerHTML + '<br/>' +\n error;\n gridWidth = 0\n throw error;\n}", "function error() {\n\t//Checking for the presence of error div inside container, if so remove the error div\n\t\tif(document.querySelector('.error')) {\n\t\t\tdocument.querySelector('.error').parentElement.removeChild(document.querySelector('.error'));\n\t\t}\n\t\t\n\t\t//creating and adding error prompt\n\t\tconst errorPrompt = document.createElement('div');\n\t\terrorPrompt.className = 'error';\n\t\terrorPrompt.innerHTML = '<p>Enter something that you want to finish</p>'\n\t\t\t\t\t\n\t\tconst body = document.querySelector('.container');\n\t\tconst inputDiv = document.querySelector('.input');\n\t\tbody.insertBefore(errorPrompt, inputDiv);\n\t\t\t\n\t\t// Prompt will disapper after 3 seconds\n\t\tsetTimeout(() => {\n\t\t\terrorPrompt.style.display = 'None';\n\t\t\tinputElem.focus();\n\t\t}, 3000);\n}", "function error() {\n\t//Checking for the presence of error div inside container, if so remove the error div\n\t\tif(document.querySelector('.error')) {\n\t\t\tdocument.querySelector('.error').parentElement.removeChild(document.querySelector('.error'));\n\t\t}\n\t\t\n\t\t//creating and adding error prompt\n\t\tconst errorPrompt = document.createElement('div');\n\t\terrorPrompt.className = 'error';\n\t\terrorPrompt.innerHTML = '<p>Enter something that you want to finish</p>'\n\t\t\t\t\t\n\t\tconst body = document.querySelector('.container');\n\t\tconst inputDiv = document.querySelector('.input');\n\t\tbody.insertBefore(errorPrompt, inputDiv);\n\t\t\t\n\t\t// Prompt will disapper after 3 seconds\n\t\tsetTimeout(() => {\n\t\t\terrorPrompt.style.display = 'None';\n\t\t\tinputElem.focus();\n\t\t}, 3000);\n}", "function showError(input,massage){\n const formControl = input.parentElement;\n formControl.className = 'form-controll error';\n const small = formControl.querySelector('small');\n small.innerHTML = massage; \n}", "function debug_error_mode() {\n let err_msg = `\n <div class=\"col s12\">\n <div class=\"card horizontal\">\n <div class=\"card-stacked\">\n <div class=\"card-content\">\n <h4>Er is een fout opgetreden bij de server</h4>\n <p>ERROR</p>\n <div class=\"card-action\" style=\"margin-top:50px\">\n <a onclick=\"debug_off()\">Debug Off</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n `\n cardCont.innerHTML = err_msg\n}", "function showError(error) {\r\n switch(error.code) {\r\n case error.PERMISSION_DENIED:\r\n smthgwrong.textContent = \"Pro zobrazení počasí v aktuální oblasti prosím povolte přítup k poloze.\"\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n smthgwrong.textContent = \"Nebylo možné identifikovat polohu.\"\r\n break;\r\n case error.TIMEOUT:\r\n smthgwrong.textContent = \"Příkaz pro získaní polohy vypršel, zkuste to prosím znova.\"\r\n break;\r\n case error.UNKNOWN_ERROR:\r\n smthgwrong.textContent = \"Během procesu došlo k neznámé chybě.\"\r\n break;\r\n }\r\n}", "showErrorMessage (error) {\n let displayError = generateErrorMessage(error);\n\n this.DOMNodes.statusTitle.innerHTML = \"Error!\";\n this.DOMNodes.statusTitle.className = \"error\";\n this.DOMNodes.statusMessage.innerHTML = `<em>${displayError.type}</em>\\n\\n${displayError.message}`;\n\n // Connect any textual references in the error message to the actual referenced text.\n for (let [index, textReferenced] of displayError.references.entries()) {\n let reference = document.getElementById(`reference-${index}`);\n reference.addEventListener(\"mouseover\", () => this.DOMNodes.editor.classList.add(`show-referent-${index}`)); // This is a CSS hack.\n reference.addEventListener(\"mouseleave\", () => this.DOMNodes.editor.classList.remove(`show-referent-${index}`));\n reference.addEventListener(\"click\", () => textReferenced.DOMNode.scrollIntoView({block: \"center\"}));\n textReferenced.DOMNode.classList.add(\"error\");\n textReferenced.DOMNode.classList.add(`referent-${index}`);\n }\n\n this.selectTab(this.tabs[\"status\"]); // Automatically switch to the status tab to display the error.\n }", "productError() {\n\t\tthis.DOM.innerHTML = \"Oups, le produit demandé n'existe pas !\"\n\t}", "function showError(error) {\n // Hide Results\n document.getElementById('results').style.display = 'none';\n\n // Hide Loader\n document.getElementById('loading').style.display = 'none';\n\n // Create a div\n const errorDiv = document.createElement('div');\n\n // Get Element\n const card = document.querySelector('.card');\n const heading = document.querySelector('.heading');\n\n // Add a class\n errorDiv.className = 'alert alert-danger';\n // Create textNode and append to div\n errorDiv.appendChild(document.createTextNode(error));\n // Insert error above heading\n card.insertBefore(errorDiv, heading);\n // Clear error after 3 seconds\n setTimeout(clearError, 3000);\n}", "function display_ajax_alert_error(index, value, mfvid)\r\n{\r\n\tif (index === '__all__'){\r\n\t\t$('div.nonfield-ajax-error').remove();\r\n\t\t$(mfvid).prepend('<div class=\"alert callout nonfield-ajax-error\">'+value[0].message+'</div>');\r\n\t\tdocument.querySelector('.alert.callout.nonfield-ajax-error').scrollIntoView({ \r\n\t\t behavior: 'smooth' \r\n\t\t});\r\n\t}else{\r\n\t\t$(\"[name=\"+index+\"] + small.error\").remove();\t \t\t\t\t\t\r\n\t\t$(\"[name=\"+index+\"]\").after('<small class=\"error\">'+value[0].message+'</small>');\r\n\t}\r\n}", "function errorIndication (elementERR, typeErr) {\n //Name error\n if (elementERR == name) {\n belowName.appendChild(name_EM);\n }\n //Email errors\n if (elementERR == emailUser && typeErr == 'email_mailEmpty_EM') {\n //emailUser.labels[0].appendChild(email_mailEmpty_EM);\n belowMail.appendChild(email_mailEmpty_EM);\n } else if (elementERR == mail && typeErr == 'email_no_At_EM') {\n belowMail.appendChild(email_no_At_EM);\n } else if (elementERR == mail && typeErr == 'email_no_domain_EM') {\n belowMail.appendChild(email_no_domain_EM);\n } else if (elementERR == mail && typeErr == 'email_no_dot_EM') {\n belowMail.appendChild(email_no_dot_EM);\n } else if (elementERR == mail && typeErr == 'email_blank_Space_EM') {\n belowMail.appendChild(email_blank_Space_EM);\n } else if (elementERR == mail && typeErr == 'email_bad_Format_EM') {\n belowMail.appendChild(email_bad_Format_EM);\n }\n //Activities errors\n if (elementERR == activities) {\n activities.appendChild(activities_EM);\n }\n //Payment errors\n //we use a parente - parent Div because visually is better\n //and we don't have another option without change the HTML\n if (elementERR == ccnum) {\n belowPayment.insertBefore(ccnum_EM, belowPayment.firstElementChild)\n }\n if (elementERR == zipCode) {\n belowPayment.insertBefore(zipCode_EM, belowPayment.firstElementChild)\n }\n if (elementERR == cvvCode) {\n belowPayment.insertBefore(cvvCode_EM, belowPayment.firstElementChild)\n }\n //Finally, the visual touch\n formatErrorIndications(elementERR);\n }", "function renderMensajeError( mensaje ) {\n\tconst html = `\n\t\t<div class=\"row fixed-bottom\">\n\t\t\t<div class=\"col-md-3 ml-auto\">\n\t\t\t\t<div class=\"alert alert-danger alert-dismissible fade show text-center\" role=\"alert\" style=\"background-color: red; color: white; z-index: 10000;\">\n\t\t\t\t\t` + mensaje + `\n\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n\t\t\t\t\t<span aria-hidden=\"true\">&times;</span>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\tdocument.getElementById(\"mensaje\").innerHTML = \"\";\n\tdocument.getElementById(\"mensaje\").innerHTML = html;\n}", "function login_estado_error(msg)\n{\n $('#login_icono_espera').attr(\"style\", \"visibility: hidden; position: absolute;\");\n $('#login_fila_estado').attr(\"style\", \"visibility: visible; position: none;\");\n $('#login_msg_espera').text(\"\");\n $('#login_msg_error').text(msg); \n}", "function show_error(a,b){\n\t\t$('error_creacion').innerHTML=b+' : '+errores[a];\n\t}", "function showError() {\n transitionSteps(getCurrentStep(), $('.demo-error'));\n }", "function showError(element, errMsg) {\n\tYAHOO.util.Dom.addClass(element.id, \"error\");\n\tvar next = YAHOO.util.Dom.getNextSibling(element);\n\tvar errorMsg = document.createTextNode(errMsg);\n\t// Se l'elemento next ha una classe di tipo error-msg\n\tif (next && YAHOO.util.Dom.hasClass(next, \"error-msg\")) {\n\t\t// sostituiamo il messaggio contenuto nell'elemento figlio\n\t\tvar el = new YAHOO.util.Element(next);\n\t\tvar oldNode = el.get('firstChild');\n\t\tel.replaceChild(errorMsg, oldNode);\n\t} else {\n\t\t// l'elemento em non esiste e allora lo creiamo\n\t\tvar errorBlock = document.createElement(\"em\");\n\t\tYAHOO.util.Dom.addClass(errorBlock, \"error-msg\");\n\t\tYAHOO.util.Dom.insertAfter(errorBlock, element.id);\n\t\terrorBlock.appendChild(errorMsg);\n\t}\n\n}", "function ajax_error() {\n $(\"#error\").html(\"An error occurred -- try refreshing the page. If the problem persists, please contact the webmaster or try again later :(\").parents(\".alert\").slideDown(\"fast\");\n}", "function mostrar_menssagem_error(id ,msg) {\n var nova_msg = retira_caracteres_indesejados(msg);\n var msg = $(id).parent().append(\"<p class='p-erro'>\"+nova_msg+\"</p>\");\n $(id).addClass(\"error-input\");\n}", "showAlertAcessoParticipante(sucess_error,mensagem){\n if(sucess_error==='success'){\n const div = document.createElement('div')\n div.id = 'message'\n div.innerHTML = `\n <div class=\"container text-center mx-auto my-auto\" style=\"padding: 5px;\">\n <div id=\"inner-message\" class=\"alert alert-primary text-center\">\n <div class=\"\" style=\"width:11%!important;float:right\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n </div>\n <p>${mensagem}</p>\n </div>\n </div>\n `\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\n }\n if(sucess_error==='error'){\n const div = document.createElement('div')\n div.id = 'message'\n div.innerHTML = `\n <div class=\"container text-center mx-auto\" style=\"padding: 5px;\">\n <div id=\"inner-message\" class=\"alert alert-danger text-center\">\n <div class=\"\" style=\"width:11%!important;float:right\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n </div>\n <p>${mensagem}</p>\n </div>\n </div>\n `\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\n }\n setTimeout(() => {\n document.getElementById('message').remove()\n }, 3000);\n }", "function displayError() {\r\n let html = `${addBookmark()}<div id=\"error-message\">${store.error}</div>`;\r\n return html;\r\n}", "function ShowError(tx){\n\t$('#res').addClass('fail');\n\t$('#res').html(tx);\n\t$('#load').hide();\n\t$('#send').show();\n}", "async function erroCarregamento(error) {\n\n erroElemento = document.getElementById(\"loader\").childNodes[0];\n \n erroElemento.textContent = \"- Erro no carregamento -\" + error;\n}", "function displayError(msg) {\n $(\"#error-message\").html(msg);\n $(\"#error-wrapper\").show();\n $(\"#results-wrapper\").hide();\n}", "function printFormError(obj , message){\n //if this object has an error message than print a new message\n if ($('#' + obj + '_error').length > 0){\n $('#' + obj + '_error_message').text(message);\n $('#' + obj + '_error').fadeIn('fast', function(){\n setTimeout(\"$('#\" + obj + \"_error').fadeOut('normal');\",5000);\n });\n return;\n }\n \n //if we got here we have no object than we need to create a new one\n var html = '';\n html = '<div class=\"formerror\" id=\"'+ obj + '_error\">';\n html+='<img src=\"/img/Error.png\" />';\n html+='<span class=\"formerror_message\" id=\"' + obj + '_error_message\">';\n html+=message;\n html+='</span>';\n html+='</div>';\n $('body').append(html);\n \n //get the location top and left\n var top , left;\n top = $('#' + obj).offset().top+ $('#' + obj).outerHeight() - $('#' + obj).height() - 15;//$('#' + obj).position().top;\n left = $('#' + obj).offset().left + $('#' + obj).outerWidth();//$('#' + obj).position().left + $('#' + obj).width() + 10;\n \n //we created the object now it's time to make it appear and disappear in the correct location\n $('#' + obj + '_error').css(\"top\" , top);\n $('#' + obj + '_error').css(\"left\" , left);\n //$('#' + obj + '_error').css('display', 'block');\n $('#' + obj + '_error').fadeIn('normal' , function(){\n setTimeout(\"$('#\" + obj + \"_error').fadeOut('normal');\",5000);\n });\n \n}", "function mdm_error(message) { document.getElementById(\"error\").innerHTML = 'try again'; }", "function showErr(err){\n\tconst outputElem = $('#results');\n\tconst errMsg = (\n\t\t\t`<p class=font>No results found.</p>`\n\t\t);\n\toutputElem.html(errMsg);\n}", "function crearError(str1) {\n var error = $(\"#fpreguntas\").find(\"#pErr\");\n\n if(error.length <= 0) {\n error = $('<p></p>');\n error.attr(\"id\", \"pErr\");\n $(\"#fpreguntas\").before(error);\n }\n\n error.text(str1);\n }", "function mostraResultado(){\n\n\tvar resultado = document.getElementById(\"divResultado\"); // procura o elemto com o id informado. No caso, a div onde sera colocada o resultado da partida\n\n\t// atibui ao resultado da pesquisa os valores das marcacoes corretas e erradas\n\tresultado.innerHTML = \"<font color= green>Erro(s) Encontrado(s): \" + numErrosEncontrados + \"</font></br>\" +\n\t\"<font color= #DAA520>Erro(s) Não Marcado(s): \" + numNaoMarcados + \"</font></br>\" +\n\t\"<font color= red>Marcação(ões) Errada(s): \" + numMarcacoesIncorretas+ \"</font>\"\n\n}", "function drawRegistrationError() {\r\n var container = document.getElementById('welcome');\r\n container.innerHTML = \"<span class='error'>Registration form couldn't load!</span>\" + container.innerHTML;\r\n}", "function showError(str) {\n log.warn(str);\n $('#charts-status').addClass('hidden');\n $('#charts-error').removeClass('hidden');\n $('#charts-error').html(str);\n}", "function error(err) {\r\n notificationElement.style.display = \"block\"\r\n notificationElement.innerHTML = `<p>${err.message}</p>`\r\n}", "function errorMessage(id, error) {\n DOC.iSel(id).innerHTML = error;\n}", "function errorMessage(message) {\r\n\t$(\"#errorMessageContent\").text(message);\r\n\t$(\"#errorMessage\").css(\"display\", \"flex\");\r\n}", "function errore(tipo) {\n var source = $('#errore-template').html();\n var template = Handlebars.compile(source);\n var context = {\n \"errore\" : \"la ricerca non ha prodotto risultati nella sezione \" + tipo\n }\n var html = template(context);\n if (tipo === \"Film\") {\n $('#objectsFilm').append(html);\n }else if (tipo === \"Serie TV\") {\n $('#objectsSerieTV').append(html);\n }\n }", "function showErrors(e) {\n $(\"#searchInput\").css({\n \"border-color\": \"red\",\n \"position\": \"relative\",\n \"right\": \"30px\",\n \"font-size\": \"30px\"\n })\n $(\"#errorsP\").html(e);\n}", "function errorMessage() {\n let messageError = \"\";\n messageError += `<p class=\"fw-bold text-center fs-1\">\"Petit problème de connexion au serveur... 🥺\"</p>`\n document.querySelector(\".error\").innerHTML = messageError;\n}", "async function appDisplayErrHandling(m) {\n\n // re-format the message to get rid of the hyperlink\n m = await reconstructStrings(m);\n \n // create a div element\n const errorDiv = document.createElement('div');\n\n // style the text\n errorDiv.style.textAlign = 'center';\n errorDiv.style.position = 'absolute';\n errorDiv.style.top = '50%';\n errorDiv.style.transform = 'translateY(-50%)';\n errorDiv.style.width = '100%';\n errorDiv.style.padding = '15px';\n errorDiv.style.backgroundColor = 'rgba(255, 0, 0, 0.75)';\n errorDiv.style.color = 'rgba(255, 255, 255, 0.75)';\n\n // append text to the element\n errorDiv.innerHTML = m;\n\n document.body.appendChild(errorDiv);\n}", "function showMessage(res) {\n\t\tvar target = document.getElementById(\"invalid-container\");\n\t\tif (res == 'fail') {\n\t\t\tif($('#invalid-container').children().length == 0) {\n\t\t\t\tvar div = document.createElement('div');\n\t\t\t\tdiv.textContent = 'Invalid username or password';\n\t\t\t\tdiv.setAttribute('id', 'invalid');\n\t\t\t\ttarget.appendChild(div);\n\t\t\t}\n\t\t} else {\n\t\t\twindow.location='http://www.hsd-studio.com/';\n\t\t}\n\t}", "function gestionErreurMessage(error){\n const erreurMessage = document.getElementById(\"erreurServeur\")\n const erreurMessagePre = document.createElement(\"div\")\n erreurMessagePre.classList.add(\"modal-dialog\", \"modal-dialog-centered\")\n erreurMessagePre.innerHTML = `\n <div class=\"modal-content border-danger\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title text-danger h5\">Erreur !</h3>\n </div>\n <div class=\"modal-body\" id=\"typeErreur\">\n Le serveur a rencontré une erreur !<br>\n <code>${error}</code><br>\n Essayer de recharger la page ou revenir plus tard.<br>\n Nous faisons tout notre possible pour remédier à ce problème dans les meilleurs délais.\n </div>\n <div class=\"modal-footer\">\n <a href=\"${window.location}\" class=\"btn btn-block btn-danger\">Recharger la page</a>\n </div>\n </div>`\n erreurMessage.appendChild(erreurMessagePre)\n $('#erreurServeur').modal('show')\n}" ]
[ "0.7008638", "0.69961274", "0.69961274", "0.69961274", "0.6962554", "0.6962554", "0.69369745", "0.6925622", "0.6873783", "0.68043685", "0.6803586", "0.67778665", "0.67504525", "0.6746877", "0.6696671", "0.66926026", "0.6682551", "0.6634087", "0.66321623", "0.6630037", "0.66187465", "0.661484", "0.6601629", "0.65872747", "0.6576303", "0.6563623", "0.6559408", "0.6540766", "0.6539691", "0.6524994", "0.65223247", "0.65035194", "0.6499843", "0.64928204", "0.6490873", "0.6486793", "0.6481116", "0.6480123", "0.64789677", "0.64745176", "0.64737654", "0.64614487", "0.6457599", "0.64359087", "0.6418923", "0.6411287", "0.6410299", "0.64098096", "0.63974464", "0.6395034", "0.6388053", "0.6385619", "0.6385295", "0.63708264", "0.637024", "0.6370196", "0.6360872", "0.63581073", "0.635548", "0.6354701", "0.6351409", "0.63504744", "0.63433015", "0.63433015", "0.6340271", "0.63380146", "0.6336826", "0.63336563", "0.6332648", "0.6331351", "0.63057405", "0.62998927", "0.6299029", "0.6297497", "0.6296826", "0.62935054", "0.6289599", "0.6286562", "0.62854105", "0.6280098", "0.62784195", "0.62760556", "0.6275696", "0.627517", "0.6275156", "0.6274853", "0.62744135", "0.6264099", "0.62621653", "0.62581265", "0.6257024", "0.6256838", "0.62535906", "0.625253", "0.62488246", "0.6245653", "0.6245532", "0.6239311", "0.62372255", "0.62365276" ]
0.6918795
8
Refresca los datos de la cabecera conforme a diagrama actual
function refCabecera() { if (currentSetId == 'analitico') { resumAnali(); } else if (currentSetId == 'sinoptico') { resumSinop(); } else if (currentSetId == 'recorrido') { resumRecorr(); } else if (currentSetId == 'bimanual') { resumBim(); } else if (currentSetId == 'hom-maq') { resumHM(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarDatosCabecera() {\n $(\".nombre\").text(nombre)\n $(\".titulo\").text(titulo)\n $(\"#resumen\").text(resumen)\n $(\"#email\").text(contacto.mail)\n $(\"#telefono\").text(contacto.telefono)\n $(\"#direccion\").text(`${contacto.calle} ${contacto.altura}, ${contacto.localidad}`)\n}", "function addDataDiagramm(Buid) { \r\n var VehicleFMSInfo = {\r\n FirmID: FirmID,\r\n BUID: Buid,\r\n Start: DiTel.LoadTimeDomain.StartTime,\r\n End: DiTel.LoadTimeDomain.EndTime,\r\n };\r\n $(\"#Div_Diagramm\").show();\r\n //GROUP setzen in die Diagramme\r\n setDiagrammGroups();\r\n setDiagrammItems(VehicleFMSInfo);\r\n\r\n //Legende bauen;\r\n DiTel.populateExternalLegend();\r\n\r\n// //Timeline Daten laden\r\n addDataTimeline(Buid);\r\n\r\n}", "function carga_logica_informe_anatomia_coronaria() {\r\n\tinicializar_variables_anatomia_coronaria();\r\n\tactualizarDibujoCanvasAnatomiaCoronaria();\r\n\treiniciar_control_seleccion_lesion();\r\n\tcargar_areas_de_seleccion_arterias();\r\n\tcargar_coordenadas_de_lesiones();\r\n}", "function loadData(){\n\t\tloadParetoData();\n\t\tloadConstraints();\n\t\t\n\t}", "function cargarCgg_res_beneficiarioCtrls(){\n if(inInfoPersona.CRPER_CODIGO_AUSPICIANTE != undefined && inInfoPersona.CRPER_CODIGO_AUSPICIANTE.length>0){\n if(inInfoPersona.CRPJR_CODIGO.length>0)\n {\n txtCrper_codigo.setValue(inInfoPersona.CRPJR_RAZON_SOCIAL);\n tmpAuspiciantePJ = inInfoPersona.CRPJR_CODIGO;\n txtCrpjr_representante_legal.setValue(inInfoPersona.CRPER_NOMBRE_AUSPICIANTE);\n tmpAuspiciante= inInfoPersona.CRPER_CODIGO_AUSPICIANTE;\n rdgTipoAuspiciante.setValue('rdgTipoAuspiciante',TypeAuspiciante.JURIDICA);\n }\n else\n {\n txtCrper_codigo.setValue(inInfoPersona.CRPER_NOMBRE_AUSPICIANTE);\n tmpAuspiciante= inInfoPersona.CRPER_CODIGO_AUSPICIANTE;\n rdgTipoAuspiciante.setValue('rdgTipoAuspiciante',TypeAuspiciante.NATURAL);\n }\n }\n }", "function HistoriaClinica() { //-------------------------------------------Class HistoriaClinica()\n\n this.a = [];\n\n HistoriaClinica.prototype.cargarData = function (data) {\n this.a = data;\n this.a.Adjuntos = [];\n // // this.a.II;\n // this.a.II_BD = 0;//estado inicial, se puede ir al servidor a buscar la informacion.\n }\n\n} //-------------------------------------------Class HistoriaClinica()", "function rp_planif_contratacion_vs_trab_cubrir(data, id_contenedor, cliente, ubicacion, callback) {\r\n\tif (d3.select('#' + id_contenedor).node()) {\r\n\t\tlimpiarContenedor('id_contenedor');\r\n\r\n\t\tres_contratacion = d3.nest()\r\n\t\t\t.key((d) => d.cod_cliente).sortKeys(d3.ascending)\r\n\t\t\t.key((d) => d.cod_ubicacion).sortKeys(d3.ascending)\r\n\t\t\t.entries(data['contrato']);\r\n\r\n\t\tres_activos = d3.nest()\r\n\t\t\t.key((d) => d.cod_ubicacion).sortKeys(d3.ascending)\r\n\t\t\t.entries(data['trab_activos']);\r\n\r\n\t\tif (data['excepcion'] !== undefined) {\r\n\t\t\tres_excepcion = d3.nest()\r\n\t\t\t\t.key((d) => d.cod_ubicacion).sortKeys(d3.ascending)\r\n\t\t\t\t.entries(data['excepcion']);\r\n\t\t\tvar map_res_excepcion = d3.map(res_excepcion, (d) => d.key);\r\n\t\t}\r\n\r\n\t\tvar map_res_activos = d3.map(res_activos, (d) => d.key);\r\n\r\n\t\td3.select('#' + id_contenedor).append('table').attr('id', 't_reporte').attr('width', '100%').attr('border', 0).attr('align', 'center');\r\n\t\td3.select('#t_reporte').append('thead').attr('id', 'thead');\r\n\t\td3.select('#t_reporte').append('tbody').attr('id', 'tbody');\r\n\t\td3.select('#thead').append('tr').attr('class', 'fondo00')\r\n\t\t\t.html('<th width=\"25%\" class=\"etiqueta\">Region</th>' +\r\n\t\t\t\t'<th width=\"25%\" class=\"etiqueta\">Estado</th>' +\r\n\t\t\t\t'<th width=\"25%\" class=\"etiqueta\">Empresa</th>' +\r\n\t\t\t\t'<th width=\"25%\" class=\"etiqueta\">ubicacion</th>' +\r\n\t\t\t\t'<th width=\"10%\" class=\"etiqueta\">Pl. Cantidad </th>' +\r\n\t\t\t\t'<th width=\"10%\" class=\"etiqueta\">Trab. Necs.</th>' +\r\n\t\t\t\t'<th width=\"10%\" class=\"etiqueta\">Hombres Activos</th>' +\r\n\t\t\t\t'<th width=\"10%\" class=\"etiqueta\">Pl. Excepcion</th>' +\r\n\t\t\t\t'<th width=\"10%\" class=\"etiqueta\">Diferencia</th>');\r\n\t\td3.select('#t_reporte').selectAll('.tbody2').data(res_contratacion).enter().append('tbody').attr('class', 'tbody2')\r\n\t\t\t.attr('id', (d) => {\r\n\t\t\t\treturn 'body_' + d.key;\r\n\t\t\t});\r\n\r\n\t\tres_contratacion.forEach((d) => {\r\n\t\t\td3.select('#body_' + d.key).selectAll('tr').data(d.values).enter().append('tr')\r\n\t\t\t\t.attr('class', (e) => {\r\n\t\t\t\t\tfactor = 0, trab_neces = 0, trab_activos = 0, excepcion = 0, color = ''; cantidad = 0;\r\n\t\t\t\t\tif (data['excepcion'] !== undefined) {\r\n\t\t\t\t\t\tif (map_res_excepcion.has(e.key)) {\r\n\t\t\t\t\t\t\texcepcion = Number(map_res_excepcion.get(e.key).values[0].cantidad);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\te.values.forEach((f, i) => {\r\n\t\t\t\t\t\tcantidad += Number(f.cantidad);\r\n\t\t\t\t\t\ttrab_neces += Number(f.trab_neces);\r\n\t\t\t\t\t\tif (i == 0) {\r\n\t\t\t\t\t\t\tif (map_res_activos.has(f.cod_ubicacion)) {\r\n\t\t\t\t\t\t\t\tmap_res_activos.get(f.cod_ubicacion).values.forEach((g) => {\r\n\t\t\t\t\t\t\t\t\ttrab_activos += Number(g.cantidad);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tfactor = (trab_activos - excepcion) - trab_neces;\r\n\t\t\t\t\tcolor = 'color ' + validarFondo(factor);\r\n\t\t\t\t\treturn color;\r\n\t\t\t\t}).html((e) => {\r\n\t\t\t\t\tfactor = 0, trab_neces = 0, trab_activos = 0, excepcion = 0; cantidad = 0;\r\n\t\t\t\t\tif (data['excepcion'] !== undefined) {\r\n\t\t\t\t\t\tif (map_res_excepcion.has(e.key)) {\r\n\t\t\t\t\t\t\texcepcion = Number(map_res_excepcion.get(e.key).values[0].cantidad);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\te.values.forEach((f, i) => {\r\n\t\t\t\t\t\tcantidad += Number(f.cantidad);\r\n\t\t\t\t\t\ttrab_neces += Number(f.trab_neces);\r\n\t\t\t\t\t\tif (i == 0) {\r\n\t\t\t\t\t\t\tif (map_res_activos.has(f.cod_ubicacion)) {\r\n\t\t\t\t\t\t\t\tmap_res_activos.get(f.cod_ubicacion).values.forEach((g) => {\r\n\t\t\t\t\t\t\t\t\ttrab_activos += Number(g.cantidad);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tfactor = Math.floor((trab_activos - excepcion) - trab_neces);\r\n\t\t\t\t\tif (factor == 0) factor = 'OK';\r\n\t\t\t\t\treturn '<td class=\"texto\" id=\"center\" >' + e.values[0].region + '</td><td class=\"texto\" id=\"center\" >' + e.values[0].estado + '</td><td class=\"texto\" id=\"center\" >' + e.values[0].cliente + '</td><td class=\"texto\" id=\"center\" >' + e.values[0].ubicacion + '</td><td class=\"texto\" id=\"center\" >' + cantidad\r\n\t\t\t\t\t\t+ '</td><td class=\"texto\" id=\"center\" >' + trab_neces + '</td><td class=\"texto\" id=\"center\" >' + trab_activos + '</td><td class=\"texto\" id=\"center\" >' + excepcion + '</td><td class=\"texto\" id=\"center\" >' + factor + '</td>';\r\n\t\t\t\t});\r\n\t\t});\r\n\t\tif (typeof (callback) == 'function') callback();\r\n\t}\r\n}", "function afficherGraphe() {\n\t\n\t\n\t\t// Création du graphe\n\t\tvar chart = new AmCharts.AmSerialChart();\n\t\tchart.dataProvider = chartData;\n\t\tchart.categoryField = \"country\";\n\t\tvar graph = new AmCharts.AmGraph();\n\t\tgraph.valueField = \"visits\";\n\t\tgraph.type = \"column\";\n\t\tchart.addGraph(graph);\n\t\tchart.write('statistiques');\n\n\n}", "function cargarCgg_gem_informacion_laboralCtrls(){\n\t\tif(inRecordCgg_gem_informacion_laboral){\n\t\t\ttxtCginf_codigo.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_CODIGO'));\n\t\t\ttxtCrper_codigo.setValue(inRecordCgg_gem_informacion_laboral.get('CRPER_CODIGO'));\n\t\t\ttxtCginf_disponibilidad.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_DISPONIBILIDAD'));\n\t\t\tcbxCginf_Calificacion.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_VEHICULO'))||0;\n\t\t\tsetCalificacion(cbxCginf_Calificacion.getValue());\n\t\t\ttxtCginf_licencia_conducir.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_LICENCIA_CONDUCIR'));\n\t\t\tchkCginf_discapacidad.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_DISCAPACIDAD'));\n\t\t\ttxtCginf_estado_laboral.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_ESTADO_LABORAL'));\n\t\t\ttxtCginf_observaciones.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_OBSERVACIONES'));\n\t\t\tisEdit = true;\t\t\n\t}}", "function cargarDatosChart(json, id, type) {\n dataYlabels = generaDatasLabels(json);\n ctx = document.getElementById(id).getContext('2d');\n let activarbarraStac = (type != 'line') ? {\n x: {\n stacked: true\n },\n y: {\n stacked: true\n }\n } : {\n x: {\n stacked: false\n },\n y: {\n stacked: false\n }\n };\n config = {\n type: type,\n data: {\n labels: dataYlabels[0],\n datasets: dataYlabels[1]\n },\n options: {\n plugins: {\n legend: {\n labels: {\n // This more specific font property overrides the global property\n font: {\n size: 10\n }\n }\n }\n },\n scales: activarbarraStac\n }\n };\n nuevaGrafica(ctx, config)\n}", "function detallesCabello(){\n\t //petición para obtener los detalles de cabello.\n\t $.ajax({\n\t url: routeDescrip+'/get_cabello/'+extraviado,\n\t type:\"GET\",\n\t dataType:\"json\",\n\n\t success:function(data) {\n\t \n\t $.each(data, function(key, value){ \n\t $(\"#pCabello\").empty();\n\n\t if(value.tenia == \"SÍ\"){\n\t $(\"#pCabello\").show();\n\t $(\"#pCabello\").append('<div class=\"card\">'+\n\t '<div class=\"card-header bg-white\">'+\n\t '<h5><b>Datos del cabello</b></h5>'+\n\t '</div>'+\n\t '<div class=\"card-body\">'+\n\t '<div class=\"row\" >'+\n\t '<div class=\"col-4\">'+\n\t '<label>Color:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.color+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Tamaño:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.tamano+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Tipo:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.tipo+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Particularidades:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.particularidades+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Modificaciones:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.modificaciones+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Observaciones:</label>'+\n\t '</div>'+\n\n\t '<div class=\"col\">'+\n\t '<p>'+value.observaciones+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>');\n\t }else{\n\t $(\"#pCabello\").hide();\n\t } \n\n\t \n\n\n\t });\n\n\t },\n\t \n\t });// fin de petición de talles de cabello\n\n\t //peticion para obtener detalles de barba\n\t $.ajax({\n\t url: routeDescrip+'/get_barba/'+extraviado,\n\t type:\"GET\",\n\t dataType:\"json\",\n\n\t success:function(data) {\n\t \n\t $.each(data, function(key, value){ \n\t pCabello \n\t $(\"#pBarba\").empty();\n\t if(value.tenia == \"SÍ\"){\n\t $(\"#pBarba\").show();\n\t $(\"#pBarba\").append('<div class=\"card\">'+\n\t '<div class=\"card-header bg-white\">'+\n\t '<h5><b>Datos de la barba</b></h5>'+\n\t '</div>'+\n\t '<div class=\"card-body\">'+\n\t '<div class=\"row\" >'+\n\t '<div class=\"col-4\">'+\n\t '<label>Color:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.color+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Tipo:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.tipo+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Estilo:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.estilo+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Observaciones:</label>'+\n\t '</div>'+\n\n\t '<div class=\"col\">'+\n\t '<p>'+value.observaciones+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>');\n\t }else{\n\t $(\"#pBarba\").hide();\n\t }\n\t \n\t });\n\t },\n\t });// fin de detalles de barba.\n\n\t //peticion para obtener detalles de bigote.\n\t $.ajax({\n\t url: routeDescrip+'/get_bigote/'+extraviado,\n\t type:\"GET\",\n\t dataType:\"json\",\n\n\t success:function(data) {\n\t \n\t $.each(data, function(key, value){ \n\t $(\"#pBigote\").empty();\n\n\t if(value.tenia == \"SÍ\"){\n\t $(\"#pBigote\").show();\n\t $(\"#pBigote\").append('<div class=\"card\">'+\n\t '<div class=\"card-header bg-white\">'+\n\t '<h5><b>Datos del bigote</b></h5>'+\n\t '</div>'+\n\t '<div class=\"card-body\">'+\n\t '<div class=\"row\" >'+\n\t '<div class=\"col-4\">'+\n\t '<label>Color:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.color+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Tipo:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.tipo+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Estilo:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.estilo+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Observaciones:</label>'+\n\t '</div>'+\n\n\t '<div class=\"col\">'+\n\t '<p>'+value.observaciones+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>');\n\n\t }else{\n\t $(\"#pBigote\").hide();\n\t }\n\t \n\t });\n\n\t },\n\t \n\t });// fin de detalles de bigote.\n\n\t //peticion para obtener detalles de patilla\n\t $.ajax({\n\t url: routeDescrip+'/get_patilla/'+extraviado,\n\t type:\"GET\",\n\t dataType:\"json\",\n\n\t success:function(data) {\n\t \n\t $.each(data, function(key, value){ \n\t $(\"#pPatilla\").empty();\n\n\t if(value.tenia == \"SÍ\"){\n\t $(\"#pPatilla\").show();\n\t $(\"#pPatilla\").append('<div class=\"card\">'+\n\t '<div class=\"card-header bg-white\">'+\n\t '<h5><b>Datos de las patillas</b></h5>'+\n\t '</div>'+\n\t '<div class=\"card-body\">'+\n\t '<div class=\"row\" >'+\n\t '<div class=\"col-4\">'+\n\t '<label>Color:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.color+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Tipo:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.tipo+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Estilo:</label>'+\n\t '</div>'+\n\t '<div class=\"col\">'+\n\t '<p>'+value.estilo+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\n\t '<div class=\"row\" style=\"margin-top:-10px\">'+\n\t '<div class=\"col-4\">'+\n\t '<label>Observaciones:</label>'+\n\t '</div>'+\n\n\t '<div class=\"col\">'+\n\t '<p>'+value.observaciones+'</p>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>');\n\t }else{\n\t $(\"#pPatilla\").hide();\n\n\t }\n\t \n\t });\n\t }, \n\t });// fin de detalles de patilla\n\t}", "function loadFondo()\n{\n fondo.cargaOk = true;\n draw();\n}", "function infogral(cabinet) {\n vm.asset = cabinet;\n if (vm.puncture) {\n vm.puncture.cabinet_id = vm.asset.economico;\n }\n }", "function crearDiagramaDeBarras(json){\r\n\t//alert(\"json a mostrar en charts: \" + json);\r\n\tvar etiquetas = devolverEtiquetas(json);\r\n\t//alert(\"tiene: \"+etiquetas.lenght);\r\n\tconsole.log(\"json para el chart:\");\r\n\tconsole.log(json);\r\n\tvar etiquetasEnArray = devolverEtiquetasEnArray(json);\r\n\tvar valoresBarras = devolverValoresBarra(json);\r\n\tvar colorFondoBarras = devolverColorFondoBarra(json);\r\n\tvar colorBordeBarras = devolverColorFondoContornoBarra(json); //REVIENTA\r\n\tconsole.log(\"devolverEtiquetas\");\r\n\tconsole.log(\"Esto es etiquetas en Array: \"+etiquetasEnArray);\r\n\t\r\n\t\r\n\tvar c = document.getElementById(\"myChart\");\r\n\tvar ctx = c.getContext(\"2d\");\r\n\t\r\n\tvar myChart = new Chart(ctx, {\r\n\t type: 'bar',\r\n\t data: {\r\n\t labels: etiquetasEnArray, /* agregar los distintos valores de respuesta aqui para nombre de barras*/\r\n\t datasets: [{\r\n\t label: 'N. de veces',\r\n\t data: valoresBarras, /* agregar aqui los datos (numericos) para los anteriores mercionados */\r\n\t backgroundColor: colorFondoBarras,\r\n\t borderColor: [ \t\t\t\t/* es el mismo que el de arriba pero mas solido (4º valor) */\r\n\t 'rgba(255,99,132,1)',\r\n\t 'rgba(54, 162, 235, 1)',\r\n\t 'rgba(153, 102, 255, 1)',\r\n\t 'rgba(255, 159, 64, 1)'\r\n\t ],\r\n\t borderWidth: 1\r\n\t }]\r\n\t },\r\n\t options: {\r\n\t scales: {\r\n\t yAxes: [{\r\n\t ticks: {\r\n\t beginAtZero:true,\r\n//\t barPercentage: 0.5\r\n\t }\r\n\t }]\r\n\t }\r\n\t }\r\n\t});\t\r\n\r\n}", "function _CarregaFeiticos() {\n for (var chave_classe in tabelas_feiticos) {\n gPersonagem.feiticos[chave_classe] = {\n atributo_chave: tabelas_feiticos[chave_classe].atributo_chave,\n conhecidos: {},\n slots: {},\n };\n for (var i = 0; i <= 9; ++i) {\n gPersonagem.feiticos[chave_classe].conhecidos[i] = [];\n gPersonagem.feiticos[chave_classe].slots[i] = {\n atributo_chave: tabelas_feiticos[chave_classe].atributo_chave,\n base: 0,\n bonus_atributo: 0,\n feiticos: [],\n feitico_dominio: null,\n };\n }\n }\n\n // Tabela invertida de feiticos.\n for (var classe in tabelas_lista_feiticos) {\n for (var nivel in tabelas_lista_feiticos[classe]) {\n for (var chave_feitico in tabelas_lista_feiticos[classe][nivel]) {\n var feitico = tabelas_lista_feiticos[classe][nivel][chave_feitico];\n tabelas_lista_feiticos_invertida[StringNormalizada(feitico.nome)] = chave_feitico;\n tabelas_lista_feiticos_completa[chave_feitico] = feitico;\n }\n }\n }\n}", "function cargarCgg_res_beneficiarioCtrls(){\n if(inRecordCgg_res_beneficiario!== null){\n if(inRecordCgg_res_beneficiario.get('CRPER_CODIGO'))\n {\n txtCrben_codigo.setValue(inRecordCgg_res_beneficiario.get('CRPER_CODIGO'));\n txtCrben_nombres.setValue(inRecordCgg_res_beneficiario.get('CRPER_NOMBRES'));\n txtCrben_apellido_paterno.setValue(inRecordCgg_res_beneficiario.get('CRPER_APELLIDO_PATERNO'));\n txtCrben_apellido_materno.setValue(inRecordCgg_res_beneficiario.get('CRPER_APELLIDO_MATERNO'))\n txtCrben_num_doc_identific.setValue(inRecordCgg_res_beneficiario.get('CRPER_NUM_DOC_IDENTIFIC'));\n cbxCrben_genero.setValue(inRecordCgg_res_beneficiario.get('CRPER_GENERO'));\n cbxCrdid_codigo.setValue(inRecordCgg_res_beneficiario.get('CRDID_CODIGO'));\n cbxCrecv_codigo.setValue(inRecordCgg_res_beneficiario.get('CRECV_CODIGO'));\n cbxCpais_nombre_nacimiento.setValue(inRecordCgg_res_beneficiario.get('CPAIS_CODIGO'));\n var tmpFecha = null;\n if(inRecordCgg_res_beneficiario.get('CRPER_FECHA_NACIMIENTO')== null || inRecordCgg_res_beneficiario.get('CRPER_FECHA_NACIMIENTO').trim().length ==0){\n tmpFecha = new Date();\n }else{\n tmpFecha = Date.parse(inRecordCgg_res_beneficiario.get('CRPER_FECHA_NACIMIENTO'));\n }\n dtCrper_fecha_nacimiento.setValue(tmpFecha);\n }\n if(inRecordCgg_res_beneficiario.get('CRPER_REQUISITOS_JSON')){\n gsCgg_res_solicitud_requisito.loadData(Ext.util.JSON.decode(inRecordCgg_res_beneficiario.get('CRPER_REQUISITOS_JSON')),true);\n }else{\n gsCgg_res_solicitud_requisito.reload({\n params:{\n inCrtra_codigo:null, \n inCrtst_codigo:INRECORD_TIPO_SOLICITUD.get('CRTST_CODIGO'),\n format:TypeFormat.JSON\n }\n });\n }\n }\n }", "function createVisRecipes(error,data1,data2) {\n // Create an object instance\n categories_ingredients=data2;\n //console.log(data_ingredients)\n forceplot = new ForceDiagram(\"force-layout\", data1,categories_ingredients,900,900*.6,120);\n}", "function mostrarDatosCompra() {\n //Tomo los datos que pasé en la funcion navegar\n const unaCompra = this.data;\n if (unaCompra) {\n const idProd = unaCompra.idProducto;\n const productoComprado = obtenerProductoPorID(idProd);\n const subTotal = unaCompra.cantidad * productoComprado.precio;\n //Escribo el mensaje a mostrar\n const mensaje = `Producto <strong>${productoComprado.nombre}</strong>.\n <br> Cantidad comprada: <strong>${unaCompra.cantidad}</strong>.<br>\n Sub Total: <strong> $${subTotal}</strong>`;\n //Muestro el mensaje\n $(\"#pDetalleCompraMensaje\").html(mensaje);\n } else {\n ons.notification.alert(\"Ocurrió un error, por favor contacte al administrador\", { title: 'Oops!' });\n }\n}", "function showDatosFacturacion() {\n fillSelect();\n showInfoClient();\n}", "function init_inpt_formulario_cargar_categoria() {\n // input para el icono\n init_inpt_formulario_cargar_categoria_icono();\n\n // input para el color\n init_inpt_formulario_cargar_categoria_color();\n}", "function loadData()\n\t{\n\t\tloadMaterials(false);\n\t\tloadLabors(false);\n\t}", "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "function actualizarDatos(chart, lbl, array_data) {\n chart.data.datasets.forEach((dataset) => {\n dataset.label = 'Numero de ventas de ' + lbl;\n });\n chart.data.datasets.forEach((dataset) => {\n dataset.data = array_data;\n });\n chart.update();\n}", "function cargarDulces() {\n // inicio carga de caramelo en tablero\n function dulce(r,c,obj,src) {\n return {\n r: r, \n c: c, \n src:src, \n locked:false, \n isInCombo:false, \n o:obj \n };\n }\n\n // preparando el tablero\n for (var r = 0; r < rows; r++) {\n grid[r]=[];\n for (var c =0; c < cols; c++) {\n grid[r][c]= new dulce(r,c,null,azarDulce());\n }\n }\n\n // Coordenadas iniciales:\n var height = $('.panel-tablero').height(); \n var cellHeight = height / 7;\n\n // creando imagenes en el tablero\n for (var r = 0; r < rows; r++) {\n for (var c =0; c< cols; c++) {\n var cell = $(\"<img class='dulce' id='dulce_\"+r+\"_\"+c+\"' r='\"+r+\"' c='\"+c+\n \"'ondrop='_onDrop(event)' ondragover='_onDragOverEnabled(event)'src='\"+\n grid[r][c].src+\"' style='height:\"+cellHeight+\"px'/>\");\n cell.attr(\"ondragstart\",\"_ondragstart(event)\");\n $(\".col-\"+(c+1)).append(cell);\n grid[r][c].o = cell;\n }\n }\n}", "function graficar(conjunto,relacion,rel,conj) \n{\n\t//arreglo de los nodos y las arista o relacion de pares\n\tvar nodes_object = [];\n\tvar edges_object = [];\n\tfor(var i=0;i<conjunto.length;i++)\n\t{\n\t\tnodes_object.push({id: conjunto[i], label:conjunto[i]});\n\t}\n\tfor(var j=0;j<relacion.length;j++)\n\t{\n\t\tedges_object.push({from:relacion[j].izquierda, to: relacion[j].derecha, label:relacion[j].valor});\t\t\n\t}\n \n\t//grafica \n\tvar nodes = new vis.DataSet(nodes_object);\n var edges = new vis.DataSet(edges_object);\n\tcrearPopup(rel,conj);\n var container = ventanaGrafica.document.getElementById(\"visualization\");\n \tvar data = {nodes: nodes,edges: edges};\n var options = {};\n var network = new vis.Network(container, data, options);\n}", "function Filtro() {\n \n obj = this; \n\n // Public methods \n this.consultar = consultar;\n// this.consultarDetalhe = consultarDetalhe;\n this.merge = merge;\n \n \n this.incluir = incluir; \n this.confirmar = confirmar; \n this.alterar = alterar; \n this.cancelar = cancelar; \n this.excluir = excluir; \n \n this.changeDataInicial = changeDataInicial;\n this.changeDataFinal = changeDataFinal;\n this.changeDataCorrente = changeDataCorrente;\n \n this.Modal = Modal; \n \n this.ORDER_BY = 'ID*1';\n this.INCLUINDO = false;\n this.ALTERANDO = false;\n this.DADOS = [];\n this.DADOS_RENDER = [];\n\n this.DADOS = [];\n this.DADOS_DETALHES = [];\n \n this.TOTAL_GERAL = 0;\n this.SELECTEDS = [];\n this.SELECTED = {};\n this.SELECTED_BACKUP = {};\n \n\t }", "function recoverDiagram(){\n let i;\n let wires = document.getElementsByClassName('wire');\n for(i = 0; i < wires.length; i++){\n wires[i].setAttribute('opacity','1');\n }\n let texts = document.getElementsByClassName('textOnWire');\n for(i = 0; i < texts.length; i++){\n texts[i].setAttribute('opacity','1');\n }\n let circles = document.getElementsByTagName('circle');\n for(i = 0; i < circles.length; i++){\n if(!$(circles[i]).hasClass('dataCircle')){\n circles[i].setAttribute('opacity','1');\n }\n }\n let uses = document.getElementsByTagName('use');\n for(i = 0; i < uses.length; i++){\n if(!$(uses[i]).hasClass('transparent')){\n uses[i].setAttribute('opacity','1');\n }\n }\n $('#instructionTable').css('opacity', '1');\n $('#registerTable').css('opacity', '1');\n $('#memoryTable').css('opacity', '1')\n}", "function dibujar_tier(){\n\n var aux=0;\n var padre=$(\"#ordenamientos\"); // CONTENEDOR DE TODOS LOS TIER Y TABLAS\n for(var i=0;i<tier_obj.length;i++){ // tier_obj = OBJETO CONTENEDOR DE TODOS LOS TIER DE LA NAVE\n if(i==0) { // PRIMER CASO\n aux=tier_obj[0].id_bodega;\n aux=tier_obj[i].id_bodega;\n var titulo1= $(\"<h4 id='bodega' > BODEGA \"+tier_obj[i].num_bodega+\"</h4>\");\n padre.append(titulo1);\n }\n if(aux!=tier_obj[i].id_bodega){\n aux=tier_obj[i].id_bodega;\n var titulo1= $(\"<h4 id='bodega' > BODEGA \"+tier_obj[i].num_bodega+\"</h4>\");\n padre.append(titulo1);\n }\n\n // DIV CONTENEDOR DEL TITULO, TABLA DE DATOS Y TIER\n var tier_div= $(\"<div class='orden_tier_div'></div>\");\n padre.append( tier_div );\n\n // DIV CON EL TITULO Y LA TABLA VACIA\n var titulo2= $(\"<div id='div\"+tier_obj[i].id_tier+\"'><h4 id='tier'> M/N. \"+tier_obj[i].nombre+\" ARROW . . . . .HOLD Nº \"+tier_obj[i].num_bodega+\" </h4><table class='table table-bordered dat'></table></div>\");\n tier_div.append( titulo2 );\n\n // DIV CON EL TIER Y SUS DIMENSIONES\n var dibujo_tier=$(\"<div class='dibujo1_tier'></div>\");\n\n //DIV DEL RECTANGULO QUE SIMuLA UN TIER\n\n // LARGO AL LADO DERECHO DEL TIER\n var largo_tier=$(\"<div class='largo_tier'><p>\"+tier_obj[i].largo+\" mts</p></div>\");\n dibujo_tier.append( largo_tier );\n\n // EL ID DEL DIV, SERA EL ID DEL TIER EN LA BASE DE DATOS\n var cuadrado_tier=$(\"<div class='dibujo_tier' id=\"+tier_obj[i].id_tier+\"></div>\");\n dibujo_tier.append( cuadrado_tier );\n\n // ANCHO DEBAJO DEL TIER\n var ancho_tier=$(\"<div class='ancho_tier'><p>\"+tier_obj[i].ancho+\" mts</p></div>\");\n dibujo_tier.append( ancho_tier );\n\n tier_div.append( dibujo_tier );\n }\n\n datos_tier(); // ASIGNAR DATOS A LA TABLE DE CADA TIER\n}", "processData()\n\t{\n\t\tlet filas = this.controlFilas; // Filas\n\t\tlet columnas = this.controlColumnas; // Columnas\n\t\tlet sumaClase = 0; // Sumas del tamaño de la clase\n\t\tlet data = []; // Matriz para datos\n\t\tdata[0] = []; // Init\n\t\tdata[1] = []; // fin\n\t\tdata[2] = []; // marca clase\n\t\tdata[3] = []; // Unidades\n\n\t\t// Recogemos los datos\n\t\tfor(let i = 0; i < filas; i++){\n\t\t\tfor(let j = 0; j < columnas; j++){\n\t\t\t\t// Verificamos si hay un dato\n\t\t\t\tif(document.getElementById((i+1)+''+(j+1)).value.length > 0){\n\t\t\t\t\t// Verificamos que solo se sumen columnas 1 y 2\n\t\t\t\t\tif(j == 0 || j == 1){\n\t\t\t\t\t\tsumaClase += parseFloat(document.getElementById((i+1)+''+(j+1)).value);\n\t\t\t\t\t\tif(j == 0){\n\t\t\t\t\t\t\t// Guardamos datos\n\t\t\t\t\t\t\tdata[0].push(parseFloat(document.getElementById((i+1)+''+(j+1)).value));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Guardamos datos\n\t\t\t\t\t\t\tdata[1].push(parseFloat(document.getElementById((i+1)+''+(j+1)).value));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(j == 2){\n\t\t\t\t\t\t// Guardamos datos\n\t\t\t\t\t\tdata[3].push(parseFloat(document.getElementById((i+1)+''+(j+1)).value));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Inyectamos\n\t\t\t\t\tdocument.getElementById((i+1)+''+(j+1)).value = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdata[2].push(sumaClase / 2); // Guardamos datos\n\t\t\tsumaClase = 0; // Reseteamos\n\t\t}\n\n\t\t// Mostramos texto para resultados\n\t\tlet h = document.createElement('h2');\n\t\th.setAttribute('class', 'results-title');\n\t\tlet hText = document.createTextNode('Resultados:');\n\t\th.appendChild(hText);\n\t\tdocument.getElementById('main-content').appendChild(h);\n\n\t\t// Obtenem0s medidas de tendencia central\n\t\tlet table = document.createElement('table');\n\t\ttable.setAttribute('id', 'medidas');\n\t\tlet caption = document.createElement('caption');\n\t\tcaption.setAttribute('class', 'padding');\n\t\tlet text = document.createTextNode('Medidas de tendencia central');\n\t\tcaption.appendChild(text);\n\t\ttable.appendChild(caption);\n\t\tlet row = table.insertRow(0);\n\t\tlet cell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Media aritmética');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediaAritmetica(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(1);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Moda');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.moda(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(2);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Mediana');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediana(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(3);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Media armónica');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediaArmonica(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(4);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Media geométrica');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediaGeometrica(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\tdocument.getElementById('main-content').appendChild(table);\n\n\t\t// Obtenem0s medidas de dispersión\n\t\ttable = document.createElement('table');\n\t\ttable.setAttribute('id', 'medidas');\n\t\tcaption = document.createElement('caption');\n\t\tcaption.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Medidas de dispersión');\n\t\tcaption.appendChild(text);\n\t\ttable.appendChild(caption);\n\t\trow = table.insertRow(0);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Desviación media');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.desviacionMedia(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(1);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Desviación estandar');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.desviacionEstandar(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(2);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Varianza');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.varianza(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\tdocument.getElementById('main-content').appendChild(table);\n\t}", "function getDesempenho(){\n init(1200, 500,\"#infos2\");\n executa(dados_atuais, 0,10,4);\n showLegendasRepetencia(false);\n showLegendasDesempenho(true);\n showLegendasAgrupamento(false);\n}", "function visualizarGrafico(chData, item, pregunta) {\n const aData = chData;\n const aLabels = aData[0];\n const aDatasets1 = aData[1];\n const aPromedio = aData[2];\n const aMediana = aData[3];\n const aDesviacion = aData[4];\n let tamanio = 0;\n let texto = \"\";\n for (let data in aDatasets1) {\n let valor = parseInt(aDatasets1[data]);\n tamanio = tamanio + valor;\n }\n texto = texto + \"Cantidad de Estudiantes que respondieron: \" + (tamanio).toString() + \"<br>\";\n if (pregunta == 5 || pregunta == 6) {\n //Promedio\n texto = texto + \"Promedio: \" + (aPromedio).toString() + \"<br>\";\n //Mediana\n texto = texto + \"Mediana: \" + (aMediana).toString() + \"<br>\";\n //Desviacion Estandar\n texto = texto + \"Desviacion estandar: \" + (aDesviacion).toString() + \"<br>\";\n }\n const item_id = \"graf_\" + item;\n document.getElementById(item_id).innerHTML = texto;\n\n const dataT = {\n labels: aLabels,\n datasets: [{\n label: \"Cantidad de Respuestas\",\n data: aDatasets1,\n fill: false,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n };\n const chart_id = \"#pie_chart_\" + item;\n const ctx = $(chart_id).get(0).getContext(\"2d\");\n if (pregunta == 2 || pregunta == 3 || pregunta == 6) {\n const barChart = new Chart(ctx, {\n type: 'pie',\n data: dataT,\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: { xaxes: [{ ticks: { beginAtZero: true } }] },\n legend: { display: true },\n\n },\n })\n } else if (pregunta == 4 || pregunta == 5) {\n const barChart = new Chart(ctx, {\n type: 'horizontalBar',\n data: dataT,\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: { xAxes: [{ ticks: { beginAtZero: true } }] },\n legend: { display: true },\n },\n })\n }\n}", "arbol(){\n var arbol = new Array();\n var padres = this._buscarPadre(data.categories);\n var hijos = this._buscarHijos(data.categories,padres);\n\n }", "function renderizaBalas(){\n\tbalas.forEach(desenhaBala);\n\tbalasAndam();\n}", "function ControladorDeEscenas(){\n //contiene el controlador de elementos visuales\n var controladorHospitales;\n\n this.iniciaControl = function(_controladorHospitales){\n controladorHospitales = _controladorHospitales;\n }\n\n\n this.setEscena1 = function(){\n \n //pon los hospitales en grid\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaGrid(0,0,generalWidth, generalHeight,80,150, hospitalesids));\n \n //define el diametro de los hexagonos\n //y el radio de los circulos\n controladorHospitales.controladorDeHexCharts.setDiameter(80);\n controladorHospitales.controladorDeHexCharts.setRadius(2);\n //pon las lineas Contadoras de un lado \n controladorHospitales.controladorDeLineasContadoras.movePosicionLineasContadoras(75,90);\n controladorHospitales.controladorDeLineasContadoras.setLargoLinea(50);\n }\n\n //en la escena dos ser ordenan los hospitales por delegacion o por tipo de hospital\n this.setEscena2 = function(){\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaClustersDePosicionesPorTipo(100,100,600,600,80,150,mapHospitalesPorTipo,50));\n }\n\n //en la escena tres se muestran los datos acumulando por mes.\n this.setEscena3 = function(){\n var circulos = d3.selectAll(\"#vivo\");\n\n circulos.transition().duration(1000).attr(\"transform\", function(d) { \n return \"translate(\" + 0 + \",\" + 0 + \")\"; });\n }\n\n}", "function mapeamentosDatasets(myJsonDoc, mapeamentos, myDataFields) {\n console.log('mapeamentosDatasets');\n\n datasets = [];\n\n campos = myDataFields;\n\n // iterar por cada visualização mapeada\n for (var i=0;i<mapeamentos['visualizations']['length'];i++) {\n\n myMap = mapeamentos['visualizations'][i];\n dataset = [];\n\n // Verificar o agrupamento de dados\n aggregateOptions = [ 'SUM', 'AVG', 'MAX', 'MIN' ];\n try {\n if (myMap['components']['y']['aggregate'] === undefined)\n aggregateOption = 0;\n else\n aggregateOption = aggregateOptions.indexOf(myMap['components']['y']['aggregate']);\n } catch(e) {\n throw e;\n }\n\n yField = myMap['components']['y']['field'];\n\n // Verificar se o campo Y informado existe no conjunto de dados\n try {\n if (campos.indexOf(yField) < 0)\n throw { msg: 'campo \"components.y.field\" informado não existe'};\n } catch(e) {\n throw e;\n }\n\n // Verificar o tipo de gráfico escolhido\n if (myMap['visualizationType'] == 'BAR_CHART') {\n \n xField = myMap['components']['x']['field'];\n\n // Verificar se o campo X informado existe no conjunto de dados\n try {\n if (campos.indexOf(xField) < 0)\n throw { msg: 'campo \"components.x.field\" informado não existe'};\n } catch(e) {\n throw e;\n }\n\n dataset = buildDataset(myJsonDoc, xField, yField, aggregateOption );\n\n // ordernar o dataset\n sortBy = '';\n sortOrder = '';\n try {\n if ( (myMap['components']['others'] !== undefined) &&\n (myMap['components']['others']['sortBy'] !== undefined)\n )\n sortBy = myMap['components']['others']['sortBy'];\n\n if ( (myMap['components']['others'] !== undefined) &&\n (myMap['components']['others']['sortOrder'] !== undefined)\n ) \n sortOrder = myMap['components']['others']['sortOrder'];\n\n if (sortBy != '') {\n dataset.sort(function(a, b){\n if (sortBy=='x') {\n s1 = a[xField].toLowerCase();\n s2 = b[xField].toLowerCase();\n if ( (sortOrder=='') || (sortOrder=='asc') ) {\n if (s1 < s2) { return -1; }\n if (s1 > s2) { return 1; }\n return 0;\n }\n else {\n if (s2 < s1) { return -1; }\n if (s2 > s1) { return 1; }\n return 0;\n }\n }\n else {\n if ( (sortOrder=='') || (sortOrder=='asc') )\n return a[yField] - b[yField];\n else\n return b[yField] - a[yField];\n }\n });\n }\n } catch(e) {\n throw e;\n }\n\n }\n\n if (myMap['visualizationType'] == 'SANKEY') {\n\n //xFields = [ 'Localidade', 'Categoria 1', 'Categoria 2' ];\n xFields = myMap['components']['x']['fields'];\n\n // Verificar se os campos selecionados para X existem no conjunto de dados\n try {\n for (var z=0;z<xFields.length;z++) {\n if (campos.indexOf(xFields[z]) < 0)\n throw { msg: 'campo \"components.x.fields\" informado não existe'};\n }\n } catch(e) {\n throw e;\n }\n\n dataset = buildDatasetSANKEY(myJsonDoc, xFields, yField, aggregateOption );\n \n }\n\n datasets.push( dataset );\n\n }\n\n /*\n //dataset = buildDataset(myJsonDoc, xField, yField, aggregateOption );\n\n camposTeste = [ 'Localidade', 'Categoria 1', 'Categoria 2' ];\n //camposTeste = [ 'Categoria 1', 'Categoria 2', 'Localidade' ];\n dataset = buildDatasetSANKEY(myJsonDoc, camposTeste, yField, aggregateOption );\n */\n\n return datasets;\n\n}", "function dibujarFigura1(){\n //Limpiamos las areas para volver a dibujar\n figura1.clearRect(0,0,200,200);\n idFig1 = numeroAleatoreoFigura();\n console.log(\"id de la figura 1:\"+figura[idFig1]);\n if(idFig1 === 0){\n crearCuadroAleatoreo1();\n }\n if(idFig1 === 1){\n crearCirculoAleatoreo1();\n }\n if(idFig1 === 2){\n crearTrianguloAleatoreo1();\n }\n}", "function init() {\r\n\r\n\r\n // Petición al JSON con una promesa\r\n\r\n fetch(url).then(response => response.json())\r\n .then(data => {\r\n console.log(data)\r\n \r\n //Provincias\r\n\r\n for (let i = 0; i < 16; i++) {\r\n\r\n\r\n //Creamos un div por cada bandera \r\n banderaDiv = document.createElement('div');\r\n banderaDiv.classList.add('bandera');\r\n\r\n // Creamos las imagenes de las banderas\r\n let img = document.createElement('img');\r\n img.setAttribute(\"src\", data.comunidades[i].provincias[0].bandera);\r\n\r\n //Creamos los select por cada bandera\r\n let select = document.createElement('select');\r\n select.dataset.comunidad = data.comunidades[i].capital;\r\n select.addEventListener('change', comprobarResultado);\r\n\r\n //Creamos los option de cada select\r\n let option = document.createElement('option');\r\n option.innerText = 'Selecciona una opcion';\r\n\r\n select.appendChild(option);\r\n\r\n data.comunidades[i].provincias.forEach(provincia => {\r\n option = document.createElement('option');\r\n\r\n option.innerText += provincia.nombre\r\n\r\n\r\n select.appendChild(option);\r\n\r\n })\r\n\r\n //Añadimos los elementos al div\r\n banderaDiv.appendChild(img);\r\n\r\n banderaDiv.appendChild(select);\r\n\r\n document.querySelector(\".contenedor\").appendChild(banderaDiv);\r\n\r\n\r\n\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n })\r\n\r\n\r\n}", "async function preencheGrafico() {\n\n let moduloSelecionado = document.getElementById('selecionaModulo').value\n\n const dadosRecebidos = await recebeDados();\n if (graficoAlunosData.labels.length > 0) {\n graficoAlunosData.labels = []\n }\n\n if (graficoAlunosData.datasets[0].data.length > 0) {\n graficoAlunosData.datasets[0].data = []\n }\n\n if (graficoAlunosData.datasets[1].data.length > 0) {\n graficoAlunosData.datasets[1].data = []\n }\n\n if (graficoAptosData.labels.length > 0) {\n graficoAptosData.labels = []\n }\n\n if (graficoAptosData.datasets[0].data.length > 0) {\n graficoAptosData.datasets[0].data = []\n }\n\n if (graficoAptosData.datasets[1].data.length > 0) {\n graficoAptosData.datasets[1].data = []\n }\n \n if (graficoResultadoData.labels.length > 0) {\n graficoResultadoData.labels = []\n }\n\n if (graficoResultadoData.datasets[0].data.length > 0) {\n graficoResultadoData.datasets[0].data = []\n }\n\n if (graficoResultadoData.datasets[1].data.length > 0) {\n graficoResultadoData.datasets[1].data = []\n }\n\n if (graficoResultadoData.datasets[2].data.length > 0) {\n graficoResultadoData.datasets[2].data = []\n }\n \n \n dadosRecebidos.forEach(dadoRecebido => {\n if (dadoRecebido.modulo === moduloSelecionado) {\n\n graficoAlunosData.labels.push(dadoRecebido.nome);\n graficoAlunosData.datasets[0].data.push(dadoRecebido.desistentes);\n graficoAlunosData.datasets[1].data.push(dadoRecebido.matriculados);\n\n graficoAptosData.labels.push(dadoRecebido.nome);\n graficoAptosData.datasets[0].data.push(dadoRecebido.aptos);\n graficoAptosData.datasets[1].data.push(dadoRecebido.naoAptos.total);\n \n graficoResultadoData.labels.push(dadoRecebido.nome);\n graficoResultadoData.datasets[0].data.push(dadoRecebido.aptos);\n graficoResultadoData.datasets[1].data.push(dadoRecebido.naoAptos.total);\n graficoResultadoData.datasets[2].data.push(dadoRecebido.frequentes);\n \n\n }\n\n });\n window.graficosAlunos.update();\n window.graficosAptos.update();\n window.graficosResultado.update();\n preencheTabela();\n}", "async function createGeneralInformationBoxes(){\n const chartData=(await getChartsData());\n \n const reduceAllTimeData=(dayInfoArray)=>{\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n return dayInfoArray.reduce(reducer);\n\n }\n\n\n const totalCases={\n title:'סה\"כ מאומתים (נדבקים)',\n // main:chartData.allCurveData[chartData.allCurveData.length-1].totalCases,\n main:reduceAllTimeData(chartData.allCurveData.map(dayInfo=>dayInfo.newCases)),\n fromMidnight:chartData.allCurveData[chartData.allCurveData.length-1].newCases,\n fromYesterday:chartData.allCurveData[chartData.allCurveData.length-2].newCases,\n moderate:'none',\n critical:chartData.allSeriousCases[chartData.allSeriousCases.length-1].critical\n }\n \n const respirators={\n title:'מונשמים',\n main:chartData.allSeriousCases[chartData.allSeriousCases.length-1].respirators,\n fromMidnight:\n chartData.allSeriousCases[chartData.allSeriousCases.length-1].respirators-\n chartData.allSeriousCases[chartData.allSeriousCases.length-2].respirators,\n allData:chartData.allSeriousCases.map(({date,respirators}) => ([Date.parse(date),respirators]))\n }\n\n \n const totalDeaths={\n title:'נפטרים',\n main:reduceAllTimeData(chartData.allSeriousCases.map(dayInfo=>dayInfo.deaths)),\n fromMidnight: chartData.allSeriousCases[chartData.allSeriousCases.length-1].deaths,\n allData:chartData.allSeriousCases.map(({date,deaths}) => ([Date.parse(date),deaths]))\n }\n\n\n const totalRecoverdCases={\n title:'החלימו עד כה',\n main:reduceAllTimeData(chartData.allCurveData.map(dayInfo=>dayInfo.recoverdCases)),\n fromMidnight:chartData.allCurveData[chartData.allCurveData.length-1].recoverdCases,\n allData:chartData.allCurveData.map(({date,recoverdCases}) => ([Date.parse(date),recoverdCases]))\n }\n \n const totalTestsYesterday={\n title:'כלל הבדיקות שהתבצעו אתמול',\n main:chartData.allTestsToLocatePatients[chartData.allTestsToLocatePatients.length-2].testsAmount,\n fromMidnight:chartData.allTestsToLocatePatients[chartData.allTestsToLocatePatients.length-1].testsAmount\n }\n \n const activeCases={\n title:'חולים פעילים',\n main:totalCases.main-totalRecoverdCases.main,\n fromMidnight:\n //newCases-recoverdCases-deaths\n chartData.allCurveData[chartData.allCurveData.length-1].newCases-\n chartData.allCurveData[chartData.allCurveData.length-1].recoverdCases-\n chartData.allSeriousCases[chartData.allSeriousCases.length-1].deaths,\n //where\n home:'none',\n hotel:'none',\n hospital:'none'\n }\n \n \n \n \n createInfoBox(totalTestsYesterday);\n createInfoBox(totalRecoverdCases,true);\n createInfoBox(totalDeaths,true);\n createInfoBox(respirators,true);\n createInfoBox(activeCases);\n createInfoBox(totalCases);\n}", "function _DependenciasClasseArmadura() {\n gPersonagem.armadura = null;\n for (var i = 0; i < gPersonagem.armaduras.length; ++i) {\n if (gPersonagem.armaduras[i].entrada.em_uso) {\n gPersonagem.armadura = gPersonagem.armaduras[i];\n break;\n }\n }\n\n gPersonagem.escudo = null;\n for (var i = 0; i < gPersonagem.escudos.length; ++i) {\n if (gPersonagem.escudos[i].entrada.em_uso) {\n gPersonagem.escudo = gPersonagem.escudos[i];\n break;\n }\n }\n\n var bonus_ca = gPersonagem.ca.bonus;\n // Por classe.\n var bonus_classe = 0;\n for (var i_classe = 0; i_classe < gPersonagem.classes.length; ++i_classe) {\n var chave_classe = gPersonagem.classes[i_classe].classe;\n var nivel = gPersonagem.classes[i_classe].nivel;\n var tabela_classe = tabelas_classes[chave_classe];\n for (var i = 1; i <= nivel; ++i) {\n if (tabela_classe.especiais != null && tabela_classe.especiais[i] != null) {\n var especiais_classe_nivel = tabela_classe.especiais[i];\n for (var j = 0; j < especiais_classe_nivel.length; ++j) {\n if (especiais_classe_nivel[j] == 'bonus_ca') {\n ++bonus_classe;\n }\n }\n }\n }\n }\n bonus_ca.Adiciona('classe', 'monge', bonus_classe);\n\n if (gPersonagem.armadura != null) {\n bonus_ca.Adiciona(\n 'armadura', 'armadura', tabelas_armaduras[gPersonagem.armadura.entrada.chave].bonus);\n bonus_ca.Adiciona(\n 'armadura_melhoria', 'armadura', gPersonagem.armadura.entrada.bonus);\n }\n if (gPersonagem.escudo != null) {\n bonus_ca.Adiciona(\n 'escudo', 'escudo', tabelas_escudos[gPersonagem.escudo.entrada.chave].bonus);\n bonus_ca.Adiciona(\n 'escudo_melhoria', 'escudo', gPersonagem.escudo.entrada.bonus);\n }\n bonus_ca.Adiciona(\n 'atributo', 'destreza', gPersonagem.atributos.destreza.modificador);\n if (PersonagemNivelClasse('monge') > 0) {\n bonus_ca.Adiciona(\n 'atributo', 'sabedoria', gPersonagem.atributos.sabedoria.modificador);\n }\n\n bonus_ca.Adiciona(\n 'tamanho', 'tamanho', gPersonagem.tamanho.modificador_ataque_defesa);\n // Pode adicionar as armaduras naturais aqui que elas nao se acumulam.\n bonus_ca.Adiciona(\n 'armadura_natural', 'racial', tabelas_raca[gPersonagem.raca].armadura_natural || 0);\n var template_personagem = PersonagemTemplate();\n if (template_personagem != null) {\n if ('bonus_ca' in template_personagem) {\n for (var chave in template_personagem.bonus_ca) {\n bonus_ca.Adiciona(chave, 'template', template_personagem.bonus_ca[chave]);\n }\n }\n bonus_ca.Adiciona(\n 'armadura_natural', 'template', template_personagem.armadura_natural || 0);\n }\n}", "function DrawDiagrams() {\n var selectedContractData = null;//selected contract from list of all Contracts (AppData.listOfContracts..)\n var rangeOfDataForCharts = [];\n //update selected Contract data when user searches for new Contract with Filters\n this.updateChangeSelectedContractData = function (inputNewData){\n selectedContractData = inputNewData\n }\n //update date range when user selects from datepicker\n this.updateDatepickerValue = function (inputDate_start, inputDate_end){\n var rangeArrayType = 'days';\n if (moment(inputDate_start).format('DD-MM-YYY') === moment(inputDate_end).format('DD-MM-YYY')){\n rangeArrayType = 'hours'\n }\n rangeOfDataForCharts = moment(inputDate_start).twix(inputDate_end, {allDay: true}).toArray(rangeArrayType);\n }\n //\n this.renderDiagrams = function (layoutType) {\n //check if we should render Tables or Graphs\n if (layoutType === appSettings.layoutEnums.tables) {\n return createContentForTables();\n } else if (layoutType === appSettings.layoutEnums.graphs) {\n return createContentForGraphs();\n } else {\n return '<div class=\"col-12\"><div class=\"card bg-light\"><div class=\"card-body text-center\"><i class=\"fas fa-info-circle\"></i> Start typing Contract ID or Mac Address to show data.</div></div></div>'\n }\n }\n /*\n START\n LOGIC FOR DRAWING TABLES\n */\n function createContentForTables () {\n //each column for TABLES will have it's template\n resetTableValuesBeforeRendering();\n var content_firstColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Overall Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">RSS Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Client RSS Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Sticky Client Status</span>` + returnRandomBMGBadge() + `</div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div><span class=\"c-card-title\">Interference Status - Overall</span>` + returnRandomBMGBadge() + `</div>\n <div><span class=\"c-card-title\">Interference Status Co- Channel</span>` + returnRandomBMGBadge() + `</div>\n <div><span class=\"c-card-title\">Interference Status - Adjecent</span>` + returnRandomBMGBadge() + `</div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference</span>\n <div class=\"row c-small-text-for-cards\">\n <div class=\"col-6\">UniFi` + returnRandomBMGBadge() + `</div>\n <div class=\"col-6\">Home` + returnRandomBMGBadge() + `</div>\n </div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">Retransmission Status</span>` + returnRandomBMGBadge() + `\n <div class=\"c-small-text-for-cards\">HGw Number of retransmissions\n <span class=\"float-right\">` + returnRandomNumberInRange(4500, 5300) + `</span>\n </div>\n </div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div class=\"c-small-text-for-cards\">Total Number of Clients\n <span class=\"float-right\">` + returnRandomNumberInRange(5, 200) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">Max. number of concurent clients\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 77) + `</span>\n </div> \n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Combined status</span>\n <div class=\"c-small-text-for-cards\">HGw Number of clients\n <span class=\"float-right\">` + returnRandomNumberInRange(10, 35) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">HGw Number of sticky clients\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 5) + `</span>\n </div>\n <div class=\"c-small-text-for-cards\">Data transfered [GB]\n <span class=\"float-right\">` + returnRandomNumberInRange(3, 35) + `</span>\n </div> \n </div></div>\n </div>`;\n var content_secondColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Bitrate [Mbps]</span>` + returnKpiTable('Bitrate', true) + `</div></div>\n <div class=\"card\"><div class=\"card-body\">\n <div class=\"c-small-text-for-cards\">HGW total traffic [GB]\n <span class=\"float-right\">` + returnRandomNumberInRange(1, 17) + `</span>\n </div> \n </div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw RSS</span>` + returnKpiTable('RSS [dBm]', true) + `</div></div>\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference network RSS</span>` + returnKpiTable('RSS [dBm]', false) + `</div></div>\n </div>`;\n var content_thirdColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3 mt-1 mt-xl-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">WiFi connected time</span>` + returnPieChartPlaceholder(['Percent of time with connected user (s)']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\">\n <span class=\"c-card-title\">HGw Channel</span>\n <div class=\"c-small-text-for-cards c-xs\">Auto channel enabled: ` + returnYesNoIcon(selectedContractData.contractHgwInfo.autoChannelEnabled) +`</div>\n <div class=\"c-small-text-for-cards c-xs\">Current channel: ` + selectedContractData.contractHgwInfo.channel +`</div>\n <div class=\"c-small-text-for-cards c-xs\">No. of changes: ` + returnRandomNumberInRange(1,99) +`</div>\n <div>` + returnPieChartPlaceholder(['Auto: Yes', 'Auto: No']) + `</div>\n </div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw WiFi Usage</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Percent of time with Sticky Clients</span>` + returnPieChartPlaceholder(['Percent of time with sticky clients']) + `</div></div>\n </div> \n </div>\n </div>`;\n var content_fourthColumn =\n `<div class=\"col-12 col-lg-6 col-xl-3\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div> \n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Client's RSS Status</span>` + returnPieChartPlaceholder(['Good', 'Medium', 'Bad']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw Interference Home</span>` + returnPieChartPlaceholder(['Low', 'Medium', 'High']) + `</div></div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\"><div class=\"card-body\"><span class=\"c-card-title\">HGw RSS Status</span>` + returnPieChartPlaceholder(['Good', 'Medium', 'Bad']) + `</div></div>\n </div> \n </div>\n </div>`; \n /* since we created placeholder containers (returnPieChartPlaceholder), we will start checking when those elements are added to DOM\n we want to attach PieChart graphs when those elements are added to DOM\n */\n startCheckingForAddedPiePlaceholders();\n //\n return (content_firstColumn + content_secondColumn + content_thirdColumn + content_fourthColumn);\n }\n //return random badge (Bad, Medium, Good..)\n function returnRandomBMGBadge () {\n var badgeBad = `<span class=\"badge badge-danger float-right\">Bad</span>`;\n var badgeMedium = `<span class=\"badge badge-warning float-right\">Medium</span>`;\n var badgeGood = `<span class=\"badge badge-success float-right\">Good</span>`;\n var badgeInvalid = `<span class=\"badge badge-secondary float-right\">Unavailable</span>`;\n var randomLevelInt = Math.floor(Math.random() * 3);\n switch (randomLevelInt) {\n case 0:\n return badgeBad\n case 1:\n return badgeMedium\n case 2:\n return badgeGood\n default:\n return badgeInvalid\n }\n }\n //Return random number in range\n function returnRandomNumberInRange (inputMinRange, inputMaxRange) {\n return (Math.floor(Math.random() * (inputMaxRange - inputMinRange + 1)) + inputMinRange);\n }\n //Return table that is different from others (diferent template)\n function returnKpiTable (inputKpiName, inputShowColumnForMin) {\n var displayStyleForMinColumn = (inputShowColumnForMin === true) ? '' : 'display:none;';\n var colorStyleForAvgColumn = (inputShowColumnForMin === true) ? 'color:#f00;' : '';\n var tableTemplate = `<div class=\"table-responsive table-borderless c-custom-table\"><table class=\"table table-striped\">\n <thead>\n <tr>\n <th>KPI Name</th>\n <th style=\"`+ displayStyleForMinColumn + `\">Min</th>\n <th>Avg</th>\n <th>Max</th>\n <th>Last</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>`+ inputKpiName + `</th>\n <td style=\"`+ displayStyleForMinColumn + `\">` + returnRandomNumberInRange(-50, 80) + `</td>\n <td style=\"`+ colorStyleForAvgColumn + `\">` + returnRandomNumberInRange(-50, 80) + `</td>\n <td>`+ returnRandomNumberInRange(-50, 80) + `</td>\n <td>`+ returnRandomNumberInRange(-50, 80) + `</td>\n </tr>\n </tbody>\n </table></div>`\n return tableTemplate;\n }\n //holds array of all pie charts that should be rendered on view\n var listOfAllPieChartElements = [];\n //used for temporary rendering of pie charts by removing each item that is rendered\n var remainingPieChartsForAdding = [];\n //create html element that will hold pie chart\n function returnPieChartPlaceholder (inputPieChartLegendTitles) {\n var idOfNewChartContainer = 'cid-pie-chart-holder-' + Math.random().toString(36).substr(2, 10);\n var newPieChartElement = {\n elementId: idOfNewChartContainer,\n chartLegend: inputPieChartLegendTitles\n }\n listOfAllPieChartElements.push(newPieChartElement);\n var templateToReturn = `<div id=\"` + idOfNewChartContainer + `\" style=\"width:100%;height:auto;min-height:200px;max-height:300px;\"></div>`;\n return templateToReturn;\n }\n //attach each pie chart to its html element\n function attachPieChartToPlaceholder (inputObjectWithData) {\n // Build the chart\n if (!inputObjectWithData || !inputObjectWithData.elementId || !inputObjectWithData.chartLegend) {\n return;\n }\n //\n Highcharts.chart(inputObjectWithData.elementId, {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'pie'\n },\n exporting: {\n buttons: {\n contextButton: {\n menuItems: [\n 'printChart',\n 'downloadPNG',\n 'downloadJPEG',\n 'downloadPDF',\n 'downloadCSV'\n ]\n }\n }\n }, \n colors: ['#20fc8f', '#ffa100', '#ff5b58', '#27aae1', 'purple', 'brown'],\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n dataLabels: {\n enabled: false,\n //distance: -10\n },\n showInLegend: true\n }\n },\n title: false,\n legend: {\n width: 100,\n itemWidth: 100,\n itemStyle: {\n width: 100\n },\n align: 'left',\n verticalAlign: 'middle',\n layout: 'vertical'\n },\n series: [{\n colorByPoint: true,\n innerSize: '50%',\n data: returnOrganizedDataForPieChart(inputObjectWithData.chartLegend)\n }],\n tooltip: {\n formatter: function () {\n return this.key;\n }\n }\n });\n }\n //In here we are calculating data for each pie chart\n function returnOrganizedDataForPieChart (inputChartLegendAsArray) {\n //inputChartLegendAsArray will be list of labels that we inputed when we created placeholder element (returnPieChartPlaceholder('Low', 'Medium', 'High'))\n var tempArrayOfLabels = inputChartLegendAsArray;\n //\n var arrayOfLabelValues = [];\n var numberToDivideOnParts = 100;\n var x;\n for (x = 0; x < tempArrayOfLabels.length; x++) {\n var s = Math.round(Math.random() * (numberToDivideOnParts));\n numberToDivideOnParts -= s;\n if (x == (tempArrayOfLabels.length - 1) && (tempArrayOfLabels.length > 1) && (numberToDivideOnParts > 0)) {\n arrayOfLabelValues.push(s + numberToDivideOnParts);\n } else {\n arrayOfLabelValues.push(s);\n }\n }\n var dataToExport = []\n tempArrayOfLabels.forEach(function (item, index, object) {\n var newLabelObj = {\n name: tempArrayOfLabels[index] + \" \" + arrayOfLabelValues[index] + \"%\",\n y: arrayOfLabelValues[index]\n }\n dataToExport.push(newLabelObj);\n })\n if (tempArrayOfLabels.length == 1) {\n var newLabelObj = {\n name: \"Empty\",\n y: numberToDivideOnParts,\n color: \"#d3d3d3\"\n }\n dataToExport.push(newLabelObj);\n }\n return dataToExport;\n }\n //interval used for checking if all pie charts are added to dom\n var pieRenderedInterval = null;\n function startCheckingForAddedPiePlaceholders () {\n remainingPieChartsForAdding = JSON.parse(JSON.stringify(listOfAllPieChartElements));\n pieRenderedInterval = setInterval(checkForPieChartsAddedToView, 300)\n }\n function checkForPieChartsAddedToView () {\n remainingPieChartsForAdding.forEach(function (arrayItem, index, arrayObject) {\n if (document.getElementById(arrayItem.elementId)) {\n attachPieChartToPlaceholder(arrayItem);\n remainingPieChartsForAdding.splice(index, 1);\n }\n });\n if (remainingPieChartsForAdding.length < 1) {\n clearInterval(pieRenderedInterval);\n }\n }\n ///Return HGw Info table that will be displayed on view\n this.returnHgwInfoTable = function () {\n var tableTemplate = `<div class=\"card bg-dark mb-3\"><div class=\"card-body\">\n <div class=\"row\"><div class=\"col-12 text-center pb-3\"><span class=\"c-card-title\">HGw Info</span></div></div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">WiFi enabled: <span class=\"float-right\"><b>`+ returnYesNoIcon(selectedContractData.contractHgwInfo.wifiEnabled) + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">HGw standard: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.hgwStandard + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">IP address: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.ipAddress + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">MAC: <span class=\"float-right\"><b>`+ selectedContractData.contractMacAddress + `</b></span></div></div></div>\n </div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Contract No: <span class=\"float-right\"><b>`+ selectedContractData.contractNumber + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Auto channel enabled: <span class=\"float-right\"><b>`+ returnYesNoIcon(selectedContractData.contractHgwInfo.autoChannelEnabled) + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">SSID: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.ssid + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Security: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.security + `</b></span></div></div></div>\n </div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Band: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.band + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Hidden SSID: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.hiddenSsid + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Bandwith: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.bandwith + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Up time: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.upTime + `</b></span></div></div></div>\n </div>\n <div class=\"row c-has-info-cards\">\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Equipment: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.equipment + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Description: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.description + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">CMTS ID: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.cmtsId + `</b></span></div></div></div>\n <div class=\"col-12 col-sm-6 col-md-3\"><div class=\"card\"><div class=\"card-body\">Firmware: <span class=\"float-right\"><b>`+ selectedContractData.contractHgwInfo.cmtsId + `</b></span></div></div></div>\n </div> \n </div></div>`\n return tableTemplate;\n }\n //return Yes/No with icon\n function returnYesNoIcon (inputBooleanValue){\n if (inputBooleanValue == true){\n return '<i class=\"fas fa-check text-success\"></i> Yes'\n }else{\n return '<i class=\"fas fa-ban text-danger\"></i> No'\n }\n }\n //reset all variables before rendering new content\n function resetTableValuesBeforeRendering (){\n listOfAllPieChartElements = [];\n remainingPieChartsForAdding = [];\n clearInterval(pieRenderedInterval);\n pieRenderedInterval = null;\n } \n /*\n START\n LOGIC FOR DRAWING GRAPHS \n */\n //reset all variables before rendering new Graph\n function resetGraphValuesBeforeRendering (){\n listOfAllGraphElements = [];\n remainingGraphsForAdding = [];\n clearInterval(graphsRenderedInterval);\n graphsRenderedInterval = null;\n }\n //crate html templates for each graph that will be diplayed on view\n function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }\n //create data series object used for HighCharts rendering options\n function returnDataSeriesForArrayItem(inputArrayItem){ \n inputArrayItem.series.forEach(function (arrayItem, index, arrayObject) {\n arrayItem.data = returnGraphDataBasedOnTimeRange();\n });\n\n return JSON.parse(JSON.stringify(inputArrayItem));\n }\n //Based on selected time range create some Graph data series\n function returnGraphDataBasedOnTimeRange (){\n var dataToReturn = []\n rangeOfDataForCharts.forEach(function (arrayItem, index, arrayObject) {\n var newSingleData = []\n var randomNumberOfData = returnRandomNumberInRange(7,20)\n var numB;\n for (numB=0;numB<randomNumberOfData;numB++){\n newSingleData.push(arrayItem);\n newSingleData.push(returnRandomNumberInRange(1,200));\n }\n //\n dataToReturn.push(newSingleData);\n });\n ///\n return dataToReturn;\n }\n //array of all graphs that should be renderedn on view\n var listOfAllGraphElements = [];\n //temp array used to check if all arrays are binded to dom\n var remainingGraphsForAdding = [];\n //return html element template that will hold graph\n function returnGraphPlaceholder (inputGraphData) {\n var idOfNewGraphContainer = 'cid-graph-holder-' + Math.random().toString(36).substr(2, 10);\n var newGraphElement = {\n elementId: idOfNewGraphContainer,\n graphData: inputGraphData\n }\n listOfAllGraphElements.push(newGraphElement);\n var templateToReturn = `<div id=\"` + idOfNewGraphContainer + `\" style=\"width:100%;height:auto;min-height:300px;max-height:500px;\"></div>`;\n return templateToReturn;\n }\n //interval that will check until all graphs are binded to dom\n var graphsRenderedInterval = null;\n function startCheckingForAddedGraphsPlaceholders () {\n remainingGraphsForAdding = JSON.parse(JSON.stringify(listOfAllGraphElements));\n graphsRenderedInterval = setInterval(checkForGraphsAddedToView, 300)\n }\n function checkForGraphsAddedToView () {\n remainingGraphsForAdding.forEach(function (arrayItem, index, arrayObject) {\n if (document.getElementById(arrayItem.elementId)) {\n attachGraphToPlaceholder(arrayItem);\n remainingGraphsForAdding.splice(index, 1);\n }\n });\n if (remainingGraphsForAdding.length < 1) {\n clearInterval(graphsRenderedInterval);\n }\n }\n ////attach graph to placeholder html elemnt\n function attachGraphToPlaceholder (inputObjectWithData) {\n // Build the Graph chart\n if (!inputObjectWithData || !inputObjectWithData.elementId || !inputObjectWithData.graphData) {\n return;\n }\n Highcharts.chart(inputObjectWithData.elementId, inputObjectWithData.graphData);\n }\n /*\n START\n LOGIC FOR DRAWING 'Currently Viewing Data' table\n */\n this.renderCurrentlyViewingDataTable = function () {\n return `<div class=\"c-custom-viewing-data-table\"><table class=\"table table-sm\">\n <thead><tr><th colspan=\"2\">Currently viewing data for contract:</th></tr></thead>\n <tbody>\n <tr>\n <td>MAC address:</td>\n <td><b>` + selectedContractData.contractMacAddress + `</b></td>\n </tr>\n <tr>\n <td>Contract ID:</td>\n <td><b>` + selectedContractData.contractNumber + `</b></td>\n </tr>\n <tr>\n <td>City:</td>\n <td><b>` + selectedContractData.contractCity + `</b></td>\n </tr> \n </tbody>\n </table></div>`;\n } \n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function visualizar_info_oi(id) {\n visualizar_facturacion(id);\n id_oi = id;\n $.ajax({\n url: \"consultar_orden/\",\n type: \"POST\",\n dataType: 'json',\n data: {\n 'id':id,\n 'csrfmiddlewaretoken': token\n },\n success: function (response) {\n //datos de la orden interna\n var data = JSON.parse(response.data);\n data = data.fields;\n //datos de las muestras\n var muestras = JSON.parse(response.muestras);\n //datos del usuario\n var usuario = JSON.parse(response.usuario);\n usuario = usuario.fields;\n //datos del solicitante\n if(response.solicitante != null){\n var solicitante = JSON.parse(response.solicitante);\n solicitante = solicitante.fields;\n }\n var analisis_muestras = response.dict_am;\n var facturas = response.facturas;\n var dhl = response.dict_dhl;\n var links = response.links;\n var fechas = response.fechas;\n //pestaña de información\n $('#titulov_idOI').text(\"Orden Interna #\" + id);\n $('#visualizar_idOI').val(id);\n $('#visualizar_estatus').val(data.estatus);\n $('#visualizar_localidad').val(data.localidad);\n $('#visualizar_fecha_recepcion_m').val(data.fecha_recepcion_m);\n $('#visualizar_fecha_envio').val(data.fecha_envio);\n $('#visualizar_fecha_llegada_lab').val(data.fecha_llegada_lab);\n $('#visualizar_pagado').val(data.pagado);\n $('#visualizar_link_resultados').val(data.link_resultados);\n $('#visualizar_usuario_empresa').text(response.empresa);\n var n = usuario.nombre + \" \" + usuario.apellido_paterno + \" \" + usuario.apellido_materno;\n $('#visualizar_usuario_nombre').text(n);\n $('#visualizar_usuario_email').text(response.correo);\n $('#visualizar_usuario_telefono').text(response.telefono);\n\n //pestaña de observaciones\n $('#visualizar_idioma_reporte').text(data.idioma_reporte);\n\n var html_muestras = \"\";\n if(muestras != null){\n for (let mue in muestras){\n var id_muestra = muestras[mue].pk;\n var objm = muestras[mue].fields;\n\n html_muestras+= build_muestras(id_muestra, objm,analisis_muestras[id_muestra], facturas[id_muestra], dhl, links, fechas);\n }\n }\n $('#muestras-body').html(html_muestras);\n $('#v_observaciones').val(data.observaciones);\n if(!$(\"#factura-tab\").hasClass(\"active\")){\n restaurar_editar();\n }\n else{\n doble_editar();\n }\n }\n })\n}", "function cargarDatos_ParaGrafica() {\n let itemDashboard = $(\"#txtItemABuscar\").val();\n let fechaIni = $(\"#fecha_inicio\").val();\n let fechaFin = $(\"#fecha_final\").val();\n $.ajax({\n url: \"controlador_grafico_parametro.php\",\n type: \"post\",\n data: { fechaIni, fechaFin, itemDashboard },\n }).done(function (resp) {\n if (resp.length > 0) {\n\n let titulo = [];\n let cantidad = [];\n let colores = [];\n let tipoGrafica = \"\";\n let datos = JSON.parse(resp);\n\n datos.forEach((element) => {\n\n titulo.push(`${element.fecha}`);\n cantidad.push(`${element.cantidad}`);\n colores.push(colorRGB());\n tipoGrafica = `${element.tipoGrafica}`;\n });\n\n myChart.destroy();\n myChartCircular.destroy();\n\n crear_graficos(titulo,cantidad,colores,\"bar\",tipoGrafica,\"GraficoFiltrado\");\n crear_graficosCircular(titulo,cantidad,colores,\"pie\",tipoGrafica, \"graficopie\"\n );\n }\n });\n}", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "function actualiserCommandes() {\n if (window.fetch) {\n\n var myInit = {\n method: 'GET',\n //headers: myHeaders,\n mode: 'cors',\n cache: 'default'\n };\n\n var datedebut = document.getElementById('start').value;\n var datefin = document.getElementById('end').value;\n\n var url = '/gestionTAIDI/api/chp_api4/' +formatted_date1+ '/' + formatted_date2;\n\n fetch(url, myInit)\n /*.then(function(){\n console.log(\"Chargement...\")\n })*/\n .then(function (response) {\n return response.json();\n // console.log(response.json())\n })\n .then(function (json) {\n\n json.forEach(([{designation}, occurence]) => {\n designations.push(designation+\" Quantité :\"+ occurence);\n occurences.push(occurence)\n })\n console.log(designations+\"\\n\\n\"+occurences);\n\n //if (current !== designations.length) {\n // current = designations.length\n var config = {\n type: 'pie',\n data: {\n datasets: [{\n data: [...occurences],\n backgroundColor: [\n window.chartColors.red,\n window.chartColors.orange,\n window.chartColors.yellow,\n window.chartColors.green,\n window.chartColors.blue,\n ],\n label: 'Dataset 2'\n }],\n labels: [...designations]\n },\n options: {\n responsive: true,\n legend: {\n position: 'right',\n labels:{\n fontSize: 16,\n\n }\n },\n title:{\n display:true,\n text:'ytergplkjhgr',\n }\n }\n };\n window.myPie = new Chart(ctx, config);\n // }\n\n });\n } else {\n // Faire quelque chose avec XMLHttpRequest?\n console.log(\"error!!!\");\n }\n }", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "function datosGraficas(id) {\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('GRAFICAS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('VISUALIZA EL AVANCE DE FORMA GRAFICA');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Datos del usuario');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let graficas = document.createElement(\"div\");\n graficas.setAttribute('id', 'myfirstchart');\n\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(graficas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n if (httpRequest.responseText != '') {\n let revisiones = JSON.parse(httpRequest.responseText);\n console.log(revisiones);\n\n new Morris.Line({\n // ID of the element in which to draw the chart.\n element: 'myfirstchart',\n // Chart data records -- each entry in this array corresponds to a point on\n // the chart.\n data: revisiones\n /*[\n { year: '2008', value: 200,value2: 200 },\n { year: '2009', value: 10,value2: 150 },\n { year: '2010', value: 5,value2: 100 },\n { year: '2011', value: 5,value2: 15 },\n { year: '2013', value: 10,value2: 25 },\n { year: '2020', value: 250,value2: 183 },\n { year: '2021', value: 5,value2: 182.5 },\n { year: '2022', value: 20,value2: 100 }\n ]*/\n ,\n // The name of the data record attribute that contains x-values.\n xkey: 'fecha',\n // A list of names of data record attributes that contain y-values.\n ykeys: ['agua', 'grasa_cor', 'indice_cor', 'masa_mag', 'peso'],\n // Labels for the ykeys -- will be displayed when you hover over the\n // chart.\n labels: ['Agua', 'Grasa Corporal', 'Indice Corporal', 'Masa magra', 'Peso'],\n resize: true,\n lineColors: ['blue', 'orange', 'green', 'red', 'purple']\n })\n }\n }\n }\n };\n httpRequest.send('datosGraf=' + id);\n\n\n}", "function updateMalariaCases(){\n\tvar svgMalariaCases = d3.select(\"#vis-sec-malaria-cases\")\n\t\t\t\t\t\t\t.append(\"svg\")\n\t\t\t\t\t\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t\t\t\t\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\t\t\t\t\t\t.style(\"margin-left\", margin.left + \"px\")\n\t\t\t\t\t\t\t.append(\"g\")\n\t\t\t\t\t\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\tvar data = bubbleData[\"malaria_cases\"];\n\taddChartInfo(data, svgMalariaCases);\n}", "function cargarInformacionEnTabla(data)\n{\n\t\t\n\t\t//se destruye el datatable al inicio\n\tif(typeof table !== \"undefined\")\n\t{\n\t\t\n table.destroy(); \n $('#tablaModulos').empty();\n }\n\t\t\n\t\t\t\n\t\t table = $('#tablaModulos').DataTable({\n\t\t\t\"data\": data,\n\t\t\tcolumns: [\n\t\t\t{ data: \"bloques\"},\n\t\t\t{ data: \"LUNES\"},\n\t\t\t{ data: \"MARTES\"},\n\t\t\t{ data: \"MIERCOLES\" },\n\t\t\t{ data: \"JUEVES\" },\n\t\t\t{ data: \"VIERNES\" },\n\t\t\t{ data: \"SABADO\" },\n\t\t\t{ data: \"DOMINGO\" },\n\t\t\t\n\t\t\t// {data: null, className: \"center\", defaultContent: '<a id=\"view-link\" class=\"edit-link\" href=\"#\" title=\"Edit\">Estudiantes por Salón </a>'},\n\t\t\t// {data: null, className: \"center\", defaultContent: '<a id=\"asistencias-link\" class=\"asistencias-link\" href=\"#\" title=\"Edit\">Asistencias</a>'}\n\t\t\t],\n\t\t\t\"info\": false,\n\t\t\t\"order\": [[ 0, \"asc\" ]],\n\t\t\t\"scrollY\": \"300px\",\n\t\t\t\"scrollX\": true,\n\t\t\t\"bDestroy\": true,\n\t\t\t\"bSort\": false,\n\t\t\t\"scrollCollapse\": true,\n\t\t\t\"searching\": false,\n\t\t\t\"paging\": false,\n\t\t\t\"filter\":false,\n\t\t\t\"columnDefs\": [\n\t\t\t// {\"targets\": [ 0 ],\"visible\": true,\"searchable\": true},\n\t\t\t// {\"targets\": [ 1 ],\"visible\": true,\"searchable\": false},\n\t\t\t// {\"targets\": [ 3 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 5 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 15 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 13 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 16 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 17 ],\"visible\": false,\"searchable\": false}\n\t\t\t],\n\t\t\t\"language\": {\n\t\t\t\t\"url\": \"//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Spanish.json\",\n \"sProcessing\": \"Procesando...\",\n\t\t\t\t\"sSearch\": \"Filtrar:\",\n\t\t\t\t\"zeroRecords\": \"Ningún resultado encontrado\",\n\t\t\t\t\"infoEmpty\": \"No hay registros disponibles\",\n\t\t\t\t\"Search:\": \"Filtrar\"\n\t\t\t}\n\t\t});\n\t\t\n}", "recorrerArbolConsulta(nodo) {\n //NODO INICIO \n if (this.tipoNodo('INICIO', nodo)) {\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //NODO L, ES LA LISTA DE CONSULTAS \n if (this.tipoNodo('L', nodo)) {\n //SE RECORREN TODOS LOS NODOS QUE REPRESENTAN UNA CONSULTA \n for (var i = 0; i < nodo.hijos.length; i++) {\n this.recorrerArbolConsulta(nodo.hijos[i]);\n this.reiniciar();\n // this.codigoTemporal += \"xxxxxxxxxxxxxxxxxxxx-\"+this.contadorConsola+\".\"+\"\\n\";\n }\n }\n //PARA RECORRER TODOS LOS ELEMENTOS QUE COMPONEN LA CONSULTA \n if (this.tipoNodo('CONSULTA', nodo)) {\n for (var i = 0; i < nodo.hijos.length; i++) {\n this.pathCompleto = false;\n this.controladorAtributoImpresion = false;\n this.controladorDobleSimple = false;\n this.controladorPredicado = false;\n this.recorrerArbolConsulta(nodo.hijos[i]);\n }\n }\n //PARA RECORRER TODOS LOS ELEMENTOS QUE COMPONEN LA CONSULTA \n if (this.tipoNodo('VAL', nodo)) {\n for (var i = 0; i < nodo.hijos.length; i++) {\n this.pathCompleto = false;\n this.controladorAtributoImpresion = false;\n this.controladorDobleSimple = false;\n this.controladorPredicado = false;\n this.recorrerArbolConsulta(nodo.hijos[i]);\n }\n }\n //PARA VERIFICAR EL TIPO DE ACCESO, EN ESTE CASO // \n if (this.tipoNodo('DOBLE', nodo)) {\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //PARA VERIFICAR EL TIPO DE ACCESO, EN ESTE CASO: /\n if (this.tipoNodo('SIMPLE', nodo)) {\n //Establecemos que se tiene un acceso de tipo DOBLE BARRA \n this.controladorDobleSimple = false;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN IDENTIFICADOR \n if (this.tipoNodo('identificador', nodo)) {\n const str = nodo.hijos[0];\n this.busquedaElemento(str);\n }\n //PARA VERIFICAR SI LO QUE SE VA A ANALIZAR ES UN PREDICADO \n if (this.tipoNodo('PREDICADO', nodo)) {\n this.controladorPredicado = true;\n const identificadorPredicado = nodo.hijos[0];\n //Primero se procede a la búsqueda del predicado\n this.codigoTemporal += \"//Inicio ejecucion predicado\\n\";\n this.busquedaElemento(identificadorPredicado);\n //Seguidamente se resuelve la expresión\n let resultadoExpresion = this.resolverExpresion(nodo.hijos[1]);\n let anteriorPredicado = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=\" + anteriorPredicado + \";\\n\";\n let predicadoVariable = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"PXP = \" + predicadoVariable + \";\\n\";\n this.codigoTemporal += \"ubicarPredicado();\\n\";\n //SI EL RESULTADO ES DE TIPO ETIQUETA\n if (resultadoExpresion.tipo == 4) {\n let datos = resultadoExpresion.valor;\n let a = datos[0];\n let b = datos[1];\n let c = datos[2];\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n // salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameID());\n this.auxiliarPredicado(a, b, c, this.consolaSalidaXPATH[i]);\n }\n }\n //SI EL RESULTADO ES DE TIPO ETIQUETA\n if (resultadoExpresion.tipo == 1) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[(this.contadorConsola + resultadoExpresion.valor) - 1]);\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n this.controladorPredicadoInicio = false;\n }\n //PARA VERIFICAR QUE ES UN PREDICADO DE UN ATRIBUTO\n if (this.tipoNodo('PREDICADO_A', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n const identificadorPredicadoAtributo = nodo.hijos[0];\n //RECORREMOS LO QUE VA DENTRO DE LLAVES PARA OBTENER EL VALOR\n //AQUI VA EL METODO RESOLVER EXPRESION DE SEBAS PUTO \n return this.recorrerArbolConsulta(nodo.hijos[1]);\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN ATRIBUTO \n if (this.tipoNodo('atributo', nodo)) {\n this.controladorAtributoImpresion = true;\n const identificadorAtributo = nodo.hijos[0];\n if (this.inicioRaiz) {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let x = this.consolaSalidaXPATH[i];\n //let nodoBuscarAtributo = this.consolaSalidaXPATH[this.consolaSalidaXPATH.length - 1];\n let nodoBuscarAtributo = x;\n //CODIGO DE 3 DIRECCIONES \n this.codigoTemporal += \"P=\" + nodoBuscarAtributo.posicion + \";\\n\";\n let inicioRaizXML = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var z = 0; z < identificadorAtributo.length; z++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${identificadorAtributo.charCodeAt(z)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n let anteriorGlobal = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"stackXPATH[(int)PXP]=\" + anteriorGlobal + \";\\n\";\n this.temporalGlobal.aumentar();\n this.codigoTemporal += \"busquedaAtributo();\\n\";\n //CODIGO DE 3 DIRECCIONES \n //Se procede a la búsqueda de los atributos en todos los nodos\n for (let entry of nodoBuscarAtributo.atributos) {\n let atributoTemporal = entry;\n let nombreAbributo = atributoTemporal.dameNombre();\n if (nombreAbributo == identificadorAtributo) {\n this.atributoID = identificadorAtributo;\n this.pathCompleto = true;\n // this.contadorConsola = i;\n // this.consolaSalidaXPATH.push(nodoBuscarAtributo);\n }\n }\n /*for (let entry of nodoBuscarAtributo.hijos) {\n this.busquedaAtributo(entry, identificadorAtributo);\n }*/\n if (this.controladorDobleSimple) {\n this.busquedaAtributo(x, identificadorAtributo);\n }\n }\n }\n else {\n this.inicioRaiz = true;\n for (let entry of this.ArrayEtiquetas) {\n let temp = entry;\n //CODIGO DE 3 DIRECCIONES \n this.codigoTemporal += \"P=\" + temp.posicion + \";\\n\";\n let inicioRaizXML = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var z = 0; z < identificadorAtributo.length; z++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${identificadorAtributo.charCodeAt(z)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n let anteriorGlobal = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"stackXPATH[(int)PXP]=\" + anteriorGlobal + \";\\n\";\n this.temporalGlobal.aumentar();\n this.codigoTemporal += \"busquedaAtributo();\\n\";\n //CODIGO DE 3 DIRECCIONES \n for (let entry2 of temp.atributos) {\n let aTemp = entry2;\n let nameAtt = aTemp.dameNombre();\n if (nameAtt == identificadorAtributo) {\n this.atributoID = identificadorAtributo;\n this.pathCompleto = true;\n }\n }\n if (this.controladorDobleSimple) {\n this.busquedaAtributo(entry, identificadorAtributo);\n }\n }\n }\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES CUALQUIER ELEMENTO \n if (this.tipoNodo('any', nodo)) {\n //SIGNIFICA ACCESO DOBLE\n if (this.controladorDobleSimple) {\n let controladorNuevoInicio = -1;\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let temporal = this.consolaSalidaXPATH[i];\n for (let entry of temporal.hijos) {\n //insertamos TODOS los hijos\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirContenido();\\n\";\n this.consolaSalidaXPATH.push(entry);\n if (controladorNuevoInicio == -1)\n controladorNuevoInicio = this.consolaSalidaXPATH.length - 1;\n this.complementoAnyElement(entry);\n }\n }\n this.contadorConsola = controladorNuevoInicio;\n this.pathCompleto = true;\n }\n //SIGNIFICA ACCESO SIMPLE \n else {\n //Controlamos el nuevo acceso para cuando coloquemos un nuevo elemento en la lista \n let controladorNuevoInicio = -1;\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let temporal = this.consolaSalidaXPATH[i];\n for (let entry of temporal.hijos) {\n //insertamos TODOS los hijos\n this.consolaSalidaXPATH.push(entry);\n if (controladorNuevoInicio == -1)\n controladorNuevoInicio = this.consolaSalidaXPATH.length - 1;\n }\n }\n this.contadorConsola = controladorNuevoInicio;\n this.pathCompleto = true;\n }\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UNA PALABRA RESERVADA que simplicaria un AXE \n if (this.tipoNodo('reservada', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n const identificador = nodo.hijos[0];\n this.auxiliarAxe = identificador;\n //VERIFICAMOS EL TIPO DE ACCESO DE AXE \n if (this.controladorDobleSimple)\n this.dobleSimpleAxe = true;\n }\n if (this.tipoNodo('AXE', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n if (this.dobleSimpleAxe)\n this.controladorDobleSimple = true;\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var i = 0; i < this.auxiliarAxe.length; i++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${this.auxiliarAxe.charCodeAt(i)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n this.codigoTemporal += \"PXP =\" + this.temporalGlobal.retornarString() + \";\\n\";\n this.codigoTemporal += \"ejecutarAxe();\\n\";\n //Si Solicita implementar el axe child\n if (this.auxiliarAxe == \"child\") {\n //ESCRIBIMOS LOS IFS RESPECTIVOS \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Si necesitsa implementar el axe attribute\n if (this.auxiliarAxe == \"attribute\") {\n //Le cambiamos la etiqueta de identificador a atributo para fines de optimizacion de codigo\n nodo.hijos[0].label = \"atributo\";\n //Escribimos el codigo en C3D para la ejecución del axe atributo \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Si necesitsa implementar el ancestor\n if (this.auxiliarAxe == \"ancestor\") {\n //Va a resolver el predicado o identificador que pudiese venir \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n if (this.auxiliarAxe == \"descendant\") {\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Reiniciamos la variable cuando ya se acabe el axe\n this.auxiliarAxe = \"\";\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN ATRIBUTO \n if (this.tipoNodo('X', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n //const identificadorAtributo = nodo.hijos[0] as string;\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n /*\n EN ESTA PARTE SE VA A PROCEDER PARA IR A BUSCAR EL ELEMENTO SEGÚN TIPO DE ACCESO\n */\n }\n //PARA VERIFICAR SI SE NECESITAN TODOS LOS ATRIBUTOS DEL NODO ACTUAL \n if (this.tipoNodo('any_att', nodo)) {\n this.controladorText = true;\n const identificadorAtributo = nodo.hijos[0];\n //Verificamos el tipo de acceso\n //Significa acceso con prioridad\n if (this.controladorDobleSimple) {\n //VERIFICAMOS DESDE DONDE INICIAMOS\n if (!this.inicioRaiz) {\n this.inicioRaiz = true;\n for (let entry of this.ArrayEtiquetas) {\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n this.complementoAnnyAtributte(entry);\n }\n }\n else {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let entry = this.consolaSalidaXPATH[i];\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n this.complementoAnnyAtributte(entry);\n }\n }\n }\n //Acceso sin prioridad\n else {\n if (!this.inicioRaiz) {\n for (let entry of this.ArrayEtiquetas) {\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n }\n }\n else {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let entry = this.consolaSalidaXPATH[i];\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n }\n }\n }\n } //FIN ANNY ATT\n //PARA VERIFICAR SI SE ESTÁ INVOCANDO A LA FUNCIÓN TEXT() \n if (this.tipoNodo('text', nodo)) {\n this.controladorText = true;\n const identificadorAtributo = nodo.hijos[0];\n //Si se necesita el texto de el actual y los descendientes\n if (this.controladorDobleSimple) {\n for (var i = this.contadorConsola; i < this.consolaSalidaXPATH.length; i++) {\n /*if (this.consolaSalidaXPATH[i].dameValor() == \"\" || this.consolaSalidaXPATH[i].dameValor() == \" \") {\n \n } else {\n // salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameValor());\n }*/\n this.codigoTemporal += \"P=\" + this.consolaSalidaXPATH[i].posicion + \";\\n\";\n this.codigoTemporal += \"text();\\n\";\n this.complementoText(this.consolaSalidaXPATH[i]);\n }\n }\n else {\n //si necesita solo el texto del actual \n for (var i = this.contadorConsola; i < this.consolaSalidaXPATH.length; i++) {\n /* if (this.consolaSalidaXPATH[i].dameValor() == \"\" || this.consolaSalidaXPATH[i].dameValor() == \" \") {\n \n } else {\n //salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameValor());\n }*/\n this.codigoTemporal += \"P=\" + this.consolaSalidaXPATH[i].posicion + \";\\n\";\n this.codigoTemporal += \"text();\\n\";\n }\n }\n }\n //PARA VERIFICAR SI ES EL TIPO DE ACCESO AL PADRE: \":\" \n if (this.tipoNodo('puntos', nodo)) {\n const cantidad = nodo.hijos[0];\n //DOSPUNTOSSSSSSSSS\n if (cantidad.length == 2) {\n this.pathCompleto = true;\n if (this.auxiliarArrayPosicionPadres == -1) {\n this.auxiliarArrayPosicionPadres = this.arrayPosicionPadres.length - 1;\n }\n for (var i = this.auxiliarArrayPosicionPadres; i >= 0; i--) {\n let contadorHermanos = this.arrayPosicionPadres[i];\n let controladorInicio = 0;\n if (i > 0) {\n while (contadorHermanos != this.arrayPosicionPadres[i - 1]) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[contadorHermanos]);\n this.codigoTemporal += \"P =\" + this.consolaSalidaXPATH[contadorHermanos].posicion + \";\\n\";\n if (controladorInicio == 0) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n controladorInicio++;\n contadorHermanos--;\n this.auxiliarArrayPosicionPadres = contadorHermanos;\n }\n }\n else {\n while (contadorHermanos >= 0) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[contadorHermanos]);\n this.codigoTemporal += \"P =\" + this.consolaSalidaXPATH[contadorHermanos].posicion + \";\\n\";\n if (controladorInicio == 0) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n controladorInicio++;\n contadorHermanos--;\n this.auxiliarArrayPosicionPadres = contadorHermanos;\n }\n }\n break;\n }\n this.codigoTemporal += \"busquedaSimple();\\n\";\n }\n //SIGNIFICA QUE TIENE SOLO UN PUNTO \n else {\n this.pathCompleto = true;\n }\n ///DOS PUNTOOOOOOOOOOOOOOOOS\n }\n }", "function dibujarFresado126(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchuraPlaca,pos.y+alaInferior)\n\t\n\tvar fresado4 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+alturaPlaca)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchuraPlaca,pos.y+alaInferior+alturaPlaca)\n\t\n\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\n\treturn op_fresado; \n\n\t\n}", "function Analog_humec() {\r\n let newDataset = {\r\n label: 'HumEC',\r\n func: Analog_humec,\r\n backgroundColor: \"rgb(12, 1, 90)\",\r\n borderColor: \"rgb(12, 1, 90)\",\r\n data: [],\r\n fill: false\r\n };\r\n if (config.data.datasets.find( element =>element.label === newDataset.label) ){\r\n console.log ( \"Ya existe esta grafica\");\r\n }else{\r\n for (const prop in LocalDatabase_analog){\r\n if(LocalDatabase_analog[prop].humCap){\r\n newDataset.data.push({x:LocalDatabase_analog[prop].timestamps.substr(11,5), y:LocalDatabase_analog[prop].humEC.rawData});\r\n }\r\n }\r\n config.data.datasets.push(newDataset);\r\n updateChart();\r\n }\r\n}", "function obtenerEstadisticas(opcion,platillo,fechaDesde,FechaHata) // si platillo=null, no importa el platillo \n{\n switch(opcion)\n {\n case 2: // por dia por todos los platillos\n\n $.post(\"PHP/obtenerEstadisticas.php\", { opcion: 2, fechaDesde: fechaDesde, fechaHasta: FechaHata, platillo: platillo }, function (data) {\n var obj = JSON.parse(data);\n var sumas = obj.suma_todo;\n //totales\n var sum_total = sumas[0].total;\n var sum_costos = sumas[0].costo;\n var sum_ganancias = sumas[0].ganancia;\n //\n var promedios = obj.promedios_todo;\n //promedios\n var prom_total = promedios[0].total;\n var prom_costo = promedios[0].costo;\n var prom_ganancia = promedios[0].ganancia;\n //puntos de top_mes(mes)\n var top_mes = obj.top_mes;\n var plot_mes = [];\n var i = 0; var len = top_mes.length;\n for (i = 0; i < len; i++) {\n plot_mes.push({\n label: top_mes[i].mes,\n value: top_mes[i].total\n });\n }\n // puntos a graficas top_dia\n var top_dia = obj.top_dia;\n var plot_dia = [];\n i = 0; len = top_dia.length;\n for (i = 0; i < len; i++) {\n plot_dia.push({\n label: top_dia[i].fecha,\n value: top_dia[i].total\n });\n }\n\n\n\n\n\n // table promedios\n var table_promedios = '<div class=\"panel panel-primary\">';\n table_promedios += '<div class=\"panel-heading\"><label>Promedio vendido por dia</label></div>';\n table_promedios += '<div class=\"panel-body\">';\n table_promedios += '<div class=\"table-responsive\">';\n\n table_promedios += '<table class=\"table table-condensed table-hover\"><thead>';\n table_promedios += '<tr class=\"info\"><th>Total</th><th>Costo</th><th>Ganancia</th></tr></thead><tbody><tr>';\n table_promedios += '<td>' + prom_total + '</td>' + '<td>' + prom_costo + '</td>' + '<td>' + prom_ganancia + '</td>'\n table_promedios += '</tr></tbody></table></div></div>';\n DOM_promedio_vendido.html(table_promedios);\n // table sumas\n var table_sumas = '<div class=\"table-responsive\"><table class=\"table table-condensed table-hover\"><thead>';\n table_sumas += '<tr class=\"info\"><th>Total</th><th>Costo</th><th>Ganancia</th></tr></thead><tbody><tr>';\n table_sumas += '<td>' + sum_total + '</td>' + '<td>' + sum_costos + '</td>' + '<td>' + sum_ganancias + '</td>'\n table_sumas += '</tr></tbody></table></div></div></div>';\n DOM_total_vendido.html(table_sumas);\n\n //headres de panels\n DOM_header1.html(\"<label>Top 3 dias mejor vendidos</label>\");\n DOM_header2.html(\"<label>Top 3 meses mejor vendidos</label>\");\n // header resultado\n DOM_results_header.html(\"<h4>Total vendido de \" + fechaDesde + \" hasta \" + FechaHata+\"</h4>\");\n\n // refresh doms\n DOM_donut1.html('');\n DOM_donut2.html('');\n DOM_donut3.html('');\n // graficar\n Morris.Donut({\n resize: true,\n element: 'donut1',\n data: plot_dia\n });\n Morris.Donut({\n resize: true,\n element: 'donut2',\n data: plot_mes\n });\n\n var top_platillos = obj.top_platillos;\n len = top_platillos.length;\n i = 0;\n var plot_data_platillos = [];\n for (i = 0; i < len; i++) {\n plot_data_platillos.push({\n label: top_platillos[i].nombre,\n value: top_platillos[i].cantidad\n\n });\n\n }\n\n Morris.Donut({\n resize: true,\n element: 'donut3',\n data: plot_data_platillos\n });\n\n\n DOM_top_platillos.show();\n\n\n\n });\n\n\n \n\n\n\n\n break;\n\n\n case 1:\n $.post(\"PHP/obtenerEstadisticas.php\", { opcion: 1, fechaDesde: fechaDesde, fechaHasta: FechaHata, platillo: platillo }, function (data) {\n\n DOM_top_platillos.hide();\n var obj = JSON.parse(data);\n var sumas = obj.suma_todo;\n //totales\n var sum_total = sumas[0].total;\n var sum_costos = sumas[0].costo;\n var sum_ganancias = sumas[0].ganancia;\n //\n var promedios = obj.promedios_todo;\n //promedios\n var prom_total = promedios[0].total;\n var prom_costo = promedios[0].costo;\n var prom_ganancia = promedios[0].ganancia;\n //puntos de top_mes(mes)\n var top_mes = obj.top_mes;\n var plot_mes = [];\n var i = 0;var len = top_mes.length;\n for(i=0;i<len;i++)\n {\n plot_mes.push({\n label: top_mes[i].mes,\n value: top_mes[i].total\n });\n }\n // puntos a graficas top_dia\n var top_dia = obj.top_dia;\n var plot_dia = [];\n i = 0; len = top_dia.length;\n for (i = 0; i < len; i++) {\n plot_dia.push({\n label: top_dia[i].fecha,\n value: top_dia[i].total\n });\n }\n\n\n\n\n\n // table promedios\n var table_promedios = '<div class=\"panel panel-primary\">';\n table_promedios += '<div class=\"panel-heading\"><label>Promedio vendido por dia</label></div>';\n table_promedios += '<div class=\"panel-body\">';\n table_promedios += '<div class=\"table-responsive\">';\n\n table_promedios += '<table class=\"table table-condensed table-hover\"><thead>';\n table_promedios += '<tr class=\"info\"><th>Total</th><th>Costo</th><th>Ganancia</th></tr></thead><tbody><tr>';\n table_promedios += '<td>' + prom_total + '</td>' + '<td>' + prom_costo + '</td>' + '<td>' + prom_ganancia + '</td>'\n table_promedios += '</tr></tbody></table></div></div></div>';\n DOM_promedio_vendido.html(table_promedios);\n // table sumas\n var table_sumas = '<div class=\"table-responsive\"><table class=\"table table-condensed table-hover\"><thead>';\n table_sumas += '<tr class=\"info\"><th>Total</th><th>Costo</th><th>Ganancia</th></tr></thead><tbody><tr>';\n table_sumas += '<td>' + sum_total + '</td>' + '<td>' + sum_costos + '</td>' + '<td>' + sum_ganancias + '</td>'\n table_sumas += '</tr></tbody></table></div></div>';\n DOM_total_vendido.html(table_sumas);\n\n //headres de panels\n DOM_header1.html(\"<label>Top 3 dias mejor vendidos</label>\");\n DOM_header2.html(\"<label>Top 3 meses mejor vendidos</label>\");\n // header resultado\n DOM_results_header.html(\"<h4>\" + platillo + \" por total vendido de \" + fechaDesde + \" hasta \" + FechaHata+\"</h4>\");\n\n // refresh doms\n DOM_donut1.html('');\n DOM_donut2.html('');\n // graficar\n Morris.Donut({\n resize: true,\n element: 'donut1',\n data: plot_dia\n });\n Morris.Donut({\n resize: true,\n element: 'donut2',\n data: plot_mes\n });\n \n \n\n \n\n });\n\n\n break;\n case 0: // platillo especifico por dia por cantidad \n\n $.post(\"PHP/obtenerEstadisticas.php\", { opcion: 0, fechaDesde: fechaDesde, fechaHasta: FechaHata, platillo: platillo }, function (data) {\n DOM_top_platillos.hide();\n\n var obj = JSON.parse(data);\n var promedio_dia = obj.promedio_dia[0].promedio_dia;\n var promedio_mes = obj.promedio_mes[0].promedio_mes;\n var total = obj.total[0].total;\n var datos = obj.datos;\n var i = 0;\n var len = datos.length;\n var plot_data = [];\n for(i=0;i<len;i++)\n {\n plot_data.push({\n label: datos[i].fecha,\n value: datos[i].cantidad\n\n });\n \n }\n\n datos = obj.datos2;\n i = 0;\n len = datos.length;\n var plot_data2 = [];\n for (i = 0; i < len; i++) {\n plot_data2.push({\n label: datos[i].mes,\n value: datos[i].cantidad\n\n });\n\n }\n\n\n\n // Cambiar DOM pertinente \n\n var table_promedios = '<div class=\"panel panel-primary\">';\n table_promedios += '<div class=\"panel-heading\"><label>Promedio vendido</label></div>';\n table_promedios += '<div class=\"panel-body\">';\n\n\n table_promedios += '<div class=\"table-responsive\"><table class=\"table table-condensed table-hover\">';\n table_promedios += '<thead><tr class=\"info\"><th>Por dia </th> <th>Por mes</th></tr></thead> <tbody><tr>';\n table_promedios += \"<td>\" + promedio_dia + \"</td>\";\n table_promedios += \"<td>\" + promedio_mes + \"</td>\";\n table_promedios += \"</tr></tbody></table></div>\";\n \n table_promedios += '</div></div>';\n\n DOM_promedio_vendido.html(table_promedios);\n DOM_total_vendido.html(total + \" \"+platillo + \" vendidos\" );\n \n DOM_header1.html(\"<label>Top 3 dias mejor vendidos</label>\");\n DOM_header2.html(\"<label>Top 3 meses mejor vendidos</label>\");\n DOM_results_header.html(\"<h4>\" + platillo + \" por cantidad vendida de \" + fechaDesde + \" hasta \" + FechaHata+\"</h4>\");\n // refresh doms\n DOM_donut1.html('');\n DOM_donut2.html('');\n // graficar\n Morris.Donut({\n resize :true,\n element: 'donut1',\n data: plot_data\n });\n Morris.Donut({\n resize: true,\n element: 'donut2',\n data: plot_data2\n });\n\n\n\n\n });\n\n\n\n break;\n\n }\n\n\n}", "function loaded(){\n graph([]);\n pieChart([],[],[],[]);\n}", "function LeerDatos(){\n var celdasvacias=false;\n renglonconceldasvacias=[];\n \n var data=Array();\n data.push({\"prestamoaccionistas\":LeerExcel(\"excelsituacion\",8,3)}); //nombre de la tabla, renglon(r) y columna(c) \n data.push({\"prestamolargoplazo\":LeerExcel(\"excelsituacion\",9,3)}); \n data.push({\"inversionaccionistas\":LeerExcel(\"excelsituacion\",12,3)});\n data.push({\"utilidadreservas\":LeerExcel(\"excelsituacion\",13,3)});\n \n data.push({\"porcgastos2\":$(\"#anio1gastos\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"porcgastos3\":$(\"#anio2gastos\").val().replace(/[\\$,]/g, \"\")});\n \n data.push({\"oficinas\":LeerExcel(\"excelgastos\",1,1)});\n data.push({\"servpublicos\":LeerExcel(\"excelgastos\",3,1)});\n data.push({\"telefonos\":LeerExcel(\"excelgastos\",4,1)});\n data.push({\"seguros\":LeerExcel(\"excelgastos\",5,1)});\n data.push({\"papeleria\":LeerExcel(\"excelgastos\",6,1)});\n data.push({\"rentaequipo\":LeerExcel(\"excelgastos\",7,1)});\n data.push({\"costoweb\":LeerExcel(\"excelgastos\",8,1)});\n data.push({\"costoconta\":LeerExcel(\"excelgastos\",9,1)});\n \n data.push({\"honorariolegal\":LeerExcel(\"excelgastos\",1,3)});\n data.push({\"viajesysubsistencia\":LeerExcel(\"excelgastos\",2,1)});\n data.push({\"gastosautos\":LeerExcel(\"excelgastos\",3,1)});\n data.push({\"gastosgenerales\":LeerExcel(\"excelgastos\",4,1)});\n data.push({\"cargosbancarios\":LeerExcel(\"excelgastos\",5,1)});\n data.push({\"otrosservicios\":LeerExcel(\"excelgastos\",6,1)});\n data.push({\"gastosinvestigacion\":LeerExcel(\"excelgastos\",8,1)});\n data.push({\"gastosdiversos\":LeerExcel(\"excelgastos\",9,1)});\n \n data.push({\"totalgastos\":$(\"#totalgastos\").val().replace(/[\\$,]/g, \"\")});\n \n data.push({\"tasalider\":$(\"#tasalider\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"primariesgo\":$(\"#primariesgo\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"riesgopais\":$(\"#riesgopais\").val().replace(/[\\$,]/g, \"\")});\n \n data.push({\"tasalargoplazo\":$(\"#tasalargoplazo\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"tasacortoplazo\":$(\"#tasacortoplazo\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"interesexcedente\":$(\"#interesexcedente\").val().replace(/[\\$,]/g, \"\")});\n \n return data;\n}", "draw(data) {\n //clear the svg\n this.vis.selectAll(\"*\").remove();\n\n //our graph, represented through nodes and links\n let nodes = [];\n let links = [];\n\n //add our nodes\n //add the committee nodes\n let init_y = 0;\n Object.keys(data.committees || {}).forEach((key) => {\n nodes.push({id:\"c_\"+data.committees[key].id, name: data.committees[key].name, x: 300, fx: 300, y: init_y+=60});\n });\n\n //add the representative nodes\n init_y = 0;\n Object.keys(data.representatives || {}).forEach((key) => {\n nodes.push({id:\"r_\"+data.representatives[key].id, name: data.representatives[key].name,party:data.representatives[key].party, x:600, fx: 600, y: init_y+=60});\n });\n\n //add the bill nodes\n init_y = 0;\n Object.keys(data.bills || {}).forEach((key) => {\n nodes.push({id:\"b_\"+data.bills[key].bill_id, name: data.bills[key].name, bill:true, x: 900, fx: 900, y: init_y+=60});\n });\n\n //add our links\n //add the donation links between committees and representatives\n Object.keys(data.donations || {}).forEach((key) => {\n if(data.donations[key].source in data.committees && data.donations[key].destination in data.representatives){\n links.push({source:\"c_\"+data.donations[key].source, target: \"r_\"+data.donations[key].destination,thickness:data.donations[key].amount, status:data.donations[key].support == \"S\" ? 1 : 2});\n }\n });\n\n //add the vote links between representatives and bills\n Object.keys(data.votes || {}).forEach((key) => {\n if(data.votes[key].source in data.representatives && data.votes[key].destination in data.bills){\n links.push({source:\"r_\"+data.votes[key].source, target: \"b_\"+data.votes[key].destination, status:data.votes[key].position == \"Yes\" ? 1 : data.votes[key].position == \"No\" ? 2 : 3});\n }\n });\n\n //a scaling function that limits how think or thin edges can be in our graph\n let thicknessScale = d3.scaleLinear().domain([0,d3.max(data.donations,(d) => {return d.amount;})]).range([2, 20]);\n\n //function that calls our given context menu with the appropria parameters\n let contextMenu = (d) => {\n let event = d3.getEvent();\n event.preventDefault();\n this.nodeMenu(d, event);\n };\n\n //Create a force directed graph and define forces in it\n //Our graph is essentially a physics simulation between nodes and edges\n let force = d3.forceSimulation(nodes)\n .force(\"charge\", d3.forceManyBody().strength(250).distanceMax(300))\n .force('link', d3.forceLink(links).distance(0).strength(.1).id((d) => {return d.id;}))\n .force(\"collide\", d3.forceCollide().radius(30).iterations(2).strength(.7))\n .force(\"center\", d3.forceCenter())\n .force('Y', d3.forceY().y(0).strength(.001));\n //Draw the edges between the nodes\n let edges = this.vis.selectAll(\"line\")\n .data(links)\n .enter()\n .append(\"line\")\n .style(\"stroke-width\", (d) => { return thicknessScale(d.thickness); })\n .style(\"stroke\", (d) => {\n if(d.status == 1) {\n return \"Green\";\n } else if(d.status == 2) {\n return \"Purple\";\n }\n return \"White\";\n })\n .attr(\"marker-end\", \"url(#end)\");\n //Draw the nodes themselves\n let circles = this.vis.selectAll(\"circle\")\n .data(nodes)\n .enter()\n .append(\"circle\")\n .attr(\"r\", 20)\n .style(\"stroke\", \"black\")\n .style(\"fill\", (d) => {\n if(d.party == \"R\"){\n return d.color = \"#E64A19\"; //red\n } else if(d.party==\"D\"){\n return d.color = \"#1976D2\"; //blue\n } else {\n return d.color = \"#BCAAA4\"; //brown\n }\n })\n .on('contextmenu', contextMenu);\n //Draw text for all the nodes\n let texts = this.vis.selectAll(\"text\")\n .data(nodes)\n .enter()\n .append(\"text\")\n .attr(\"fill\", \"black\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"10px\")\n .html((d) => { return d.name; })\n .each((d, i, nodes) => { d.bbox = nodes[i].getBBox(); })\n .on('contextmenu', contextMenu);\n //Draw text background for all the nodes\n let textBGs = this.vis.selectAll(\"rect\")\n .data(nodes)\n .enter()\n .insert(\"rect\", \"text\")\n .attr(\"fill\", (d) => {return d.color;})\n .attr(\"width\", (d) => {return d.bbox.width+10})\n .attr(\"height\", (d) => {return d.bbox.height+10})\n .on('contextmenu', contextMenu);\n\n //For every tick in our simulation, we update the positions for all ui elements\n force.on(\"tick\", () => {\n edges.attr(\"x1\", (d) => { return d.source.x; })\n .attr(\"y1\", (d) => { return d.source.y; })\n .attr(\"x2\", (d) => { return d.target.x; })\n .attr(\"y2\", (d) => { return d.target.y; });\n circles.attr(\"cx\", (d) => { return d.x; })\n .attr(\"cy\", (d) => { return d.y; })\n texts.attr(\"transform\", (d) => { return \"translate(\" + (d.party || d.bill ? d.x : d.x-d.bbox.width) + \",\" + (d.y+(d.bbox.height/4)) + \")\"; });\n textBGs.attr(\"transform\", (d) => { return \"translate(\" + (d.party || d.bill ? d.x-5 : d.x-d.bbox.width-5) + \",\" + (d.y-(d.bbox.height*.5)-5) + \")\"; });\n }); // End tick func\n\n //zoom and pan our graph such that all elements are visible\n setTimeout(() => {this.zoomTo(this.vis)}, 500);\n }", "function DibujarChartPrincipal() {\n //Se obtienen las dos cadenas, 1 de cada servlet y con al informacion para las graficas, principal y secundaria respectivamente.\n var cadena = carga();\n var cadena2 = carga2();\n //Split a las dos cadenas para tener los datos como vector y darles formato.\n cadena = cadena.split(\",\");\n cadena2 = cadena2.split(\",\");\n\n //Se arma el vector con los datos de la grafica principal de forma manual.\n primaryData =\n [\n [ConvertirMes(cadena[0]), '', DevolverNull(parseFloat(cadena[1])), parseFloat(cadena[2]), parseFloat(cadena[3]), parseFloat(cadena[4]), parseFloat(cadena[5])],\n [ConvertirMes(cadena[6]), '', DevolverNull(parseFloat(cadena[7])), parseFloat(cadena[8]), parseFloat(cadena[9]), parseFloat(cadena[10]), parseFloat(cadena[11])],\n [ConvertirMes(cadena[12]), '', DevolverNull(parseFloat(cadena[13])), parseFloat(cadena[14]), parseFloat(cadena[15]), parseFloat(cadena[16]), parseFloat(cadena[17])],\n [ConvertirMes(cadena[18]), '', DevolverNull(parseFloat(cadena[19])), parseFloat(cadena[20]), parseFloat(cadena[21]), parseFloat(cadena[22]), parseFloat(cadena[23])],\n [ConvertirMes(cadena[24]), '', DevolverNull(parseFloat(cadena[25])), parseFloat(cadena[26]), parseFloat(cadena[27]), parseFloat(cadena[28]), parseFloat(cadena[29])],\n [ConvertirMes(cadena[30]), '', DevolverNull(parseFloat(cadena[31])), parseFloat(cadena[32]), parseFloat(cadena[33]), parseFloat(cadena[34]), parseFloat(cadena[35])],\n [ConvertirMes(cadena[36]), '', DevolverNull(parseFloat(cadena[37])), parseFloat(cadena[38]), parseFloat(cadena[39]), parseFloat(cadena[40]), parseFloat(cadena[41])],\n [ConvertirMes(cadena[42]), '', DevolverNull(parseFloat(cadena[43])), parseFloat(cadena[44]), parseFloat(cadena[45]), parseFloat(cadena[46]), parseFloat(cadena[47])],\n [ConvertirMes(cadena[48]), '', DevolverNull(parseFloat(cadena[49])), parseFloat(cadena[50]), parseFloat(cadena[51]), parseFloat(cadena[52]), parseFloat(cadena[53])],\n [ConvertirMes(cadena[54]), '', DevolverNull(parseFloat(cadena[55])), parseFloat(cadena[56]), parseFloat(cadena[57]), parseFloat(cadena[58]), parseFloat(cadena[59])],\n [ConvertirMes(cadena[60]), '', DevolverNull(parseFloat(cadena[61])), parseFloat(cadena[62]), parseFloat(cadena[63]), parseFloat(cadena[64]), parseFloat(cadena[65])],\n [ConvertirMes(cadena[66]), '', DevolverNull(parseFloat(cadena[67])), parseFloat(cadena[68]), parseFloat(cadena[69]), parseFloat(cadena[70]), parseFloat(cadena[71])]\n ];\n\n\n //Datos necesarios para utilizar en la grafica principal. \n var menor = parseFloat(cadena[4]);\n var mayor = parseFloat(cadena[2]);\n var mayormes = cadena[72];\n var menormes = cadena[73];\n var mayoranio = parseInt(cadena[74]);\n var menoranio = parseInt(cadena[75]);\n\n\n\n /*******************************************OPCIONES DE LA GRAFICA PRINCIPAL (LINEAL)*************************************/\n\n //Se crean las opciones dependiendo si se vera la grafica por indice o por dias de inventario.\n if ($('#tipo option:selected').val() === \"1\") //Si es indice\n {\n primaryOptions = {\n title: '',\n //legend: 'none',\n tooltip: {isHtml: true}, // This MUST be set to true for your chart to show.\n vAxis: {title: 'Indice del mes', titleTextStyle: {color: ColorFuenteGrafica()}, textStyle: {color: ColorFuenteGrafica()}, gridlines: {count: 20}, viewWindow: {\n min: (menor - 0.1),\n max: (mayor + 0.1)\n }},\n hAxis: {title: '*El valor \"Menor historico\" corresponde a ' + ConvertirMes(menormes) + ' de ' + menoranio + '\\n' +\n '*El valor \"Mayor historico\" corresponde a ' + ConvertirMes(mayormes) + ' de ' + mayoranio, titleTextStyle: {color: ColorFuenteGrafica()}\n , textStyle: {color: ColorFuenteGrafica()}},\n colors: [\"#EAD008\", \"#40FF00\", \"#01DFD7\", \"#FF0000\", \"#000000\"],\n annotations: {\n style: 'line'\n },\n series: {\n 0: {pointShape: 'circle', pointSize: tamapunto()},\n 4: {pointShape: 'circle', pointSize: tamapunto()}\n\n },\n lineWidth: tamlinea,\n backgroundColor: FondoGrafica(),\n legend: {\n textStyle: {\n color: ColorFuenteGrafica()\n }}\n };\n }\n else\n {\n\n primaryOptions = {\n title: '',\n tooltip: {isHtml: true},\n vAxis: {title: 'Dias de inventario', titleTextStyle: {color: ColorFuenteGrafica()}, textStyle: {color: ColorFuenteGrafica()},\n gridlines: {count: 20}, viewWindow: {\n min: (menor - 1),\n max: (mayor + 1)\n }},\n hAxis: {title: '*El valor \"Menor historico\" corresponde a ' + ConvertirMes(menormes) + ' de ' + menoranio + '\\n' +\n '*El valor \"Mayor historico\" corresponde a ' + ConvertirMes(mayormes) + ' de ' + mayoranio, titleTextStyle: {color: ColorFuenteGrafica()},\n textStyle: {color: ColorFuenteGrafica()}},\n is3D: true,\n colors: [\"#EAD008\", \"#FF0000\", \"#01DFD7\", \"#40FF00\", \"#000000\"],\n annotations: {\n style: 'line'\n },\n series: {\n 0: {pointShape: 'circle', pointSize: tamapunto()},\n 4: {pointShape: 'circle', pointSize: tamapunto()}\n\n }, lineWidth: tamlinea,\n backgroundColor: FondoGrafica(),\n legend: {\n textStyle: {\n color: ColorFuenteGrafica()\n }}\n };\n }\n\n /*\n tooltipData =\n [\n [cadena2[0], parseFloat(cadena2[1]), parseFloat(cadena2[2]), parseFloat(cadena2[3]), parseFloat(cadena2[4]), parseFloat(cadena2[5]), parseFloat(cadena2[6]), parseFloat(cadena2[7]), parseFloat(cadena2[8]), parseFloat(cadena2[9]), parseFloat(cadena2[10]), parseFloat(cadena2[11]), parseFloat(cadena2[12])],\n [cadena2[13], parseFloat(cadena2[14]), parseFloat(cadena2[15]), parseFloat(cadena2[16]), parseFloat(cadena2[17]), parseFloat(cadena2[18]), parseFloat(cadena2[19]), parseFloat(cadena2[20]), parseFloat(cadena2[21]), parseFloat(cadena2[22]), parseFloat(cadena2[23]), parseFloat(cadena2[24]), parseFloat(cadena2[25])],\n [cadena2[26], parseFloat(cadena2[27]), parseFloat(cadena2[28]), parseFloat(cadena2[29]), parseFloat(cadena2[30]), parseFloat(cadena2[31]), parseFloat(cadena2[32]), parseFloat(cadena2[33]), parseFloat(cadena2[34]), parseFloat(cadena2[35]), parseFloat(cadena2[36]), parseFloat(cadena2[37]), parseFloat(cadena2[38])]\n \n ];*/\n\n //Se especifican las opciones de la grafica ya sea si es por indice o por dias.\n if ($('#tipo option:selected').val() === \"1\")\n {\n tooltipOptions = {\n width: 400,\n height: 300,\n title: 'Rotacion de Inventarios (Plantas)',\n is3D: true,\n // chartArea: { width: \"90%\", height: \"90%\" },\n\n legend: 'none',\n hAxis: {title: 'Plantas', titleTextStyle: {color: 'Black'}},\n vAxis: {title: 'Indice del mes', titleTextStyle: {color: 'Black'}, gridlines: {count: 15}, format: \"#.##\"}\n //legend: 'none'\n };\n }\n else\n {\n tooltipOptions = {\n width: 400,\n height: 300,\n title: 'Dias De Inventario (Plantas)',\n is3D: true,\n //chartArea: { width: \"100%\", height: \"70%\" },\n\n legend: 'none',\n hAxis: {title: 'Plantas', titleTextStyle: {color: 'Black'}},\n vAxis: {title: 'Dias de Inventario', titleTextStyle: {color: 'Black'}, gridlines: {count: 15}, format: \"#.##\"}\n //legend: 'none'\n };\n }\n\n //var data = new google.visualization.arrayToDataTable(tooltipData);\n //Se crea el datatable para los datos de la grafica secundaria.\n var data = new google.visualization.DataTable();\n data.addColumn('string', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n data.addColumn('number', '');\n\n //Se agregan los datos al datatable de forma manual por medio de los valores leidos del servlet para la grafica secundaria.\n data.addRows([\n [cadena2[0], parseFloat(cadena2[1]), parseFloat(cadena2[2]), parseFloat(cadena2[3]), parseFloat(cadena2[4]), parseFloat(cadena2[5]), parseFloat(cadena2[6]), parseFloat(cadena2[7]), parseFloat(cadena2[8]), parseFloat(cadena2[9]), parseFloat(cadena2[10]), parseFloat(cadena2[11]), parseFloat(cadena2[12])],\n [cadena2[13], parseFloat(cadena2[14]), parseFloat(cadena2[15]), parseFloat(cadena2[16]), parseFloat(cadena2[17]), parseFloat(cadena2[18]), parseFloat(cadena2[19]), parseFloat(cadena2[20]), parseFloat(cadena2[21]), parseFloat(cadena2[22]), parseFloat(cadena2[23]), parseFloat(cadena2[24]), parseFloat(cadena2[25])],\n [cadena2[26], parseFloat(cadena2[27]), parseFloat(cadena2[28]), parseFloat(cadena2[29]), parseFloat(cadena2[30]), parseFloat(cadena2[31]), parseFloat(cadena2[32]), parseFloat(cadena2[33]), parseFloat(cadena2[34]), parseFloat(cadena2[35]), parseFloat(cadena2[36]), parseFloat(cadena2[37]), parseFloat(cadena2[38])],\n [cadena2[39], parseFloat(cadena2[40]), parseFloat(cadena2[41]), parseFloat(cadena2[42]), parseFloat(cadena2[43]), parseFloat(cadena2[44]), parseFloat(cadena2[45]), parseFloat(cadena2[46]), parseFloat(cadena2[47]), parseFloat(cadena2[48]), parseFloat(cadena2[49]), parseFloat(cadena2[50]), parseFloat(cadena2[51])]\n ]);\n\n var view = new google.visualization.DataView(data);\n\n\n // For each row of primary data, draw a chart of its tooltip data.\n for (var i = 0; i < primaryData.length; i++) {\n // Set the view for each event's data\n view.setColumns([0, i + 1]);\n\n var hiddenDiv = document.getElementById('hidden_div');\n var tooltipChart = new google.visualization.ColumnChart(hiddenDiv);\n\n google.visualization.events.addListener(tooltipChart, 'ready', function () {\n\n // Get the PNG of the chart and set is as the src of an img tag.\n var tooltipImg = '<center><h3>' + primaryData[i][0].toString() + ' ' + $(\"#anio\").val() + '</h3></center><br><img src=\"' + tooltipChart.getImageURI() + '\">';\n\n // Si el tipo de inventario (algodon, poliester, etc) no tiene subgrafica se agrega esta opcion\n var tooltipImg2 = '<h2>' + '&nbsp&nbsp' + primaryData[i][0].toString() + '' + '</h2> <h3> &nbsp&nbsp ' + $(\"#anio\").val() + ': ' + primaryData[i][6].toString() + '&nbsp&nbsp&nbsp' + '</h3>';\n\n /*Se evalua si el valor del mes es \"0\", si es 0 quiere decir que no existen datos para tal mes aun y por lo tanto no se debe graficar,\n * por lo tanto las ultimas dos columnas de la matriz de la grafica se vuelven NULL para que no dibuje el punto con valor 0 y para que\n * no agregue tooltip a un valor inexistente.\n */\n if (primaryData[i][6].toString() === \"0\") {\n\n primaryData[i][6] = null;\n primaryData[i][7] = null;\n\n }\n else {\n\n // Add the new tooltip image to your data rows.\n /* Se agrega de acuerdo al tipo de inventario, si el tipo de inventario esta divido por plantas se agrega el tooltip con subgrafica,\n de lo contrario se agrega el tooltip solo con los datos.*/\n\n if ($('#tipo2').val() === \"1\" || $('#tipo2').val() === \"2\" || $('#tipo2').val() === \"4\")\n {\n\n primaryData[i][7] = tooltipImg2;\n }\n\n else\n {\n\n primaryData[i][7] = tooltipImg;\n }\n\n }\n });\n\n tooltipChart.draw(view, tooltipOptions);\n }\n drawPrimaryChart();\n}", "function inicializarConversacionDiana(){\nprint(\"Inicializa la conversacion\");\nconversacionDiana = new ArbolConversacion(texturaCristina,texturaDiana,texturaCristinaSombreada,texturaDianaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Tal vez usted me entienda, Diana, hay seres que nos vienen acompañando desde que se iniciaron los ataques y ahora sé qué es lo que necesitan, me lo han dicho.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Chica, voy a ser muy sincera contigo, tú no estás bien. Ese brazo necesita curaciones y la falta de droga te puede estar afectando la mente, es preciso que entres en tratamiento inmediatamente, y eso no lo conseguirás aquí adentro.\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"Nunca me he sentido mejor, lo del brazo no es tan grave y jamás he estado tan lúcida. De verdad Diana, hay seres que nos necesitan, usted podría ayudarlos mucho, no con curaciones, sino con otro tipo de cuidados.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Bueno, si te sientes tan bien ¿Por qué no subes a auxiliar la gente que está atrapada arriba? Seguro que serás de gran ayuda.\",2);\ndialogos.Push(l);\n \nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionDiana.setRaiz(nodoRaiz);\n\n/**\n* Nodo Opcion 1\n* \n**/\ndialogos = new Array();\nl = new LineaDialogo(\"Por favor Diana, es verdad lo que le digo, sé que no es fácil entenderlo,\\n pero si me acompaña lo entenderá.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, he decidido bajar con el anciano y con Fabio. Abajo podemos conseguir ayuda profesional y tú deberías acompañarnos.\",2);\ndialogos.Push(l);\n\nvar nodo1: NodoDialogo = new NodoDialogo(dialogos, NEGACION );\n\nnodoRaiz.setHijo1(nodo1);\n\n\n\n/**\n* Nodo Opcion 2\n* \n*/\n\ndialogos = new Array();\nl = new LineaDialogo(\"Son seres que después compensarán nuestra ayuda, de verdad Diana,\\n son más importantes que los de arriba, son los otros.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, he decidido subir con el doctor y con el muchacho a auxiliar a los oficinistas de arriba, Tú serías de gran ayuda, acompáñanos.\",2);\ndialogos.Push(l);\n\nvar nodo2: NodoDialogo = new NodoDialogo(dialogos);\n\nnodoRaiz.setHijo2(nodo2);\n}", "function graficar(conjunto,relacion) \n{\n\t//arreglo de los nodos y las arista o relacion de pares\n\tvar nodes_object = [];\n\tvar edges_object = [];\n\tfor(var i=0;i<conjunto.length;i++)\n\t{\n\t\tnodes_object.push({id: conjunto[i], label:conjunto[i]})\n\t}\n\tfor(var j=0;j<relacion.length;j++)\n\t{\n\t\tvar aux = relacion[j].entrada;\n\t\tif(relacion[j].salida!=\"n\")\n\t\t\taux = relacion[j].entrada + \", \" + relacion[j].salida;\n\t\tedges_object.push({from:relacion[j].de, to: relacion[j].a, label: aux, arrows:'to'})\n\t}\n\n\t//grafica \n\tvar nodes = new vis.DataSet(nodes_object);\n var edges = new vis.DataSet(edges_object);\n crearPopup(1,ventanaGrafica);\n\tvar container = ventanaGrafica.document.getElementById('visualization');\n \tvar data = {nodes: nodes,edges: edges};\n var options = {};\n var network = new vis.Network(container, data, options);\n}", "function dataSets(dataApi,params){\n\n\n //http://localhost:8080/spam-abp/public/api/estadisticas/donativos/0000-00-00/2019-12-31\n // .data('id', g.id)\n // .data('nombre', g.nombre)\n // .data('tipo', g.tipo_grafico)\n // .data('fechaInit',g.data_init)\n // .data('fechaFin', g.data_fin)\n // .data('tipo_data', g.tipo_data)\n // .data('intervalo', g.intervalo)\n // .data('tipos_donacion', g.tipos_donacion)\n // .data('centro', g.centro)\n // .data('animales', g.animales)\n // .data('mostrar_valor',g.mostrar_valor)\n // .data('ordenar',g.ordenar)\n // .data('tema',g.tema)\n// $('#nav6').data(): Object\n// animales: \"all\"\n// centro: \"5\"\n// fechaFin: null\n// fechaInit: null\n// id: 6\n// intervalo: \"30dd\"\n// mostrar_valor: \"cash\"\n// nombre: \"aiosfaskldfa\"\n// objetivos: null\n// ordenar: \"tipus\"\n// tema: \"dades\"\n// tipo: \"bar\"\n// tipo_data: \"dinamic\"\n// tipos_donacion: \"Menjar,Veterinaria,Oficines\"\n // var ordenar = \"tipus\"\n // var tipos = new Array();\n // tipos = params.tipos_donacion.split(',');\n var datasets = [];\n var dataset;\n // var labels = tipos;\n // var donatius = [];\n\n // $.each(tipos, function(ii,t){\n // var donatiu = 0;\n // $.each(dataApi,function(i,d){\n // if (t == d.subtipo.tipo.nombre){\n // donatiu = donatiu + d.coste;\n // }\n // });\n // donatius.push(donatiu);\n // });\n dataset = {\n label:'Donacions',\n data:dataApi['data'],\n //backgroundColor:'green',\n backgroundColor:[\n 'rgba(255, 99, 132, 0.8)',\n 'rgba(54, 162, 235, 0.8)',\n 'rgba(255, 206, 86, 0.8)',\n 'rgba(123, 31, 255, 0.8)',\n 'rgba(222, 11, 145, 0.8)',\n 'rgba(75, 192, 192, 0.8)'\n ],\n borderWidth:1,\n borderColor:'#777',\n hoverBorderWidth:2,\n hoverBorderColor:'#777'\n };\n datasets.push(dataset);\n\n if(params.tema == \"objectiu\"){\n var objectius = new Array();\n objectius = params.objetivos.split(',');\n // $.each(tipos, function(ii,t){\n // var donatiu = objectius[ii];\n // donatius.push(donatiu);\n // });\n dataset = {\n label:'Objectius',\n data:objectius,\n //backgroundColor:'green',\n backgroundColor:[\n 'rgba(255, 99, 132, 0.5)',\n 'rgba(54, 162, 235, 0.5)',\n 'rgba(255, 206, 86, 0.5)',\n 'rgba(123, 31, 255, 0.5)',\n 'rgba(222, 11, 145, 0.5)',\n 'rgba(75, 192, 192, 0.5)'\n ],\n borderWidth:1,\n borderColor:'#777',\n hoverBorderWidth:2,\n hoverBorderColor:'#777'\n };\n datasets.push(dataset);\n }\n\n var data = {\n labels:dataApi['labels'],\n datasets:datasets\n };\n return data;\n}", "function showCabello(){\n\t\tconsole.log(showCabello2);\n if(showCabello2 == true){\n \n $(\"#datosCabello\").hide();\n $(\"#btnEditarC\").show();\n $(\"#detallesV\").show();\n detallesCabello();\n\n\n }else{\n \n $(\"#detallesV\").toggle();\n $(\"#btnEditarC\").hide();\n $(\"#datosCabello\").show();\n \n $('#tieneCabello').val(1).trigger('change');\n $('#tieneBarba').val(1).trigger('change');\n $('#tieneBigote').val(1).trigger('change');\n $('#tienePatilla').val(1).trigger('change');\n\n\n }\n\t\t}", "function ControladorHospitales(){\n var DOMsHospitales = {};\n var DOMsNombresHospitales = {};\n var DOMsHexCharts = {};\n var DOMsLineasContadoras = {};\n var DOMsLeyendas = {};\n var grupoHospitales;\n var currentCategoria;\n var isSelectedGroup=false;\n\n this.controladorDeHexCharts = new ControladorDeHexCharts();\n this.controladorDeLineasContadoras = new ControladorDeLineasContadoras();\n this.controladorDeNombreDeHospitales = new ControladorNombresDeHospitales();\n\n this.initDOMsHospitales = function(svg){\n \n grupoHospitales = svg.append(\"g\").attr(\"class\",\"wrapper-all-hospitals\");\n var hospitalDomElement;\n var nombreHospitalDomElement;\n var hexChartDOMElement;\n var lineaContadoraDOMElement;\n var leyendasDOMElement;\n hospitales.forEach(function(hospital){\n \n hospitalDomElement = grupoHospitales.append(\"g\")\n .attr(\"class\",\"wrapper-hospital\")\n .attr(\"id\",hospital.id);\n\n\n //cada hospital contiene un título\n nombreHospitalDomElement = hospitalDomElement.append(\"g\").attr(\"class\",\"nombre\");\n //cada hospital contiene un hexchart\n hexChartDOMElement = hospitalDomElement.append(\"g\").attr(\"class\",\"hexChart\").attr(\"id\",hospital.id);\n //cada hospital contiene una linea contadora\n lineaContadoraDOMElement = hospitalDomElement.append(\"g\").attr(\"class\",\"lineaContadora\");\n //cada hospital tiene leyendas\n leyendasDOMElement = hospitalDomElement.append(\"g\").attr(\"class\",\"leyendas\");\n\n DOMsHospitales[hospital.id]=hospitalDomElement;\n DOMsNombresHospitales[hospital.id]=nombreHospitalDomElement;\n DOMsHexCharts[hospital.id]=hexChartDOMElement;\n DOMsLineasContadoras[hospital.id]=lineaContadoraDOMElement; \n DOMsLeyendas[hospital.id] = leyendasDOMElement; \n });\n \n //entrega los doms a los controladores\n this.controladorDeHexCharts.setHexDoms(DOMsHexCharts);\n this.controladorDeLineasContadoras.setLineasContadorasDOMs(DOMsLineasContadoras);\n this.controladorDeNombreDeHospitales.setNombresDOMs(DOMsNombresHospitales);\n\n //inicializa los elementos dom internamente en los controladores\n \n this.controladorDeHexCharts.initHexCharts();\n\n }\n\n this.moveMainWrapper = function(px,py){\n $(\".wrapper-all-hospitals\").attr(\"transform\",\"translate(\"+px+\",\"+py+\")\");\n }\n\n this.insertHospitalesToWrapper = function(){\n for(var key in DOMsHospitales){\n $(\".wrapper-hospital#\"+ key).appendTo(grupoHospitales);\n }\n }\n\n this.updateHexCharts = function(svg,anio,mes)\n {\n this.controladorDeHexCharts.updateHexsHospitales(svg,anio,mes);\n }\n\n this.updateLineasContadoras = function(svg,anio,mes)\n {\n this.controladorDeLineasContadoras.updateLineasContadoras(svg,anio,mes);\n }\n\n this.setPosicionDeDOMSHospitales = function(posiciones){\n for(var id in posiciones){\n domHospital = DOMsHospitales[id];\n domHospital.transition().duration(800).attr(\"transform\", function(d) { \n return \"translate(\" + posiciones[id].x + \",\" + posiciones[id].y + \")\"; });\n \n }\n }\n\n this.resetListeners = function(){\n for(var id in DOMsHospitales){\n DOMsHospitales[id]\n .on(\"mouseenter\",null)\n .on(\"mouseover\",null)\n .on(\"mouseout\",null)\n .on(\"click\",null);\n }\n }\n\n this.resetHospitalUI = function(){\n hospitales.forEach(function(d){\n DOMsHexCharts[d.id]\n .attr(\"selected\",null)\n .attr(\"opacity\",1);\n }); \n }\n\n this.addTooltipListeners = function(){\n var div = d3.select(\"body\").append(\"div\") \n .attr(\"class\", \"tooltip\") \n .style(\"opacity\", 0);\n\n for(var id in DOMsHospitales){\n \n DOMsHospitales[id]\n .on(\"mouseenter\", function(d) { \n var hospitaldata = mapHospitales[this.id][0]; \n\n var rect = this.getBoundingClientRect();\n div.transition() \n .duration(200) \n .style(\"opacity\", .9); \n div .html( hospitaldata.Nombre + \"<br/>aaa\" ) \n .style(\"left\", rect.left + \"px\") \n .style(\"top\", rect.top + \"px\"); \n })\n .on(\"mouseleave\", function(d) { \n div.transition() \n .duration(500) \n .style(\"opacity\", 0)}); \n \n }\n }\n\n function showTooltip(d){\n\n var hospitaldata = mapHospitales[this.id][0];\n this.append(\"text\").text(hospitaldata.Nombre);\n\n }\n\n this.addSelectGroupListeners = function(categoria){\n currentCategoria = categoria;\n isSelectedGroup = false;\n var porTipo = currentCategoria ==\"Tipo\"? \"subtipo\":\"zona\"\n for(var id in DOMsHospitales){\n \n DOMsHospitales[id]\n .on(\"click\",function(d){\n isSelectedGroup=true;\n //mark selected group\n var hospitaldata = mapHospitales[this.id][0];\n\n //repopulate the chart with data of this group\n controlVisualizacion.escuchoCambioDeDatosEnLineChart(categoria,hospitaldata[porTipo]);\n\n hospitales.filter(function(d){return d[porTipo]==hospitaldata[porTipo]}).forEach(function(d){\n \n //mark selected hexcharts, and unselected hexcharts\n DOMsHexCharts[d.id].attr(\"selected\",\"true\");\n $(\".linechart > path[hospitalid='\"+d.id+\"'] \").attr(\"mouse\",null).attr(\"selected\",\"true\");\n });\n hospitales.filter(function(d){return d[porTipo]!=hospitaldata[porTipo]}).forEach(function(d){\n DOMsHexCharts[d.id].attr(\"selected\",\"false\");\n }); \n \n })\n \n }\n}\n\n this.addChangeOpacityListeners = function(categoria){\n currentCategoria = categoria;\n for(var id in DOMsHospitales){\n \n\n DOMsHospitales[id]\n .on(\"mouseenter\",mouseEnterToHospital)\n .on(\"mouseover\",mouseEnterToHospital)\n .on(\"mouseout\",mouseOutOfHospital);\n \n }\n }\n\n function mouseEnterToHospital(d){\n\n var hospitaldata = mapHospitales[this.id][0];\n var porTipo = currentCategoria ==\"Tipo\"? \"subtipo\":\"zona\"\n //acciones cuando un grupo esta seleccionado\n if(isSelectedGroup){\n hospitales.filter(function(d){return d[porTipo]==hospitaldata[porTipo]}).forEach(function(d){\n DOMsHexCharts[d.id].attr(\"mouse\",\"enter\");\n });\n d3.select(\".c3-lines-\"+hospitaldata.id+\"-nacimientos >path\").style(\"stroke-width\",\"2px\");\n }\n\n //acciones cuando no hay grupo seleccionado\n else\n {\n //$(\"#\"+hospitaldata.subtipo.replace(/[^\\w\\*]/g,'')+\".lineChart > [hospitalid='\"+hospitaldata.id+\"'] > path\").\n //difuna elementos no selecicionados\n hospitales.filter(function(d){return d[porTipo]!=hospitaldata[porTipo]}).forEach(function(d){\n DOMsHexCharts[d.id].attr(\"opacity\",0.5);\n $(\".c3-lines-\"+d.id+\"-nacimientos\").attr(\"opacity\",\"0\");\n });\n //remarca elementos en el grupo\n hospitales.filter(function(d){return d[porTipo]==hospitaldata[porTipo]}).forEach(function(d){\n DOMsHexCharts[d.id].attr(\"opacity\",0.9);\n });\n d3.select(\".c3-lines-\"+hospitaldata.id+\"-nacimientos >path\").style(\"stroke-width\",\"2px\");\n\n DOMsHexCharts[this.id].attr(\"opacity\",1);\n }\n \n }\n\n function mouseOutOfHospital(d){\n var hospitaldata = mapHospitales[this.id][0];\n \n hospitales.forEach(function(d){\n DOMsHexCharts[d.id].attr(\"opacity\",1);\n DOMsHexCharts[d.id].attr(\"mouse\",\"out\");\n $(\".c3-lines-\"+d.id+\"-nacimientos\").attr(\"opacity\",\"1\");\n d3.select(\".c3-lines-\"+d.id+\"-nacimientos >path\").style(\"stroke-width\",\"1px\");\n });\n \n \n }\n\n \n}", "function ControladorHospitales(){\n var DOMsHospitales = {};\n var DOMsNombresHospitales = {};\n var DOMsHexCharts = {};\n var DOMsLineasContadoras = {};\n var DOMsLeyendas = {};\n\n this.controladorDeHexCharts = new ControladorDeHexCharts();\n this.controladorDeLineasContadoras = new ControladorDeLineasContadoras();\n this.controladorDeNombreDeHospitales = new ControladorNombresDeHospitales();\n\n this.initDOMsHospitales = function(svg){\n \n var grupoHospitales = svg.append(\"g\").attr(\"class\",\"wrapper-all-hospitals\");\n var hospitalDomElement;\n var nombreHospitalDomElement;\n var hexChartDOMElement;\n var lineaContadoraDOMElement;\n var leyendasDOMElement;\n hospitales.forEach(function(hospital){\n hospitalDomElement = grupoHospitales.append(\"g\")\n .attr(\"class\",\"wrapper-hospital\")\n .attr(\"id\",hospital.id);\n //cada hospital contiene un título\n nombreHospitalDomElement = hospitalDomElement.append(\"g\").attr(\"class\",\"nombre\");\n //cada hospital contiene un hexchart\n hexChartDOMElement = hospitalDomElement.append(\"g\").attr(\"class\",\"hexChart\");\n //cada hospital contiene una linea contadora\n lineaContadoraDOMElement = hospitalDomElement.append(\"g\").attr(\"class\",\"lineaContadora\");\n //cada hospital tiene leyendas\n leyendasDOMElement = hospitalDomElement.append(\"g\").attr(\"class\",\"leyendas\");\n\n DOMsHospitales[hospital.id]=hospitalDomElement;\n DOMsNombresHospitales[hospital.id]=nombreHospitalDomElement;\n DOMsHexCharts[hospital.id]=hexChartDOMElement;\n DOMsLineasContadoras[hospital.id]=lineaContadoraDOMElement; \n DOMsLeyendas[hospital.id] = leyendasDOMElement; \n });\n \n //entrega los doms a los controladores\n this.controladorDeHexCharts.setHexDoms(DOMsHexCharts);\n this.controladorDeLineasContadoras.setLineasContadorasDOMs(DOMsLineasContadoras);\n this.controladorDeNombreDeHospitales.setNombresDOMs(DOMsNombresHospitales);\n\n }\n\n\n this.updateHexCharts = function(svg,anio,mes)\n {\n this.controladorDeHexCharts.updateHexsHospitales(svg,anio,mes);\n }\n\n this.updateLineasContadoras = function(svg,anio,mes)\n {\n this.controladorDeLineasContadoras.updateLineasContadoras(svg,anio,mes);\n }\n\n\n\n this.setPosicionDeDOMSHospitales = function(posiciones){\n hospitalesids.forEach(function(id){\n domHospital = DOMsHospitales[id];\n domHospital.transition().duration(800).attr(\"transform\", function(d) { \n return \"translate(\" + posiciones[id].x + \",\" + posiciones[id].y + \")\"; })\n });\n \n }\n\n}", "createChartData() {\n /**\n * entities : all entities data and options\n * entityOptions : global entities options\n */\n if (!this.entity_items.isValid()) return null\n // const _data = this.entity_items.getData()\n\n const _data = this.entity_items.getChartLabelAndData()\n\n if (_data.length === 0) {\n console.error(\"Create Chart Data, no Data present !\")\n return null\n }\n\n let _defaultDatasetConfig = {\n mode: \"current\",\n unit: \"\"\n }\n\n let _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"simple\"\n\n /**\n * merge entity options\n */\n if (this.entity_options) {\n _defaultDatasetConfig = {\n ..._defaultDatasetConfig,\n ...this.entity_options\n }\n }\n\n /**\n * merge dataset_config\n * all entity labels\n * add dataset entities\n */\n _graphData.data.labels = _data.labels //this.entity_items.getNames()\n _graphData.data.datasets[0] = _defaultDatasetConfig\n _graphData.data.datasets[0].label = this.card_config.title || \"\"\n /**\n * add the unit\n */\n if (this.entity_options && this.entity_options.unit) {\n _graphData.data.datasets[0].unit = this.entity_options.unit || \"\"\n } else {\n _graphData.data.datasets[0].units = this.entity_items.getEntitieslist().map((item) => item.unit)\n }\n\n /**\n * case horizontal bar\n */\n\n if (this.card_config.chart.isChartType(\"horizontalbar\")) {\n _graphData.data.datasets[0].indexAxis = \"y\"\n }\n\n /**\n * custom colors from the entities\n */\n let entityColors = _data.colors //this.entity_items.getColors()\n\n if (this.entity_options && this.entity_options.gradient != undefined) {\n _graphData.config.gradient = true\n }\n\n if (entityColors.length === _graphData.data.labels.length) {\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].showLine = false\n } else {\n if (this.card_config.chart.isChartType(\"radar\")) {\n _graphData.data.datasets[0].backgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderWidth = 1\n _graphData.data.datasets[0].pointBorderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].pointBackgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].tooltip = true\n _graphData.config.gradient = false\n } else {\n /**\n * get backgroundcolor from DEFAULT_COLORS\n */\n entityColors = DEFAULT_COLORS.slice(1, _data.data.length + 1)\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].borderWidth = 0\n _graphData.data.datasets[0].showLine = false\n }\n }\n _graphData.data.datasets[0].data = _data.data\n _graphData.config.segmentbar = false\n\n /**\n * add the data series and return the new graph data\n */\n if (this.card_config.chart.isChartType(\"bar\") && this.card_config.chartOptions && this.card_config.chartOptions.segmented) {\n const newData = this.createSimpleBarSegmentedData(_graphData.data.datasets[0])\n if (newData) {\n _graphData.data.datasets[1] = {}\n _graphData.data.datasets[1].data = newData.data\n _graphData.data.datasets[1].tooltip = false\n _graphData.data.datasets[1].backgroundColor = newData.backgroundColors\n _graphData.data.datasets[1].borderWidth = 0\n _graphData.data.datasets[1].showLine = false\n _graphData.config.segmentbar = newData.data.length !== 0\n }\n }\n return _graphData\n }", "function estructuraSeccion(seccion){\n\t\tvar camposModelo = {\n\t\t\t\t\"headerSeccion1\" \t\t :{ \"objeto\" : { \"tituloObjetoHS1\" :\"text\", \"seleccionObjetoHS1\" :\"text\" }},\n\t\t\t\t\"headerSeccion2\" \t\t :{ \"telefonoHS2\" : \"text\", \"emailHS2\" : \"text\"},\n\t\t\t\t\"headerSeccion3\" \t\t :{\"tituloHS3\":\"text\", \"iconoHS3\":\"img\", \"variosHS3\" : \"lorem\", \"logoHS3\":\"img\", \"fondoHeaderHS3\":\"img\"},\n\t\t\t\t\"headerSeccion4\" :{ \"tituloHS4\":\"text\", \"descripcionHS4\" :\"lorem\", \"seleccion1HS4\" : \"text\", \"boton1HS4\" : \"text\"},\n\t\t\t\t\"headerSeccionArray5\":{\"tituloHSA5\":\"text\", \"faviconHSA5\":\"img\", \"logoHSA5\":\"img\", \"fondoHeaderHSA5\":\"img\", \"objeto\" : {\"enlaceHSA5\":\"text\" }},\n\t\t\t\t\"bodySeccionArray1\":{ \"seleccionBSA1\":\"text\", \"tituloBSA1\":\"text\", \"botonBSA1\":\"text\", \"objeto\" :{\"seleccionObjetoBSA1\" : \"text\", \"iconoObjetoBSA1\" : \"text\", \"tituloObjetoBSA1\" :\"text\", \"descripcionObjetoBSA1\" :\"lorem\" , \"botonObjetoBSA1\":\"text\" }},\n\t\t\t\t\"bodySeccionArray2\":{ \"seleccionBSA2\":\"text\", \"tituloBSA2\":\"text\", \"botonBSA2\":\"text\", \"objeto\" :{\"posicionObjetoBSA2\" :\"text\", \"imagenObjetoBSA2\" : \"text\", \"seleccionObjetoBSA2\" : \"text\", \"tituloObjetoBSA2\" :\"text\" }},\n\t\t\t\t\"bodySeccionArray3\":{ \"imagenBSA3\" :\"img\", \"tituloBSA3\" : \"text\", \"descripcionBSA3\":\"lorem\", \"objeto\" : {\"iconoObjetoBSA3\" :\"text\", \"tituloObjetoBSA3\" :\"text\", \"descripcionObjetoBSA3\" :\"text\" , \"seleccionObjetoBSA3\" : \"text\", \"botonObjetoBSA3\" :\"text\" }},\n\t\t\t\t\"bodySeccionArray4\":{ \"tituloBSA4\" :\"text\", \"seleccionBSA4\":\"text\", \"botonBSA4\":\"text\", \"objeto\" : {\"posicionObjetoBSA4\" :\"text\", \"imagenObjetoBSA4\" : \"img\", \"seleccionObjetoBSA4\" : \"text\", \"tituloObjetoBSA4\" :\"text\", \"descripcionObjetoBSA4\" :\"text\" }},\n\t\t\t\t\"bodySeccionArray5\":{ \"imagenBSA5\" : \"img\", \"tituloBSA5\" :\"text\", \"seleccionBSA5\":\"text\", \"botonBSA5\":\"text\", \"objeto\" : {\"posicionObjetoBSA5\" :\"text\", \"imagenObjetoBSA5\" : \"img\", \"tituloObjetoBSA5\" : \"text\", \"subTituloObjetoBSA5\" :\"text\", \"descripcionObjetoBSA5\" :\"lorem\" }},\n\t\t\t\t\"footerSeccionUbicacion\" :{ \"tituloFSU\" : \"text\", \"domicilioFSU\" : \"text\", \"telefonoFSU\" : \"text\", \"correoFSU\" : \"text\", \"ubicacionFSU\" : \"lorem\"},\n\t\t\t\t\"footerSeccionRedes\" :{ \"tituloRedes\" : \"text\", \"textFFS1\" : \"text\", \"textIFS1\" : \"text\", \"textTFS1\" : \"text\", \"textYFS1\" : \"text\", \"textLFS1\" : \"text\", \"textGFS1\" : \"text\"},\n\t\t\t\t\"bodyQRE\" : {\"objeto\":{\"imagenObjetoQRE\": \"img\", \"tituloObjetoQRE\": \"text\", \"descripcionObjetoQRE\": \"lorem\" }},\n\t\t\t\t\"bodyQRD\" : {\"objeto\":{\"imagenObjetoQRE\": \"img\"}}\n\t\t\t\t}\n\t\t\n\n\t\tswitch (seccion) { \n\t\tcase \"headerSeccion1\": return camposModelo.headerSeccion1; break;\n\t\tcase \"headerSeccion2\": return camposModelo.headerSeccion2; break;\n\t\tcase \"headerSeccion3\": return camposModelo.headerSeccion3; break;\n\t\tcase \"headerSeccion4\": return camposModelo.headerSeccion4; break;\n\t\tcase \"headerSeccion5\": return camposModelo.headerSeccion5; break;\n\t\tcase \"headerSeccionArray1\": return camposModelo.headerSeccionArray1; break;\n\t\tcase \"headerSeccionArray2\": return camposModelo.headerSeccionArray2; break;\n\t\tcase \"headerSeccionArray3\": return camposModelo.headerSeccionArray3; break;\n\t\tcase \"headerSeccionArray4\": return camposModelo.headerSeccionArray4; break;\n\t\tcase \"headerSeccionArray5\": return camposModelo.headerSeccionArray5; break;\n\t\tcase \"bodySeccion1\": return camposModelo.bodySeccion1; break;\n\t\tcase \"bodySeccion2\": return camposModelo.bodySeccion2; break;\n\t\tcase \"bodySeccion3\": return camposModelo.bodySeccion3; break;\n\t\tcase \"bodySeccion4\": return camposModelo.bodySeccion4; break;\n\t\tcase \"bodySeccion5\": return camposModelo.bodySeccion5; break;\n\t\tcase \"bodySeccionArray1\": return camposModelo.bodySeccionArray1; break;\n\t\tcase \"bodySeccionArray2\": return camposModelo.bodySeccionArray2; break;\n\t\tcase \"bodySeccionArray3\": return camposModelo.bodySeccionArray3; break;\n\t\tcase \"bodySeccionArray4\": return camposModelo.bodySeccionArray4; break;\n\t\tcase \"bodySeccionArray5\": return camposModelo.bodySeccionArray5; break;\n\t\tcase \"footerSeccion1\": return camposModelo.footerSeccion1; break; \n\t\tcase \"footerSeccion2\": return camposModelo.footerSeccion2; break; \n\t\tcase \"footerSeccion3\": return camposModelo.footerSeccion3; break;\n\t\tcase \"footerSeccion4\": return camposModelo.footerSeccion4; break;\n\t\tcase \"footerSeccion5\": return camposModelo.footerSeccion5; break;\n\t\tcase \"footerSeccionArray1\": return camposModelo.footerSeccionArray1; break;\n\t\tcase \"footerSeccionArray2\": return camposModelo.footerSeccionArray2; break;\n\t\tcase \"footerSeccionArray3\": return camposModelo.footerSeccionArray3; break;\n\t\tcase \"footerSeccionArray4\": return camposModelo.footerSeccionArray4; break;\n\t\tcase \"footerSeccionArray5\": return camposModelo.footerSeccionArray5; break;\n\t\tcase \"footerSeccionUbicacion\": return camposModelo.footerSeccionUbicacion; break;\n\t\tcase \"footerSeccionRedes\": return camposModelo.footerSeccionRedes; break;\n\t\tcase \"bodyQRE\": return camposModelo.bodyQRE; break;\n\t\tcase \"bodyQRD\": return camposModelo.bodyQRD; break;\n \n\t\t}\n\t}", "function _ConverteFeiticos() {\n _ConverteEscolasProibidas();\n _ConverteFeiticosConhecidos();\n _ConverteFeiticosSlots();\n}", "function dibujarFresado109(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t} \n\t\n\t\n\t//Puntos trayectoria \n \n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+pliegueIzq)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado17 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\tvar fresado10 = new RVector(pos.x+alaIzquierda,pos.y+pliegueInferior+alaInferior-pliegueIzq) \n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado1 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){ \n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t \n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior){\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\treturn op_fresado;\n}", "function cargarCapas() {\r\n var stylePuntosParadas = new OpenLayers.StyleMap( {\r\n fillOpacity : 0.7,\r\n pointRadius : 9,\r\n idBD : \"${idBD}\",\r\n idOrd : \"${idOrd}\",\r\n label : \"${idOrd}\",\r\n lat : \"${lat}\",\r\n lon : \"${lon}\",\r\n dir : \" ${dir}\",\r\n ref : \"${ref}\",\r\n img : \"${img}\",\r\n fontColor : \"white\",\r\n fillColor : \"#1C5E06\", //verde\r\n strokeColor : \"#FFFFFF\",\r\n strokeOpacity : 0.7,\r\n fontSize : \"12px\",\r\n fontFamily : \"Courier New, monospace\",\r\n fontWeight : \"bold\"\r\n });\r\n\r\n var stylePuntosEstudiante = new OpenLayers.StyleMap( {\r\n fillOpacity : 0.7,\r\n pointRadius : 6,\r\n ci : \"${ci}\",\r\n lat : \"${lat}\",\r\n lon : \"${lon}\",\r\n dir : \"${dir}\",\r\n fontColor : \"white\",\r\n fillColor : \"#DF3A01\", //naranja\r\n strokeColor : \"#FFFFFF\",\r\n strokeOpacity : 0.7,\r\n fontSize : \"12px\",\r\n fontFamily : \"Courier New, monospace\",\r\n fontWeight : \"bold\"\r\n });\r\n\r\n var stylePuntosRutas = new OpenLayers.StyleMap( {\r\n fillOpacity : 0.7,\r\n pointRadius : 9,\r\n label : \"${id}\",\r\n fontColor : \"white\",\r\n fillColor : \"#003DF5\", //black\r\n strokeColor : \"#FFFFFF\",\r\n strokeOpacity : 0.7,\r\n fontSize : \"12px\",\r\n fontFamily : \"Courier New, monospace\",\r\n fontWeight : \"bold\"\r\n });\r\n\r\n lienzoParadas = new OpenLayers.Layer.Vector('Points', {\r\n styleMap: stylePuntosParadas\r\n });\r\n\r\n map.addLayer(lienzoParadas);\r\n\r\n lienzoRutas = new OpenLayers.Layer.Vector('Puntos Rutas', {\r\n styleMap: stylePuntosRutas\r\n });\r\n\r\n map.addLayer(lienzoRutas);\r\n \r\n lienzoEstudiantes = new OpenLayers.Layer.Vector('Puntos Estudiantes', {\r\n styleMap: stylePuntosEstudiante\r\n });\r\n\r\n map.addLayer(lienzoEstudiantes);\r\n\r\n //Comportamiento de los Elementos de la Capa\r\n selectFeatures = new OpenLayers.Control.SelectFeature(\r\n [ lienzoParadas ],\r\n {\r\n clickout : true,\r\n toggle : false,\r\n multiple : false,\r\n hover : false,\r\n onSelect : function(feature){\r\n selectParada( feature );\r\n },\r\n onUnselect : function(feature){\r\n unselectParada( feature );\r\n }\r\n }\r\n );\r\n\r\n map.addControl( selectFeatures );\r\n selectFeatures.activate();\r\n \r\n selectFeaturesEstudiante = new OpenLayers.Control.SelectFeature(\r\n [ lienzoEstudiantes ],\r\n {\r\n clickout : true,\r\n toggle : false,\r\n multiple : false,\r\n hover : false,\r\n onSelect : function(feature){\r\n infoEstudiantePopUp(feature);\r\n },\r\n onUnselect : function(feature){\r\n map.removePopup( feature.popup );\r\n feature.popup.destroy();\r\n feature.attributes.poppedup = false;\r\n feature.popup = null;\r\n }\r\n }\r\n );\r\n\r\n map.addControl( selectFeaturesEstudiante );\r\n \r\n /**\r\n * Inicializa el mapa para que permita graficar los recorridos de los buses\r\n */\r\n capaRecorridos();\r\n permitirArrastrarPuntosRutas();\r\n}", "function AnDiagram(parameters) {\n var _this = this;\n\n _classCallCheck(this, AnDiagram);\n\n /* Merge custom parameters with default parameters\r\n ------------------------------------------------------------------ */\n this.parameters = $.extend({\n $element: null,\n dataUrl: null\n }, parameters);\n this.highchart = null;\n this.anLoader = new _components_an_loader__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n parent: this.parameters.$element.parent(),\n visibleAtStart: true\n });\n /* Initialization\r\n ------------------------------------------------------------------ */\n\n this.init();\n /* Set Data\r\n ------------------------------------------------------------------ */\n\n $.get({\n url: this.parameters.dataUrl,\n success: function success(result) {\n _this.anLoader.hide();\n\n _this.highchart.addSeries({\n name: 'Effectifs',\n data: []\n });\n\n var totalEffectif = 0;\n\n for (var i = 0; i < result.data.length; ++i) {\n totalEffectif += parseInt(result.data[i]['effectif']);\n }\n\n var _loop = function _loop(_i) {\n var item = result.data[_i];\n\n _this.highchart.series[0].addPoint({\n name: item['libelle'],\n color: item['couleur'],\n y: parseInt(item['effectif']) / totalEffectif,\n effectif: item['effectif'],\n events: {\n select: function select(event) {\n document.location.href = item['legacyUrl'];\n }\n }\n });\n };\n\n for (var _i = 0; _i < result.data.length; ++_i) {\n _loop(_i);\n }\n }\n });\n }", "constructor(){\n this.ju1 = new Jugador(1, 'X');\n this.ju2 = new Jugador(2, 'O');\n this.actual = this.ju1;\n this.tab = new Juego();\n this.ganador = 0;\n this.liGanad = [[0,1,2],\n [3,4,5],\n [6,7,8],\n [0,3,6],\n [1,4,7],\n [2,5,8],\n [0,4,8],\n [2,4,6]];\n }", "function loadCor(id) {\n var dilon=JSON.stringify(carRec[id]);\n var noop = JSON.parse(dilon);\n console.log(noop);\n $(\"#misdatos\").empty();\n $(\"#misdatos\").append(\n \" <h4>\"+\"Destinatario: \"+noop.destino+\"</h4>\",\n \" <h4>\"+\"Mensaje: \"+noop.mensaje+\"</h4>\",\n \" <h4>\"+\"Fecha: \"+noop.fecha+\"</h4>\" \n );\n }", "function dibujarFresado113(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado17 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function principal(){\n\n borraCanvas();\n\n console.log(ratonX + ' - ' + ratonY);\n\n for(i=0; i<numParticulas;i++){\n particulas[i].actualiza();\n }\n\n}", "function Coche(modelo) {\r\n if (modelo === void 0) { modelo = null; }\r\n //Valor atributos por defecto\r\n this.color = \"Blanco\";\r\n this.velocidad = 0;\r\n if (modelo == null) {\r\n this.modelo = \"BMW Generico\";\r\n }\r\n else {\r\n this.modelo = modelo;\r\n }\r\n }", "function CentroDeControl(){\n this.groupDOM;\n this.botones;\n this.width;\n this.height;\n this.DOMid;\n this.duracion;\n\n \n this.initCentroDeControl = function(){\n }\n\n //aqui se inicia el svg que contendra los controles\n this.iniciaDOMSdeCentroDeControl = function(DOMid,classname,w,h,duration){\n \n this.width = w;\n this.height = h;\n this.DOMid = DOMid;\n this.classname = classname;\n this.duracion = duration;\n\n var svg = d3.select(\"#\"+DOMid)\n .append(\"svg\")\n .attr(\"class\",\"vis\"+classname)\n .attr(\"width\",w)\n .attr(\"height\",h)\n .append(\"g\")\n .attr(\"class\",classname);\n\n this.initDOMsParaBotones(svg);\n }\n\n\n this.initDOMsParaBotones = function(svg){\n this.groupDOM = svg.append(\"g\").attr(\"class\",\"botones\");\n }\n\n this.fireEvent = function(args){\n var sceneNum = args[0];\n var sceneArguments = args[1];\n \n controlVisualizacion.escuchoCambioDeEscena(sceneNum,sceneArguments);\n }\n\n\n \n //crea los Botones por tipo\n this.enterBotonesOrdenarPorTipos = function(){\n //se eliminan botones previos que esten cargados en la vista\n if(this.botones){\n this.botones.eliminaBotones();\n }\n \n\n //set the data \n var botonesData = [{nombre:\"botonOrdenarPorTipo\",initial_px:200 ,initial_py:200 ,update_px:200 ,update_py:50 ,w:100, h:30, imgpath:\"imgs/botones/OrdenarPorTipo_\",args:[2,[\"Tipo\"]]},\n {nombre:\"botonOrdenarPorDelegacion\" ,initial_px:300 ,initial_py:200 ,update_px:300 ,update_py:50 ,w:100, h:30, imgpath:\"imgs/botones/OrdenarPorDelegacion_\",args:[2,[\"Delegacion\"]]}];\n \n this.botones = new GrupoDeBotones();\n this.botones.setEventManager(this);\n this.botones.enterBotones(this.groupDOM,\"ordenarPor\",botonesData,this.fireEvent);\n \n }\n\n //Crea boton por mes\n this.enterBotonesEscena2 = function(){\n //se eliminan botones previos que esten cargados en la vista\n this.botones.eliminaBotones();\n\n var botonesData = [{nombre:\"Regresar\",initial_px:200 ,initial_py:200 ,update_px:200 ,update_py:50 ,w:100, h:30, imgpath:\"imgs/botones/Regresar_\",args:[1,[]]},\n {nombre:\"verAnual\",initial_px:300 ,initial_py:300 ,update_px:400 ,update_py:50 ,w:100, h:30, imgpath:\"imgs/botones/Anual_\",args:[3,[]]}];\n \n this.botones = new GrupoDeBotones();\n this.botones.setEventManager(this);\n this.botones.enterBotones(this.groupDOM,\"Anual_Regresar\",botonesData,this.fireEvent);\n }\n\n this.enterBotonesEscena3 = function(){\n this.botones.eliminaBotones(); \n\n\n var botonesData = [{nombre:\"Regresar\",initial_px:200 ,initial_py:200 ,update_px:200 ,update_py:50 ,w:100, h:30, imgpath:\"imgs/botones/Regresar_\",args:[2,[\"Tipo\"]]}];\n\n this.botones = new GrupoDeBotones();\n this.botones.setEventManager(this);\n this.botones.enterBotones(this.groupDOM,\"Botones-Escena3\",botonesData,this.fireEvent);\n \n \n }\n\n\n \n\n}", "onRefresh() {\n this.setState({citas: []});\n this.TraeDatos();\n }", "function ControladorDeEscenas(){\n //contiene el controlador de elementos visuales\n var controladorHospitales;\n var currentCategoria;\n\n this.iniciaControl = function(_controladorHospitales,_controaldorGrupoHospitales,_controladorLineChart,_controladorC3linechart,_controladorParallelChart){\n controladorHospitales = _controladorHospitales;\n controladorGrupoHospitales = _controaldorGrupoHospitales;\n controladorLineChart = _controladorLineChart;\n controladorC3linechart = _controladorC3linechart;\n controladorParallelChart = _controladorParallelChart;\n }\n\n\n this.setEscena1 = function(){\n \n //esconde line charts\n //controladorGrupoHospitales.hideLineCharts(); \n //controladorGrupoHospitales.resetPosicionDeDOMSGrupos();\n \n //define el diametro de los hexagonos\n //y el radio de los circulos\n controladorHospitales.controladorDeHexCharts.setDiameter(80);\n controladorHospitales.controladorDeHexCharts.setRadius(2);\n //pon las lineas Contadoras de un lado \n controladorHospitales.controladorDeLineasContadoras.movePosicionLineasContadoras(75,90);\n controladorHospitales.controladorDeLineasContadoras.setLargoLinea(50);\n controladorHospitales.controladorDeLineasContadoras.hideLineasContadoras();\n\n \n //inserta los hospitales al wrapper-all-hospitals\n //el contador es para darle tiempo a que los otros \n //g contenedores de hospitales regresen a la posición (0,0)\n //y no se vea un brinco.\n setTimeout(function(){\n controladorHospitales.insertHospitalesToWrapper();\n }, 1000); \n \n\n //pon los hospitales en grid\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanal(40,300,150,hospitalesids));\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(0,0);\n controladorHospitales.resetListeners();\n controladorHospitales.resetHospitalUI();\n //controladorHospitales.addTooltipListeners();\n controladorC3linechart.hideDom();\n }\n\n //en la escena dos se ordenan los hospitales por delegacion o por tipo de hospital\n this.setEscena2 = function(categoria,anio){\n currentCategoria = categoria;\n\n var hospitalesPorTipo = categoria==\"Tipo\" ? mapHospitalesPorTipo : mapHospitalesPorZona; \n \n //controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaClustersDePosicionesPorTipo(0,0,800,400,80,150,arregloPorTipo,50));\n var arreglo_hospitalesPorTipo = createObjectToArray(hospitalesPorTipo);\n controladorGrupoHospitales.createGrupoDoms(categoria,arreglo_hospitalesPorTipo,anio);\n controladorGrupoHospitales.insertHospitalesToGroupWrapper(arreglo_hospitalesPorTipo);\n controladorGrupoHospitales.hideLineCharts();\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(450,0);\n //controladorGrupoHospitales.showLineCharts(categoria);\n \n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanalPorTipo(categoria,hospitalesPorTipo));\n\n controladorHospitales.addChangeOpacityListeners(categoria);\n controladorHospitales.addSelectGroupListeners(categoria);\n\n controladorC3linechart.loadDataAllHospitales(anio,categoria);\n controladorC3linechart.showDom();\n\n controladorParallelChart.hideDOM();\n }\n\n\n //en la escena tres se muestra un parallel chart comparando totales anuales\n this.setEscena3 = function(){\n controladorHospitales.resetListeners();\n controladorHospitales.addChangeOpacityListeners(currentCategoria);\n\n controladorC3linechart.loadParallelLinesAllHospitalsData(currentCategoria);\n }\n}", "function updateViz() {\n background(\"seashell\");\n\n loadImage(\"USVizLegend.png\", displayLegend);\n if (stateArray.length > 0) {\n for (let i = 1; i < stateArray.length; i++) {\n stateArray[i].display();\n }\n }\n else { //handles error if stateArray does not contain data\n text(\"Waiting to load data files...\", width / 2, height / 2);\n }\n}", "function dibujarFresado120(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\t\n\tvar fresado8 = new RVector(pos.x+anchura1+anchura2,pos.y)\n\t\n\tvar fresado9 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado16 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9, fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){ \n\t\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){ \n\t\tvar fresado23 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\treturn op_fresado;\n}", "function setCajasServidor() {\n for (var i = 0; i < self.datosProyecto.businesModel.length; i++) {\n var businesModel = self.datosProyecto.businesModel[i];\n for (var x = 0; x < businesModel.cajas.length; x++) {\n var caja = businesModel.cajas[x];\n for (var j = 0; j < cajasServidor.length; j++) {\n if (caja.id == cajasServidor[j].id) {\n caja.titulo = cajasServidor[j].titulo;\n caja.descripcion = cajasServidor[j].descripcion;\n caja.color = cajasServidor[j].color;\n caja.textoCheck = cajasServidor[j].textoCheck;\n }\n }\n }\n }\n}", "function cargarCgg_veh_vehiculoCtrls(){\n\t\tif(inRecordCgg_veh_vehiculo){\n\t\t\ttmpDatos['MARCA'] = inRecordCgg_veh_vehiculo.get('CVMRC_CODIGO');\n\t\t\ttmpDatos['CATEGORIA'] = inRecordCgg_veh_vehiculo.get('CVCTG_CODIGO');\n\t\t\ttmpDatos['PRODUCTIVO'] = inRecordCgg_veh_vehiculo.get('CSCTP_CODIGO');\n\t\t\ttmpDatos['SECTOR'] = inRecordCgg_veh_vehiculo.get('CVSCT_CODIGO');\n\t\t\ttxtCvveh_codigo.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_CODIGO'));\n\t\t\ttxtVehCvmrc_codigo.setValue(inRecordCgg_veh_vehiculo.get('MARCA'));\n\t\t\tcbxCvclr_codigo.setValue(inRecordCgg_veh_vehiculo.get('CVCLR_CODIGO'));\n\t\t\ttxtCvctg_codigo.setValue(inRecordCgg_veh_vehiculo.get('CATEGORIA'));\n\t\t\ttxtCsctp_codigo.setValue(inRecordCgg_veh_vehiculo.get('PRODUCTIVO'));\n\t\t\ttxtCvsct_codigo.setValue(inRecordCgg_veh_vehiculo.get('SECTOR'));\n\t\t\tcbxCgg_cvclr_codigo.setValue(inRecordCgg_veh_vehiculo.get('CGG_CVCLR_CODIGO'));\n\t\t\ttxtCvveh_nombre.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_NOMBRE'));\n\t\t\ttxtCvveh_modelo.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_MODELO'));\n\t\t\tcbxTipoVehiculo.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_TIPO'));\n\t\t\tnumCvveh_anio_produccion.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_ANIO_PRODUCCION'));\n\t\t\ttxtCvveh_chasis.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_CHASIS'));\n\t\t\ttxtCvveh_placa.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_PLACA'));\n\t\t\tnumCvveh_eslora.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_ESLORA'));\n\t\t\tnumCvveh_manga.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_MANGA'));\n\t\t\tnumCvveh_puntal.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_PUNTAL'));\n\t\t\ttxtCvveh_material.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_MATERIAL'));\n\t\t\tchkCvveh_ingreso.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_INGRESO'));\n\t\t\tdtCvveh_fecha_ingreso.setValue(truncDate(inRecordCgg_veh_vehiculo.get('CVVEH_FECHA_INGRESO')));\n\t\t\tcbxCvveh_tipo_ingreso.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_TIPO_INGRESO'));\n\t\t\tnumCvveh_tiempo_estadia.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_TIEMPO_ESTADIA'));\n\t\t\tchkCvveh_salio.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_SALIO'));\n\t\t\tdtCvveh_fecha_salida.setValue(truncDate(inRecordCgg_veh_vehiculo.get('CVVEH_FECHA_SALIDA')));\n\t\t\ttxtCvveh_observacion.setValue(inRecordCgg_veh_vehiculo.get('CVVEH_OBSERVACION'));\n\t\t\tisEdit = true;\n\t\t\tgsCgg_veh_vehiculo_estado.reload({params:{\n\t\t\t\t\tformat:'JSON',\n\t\t\t\t\tinCvveh_codigo:inRecordCgg_veh_vehiculo.get('CVVEH_CODIGO')\n\t\t\t\t}\n\t\t\t});\n\t\t\tgrdCgg_veh_vehiculo_motor.getStore().baseParams.inCvveh_codigo = inRecordCgg_veh_vehiculo.get('CVVEH_CODIGO')\n\t\t\tgrdCgg_veh_vehiculo_motor.getStore().reload();\n\t\t\t\n\t\t\tgsVehiculoAdjunto.reload({params:{\n\t\t\t\tformat:\"JSON\",inCvveh_codigo:inRecordCgg_veh_vehiculo.get('CVVEH_CODIGO')\n\t\t\t\t}\n\t\t\t});\n\t\t\tpnlVehMotor.setDisabled(!isEdit);\n\t}}", "function setup() {\n // http://datamx.io/dataset/salario-minimo-historico-1877-2019\n loadTable('../../data/mx_salariominimo_1877-2019.csv', 'csv', 'header', gotData);\n createCanvas(windowWidth, windowHeight);\n}", "constructor() {\n super();\n this.state = {\n tutores: {\n columns: [\n {\n title: \"Nombre\",\n field: \"nombre\",\n },\n ],\n data: [{ nombre: \"\" }],\n }, //aqui va el nombre de la tablilla\n open: false,\n mensajeDispo: \"\",\n visible: false,\n actuTys: false,\n fotos: [\n \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxASEhUSEBAVFRUVFRAVFhYVFRUVFRUVFRUWFhUVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGi0fHx0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLi0tLS0tLS0tLS0tLS0tLf/AABEIARMAtwMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAACAAEDBAUGB//EADwQAAEDAQUECAQFAwQDAAAAAAEAAhEDBAUSITFBUWFxBiKBkaGxwdETMuHwFCNCYnJSsvEHY4KiM0NT/8QAGQEBAAMBAQAAAAAAAAAAAAAAAAECAwQF/8QAIxEBAQEBAQEAAgEEAwAAAAAAAAECESEDMUEiEhMyUUJxgf/aAAwDAQACEQMRAD8A85ATwnThQsaEoRJ0AwlCJJEBhNCJJAMJoRJIAhNCNJBHCUKSE0II4TEKSExCCMhCQpCExCCMhAQpSEJCCIoSpCEBCCMhJOU6DUhPCdPCJNCUIkkDQmhGkgCEoRpIgEJsKOEkAYU2FWLPQc8w0DnIyWj+AYwgZudqZyaO5R2Lf01jYUxC6xlhY5oADWjackJuajtcTycFH9cW/t1ykJoW/a7laPkce33CyK1nc3UeymWVW5sViEJClIQkKVURCAhTEICEERCAhSkICEERCScpINaE8J4TgIk0JQihOAiA4UoRwlCAMKWFHCUII3ZCVQ/EYzA0TW6uScLdBqnsDc/uPqqWtMxrUQWt6jQSVbsxcNtOf3FUKldzM+Cnsl60ndWoRPESPJUaRpPqVG/NRY7+JafMearPvOno4OpHiIb2ObLUq1lYRNJ5adkO6qx7ZWqMyqiJ0eBLeT2+oQvY2XWt4zHWHMT4ZFA20MqA+O/tCwqVqc0wOqTnGrHje1XaYD+tT6rhr7HgoviZ6O02aMxmFVIWlSqF0giHfqB28VVtFGCtM674y3jnsVSFGQpiEBCuzQuCAhTEKNwQQuCSJwToNYBEAnARQiQwnDUQCINRCPCnwqTCkGoI8Kr26rgaTt0Cu4VlXg8F38dOe8qLeRbM7VNrYGf+Vq3c3P7HisljsTgAujsVmAAO1ZW8bZnVitZA+FC/o2HZrQswkroLDRlY63Y6c/OVwle4q1LrUnEcNnaErLbcf5VdsE5DceR2L08WAEaLFv3ok17S5gh2oUZ+nfya+U/Tzm2Xf8F2HM0ySRvYd43FT0GOGYPWGhGj2rcp08bTTqjrDqmeGnb7FZ9KzwTTOozafL73haTXWNzxYY0PbjZ8wyI2g7vUFKuA5s/Yd9VHRfgcH7HZOHn3HNXK1KDwdoeOz74lTPC+xjOagcFartznf57fvioHBdE9jls5UDgo3BTuCicFKELgkicElA2QEQCINRhqAA1GGog1SBqkRYU+FShqfAgr1jAJXMWp5J5mfoujvUwyN+S5evVzPFZ6/LTP4XrsoS7PM+S6qhSy0WDcdIxiO1dTZRksd10/ODsNBdFd7Fk2YAFb1iprGuiNWzsVv4QIUVnarRKmRWuF6WXNgcKrBE5H0PfC5W3MkCpGY7+I9V65etlFSk5pE5LzS00sLiw7fs+M96tLyqanYyazRAI0fn/y294gqayuxUy0/pgTu/pPoobJ8tSltY6R5j1CVFwD+DhhPaJarsgWmnqeIPfkfFU3BadZuRncR6hUHNW/zvjD6T1XcFE4Kw4KJwV2au4JInBOg3A1GGog1GGqEhDUbWo2tRhqlCMNRYVIGosKDDvl2bW8yuTtLZqBo4DvK6W3vmqeAK5z/wB45jzCy77W3PI7Sx0AGgDYFs2Oy4vmJaOGSoXe0GJVq9TVwRSEZarG11SNVtis40rlp4kHzVilepokB4xt/rZs5jYuAqXZUIiXCqdJBwzO4a5LpbwsPwmNewuzcQBDi4NmG4yAA4HXSQNdsLlE17zj0Sw2lj2hzTIVqkZXDdFL2cT8Jwgyu4qjCyRuVV6evbqNMfmPa3mQF570rqUjUx0XYoz6o7/DPsUXSe3Opuc8U2ktn5hjMgEnKYPLNZ9o6RWoM/OpsNEimcTIhvxBLQ6NDqpk6rbM3lrOtxDKzKg0eMB57FFacstx+rf7kF4PD6Rg/KQ4bxmPIFDWqYutvY13dM+itGdnq9jmDvH35qrUapLI6W8jH34J6zcytPkx+qm8KFwVp4UDgtmKu4Jkbwkg6FrVIGpNCkaFCSa1GGomtRhqlAA1O8ZFSQhrZNKJcjVMvf8Ay8B/kLna7orD+Q8/ot7Fme096wLUPzR/Ieawz+W2vw9Duky4LrLK1rhBGS5G63QQuyuynKy07MRYZYWj5VlXtiaDBzXW0qOS5XpTXa12BolxE8AFRfxk9G2n444lemuGUcF530RYTUDivQg/ep6rZ5HPW+5w8nE1sHUQBKp23orSqMLXYyDnBcSCYAkjbkAOxdY6mDonbZoSd/R5+3il63f+Hc+nnBBjuj27ln0HSxvJw7CQfIr0j/Ua5g6i6uwdamCTxbtXmFF/UA4NPe0K+WP0nF+7HzI/j6ey0KrFkXTOJ3ANW6RIHJafP/Jh9P8AFQqNVZ4V+q1VKjVuwVHhJE8J0HRtCNoQtCkaESlYEYCFoUjQiDQoLcYYfvYrQCzr6fFNx4ef+FF/Cc/lytPMu5j1WHeGT5Owg+K3LIJPj3LNvShIJWGb631PHdXbSxRHBdfdRMwuE6F3gH02yes2Gu7ND3L0W4HNc+OBWW+yurGvOrNqvHC2G5neuTt9Nz3F3mj6UsqgE0HlrmzllBjYZ0UVzWR9oZiFoIcA+QQMsJgAqMy31peT8tTozRLHguZkd2YldhmTpA469yy7nuK2Mwj4lNwIyLgRHAwrlqp2qix1SoaOFoJPWcMh2cFP9Ov9K3Wf1qKtSu6i+CeoTkdx3LVZaQRIXOWO9KlppGo+z/DZn85kkDbEZK5cVJxpAvykkgftnKexV7y8W1PPQdKaw/C1z/tVP7SvCm1dAOA7gAvXv9TLe2hYagnrVIpt3ku17gCvGrJmRwJWmPx1z/S9vG3dHzO7PIe63aQkdp81jXLT1O8P8wB5BbFiznsPePor4v8AJnufwR1WqnVatOqxUqzF0OVnVGpKWq1JBvtUrQogFI1BO0Iwo2lGCgJYfSOr+XG8z7LbccjyK5XpPXgxuE+yrv8AC+J6y7C/rOO4O9PqivajFOduvfKr3aeqTv8Ace60ukY6scvNYftt+nM3VeT7PUxtzGjm7x7r1ro1fjHYajHSMp4bwRvXjldi1ejdrfSMtOU5jYVf6ZlnUfLdzePWrzcHVHRmDn36rOp2Cqw4qUmd2TuXEKtdd5B8Ge/Yutu5gyhc3sd3z1/6nuq+bSQA57mkSM2NO7PYpLVRrV3QXuLJBJcMLctzdq1LPRKnLVNurPan+5mXucyKlpsoNMU26GAeQzKG222lQpl9RwYxgkk5AAJrbb2tyGZC8V6cX/UtNUh7/wAphhjBo4jVx357VGZ2sd6snVPpl0kqW+viEik2RSad215G8qrZaMEjcADzyJ9FHdlDE4EjTP0aPEK5eThTbE5uPrLit7/qMJ381q3K78uTuP8AcFfu1/WI4HwM+qwbntPUI3kf3Kzctsmo3jl4R7Kkv8l9f4uhqBUqzVoVAqdZq63Ez6rUlJVCSDXaUYUbQjCCRpRgoGqQBAxORXD9JKsufwwt8F3ULz++/wBU7XnwJCptpgFgMBvLPwVy+3kgn71yVGyfKDzKs293yjfPmsv21/4sOswjLcFZuYT3qS0Us3HdH34priHmrW+K5n8nTXUCHZLurmtxZGISFx9gp5rqLK3Jc+nVl1Db5aSMiEVe8C75ch4rBpuStd5NptJJ0Wd1V5IzOml9ihRIaes7L3MryF9TG6XHXVdNftsFreQw9cTDTo8ftP8AVw2rlxSc1+FwIO4iD3FdHyzyOf667Wvd9fCCSYlZ1vtWN5OwZAcNviSgcX8kVGyk56Ad3erySeqW2+LVhrENPLxzhSXPUIqt5tPYVBSpEh0LVuCiHubwPgYUcT12L1Uqq7UCqVQuhyqNUJIqqSDQa5SNKiCNqCdqNpUbXLEvHpVRpktYDUI2gw2ee3sUjogFwfSjDMAj53HLjn6+CpW+/bRXyc7C3+luQ9yonZ4AdgED371ntfC3ZGyDuwj39VLaxNQDcJ7SjsrOrz+/ZO+MRduA8FjL6354rWtv5bzxPt7KG52QRzWxabA74DHR8znCf4hs+JUNis0Fo4qLrziZn3roLKNFq0a8BQMs8NChqVIyWV9bzxoVLbAXIdJL1J6oK0bytWFq4u8apJ81bGe1TevFOpUdMgweC0DedWoAHYan8mguHIjVZzRu+hSAAM7PEFdHI5+2NupLWtIa0FwkSJy+yFA2nUe7rSctAMuyMlfs9te54DXHAMDCNgkfN3ytutRwNdjd1gYyyEHMOPKD3LHvGvOubfTI6rRmcgPPsCloWv8ACuGABxHzA6cp2fVFbrc2gC1gmq4Zn/5NOYH8zrw8sRrt+a1xm32sfpqTyO7sN/0KsNnA4/pdt5O0PmrdZedlw2rXuq+iyGVCSzecy33HBbsHQVUkL3A5hJQloBG1RgqK3WsUqbqh/SCRxOwd6DG6XXmWgUWHMiXxu2N7VyZcNyGpaHOc5zjLjmSipPOWQUUnqzZKTnQXfLu0nl7q5TaJJ8fQIaZdGYVwWR2HG8gDYPosda66MZ4b4sw0Kcs2cieJ2DklZKMZxn5fVWAzxy+qr+F+ddBSDatjoub+k1GuksnXWGjFEg5u3hBYrDLgYyCHo9X/AA5LXAmjUgPbiLRMjrOjMgRpwW66zFjcVPrsMkPA1wgFxw6gCdTuWOm2efiqturhrVkBxPWPYjtby4wZ5KwbMGtDq8taC1pYP/KcQkEN2CIz4hIm3jFt1KWlzjhYJGM/LigkNnech2rkK1NxzjiuuvV7qpl4AaNGNybloSN/sNy5q22cy46TGe6Ny1x4x32qVOkdQM9rTt5KT4GLMabd/bxUlEHfPn3ro7vsDXM+IRGgeNJ/dz28e9W1rimc9Yd0vNN3W0c17TzADh4BT3hfroyMuy5ZaEo76s2Bpj9LnDuxNnucFzJdKtmTXtU3q58iX4hJJJkkkknUkqZirMEqyStmByZRAqMFECpGrdd4lnVeernHD6J1mA70yD0Nq5LpbeRc74TT1WwXcXfRdS54aCToASexec220Go9zz+pxPYdFCaBmbsuC1LNYMsTnLMs5OxWTTqHImAdiz0viNihWs7DieS8jRg6x9h2qRtoqWh+IjC0aNGjR78VHZLqhkmPUqOjeD2vFOnhEuAJiTmd5yCz/wCm369bpZAgbfvtVix2f9RUtns+05nitChSACw1p1ZydlPJC0vpmab3N0mDkYzzH3qpVFVKrKtYlN62g/M8E/mScDcRx6574yWfWfmXOJc4gAucZJA0zSqPVWo5WZ8kV7U6VgW6rJLBrt4LSva2im2TroBvK56zVMRl2pWuZ51jvU7xcs7NGuHI6dx9Cu0u+nhoHEAWkFuIbCdjh3eCxrou8PBxfKd2zcRuIXRXaQaVSk49dksf+4R1HjsIPLJZ612tM55HFXpaJY+dQY7cIB8lzS0rxrnrN/c4kcZOX3uWe1q68TkcW72pqIgInJHYmeVooQKIIAUQQGEkIToOt6TWsMoFs5v6o5bfBcMVu9Lak1QJ0aMt0kz6LEYwkwoS0brssjFmti77u+K/OQ0a5+6r2WlhaADrC2rXW+FQEZEjhK5tavXVjMkZN+3mGj4VIQNFnXSz86nP9XedVTacTi4lXLj61oZwk8gAVpzmWd13Uek2enICnNNV7E/JXguGvRis9sBVapV2qs+uVaK6qvVKo2y0NY0ucYACmtFYAEkwBqVxV83mazoGTBoN/ErXGP6qw+v0mYgttrdVeXHTYNwVmzgFuYWdTWhYwujU5HLi9rtOijoY4NM5ZtOsb27/AKIbZaMFVrgcyMJ4xp4T3BR9F7U3Om8QdWnQzvH0WV0lrEPH/ITvnaufOe1061zLn7c7FUed7nHvJIUITvdn3IF1xxVIHeqTsk1PVORJUoMwKQFA52wJ2qQaSZJBJfdUOr1CN8dwA9EFgtDWHNVXGc0KrZ1MvHRWO0Unvl7hA7Co78vMP6o0GgWCnJlU/tzq/wDcvB4vVW7mtYpVWvdpmDwB2qiE4KvZ3xSXl69XsDwQCDIMEEaFaYOS8oui+61nPVOJm1h07NxXd3Xf9Ku2WGHDVh+YceI4rj+nyseh8vvnU5+2naKkLHt1qa0EkwBqVTve/WsHWOecAalcdeN41Kx6xhuxo07d5VsfK1T6/aRNfF6mscLcmD/txPssxOlC6pJJyOLWrb2kxbNhtNKIIM75EfVZAWlYbwZTaR8IYjt/yq6nVsa4sst7QSyDv5HeD+k+BVK9bYajhtgQDtPNR2qtOe0qKkzKT95pnPE613wLWIw1M56Bz1dmkaEz3Jg7JREqQ8o2oAN6OUBgpJgkgiPJAVKo3KAKSScIDAShMCnlAk7HlpDmkgjQhMlKBPcSSSZJ1JTJJIEnCZE1A4CKEgiUgVODkooRNKAXsUFQK0VC8oAxoZTJlAcIxKZpRygIJIZSUhigcpConKAycJkkDp0yZAUpSmSQPKUoUkBI2qMKRqCQJwhCJSHTpkkClRvRlRPQRJJJKA4RNHFCEYQPKdME6kDKFySSgCkkkgSSSSBJJJIEkkkgSkakkgkCdJJSHSSSQCSonlJJQASSSQJGEkkBBOkkpH//2Q==\",\n \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMSEhUTEhMVFhUXFRcVFxcXFRcVFxUXHRUXFxUXFxUYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGhAQFy0dHR0rKy0tKy0tLSstLS0tLS0tLS0tLS0tLS0rLSstLSstLS0tLS0tLS0tLS0tLS0tLS0tK//AABEIAOEA4QMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAACAAEDBAUGBwj/xABHEAACAQIDBQQHAwcKBwEAAAAAAQIDEQQFIRIxQVFhBnGBkRMiMqGx0fAHFMEzNEJSYnLhFSNDY3OCkrLC8QgkU4Ois9IW/8QAGQEBAAMBAQAAAAAAAAAAAAAAAAECAwQF/8QAJREBAQACAgICAQQDAAAAAAAAAAECEQMhEjEEQXETIlFhFDIz/9oADAMBAAIRAxEAPwDzwKwkPYuBbCUgGOgCsNYcTZIjYIbBiQBkxkSbIKQCiE2JBWANSHUiGU7cUN6ZPRfBjZpNckU9Cs5Bp8xuJ1VmNcJyKqZLFkoKqyFhzQLRAG4mxpAMB2A0FcVgIrBRFKI0UBLGQMpDxiLYAbaEFsDgPcNMEVwHHQox0CSsSAkM2O0MkALYkKSGTID3Bc0rtg4vExgtfIxsXipT42XIi3SdL9bMkvZV2VJ5jJ8bFDa5DNldpWniet31S+RJTxcl3dEkU4Tt17yWL5aeN0QnbRji0tVa/J/xJVi1J3S16Oxiuetn5hXtr7yNJ8m1PGpcGvBlrD4tOybty3GLh5uWm/pfXwJJRVrp211XFP5Ey2Fm27O3ACxjUsdOO+zSf1Y1MPiFNXT+u40l2pYKQKDYIQbZGsGCwFIUYiQcUA8UPsksEJokRCJbCAhaBQ8hkQJEw4kYcADlAhlEspDSiBVaI6tRRTb3IlZj5vXu9hcN/eKKWJrucm/iV5BvQBvmZrGbHQIaAeMk94n5gwRIoOLv9fxQDQfC5M4xit78d3uBnDW6WnHp/AnguWvcE6V6WIs9y+ZcniU9bW59PmRTUHot/dYb0L5btO9ciEyU1aGl17tPNAYaq4NMdUpJWHp0W93D4cRsuLcw9dTV0SMz8FBxkuTNOxpLtSzQBNB2GaJQZIkigB0yRMmJagwRLFEBWEFYROhUkgUSyiDYgJEtNEUSaEgJrEdUKLuDJAU8TU2ISlyOZlLabb3t3N3PJ2go838DCRXJMDJA7LJNm5YpYe9lxfuKraVqFByeiLX3J7uJ1WUZRFR1RpRyuPIzubfDh6cHLBtcCT7o5HcfyRfgFDJkuHuv7iv6jT/HcRSwzsSRwja3bvM7mlkbm7bPuNnDdlo33eJW8q8+Nt5xl+Tzqb0t6W1bffS1jscv7Gbcbz07tXwsdll/Z6FPdFLuRrQoKKstCtzta48OOLif/wArCMXG3dp8Th+0WTSwzul6u9abnyPZ61Mxc3wMasHGSvwIxz0tycMynTxGri7O60425PmvrmbeFquUU3xRU7R5QqMmlo093TmiXLJ3pR8vLQ7MLt5Wcs6q4DIZMKxooEJC2AoxAOBKmBFBpAOOCIAaiIWWJkLiQACixrDxRInpoKSGpseciBg9oHrFd7Mi3A0M7m3V7kjMlK5S+1onw0byXuNPK4KU79dO7gZeGer6I6DIIa3tqUyacc3XWYOGiL1KncrYRaGjhYmFd+ET0aSL1GgitT3mjQRnXRit4bDLkauFwqdithKZoYepYYxXPK/SeNBLqQ18PcsbYFWV9Ll7plLdsrEUbGZiIm7i3oZdaNzK9V0Y3cecdv8ALNqO2t696ONyq62oPhr4M9V7T4fapyXQ8qy+p/OW4tNW6pu3uOrhrzflYau2mkOkE4CkrHU4yHBEBLEJMhiiaMQFdCHEQFJA7JLIZICBxGuTOADiAyY6YLQ8N4GBntNqonzj8GzJbOl7QUXKEWld7XDuZzTjYpfaySjvOqySPkcpRWp3mQYe0EzPNtwzdbuGjZJF/C77FGLLVGpqY2O7HppRVi3hpMqUZp7y7RiUreNbBzaLkFruKeFe41KUNBFMqQnAKwXey2lNqGIV3YpVYWNWrs20MbMsdTpp3kl0KWNZl0zc0hdPqeM4fD/8xVT/AEZO3+LQ9S/l2lUlsKWrdkuD7med0qT9PXfDblHxUnp8Do4ZquP5dlk0tXBkhTQLOp55MdApksYgFYmiAlYIgOIG45IKwVhMeCIDNAuJMDKIFfZH2CWMRONuQEFa8Yya0ai3c5zN8LJqNVezJWdtLPr8zqKyvCa5wdvrwK6cIYWEZq94Xte3ta/iYZ3WTs4sPPi1/bjaHtHo2Rfk0efbFpaaLej0Hs8/5pDNXgmsrGlUlbeZNbN5KWzTjf3m9HD7S3aFCthlT3RfkzPcdNlZEsVim3JxbXDZfwuHTzzE0/0avjG/4A4jOqsZbMKbb7nbx5E+XY/GVZ7Dgo3cUns+rq9W5PdYn2pbJ91ewvbaurXpt232i/xOmyjtU6llJW+tDmsXRrUpNS2ZW1ummmuanG1n0a8Q6VWUXe3XwZnW+O57r0jD4u5UzTNVTV2/BalfIqimk7lPPsNOV3BbtL2vb6uZ7aubzHtPjJtqjBqN7J2Svzd2ynQyqvV9atVpxd/Z2tt262aV/Miq9ncRVqpwm5LW6k5Lhp7LVmnfizVq9k5pU9mUk1Fek9JL0kZysk/Ubur9Gjbeo5rLctWVXxXZuLcJU5OU4yUr3tud9y3I5zGK2IxEV/1m/OKZ6llWA9HT9ZK/Rt+96nmOcRtia7/rP9MS/Blus/k4zHHpBfgC2KTBTOpwCRYgkQ00SpAEx1Ij2hlMCT63iA2hAXqkQIotTjw4leWgCEkJjpgMkhx6bDkgIox6mFn8WlBa2UVHy0/A3ZlihC7Ut64p8Hbf8DHlnquv42XvFx2NopUqc1+1CXR3Ul7rnXZLpTj3EFTBQaqLVqTjK3Jp6W6lzDKyVjPe41mOs7W7l009DS9FtGFg52NmjWMco6sOwSy+UdYwb66P3FjCRa/o2n+5r8DRwc78C/Erur+MjKqJpXkvBpa+Bi5lSTjfi+XA6TGUtDDxKS3sbLJo2QVHGWyb8km5QlzOaw0XGd+p0FSpeSlwat4ojJbGdGWUJO8ZteHyJ6eCs/Wk3bpb3lqg9N6JpLQj2KlWSUWkeS55riKrX67+X4HqGOla55TjZXqTfOUn7zo+NO64/ndYyKrBUSVoA7HmHjcLaI0w7gBdjoLZGsAr9RC8RAblSStoiq48Sfb0txBAha5sZIeSQCYBtBKQO0JSAKTJMPVUW77nv/BkaGfAjKbi2OVxu4ec1GTUXdNeWpNFspVVZtrkviWaMlpxOe466dcz8u2jh5mlhampj0WXqMtTPKOnjrpcJUNONYwMJJk+JxLUTGurcsDnud7K2Y8XYy0ttbRQzeh6Rb+N+59DNrVq8F6slfuL449MsstOvwcU7cTo5YT+a14dDzDI87qKVqi1vwTs/kdtQzqdSNkn3tWSIsWxzlib07hrfozRpYraVzPhQTjst3vq3xuPhU16r4GfpfcPmc/VZ5bXd25c2356npGdVNmnN/sv4HnDWngdfxvt5/zst2RWbGFIKJ1PPMo+4UR2IBD3GYooBbXQcKwgL0ZjuoRXFcAnK4CkCxIgE5DJgyYgJtoQ0WBXrqEXOTsl9WXUA3C+0uiJKem7TgZfZ3ESqqpOXGdl0WytF5rzNCo7d3Mwyvbrwn7YuQn9fEtYbEaq7/gjOhV+uQ1SdtV9fMzsbS6d3h2vRya3pFDMcZGnB7ckuV3Yr9ns0WzZ8VbqbGFUaqaklx8uBh6rpxvlHK0sxpN/lF3J3fuJ6dWEmrRnK+qtB7ugsbksIVG1BRmuKVro08px8qbirJ7MdmzVn4vwRe5LTjy+psGFw0E/yFW6s7bD62fLgW8RntKlC8qVSC5uPhw1Nylm87X9FwXLhfr1OdxVKdWpeet36qv6sVfpx6kflbDDLK6skHRzRVGnCM2v3JR+KNlSVtr66B0MPGEEuhj43GaJR06dLXv3lL2rnrFR7S431JJcbL43OMq+41s1xG09lO+zv7/9jLqRa4ndw4+OLyvkZ+Wf4VkEhrCSNmB4ikh0hrAM0FEFsZSAkGHEBYkxkyFMNMgSpoYHbHsAmh0hRQc6sIK82kubdgAbSV27Jat8jlc6zP0r2Y+wnp+0+b/ALOc1dV7MdILzl1fyMoijt+ymFf3Pb/r5LzhH/wCS5XWhpfZlTjXwNWi9HGo+9XSlGVu9PyKuPw0qcnCas19Jp8UzLkmu3Xw3ePj/AAoXJaMluIKqApS1M/a/poU57MlbxOjyjFPmcjKroXcqzHZdr28Clx20wz1Xa5lR20n03malKO+KfUuZdmcLWlrctrZ4PT69xn3HXjd9yqNDFNuy8jSwsG9bWHoYWKd0krK/ffp0L0K6UeFxU+V+1DMsWrNeH4/M47tBmMaEL67TVkvgjR7WZxCC3pc7d25e5Hl+ZZnKtPalu4LkjXi4991xfI5tdT22aOeQftKUff8AAn+9U5bpRvy3e5nLiudunm7dPICETBpYmUdzf10LUM0lxSfmhpO2uxm7FCnmcXvTj70W6VWMt0kwFJApEjGiwFbo/MRJtDAHANw0Io7ySLAVhVKiinKTSXNspZhmcad0vWlyvou/5HO4rFSqO8nflyXciBr4ztBwpL+9L8I/MxMRiJTd5SbfV/hwInIeKI2BGCaGCXZfZbmvocX6N+zVjb+9HWPu2l4nrWc5JDEw/VkvZla9ujXGPQ+eMJXlTnGcHaUZKS707o+iuz+ZqvRp1obpRTa5aaomTc1SWy7jzfNcsqUZbFSLT4PhJc4vivh0M/Ya/wBz2zGYCnWg4zipRfB8Oqa1T6o4HPex1SleVG9SHL+kj4L2l3a9DDLjs9OrHlmXvquRumuRDJO+7x/2LToheia4dSi1lHgcfsvXSzOio5xotd1vBHKVaCb3MelhJvSDfdv+JFkq+OdxdxHNlvut2+/mirWza8lCG1UlJpRhHWUm9xh4PI6svabS5X/BWR6n2I7IRwy9LOP8616t98E+MuvQY4eVWz57MXmH2odn3haOGlN3qTnP0nFJ7MXGEeaj62vG7fQ84kj2/wC3yC+74b+3l/63c8RkdWpOo86227p4TDIQ4SJ2hJcQwidoOOpAiGxfwuZOOkvWXPivmaFDExluevLczAEptNNOz4PqNpdMIxP5Yl+qvNiK+UT41uVakYK8nZfW5cTFx2byl6sPVjz4v5Iz6+IcneTbf15EDlclAnMASHSIDWDpIWyFR494AyQDRPJEUkAET0r7K8/UG8NN6P1odOa+uZ5qXcDiZU5xnH2ou6+Xlp4iD6Zw1VcC46SeqOb7PZjGvRhUi7pxT7n16nR4GrwLjGznstSxF21sVP142u/3lul8epxWZdna1B+vG8VumtYvv4x7mevxp3IsxrUqNKVSs0oRXrN7uVrcb7rGeXHK2w5bj/ceOUsHfhc38l7PTqv1I7t8t0V3vman8qYGMXKEcLaSUrykrP8Acvf1V0stCah25VKtHa9HUwrVnPDwlNUv25ODkthcd1t/Qp+jftrfkzX7Y6LJOzNOi1KXrz5taR7lzN6URUKsZxjOElKMkpRlF3Uk1dNNb00R4iWjL4zXUc2WVy7rxn7fMam8LSXB1Zv/AMIr4vyPIZo9C+2ynJY+ne+y8PHZ5flKu1b3HnzL1RFYaxJKI0SqRRY4rCJQQhhwGYFR6eIbI6m5kVJaDkG2OV0tswhINIsqaKDSFFD2ASFQ3eI4sPuAOxDNE4E0ShBYlpsaw8UQl6R9lWatOVBvjtR7n7Xk7f4j1ilPZPnjszmv3bEU636KdprnB6T8lqusUfQNCadnF3i16r4Pky0HQYaei67jg+0PbChVxP3epHbw62oaXanNXhLctyd1pyvxOgzjGTpYaq6d9rYtC36MnptLuu34HjWVqdWVKEq0qdOlUcZv0e9Lhr+zbnpK/AvNfaLv6dH2e2akp/cqNSNKjV1dSG3o73Tbad7Pjqla+80pSccbD7jTqxl61Sc0qcab5wktVKOrT43aa5mTic9U418Jhq1RQj7UowautzV7br6N6bVtNDUw2IjH0FDDLETqVI7Lnx3atvnve+yWprhuzd9It769t7st2rUcX919G405q8mtKdKs5Oyje1lPW64NX4s7yo7+KPG8LgKdGo8PBzc6aU6spN+1Kctiz4WSf02epdn8xVekpN+tH1Z964+K1MMtb6W108k+32klWwb4+iqJ+E4tf5meWM9S/wCIOUvvWGTacVRdlxUnN7V+9RjbuZ5bIqGEIQQQw4wCHuMIBmR1NxIyOoQlXEIRVKSIcRCLIEOIQCYsPu8xCAlBkIRaoRveJCEVSlgfQnZz8ywv9lT/AMkRCLRH22cT+bruf4nnD/N5/v8A4oQhfa30PIP6Xvh/lZ0X2a/lP+0/wEI3y/5xTH/asul+e5l/aR+MzqOwPt1u6PxYhGF9r/Th/wDiC/LYb9z/AFVDyhiEQgyHQhBBMQhACIcQAsCoIRCVcQhFEv/Z\",\n \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExIVFhUXGBgWGBgXGBcXGhkXHxoYGBcVFxgYHSggGBslGxcXITEiJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGi0lHyUtKy0tLTItLS0rLy0tLy0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAQYAwAMBIgACEQEDEQH/xAAcAAACAgMBAQAAAAAAAAAAAAAEBQMGAAIHAQj/xABGEAABAwIDBAcDCgMHAwUAAAABAgMRACEEEjEFQVFhBhMicYGRoTJSsQcUI0JyksHR0vBiguEWFyRTorLCM2PxFUNzk+L/xAAZAQACAwEAAAAAAAAAAAAAAAABAgADBAX/xAAvEQACAgEDAwEHBAIDAAAAAAAAAQIRAwQSITFBYRQTIjJRcZHBI4Gx8DNCBRWh/9oADAMBAAIRAxEAPwC6YV4TBUbAZjKgmCLLTf2Ztw14VPtJuEZgZIggGbxcAbhxmDpUISCcquyrVJHEyJSeJ4HnrXjmHOmbszcBJEjha0kZhIjUcK5M9L+oskXXzNEc9RcGEhSgJkEa6EWoXCLIWVFNyYJ5WAPfp5UwIBHEa0MhaggmBlUqVCLxJEgjvq7Im2vAmJqmn3DXBQ+0kKSEkRYpKkixj6x56jyNEPjs7/x9agbdIk2VYCSCSQLx2TJi3nQyJt1XA2FpLqE7PWOqIGsHW9rxzgaUEwhJme1M3BieJN95HkBUrQiQYg8DHkCLV7iWQEkgE2skb43DwpsN7aZM8rfBiFDNlJ1BN/aF7z3z8b3oLAPqViFN/VAABFrwCUmNxkeVHqaTEieyRP47r2NS4XAISc4CiQbHebRryBIvw5Cq86cVdhwOLtNHhJEJsU39qPIHeAPqxxqNBCYKfZm94uTpl3bonj5EPTJKtIEHWCDO7W+XncVElhSwIIKjrI3XAVqOFrcJ0pccHL3v79fqSckvdPMMwlZUQNFEHUGZzeMAj9ipnApNpO68kCN5J3aeteMMoaIykBJvqJBgdpRPHhHximIWbQmZE2nzHEVpcbKW+fABhc0lMHzHiNL+dE5T3fvxqBxIEEoITaDATzA5iL6bo33JE8huvv8AEWrk6rG4z+pqhK4kLiR7s93lUJw7czkAN7lPON4/c1M22STmSJgG2s3EHwAjxr11JywQd3PnVCg06Zbu+RE1h0JOYaxHrHhetH1guBuTmgqFrWy7+NR7ScdiG8qSYOZQJyp3wnQqnSSBS57FqLwyFYyABzspGcxYZza/CR32rRixd0+SPnqPC2N+vEfnXmLTlbJG4E27qV4LaT5UA4yMpJuCAU3sFJmSYk7rA91NXpiBB76rcVC1JBRU2FFDqVFzMqBOgkSd3Hnypz0UUSyqZs4sCRFrRXh2WgLzZfLnqDytUvRl0rbUT/mLT5GJ9Ku0nxMfK00KA24gkKKSk7laGRolRsLx2TwsKLSVJ95PIjrE+BT2h425VM87ECJJtHLeTY2r1OHA9kqRySbfdMpHgK61UcvffU068rEQkjSUL077AjuqJSFgWcI3QsoI8ikH1qdTSlSMyFclInumFD4V78wE7gOCUhPmoX8iKDSCpJELWItGZTqhFkABIP8AEoE+p8KLYYOqoF7ga6achrx76gDhRKU5QATaPyqZp4qB3aXF9/7t31A7r4CENomB4i9vyrZ9uYi3aT5ZgD6SKGwSFCQVoIGqoOZUkwIERGm/SiHm1KETF/TvFSLtCyjsknYPs5oguJIslRSOad34jwojCZgopBFjIM/FM8xOlzO8VolvqkqWSSAkqI7RmBNpJ5+dV3BdM8MO0s9T2hdZ7NxeSD7NwCSNwO6y7VSjJDczcpRLaFCQQIH4nKSAIjRR8Qar+2ulKWZCACpUlSlnIlIjSdSQOHfIml+L+UHDOIUMMgrAuVqPVpBg3TbMrwArjvSvajuKUEgdlJNkzB4GOQqQxqPuoanLlotPSL5U3DmaZWVI0OVKW0a7icyyJ4Kv6VUXenu09BjHBNgG8qP9iRQWG2G8fqTP7kHdRH9ln09rIY3SL99XJxQfZy+R630wx8yrH4qeIdWf9OaDV36P/KriWQA6oYhMi7iUtKPILSYEfxAzxrnr2xXUgnIYoILWkwZT+NCeOGTqrJTifVHR7bjOLQHmkrGbsqCgkFCgAcirzzESO1IsaF2Jj3HVKzrTA63s6EAOEJzcspF/4TXC+iHSp7Zzgca7bCiA8jKoBQ3ngFgG0HdzM9/wbyHEh1tSXEuJBStIklKvZkjdug8OVc3Ng2yarrVFqkknYRjElaOwoA8RBj8DSJnDYptJShSXO0DKzexkkZQYk3PlarA42Nd/HfWgKdFGPSRQngnh5jyDFqFJUxZg1YjKEOhJI3pm/C0Wo9zEDcR++A1PhWFQ0SDfWRFvEelarSDqAe+hj0sslynwTLqVFpRRs2ufPf4f0rTYCYbNvrqPwvWzGnjHjvP74VmxPYP2jS4Uo5mkXXeO2DFItMa2njy51JFDraIAkk6a2O65yxxrApY1QDwykT/qA+JrqWc7b5PU4btZpGs6boIy90knxqd5RCTl13d+491RdeN6Vj+Un/bNYMW3vWB9rs/GjYNrCerGsCeMCa0S9JKYNovaN/Pl8K1GJQdHEH+YfnXqVoEnMm9zcaxHwAoE5RulITfSYH5C/wC70QigHXmyUy4mxmJnloDrqPE1OjFT7KFq/lyjvlcCmSQHufUJxbqUNqUowANf3rXzd036SuY7EHMoBptRDaBprBWT9ZRjXhpXZOn2IeTs9+8KiEgiTBNlAzuCgNDdJrgeMwK23MqlIVICpQZETESQL2pu5big9u4c7JxClJyIm9pFhV82HsFtIEpBNVzors4EhRv8BV9ZOWKzZZc0jqYIcWxpgdmtJ+qKO+YoJ0FLU4i1FYR8zB31Saq44G2F6OMKBzIBqm9M/k3acBU2mO6rfhMVGpNGLxRI5Vamq4McoT3c8o+ZXsEvDuKw7osdDMSNxrrfyJbUPzZ3DrgJaWCg8lSSOV0k854zQXyq7BSpvrki6b24b6rvya4gjEhKN6SFDiNQe8Ef6udPLI1ByRlzYl0O5KcSdCPMVGTQWFZOYA5jvvyv8YoxaL3Ejz8SN+/0oQyucHKjE4JSqyNbgiYPiCPjWiTbUHu+FTLOawJjjbyAIt/StFJo4pTkrkqDkUVxFmNGx5H01rNhnsH7R/CtWtTw48/3+FbbDHYP2j+FYoqtRI343eFFOO08YhX/AEAUzcpdBE+9BGaDHC9QYnpNiRYYZcyNUkC3AhI1q3tOSL903F9IIN0md1TAVshGLVxZnnlknUoi3Y2MedSVOsdVpl7Uk8ZEdmmAVWmIdypJ/c6ChPniuH+lX51J5YwdNlKi5coZa1GlnWySd3ZA8P61DhnyTyI5j40SVRenhNTVoDtcGySRFu+N1StqoTC4tLiM6ZjmIOk6UU0ZvTpiNNdSHbuB6/DOtjVSTHfqPWvmTbZyYlSdZv8AG37419TrfQlJK1JSneVEAcNTXyzt1IONcAg5VFMzINzcHeKH+37GnB/jf1X5L90LBKAo1bAmaT9H8OEMIA3ia3xbszKoHfArM3bOvBVEanEJRvB8aMZ2mjQgd9c42oWlXD9xaAZHpW+ysYodnMVDcZmjtGjPmjqLW0AdSk+AmmeHxSFCBE8q5q+tSBmOhofC9JHkL7DYUnxBNBWTIonSds4QONLSbgpPwNcz+S7ZmbGOEAdiFRfiUkeIPpXRNmbYS+2qRCspt4VV/k1eSylxzIpbryyG0gWyiVCVGyZgxPCni0lyYtQm1x1OkpYSkkgQTzJ+NRByZkaE+W6lmx9tLfJzISkQSIVJsQCFWga7iak+dr5+Sfwqe3xxRzpYpJ0wlLkpBNpitELkSRGv9K2ZWVCT+Verq9STVoqaNmDI8T+Ve7FHZV9o1qwYSNbib9/9a32L7KvtGuXjd52/qdVKsVfQXMuS4o/VOUAWy5coMgc5n04US61lBKSRF4mQQNRB0tpEUlxeNX1qA00pbZjMsgoyi9oUAZAjd47qsIMis2XLKGXdFls8alFWgPFDsnw+IpYHLkZvUeknnTR32VJ3gHxG48/zmlatbH1/CRWrUtScZLujnwTVpjHBkZh2p8uB4UTtYQyqAVEgjKCJywc0c4vQOE9sRc6zwA8aj27iXG+0hoqBLSSoXKRmzKMRoUyJncKtwX7JjxinMMbuqEpELABKYAncYnUjNp7opkhsC0RFIkv51NpCQAMi4QcoJAVmSI3SNDvA0pyXCQCoRJAIPDNB8Iq7DJxi7d0DU4+U0Uz5VsQsNYdCSUhbhuN8C3heuedLNnAIS5AKklIKogkG141vFde+UPA9ZhCsCVMqDgjhov0M+FcmxGFW4lyZILjeXuBnyvSYsu/3jdigvY7UWzZSfo0DTsj4Uv2xsJpZlYUoDdmIB7wDemWEEAUc6lJEzUTZqUU+CgYvZGHSSW2ShWlkkeXDvorYeAhST2pJi4A8bU/xa0zYCocOZWCNxp9zaIsUYsbdP9nxgm1NiFZoJ03Hf3xXN9nbOxpVKFJy81Kn1tXaNotBzCwoAgVWtm9H2lK7K1oPugj0mjurgreNydtgXRt10Zg4jKpKVTp7pvIsauOF2chLLKUfRhtLWspJCeytJncRm85r3GbPDWFei56pcK0PsnWicO6pKEZ0mAEBRGZxShEGQEyNEzF9aqlXcpyPujTA4UNi1hk5i6u0d53mtYlfhROHalOawKu1eRCdwVN5jWdNNIrE4K8gi+8EkeUXqmWKUvh+bMeaS3c/InZsnzNRDMSFTCYIKYFza866VLiEkIOXUC03/Kh8Ms+yUq5ezy0AUSd94FbG3Cl2ophFST+YckWT3flXmxfZV9o1qbRG86RG4/vwr3YZ7KvtVztN/kN8vgYvSwoRZPr+Jo5s8ZHcJ+FVz+0Sv8tPma9T0lUNEAdx/MVlxY6kty4NcsU2izllBsT5pPoa0VhU/wCaoeE89SD6mkH9q1+76j9NbI6YKGrc/wA0fhXQhPHDp+TNLSZJdV/A6OSOy6hZkjKkpkwQFWzaiRNQYxkOpKeyTp2gqR5EEcdKWOdNARHUn7w/KtFdJUKuWlA7iCJHd+VR6pKVVaE9FlXMVTCMPsooJMNyZ7WZc5TGYZdDJAPDW16b5ZSATNom0+gHwpGnpIjehXp+db/+voI9lY+7+qrlnwroyqWm1Muq/gc4x4dUnNfrMqI3HNqDwGtc925sQsODKsKSQVReQmQL2g3IE27qtmK2u2tKQAtOVSVD2d27WlXSJ9tTRVBKkghMgaqWgzM8AfOufhntlS6M3Y8U4rlCVLkDvMUtxW1SDkAJNSleZI7/AN/GlmNwqyqGyAo3kiR410EWXS4CUgqGZau4Vvg9soSsJyHgZ0PMEb6WbJfxDpW2402FI3AkSNxTJ31mMwSkq7aFtkGNMye4EfnT0lwRTb6F9we32lNqaWCCuQmLkW1jlSDCbWWFwqJFK9lOtMEuuLWAARmUgwJ1k3oZePQ6slpWa9iJg9x30rQd/Pk6lsjaIfAaN81u8b6sLmBXuyR3q/pVC6Jdh7OowEjXmRpVz/8AV0z/ANUHz9ezegsijw2ZNRhlNqkefNF5u0kTYgAkiJMTO/n+VbYvBFZjKAQOzuvu38BHKvDtZuZLqSdxFvOU99bp2wiDDyJ3BRHrFVucd12U+yml8P8A4a/NnD2Sb6nf4TItz1qTDsZZGp3wIjlF/jQ52hJnrWZ5K/8A1NaDH3nO0T9oR6mhkkpqm3Qscbi7Uf5JcTi0ouoKgXlKVKjjOUVt0dVKCRoSDfmJqBWLCkqRLIzApJ6wWkETc170bxSEpUFLSIgCSBNrm/Oq8UIwyKmXPc4Pj5FR6ma8LFct/vGxnuM/dV+qvD8o+M9xn7qv1U3o8vg3euw+fsdRLRqMtVzH+8TG+6z91X6qw/KDjPdZ+6f1UPRZfAVrsPn7HSOoqRDVq5j/AG9xnus/dV+qvU9PsYPqs/dV+ql9Dl8Devw+fsdSbYqZLNcq/vExnus/dV+qs/vIxvusfcV+qh6HN4B6/D5+x1pLdRbSy9WUkgFVgCbneQJN7VywfKXjfcY+4r9VW7rnHFYdzEZesSb5RCUlSVJIuT7wBvup8ehyJ3LsJPXY3xHuR4aUrLZpilnTiLVmPwma41FCt48gwruP51oqxU9vDJMZhEm5sdx/rw77UM1icQOz1pjNNwF3438PKmhINSYXo11hkOQNYH5TRss2rqCu7KOISQ+6paJzZcqUA79BJInnuFCYTZyQvNlASLJFXHCbIDaSSQRHj3VQOm/StOGIQ0kKcNwCDlCZNzBvNwIqJSk6RXOUIK2XXZ7cJ0sfXnU5RXIR8qON9xj7iv11n96ON91j7iv11mnos0nfH3DHX4YquTrZbrXIa5L/AHn433WPuK/VWf3nY33WPuK/VQ9Bm8Df9hh8nWCg1qU1RuhvTLFYrEobcDQQc05UkGySRBKiNRwpz08249hA0WcpzlQOdM6ZYiI4mqpYJqag+pdHPCUN66D8JrCj92rmX9v8b/2fuH9VZ/b3G8Wv/r/rVvo8ngT1eLyVUsitCirFs1hK2iTqDGgPrSFSa6qdnGaojyVgRW+Q1mQ0QHoQK8KKyTWJzKISlJUo2ASJJ7gLmiQ0KK16u8bzoNSeQFW/Y/Qd9cKxB6lPuiFOHw0T4z3VbMLsxjCplpsZvfPaWf5jp3CKZRYjmim9GeizvWIdebyIT2gFWUo/V7OoE3vGlXDEiZFa/OpMkyfOvFrmroxpFUpWzbCbSjsL7grjyPOtMakG9DYhuaGGIKLKunjwrLkwU7ibcWptbZ/cmS8tFh2hu3GjMPtl1JsFcv2KHZAX7Jphh8LxrO67muLmugW1jX8RCVEhJgc4qr/LJsQJRh8UgW7WHWeaRmR4/wDU+6KtOHxIzZEe18OddE2Bhk9QW1oC0kXSoBQVyIVY+NX4IN3Iy6vIqUe58hVsmvobpR8kmz8TKsOThXTeEjM2eZaMFI3dkgDga5D0p+T/AB2AlTrOZr/OalbfiYlH8wFXtNGJMriU1JkqFC6nQqlZbEt/ybIjFN/aP+xVWb5U0ynD/aX8E1W/k+VGJb+1/wAVVcOnqEqDMiYK9f5a5eV1qU/73OvijenaOZhuvQinfVtjVIFes5FA9hIO6wrVvM3sxfsu6VieBpW6oAkcCRTjZqg1JUjNI0kiKVYtkkqUN5Jj8uNXGQiK6kweFdeX1bLa3Fn6qElR7zGg5mmPRDow7jnMqZS0k/SORZP8KeKzw3amu5bKwDGEaDTCAlO+LqUfeUdVHnVkYNiSnRzTYvyXPKheLcDSf8tEKX3FXsp8Jq6YHYuHwqYZbCToVarV3qNzTnF44J9sEJ94XHid1CugG4uDv4+NXKCRS5Nip1Um1JtrXUEm4iny00n2sjtjuo0AWYFMZhwtUWBVAg6SQORnTupiy3voFaIUtPj50UAINRLbmvG17jUlFogMhjKZFjW2KxrqlBpI7ZvviPeJ4VI/iENpLjiglKbkn4DieVS9G8cl8recUW20JEReBqBGhVvJNgKqeBTkXR1MscfA+6MbJyXJknUnjV6wjpAPdAqodBtusYtKwhQztqKVJ5SQFj+FUeGnfZdoPZcse8n41akkuCltvlh+O7QgjgoEbidfWhNn7QLbiW3FSlchKha/ukcanxS9O6KSbVAIvpIPMHcRRoAN0z+SrB4yVtpGGe99pIyKOsuNWE80mTvmuKdKOg2NwBJeazNj/wB1uVIjiq0o/mA8a+jdm7TzJCSr6RKQT/EjcrwNMm8SlesFJsQdx51U8Y6m0fM/QR3/ABLf2v8Aiqrz0sObq+9X4VZdufJm0nEJxWCARBlxnRJEHtNbkm+mh5b6d04WpDMjsrSoC40lSQQQa5GpxtZ4nd0c1PTyS7c/krGPHajlUmATc91H7M2ETimW8QtLgdE9gqTuCgCYEWO7jVY2s44y86htxQAUoARJABMAzMxpM3q9R3e6ijJL2dSfcvRwDS2WUtNKDqM3WOdkA3lIibkDfNS4thzGYgqxHbsSTI7KZshKk6GTa2861LsJRNws/ZNxP/mn6hCBYCb2nTdMk3/PStOOO5nPlKkHbJcZZbS0011QiQkaHeTm3niTepSuO8/uKXOvgBE6Wjw/pNFu2+IPGta4M7PXHQoEHQ0n2Ticji8OTp2kd1GOq31XtpvZMXh1+8ch8bfjRAWUppXtNu4pusUueVnzcrj8qDILUJoTGNQsHiIpsluosUxKe4zQCJVIqJzGBE5zECe8cqcfNr1FjdlhabpBKe0J9f3yogObdJ8a68uFApSk9lB/3HiTVp2Bh2WmM7pUQEyGi4BnzQEkgAKJ1OXgL+yah6Q7K657CZfaddSyfEiCe69dF2hhsJgG2msOlOd19KetVBK1pBWltStcilpAIEJ7UDeaVWm6DwcU2W8/hX0vsK7aTpuUN6CN4Nd7wW0Q8228sKQFBCgki4JvBFI9l9FGGlqUQLKNvGmWIxYVAT7IUB300VQGy0vLk+APpSrajdiaNWqyTxTUT5kUxBFtV9TLbWJR7TKhm/ibVZaTyqwjEAFDqDLa4I4RS/G4ULYcb95JHpVc6IbXhs4Z36p7J4cqBDoWz8fGYe4spP2TcVUPle2SHsC842n6VkpUSNVNBSVGeJSkTPBJpmw/Be5hCvgJ9aNxr8GNetTlg3k5ZFt+lJOCkuSyGSUHcX4+5zzDADGbPPFsSTvtE68ABu0qkdIcWhD+JuoOFcIyxFnCFZpHuTHOKvmOSPnez8hOUpGXkkkQAYvE+lc76UsK+dPgiCV2zawXBB8jrXNwKpNP+8nZ1/MISj3Om9GdhOKw4fC0xEkSQde6/nRWOdlR8qN6NHLs7Dgx2wmO49qkzy+2rko1vwrhs4+R8hGNX2Ed9b4TG9stKNlQpJ4GP/NDYq7fMGaVbRfylpfPKfiKtKyyOc6rHScdtg7w4j4irIVzCtyhVe26PpWh/GPjUIWhzESmgcCcxV31upXZ8KhwdqgAotRXnVzIorJIrQJokA0tWqRCd1EIRWr6IvRAUXaC42iw17rqXBNwQQd3eCPCrlidnfOlNiylsvpeOhkgwEJANwFFOY74VGgqj9IAVbTw+UwrQHhIMHwrqPRfCJYJlUoSgFROqSLz4jyKTxNNCqdgm2lwQbYwykLCFEyUpJO82hR8VA0JtRvIlOXSRVg6ZpzJYc3kZVd5GYD0XVa2g5IA50idhLOhUtoPKvFGtcP/ANNNeKNEh7O6qHjWeqxZG5dXjNVZ6ZMghLidUm/dQIMW1lLa1fwAeSgfgam2ti5xGBSDqFLPcEZaXqeBwgPvFN/WPSh8M4V4tn/tsk+KlR+FAYU7NXL+GzGzGIdaMnQE9Yju0X5VWOmWBcDzuI6pfUdYUh0TlKgsGEqOp7J8jVj2WqcXim/4uuHek9o/dUqqf0vfX1zrZWvIQpQRJKQc5JUEzAMAmY41hlGsz8o6jnv0kH8m1+fydYwTkYfCI4NNnzSn8qR4lzLiHEnkoUyZc7DX/wAaP9opN0tVkfad3KEH9+NbYKoo5kuWHKV2J4GlO20ywqPqwoeH9KZYRUpUKCcuCk6EEGmYBhsLFdZh21cBHlalm3HB85ZTvzekE0N0LxENvMnVtZ8jcH4+VQbaf/x+GHEfgqhZC2K0ArSDRLLcio3EVABWEe3E1MU3pdRDTh3miCgsJrxxNqkTpWxFEBy3a7Dq9pM9SMzgzQJA9lK1k34JCj4V0TGY1thtJClOvvdUhAuEKcuoGPdTdUn3QeANNKgjayTmSkpCloKrgLKFhJjf2iLH10q2JwrrqkqVkbKm/nJcUSerZGcdrnlCSYA9AKEW+gzXBY9ovoWwptBKiyWiVRYnKUzymSarAMnxojY+3kKSthoAJUlSgXDlU5JKioSO0uyRH8MCkez8ZmURO8j1o7doOpecIuURwrUqoLZ+IAdKSdUg1PiHRMCoQ3BpbtZoKQRxEUahV6ixzfZoBKm/iyjAPJOqFIjuKgn/AJUf0ZMlTh4JT5C/qTUGPw8tPpOhSD35VJV+FT7E7LfgSe80GFFcafybTQdy1ZFdy5Qf93pTDF4cF5TgbGdQyk9o24XJ9KWBjrMeke6QryINNcX0hOdYDYspQuonQkaAVz9cpcOPk6n/AB04+8peGOFoy5UjRKQnyEUu6Ys58JnGrZB8NPxFMcartCs6oOtONH6ySPMa10TliHo3is6AfA/CpMWIVSDofiClxbZsRu5gwas2ObmoQQNHq8XmHsvJyn7abj0zVFtMFWNwihuzz3AFX50RtBFpGqSFDvF/XTxrMOtKsSm8w2pQ7iUifWlohcsM9YRW6xSljE5aPOKBFvGmATJbqUJpa/tdKdKGb2spR7I76lkLG24BY1upVA/OLAxWyXwRRsBTcRiEI2y2pYJQG1FYEexlVmmbRGuhGouAKt23Nrt4dtlITnCy8HUzGbDuEF5And1ikKFwUpnnFQ+YDEbRxaNYwLpHeIiPOnmw21P9Vh3kwUKX1bxyypQCSho2taY1CpM80XMhrpDDo0ltCVpWA43Cgy4oDMFRosfUcFp3HUWNIdltAHNxM+tWJezksJU24qGHD1aiBBZczQ2oAfVz2A3GU6KACvZLEDKqMwJBi4kGLHeKtkxBjP0xH8NFJtQSVf4n+WKKcXrSBC21iiMQiU0pU4QRTfDLkVAlfxCZSsH3FD0NC7NX9H3mn2PwUBSgdUqt4GqthX8rI7poVyEg6Koz4907kiP35UnfeT1rkmO2rW31jTr5Olz85fO9ZjuF652drYhBJJS4nW4zC95kQYrNqI70jTpsixttnWsae0KkwrkKFD7QPaFaoVetRlKjtJv5vtQ7kuHMO5Yv/rBq2OG1I/lGwpLbOJTq2rKr7J0Pgof6qYYDFdY0lXEUAgm0IB76X7CT9M4d6UhHgSVD8vCitqHsmgOizmZT5P8AAP8AdU7kH5NYVVqo14lVQhCWpN6Pw8AQBUJReiUijQA5Xs15hdK2HsitMObGoQR9EcWE7ccn2VMqb8YCgPHIfKuhHDJKUJAspsJBAiFoEpI4H6PNP/bTxrmHRt0K2hikaFSU5F7kuJu3NrBR7J7+dXNja6vmgXcLbeaCgYsM6UuI78s376X4akT4riSY7FKf6omIfQEr4dYQW1EfzJnw50l2VhFtqCTfKopJ4wSJ8YmoH33MOvBYdcwX8PlVuUc7XWQf5lW/iHEUxQtSnlKT7Gcxex3n1NWtpoBKpX+K5QPhReJbg0ucV/ifKm+NRakYQbEewDXuGx5SdLVqLoIqJSIoEDH8SVDlCvgaoW0cZlYmdEesVeQOx5/A1zfCK651KfqIIJ5kaD8agS59BMEWsIlCtVBSz3qvHhaufJJcLIRKSGUNmSDdAVJGUnsndXV9mJ7I4WnxNcwd+jfSMs5ERlvqM4jjaPSqMvYuxl72luND5qI2lpQQVYVoKA5zDDEMOMK0WkgcjuPgYPhVU6KPKDamlWUglJHAgwR51ZcK7lNLNrYTqsUXU+w+J7nBAUPEQe8qoMIFtNwwaH6II7LquLnwSP617tZdjWvQ9f0SvtKPrUXUjHqzWorxRqN5UCoQJz0UzS5lUkCjcPIkGiAZDShmF2PjU+a1LyuAfGoQpuAxRZxbz4ggKCSlR7K0mcyFciPIwd1Xzo7tBLjwQFgtrSlztpzBQmGnbfXS4QFHcUKP2aEhoELXlzFThAAEkkwAEjeSd1XbY7CsBhuoMF90qPtxlJBCmkKSd2tplSHdREnoiMKxmJZWhSOrUtLSg63dWZt5KW0NkLEZsoRJIsDmGgICzoiVdXBtlUbHwv460dh8V80CHNGwlLhJHtNmOuBk+2ZzHcFxrcDTDPqOJcKWylrN2U+43JAB4aFRG4qIo3xSQtU3ybPr+nJ7qsGIumq3i1fSqI0tVlF0eFAYXJVUpuKgfEV62u1KQkSOyfH4VznoqkApSPPid5rooNj4/CuZdEXgpaU79RQGOqYcQyTzHpXOMYCjH4lIjsqeI00MqFhEWUNeFdGaJ6oeNUjp67/jSSAP8IlQKSoSCPrX1zZtLG1U5uiLcXUsWP0pcKZYvSgCmtBSahd6PdYD7Jb+sO0k8FDT8vGloNG4F6CKhClbXfISQqxEzO4jUVnQ13skHvor5T8NkKXE6O2VyUN/iPgaVdGlx40i6hLfmrQjMoCvG7iiGG4uacBiwlFgZUbdwohbmgAvxoJu6po1aoogCQZTQGJWA2o99FoPZpZtNf0K+40CBPQbCIZb+dvg3UUsIT7ajBko4LIkZvqJCjIKhC3pe84XU4pQSChaShA9gFGUhCdOwnsgq3nhEBrsdqWGnCRKWw2gkQEJjM4oDzJOqsgixAqDFYP56+1hx7ISCR/Dm7KCeKrqJ3wrjTxjfUDdKxVtpZxjTymiepbIyJ94FSVKzQbpASrKI3TeRF1Q3lUhlUpK2gpR35pJUPGfWg8FgENoxRIIScQEp5plKRA5lz4Vaulh7eGIT/7awSY4NmLE8TSS4kkvkSPKf1/BTsWjK4asWEMoHdVfxZlau+nezFdkUQkGKFqgaMUdjm99LhrSsJO6YQo8j8DXLehDoLyRvrqGJX9C4eCFH/STXLuhuFHWJVvpWE7OhvsCSNK518oOzHl4hlbSCQtgIUdAMq1i5kbiKtLDCt5gcK02mqW2hrlzj1mqdRPbjtGjS41kyqLPMRpQyKysrSZQR9XaFboNZWVAizpkz1mEUTqghQ7xP/Eq9Kq2yjAFZWVX3CWbBuzRmJehIA1Nqysp0A3wyIij16VlZTsU8SuEmlO1VfRK7qyspQh6FFbDTekpbEz46d6RTHoenInEYj63sp4j6iT4GT41lZViYk+31N9uK+kwOESYDq86jylIA5xnSe9Ap/0q2hmdabygAEeSguw+6K9rKp/2Y6+Eq2JHaV3mmuzFdkVlZTEDX0yk0mfbIOtZWUGEgxjp6h4cWnP9hqkdHzlgjdWVlKwnRtnYtKhEGYmTFD4wiYIn4XNZWVj1z/S/c3/8cv1v2P/Z\",\n \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExIVFhUXFxgXFxgXFxcXGhoXGBcXFxgaFxcYHSggGBolHRcVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGBAQFy0dICUtLS0tKy0tLS0tLS0tLS0tLS0tMC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIANwA5QMBIgACEQEDEQH/xAAcAAAABwEBAAAAAAAAAAAAAAAAAQIDBAUGBwj/xABBEAABAwEFAwgHBwUAAgMBAAABAAIRAwQFEiExQVFxBiJhgZGxwfATIzJTodHhBxQzQlJykmKCotLxk7JDwuIV/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAECAwQF/8QAJREBAQACAgICAgEFAAAAAAAAAAECEQMxIUESMgQiURNCYYGh/9oADAMBAAIRAxEAPwDTtSkSMJAaj3j+G7h4qTCj3l+E7h4pZdU52csbIYAn4TVn9kcE8mQIIQjCANGEIRoAgjQhHCAII0EIQAQARwjQBQgjhEgAotNvrXGDoFKKjt/EPV3Je4D8IAJSJMCREI4QQBIkaCAIopSkSASQgjRoCLCOEGhGEApMW8+rfwUiExeH4T/2lLLqiHbP7ITgTdlPNHBOpgEAEEoIAJQQCOEASNQ72valZ2Y6ro3D8x4Bc15Q8t61aW0yabNzTziOl3gErTkdJt170KX4lVjTuJz7Bmqity4sjTAc48GnxhclNQnaTPxRYQo+VVMY67Z+W1kcYxub+5pCvLLbGVBiY4EHaDIXAnADP/nbtU24+UFSzVA5jstrc4I605kLi7wklVtyXzStDA5jgTAkbQTsIVmVSBQozR6w57vj/wAUguUcR6Q74HYj3AlIigEcpgUIoRyggElBGggCRQjRSgBBQQQQEcBGEUJaAATNv/Df+09yfATN4D1T/wBp7ksuqIVY82Ajcn4UW7G+rbKmQnATCUEAEoBACFTco7/ZZWZw6ofZb4ncFPvS3soU3VH6NHadgHSuMXzejq9R1R+rjkNw2dQSOQm+L1fWeXvcST5gDYFVqQKZ1Tbzhz88EqqDYY1PX8ktnO2c0bNpPSo1Jpfmcmjz1lbHkrcnpHBxbzRoseTL4xrx4XOodi5NVarZiBs+iat3IyqwTM9C63Z7O1oAAhN21jSCuK83JLvbsnHx3xpxW7rfUovyJY9p1HjsPBdk5MXy200Q7IPGTx07x0HVc15X2LBUxtGuqPkNfPoq4acmv5p6DsPneu3i5PlJk4uXj+NsdfIUcD1hP9I7ypDDKaa3nnPYFv7jA8gQgBGqEJgIQQBQQBII0RQARFBBAEghCCAYBG9D0jd47VWC4qH6P8nfNOtuOz+6HafmgJv3ln6m9oUa3W2mWOb6RskEahBtz0RpTb2J6nYabdKbR1BK+QFmtNNrQC9oyGrgPFLFvpe9Z/JqN1lY72mNPEBELDS92z+ITA//AOlR97T/AJj5oC86Pvaf8gjFip+7Z/EKHfb6NCi+o6mzmg/lGZhAYn7Qb5FR4pMdLGZ5bXfTxWIY0uMdqk2uqXkvdliMno2wEzReYOERP5jo0fNSrR6tUDctTsHnRRPRyZf1NG3gPFP+gwzri2k6/RP2Gi2ZeZ3nI+Km3UXjj8ql8nbuFaqA5zQB+We5dauuwtptACwtmstB4bmGuGh9l3x1C39ifLJ3DasLPl5dk/WaSi0KBa6JVTft7ENLGOhx27Qqq7qdT2qlesf7oHUubOS9NMJYZ5XWLFRJ/M3MLm1C0Q+V1m8hLIxY2nKTGIcY1C4/ahgquafyuI6lr+J7xZflTrJ3Dk9fvpKLSWPJAAloxTs2FW9GsSXPNN0QIGWI9Urn32bXzhPoXHI+yek/WO1dNxLsx8uHKaqGLeNjKnU0fNH98PuqnYP9lKlDEVaUT74fc1P8P9kPvbvc1P8AD/ZSpQlARHW13uan+H+yL7473L+1n+ymYkEBD+8v9y/tZ80g2t/uHz+5qnxKjUH85w6SkDJtVX3B/mPkgpiCYMRt2pRbIRBKCAUAjCJHxQBgJQSUbQgFgLCfahejWsZRnnE43AbGwQOsmexbirVaxpe4w1oLidwAkriPKq0mq/0zvbqOc+P0snDTb/iewHalTipqV8RiBA+Cm2SkKjiXT6Om3EQMp3AcVT0zvVxdIL2vYNXuY0duff8ABK+IvCbqzu6xi0VnZxjeS2cpBzynU9CvrRyLpBjg5xDthy8R0raXZcLKdBtPCDlnIBnjOqQ+4m7JaNzXPaOxrgFnbZ5dOPHNaY+5bj9G0MxyNIdLuzo6FZ3fYrUalb7vaQygwNaA5npAakS8MzBDRLdDEkhXLLhaTDqj43Y6ndigq1ZSZTYGMaGtaIAGQ+CjesbWlx3ZHMQ2sfSOrOD6rajmFrThGWhAyyIIOc6qFVq2rHzaVINA1w69cytba7tD6pcJBOsRmRpIORyy35ao32B4+ktH/wBlhjyzV8NMuG+FTc1F9RpdDqfRMx1HIhc8vtpNZ7iRONzTGktMSOgrq9SlUDYbgaI1kv8AhDVym/qYZWc0OLgHGSYkl2bjllqr/Gs+dYflS/GF3PbzSqtOwEfVd6uW2CrSa4GctV53DV2H7N7YXUWtJGhHTLcu7CuvquTuNrKCNEVSBShKCIFAGihBBAE4ef8AijWb2ncT3qR2KNS9tyXsJSCQSgmDYKWEhqWUApoRykNKNoCAWjBSUpqAqOWAJsj2t1eWM/m9rfFcx5TUJqADTE5jRubSaxrY45nrK6xfzMVnqZZtGMcWHGPi0LkdqdifJ0bLR+4mXfAnsU1UZ2208Lo6O5aj7OrIKlopjY0l5/tAj4lZW21JqO4eC1n2SVALYQdTSMdRbKMp4Xx3WTtAdCpr1t7sQYz2jkrkhZC8LzNnr1Hmi+pm1owxDAdpnSSRn0LDO3xHZxe/G15SouptyhzozkxPAqPed7tpM5zYMKa5loIn0TOGMk6TrEKjvJxafWWdxynYct/BPPHWOpF8cuWW/F/2g2K9RUBIBka5EK4s1pBHQqQ26mwc5rqc5c4QMxI52idsROeciCQRpHkrz5426r/lOt1QEELh161MVVx3kntJXX7fWw03vdoGk9gXF6tQuJcdua6vw55tcP5tmsYk0c2hb/7LrSRV9GTkcxxiPDuXPrK7YtjyHqYbTSO8wev6wuvJxYuykpKJAq0DQRSggAiJQAQlADsUVntuUoqLTPPd52JezSZ4IkXnegmRCUEkFGEAsIwiRA9BQDiNpSAlhARr2rBlCq46BjjH9pyXHbecLWt2xidxdn3LrXKIj7u8HQ4WngXAFccvKpJcdwgdQgdyzz700w6UVQSSd8lSbjvN1mr06zfyOBI3jRw7CUVZkDq+QUCqVpEdPSV2XgyvTbUpuxNcJBHnVOCytJeSJxgA9XkLln2UXg5pfTklpM4dkxs3Lq9nqhwWOU8urHK62i4KtIHBVdGwEYhERGemmxRrVf1TORTGUaO087FaV6eSqrRZSdYSzz1G2Exv2m/+KO3YrUPR1CHU8phuEH2csz/SpXoG0mBjRG4bmjyE6KGHMqjv6+G0mue46DIDVebllcstR0/rOvEVnL+8wyzmmDnU5o4fmPZ3rmbQpl63i+vUxv4NG4JgNyXp8PH/AE8dPM5+T+pludEU9QtRyYqYatM7ng9UhZqjTkrRXNSIfT2Avier6hVydIwdwDtEUqDdVox0WO2xB4jIhSsSqVFhyUYKalHKZHZQSQUpMCJUZg5587FIJUVvtnzsSvcM/PWgkngjQEVtWp7sfy+iUKtT9A/l9E8EYTIyalX9Df5fRJfVqjPA2OJ7Tkn2uz2fVKqnmnKcikDNM1SJBZ8Sl+t/p7Siu0+raOhSpTgUHKqrUbZ3zhAETHEH5Lklvybx8f8AhXTftAtEUA39Ts+AE98Llt6PyA6fos79mk+pitnHCe0mFAq6qc53NnjHAZKOGz2K4hp/s6qxVPUuugH2mnP4FcT5HV8FboK7Pd9cECFF706MPpKfrW8tHOaRwzCq7RfTQCrK0skLK3pQgrDm8OjiuyLbfLn5NGZ2rL8qW+qdOZhX1Bmao+V7vV4RrI7FycX3jbk+lYylQkblL9CIzPZ9VFcnQeacl6leVDragGTR1q+uCliqNExmdenb8FmLOc81q+Rr8TyDqIPUMgRwn4qMouVvLibUaXMFQD8w5s5HXw7VbGlU94z+B+aqQcD8X6TPFp5ruw4Vel3YlL6Tf5R/QVffN/j9UXoq3vmf+P6qRCMFVKWjAp1/fM/8f1SxSrHWs0cKfzKeBSwVZI/3V/v3fxb8ks2RuGMbydZmD8E5KMoCN90PvqvaPkgn0EAkJUpAKUEyHKOoTBHFJDvO1EZ53Dw1SBq6XTSapT/Peol0/hM4Ju/bxFGmXkiQDA2lE6P2xHLy346uEaMEDic1z621ZKub7thcXEnNxJPFUD96WM9qy/hJb+GOJ+KRTbI6R3J2ieaAd2aToQelUlM5Pj1i6pcVfICejp6lzS4qE1JXQ7kZgfG9c+WX7Ozix/RqC/JUl5NkqxfWhRzTLjCzzvymmmGPxu1UKAa2SsLylqZuPT4QuiXzSwtC5vypcPSBo2a8Vnw4furmy/Rn3Dz1J0jmwkOCdiIXbXnwwwQCpVhtjqbg9uRaclFqd6OimHUbs5QMrUxOThsO3eJGoPfCv7mtYewtBnDkDrzfy/LqXIrutBa7IwtTd9sLYqMJBHtCdm36cFz5WytZjLHRCgqez3oSBMFSrJeLXmIg7AnjnKi4WJ4KU0+ZKaBQDlrKg9i6kJSQgqIZ4x1AoIkEjEECY0ScXn5JQVpG07VBtN8Ma7AA5xg6AR2/RP2+rhpuPUOJyWYpj1kf0z2n6KbVSLOlbHhoaDA+PaqLlFWGCCcyZ7FZlZvlQ8kYRqASflxKV6VGLt1bEZ3qOwTASq+vwS6O74qklNOcHQ6dG5KZtG3d0pqp807Z+cRvyB4b0g0/J2z5nbHyW0szZIMRCzXJOuwOc0kYjmBt8/JbqiwQCuG2/OvU45PhBWjYVOutgiVFrUpCVQcabZOxGFszVnjLjqK7ldag3pOjR07T1Lktvq4nuM7VtOVtvIaXEiSMLd/HoCwjWzw1XRx4+bXJz5eJiMDakASUp5nPYE1UqEZbTmehaOYKrJ9kTG1M0xtVxclCZnannXVrG9KZzejuPtWFu1WVgtxYROm/5qLWoFuRG1Bmo+PySykPFurtfDG8AnKNpwFr9zj2YjPwVPc1pIaWH8uh3t85KSx80x0ie3Nc1jZusU55dBSmnzPgq+5a+Oi07RzT1Zd0KaD5/wCLolc9mj0o0gHijBWm0lDzqjSEaQAJQTYS8S0Srr9qQ1o3mewfVUbDFTizuP8A+lY35VmoB+kfE+Qqi1uh1N3ThPB2XfCmriVXqZZHNVtS7gWkkknzKlWl6fomQOnJGjcxvCjge4HeowdEqz5WUHtqkmI6BHR2qnpuTk8J35LBJ0T9kMEJttNwzAT1ldLhxSpxZWx7qdSnUGToxdc/VdXuC1trUWvboR2HaO1cyvuzl3ocIJObcuAPgtV9n7X0sbKjgASC0TnMZ9G7Jc2XxuMvt1cVymVnptS0hVVtvBrjgJwkHnA5ZajPQyl31e3om4g3EB7QBEjp4LC8o+UjKrcLWNJOZOrhvAMCFGM3XRllJN1A5V2xtSocJEDTuWde/YO/vTNprkn5pjEuvHHUefnn8rtKNTt2DZxKSznO35p+xXW+o3EAru6LlIcC4aKcspjCxlqwuW78Lc9SrA2fPJS7PSgaJbmb44rnxttb3pnr5ojmt2kE9w7yFQGWk9BWkLm1bQS10tptji45njqOxUVsp5u4nvW970ziypVIbiGxjvCFb0smNG4DuVK1pFMf1EDqlXWyFhWk7XfJiv7bP7gPgfBXgKyVzV8FZsmAcj1j5wtO61s/Wz+Q+arDpnnPKU0pagtt9P3jP5BLFvp+8b2hbRml+dUFGFtp7HTwDj3BEmRQso/W/wDkU42xs3HrOaUClNPBaJZq1x6R0aSQOrLwUK8KcsIGuo4jRP4pz3pFZyn0uGXVMTGu3gFP2R8t61Asj+Y9v6HHsPOHeR1J6wVETsIHKaxB+UbZ7cvPFZi03Lh9mZW8vMaO3a8NqgNsuclFy0Pixhut4jNWlhuZ2ISNY8VqKNjaToprbNmDCNbHSlvCjgDD0gduSWyqdNqtrZZG1HU2P9lz2tPRJAmdkaqbePI20t9kMqD9QIYf7gcusHqC5rxbt06cOWSTZN1Wr0wDXAOcIGYBmdNUvlNcLvQucGtwgS6MiAMychsWPsN9V6FY4Wslj85kjmmCAcssldcovtHdVovoU6GB7wWvcXYgAcnYAAJkTmYiVOOOcuovPk8b9Oa26zw8gZ5nPeiFiOHEd4A6yrm7bO6s/AC0OjLm65geK1NLkFa3sxvdTFNvPOwnDnAEZrs36ji179Hbvu4MpNEbB2qbRpQn35ABE0Lny+zbHoA0KNaLKDm4mBrnl1hSWqPelSKRG13N7dfhKU8HVDcVDE6o+YxEkcJy+EKDbLJzyNkrRXVQwzwVTazzz+5GV6GM7N1WfhD+qewFWrjkq+p/8fE68Cp4iFN6OdmS+HA7s+xbMYdQ1u/2W/JYqtqtZd1WaTD0ATwy6tEsbos4mB3QOAaFF9IfSjT4DZuTodwjqz4qM9/rm5RkdI3LXHLyzsWwqlBRsSCey0fBSbRUhjj/AEnuQBTF4uim7h3mFuzUARVSlJqrtSWi0m86p0hp/wDZJsTsyEumeeRvb3EfNMUDz1PsLa2slqg2V8sg6tOE+B7O4qyqCW9SqKQw1Oh2R47D53pZTaosrLopbVFpFSmlGF8DKGrYOblrsXQLnvB72NJbkQCD0ESsFWHNWy5IOxWdhnQFvYSB8IS6zHeKk5RcgKLzUrMc9pOJ+BsQXwTlukrkLaJAk6lel20OlZat9nVkfW9IQ4AmSxrobPeOAIC6PjLPDK2sd9mfJb0j/T1AcDcgNMTt07ht6T0FdSv5wZZahEezhHRihsDtVnYrJSpMDWABoEAAZAcAs9y2tMUg0fmcPgCfkjGfGWi3eowld2aNuiTV1RgLi9uktuSq7dVxVMI0Z37fBT7TVwNLt3fs+Kq7M05k6nNTf4OfynUMmkrOWo84/uWidIZ1LN2jXr8UZdwTqlWp8ej/AHH/ANSrGhoqq2nOnxPcrKzHJVei9k1jmtDcVWaUAjIkdx8VnawlW9wuIa8a6HbtkeCyisulySVDru9czzsT5d5n5KFaXD0tMePQVUvlnVoKvkIJtrign8hpNaelRr0d6o8R3hPB2Sh3u71f9w7iuxgpwUh6W0pNUpLQKb4rNG9rh3HwSRlU60zVd6+l+6O0EJ605PSgq8PsqG6hJUph5o4IU9UXs/QqDZOexSQo5HO4p9miNao3uCqHJXnIa1ECozc4OHWPoqOpopvIx3rn/tB/y+qzzuspVY/WuhU7QUsPKjUSpDRkuueYxpc7ysny1fnTH7j3ALUvWO5YO9Yz9viUZ/WjHtminaZTYKOs7CxxGoBK4nQgXjWxPwjRuZ4+e9CkFDsnsztOZ4qZZBmsu6v0kWowxZesc+taW8TzVmK2xPL7FOgt7s6fE9ytbK7JU1sPPp8D4K3swyV/2p/uLeVPuZ0PInVvcfqq6qVLuc+sHA9yxaXpeE+fkoFpHraeW3wKnuVda3c+nx+aGafKCEIKdnp//9k=\",\n ],\n };\n this.handleOnClick = this.handleOnClick.bind(this);\n this.handleOnClose = this.handleOnClose.bind(this);\n this.obtenerMensajeRango = this.obtenerMensajeRango.bind(this);\n\n this.handleOnChangeUpdate = this.handleOnChangeUpdate.bind(this);\n }", "function cargarInformacion(){\n $.getJSON(\"js/attributes.json\", function(myData) {\n attributesOfficial = myData;\n new Vue({\n el: '#cont-myAttributes',\n data: {\n todos: myData\n },\n methods:{\n addAttributesGlobal:function (argument) { \n for(let i in this.todos){\n for(let j in this.todos[i].attributes){\n if(this.todos[i].attributes[j].uid == argument){\n var index = isContenido(attributesGlobal, this.todos[i].attributes[j].name); \n if (index > -1) {\n attributesGlobal.splice(index, 1); \n }else{\n attributesGlobal.push(this.todos[i].attributes[j].name);\n } \n }\n }\n } \n }\n } \n });\n $('.i-checks').iCheck({\n checkboxClass: 'icheckbox_square-green',\n radioClass: 'iradio_square-green',\n }); \n });\n $.getJSON(\"js/arquitectures.json\", function(myDat) {\n arquitecturesOfficial = myDat;\n new Vue({\n el: '#cont-myArquitecturas',\n data: {\n todos: myDat\n },\n methods:{\n addArquitecturesGlobal:function(typeUID, argument){\n var control = true;\n for(let i in this.todos){\n for(let j in this.todos[i].arquitectures){\n if(this.todos[i].arquitectures[j].uid == argument){\n if(control){\n var index = isContenido(arquitecturesGlobal, this.todos[i].arquitectures[j].name); \n if (index > -1) {\n arquitecturesGlobal.splice(index, 1); \n }else{\n arquitecturesGlobal.push(this.todos[i].arquitectures[j].name);\n }\n control = false;\n } \n }\n }\n }\n\n //Esto lo tengo que hacer para controlar la vista\n for(let i in this.todos){\n for(let j in this.todos[i].arquitectures){ \n if(this.todos[i].uid != typeUID && this.todos[i].arquitectures[j].uid == argument){ \n caja = document.getElementById(\"caja_\"+this.todos[i].uid+\"_\"+argument);\n if(caja.hidden){\n caja.hidden = false ; \n }else{\n caja.hidden = true ; \n } \n } \n }\n }\n\n\n arrayUidAttr = [];\n for(let i in attributesGlobal){\n uidattr = getUidByName(attributesOfficial, attributesGlobal[i]); \n arrayUidAttr.push(uidattr);\n }\n\n for(let i in this.todos){\n for(let j in this.todos[i].arquitectures){\n if(this.todos[i].uid == typeUID && this.todos[i].arquitectures[j].uid == argument){ \n peso = document.getElementById(\"peso_\"+this.todos[i].uid+\"_\"+argument); \n if(peso.innerHTML == \"...\"){\n peso.innerHTML = \"\";\n my_scores = getScore(arquitecturesOfficial, argument, arrayUidAttr); \n var rta = \"\";\n for(let k in arrayUidAttr){\n rta += getNamedByUid(attributesOfficial, arrayUidAttr[k])+\": \"+my_scores[k]+\" \";\n }\n peso.innerHTML = rta; \n }else{\n peso.innerHTML = \"...\"; \n }\n \n\n } \n }\n } \n \n\n }\n }\n });\n $('.i-checks').iCheck({\n checkboxClass: 'icheckbox_square-green',\n radioClass: 'iradio_square-green',\n }); \n }); \n}", "function createVis(data) {\n const canvas = d3.select('#GA2').append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"id\", \"svg-ga2\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n const nested = d3.nest()\n .key(function (d) {\n return d.COD_REGION;\n })\n .key(function (d) {\n return d.DEPENDENCIA;\n })\n .entries(data);\n\n console.log(nested)\n\n const regionIDs = nested.map(function (d) {\n return d.key;\n });\n const dependenciaNames = nested[0].values.map(function (d) {\n return d.key;\n });\n\n x0.domain(regionIDs);\n x1.domain(dependenciaNames).rangeRoundBands([0, x0.rangeBand()]);\n y.domain([0, d3.max(countDependenciasGral(nested, dependenciaNames))]);\n\n\n canvas.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"x\", width / 2) // x-offset from the xAxis, move label all the way to the right\n .attr(\"y\", 26) // y-offset from the xAxis, moves text UPWARD!\n .style(\"text-anchor\", \"end\") // right-justify text\n .style('font-weight', 'bold')\n .text(\"Región\");\n\n canvas.append(\"g\")\n .attr(\"class\", \"y axis\")\n .style('opacity', '0')\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90) translate(-200, 0)\") // although axis is rotated, text is not\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .style('font-weight', 'bold')\n .text(\"Cantidad\");\n\n\n // Adding a title\n canvas.append(\"text\")\n .attr(\"x\", (width / 2))\n .attr(\"y\", -7)\n .attr(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"18px\")\n .style('font-weight', 'bold')\n //.style(\"text-decoration\", \"underline\")\n .text(\"Distribución de alumnos vulnerables por región con respecto a dependencia.\");\n\n canvas.select('.y').transition().duration(500).delay(1300).style('opacity', '1');\n\n updateData(nested)\n\n //Legend\n const legend = canvas.selectAll(\".legend\")\n .data(nested[0].values.map(function(d) { return d.key; }).reverse())\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d,i) { return \"translate(-600,\" + (i+5) * 20 + \")\"; })\n .style(\"opacity\",\"0\");\n\n legend.append(\"rect\")\n .attr(\"x\", width - 18)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", function(d) { return color(d); });\n\n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) {return d; });\n\n legend.transition().duration(500).delay(function(d,i){ return 1300 + 100 * i; }).style(\"opacity\",\"1\");\n}", "function dataTreatmentForChart(arr_datas) {\n // on parcours le tableau suivant : [arr_joint[0], arr_france[0], arr_belgique[0], arr_suisse[0], arr_canada[0]] (sans les statistiques)\n var res = [];\n for (var i = 0; i < arr_datas.length; i++) {\n //Pour chaque tableau on crée une copie dans current_array\n var current_array = JSON.parse(JSON.stringify(arr_datas[i]));\n //On prend sa longueur\n var len_current = current_array.length;\n for (var j = 0; j < len_current; j++) {\n //On fit le tableau\n current_array[j] = fit(current_array[j]);\n }\n //On flatten le tableau grâce à une copie de celui-ci\n var flatten_array = flatten(JSON.parse(JSON.stringify(current_array)));\n res.push(flatten_array);\n }\n return res;\n}", "function dibujarFresado123(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\t\n\tvar fresado4 = new RVector(pos.x+alaIzquierda,pos.y) \n\t\n\t\n\t\n\t\n\t\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y) \n\t\n\t\n\t\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado12 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\n\t\n\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){ \n\t\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){ \t\t\n\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\n\n\treturn op_fresado; \n\n}", "function cargaCombosDependientes() {\n\tcargaCombosMarcaCanal();\n\tcargaCombosClientes();\n\tcargaCombosZonas();\n\tif (parametrosRecargaCombos.length > 0) {\n\t\trecargaComboMultiple(parametrosRecargaCombos); \n\t\tparametrosRecargaCombos = new Array();\n\t}\n}", "function leerDatosCurso(cursoAgregado){\n\t// Obtener datos relevantes del curso agregado\n\tconst infoCurso = {\n\t\timagen: cursoAgregado.querySelector('img').src,\n\t\ttitulo: cursoAgregado.querySelector('h4').textContent,\n\t\tprecio: cursoAgregado.querySelector('.precio span').textContent,\n\t\tid: cursoAgregado.querySelector('a').getAttribute('data-id')\n\t}\n\n\t// console.log(cursoAgregado);\n\n\t// Información obtenida del curso, lista para usarse\n\t// console.log(infoCurso);\n\n\t// Pasar la información a un formato de HTML\n\tinsertarCarrito(infoCurso);\n}", "function flotLoadSecondaryStructure() {\n // clears graph between loading files\n organizedData = [];\n for (var j = 0; j < rawDataOriginal.length; j++) {\n var tempChar = rawDataOriginal[j][1];\n organizedData.push( {\n data: [[rawDataOriginal[j][2], rawDataOriginal[j][3]]],\n labels: [tempChar],\n });\n }\n}", "function draw() {\n cenas[cenaAtual].draw();\n}", "function dibujarFresado111(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0 ; n<5 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\t\n\t//Puntos trayectoria \n\n\t\n\tvar fresado11 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior) //nuevo\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca) //muevo\n\t\n\tvar fresado23 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\t\n\t\n\tif (anchura5>pliegueInf5){\n\t\tvar fresado14b = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5-alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado14b , fresado23 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }else{\n var line = new RLineEntity(document, new RLineData( fresado15 , fresado23 ));\n\t op_fresado.addObject(line,false);\n }\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado22 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n var line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n } \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n } \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>(pliegueInf4*2)){\n\t\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n var line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t//anchura4 - Inferior\n\tif (anchura5>pliegueInf5){\n\t\tvar fresado10 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado11 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n var line = new RLineEntity(document, new RLineData( fresado10 , fresado11 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado29 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2){\n\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado45 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado46 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado45 , fresado46 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t//anchura5 - Superior\n\tif (anchura5>pliegueSuperior){\n\t\tvar fresado49 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado50 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado47 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado48 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\treturn op_fresado;\n}", "function loadModel() {\n this.model = DiagramService.get();\n }", "function loadData(id) {\n if (conf[id].customFont) {\n var font = new FontFace(conf[id].fontName, `url(${conf[id].fontPath})`);\n font.load().then((f) => {\n document.fonts.add(f);\n fontPath = conf[id].fontPath;\n });\n \n }\n else{\n fontPath=null\n }\n fontName = conf[id].fontName;\n color = conf[id].color;\n fontSize = conf[id].fontSize;\n xAxis=conf[id].coordinate.x;\n yAxis=conf[id].coordinate.y;\n defaultcoordinate=conf[id].coordinate.default;\n previewText.style.color = color;\n previewText.style.fontSize = fontSize;\n previewText.style.fontFamily = conf[id].fontName;\n switch (id) {\n case \"time\":\n previewText.innerHTML = new Date().toLocaleTimeString(\"en-US\");\n break;\n case \"day\":\n previewText.innerHTML = days[new Date().getDay()];\n break;\n case \"greeting\":\n previewText.innerHTML = \"Good Morning.\";\n break;\n default:\n break;\n }\n document.getElementById(\"hex_code\").value = conf[id].color;\n document.getElementById(\"font_size\").value = conf[id].fontSize;\n document.getElementById('x-axis').value=xAxis;\n document.getElementById('y-axis').value=yAxis;\n}", "static async setData() {\n\t\treturn { max: MAX_CAR, dark: false, cars: [], history: {} }\n\t}", "function dibujarFresado110(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\tvar fresado11 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4-alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }else{\n var line = new RLineEntity(document, new RLineData( fresado14 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t var line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\t op_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n }\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n var line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado29 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior){ \n\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t\n\t\n\treturn op_fresado;\n}", "function load_dataset(csv) {\n var data = d3.csv.parse(csv);\n dz=data;\n create_table(data);\n progressUp(\".progress-bar\", 50);\n loadHisto(data);\n //console.log(\"1\");\n setChart(1);\t\t\n \n d3.select(\"#visuelChng\").remove();\n notif();\n \n var uli = $('<li></li>').attr(\"role\",\"presentation\");\n \tvar test = $('<a></a>').attr(\"id\",\"visuelChng\").click(function(){\n \t//alert(chart);\n \tsetChart(changeGraph(getChart(),dz));\n \tnotif();\n \tuli.addClass(\"active\");\n \t\t\n });\n test.html('<p><span class=\"glyphicon glyphicon-refresh\"></span>'+' Changer de visuel</p>');\n uli.append(test);\n $(\"#tools\").append(uli);\n \n console.log(\"%\"+chart);\n //console.log(test.parent().html());\n \n progressUp(\".progress-bar\", 100);\n}", "function dibujarMarcadorUnico(coordenadas, estilo, sourceCapa) {\n sourceCapa.clear();\n var marcadorPtoInteres = drawFeature.getMarcadorByStyle(coordenadas, estilo);\n // le asignamos un id para poder recuperarlo mas facil\n sourceCapa.addFeature(marcadorPtoInteres);\n }", "function dibujarFresado115(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=1 ; n<4 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]) {\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1) {\n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)) {\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)) {\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4) {\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function copyData2Form(form, statut, acteurcourant) {\n form.id = globalDAData.id;\n if (globalDAData.bdc != \"\") { form.bdc = \"BDC n° \"+globalDAData.bdc; } else {form.bdc = \"\";}\n form.fournisseur = globalDAData.fournisseur;\n form.statut = statut;\n form.demandeur = globalDAData.emetteur;\n form.typedemande = globalDAData.typedemande;\n form.nature = globalDAData.nature;\n form.contactfournisseur = globalDAData.contactfournisseur;\n form.buimputation = globalDAData.buimputation;\n form.codeprojet = globalDAData.codeprojet;\n form.nomprojet = globalDAData.nomprojet;\n form.quantite = globalDAData.quantite;\n if (globalDAData.prixtjmachat != '') {\n form.prixunitairetjmachat = Utilities.formatString(\"%.2f\", globalDAData.prixtjmachat);\n } else {\n form.prixunitairetjmachat = '';\n }\n if (globalDAData.prixtjmvendu != '') {\n form.prixunitairetjmvendu = Utilities.formatString(\"%.2f\", globalDAData.prixtjmvendu);\n } else {\n form.prixunitairetjmvendu = '';\n }\n if (globalDAData.marge != '') {\n form.marge = Utilities.formatString(\"%.2f\", globalDAData.marge);\n } else {\n form.marge = '';\n }\n form.collaborateur = globalDAData.collaborateur;\n form.datedebutlivraison = globalDAData.datedebutlivraison;\n form.datefinlivraison = globalDAData.datefinlivraison;\n form.adresselivraison = globalDAData.adresselivraison;\n form.conditionreglement = globalDAData.conditionreglement;\n form.urldevis = globalDAData.urlDevis;\n if (globalDAData.urlBDCpdfsigne != '') {\n form.lblbdcsigne = \"Lien de téléchargement\";\n form.urlbdcsigne = globalDAData.urlBDCpdfsigne;\n } else {\n form.lblbdcsigne ='';\n form.urlbdcsigne='';\n }\n form.acteurcourant = acteurcourant;\n}" ]
[ "0.620861", "0.61527145", "0.60866874", "0.59810466", "0.596609", "0.58920014", "0.58885497", "0.5867257", "0.5858546", "0.5843594", "0.5837693", "0.5755298", "0.5740153", "0.56945264", "0.56882226", "0.56734955", "0.5656469", "0.56556016", "0.56403524", "0.5639397", "0.56383765", "0.5629862", "0.56048393", "0.56032217", "0.5589058", "0.5585358", "0.5516672", "0.55121166", "0.55066997", "0.55043787", "0.55035764", "0.5502725", "0.54923743", "0.5488473", "0.5482863", "0.54635483", "0.5445752", "0.5445175", "0.5435409", "0.541857", "0.54080296", "0.54043776", "0.54041064", "0.53849083", "0.53840274", "0.53801346", "0.5376997", "0.5376572", "0.537413", "0.53707075", "0.53699636", "0.5368042", "0.5366341", "0.53592217", "0.5358575", "0.5356334", "0.5351363", "0.5338547", "0.5338254", "0.53326684", "0.5331632", "0.53220934", "0.53210366", "0.5316191", "0.5309924", "0.5309203", "0.53091323", "0.5305762", "0.53050727", "0.5305066", "0.52949435", "0.5291485", "0.5289785", "0.52844876", "0.52823097", "0.5280948", "0.5279812", "0.5277241", "0.52763647", "0.52735966", "0.52726334", "0.5270632", "0.5268748", "0.52639955", "0.5259608", "0.52580124", "0.52568", "0.5251601", "0.524894", "0.52385545", "0.5233002", "0.5232954", "0.5231657", "0.5228545", "0.52261525", "0.5225315", "0.5224469", "0.52241856", "0.522326", "0.52220875", "0.52185565" ]
0.0
-1
Elimina la figura que se encuentre seleccionada.
function deleteFigure() { var figDel = STACK.figureGetById(selectedFigureId); if (figDel.name == "LineInit") { errorDiv("No se puede eliminar un inicio de linea"); return; } else if (figDel.name == "MultiPoint") { errorDiv("No se puede eliminar un punto de union"); return; } else if (selectedFigureId == ordenFig[ordenFig.length - 1] && ordenFig[ordenFig.length - 2] == "RF") { errorDiv("No se puede eliminar un señalador de repeticion"); return; } else if (selectedFigureId == ordenFig[ordenFig.length - 1]) { sumDirect(figDel.id, true); var cmdDelFig = new FigureDeleteCommand(ordenFig[ordenFig.length - 1]); cmdDelFig.execute(); History.addUndo(cmdDelFig); var cmdDelCon = new ConnectorDeleteCommand(ordenCon[ordenCon.length - 1][0]); cmdDelCon.execute(); History.addUndo(cmdDelCon); ordenFig.pop(); ordenCon.pop(); cleanStates(); coor[1] -= disFig * 2; } else if (valEliminar()) { sumDirect(figDel.id, true); var figId = selectedFigureId; for (var i = 0; i < ordenCon.length; i++) { if (ordenCon[i][1] == selectedFigureId && !elimSF && !elimTR && !elimTLF) { if (elimEF) { selectedConnectorId = ordenCon[i - 1][0]; } else { selectedConnectorId = ordenCon[i][0]; } break; } else if (ordenCon[i][2] == selectedFigureId && (elimSF || elimTR || elimTLF)) { selectedConnectorId = ordenCon[i][0]; } } var cmdDelFig = new FigureDeleteCommand(selectedFigureId); cmdDelFig.execute(); History.addUndo(cmdDelFig); var cmdDelCon = new ConnectorDeleteCommand(selectedConnectorId); cmdDelCon.execute(); History.addUndo(cmdDelCon); var orden = ordenEliminar(figId); if (orden != null) { selectedConnectorId = orden[0]; selectedFigureId = elimEF || elimTR || elimTLF ? orden[1] : orden[2]; var fig = STACK.figureGetById(selectedFigureId); var x = fig.rotationCoords[1].x; var y = fig.rotationCoords[1].y; if (fig.name == "LineOut") { x -= tamFig; y += 1; } else if (fig.name == "LineIn") { x += tamFig; y += 1; } else if (fig.name == "MultiPoint") { y += tamFig / 5; } var cps = CONNECTOR_MANAGER.connectionPointGetAllByParent(orden[0]); var undoCmd = new ConnectorAlterCommand(orden[0]); History.addUndo(undoCmd); if (elimEF || elimTR || elimTLF) { if (fig.name == "MultiPoint") { connectorMovePoint(cps[0].id, x, y); } else { connectorMovePoint(cps[0].id, x, y + tamFig); } } else { connectorMovePoint(cps[1].id, x, y); } var fig = STACK.figureGetById(orden[1]); if (fig.name == "MultiPoint") { fig = STACK.figureGetById(orden[2]); } var moveY = -disFig; if (figDel.name == "LineIn" || figDel.name == "LineOut") { moveY += tamFig; } else if (figDel.name == "LineDouble") { moveY += tamFig / 2; } var moveMatrix = [ [1, 0, 0], [0, 1, moveY], [0, 0, 1] ]; var inicia = false; for (var i = 0; i < ordenFig.length; i++) { if (inicia) { if (isNaN(ordenFig[i])) { if ((initIn && !elimSI && !tray) || (elimSI && ordenFig[i] == "SF")) { break; } valOrden(ordenFig[i]); } else if (valMoverFig(ordenFig[i])) { var moveFigure = new FigureTranslateCommand(ordenFig[i], moveMatrix); History.addUndo(moveFigure); moveFigure.execute(); } } else if (ordenFig[i] == fig.id) { inicia = true; if (entra || sale || tray) { coor[1] += disFig; initIn = true; if (elimTLI || elimSI && ordenFig[i + 1] == "SF") { i--; } } else if (idTray != -1) { if (ordenFig[i - 2] == "TF") { i--; } } if (elimTM) { coor[1] += disFig; break; } } else if (isNaN(ordenFig[i])) { valOrden(ordenFig[i]); if (tray && ordenFig[i] == "TI") { idTray = ordenFig[i - 1]; } } } } renumFig(figDel); if (elimTM) { cambioLV(orden[0]); } redrawLine(); if (isNaN(moveY)) var moveY = -disFig; coor[1] += moveY - disFig; cleanStates(); } resetValOrden(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static DeleteSelected(){\n ElmentToDelete.parentElement.remove();\n UI.ShowMessage('Elemento eliminado satisfactoriamente','info');\n }", "function eliminarSeleccion()\n{\n\t$(\".active\").remove()\n}", "function removerSelecionado() {\n const botao = document.querySelector('#remover-selecionado');\n botao.addEventListener('click', function () {\n const tarefa = document.querySelector('.selecionado');\n if (tarefa) {\n tarefa.remove();\n }\n });\n}", "function eliminarVegetalSeleccionado(e, seleccionado) {\r\n e.preventDefault();\r\n valor = seleccionado.textContent\r\n valorParaFacturacion = seleccionado.textContent.toLowerCase()\r\n seleccionado.remove();\r\n $(`#img${valor}`).remove();\r\n eliminarIngredientesDelArray(arrayParaFacturarVegetales, eval(valorParaFacturacion))\r\n eliminarIngredientesDelArray(arrayVegetales, valor)\r\n eliminarIngredientesDelArray(arrayIngredientes, valor + \" ($\" + eval(valorParaFacturacion).precio +\")\" )\r\n }", "removeSelection() {\n this.simcirWorkspace.removeSelected();\n }", "function removeSelectedImage(){\n for(let i = 0; i < selectedImages.length; i++){\n let element = document.getElementById(selectedImages[i]);\n element.parentNode.removeChild(element);\n images.splice(images.indexOf(selectedImages[i],1));\n }\n selectedImages = [];\n}", "remove () {\r\n\t\tvar svg = d3.select(this.element);\r\n\t\tsvg.selectAll('*').remove();\r\n\t}", "deselectCurrentPiece() {\n if (this.selectedPiece != null) {\n this.selectedPiece.selected = false;\n this.selectedPiece.swapText();\n this.selectedPiece = null;\n }\n }", "function cmdDeleteSelected() {\n var i;\n for( i in ImageInfo[currentImage][\"Regions\"] ) {\n if( ImageInfo[currentImage][\"Regions\"][i] == region ) {\n removeRegion(ImageInfo[currentImage][\"Regions\"][i]);\n paper.view.draw();\n break;\n }\n }\n}", "function eliminarCurso(e){\n if(e.target.classList.contains('borrar-curso')){\n // id del curso a borrar\n const idCurso = e.target.dataset.id;\n \n // Eliminar curso del arreglo cursosCarrito\n // recorre todo el arreglo y reasigna todos los objetos con un id diferente al que hemos seleccionado\n // para eliminar. De esta forma eliminamos el curso de nuestro arreglo.\n cursosCarrito = cursosCarrito.filter( curso => curso.id !== idCurso);\n \n console.log(cursosCarrito);\n\n actualizarHTML();\n }\n}", "clearSelected() {\n this.getSelectedIds().forEach(id => {\n if(this.get(id).created === false) {\n this.get(id).onStopDrawing({});\n }\n this.delete(id);\n });\n }", "function clearSelection(){\n pieceSelected = false;\n selectedPieceArray = [];\n}", "function removeSelected() {\n const selected = getSelectedDoggo();\n if (selected) {\n selected.classList.remove(\"selected\");\n }\n}", "function deleteSelectedArrow() {\n // TODO diagram: delete selected arrow\n if (selectArrow != null) {\n //set selectedArrow unselected (css)\n selectArrow == null;\n }\n }", "function Borrar(){\n\tcalGuiasRemoveSelection();\n}", "function eliminarCarrito(e){\n console.log(\"target\" +e.target.id);\n let posicion= carrito.findIndex(c => c.id == e.target.id);\n carrito.splice(posicion, 1);\n console.log(carrito);\n\n carritoUI(carrito);\n\n localStorage.setItem(\"carrito\", JSON.stringify(carrito));\n\n}", "removeFigure(){\n\n this[figure] = null;\n }", "function btnExcludeSelected() {\n const eraseOnlySelected = document.querySelectorAll('.selected');\n for (let erase of eraseOnlySelected) {\n if (confirm('Tem certeza de que deseja excluir TODAS as atividades SELECIONADAS?')) {\n const nextParent = erase.parentNode;\n const theLastParent = nextParent.parentNode\n theLastParent.remove();\n }\n }\n archiveSet();\n }", "function delSelect(){\n\tvar activeObject = c.getActiveObject();\n if (activeObject['_objects']) {\n activeObject['_objects'].map(x => c.remove(x));\n } else if (activeObject) {\n c.remove(activeObject);\n }\n}", "function onDelete(e)\n{\n var evt = e ? e : event;\n var sel = evt.target ? evt.target : evt.srcElement;\n if(evt.keyCode && evt.keyCode == 46 || evt.which == 46) {\n var val = sel.value;\n if(sel.id==\"paletteList\")\n {\n removePalette(val);\n updatePaletteDom();\n redraw();\n }\n else if(sel.id==\"spriteList\")\n {\n removeSheet(val);\n updateSheetDom();\n redraw();\n }\n else if(sel.id==\"tileList\")\n {\n removeTiles(val);\n updateTileDom();\n redraw();\n }\n \n }\n \n}", "function eliminarCurso(e) {\n\n if (e.target.classList.contains('borrar-curso')) {\n const cursoId = e.target.getAttribute('data-id')\n\n // Elimina del arreglo de articulosCarrito por el data-id\n articulosCarrito = articulosCarrito.filter(curso => curso.id !== cursoId)\n // console.log(articulosCarrito)\n carritoHTML() // Iterar sobre el carrito y mostrar su HTML\n }\n}", "function thumb_select_delete() {\n\tvar $elem = $('.thumb_current');\n\t\n\tremove_watermark();\n\t$('#container').find('.selected').removeClass('selected');\n\t$elem.addClass('selected');\n\t$elem.addClass('delete_watermark');\n\t$('#container').isotope('reLayout', thumb_adjust_container_position);\n }", "function removecolor()\r\n{\r\nvar x=document.getElementById(\"colorSelect\");\r\nx.remove(x.selectedIndex);\r\n}", "function removeSelectedArea()/*:void*/ {\n this.canvasMgr$AoGC.removeSelectedShape();\n }", "function selectedCardDisappears() {\n $(this).parent().empty();\n }", "eliminer() {\n //console.log(\"ELIMINER le divImage \"+this.divImage);\n this.divImage.parentNode.removeChild(this.divImage);\n\t}", "function deleteSelection() {\n tempSelectedDates.forEach(function (e) {\n dateRangeChart.dispatchAction({\n type: 'downplay',\n dataIndex: e[1],\n seriesIndex: e[2]\n });\n });\n tempSelectedDates = new Set([]);\n //update the selection date list\n var $ul = createSelectionUl(tempSelectedDates);\n $(\"#daysSelectedList\").empty().append($ul);\n }", "function remove_selected(){\n\tfoodlst = SELECTED_DAY_ID == \"R\" ? MY_EXPRESS_PLAN : MY_CURRENT_PLAN[SELECTED_DAY_ID] ;\n\tvar j = 0;\n\t$(\".food_list_item\").each(function(){\n\t\tif(this.checked) { foodlst.splice( parseInt(this.getAttribute(\"id_tag\")) - j , 1 ); j++;}\n\t});\n\tdisplay_grocery_list();\n\tselect_day();\n\tupload();\n}", "function eliminarBox(event) { \n event.target.parentNode.parentNode.remove();\n}", "function removeClicked()\n\t{\n\t\tvar i, els = getSelectedImages();\n\n\t\tfor (i = 0; i < els.length; i++) {\n\t\t\tremoveImageConstruct(els[i].id);\n\t\t\tdelete ImageStore[els[i].id];\n\n\t\t}\n\n\t\tif (els.length > 0) {\n\t\t\tenableImageButtons([Ids.DeleteAction, Ids.RotateLeftAction, Ids.RotateRightAction, Ids.CropAction, Ids.ClearAction], false);\n\t\t\tloadData(EmptyImageData);\n\t\t\tdisableAllImageControls();\n\t\t\tImageCount -= els.length;\n\t\t}\n\t\t\n\t\tif (ImageCount === 0) {\n\t\t\tYD.setStyle(Ids.DropHelp, 'display', 'block');\n\t\t\tYD.get(Ids.DropHelp).innerHTML = MsgDragPhotos;\n\t\t}\n\n\t\tdisplayImageDimensions();\n\t}", "function removeChoice () {\n twoTwo.previousElementSibling.remove()\n twoTwo.remove()\n fourFour.remove()\n }", "function removePref(event) { \r\n \r\n const pref = event.currentTarget;\r\n \r\n /*Cambio l'immagine del cuore*/\r\n pref.src = listPreferiti[0]; \r\n pref.removeEventListener('click', removePref);\r\n pref.addEventListener('click',insertPref);\r\n\r\n /*Seleziono il nodo 'padre' e trovo l'id. \r\n Seleziono tutti i div della sezione Preferiti,\r\n li scorro e se trovo un div con lo stesso id lo rimuovo.*/\r\n\r\n var source = pref.parentNode; \r\n var idSource = source.id; \r\n const boxes = document.querySelectorAll('#sectionPref div'); \r\n for(const box of boxes){ \r\n if (box.id==idSource){ \r\n box.remove();\r\n break;\r\n }\r\n }\r\n \r\n /*Poichè ho reso cliccabile il cuore nella sezione Preferiti, se l'utente elimina\r\n il preferito cioè clicca sul cuore, devo aggiornare il corrispettivo elemento della sezione\r\n \"Tutti gli elementi\".*/\r\n \r\n const griglia = document.querySelectorAll('#grid div'); \r\n for(const div of griglia) { \r\n if(div.id == idSource) {\r\n div.childNodes[2].src = listPreferiti[0];\r\n div.childNodes[2].removeEventListener('click',removePref); \r\n div.childNodes[2].addEventListener('click',insertPref);\r\n }\r\n }\r\n \r\n /*Nascondo la sezione Preferiti*/\r\n if (document.querySelectorAll('#sectionPref div').length==0) { \r\n let p = document.getElementById(\"sezionePreferiti\");\r\n p.classList.add('hidden');\r\n }\r\n}", "deselectAll() {\n const me = this;\n me.recordCollection.clear();\n if (me._selectedCell) {\n me.deselectCell(me._selectedCell);\n }\n }", "removeSelected(option, options) {\n let index = options.indexOf(option);\n if (index > -1) {\n options = options.splice(index, 1);\n }\n }", "function removeSelectionPolygon() {\t\t\t\n\t\t\t\tselection_polygon.setPath([]);\n\t\t\t\tselection_polygon.setMap(null);\n\t\t\t}", "deselect(selectedMo) {\n const index = this.getIndexOfSelected(this.selected, selectedMo);\n if (index > -1) {\n this.selected.splice(index, 1);\n }\n this.onChange.emit(this.selected);\n }", "function eraseShape() {\r\n\tif (anySelected) {\r\n\t\tshapes.splice(shapes.indexOf(previousSelectedShape), 1);\r\n\t\tpreviousSelectedShape = null;\r\n\t\tdrawShapes();\r\n\t\tanySelected = false;\r\n\t}\r\n}", "function modeDelete()\n{\n d3.selectAll(\"circle\").on(\"click\", function()\n {\n d3.select(this).remove();\n });\n\n d3.selectAll(\".point\").on(\"click\", function()\n {\n d3.select(this.parentNode).remove();\n });\n}", "clearSelection(){\n this.selected = null\n }", "function borrarCurso(e){\n const li = e.target.parentNode.parentNode;\n li.parentNode.removeChild(li);\n \n}", "function deleteGame() {\n let deleteMe = document.getElementById(\"images\");\n deleteMe.remove();\n \n deleteMe = document.getElementById(\"selectText\");\n deleteMe.remove();\n \n deleteMe = document.getElementById(\"outcomeHolder\");\n deleteMe.remove();\n\n}", "function remove(id,group){\nvar arrow = document.getElementById(id);\n// console.log(\"remove: \" + group.splice(0,1));\ngroup.splice(0,1);\nif(arrow){\n document.body.removeChild(arrow);\n}\n}", "clearOptions(){\n let element = p5Instance.select(`#div_${this.id}`);\n if(element){\n element.remove();\n this.command.context.chain.strokeWeight(1);\n }\n }", "function dropToRemove(ev, el) {\n ev.preventDefault();\n var id = ev.dataTransfer.getData(\"text\");\n var node = document.getElementById(id);\n document.getElementById('canvas').removeChild(node);\n ev.stopPropagation();\n return false;\n}", "function eliminarproducto(e){\n for (let i = 0; i < carrito.length; i++) {\n \n if(e.target.id == carrito[i].nombre){\n carrito.splice(i,1);\n localStorage.setItem('datos',JSON.stringify(carrito))\n escribirDatosCarrito(carrito)\n iconcarrito.textContent=carrito.length;\n\n }\n } \n \n escribirCarroVacio()\n}", "function limpiarPrecios() {\n var selectPrecioMayorista = document.getElementById(\"id_precioMayorista\");\n selectPrecioMayorista.value = \"\";\n\n var selectPVP = document.getElementById(\"id_precioPVP\");\n selectPVP.value = \"\";\n\n if (document.getElementById(\"id_img_producto\")) {\n let imagen = document.getElementById(\"id_img_producto\");\n imagen.remove();\n }\n}", "function clearSelection() {\r\n map.deselectCountry();\r\n pc1.deselectLine();\r\n donut.deselectPie();\r\n sp1.deselectDot();\r\n }", "function cleanSelection() {\n for (let i = 0; i < colorOptCount; i++) {\n colorOpt.remove(colorOpt[i]);\n }\n}", "function deleteObj() {\n\n\t\t\tif (canvas.getActiveObject()) {\n\t\t\t\tvar selectOb = canvas.getActiveObject();\t\n\t\t\t\tcanvas.remove(selectOb);\t\n\t\t\t}\n\t\n\t\n\t\t\tif (canvas.getActiveGroup()) {\n\t\t\t\tcanvas.getActiveGroup().forEachObject(function(a) {\n\t\t\t\tcanvas.remove(a);\n\t\t\t\t});\n\t\t\t\tcanvas.discardActiveGroup();\n\t\t\t}\n\n\t\t\tcanvas.deactivateAll();\t\t\t\n\t\t\thideTools();\t\n\t\t\tcanvas.renderAll();\t\t\n\n\t\n\t\t}", "function eliminarPino() {\r\n\r\n document.getElementById(\"fila1\").remove();\r\n subT = 0;\r\n actualizarCostos();\r\n\r\n\r\n}", "clear() {\n const svg = select(this.base);\n svg.selectAll(\"g\").remove();\n }", "function eliminarCurso(e){\r\n\r\n e.preventDefault();\r\n\r\n \r\n if(e.target.classList.contains(\"borrar-curso\")){\r\n\r\n const idCurso = e.target.getAttribute('data-id')\r\n console.log(idCurso)\r\n\r\n arrayCarrito = arrayCarrito.filter(curso => curso.id !== idCurso)\r\n\r\n carritoHtml();\r\n }\r\n\r\n}", "function limpiarSelect() {\n\n var select = document.getElementById('id_selectColores');\n while (select.firstChild) {\n select.removeChild(select.lastChild);\n }\n\n var div = document.getElementById(\"id_fotoColores\");\n while (div.firstChild) {\n div.removeChild(div.lastChild);\n }\n}", "function eliminarCurso(e) {\n\tif (e.target.classList.contains('borrar-curso')) {\n\t\teliminarCursoLocalStorage(e);\n\t\te.target.parentElement.parentElement.remove();\n\t\tcursosAgregados = cursosAgregados.filter(curso => curso !== e.target.parentElement.parentElement.querySelector('.titulo').textContent);\n\t}\n\treturn true;\n}", "function deletePoint(){\n event.target.parentElement.remove();\n onButtonClick(); \n}", "function _destroy() {\n selected = null;\n }", "function deleteSelectedDevice() {\n // TODO diagram: delete selected device\n if (selectedDevice){\n $(document).find(\"#\"+selectedDevice.type+selectedDevice.index).remove();\n devicesCounter.alterCount(-1);\n }\n }", "function excluir(aux) {\n aux.remove();\n}", "deleteSelectedObjects() {\n var objects = this.selection.getSelectedObjects();\n this.selection.clear();\n objects.forEach(object => {\n object.remove && object.remove();\n });\n }", "function removeSelectedOption(){\n var toRemove = select.selectedIndex;\n\n // Remove option from list of objects and update select\n dialogContent.splice(toRemove - 1, 1);\n UpdateSelect();\n\n // If removed was not last, select the new option at toRemove index\n if(toRemove < select.length){\n select.selectedIndex = toRemove;\n } else {\n select.selectedIndex = select.length - 1;\n }\n \n if(select.length <= 1)\n select.innerHTML = \"<option value='' disabled selected>Adicione um Diálogo para Editar</option>\";\n console.log(\"ON REMOVE =>\");\n console.log(dialogContent);\n \n fetchEditor();\n}", "function dotWindow_deleteKey(dotWindow, evt) {\n if (dotWindow.selected != null) {\n dotWindow.points.splice(dotWindow.selected,1);\n dotWindow.selected = null;\n dotWindow.listChanged();\n }\n}", "function clearSelection() {\n if (selectedShape) {\n if (selectedShape.type != google.maps.drawing.OverlayType.MARKER) {\n selectedShape.setEditable(false);\n }\n selectedShape = null;\n }\n}", "function eliminarEntrada() {\n\tli.remove(); //remueve la entrada con el click del botoncito\n\t}", "function borrarTarea(){\n\t\t$(this).parent().remove(); //borra la tarea específica\n\t}", "function removeLastPart(){ $paper.find('img#'+lastSelected).remove(); }", "function borrarTodo() {\n let img = document.querySelectorAll('.adorno');\n for (let i = 0; i < img.length; i++) {\n img.item(i).remove()\n }\n bolas = 0\n eliminadas = 0;\n txtBolasCreadas.text(`Bolas Creadas : ${bolas}`);\n txtBolasEliminadas.text(`Bolas Eliminadas : ${eliminadas}`);\n\n }", "function removePreview () {\n\tsvg.selectAll(\"polygon.preview\").remove();\n}", "function clearSelected() {\n var selected = getSelected();\n while (selected.length > 0) removeFromSelected(selected[0]);\n document.getElementById(\"eMalButtons\").classList.remove(\"emActive\");\n}", "delete(){\n let td = this.getCase();\n let img = td.lastChild;\n if(img != undefined) td.removeChild(img);\n }", "function removeElement(evt) {\n selectedElement = evt.target.parentElement;\n selectedElement.remove();\n}", "function _destroy() {\n selected = null;\n}", "function _destroy() {\n selected = null;\n}", "function _destroy() {\n selected = null;\n}", "function deleteItem(e) {\n e.preventDefault();\n if (e.target.localName == 'svg') {\n let parentBtn = e.target.parentElement;\n parentBtn.parentElement.remove();\n } if (e.target.localName == 'button') {\n e.target.parentElement.remove();\n }\n }", "function deleteSelected(animationDuration) {\n\tMainwinObj.deleteSelected(animationDuration);\n}", "function removeSelection() {\n $('.file-row input[type=\"checkbox\"]').each(function() {\n var $item = $(this);\n\n $item.prop('checked', false);\n $item.parents('.file-row').removeClass('active');\n $selectAllCheckbox.removeClass('active');\n $('.file-row').removeClass('passive');\n });\n}", "function eliminarCurso(e) {\n let curso, cursoId;\n if (e.target.classList.contains(\"borrar-curso\")) {\n e.target.parentElement.parentElement.remove();\n curso = e.target.parentElement.parentElement;\n cursoId = curso.querySelector(\"a\").getAttribute(\"data-id\");\n }\n eliminarCursoLocalStorage(cursoId);\n}", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "function deleteNeume(){\n currentSyllable.neumes.splice(currentNeumeIndex, 1);\n \n currentNeumeIndex = 0;\n \n document.getElementById(\"input\").innerHTML = neumeDataChangeForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n createSVGOutput();\n}", "function destroyDrag( ) {\r\n selected = null;\r\n }", "remove() {\n\t\tthis.outerElement.style.display = \"none\";\n\t\tthis.removed = true;\n\t}", "deleteSelection(sketch, selected, layer) {\n if (this.objects) {\n for (let i = 0; i < this.objects.length; i++) {\n if (this.objects[i].deleteSelection(sketch, selected, layer)) {\n break;\n }\n }\n }\n }", "delete(e) {\r\n if(statusToolDelete) {\r\n var id = areasPolygons.indexOf(e.target);\r\n for (let a of areas) {\r\n if (a.polygonId == id) {\r\n var area = a\r\n }\r\n }\r\n area.hide();\r\n areas.splice(areas.indexOf(area), 1);\r\n mapData.areas.splice(mapData.areas.indexOf(area), 1);\r\n }\r\n }", "removeAction(){\n // Elimino el todo seleccionado\n removeTodo(this);\n }", "function deleteElement() {\n this.style.display = 'none';\n }", "removeSelected() {\n\n Model.clearSelected(this.currentCartItems);\n }", "function eliminarLinea(indice){\n $(\"#fila\" + indice).remove();\n calculaTotalAjusteInv();\n detalles=detalles-1;\n evaluarAjusteInv();\n}", "function deselect() {\n let selected = squares.find((square) => square.hasClass(constants.classes.SELECTED));\n\n if (selected) {\n selected.removeClass(constants.classes.SELECTED);\n }\n\n\n return selected;\n }", "function eliminarCurso(e) {\n e.preventDefault();\n let curso, cursoid;\n if (e.target.classList.contains(\"borrar-curso\")) {\n e.target.parentElement.parentElement.remove();\n curso = e.target.parentElement.parentElement;\n cursoid = curso.querySelector(\"a\").getAttribute(\"data-id\");\n }\n eliminarCursoLocalStorag(cursoid);\n}", "function eliminarCurso(e){\n e.preventDefault() \n let curso;\n let cursoId;\n if(e.target.classList.contains('borrar-curso')){\n e.target.parentElement.parentElement.remove();\n curso = e.target.parentElement.parentElement;\n cursoId = curso.querySelector('a').getAttribute('data-id');\n }\n elimninarCursoLocalStorage(cursoId);\n}", "deleteSelection(e) {\n var direction, selection, values, caret, tail;\n var self = this;\n direction = e && e.keyCode === KEY_BACKSPACE ? -1 : 1;\n selection = getSelection(self.control_input); // determine items that will be removed\n\n values = [];\n\n if (self.activeItems.length) {\n tail = getTail(self.activeItems, direction);\n caret = nodeIndex(tail);\n\n if (direction > 0) {\n caret++;\n }\n\n for (const item of self.activeItems) {\n values.push(item.dataset.value);\n }\n } else if ((self.isFocused || self.settings.mode === 'single') && self.items.length) {\n if (direction < 0 && selection.start === 0 && selection.length === 0) {\n values.push(self.items[self.caretPos - 1]);\n } else if (direction > 0 && selection.start === self.inputValue().length) {\n values.push(self.items[self.caretPos]);\n }\n } // allow the callback to abort\n\n\n if (!values.length || typeof self.settings.onDelete === 'function' && self.settings.onDelete.call(self, values, e) === false) {\n return false;\n }\n\n preventDefault(e, true); // perform removal\n\n if (typeof caret !== 'undefined') {\n self.setCaret(caret);\n }\n\n while (values.length) {\n self.removeItem(values.pop());\n }\n\n self.showInput();\n self.positionDropdown();\n self.refreshOptions(false);\n return true;\n }", "delete() {\n this.removeAllConnections()\n \n let parent = this.getParent()\n let diagram = this.getDiagram()\n \n if (parent) {\n parent.removeChild(this)\n } else {\n diagram.removePane(this)\n }\n \n this.redrawAllConnectionsInDiagram()\n }", "function deleteLine(){\n\t\tul.removeChild(li);\n\t\tli.removeChild(btn);\n\t}", "function deleteObject(selection, canvas)\n {\n if (selection.type === 'activeSelection') {\n selection.forEachObject(function(element) {\n canvas.remove(element);\n });\n } else {\n canvas.remove(selection)\n }\n canvas.discardActiveObject()\n canvas.requestRenderAll()\n }", "function eliminarCurso(e){\n e.preventDefault();\n let curso,\n cursoId;\n \n if (e.target.classList.contains('borrar-curso')){\n\n e.target.parentElement.parentElement.remove();\n curso = e.target.parentElement.parentElement;\n cursoId = curso.querySelector('a').getAttribute('data-id');\n }\n\n eliminarCursoLocalStorage(cursoId);\n\n}", "function eliminarCurso(e) {\n e.preventDefault();\n\n let curso,\n cursoID;\n if(e.target.classList.contains('borrar-curso')){\n e.target.parentElement.parentElement.remove();\n curso = e.target.parentElement.parentElement;\n cursoID = curso.querySelector('a').getAttribute('data-id');\n }\n eliminarCursoLocalStorage(cursoID);\n}", "function _destroy() {\n\t\t\t\tselected = null;\n\t\t\t}", "clear()\n {\n this.set('selected', null);\n }", "remove() {\n this.holder.remove()\n this.createAltRowBtn.remove()\n }" ]
[ "0.70309466", "0.6962904", "0.6878292", "0.68118155", "0.67688084", "0.66514903", "0.66120136", "0.65980184", "0.6591854", "0.6591258", "0.6555584", "0.6524971", "0.6522166", "0.6491191", "0.6487029", "0.64858973", "0.6447065", "0.64295524", "0.6418031", "0.6402658", "0.63809067", "0.6378415", "0.63713795", "0.63700545", "0.6361969", "0.6353932", "0.63359094", "0.6334689", "0.6328742", "0.6326004", "0.62978494", "0.62964207", "0.629635", "0.6296083", "0.6295823", "0.6289072", "0.62845176", "0.628242", "0.6281224", "0.6279068", "0.62570274", "0.625299", "0.62222016", "0.62190306", "0.62144524", "0.62138444", "0.62078035", "0.62063277", "0.61809987", "0.6179608", "0.6172833", "0.6168298", "0.6162228", "0.61419684", "0.61389655", "0.6136693", "0.61200476", "0.6119833", "0.6117915", "0.6117512", "0.61074424", "0.6106564", "0.6105717", "0.60993046", "0.6091791", "0.6090241", "0.60886896", "0.60845286", "0.6078763", "0.60783345", "0.6078273", "0.6078273", "0.6078273", "0.60772693", "0.60765684", "0.60755867", "0.606627", "0.6065091", "0.6065091", "0.6062706", "0.60573125", "0.60561794", "0.6054095", "0.6053102", "0.6048191", "0.60447633", "0.60405564", "0.603975", "0.603134", "0.6018149", "0.6013975", "0.60074055", "0.60059285", "0.6003824", "0.60013956", "0.5999242", "0.5994761", "0.5986763", "0.5986594", "0.598059" ]
0.64647335
16
Gestor de orden, reinicializa todas la variables de orden
function resetValOrden() { entra = false; sale = false; tray = false; trayLin = false; initIn = false; initMul = false; idLineTray = -1; idTray = -1; valTLF = false; valMovTF = false; elimEF = false; elimSI = false; elimSF = false; elimTR = false; elimTLF = false; elimTLI = false; elimTM = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(nombre,urgencia){\n this.nombre = nombre //Se agrega this. para saber a que instancia pertenece\n this.urgencia = urgencia\n }", "constructor() {\n this.inicializar();\n this.generarSecuencia();\n this.siguienteNivel(); \n }", "initRegistro() {\n this.registro = new _models_register__WEBPACK_IMPORTED_MODULE_7__[\"Register\"](null, // id\n 0, // lecturaAnterior\n 0, // lectura\n 0, // consumo\n this.today.getFullYear(), // year\n this.today.getMonth(), // month\n 0, // excessconsumo\n 0, // excesscosto\n 0, // excessm3\n 0, // base\n 0, // subtotal\n false, // cancelado\n false, // facturado\n '', // meter\n '' // extra\n );\n }", "function creerNouvellePersonne(nom) {\n var obj = {};\n obj.nom = nom;\n obj.salutation = function () {\n alert('Salut ! je m\\'appelle ' + this.nomComplet +'.');\n };\n return obj;\n}", "init(){\n this.initFunctional();\n }", "universite(){\n\n }", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this);\n this.siguienteNivel = this.siguienteNivel.bind(this);\n this.toggleBotonInicio();\n this.generarSecuencia();\n this.nivel = 1;\n this.colores = {\n btnceleste,\n btnvioleta,\n btnnaranja,\n btnverde\n }\n }", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this);\n this.siguienteNivel = this.siguienteNivel.bind(this);\n this.toggleBtnEmpezar();\n this.nivel = 1;\n this.Ultimo_nivel = 10;\n this.colores = {\n celeste,\n violeta,\n naranja,\n verde,\n };\n }", "constructor(objeto,view,...parametros){\n let proxy= ProxyFactory.create(objeto, parametros, (model) => view.update(model));\n view.update(proxy);\n //retorna uma instancia no proprio construtor\n return proxy;\n }", "function constroiEventos(){}", "constructor() {\n this.functions = {};\n }", "constructur() {}", "function LingotOr(valeur) {\n this.valeur = valeur;\n console.log('this', this);\n}", "function Alumno(nombre,apellido,edad)\n{\n this.nombre = nombre;\n this.apellido = apellido;\n this.edad = edad;\n /*this.saludar = function(){\n console.log(\"Hola! que se cuenta?\");\n }\n */\n //Puedo setear un metodo con una funcion externa\n //this.saludar = Saludar;\n}", "function init(){ // función que se llama así misma para indicar que sea lo primero que se ejecute\n carreraCtrl.carreras = carreraService.getCarreras();\n }", "constructor(nombre, ruido) { \n this.nombre = nombre;\n this.ruido = ruido;\n }", "saludar(fn){//recepcion de funcion\n var {nombre, apellido}=this //desgrloce de variables\n console.log(`Hola me llamo ${nombre} ${apellido}`)\n if(fn){\n fn(nombre, apellido, true)\n }\n }", "constructor(nombre, ruido) {\n this.nombre = nombre;\n this.ruido = ruido;\n }", "function init(){\n\tentidades();\n ramas();\n armarArbol();\n}", "function Oo(){}", "function Filtros () {\n this.$tipo_equipo = $('#id_tipo_equipo')\n this.$equipo = $('#id_equipo')\n this.$equipo_texto = $('#equipo_texto')\n this.$equipo_id = $('#equipo_id')\n this.$fecha_inicio = $('#id_fecha_inicio')\n this.$fecha_fin = $('#id_fecha_fin')\n this.$tipo = $('#id_tipo')\n this.$boton_limpiar = $('#boton_limpiar')\n this.$boton_buscar = $('#boton_buscar')\n this.init()\n}", "function criarFuncionario(nome, salarioBase, faltas) {\n return{\n nome,\n salarioBase,\n faltas,\n getSalario(){\n return (salarioBase / 30) * (30 - faltas) // funcao calculo salario faltas\n }\n } \n}", "function TarjetaFiltros() {\n\n this.$id_elaborador = $(\"#id_elaborador\")\n this.$id_autorizador = $(\"#id_autorizador\")\n this.$id_aprobador = $(\"#id_aprobador\")\n this.$boton_colapsible = $(\"#boton_colapsible\")\n this.$id_estado = $(\"#id_estado\")\n this.$id_fecha_inicial_final_programada = $(\"#id_fecha_inicial_final_programada\")\n this.$id_fecha_inicial_final_real = $(\"#id_fecha_inicial_final_real\")\n this.$id_compania_auditada = $(\"#id_compania_auditada\")\n this.$boton_buscar = $('#boton_buscar')\n this.$boton_limpiar = $('#boton_limpiar')\n this.init_Components()\n this.init_Events()\n}", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this)\n btnEmpezar.classList.add('hide');\n\n // Nivel inicial\n this.nivel = 1;\n\n // Variables de colores\n this.colores = {\n celeste: celeste,\n violeta: violeta,\n naranja: naranja,\n verde: verde\n }\n }", "constructor(name,type,evolutions)\n {\n /*\n Se utiliza \"this\" para hacer referencia al propietario de la función que la está invocando o en su defecto, al objeto donde dicha función es un método.\n */\n // Se utilizan los métodos propios de la clase \n // para modificar sus atributos.\n this.#name=name;\n this.#type=type;\n this.#evolutions=evolutions;\n }", "function TarjetaFiltros(){\n\n this.$organizaciones = $('#id_organizaciones')\n this.$empresas = $('#id_empresas')\n this.$contenedor = $('#content-data')\n\n this.init_Components()\n this.init_Events()\n}", "constructor(){\n /**\n * Infobulle\n * @member {Tooltip}\n */\n this.infobulle = new Tooltip();\n /**\n * Gestionnaire de page\n * @member {GestionnairePage}\n */\n this.gestionnairePages = new GestionnairePage(this);\n /**\n * Bannière de l'application\n * @member {Banniere}\n */\n this.banniere = new Banniere(this);\n /**\n * Gestionnaire de population\n * @member {GestionnairePopulation}\n */\n this.gestionnairePopulation = new GestionnairePopulation(this);\n /**\n * Instance du panel de stratégie\n * @member {StrategyPanel}\n */\n this.strategyPanel = new StrategyPanel(this);\n /**\n * Instance du panel de population\n * @member {PopulationPanel}\n */\n this.populationPanel = new PopulationPanel(this);\n /**\n * Instance du panel d'informations\n * @member {InformationsPanel}\n */\n this.informationsPanel = new InformationsPanel(this);\n /**\n * Créateur de personnage\n * @member {CharCreator}\n */\n this.charcreator = new CharCreator(this);\n }", "obtain(){}", "constructor() {\n this.fns = { any: [] };\n }", "initialize() {\n const base = {\n scope: this,\n partialArg: { ...this.context, doc: this },\n }\n\n /**\n * @property {Registry} actions\n *\n */\n this.actions = registry({\n name: 'actions',\n members: this.tryResult('actions', {}),\n ...base,\n })\n\n /**\n * @property {Registry} sandboxes\n *\n */\n this.sandboxes = registry({\n name: 'sandboxes',\n members: this.tryResult('sandboxes', {}),\n ...base,\n })\n }", "function Persona(nombre) {\n this.nombre = nombre;\n //Esto crea una funcion por objeto instanciado. No es correcto este enfoque.\n /* this.saluda = function () {\n console.log('Hola, me llamo', this.nombre);\n \n } */\n}", "function TargetaResultados() {\n\n this.toolbar = new Toolbar()\n this.grid = new GridPrincipal()\n this.modal = new VentanaModal()\n}", "consstructor(){\n \n\n }", "initializing() {\n // Have Yeoman greet the user.\n this.log(chalk.bold.green(`JHipster db-helper generator v${packagejs.version}`));\n\n // note : before this line we can't use jhipsterVar or jhipsterFunc\n this.composeWith('jhipster:modules',\n { jhipsterVar, jhipsterFunc },\n this.options.testmode ? { local: require.resolve('generator-jhipster/generators/modules') } : null\n );\n }", "function Organigrama(){\n\n this.$organizacion = $('#id_organizacion')\n this.$numero_empleado = $('#id_empleado')\n this.$contenedor = $('#content-data')\n this.obtener_Datos()\n\n}", "setAutor(autor){\r\n this.autor =autor;\r\n }", "function ea(){}", "constructor(nombre, apellido){\n this.nombre=nombre\n this.apellido= apellido\n }", "static initialize(obj, editions) { \n obj['editions'] = editions;\n }", "init(){\n \n }", "function enviataxaaula(percent_aula, id_aula, id_projeto) {\n var envio = {}\n envio.id_contato = get_data('geral').id\n envio.id_aula = id_aula\n envio.percentual = percent_aula\n envio.email = get_data('geral').email \n envio.id_projeto = id_projeto \n\n set_tempo_ondemand(envio, (stst) => {\n //console.log('inserido - ' + id_aula + ' - ' + percent_aula + ' - ' + envio.id_contato)\n })\n}", "function template_inicializarBotones() {\n\t//todos los \"nuevos selects\" tiene esta misma funcionalidad\n\t$(\"ul.template_campos\").each(function(){\n\t\tvar elemento = $(this);\n\t\t\n\t\t$(this).on({\n\t\t\tclick: function() {\n\t\t\t\tvar isOpen = false;\n\t\t\t\t\n\t\t\t\tif (elemento.find(\"li.lista\").css(\"display\") != \"none\")\n\t\t\t\t\tisOpen = true;\n\t\t\t\t\t\n\t\t\t\tif (isOpen)\n\t\t\t\t\telemento.find(\"li.lista\").hide();\n\t\t\t\telse\n\t\t\t\t\telemento.find(\"li.lista\").show();\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t$(this).find(\"li.lista li\").on({\n\t\t\tclick: function() {\n\t\t\t\telemento.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\telemento.find(\"p\").text($(this).text());\n\t\t\t}\n\t\t});\n\t});\n\t\n\t\n\t//agrega evento para cuando se cambie de estado, actualizar la ciudad\n\t$(\"#template_venta_estado,#template_renta_estado,#template_rentaVac_estado\").each(function(){\n\t\tvar elemento = $(this);\n\t\t\n\t\t$(this).find(\"li.lista li\").on({\n\t\t\tclick: function() {\n\t\t\t\ttemplate_actualizar_ciudad(elemento.prop(\"id\"));\n\t\t\t}\n\t\t});\n\t});\n}", "constructor(){\n super();\n this.Mostrar = this.Mostrar.bind(this);\n \n }", "function $o(){}", "constructor () {\n this.media = new Media();\n this.selector = new Selector();\n this[_initProps]();\n this[_initTable]();\n this[_initTableEvents]();\n this[_initCallback]();\n this[_addHotkeyListener]();\n }", "function init(){\n\t\t$scope.inventario.establecimiento_id_establecimiento = $rootScope.establecimiento.direccion;\n\t\t\n\t\t\n\t\tProductos.getProductos().then(function(response){\n\t\t\tconsole.log(response.data.productos);\n\t\t\t$scope.listaProductos = response.data.productos;\n\t\t});\t\t\n\n\t}", "function init(){\n\t\t$scope.inventario.establecimiento_id_establecimiento = $rootScope.establecimiento.direccion;\n\t\t\n\t\t\n\t\tProductos.getProductos().then(function(response){\n\t\t\tconsole.log(response.data.productos);\n\t\t\t$scope.listaProductos = response.data.productos;\n\t\t});\t\t\n\n\t}", "function PopupAcciones() {\n\n this.$id_boton_checklist = $('#id_boton_checklist')\n this.$id_boton_plan_auditoria = $('#id_boton_plan_auditoria')\n this.init_Events()\n}", "activate(){\n\n let controller_obj = this;\n\n \n //this._cargarReproducciones( controller_obj );\n\n //console.log(this.reproducciones);\n\n // console.log(this.reproducciones)\n }", "constructor(nome, idade){\n this.nome = nome; //this. esta se referindo ao proprio objeto e nao a uma variavel em especifico\n this.idade = idade;\n }", "saludar(fn){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido}`)\n if(fn){\n fn(this.nombre,this.apellido, false)\n }\n }", "static get INIT_DAO() {\n return {\n active: 1\n }\n }", "static initialize(obj, effects, createdCoupons, createdReferrals) { \n obj['effects'] = effects;\n obj['createdCoupons'] = createdCoupons;\n obj['createdReferrals'] = createdReferrals;\n }", "function Estudante() {\n\n this.despedida = function () {\n console.log('Tchau! Sou da Classe Estudante');\n }\n}", "function Inicializar() {\n $(\"input.fecha\").datepicker($.datepicker.regional[\"es\"]);\n Argumentos = searchToJSON();\n $(\"#idOperador\").val(Argumentos.idOperador);\n $(\"input.fecha\").val(AFechaMuyCorta(new Date()));\n if (Argumentos.Supervisados == 0) {\n $(\"#filaOperador\").hide();\n $(\"#Supervisado\").val(0);\n } else {\n //OperadoresSupervisados_lst(_OperadoresSupervisados_lst, Argumentos.idOperador);RA\n LlamarServicio(_OperadoresSupervisados_lst, \"OperadoresSupervisados_lst\", { idOperador: Argumentos.idOperador });\n $(\"#Supervisado\").val(1);\n }\n\n}", "afficher(){\n this.racine.afficher()\n }", "function initDoors()\n {\n var spawnPoint;\n function createDoor(i)\n {\n //Se crean puertas según los puntos de spawn del json\n spawnPoint = map.findObject(\"Objects\", obj => obj.name === \"Puerta \" + i);\n doors[i] = this.statics.create(spawnPoint.x + 16, spawnPoint.y + 16, \"door\").refreshBody();\n //Se asocia una callback al evento de colisión de Juan con las puertas\n //El guardia podrá atravesarlas\n that.physics.add.collider(juan, doors[i], function(){openDoor(i);}, null, this);\n }\n for(var i = 0; i < numDoors; i++)\n createDoor(i);\n }", "_initRepos() {\n this._repos = {\n meal: new MealRepository(),\n meal_type: new MealTypeRepository(),\n sport: new SportRepository(),\n user: new UserRepository(),\n };\n\n this._repos.meal.addDataSource(new SQLiteMealDataSource(this._db));\n this._repos.meal_type.addDataSource(new SQLiteMealTypeDataSource(this._db));\n this._repos.sport.addDataSource(new SQLiteSportDataSource(this._db));\n this._repos.user.addDataSource(new SQLiteUserDataSource(this._db));\n }", "init(){}", "constructor(nombreLugar='Tierra de mordor', tipoDescripcion='Es un lugar rodeado de arboles muertos y arena negra, donde no se puede ver nada por su densa niebla.')\r\n {\r\n this.nombreLugar = nombreLugar;\r\n this.tipoDescripcion = tipoDescripcion;\r\n }", "constructor() {\n // class (etiqueta html) (web-component)\n // Instanciar a la clase\n // Clase esta lista\n // Clase se destruye\n this.ancho = 200;\n this.cambioSueldo = new EventEmitter(); // evento\n this.mostrarResultados = new EventEmitter();\n this.suma = 0;\n this.resta = 0;\n this.multiplicacion = 0;\n this.division = 0;\n console.log('instanciando');\n }", "function inicializar() {\n\n var modalServicio = $('#modal-form-servicio'),\n modalPersona = $('#modal-form-persona'),\n modalTipoServicio = $('#modal-form-tipo-servicio'),\n modalMarca = $('#modal-form-marca'),\n modalComponente = $('#modal-form-componente'),\n\n formServicio = modalServicio.find('form').html(),\n formPersona = modalPersona.find('form').html(),\n formTipo = modalTipoServicio.find('form').html(),\n formMarca = modalMarca.find('form').html(),\n formComponente = modalComponente.find('form').html(),\n\n wd = window || document;\n\n\n\n var compu = {\n\n initCompu: function() {\n \n this.setActionsFormServicio(); \n this.setActionsFormTipo(); \n this.setActionsFormComponente(); \n\n $('#servicio-btn').on('click',{modal:modalServicio}, this.showModal);\n\n $('#guardar-servicio-btn').on('click', this.guardarServicio);\n $('#edit-servicio-btn').on('click', {modal:modalServicio}, this.showModal);\n \n $('#guardar-persona-btn').on('click', this.guardarPersona);\n $('#guardar-tipo-servicio-btn').on('click', this.guardarTipoServicio);\n $('#guardar-marca-btn').on('click', this.guardarMarca);\n $('#guardar-componente-btn').on('click', this.guardarComponente);\n\n $('#update-btn').on('click', this.update);\n\n modalServicio.on('hidden.bs.modal', this.alHideServicio);\n modalPersona.on('hidden.bs.modal', this.alHidePersona); \n modalTipoServicio.on('hidden.bs.modal', this.alHideTipoServicio); \n modalMarca.on('hidden.bs.modal', this.alHideMarca); \n modalComponente.on('hidden.bs.modal', this.alHideComponente); \n },\n\n\n setActionsFormServicio: function() {\n $('#cliente-btn').on('click', {modal:modalPersona}, this.showModal);\n $('#tipo-btn').on('click', {modal:modalTipoServicio}, this.showModal);\n $('#marca-btn').on('click', {modal:modalMarca}, this.showModal);\n $('#componentes-btn').on('click', {modal:modalComponente}, this.showModal);\n\n $('#id_cliente,#id_tipo,#id_marca,#id_componentes').select2({\n formatNoMatches: function(m){return 'Oops, no se encontraron resultados!';}\n });\n\n $('#id_plazo').datetimepicker({\n language: 'es',\n showMeridian: true, //muestra am y pm pero si se cambia el language no funciona, se arregla add [\"AM\", \"PM\"] en el archivo localizado\n format: 'dd-mm-yyyy HH P',\n startDate: new Date(),\n autoclose: true,\n daysOfWeekDisabled: [0],\n minView: 1,\n //maxView: 3,\n todayHighlight: true,\n });\n },\n\n\n clearActionsFormServico: function() {\n $('#cliente-btn, #tipo-btn, #marca-btn').off();\n $('#id_cliente').select2(\"destroy\");\n $('#id_tipo').select2(\"destroy\");\n $('#id_marca').select2(\"destroy\");\n $('#id_componentes').select2(\"destroy\");\n }, \n \n\n setActionsFormTipo: function() {\n $('#form-tipo-servicio #id_icon').select2({\n formatResult: compu.iconFormat,\n formatSelection: compu.iconFormat,\n escapeMarkup: function(m) { return m; }\n });\n },\n\n clearActionsFormTipo: function() {\n $('#form-tipo-servicio #id_icon').select2(\"destroy\");\n },\n \n setActionsFormComponente: function() {\n $('#form-componente #id_icon').select2({\n formatResult: compu.iconFormat,\n formatSelection: compu.iconFormat,\n escapeMarkup: function(m) { return m; }\n });\n },\n\n\n clearActionsFormComponente: function() {\n $('#form-componente #id_icon').select2(\"destroy\");\n },\n \n\n iconFormat: function(state) {\n if (!state.id) return state.text; // optgroup\n return \"<i class='fa fa-fw fa-\"+state.id+\"'></i> \"+ state.text; //state.text;\n },\n \n \n showModal: function(event) { \n event.preventDefault();\n if (event.data.reset) { // si reset es true entonces reseteo el form y su id, por ahora no estoy usando esto\n var form = event.data.modal.find('form');\n compu.clearForm(form);\n };\n \n var selectedItems = $('#id_componentes').select2(\"val\");\n event.data.modal.modal('show'); \n },\n\n\n alHideServicio: function() {\n compu.clearActionsFormServico();\n $('#form-servicio').html(formServicio);\n compu.setActionsFormServicio();\n },\n\n alHidePersona: function() {\n $('#form-persona ').html(formPersona);\n }, \n\n\n alHideTipoServicio: function() {\n compu.clearActionsFormTipo();\n $('#form-tipo-servicio').html(formTipo);\n compu.setActionsFormTipo();\n },\n\n\n alHideMarca: function() {\n $('#form-marca').html(formMarca);\n },\n\n\n alHideComponente: function() {\n compu.clearActionsFormComponente()\n $('#form-componente').html(formComponente);\n compu.setActionsFormComponente();\n },\n \n\n ///////// PRINT METODOS /////////\n\n\n update: function(event) {\n\n modalUpdate = $('#modal-update').modal({backdrop: 'static'});\n\n okBtn = modalUpdate.find('.ok-btn').one('click', function(){\n \n return wd.location.reload(true);\n });\n\n okBtn.button('loading');\n\n url = $(event.currentTarget).data('url')\n \n $.get(url)\n .fail(function() {\n alert( \"error\" );\n })\n .always(function(data){\n var $content = modalUpdate.find('.content')\n var $msg = $content.find('.msg');\n\n if (!(data['success'])) { \n modalUpdate.find('.logo i').removeClass().addClass('fa fa-frown-o');\n modalUpdate.find('.logo h5').text('imposible');\n $msg.html(data.msg);\n okBtn.button('reset'); \n\n setTimeout(function(){console.log('hola despues de 10 segundos')}, 10000);\n console.log('hola soy despues del settimeout');\n \n } else {\n modalUpdate.find('.logo i').removeClass().addClass('fa fa-smile-o');\n modalUpdate.find('.logo h5').text('actualizado'); \n $msg.html(data.msg);\n\n setTimeout(function(){\n okBtn.button('reset');\n $msg.html('Servidor listo, Dale OK');\n }, 30000);\n\n var $progress = $content.find('.progress').removeClass('hidden').addClass('show');\n var $bar = $content.find('.progress-bar');\n var unidad = $bar.width();\n\n var intervalo = setInterval(function(){\n var width = $bar.width() + 3;\n \n $bar.width($bar.width() + unidad);\n \n if (okBtn.text() == \"OK\") {\n $progress.removeClass('active'); \n $bar.width('100%');\n clearInterval(intervalo); \n }\n },1000);\n }\n });\n },\n \n\n ///////// AJAX METODOS /////////\n\n guardarServicio: function(event) {\n console.log($('#form-servicio').serialize());\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarServicio,\n form : '#form-servicio',\n btn : $btn\n });\n },\n\n\n\n fadeElement: function() {\n $(document).bind('DOMNodeInserted', function(e) {\n var element = e.target;\n setTimeout(function() {\n $(element).fadeOut(1000, function() {\n $(this).remove();\n });\n }, 2000);\n }); \n },\n \n\n\n guardarPersona: function() {\n var $btn = $(event.target).button('loading');\n\n $(event.target).button('loading');\n compu.ajax({\n url : urlGuardarPersona,\n form : '#form-persona',\n btn : $btn\n });\n },\n\n\n guardarTipoServicio: function() {\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarTipoServicio,\n form : '#form-tipo-servicio',\n btn : $btn\n });\n },\n\n\n guardarMarca: function() {\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarMarca,\n form : '#form-marca',\n btn : $btn\n });\n },\n\n guardarComponente: function() {\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarComponente,\n form : '#form-componente',\n btn : $btn\n });\n },\n \n\n\n ajax: function(options) {\n \n $.ajax({\n url: options.url,\n type: \"POST\",\n data: $(options.form).serialize(),\n\n success: function(data) {\n if (!(data['success'])) {\n $(options.form).replaceWith(data['form_html']); // OJO replace mata los listener y referencias...\n \n if (options.url == urlGuardarServicio) compu.setActionsFormServicio();\n if (options.url == urlGuardarTipoServicio) compu.setActionsFormTipo(); \n if (options.url == urlGuardarComponente) compu.setActionsFormComponente(); \n }\n else {\n if (options.url == urlGuardarServicio) return window.location.href= data.url;\n \n if (options.url == urlGuardarPersona) compu.successOk('#id_cliente', data, modalPersona);\n\n if (options.url == urlGuardarTipoServicio) compu.successOk('#id_tipo', data, modalTipoServicio);\n \n if (options.url == urlGuardarMarca) compu.successOk('#id_marca', data, modalMarca); \n \n if (options.url == urlGuardarComponente) compu.successOk('#id_componentes', data, modalComponente); \n }\n\n options.btn.button('reset');\n },\n error: function () {\n console.log('tengo errores');\n $(options.form).find('.error-message').show()\n }\n });\n },\n\n\n successOk: function(selector, data, modal) {\n var select = $('#form-servicio '+selector).append('<option value=\"'+ data['value']+'\">'+data['nombre']+'</opotion>');\n if (selector == '#id_componentes') {\n var selectedItems = $(selector).select2(\"val\");\n selectedItems.push(''+data.value+'');\n $(selector).select2(\"val\", selectedItems);\n } else {\n select.val(''+data.value+''); \n select.trigger('change');\n }\n \n modal.modal('hide');\n },\n\n\n\n /////////////// UTILES ////////////////\n\n clearForm: function(form) {\n console.log(form);\n form.find('*').each(function(index,element){\n //console.log(Element.tagName.toLowerCase());\n switch(element.tagName.toLowerCase()) {\n case 'input':\n if (element.name == 'csrfmiddlewaretoken') break;\n else if ( $(element).hasClass('datetimeinput') ) {\n element.value = \"\";\n //$(element).datetimepicker('update');\n }\n else {\n element.value = \"\";\n }\n break;\n case 'textarea':\n element.value = \"\";\n //console.log(element.value);\n break;\n case 'select':\n //console.log(element.options[element.selectedIndex].text);\n //element.selectedIndex = 1;\n $(element).select2(\"val\", \"\");\n break;\n\n\n }\n\n });\n \n /*var elements = form.elements; \n \n form.reset();\n\n for(i=0; i<elements.length; i++) {\n \n field_type = elements[i].type.toLowerCase();\n \n switch(field_type) {\n \n case \"text\": \n case \"password\": \n case \"textarea\":\n case \"hidden\": \n \n elements[i].value = \"\"; \n break;\n \n case \"radio\":\n case \"checkbox\":\n if (elements[i].checked) {\n elements[i].checked = false; \n }\n break;\n\n case \"select-one\":\n case \"select-multi\":\n elements[i].selectedIndex = -1;\n break;\n\n default: \n break;\n }\n }*/\n }\n \n\n\n };\n\n return compu;\n }", "function Fruta(nombre){\n//para poner cosas\n\n this.setNombre = function(valor){\n\n nombre=valor;\n };\n this.getNombre = function(){\n return nombre;\n };\n\n\n\n\n\n}", "function PratoDoDiaComponent() {\n }", "constructor(nombre, apellido, altura) {\r\n this.nombre = nombre;\r\n this.apellido = apellido;\r\n this.altura = altura;\r\n }", "constructor(modelo) {\n this.modelo = modelo;\n }", "constructor(raza) {\n this.raza = raza;\n\n // METODA 'MISCARE()' (IN INSTANTA OBIECTULUI)\n this.miscare = function() {\n console.log('miscare');\n }\n }", "saludar(fn){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido} y soy programador`)\n if(fn){\n fn(this.nombre,this.apellido, true)\n }\n }", "function Persona(nombre) {\n this.nombre = nombre;\n // this.saluda = function() {\n // console.log('Hola me llamo', this.nombre); \n // }\n}", "constructor(nombre,edad,correo){\n\t// PROPIEDADES DE LA CLASE \n\t\tthis.nombre = nombre,\n\t\tthis.edad = edad,\n\t\tthis.correo = correo;\n\n\n\t}", "function makeKiaOra(name) {\n return function() {\n console.log('KiaOra, ' + name)\n }\n}", "function Mascota(nombre, especie, raza='')//no importa el orden de los datos\n//se pone comillas en la raza para que no te salga undefined por si no lo sabemos\n\n{\n this.nombre = nombre\n this.especie = especie\n this.raza = raza//los parametros de una funcion constructora son parametros y pueden tener valores por defecto\n\n}", "function yo(){ }", "static get creators() {\n return {\n /**\n * @param {String} deviceMode\n */\n deviceChanged: (deviceMode) => ({\n type: this.types.DEVICE_CHANGED,\n payload: { deviceMode }\n }),\n\n /**\n * @param {String} searchMode\n */\n searchChanged: (searchMode) => ({\n type: this.types.SEARCH_CHANGED,\n payload: { searchMode }\n }),\n };\n }", "init() {\n this.setResolver();\n this.setValidationAndBehaviour();\n }", "_init() {\n this.floors.all = FloorsJSON\n this.locations.all = LocationsJSON\n this._segregateLocations()\n this._groupFloorsByBuildings()\n }", "constructor(init){\n Object.assign(this,init)\n this.type = 'entity'\n }", "function Pessoa(nome, sobrenome){\n\n // atributos privados\n const ID = 123123;\n const metodos = function(){\n \n }\n\n\n //atributos ou metodos publicos\n this.Pessoa = nome;\n this.sobrenome = sobrenome;\n\n this.metodo = function(){\n console.log(\"Oi sou o Metodo\");\n }\n }", "function AutoFactory() {}", "function TargetaResultados() {\n\n this.toolbar = new Toolbar()\n this.grid = new GridPrincipal()\n}", "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "async init(){}", "constructor(make, model, year, doors){ //constructor class addimg doors\n super(make, model, year);\n this.doors = doors;\n }", "constructor (nombre, tipo, edad) {\n this.nombre = nombre\n this.tipo = tipo\n this.edad = edad\n }", "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "function cuadrado() {}", "function funcionario(nome, sobrenome) {\n this.nome = nome;\n this.sobrenome = sobrenome;\n}", "constructor() {\n this.alunos = document.getElementById(\"alunos\")\n }", "constructor() {\n this.init = this.init.bind(this);\n }", "function reservar(completo, opciones){\n opciones = opciones || {};\n\n }", "constructor(color, velocidad, ruedas, motor, marca) {\n this.tipo = 'auto';\n this.color = color;\n this.velocidad = velocidad;\n this.ruedas = ruedas;\n this.motor = motor;\n this.vendido = true;\n this.marca = marca || 'Honda';\n }", "function init(){\n controllerInit(routerInitModel);\n serviceFilter(globalEmitter,'userAccount',globalCallBackRouter,commonAccessUrl,guardKey)\n createAccount(globalEmitter,'createAccount',globalCallBackRouter,commonAccessUrl,guardKey)\n updateAccount(globalEmitter,'updateAccount',globalCallBackRouter,commonAccessUrl,guardKey)\n //genericDataAccess(dataAccessInitModel);\n}", "function User(nombre, edad) {\n this.nombre = nombre\n this.edad = edad\n this.mascotas = [] //como pongo mascotas sería un array y pondría dentro de un array un push no voy a guardar el nombre\n //el objeto, guardo la mascota\n /*this.saludar = function(aQuien = 'amigo') //pongo this y ya Elena y Ernesto podrían saludar\n {\n console.log(`Hola ${aQuien}, soy ${this.nombre}`)*/\n\n}", "constructor(){\n this.lamaService = new LamaService();\n this.createlamaview = new CreateLamaView(this);\n this.listlamaview = new ListLamaView(this);\n this.listlamaview.drawLamas(this.lamaService.getLamas());\n }", "function init(){\n //\n ourLoc = ol.proj.fromLonLat([-122.155872, 37.482087])\n // i declared the variable at the top, so now i can use it here\n\n view = new ol.View({\n center: ourLoc,\n zoom: 4\n })\n\n map = new ol.Map({\n\t\ttarget: 'map',\n\t\tlayers: [\n\t\t new ol.layer.Tile({\n\t\t source: new ol.source.OSM()\n\t\t })\n\t\t],\n view: view\n });\n}", "function init() {\n console.log(\"init\");\n //let menuConf = {$menu: document.getElementById('top-nav'), direction: 'horizontal' }\n return new Menu({ $menu: document.getElementById('top-nav'), direction: 'horizontal' });\n}", "function Pessoa(nome, sobrenome) {\n // Atributos ou metodos publicos\n const ID;\n const metodoInterno = function () {\n \n }\n\n // Atributos ou metodos publicos\n this.nome = nome;\n this.sobrenome = sobrenome;\n\n this.metodo = function () {\n console.log(this.nome + ' Sou um metodo');\n }\n\n}", "constructor(make, model, year, doors){//parameters of constructor\n super(make, model, year);\n this.doors = doors;//initiliazing\n }", "function init() {\n console.log(\"init\");\n document.getElementById(\"comenzar\").onclick = iniciarSaludo;\n document.getElementById(\"parar\").onclick = pararSaludo;\n}", "constructor(nombres, apellidos, fechaN, direccion, celuar, email, departamento, action) {\n this.nombres = nombres;\n this.apellidos = apellidos;\n this.fechaN = fechaN;\n this.direccion = direccion;\n this.celuar = celuar;\n this.email = email;\n this.departamento = departamento;\n this.action = action;\n\n }", "function Manusia(nama,umur){\n let manusia = {}; //* inisiasi objek biar nanti diisi\n manusia.nama = nama; //* menambahkan properti objek manusia dengan simbol (.) dan assign (=) dari parameter\n manusia.umur = umur;\n manusia.energi = 0; //* menambahkan properti objek manusia bukan dari parameter\n\n manusia.makan = function(porsi){ //* membuat method makan untuk manusia\n this.energi += porsi \n return this.nama + \" telah makan sebanyak \" + porsi\n }\n\n return manusia //* mereturn objek yang sudah diisi\n}" ]
[ "0.621942", "0.6082999", "0.6008036", "0.5878133", "0.5874657", "0.5838005", "0.57965785", "0.5784554", "0.5780538", "0.5779431", "0.5744671", "0.57341367", "0.56929195", "0.5676274", "0.5659722", "0.5630644", "0.5622715", "0.5559884", "0.55510926", "0.5547678", "0.55454", "0.5539764", "0.5535354", "0.5510923", "0.55106944", "0.5504503", "0.5471406", "0.54627025", "0.54466254", "0.5437474", "0.5433243", "0.5428455", "0.54272336", "0.54205346", "0.54114574", "0.54072034", "0.5403701", "0.5393433", "0.5391394", "0.53837514", "0.5376922", "0.5366244", "0.5362831", "0.53611344", "0.53589416", "0.53587234", "0.53587234", "0.53582156", "0.53503335", "0.5345281", "0.5344228", "0.53439134", "0.53383994", "0.5338121", "0.53330106", "0.5332483", "0.53288853", "0.53133535", "0.53100467", "0.5304184", "0.5302522", "0.5302306", "0.5297517", "0.529234", "0.529091", "0.52892107", "0.5274267", "0.5271356", "0.5268925", "0.5255287", "0.5247368", "0.52461505", "0.5244597", "0.5242049", "0.52418315", "0.5239943", "0.52332443", "0.5228446", "0.5228409", "0.5226233", "0.5218935", "0.5214915", "0.52124333", "0.52122176", "0.5212075", "0.52104664", "0.5203708", "0.51973706", "0.51960117", "0.51956165", "0.519561", "0.5188559", "0.51885563", "0.5169296", "0.51660675", "0.5162027", "0.51619697", "0.5155034", "0.5153418", "0.5152589", "0.5150587" ]
0.0
-1
Translates the list format produced by cssloader into something easier to manipulate.
function listToStyles (parentId, list) { var styles = [] var newStyles = {} for (var i = 0; i < list.length; i++) { var item = list[i] var id = item[0] var css = item[1] var media = item[2] var sourceMap = item[3] var part = { id: parentId + ':' + i, css: css, media: media, sourceMap: sourceMap } if (!newStyles[id]) { styles.push(newStyles[id] = { id: id, parts: [part] }) } else { newStyles[id].parts.push(part) } } return styles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listToStyles(parentId, list) {\n var styles = [];\n var newStyles = {};\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = item[0];\n var css = item[1];\n var media = item[2];\n var sourceMap = item[3];\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n };\n\n if (!newStyles[id]) {\n styles.push(newStyles[id] = {\n id: id,\n parts: [part]\n });\n } else {\n newStyles[id].parts.push(part);\n }\n }\n\n return styles;\n }", "function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n }" ]
[ "0.63083893", "0.630304" ]
0.0
-1
globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode, /* vue-cli only */ components, // fixed by xxxxxx auto components renderjs // fixed by xxxxxx renderjs ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // fixed by xxxxxx auto components if (components) { if (!options.components) { options.components = {} } var hasOwn = Object.prototype.hasOwnProperty for (var name in components) { if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) { options.components[name] = components[name] } } } // fixed by xxxxxx renderjs if (renderjs) { (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() { this[renderjs.__module] = this }); (options.mixins || (options.mixins = [])).push(renderjs) } // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "extend(config, 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 }" ]
[ "0.58474934", "0.57268775" ]
0.0
-1
['Elie', 'Tim', 'Matt', 'Colt'] vowelCount
function vowelCount(str){ var vowels ="aeuio"; return str.toLowerCase().split('').reduce(function(acc, nVal){ if(vowels.indexOf(nVal) !== -1){ if(acc[nVal]){ acc[nVal]++; } else { acc[nVal] = 1; } } return acc; }, {}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vowelCount(str) {\n\tvar vowels = 'aeiou';\n\treturn str.toLowerCase().split(\"\").reduce(function(acc, next){\n\t\tif(vowels.indexOf(next) !== -1) {\n\t\t\tif(acc[next]) {\n\t\t\t\tacc[next]++;\n\t\t\t} else {\n\t\t\t\tacc[next] = 1;\n\t\t\t}\n\t\t}\n\t\treturn acc;\n\t}, {});\n}", "function countvowels(text){\n var character = text.toLowerCase().split('')\n var vowels = 'aeiou';\n \n var countvowels = character.reduce(function(acc,current){\n return vowels.indexOf(current) > -1 ? acc + 1 : acc;\n },0);\n \n return countvowels;\n}", "function getCount(str) {\n var vowelsCount = 0;\n\n // enter your majic here\n str.split('').map(function(x) {\n if(x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') {\n vowelsCount++;\n }\n });\n\n return vowelsCount;\n }", "function vowelCount(str) {\n const vowels = 'aeiou';\n return str.split('').reduce(function(accumulator, next) {\n let lowerCased = next.toLowerCase();\n if(vowels.indexOf(lowerCased) !== -1) {\n if(accumulator[lowerCased]) {\n accumulator[lowerCased]++;\n } else {\n accumulator[lowerCased] = 1;\n }\n }\n return accumulator;\n }, {})\n}", "function vowelCount(str){\n const vowels = \"aeiou\";\n return str.split('').reduce(function(accm,next){\n let lowerCased = next.toLowerCase()\n if(vowels.indexOf(lowerCased) !== -1){\n if(accm[lowerCased]){\n accm[lowerCased]++;\n } else {\n accm[lowerCased] = 1;\n }\n }\n return accm;\n }, {});\n}", "function VowelCount(str) {\n var newStr = str.toLowerCase().split('');\n var vowelCounter = 0;\n for(var i = 0; i<newStr.length; i++) {\n if(newStr[i] === 'a' || newStr[i] === 'e' || newStr[i] === 'i' || newStr[i] === 'o' || newStr[i] === 'u')\n {vowelCounter += 1;}\n }\n return vowelCounter;\n}", "function vowelCount(word) {\n let letters = word.split(\"\");\n let vowels = letters.filter(\n (letter) =>\n letter === \"a\" ||\n letter === \"e\" ||\n letter === \"i\" ||\n letter === \"o\" ||\n letter === \"u\"\n );\n return vowels.length;\n}", "function vowel_count(str)\n{\n //code goes here\n}", "function vowelCount(str) {\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n let lowerCaseSplitStr = str.toLowerCase().split('');\n let count = 0;\n lowerCaseSplitStr.forEach((letter) => {\n if (vowels.includes(letter) === true) {\n count++;\n }\n });\n return count;\n}", "function getCount(str) {\n var vowelsCount = 0;\n str.split(\"\").forEach(function(x){\n if(x == \"a\" | x == \"e\" | x == \"i\" | x == \"o\" | x == \"u\"){\n vowelsCount += 1;\n }\n }); \n return vowelsCount;\n}", "function vowelCount( str ) {\n\tvar strArr = str.split('');\n\tvar counter = 0;\n\tfor ( var i = 0; i < strArr.length; i++ ) {\n\t\tif (\n\t\t\tstrArr[i] === \"a\" \n\t\t\t|| strArr[i] === \"e\" \n\t\t\t|| strArr[i] === \"i\" \n\t\t\t|| strArr[i] === \"o\" \n\t\t\t|| strArr[i] === \"u\" \n\t\t) {\n\t\t\tcounter++;\n\t\t}\n\t}\n\n\treturn counter;\n}", "function countVowels(word) {\n var vowelAmount = 0;\n var i = 0;\n for (i = 0; i < word.length; i++){\n if ( (word[i] === 'a') || (word[i] === 'e') || (word[i] === 'i') || (word[i] === 'o') || (word[i] === 'u') || (word[i] === 'y') ){\n vowelAmount++;\n }\n }\n return vowelAmount;\n}", "function vowelCounter(str) {\n var count = 0;\n for (var i = 0; i < str.length; i++) {\n var l = str.charAt(i).toLowerCase();\n if (l === 'a' || l === 'e' || l === 'i' || l === 'o' || l === 'u') {\n count++;\n }\n }\n return count;\n}", "function vowelCount(str) {\n\tvar splitArr = str.toLowerCase().split(\"\");\n\tvar vowels = 'aeiou';\n\tvar obj = {};\n\n\tsplitArr.forEach(function(letter){\n\t\tif(vowels.indexOf(letter) !== -1) {\n\t\t\tif(obj[letter]) {\n\t\t\t\tobj[letter]++;\n\t\t\t} else {\n\t\t\t\tobj[letter] = 1;\n\t\t\t}\n\t\t}\n\t});\n\treturn obj;\n}", "function vowelsCounter(str){\r\n \r\n var v = [\"a\",\"e\",\"i\",\"o\",\"u\"];\r\n var n = 0;\r\n for (c in str){\r\n for (vi in v){\r\n if (v[vi] == str[c]){\r\n n = n + 1;\r\n }\r\n }\r\n }\r\n return n;\r\n}", "function countVowels(value){\n var vow = 'aeiou';\n var count = 0;\n for(var x = 0; x < value.length; x++){\n if(vow.toLowerCase().indexOf(value[x]) !== -1){// copied from #44\n count++;\n }\n }\n return count;\n}", "function vowelCounter(string) {\n var vowelCount = 0;\n var input = string.toLowerCase();\n //loop throught string as an array\n for (var i=0; i < input.length; i++) {\n if (input[i] === 'a' || input[i] === 'e' || input[i] === 'i' || input[i] === 'o' || input[i] === 'u' ) {\n vowelCount++\n }\n }\n return vowelCount;\n }", "function vowelCount(str){\n var result = 0;\n str = str.split(\"\");\n str.forEach(function(letter){\n if(/[aeiou]/i.test(letter)){\n result ++;\n }\n });//end of forEach\n return result;\n}", "function VowelCount(str) { \n let count = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === 'a' || str[i] === 'e' || str[i] === 'i' || str[i] === 'o' || str[i] === 'u') {\n count++;\n }\n }\n return count;\n}", "function numVowels (str) {\n let count = 0;\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n\n for (let char of str) {\n for (let vowel of vowels) {\n if (char.toLowerCase() === vowel) count++;\n }\n }\n\n console.log (`The number of vowels in ${str} is = ${count}`);\n}", "function vowelCount(str1)\n{\n var vowelList = 'aeiouAEIOU';\n var vlcount = 0;\n \n for(var x = 0; x < str1.length ; x++)\n {\n if (vowelList.indexOf(str1[x]) !== -1)\n {\n vlcount += 1;\n }\n \n }\n return vlcount;\n}", "function countVowels(arr){\n var str = arr.toString();\n var count = 0;\n count = countVowelsInStr(str, count);\n return count;\n }", "function vowelCount(str) {\n let splitArr = str.split(\"\")\n let obj = {};\n const vowels = 'aeiou';\n\n splitArr.forEach(function(val) {\n let lowerCasedLetter = val.toLowerCase();\n if(vowels.indexOf(lowerCasedLetter) !== -1) {\n if (obj[lowerCasedLetter]) {\n obj[lowerCasedLetter]++;\n } else {\n obj[lowerCasedLetter] = 1;\n }\n }\n })\n\n}", "function vowelCount(sentence)\n{\n let vowList = 'aeiouAEIOU';\n let vCount = [];\n \n for(let i = 0; i < sentence.length ; i++) {\n if (vowList.indexOf(sentence[i]) !== -1)\n {\n vCount ++;\n }\n }\n let output2 = `${vCount} vowels found`;\n console.log(output2);\n}", "function vowel_count(str1)\n{\n var vowel_list = 'aeiouAEIOU';\n var vcount = 0;\n \n for(var x = 0; x < str1.length ; x++)\n {\n if (vowel_list.indexOf(str1[x]) !== -1)\n {\n vcount += 1;\n }\n \n }\n return vcount;\n}", "function vowel_count(str1)\n{\n var vowel_list = 'aeiouAEIOU';\n var vcount = 0;\n \n for(var x = 0; x < str1.length ; x++)\n {\n if (vowel_list.indexOf(str1[x]) !== -1)\n {\n vcount += 1;\n }\n \n }\n return vcount;\n}", "function vowel_count(str1) {\n var vowel_list = \"aeAE\";\n var vcount = 0;\n\n for (var x = 0; x < str1.length; x++) {\n if (vowel_list.indexOf(str1[x]) !== -1) {\n vcount += 1;\n }\n }\n return vcount;\n}", "function vowelCount(str) {\n\n // put all vowels from the string into an array\n var vowels = str.match(/[aeiou]/gi);\n\n // if there are no vowels in the string return 0\n // else return the length of the array containing the vowels\n return (vowels === null) ? 0 : vowels.length;\n\n}", "function vowelCounter(string) {\n return string.match(/[aeiou]/ig).length\n}", "function getVowelCount(string){\n var count = 0;\n for (var i = 0; i < string.length; i++) {\n var character = string[i];\n if (character === 'a' || character === 'e' || character === 'i' || character === 'o' || character === 'u') {\n count++;\n }\n }\n return count;\n}", "function getCount(test) {\r\n var vowelsCount = 0;\r\n let tempStr = test.split(\"\");\r\n let vowel = [\"a\",\"e\",\"i\",\"o\",\"u\"];\r\n for(let i = 0; i < str.length ; i++){\r\n for(let j = 0; j < str.length ; j++){\r\n if(tempStr[i].includes(vowel[j])){\r\n vowelsCount++;\r\n }\r\n }\r\n }\r\n \r\n return vowelsCount;\r\n }", "function vowelCount(str) {\n const vowels = \"aeiou\";\n let counter = 0;\n for (i = 0; i < str.length; i++) {\n if (vowels.indexOf(str[i].toLowerCase()) > -1) {\n counter++;\n }\n }\n return counter;\n}", "function vowelCounter(sentence){\n var vowels = 'AEIOUaeiou';\n var vowelCounter = 0;\n \n for(var x = 0; x < sentence.length ; x++)\n {\n if (vowels.indexOf(sentence[x]) !== -1)\n {\n vowelCounter += 1;\n }\n \n }\n return vowelCounter;\n}", "function vowelCount(str) {\n var array = str.split(\"\")\n var vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']\n var count = 0\n \n for(var i = 0; i < array.length; i++) {\n if (vowels.includes(array[i])) {\n count++\n }\n } \n console.log(count)\n}", "function VowelCount(str) {\n const vowels = {\n a: true,\n e: true,\n i: true,\n o: true,\n u: true,\n };\n count = 0;\n for (let i = 0; i < str.length; i++) {\n if (vowels[str[i]]) {\n count++;\n }\n }\n return count;\n}", "function vowels(str) {\n // split str into arr, all lowercased\n let arr = str.toLowerCase().split('')\n // set counter\n let counter = 0\n // loop thru arr\n // if element is vowel, counter++\n arr.forEach(char => {\n if (isVowel(char)) {\n counter++\n }\n })\n return counter\n}", "function getCount(str) {\n var vowelsCount = 0;\n \n const split = str.split(\"\") \n for (let i=0; i< split.length; i++){\n if(split[i] === 'a'|| split[i] ==='e'|| split[i] === 'i'|| split[i] === 'o'||\n split[i] === 'u') {\n vowelsCount+=1\n }\n }\n return vowelsCount;\n }", "function count(string) {\n let vowels = 0; \n let lowerCaseString = string.toLowerCase(); \n for (let i = 0; i < lowerCaseString.length; i++) {\n if (lowerCaseString[i] === 'a') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'e') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'i') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'o') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'u') {\n vowels = vowels +1; \n }\n }\n return vowels; \n}", "function vowelCount(str) {\n var m = str.match(/[aeiou]/gi);\n return m === null ? 0 : m.length;\n }", "function countVowels(str){\n //Use .split method to break string apart into digestable bits for later.\n let splitString=str.split('');\n //Declare an object that will store the number of each vowel within.\n let numOfVowels={};\n //Declare a variable that identifies what vowels are.\n let vowels=\"aeiou\";\n \n //Use previous split string and apply .forEach to compare each letter of a string to the previously declared vowel variable\n splitString.forEach((letter)=>{\n //Declare if statement that uses .indexOf method to compare each element. Also use .toLowerCase to ensure nothing is missed.\n if(vowels.indexOf(letter.toLowerCase())!==-1){\n //If the vowel passes, add to object.\n if(letter in numOfVowels){\n numOfVowels[letter]++;\n //Otherwise, keep checking\n }else{\n numOfVowels[letter]=1;\n }\n } \n \n });\n //Return object\n return numOfVowels; \n }", "function getCount(str) {\n let vowelsCount = 0;\n for (current_char of str) {\n if (current_char === 'a' | current_char === 'e' | current_char === 'i' | current_char === 'o' | current_char === 'u') {\n vowelsCount++;\n }\n }\n return vowelsCount;\n }", "function VowelCount(str) {\n var counter = 0;\n var vowels = \"aeiou\";\n\n //loop through every character in string\n for (var i = 0; i < str.length; i++) {\n //if vowel, increment counter\n if (vowels.indexOf(str[i]) !== -1) {\n counter++;\n }\n }\n\n return counter;\n}", "function getCount(str) {\n var vowelsCount = 0;\n var vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"];\n for(var i = 0;i < str.length;i++){\n for(var j=0;j<vowels.length;j++){\n if(str[i] === vowels[j]){\n vowelsCount++;\n }\n }\n }\n \n return vowelsCount;\n }", "function getCount(str) {\n var vowelsCount = 0;\n var vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"];\n for(var i = 0;i < str.length;i++){\n for(var j=0;j<vowels.length;j++){\n if(str[i] === vowels[j]){\n vowelsCount++;\n }\n }\n }\n \n return vowelsCount;\n }", "function getCount(str) {\n var vowels = str.match(/[aeiouAEIOU]/gi);\n return vowels === null ? 0 : vowels.length;\n}", "function countVowels(word) {\n let vowelCounter = 0;\n let vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n for (let i = 0; i < word.length; i++) {\n if (vowels.includes(word[i])) {\n vowelCounter += 1\n }\n }\n return vowelCounter\n}", "function getCount4(str) {\n const vowels = {\n a: true,\n e: true,\n i: true,\n o: true,\n u: true\n };\n\n return str.split('').filter((currentLetter) => vowels[currentLetter]).length;\n}", "function howManyVowels (z){\n \n let vowelsQuantity = z.match(/[aeiou]/gi).length;\n return vowelsQuantity\n}", "function numVowels(string) {\n var counter = 0;\n var newString = string.toUpperCase();\n for (var i = 0; i < string.length; i++) {\n if ((newString[i] === 'A') ||\n (newString[i] === 'E') ||\n (newString[i] === 'I') ||\n (newString[i] === 'O') ||\n (newString[i] === 'U')) {\n counter++;\n }\n }\n return counter;\n}", "function vowelCount(str) {\n var matches = str.match(/[aeiou]/gi);\n\n if(matches.includes(\"i\") ||matches.includes(\"o\") || matches.includes(\"a\") || matches.includes(\"e\") || matches.includes(\"u\") ){\n\n return matches.length;\n }else{\n\n return 0;\n }\n\n}", "function vowels(a) {\n var i;\n var counter = 0;\n for (i = 0; i < a.length; i++)\n if (a[i] == \"a\" || a[i] == \"e\" || a[i] == \"o\" || a[i] == \"i\" || a[i] == \"u\" || a[i] == \"A\" || a[i] == \"E\" || a[i] == \"O\" || a[i] == \"I\" || a[i] == \"U\") {\n\n counter++;\n }\n\n return counter;\n\n}", "function vowels(str) {\n let counter = 0;\n for (let char of str.toLowerCase()) {\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n counter++\n }\n }\n return counter\n}", "function findNumberOfVowels(mySentence) {\n const vowelList = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n let currentVowelCount = 0; \n const arrayOfLetters = mySentence.toLowerCase().split(\"\"); \n \n for(let x = 0; x < arrayOfLetters.length; x++) {\n if (vowelList.includes(arrayOfLetters[x])) {\n currentVowelCount += 1; \n }\n }\n return currentVowelCount; \n}", "function count_vowels(word) {\n let vowels = 0;\n let i = 0;\n\n while (i < word.length) {\n let char = word[i];\n if (char == \"a\" || char == \"e\" || char == \"i\" || char == \"o\" || char == \"u\") {\n vowels++\n };\n i++\n };\n return vowels\n}", "function countVowels(str){\n let vowelCount=0;\n for(let i=0; i<str.length; i++){\n if('AEIOUaeiou'.includes(str[i])){\n vowelCount++;\n }\n }\n return vowelCount;\n}", "function countVowels(str) {\r\n\r\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\r\n\r\n var string = str;\r\n var len = string.length;\r\n \r\n var counter = 0;\r\n\r\n for (var i = 0; i < len; i++) {\r\n\r\n for (var j = 0; j < 6; j++ ) {\r\n\r\n if (vowels[j] === string[i]) {\r\n counter++;\r\n }\r\n \r\n } \r\n\r\n }\r\n\r\nconsole.log(\"No. of Vowels In The String: \" + counter);\r\n \r\n}", "function vowelCount(str1)\n{\n var vowels = 'aeiouAEIOU';\n var count = 0;\n\n for(var i = 0; i < str1.length ; i++)\n {\n if (vowels.indexOf(str1[i]) !== -1)\n {\n count += 1;\n }\n\n }\n return count;\n}", "function findOccurrences() {\n var str = \"Pleases read this application and give me gratuity\";\n var count = 0;\n let haveSeenVowel = false;\n \n for (const letter of str.toLowerCase()) {\n switch (letter) {\n case 'a':\n case 'e':\n case 'i':\n case 'o':\n case 'u':\n {\n if (haveSeenVowel) {\n count++;\n haveSeenVowel = false;\n } else {\n haveSeenVowel = true;\n }\n break;\n }\n default:\n haveSeenVowel = false\n }\n }\n \n return count\n }", "function countVowels(word) {\n // TODO: Place your code here\n}", "function getCount(str) {\n let vowelsMatch = \"aeiou\";\n //this is your counter\n let vowelsCount = 0;\n //loop over the string that is passed in \n for (i=0; i < str.length; i++) {\n //loop over the vowels string to compare each index position against the string that was passed in to find any matches\n for (v=0; v < vowelsMatch.length; v++) {\n // if any 2 indexes are equal, add 1 to the vowel count\n if (str[i] === vowelsMatch[v]) {\n vowelsCount++;\n }\n }\n }\n return vowelsCount;\n }", "function getCount(str) {\n var vowelsCount = 0;\n if (str.match(/[(a)+(e)+(i)+(o)+(u)+]/g)){\n vowelsCount = str.match(/[(a)+(e)+(i)+(o)+(u)+]/g).length;\n }\n return vowelsCount;\n}", "function getCount(str) {\n var vowelsCount = 0;\n\n let pos = {\n A : str.indexOf(\"a\"),\n E : str.indexOf(\"e\"),\n I : str.indexOf(\"i\"),\n O : str.indexOf(\"o\"),\n U : str.indexOf(\"u\")\n }\n\n while ( pos.A != -1 ) {\n vowelsCount++;\n pos.A = str.indexOf( \"a\", pos.A + 1 );\n }\n while ( pos.E != -1 ) {\n vowelsCount++;\n pos.E = str.indexOf( \"e\", pos.E + 1 );\n }\n while ( pos.I != -1 ) {\n vowelsCount++;\n pos.I = str.indexOf( \"i\", pos.I + 1 );\n }\n while ( pos.O != -1 ) {\n vowelsCount++;\n pos.O = str.indexOf( \"o\", pos.O + 1 );\n }\n while ( pos.U != -1 ) {\n vowelsCount++;\n pos.U = str.indexOf( \"u\", pos.U + 1 );\n }\n return vowelsCount;\n}", "function vowelCount(str){\n let count = 0\n str = str.toLowerCase()\n //return(console.log(str.length))\n if(str.length==0){\n return 'Empty String'\n }\n for(let i = 0; i<=str.length; i++){\n //console.log(str[i])\n //let stringLower = str[i]\n if((str[i]=='a') || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u'){\n count = count + 1\n }\n}\nreturn count\n}", "function countVowels2(string) {\n //create counter\n //create list of vowels array\n //for each char in str\n //if Vowels array contains char\n //increment counter\n //return counter\n \n var counter = 0;\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n \n for (var char of string) {\n if (vowels.includes(char.toLowerCase())) {\n counter++;\n }\n }\n \n return counter;\n }", "function countVowels(string)\n{\n\tvar count = 0;\n\tvar vowel ='aeiouAEIOU'\n\tfor(var i =0;i<string.length;i++)\n\t\t{\n\t\t\tif(vowel.indexOf(string[i]) !== -1)\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\n\t\t}\n\treturn count\n}", "function countVowels(str) {\n const strLower = str.toLowerCase()\n const vowels = 'aeiou'\n let count = 0\n\n for (let i = 0; i < strLower.length; i++) {\n if (vowels.indexOf(strLower[i]) !== -1) {\n count += 1\n }\n }\n\n // console.log(count)\n return count\n}", "function vowels(arrayelement)\n {\n const vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n var count = 0 ;\n for (let char of arrayelement.toLowerCase())\n {\n if (vowels.includes(char)) \n {\n count++;\n }\n }\n return count;\n }", "function VowelCount(str) {\n\n // First, we Remove all characters in the string that aren't vowels with the .replace method.\n // Note that ^ in Regex means \"all characters not in the set\", so placing it in front of aeiou means \"Match everything that isn't a vowel\"\n // Enclosing a set in [] means that our string matches any individual character in that set\n // Ending with our /g tag signifies that we want to do a global search and lets our engine know to going through the entire string.\n str = str.replace(/[^aeiuo]/g, \"\");\n\n // Finally, we return the length of the string to \"count\" how many vowels are left.\n return str.length;\n}", "function numOfVowels(string) {\n var m = string.match(/[aeiou]/gi);\n return m === null ? 0 : m.length;\n}", "function getNumberOfVowels(str) {\r\n // code ...\r\n return [...str].filter(function (letter) {\r\n return \"aąeęėiįoyuųū\".includes(letter.toLowerCase());\r\n }).length;\r\n\r\n // return Array.from(str).filter(letter => 'aąeęėiįoyuųū'.includes(letter)).length\r\n }", "function countVowels(str) {\n let vowels = 'aeiouAEIOU';\n let count = 0;\n\n for (let i = 0; i < str.length; i++) {\n if (vowels.indexOf(str[i]) !== -1) {\n count += 1;\n }\n }\n\n return count;\n\n\n}", "function countVowels(target) {\n const characters = ['a', 'e', 'i', 'o', 'u'];\n let number = 0;\n\n for (let i = 0; i < target.length; i++) {\n if(characters.includes(target[i])) {\n number++;\n }\n }\n return number;\n}", "function countVowel(word) {\n word = word.match(/[aeiouAEIOU]/gi);\n return word.length;\n}", "function countVowels1(str) {\n\n\tlet sum = 0;\n\tlet letters = str.split('');\n\n\tfor (let i = 0; i < letters.length; i++) {\n\n\t\tconst l = letters[i];\n\n\t\tif (l === 'a' || l === 'e' || l === 'i' || l === 'o' || l === 'u') {\n\n\t\t\tsum++;\n\t\t}\n\t}\n\n\treturn sum;\n}", "function vowels(str) {\n let count = 0;\n let checker = \"aeiou\"; // or we have give it as an array = ['a','e','i','o','u'] \n for (let char of str.toLowerCase()) {\n if (checker.includes(char)) {\n count++\n }\n\n }\n return count;\n}", "function getCount(str) {\n let vowelsRegex = /[a,e,i,o,u]/g\n let result = str.match(vowelsRegex)\n return result ? result.length : 0\n}", "function countVowelConsonant(str) {\n\n return str.split(\"\").reduce(function (accumulator, currentValue) {\n let i=2;\n if(\"aeiou\".indexOf(currentValue) != -1) i=1; \n return accumulator +i;\n }, 0);\n }", "function Vowels(str5) {\n var sliptString = str5.split(\"\");\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"];\n return sliptString.reduce(function(acc, next) {\n if (vowels.indexOf(next) !== -1) {\n acc += 1;\n }\n return acc;\n }, 0)\n}", "function vowels(str) {\n\tlet arr = str.split('')\n\tlet newArr = []\n\tlet count = 0\n\n\tlet vowelObj = { a: true, e: true, i: true, o: true, u: true}\n\n\tfor (let i = 0; i < arr.length; i++) {\n\t\t// vowelObj['a']\n\t\tif (vowelObj[arr[i]]) {\n\t\t\tcount += 1\n\t\t} \n\t}\n\n\t// for (let i = 0; i < arr.length; i++) {\n\t// \t// includes\n\t// \tif (vowelArr.includes(arr[i])) {\n\t// \t\tnewArr.push(arr[i])\n\t// \t}\n\t// }\n\treturn count\n}", "function countVowels(str)\r\n {\r\n for (var i = 0; i < str.length; i++)\r\n if (isVowel(str[i]))\r\n \r\n // Check for vowel\r\n console.log(str[i]);\r\n console.log(str);\r\n return str;\r\n }", "subtractOneForE(aStr){\n let vowelsCount = this.countVows(aStr);\n if(aStr.endsWith('e')){\n vowelsCount --;\n }\n return vowelsCount;\n\n }", "function countVowelConsonant(str) {\n let count = 0\n for (let i = 0; i < str.length; i++) { // for each letter in the string, add 1 to count if the letter is a vowel.\n if (str[i] === \"a\" || str[i] === \"e\" || str[i] === \"i\" || str[i] === \"o\" || str[i] === \"u\") {\n count += 1\n } else { // if the letter is not a vowel, add 2 to count.\n count += 2\n }\n } return count\n }", "function vowels(str) {\n const regex = /[aeiouAEIOU]/\n return [...str].reduce((acc, curr) => {\n curr.match(regex) ? acc += 1 : null\n return acc\n }, 0)\n}", "function countVowels(string2) {\n let match = string2.match(/[aeiou]|[AEIOU]/g);\n let output3 = `${match.length} vowels found`;\n console.log(output3); \n}", "function countVowels(string) {\n if (string.length === 0) {\n return 0;\n }\n if (string.slice(0, 1).toUpperCase() === \"A\" || string.slice(0, 1).toUpperCase() === \"E\" \n || string.slice(0, 1).toUpperCase() === \"I\" || string.slice(0, 1).toUpperCase() === \"O\" \n || string.slice(0, 1).toUpperCase() === \"U\") {\n return increment(countVowels(string.slice(1)));\n }\n return countVowels(string.slice(1))\n}", "function getCount(str) {\n return (str.match(/[aeiou]/ig)||[]).length;\n }", "function findVowels(str) {\n str.toLowerCase();\n const inArr = str.split('');\n const vowels = inArr.filter(item => item === \"a\" || item === \"e\" || item === \"i\" || item === \"o\" || item === \"u\");\n return vowels.length;\n}", "function vowels(str) {\n const matches = str.match(/[aeiou]/gi);\n\n return matches ? matches.length : 0;\n}", "function getCount(str) {\n return str.toLowerCase().split('').filter(function(char) {\n return char == 'a' || char == 'e' || char == 'i' || char == 'o' || char == 'u';\n }).length;\n}", "function vowels(str) {\n\tlet obj = {'a':1,'e':1,'i':1,'o':1,'u':1};\n\tlet counter = 0;\n\tfor(i=0;i<str.length;i++){\n\t\tif(obj[str[i].toLowerCase()]){\t\t\t\t\t\t//trying to reference the object, if it is falsy, it is not a property\n\t\t\tcounter++;\n\t\t}\n\t}\n\treturn counter;\n}", "function vowelBonusScore (word){\n let score = 0;\n let vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n for (let i = 0; i < word.length; i++){ \n if (vowels.includes(word[i])) {\n score += 3;\n } else { \n score += 1\n } \n }\n return score;\n}", "function countVowels(stringEntered) {\n let count = 0;\n for (let i = 0; i < stringEntered.length; i++) {\n if (\n stringEntered[i] === \"a\" ||\n stringEntered[i] === \"e\" ||\n stringEntered[i] === \"i\" ||\n stringEntered[i] === \"o\" ||\n stringEntered[i] === \"u\"\n )\n count++;\n }\n return count;\n}", "function vowels(inputString) {\n const vowelListStr = 'aeiou';\n\n inputString = inputString.toLowerCase();\n\n const stringArr = inputString.split('');\n\n const vowels = stringArr.filter(char => vowelListStr.includes(char));\n return vowels.length;\n}", "function vowelBonusScore(word) {\n \tword = word.toUpperCase();\n let points = 0;\n for(i=0; i<word.length; i++){\n if (word.slice(i, i+1)==='A' || word.slice(i, i+1)==='E'|| word.slice(i, i+1)==='I' || word.slice(i, i+1)==='O' || word.slice(i, i+1)==='U'){\n points = points + 3;\n }\n else {\n points = points + 1;\n }\n }\n //console.log(points);\n return points;\n}", "function vowelsInString(vowelsWithin){\n let count = 0; //used to count the number of vowels that are insisde of the string\n let vowels = 'aeiou'; // going to be used to compare strings\n\n for (let i=0; i< vowelsWithin.length;i++){ // .length shows me all the characters in the string vowelWithin.\n if(vowels.indexOf(vowelsWithin[i].toLowerCase()) > -1) { // indexOf shows me the index number of the string and if the character is not found then it displays a -1, so all values greater than -1 will be within the string vowelWithin.\n count ++;\n }\n }\n return count;\n}", "subtractOneFConstVowel(aStr){\n let vowelCount = this.subtractOneForE(aStr);\n if(aStr.match(/aa|oo|ee|ii|uu/gi)){\n return vowelCount - aStr.match(/aa|oo|ee|ii|uu/gi).length\n }else{\n return vowelCount;\n }\n }", "function vowelIndices(word){\n// 1. Define an empty array we can push index values into\n var arr = [];\n//2. Iterate through 'word', searching for vowels\n for (i = 0 ; i <word.length; i++) {\n//3. Use 'indexOf' to find locations of vowels inside of 'word'\n if ('aeiouy'.indexOf(word[i]) !== -1)\n//4. As long as the vowels are located inside of 'word' (ie not -1), push their index location into an array\n arr.push(i+1);\n }\n//5. Print the array\n return arr;\n}", "function vowels2(str) {\n const matches = str.match(/[aeiou]/gi);//g is for continue the search and i is case-insensitive \n return matches ? matches.length : 0;\n}", "function vowels2(str) {\n /* RegEx tips:\n g -> make sure we don't stop at the first match\n i -> case insensitive\n */\n const matches = str.match(/[aeiou]/gi)\n return matches ? matches.length : 0\n}", "function vowelBonusScore(userWord) {\n let score = 0;\n let vowel = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n for (let i = 0; i < userWord.length; i++) {\n if (vowel.includes(userWord[i].toLowerCase())) {\n score += 3;\n } else {\n score += 1;\n }\n }\n return(score);\n\n}" ]
[ "0.81807715", "0.79066265", "0.78577167", "0.7847525", "0.7834786", "0.77947104", "0.77783763", "0.76659334", "0.76409614", "0.7620593", "0.7597341", "0.75891644", "0.7570892", "0.7554376", "0.75438464", "0.75330657", "0.75097483", "0.74998695", "0.749715", "0.7488472", "0.748662", "0.74841815", "0.7482876", "0.7479638", "0.7475234", "0.7475234", "0.7474596", "0.74726266", "0.746156", "0.74596775", "0.7456978", "0.7432664", "0.74280226", "0.742384", "0.7420489", "0.7402033", "0.73998207", "0.7388451", "0.7356815", "0.7314589", "0.7311861", "0.7309813", "0.7301255", "0.7301255", "0.72957647", "0.7291729", "0.7286153", "0.7280474", "0.726543", "0.7253216", "0.724713", "0.7241781", "0.7240647", "0.723406", "0.72340196", "0.72306883", "0.7214738", "0.7204159", "0.7200369", "0.7170533", "0.713058", "0.7123598", "0.7116864", "0.7112859", "0.71122086", "0.71037596", "0.70841396", "0.7058086", "0.7057409", "0.7044521", "0.7034478", "0.7022764", "0.6958709", "0.6953783", "0.69225866", "0.6913197", "0.6886967", "0.6882664", "0.6868802", "0.6804637", "0.6775525", "0.67398113", "0.672648", "0.6710879", "0.67086285", "0.6701131", "0.6690007", "0.6686252", "0.66512877", "0.6642173", "0.6639899", "0.663719", "0.6611771", "0.65876675", "0.65378356", "0.65267235", "0.6525276", "0.6511777", "0.6498464", "0.6464993" ]
0.81547403
1
Old way to join javascript vaiables with a string
function getMessage() { const year = new Date().getFullYear(); console.log(year); // 2017 return "The year is: " + year; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function concat_string() {\n return Array.prototype.slice.call(arguments).join('');\n} // end concat_string", "function strcat() { // takes as many strings as you want to give it.\n $strcatr = \"\";\n $isjs = js();\n $args = $isjs ? arguments : func_get_args();\n for ($strcati=count($args)-1; $strcati>=0; $strcati--) {\n $strcatr = $isjs ? $args[$strcati] + $strcatr : $args[$strcati] . $strcatr;\n }\n return $strcatr;\n}", "function join() {\n for (var _len = arguments.length, fields = Array(_len), _key = 0; _key < _len; _key++) {\n fields[_key] = arguments[_key];\n }\n\n return fields.join(' ');\n}", "function sc_string() {\n for (var i = 0; i < arguments.length; i++)\n\targuments[i] = arguments[i].val;\n return \"\".concat.apply(\"\", arguments);\n}", "function str() {\n return array(arguments).join(\"\");\n}", "function str() {\n return Array.prototype.join.call(arguments, \"\");\n }", "function concat_string() {\n\tvar pieces = Array.prototype.slice.call(arguments);\n\tvar output = pieces.join('');\n\treturn output;\n}", "function join() {\n return normal(Array.join(arguments, SEPARATOR));\n}", "function sc_stringAppend() {\n return \"\".concat.apply(\"\", arguments);\n}", "function fancyJoin(a,b) {\n if (a == \"\") { return b; }\t\r else if (b == \"\") { return a; }\r else { return a+\"+\"+b; }\r}", "function join(array, string) {}", "function join(stringOne, stringTwo) {\n // YOUR CODE BELOW HERE //\n \n // Declare a variable called args to store a collection of arguments. \n // The Array.from() creates an array from an array-like object. \n var args = Array.from(arguments);\n // The .join() method returns the strings combined together with \"\" during the call of function join.\n return args.join(\"\");\n \n // YOUR CODE ABOVE HERE //\n}", "function joinStrings() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.filter(Boolean).join(' ');\n }", "function join(x)\r\n{\r\n a=x.join(',') ;\r\n b=x.join('+') ;\r\n console.log('\"'+a+'\"') ;\r\n console.log('\"'+b+'\"') ;\r\n \r\n}", "function stringConcat(arr) {\n return arr.join('');\n}", "function join(arr) {\n var res = '';\n for (var i = 0; i < arr.length; i++)\n res += arr[i];\n return res;\n}", "toString(glue, pieces, property_name){\n \tlet result = '';\n \tif (pieces) {\n \tresult = pieces\n \t\t\t.map((p) => { return p[property_name];})\n \t\t\t.reduce((prev, curr) => [prev, ', ', curr]);\n }\n return result;\n }", "function concat() {\n concatenated = \"\";\n for (var i = 0; i < arguments.length; i++) {\n concatenated += arguments[i];\n }\n return concatenated;\n}", "function joinStrings(string1, string2){\n return `${string1} ${string2}`;\n}", "function join(s, arr) {\n\t\tvar str = arr[0];\n\t\tfor(var i = 1; i < arr.length; i++) {\n\t\t\tstr += s + arr[i];\n\t\t}\n\t\treturn str;\n\t}", "function myConcat(separator) {\n var result = \"\"; // initialize list\n var i;\n // iterate through arguments\n for (i = 1; i < arguments.length; i++) {\n result += arguments[i] + separator;\n }\n return result;\n}", "join(seperator = \",\") {\n let str = \"\";\n for (let i in this)\n str += seperator + this[i];\n return str;\n }", "function stringVariator() {\n let existingString = \"\";\n function inner(stringType) {\n if (typeof stringType === \"string\") {\n existingString.concat(stringType);\n } else if (Array.isArray(stringType)) {\n existingString.concat(stringType.join(\" \"));\n }\n return existingString + \".\";\n }\n return inner;\n}", "function joinElements(a) {\r\n return a.join(',');\r\n}", "function f(a,b,c){\n var s=Array.prototype.join.call(arguments);\n console.log(s);\n}", "function join_expr(n) {\n if (n.length < 1) return \"\";\n var s = \"\";\n var i = is_array(n[0]) ? 0 : 1;\n while (i < n.length) {\n s += is_string(n[i]) ? n[i] : join_expr(n[i]);\n i++;\n }\n return s;\n}", "function toString(value){return ''+value;}", "function join(arr) {\n let res = \"\";\n for (let i = 0; i < arr.length; i++)\n res += arr[i];\n return res;\n}", "function join(arr) {\n let res = \"\";\n for (let i = 0; i < arr.length; i++)\n res += arr[i];\n return res;\n}", "function _strContent(v,sep) {\r\n\tif(!v) return \"\";\r\n\tif(typeof v === 'function') return v() || '';\r\n\tif(Array.isArray(v)) {\r\n\t\treturn v.map( str => _strContent(str, sep)).join(sep||\"\");\r\n\t}\r\n\tif(typeof v === 'string') return v || '';\r\n\t\r\n\treturn \"\"+v;\r\n}", "function concatValues(obj) {\n var value = '';\n for (var prop in obj) {\n value += obj[prop];\n }\n return value;\n }", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function joinElement(arr) {\n return arr.toString();\n}", "function makeString(item, join) {\n if (join === void 0) { join = ','; }\n if (item === null) {\n return 'COLLECTION_NULL';\n }\n else if (isUndefined(item)) {\n return 'COLLECTION_UNDEFINED';\n }\n else if (isString(item)) {\n return item.toString();\n }\n else {\n var toret = '{';\n var first = true;\n for (var prop in item) {\n if (exports.has(item, prop)) {\n if (first) {\n first = false;\n }\n else {\n toret = toret + join;\n }\n toret = toret + prop + ':' + item[prop];\n }\n }\n return toret + '}';\n }\n}", "function _join_args(args) {\n var message = \"\";\n for (var msg in args)\n message += args[msg];\n return message;\n}", "function jsCat(strs, sep) {\n var arr = [];\n strs = E(strs);\n while(strs._) {\n strs = E(strs);\n arr.push(E(strs.a));\n strs = E(strs.b);\n }\n return arr.join(sep);\n}", "function jsCat(strs, sep) {\n var arr = [];\n strs = E(strs);\n while(strs._) {\n strs = E(strs);\n arr.push(E(strs.a));\n strs = E(strs.b);\n }\n return arr.join(sep);\n}", "function join(separator, ...values) {\r\n return values.join(separator);\r\n}", "asString() {\nvar x, y, z;\n[x, y, z] = this.xyz;\nreturn `<${x} ${y} ${z}>`;\n}", "niceList(array, join, finalJoin) {\n var arr = array.slice(0), last = arr.pop();\n join = join || ', ';\n finalJoin = finalJoin || ' and ';\n return arr.join(join) + finalJoin + last;\n }", "function toString(value){return''+value;}", "function toString(value){return''+value;}", "function toString(value){return''+value;}", "function toString(value){return''+value;}", "function toString(value){return''+value;}", "function toString(value){return''+value;}", "function _string(obj) {\n return exports.PREFIX.string + ':' + obj;\n}", "function joinData(data) {\n return withoutEmptyStrings(data).join(\" ; \");\n}", "function concatValues( obj ) {\r\n var value = '';\r\n for ( var prop in obj ) {\r\n value += obj[ prop ];\r\n }\r\n return value;\r\n}", "function fooBar(a){ return \"\"+a}", "function concatValues( obj ) {\n var value = '';\n for ( var prop in obj ) {\n value += obj[ prop ];\n }\n return value;\n }", "function concatValues( obj ) {\n var value = '';\n for ( var prop in obj ) {\n value += obj[ prop ];\n }\n return value;\n }", "function concatValues( obj ) {\n var value = '';\n for ( var prop in obj ) {\n value += obj[ prop ];\n }\n return value;\n }", "function join(a, b) {\n console.log(a + b)\n}", "function concatValues( obj ) {\n var value = '';\n for ( var prop in obj ) {\n value += obj[ prop ];\n }\n return value;\n}", "function fill (val) {\n while (typeof val === 'function') {\n val = val(req)\n }\n if (val === undefined || val === null) return ''\n if (typeof val === 'string') return val\n if (Array.isArray(val)) {\n return val.map(fill).join('')\n }\n // not much we can after here, so this is more diagnostic\n if (typeof val === 'object') return val // H.safe, JSON.stringify(val)\n return val.toString()\n }", "function concatenation(){\nconcString();\nconcNumStr();\nconcNumStrAsNum();\n}", "function join(arr, str) {\n return arr.join(str);\n}", "function _join(pre, tail) {\n var _hasBegin = !!pre\n if(!_hasBegin) pre = ''\n if (/^\\[.*\\]$/.exec(tail)) return pre + tail\n else if (typeof(tail) == 'number') return pre + '[' + tail + ']'\n else if (_hasBegin) return pre + '.' + tail\n else return tail\n}", "function makeString(item, join) {\n if (join === void 0) { join = \",\"; }\n if (item === null) {\n return 'COLLECTION_NULL';\n }\n else if (isUndefined(item)) {\n return 'COLLECTION_UNDEFINED';\n }\n else if (isString(item)) {\n return item.toString();\n }\n else {\n var toret = \"{\";\n var first = true;\n for (var prop in item) {\n if (has(item, prop)) {\n if (first)\n first = false;\n else\n toret = toret + join;\n toret = toret + prop + \":\" + item[prop];\n }\n }\n return toret + \"}\";\n }\n}", "function addComma(str){\r\n return \", \"+str;\r\n}", "function jsCat(strs, sep) {\n var arr = [];\n strs = E(strs);\n while(strs[0]) {\n strs = E(strs);\n arr.push(E(strs[1]));\n strs = E(strs[2]);\n }\n return arr.join(sep);\n}", "function buildString(...template){\n return `I like ${template.join(',')}`;\n}", "function join(separator) {\n if (separator === void 0) { separator = ','; }\n return new lift_1.StringOps(this.value().join(separator));\n}", "function mapJoin(arr, sep, foo){\n if (foo === undefined){\n foo = sep;\n sep = \"\";\n }\n return $.map(arr, foo).join(sep);\n}", "function joinObj(a, attr) {\n var out = [];\n\n for (var i = 0; i < a.length; i++) {\n out.push(a[i][attr]);\n }\n\n return out.join(\", \");\n}", "function stringify$1(selector) {\n return selector.map(stringifySubselector).join(\", \");\n}", "static _append(str, obj) {\r\n if (Array.isArray(obj)) {\r\n return HookManager._appendArrayString(str, obj);\r\n }\r\n else if (typeof obj == \"object\") {\r\n return HookManager._appendObjectString(str, obj);\r\n }\r\n else if (typeof obj == \"function\")\r\n str += obj.toString().replace(/\\s/g, \"\");\r\n else if (typeof obj == \"bigint\")\r\n str += util.inspect(obj);\r\n else\r\n str += JSON.stringify(obj);\r\n return str;\r\n }", "function addString(a,b){\n\tconst fullName = a +\" \"+ b;\n\n\treturn fullName;\n}", "function concat(...params) {\n return output(params).apply(array => array.join(\"\"));\n}", "function makeString(item, join) {\n if (join === void 0) { join = \",\"; }\n if (item === null) {\n return 'COLLECTION_NULL';\n }\n else if (collections.isUndefined(item)) {\n return 'COLLECTION_UNDEFINED';\n }\n else if (collections.isString(item)) {\n return item.toString();\n }\n else {\n var toret = \"{\";\n var first = true;\n for (var prop in item) {\n if (has(item, prop)) {\n if (first)\n first = false;\n else\n toret = toret + join;\n toret = toret + prop + \":\" + item[prop];\n }\n }\n return toret + \"}\";\n }\n }", "function jsCat(strs, sep) {\n var arr = [];\n strs = E(strs);\n while(strs[0]) {\n strs = E(strs);\n arr.push(E(strs[1])[1]);\n strs = E(strs[2]);\n }\n return arr.join(sep);\n}", "function jsCat(strs, sep) {\n var arr = [];\n strs = E(strs);\n while(strs[0]) {\n strs = E(strs);\n arr.push(E(strs[1])[1]);\n strs = E(strs[2]);\n }\n return arr.join(sep);\n}", "function attrsToStr(attrs){var parts=[];$.each(attrs,function(name,val){if(val!=null){parts.push(name+'=\"'+htmlEscape(val)+'\"');}});return parts.join(' ');}", "function join(seq) {\n var i = seq.length\n , seps = _fmts[\"concat\"]\n , rv = \"\"\n , sep = \"\"\n if (!Object.isArray(seps)) seps = [seps]\n\n while (i--) {\n if (seq[i]) {\n rv += sep + seq[i]\n if (seps.length) sep = seps.pop() }}\n return rv\n }", "function getJoinedConcatParts(node, scope) {\n return node.value.parts.map((part) => getPartValue(part, scope)).join('');\n }", "function join(writer, value, delim) {\n if ( isArray(value) ) {\n return value.join(delim || ' ');\n }\n return value;\n}", "function combineTwoStrings(one,two){\n one.toString(); two.toString();\nreturn one.concat(two);\n}", "function join(array, str) {\n return array.join(str)\n}", "function foo(strings, ...values) {\n var str = \"\";\n for (var i=0; i<strings.length; i++) {\n str += strings[i];\n }\n return str;\n}", "function urlJoinEncode() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i - 0] = arguments[_i];\n }\n return encodeURIComponents(urlPathJoin.apply(null, args));\n}", "function join(array, sep) {\r\n\tvar out = '';\r\n\tArray.prototype.forEach.call(\r\n\t\tarray,\r\n\t\tfunction(item) {\r\n\t\t\tout += typeof item === 'string' ?\r\n\t\t\t\titem + sep :\r\n\t\t\t\tinspect(item) + sep;\r\n\t\t}\r\n\t);\r\n\r\n\treturn out;\r\n}", "function concatInformed() {\n var string = '';\n var array = [$scope.informed.email, $scope.informed.facebook, $scope.informed.webSite,\n $scope.informed.colleague, $scope.informed.other\n ];\n\n array.forEach(function(value) {\n if (value !== '')\n string += value + ', ';\n });\n\n return string.slice(0, string.length - 2);\n }", "function concatenateStrings(string1, string2, string3){\n var newString = string1.toString() + \" \" + string2.toString() + \" \" + string3.toString();\n\n return newString;\n}", "function stringConcat(arr) {\n return arr.reduce((acc, el) => `${acc}${el}`) \n}", "function path_join() {\n // trim slashes from arguments, prefix a slash to the beginning of each, re-join (ignores empty parameters)\n var args = Array.prototype.slice.call(arguments, 0);\n var nonempty = args.filter(function (arg, idx, arr) {\n return typeof (arg) != 'undefined';\n });\n var trimmed = nonempty.map(function (arg, idx, arr) {\n return '/' + String(arg).replace(new RegExp('^/+|/+$'), '');\n });\n return trimmed.join('');\n}", "asString() {\nvar w, x, y, z;\n[x, y, z, w] = this.xyzw;\nreturn `<${x} ${y} ${z}; ${w}>`;\n}", "toString() {\n let result = \"\";\n for (const parameterName in this._rawQuery) {\n if (result) {\n result += \"&\";\n }\n const parameterValue = this._rawQuery[parameterName];\n if (Array.isArray(parameterValue)) {\n const parameterStrings = [];\n for (const parameterValueElement of parameterValue) {\n parameterStrings.push(`${parameterName}=${parameterValueElement}`);\n }\n result += parameterStrings.join(\"&\");\n }\n else {\n result += `${parameterName}=${parameterValue}`;\n }\n }\n return result;\n }", "toString() {\n let result = \"\";\n for (const parameterName in this._rawQuery) {\n if (result) {\n result += \"&\";\n }\n const parameterValue = this._rawQuery[parameterName];\n if (Array.isArray(parameterValue)) {\n const parameterStrings = [];\n for (const parameterValueElement of parameterValue) {\n parameterStrings.push(`${parameterName}=${parameterValueElement}`);\n }\n result += parameterStrings.join(\"&\");\n }\n else {\n result += `${parameterName}=${parameterValue}`;\n }\n }\n return result;\n }", "function mergeToStringUsingFor(elements, delimiter = ',') {\n\n}", "toListString(arr) {\n\t\tif (!arr.length) return '';\n\t\tif (arr.length === 1) return arr[0];\n\t\tif (arr.length === 2) return `${arr[0]} and ${arr[1]}`;\n\t\treturn `${arr.slice(0, -1).join(\", \")}, and ${arr.slice(-1)[0]}`;\n\t}", "function viewparamsToStr(obj) {\n var str = '';\n $.each(obj, function(k,v) {\n str.length && (str += ';');\n str += k + ':' + v;\n });\n return str;\n}", "function join_char(c1,c2){\n return c1;\n}", "function xo(e){return e.join(\";\")}", "function j(a){return a.map(function(a){return\" \"+a})}", "static objectToQueryString(object) {\n return Object.values(object).map(x => \"'\" + x + \"'\").join(',');\n }", "function stringConcat(arr) {\n const result = arr.reduce(arr.toString());\n return result;\n}", "function concat(str1, str2, seperator = \" \") {\r\n}" ]
[ "0.6990018", "0.696693", "0.6904301", "0.68921524", "0.6866057", "0.68396217", "0.6803885", "0.6702852", "0.66888016", "0.6623015", "0.6585783", "0.6428011", "0.6403396", "0.6362277", "0.6299635", "0.6285769", "0.62816155", "0.6258727", "0.6236923", "0.6233475", "0.6222584", "0.61952096", "0.6141884", "0.6131547", "0.61286294", "0.60961545", "0.60833526", "0.60580254", "0.60580254", "0.6034572", "0.60071415", "0.60026634", "0.60026634", "0.60026634", "0.60026634", "0.5970976", "0.59673244", "0.5959946", "0.59505296", "0.59505296", "0.5943898", "0.59430116", "0.5924002", "0.59174335", "0.59174335", "0.59174335", "0.59174335", "0.59174335", "0.59174335", "0.59139353", "0.5903458", "0.5897822", "0.58973664", "0.5884188", "0.5884188", "0.58828026", "0.587164", "0.5862947", "0.58613425", "0.5852487", "0.58364147", "0.58269763", "0.5822323", "0.58205664", "0.58107185", "0.5801913", "0.578411", "0.57839483", "0.5775095", "0.5773704", "0.577139", "0.57648563", "0.5762291", "0.5760883", "0.575991", "0.575991", "0.5720965", "0.5714836", "0.5713784", "0.5708354", "0.5705656", "0.5697005", "0.56960434", "0.56940824", "0.5689513", "0.56859446", "0.5680538", "0.5670351", "0.5662457", "0.56616634", "0.5659921", "0.5659921", "0.56399125", "0.56305075", "0.56299484", "0.56283665", "0.56232506", "0.56206834", "0.56203157", "0.5618597", "0.5611994" ]
0.0
-1
The year is: 2017 refactored code we no longer use double or single quotes, we now use back ticks to write a string Wrap the variable in a dollar sign and opening and closing curly brackets and put it inside the back ticks Gives it a more legible look
function getMessage2() { const year = new Date().getFullYear(); console.log(year); // 2017 return `The year is ${year}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dogOld(years) {\n let YearsCalululation = years * 7;\n console.log(`Your doggo is ${YearsCalululation} years old in human years!`);\n}", "getYearNumerals(year) { return `${year}`; }", "function $currentYear() {\n\tvar d = new Date();\n\tvar n = d.getFullYear();\n\tdocument.getElementById(\"copyright\").innerHTML = '&copy; ' + n + ' - Gallery';\n}", "function supply(age,perDay){\n let totalAge = 80\n let howMuch = (perDay * 365) * (totalAge - age)\n let compiler = `You will need ${howMuch} of your favorite snack to last you till the age of ${totalAge}`\n console.log(compiler)\n}", "function showDate() {\n return `The date is: '01.01.1990'`;\n }", "calcAge() {\n console.log(\n `I'm ${\n 2037 - this.birthYear\n } years old, but as a student I feel more like ${\n 2037 - this.birthYear + 10\n }`\n );\n }", "get yearString(){\n if (parseInt(this.timeSavedMonthes/12) === 1){\n return 'YEAR'\n }\n return 'YEARS'\n }", "function CopyYear(){\r\n\tvar date = new Date();\r\n\tNowYear = date.getFullYear();\r\n\tCopyTxt = \"<h3>Thanks for watching.</h3>\";\r\n\t/*\r\n\tif(NowYear > 2014){\r\n\t\tCopyTxt = (\"&copy; 2014-\"+NowYear+\" Project るろたび.\");\r\n\t}else if(NowYear === 2014){\r\n\t\tCopyTxt = (\"&copy; 2014 Project るろたび.\");\r\n\t}else{\r\n\t\tCopyTxt = (\"&copy; Project るろたび.\");\r\n\t}\r\n\t*/\r\n}", "function Copyright() {\n return <p>Copyright © BlurbSay {new Date().getFullYear()}.</p>;\n}", "function getMessage() {\n const year = new Date().getFullYear();\n return `The year is ${year}`\n}", "function dollarize(expr)\n{\n return \"$\" + format(expr,2);\n}", "function getMessage6() {\n const year6 = new Date().getFullYear();\n\n return `The year is ${year6}`;\n}", "calcAge() {\n console.log(\n `I'm ${\n 2037 - this.birthYear\n } years old, but as a student I feel more like ${\n 2037 - this.birthYear + 10\n }`\n );\n }", "function format(a, b, c) {\n// the result string must give: \"Their names were: a, b and c.\"\n const template = `Their names were: ${a}, ${b} and ${c}.` //This is using backticks NOT single quotes.\n return template\n }", "function hello(first, last){\n let myName = first + ' ' + last;\n console.log(`Hello, ${myName}.`); //In order for $ to work use backtics ``\n}", "function formatTemplateVars(str) {\n\t\tvar d = new Date(), \n\t\t\tvals = {};\n\t\t\n\t\t// prepare available substitutions\n\t\tvals.year = d.getFullYear();\n\t\tvals.month = d.getMonth() + 1;\n\t\tvals.month = vals.month < 10 ? \"0\" + vals.month : vals.month;\n\t\t\n\t\tObject.keys(vals).forEach(function(k) { str = formatTemplateVar(str, k, vals[k]) }); \n\t\treturn str;\n\t}", "function setDynamicCopyrightYear() {\n var anio = (new Date).getFullYear();\n $( '.copyright' ).find( 'span.year' ).text( anio );\n }", "function getMessage() {\n\tconst year = new Date().getFullYear();\n\n\tconsole.log(year); // 2017\n\n\treturn \"The year is: \" + year;\n}", "function shortForm(){\n return Date.parse((new Date()).getFullYear() + \" \" + date.replace(\",\",\"\").match(/[a-zA-Z0-9 \\:]+/)[0].trim());\n }", "function myYear(year){\n return year * 365 * 24 * 60 * 60;\n}", "function lifeInWeeks(age){\r\n var yearsRemaining = 100 - 24;\r\n var days = yearsRemaining *365;\r\n var weeks = yearsRemaining * 52;\r\n var months = yearsRemaining *12;\r\n \r\nconsole.log(`I have ${days} days, ${weeks} weeks and ${months} months left. You have many times and keep going well.`);\r\n}", "function convertYear(year) {\n year += \"\";\n\n return year.length < 4 ? \"200\" + year : year;\n }", "function setCopyrightDate(){\n year = new Date().getFullYear();\n document.write(year);\n }", "function sayHi(name, age) {\n return `Hello, ${name}, youa are ${age} years old`;\n}", "function paraBuilder(variable) {\n if (variable == 'allDatesLabels') {\n return 'Sign-up+Date'; // This is basically a cheat, will come back to it later\n }\n else {\n var name = variable.replace('sLabels', '');\n name = name.replace(/([a-z])([A-Z])/g, '$1+$2');\n name = name.charAt(0).toUpperCase() + name.slice(1);\n return name\n }\n }", "function dogAge(number) {\n return `Your doggo is ${number * 7} years old in human years!`\n}", "function calculateDogAge(humanYear) {\r\n let dogAge = 7 * humanYear;\r\n console.log(`Your doggie is ${dogAge} years old in dog years!`);\r\n}", "function dateWriter(year, month, day) {\r\n var fullDate = new Date();\r\n var year = fullDate.getFullYear() + 2019;\r\n var month = fullDate.getMonth() + 12;\r\n var day = fullDate.getDate() + 07;\r\n return newDate = year + '\\n' + month + \"\" + day;\r\n\r\n\r\n}", "function sayHello3(name = \"Nguyen Van A\", year = 2006) {\n console.log(\"Ten: \", name);\n console.log(\"Tuoi: \", 2021 - year);\n}", "function calculateDogAge(a) {\n let dogAge = a * 7;\n return `Your doggie is ${dogAge} years old in dog years!`\n\n\n}", "function howdyEd(name){ \n return `Howdy ${name}!`\n}", "function CurrentYear(feet, theYear) {\n feet.innerHTML = \"\\<h5\\>\\&copy 2016 Junior Developer Toolbox. All Rights Reserved. \\<br \\/\\> A Member of the Complete Developer Family \\&copy 2015 - \" + theYear + \" \\<a href=\\\"http:\\/\\/completedeveloperpodcast.com\\\" \\> \\<img class=\\\"CDPlogo\\\" src= \\\"http:\\/\\/completedeveloperpodcast.com\\/wp-content\\/uploads\\/2015\\/09\\/JPEG300_iTunes.jpg\\\" \\> Complete Developer Podcast\\<\\/a\\>. All rights reserved.\\<\\/h5 \\> \";\n document.getElementById(\"footer\").appendChild(feet);\n}", "incomeOverTime() {\n return `Your weekly income will be Ksh ${this.totalProduction() * 7}\nYour yearly income will be Ksh ${this.totalProduction() * 366}`;\n }", "function copyrightYear() {\n var year = new Date().getFullYear();\n document.getElementById(\"year\").innerHTML = year;\n}", "function calculateDogAge(age){\r\n document.writeln(`Your doggie is ${age*7} years old in dog years!`)\r\n}", "function sayHello3(name, age){\n // `(백틱)으로 String을 입력하고 필요한 변수를 ${변수명}을 통해 넣어준다.\n console.log(`Hello ${name} you are ${age} years old.`);\n}", "static format (stringDefinition = '') {\n // Test to \n\n let combinatorLiteralFormat = /(\\|\\||\\||&&|\\[|\\]|,(?=[^{}]*(?:{|$))|\\/|<[^>]*>)/g\n let multiplyerFormat = /\\s*(\\*|\\+|\\?|\\{[^\\}]*\\}|\\#|\\!)/g;\n return stringDefinition.replace(combinatorLiteralFormat, ' $1 ')\n .replace(multiplyerFormat, '$1 ').replace(/\\s+/g, ' ').trim();\n }", "function myFunction() {\n var d = new Date();\n var n = d.getFullYear();\n document.getElementById(\"year\").innerHTML = n;\n}", "function saludar2() {\r\n let nombreCompleto = \"Leandro Borrelli\";\r\n return `Hola ${nombreCompleto}`;\r\n}", "function compareYear(year0, year1) {\n if (year1 != year0) { return `<h3>${year0}</h3>` }\n else { return \"\" };\n}", "function year_increment(){\n\t\tif(pymt_num === 1){\n\t\t\tyear++;\n\t\t\treturn 1;\n\t\t}\n\t\telse if(pymt_num % 12 === 0){\n\t\t\treturn year++;\n\t\t}else {\n\t\t\treturn '';\n\t\t}\n\t}", "function ageCalculator(birthYear){\n let currentYear = 2021;\n console.log(`your age is ${currentYear-birthYear}`);\n\n}", "function computeYear(inputYear) {\n if (inputYear) parseYear = `&primary_release_year=${inputYear}`;\n}", "function computeYear(inputYear) {\n if (inputYear) parseYear = `&primary_release_year=${inputYear}`;\n}", "function create_page_title(title)\n{\n return `\n <h1 class=\"page_title\">\n ${title}\n </h1>\n <hr>\n `;\n}", "function formatString(str) {\n let l = str.length;\n let ns = '';\n if (l > 3) {\n ns = `\\$${str.substring(0, l - 3)}.${str.substring(l - 3, l + 1)}`;\n }\n if (l <= 3) {\n return `\\$${str}`\n }\n return ns;\n}", "formatYearRange(start, end) {\n return `${start} \\u2013 ${end}`;\n }", "formatYearRange(start, end) {\n return `${start} \\u2013 ${end}`;\n }", "function transformYear(year) {\n if (year < 10) {\n year = \"190\" + year;\n } else if (year > 10 && year < 100) {\n year = \"19\" + year;\n } else {\n year = \"20\" + year[1] + year[2];\n }\n\n return year;\n}", "function printES6(){\n console.log(`My name is ${name}, I'm ${age} old`)\n let company1 = 4\n let company2 = 7\n console.log(`I have ${company1+company2} years of experience`)\n}", "function sayHello(name='Chan', age=30){\n return `Hello ${name} your ${age} years old`;\n}", "function saludar3(nombre) {\r\n return `hola ${nombre}`;\r\n}", "function sayHi(name, age) {\n // Use templete literals with string interpolation.\n return `Hi. My name is ${name} and I'm ${age} years old`;\n}", "formatYear(year, format) {\n return this.getMomentObj(year).format(format);\n }", "function myBirthYearFunc(birthYearInput){\r\n     console.log(\"I was born in \" + birthYearInput);\r\n }", "function ISO_2022() {}", "function ISO_2022() {}", "function NextYearCDP(feet, theYear) {\n feet.innerHTML = \"\\<h5\\>\\&copy 2016 Junior Developer Toolbox. All Rights Reserved. \\<br \\/\\>A Member of the Complete Developer Podcasting Family \\&copy 2015 - \" + theYear + \" \\<a href=\\\"http:\\/\\/completedeveloperpodcast.com\\\" \\> \\<img class=\\\"CDPlogo\\\" src= \\\"http:\\/\\/completedeveloperpodcast.com\\/wp-content\\/uploads\\/2015\\/09\\/JPEG300_iTunes.jpg\\\" \\> Complete Developer Podcast\\<\\/a\\>. All rights reserved.\\<\\/h5 \\> \";\n document.getElementById(\"footer\").appendChild(feet);\n}", "function greet(name){\n return `Hello, ${name}, I am JavaScript!`;\n}", "function setDate() {\n\nvar today = new Date();\nvar year = today.getFullYear();\n\nvar rok = document.getElementById('mainfooter');\nrok.innerHTML = '<p>Copyright &copy;' + year + ' Adam Stasiun </p>';\n}", "introduce() {\n console.log(\n `This is a ${this.make} ${this.model} that was made in ${this.yearMade} and has a top speed of ${this.topSpeed}`\n );\n }", "function dogYears(humanYears){\n //input human year spit out dog years\n //dogYears = human * 7\n var dogAge = humanYears * 7;\n console.log(\"your dog is \" + dogAge)\n}", "function getYear(date) {\n var year = date.substring(0, 2);\n return \"20\" + year;\n}", "yearContainer() {\n const { album } = this.props;\n return album.year ? <h5 className=\"album-show-track-year\">Released in {album.year}.</h5> : null\n }", "function dogAge(puppyAge) {\n let x = 7;\n console.log(`Your dog is ${puppyAge * x} in human years!`);\n}", "toString() { return `${super.toString()}/${this.#graduationYear}`; }", "function dogYears(age){ //(parameter) \"storage bin\" - always in the function definition -\n var dogYears = age * 7;\n console.log(\"Sparky is \" + dogYears + \" years old.\")\n}", "function S_templateStrings2() {\n // code snippet begin ----\n let a = 4;\n let b = 17;\n\n /* statement string with math expression placeholders that\n will be replaced by their respective results */\n let statement = `Twenty-one is ${a + b} and not ${2 * a + b}.`;\n\n console.log(statement); \n // code snippet end ----\n \n setInnerHTML(\"#result-text-2\", statement);\n}", "updateYear() {\n O('year-label').innerHTML = this.year;\n }", "function greetings(yourName, yearOfBirth) {\n let age = 2020 - yearOfBirth;\n let result = \"Hello \" + yourName + \", your age is \" + age;\n document.getElementById('someText').innerHTML = result;\n}", "function dogYears (humanAge){\n //Inpute a human year and spitout a dog year\n //Human age * 7 = dog age\n var dogAge= humanAge*7;\n\n //Print out\n console.log(\"A dog who is \" + humanAge + \" is \" + dogAge + \" in dog years.\");\n}", "formatCode(code) {\n return code\n .replace(/^([0-9]{3})([0-9]{3})$/, '$1 $2') // 6 digits\n .replace(/^([0-9]{2})([0-9]{3})([0-9]{2})$/, '$1 $2 $3') // 7 digits\n .replace(/^([0-9]{2})([0-9]{3})([0-9]{3})$/, '$1 $2 $3') // 8 digits\n }", "function footer_text(){\n // Display the footer text with current year\n var text_element = document.getElementById(AllIdNames.footer_text_id);\n var current_year = new Date().getFullYear();\n text_element.innerHTML = '&copy;' + ' Voltex Designs ' + current_year;\n}", "function fullName(fName,lName) {\n let myFullName = fName + ' ' + lName\n //let myFullName = `${fName} ${myFullName}`;\n\n console.log(`Hello my name is ${myFullName}`);\n\n}", "function fix_string_formatting(string, variables) {\n console.log(\"inside fix_string\");\n list = string.split('%s');\n console.log(list);\n new_str = list[0];\n for (var i = 1; i < list.length; i++) {\n new_str += (' $' + i + ' ' + list[i]);\n console.log('\\n'+i+'\\n' + new_str + '\\n');\n }\n \n return new_str;\n }", "function dateBuilder(d){ \n let monthss =[\"january\" , \"february\" , \"March\" , \"april\" , \"Mai\" , \"june\" , \"july\" , \"august\" , \"September\" , \"october\" , \"november\" , \"december\"] ; \n let days = [ \"sunday\" , \"Monday\" , \"tuesday\" , \"wednesday\" , \"thursday\" , \"friday\" , \"saturday\", \"sunday\"]; \n let day = days[d.getDay()]; \n let date = d.getDate() ;\n let monthh = monthss[d.getMonth()] ; \n let year = d.getFullYear(); \n return `${day} ${date} ${monthh} ${year}` ; //incrementer \n\n}", "function dogYears (age) {\n\tageDogYears = age * 7;\n\tmessage = age + ' years is ' + ageDogYears + ' dog years.';\n\treturn message;\n}", "asString() {\nvar w, x, y, z;\n[x, y, z, w] = this.xyzw;\nreturn `<${x} ${y} ${z}; ${w}>`;\n}", "function writeNameAndAge(name, age) {\r\n const nameAndAge = `${name} is ${age} y.o`;\r\n return nameAndAge;\r\n}", "function YearInT(arg0)\n{\n\treturn 13;\n}", "function dateWriter (year, month, day){\n return dateWriter.year;\n}", "formatDate(x) {\n let date = new Date(x)\n let _month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1\n let _date = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()\n let _hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()\n let _minute = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()\n let _second = date.getSeconds() < 10 ? `0${date.getSeconds()}` : date.getSeconds()\n let dateStr = `${date.getFullYear()}-${_month}-${_date} ${_hour}:${_minute}:${_second}`\n return dateStr\n }", "function calcDogAge(number) {\n return `Your doggo is ${number * 7} years old in human years!`;\n}", "function years(num){\n let years0,\n str1=num.toString(), \nsL=str1.length;\nif (sL==1) {s1=\"0\"; s2=str1} else { s2=str1.charAt(sL-2); s2=str1.charAt(sL-1)} \nif (s2==\"1\" && s1!=\"1\") {years0=' год '} else if \n((s2==\"2\"||s2==\"3\"||s2==\"4\" )&&s1!=\"1\") {years0=' года '} else {years0=' лет '};\nreturn years0\n}", "function Copyright(props) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" align=\"center\" {...props}>\n {'Copyright © Team Ukku '}\n\n {new Date().getFullYear()}\n {'.'}\n </Typography>\n );\n}", "function greetings3 ({ first_name, last_name, profession, age }) {\n return `Hi, I am ${first_name} ${last_name}.\n I am a ${profession}\n My age is ${age}`\n}", "function saludarEstudiante(estudiante) {\n console.log(`Hola ${estudiante}`); // template strings (Plantillas de cadena de texto)\n}", "set Dollar(value) {}", "function dogYears(humanA) {\n \n //Dog years = humam*7\n var dogAge = humanA*7\n console.log(\"Dog age is \"+dogAge);\n}", "function literals(name, age) {\n return 'Hello ' + name + '. Your age is ' + age + ' years old.';\n}", "function calculateDogAge(puppyAge) {\n let ageCalculator = puppyAge * 7;\n return `Your doggie is ${ageCalculator} years old in dog years!`;\n}", "function leapYear(year) {\n if (year % 4 === 0) {\n if (year % 100 === 0) {\n if (year % 400 === 0) {\n return \"leap year\";\n } else {\n return \"not leap year\";\n }\n } else {\n return \"Leap Year\";\n }\n } else {\n return \"Not Leap Year\";\n }\n}", "function substitutions_ECMA6() {\n let sub1 = `paypal`;\n let sub2 = `${sub1} is PYPL`;\n console.log(sub2);\n \n //TL inside of another TL\n let tl1 = `template literal 1`;\n \n let tl3 = `Hello, ${\n `this is ${ tl1 }`\n }.`; \n console.log( tl3);\n}", "function pet(animal) {\n console.log(`My puppy's name is ${animal}!`)//* ${} - uses string inerpolation *//\n}", "function greet(name){\n return `Hello, ${name} how are you doing today?`;\n}", "study(time) {\n return `I am studying and it is currently: ${ time }!`\n }", "function NextYearBoth(feet, theYear) {\n feet.innerHTML = \"\\<h5\\>\\&copy 2016 - \" + theYear + \" Junior Developer Toolbox. All Rights Reserved. \\<br \\/\\>A Member of the Complete Developer Family \\&copy 2015 - \" + theYear + \" \\<a href=\\\"http:\\/\\/completedeveloperpodcast.com\\\" \\> \\<img class=\\\"CDPlogo\\\" src= \\\"http:\\/\\/completedeveloperpodcast.com\\/wp-content\\/uploads\\/2015\\/09\\/JPEG300_iTunes.jpg\\\" \\> Complete Developer Podcast\\<\\/a\\>. All rights reserved.\\<\\/h5 \\> \";\n document.getElementById(\"footer\").appendChild(feet);\n}", "function calculateDogAge(dogAge) {\n let humanYears = 7 * dogAge;\n console.log(`Your doggie is ${humanYears} years old in human years!`);\n}", "function saludo(nombre = 'Visitante')\r\n{\r\n return `Hola ${nombre}`\r\n}", "get year () { return String(this._date.getFullYear()) }" ]
[ "0.65587765", "0.62336016", "0.6166508", "0.6123924", "0.61114025", "0.60027987", "0.6000426", "0.5983199", "0.59783226", "0.5949656", "0.592314", "0.5915272", "0.5914158", "0.590703", "0.58961946", "0.58823246", "0.5879619", "0.5869922", "0.5865624", "0.5841665", "0.58121157", "0.58090216", "0.5789215", "0.5770774", "0.5762279", "0.57577175", "0.5747604", "0.56942475", "0.56766737", "0.56576896", "0.5618916", "0.5617702", "0.5617629", "0.5608509", "0.5583797", "0.5562542", "0.55349964", "0.5521249", "0.5495288", "0.5484169", "0.5471987", "0.5468179", "0.5461346", "0.5461346", "0.5447488", "0.5431814", "0.54208124", "0.54208124", "0.5413148", "0.5399291", "0.53985906", "0.53810346", "0.5353463", "0.53310037", "0.53296334", "0.53126204", "0.53126204", "0.530394", "0.52837884", "0.5281595", "0.52745116", "0.52599865", "0.52575034", "0.5252432", "0.5246884", "0.52444005", "0.52368563", "0.5233698", "0.52286613", "0.52144116", "0.5213051", "0.52119964", "0.5210728", "0.5210481", "0.5209354", "0.5209094", "0.5206767", "0.5204034", "0.5201246", "0.5198868", "0.519881", "0.519265", "0.519187", "0.51861346", "0.5183457", "0.5182615", "0.5174893", "0.51734793", "0.5172844", "0.51692605", "0.5155564", "0.5155421", "0.5152371", "0.5150382", "0.51384133", "0.513765", "0.5135459", "0.5126795", "0.51258725", "0.5125036" ]
0.62125856
2
Your number doubled is 10 Ex. 3 Name Helpers Refactor the function to use template strings
function fullName(firstName, lastName) { return `${firstName} ${lastName}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNumberName(numberString) {\r\n let digitName10 = \"\";\r\n let digitName1 = \"\";\r\n\r\n if (numberString[0] === \"1\") {\r\n //Define tenth digit place if tenth digit place is \"1\"\r\n switch (numberString[1]) {\r\n case \"0\":\r\n digitName10 = \"TEN\";\r\n break;\r\n case \"1\":\r\n digitName10 = \"ELEVEN\";\r\n break;\r\n case \"2\":\r\n digitName10 = \"TWELVE\";\r\n break;\r\n case \"3\":\r\n digitName10 = \"THIRTEEN\";\r\n break;\r\n case \"4\":\r\n digitName10 = \"FOURTEEN\";\r\n break;\r\n case \"5\":\r\n digitName10 = \"FIFTEEN\";\r\n break;\r\n case \"6\":\r\n digitName10 = \"SIXTEEN\";\r\n break;\r\n case \"7\":\r\n digitName10 = \"SEVENTEEN\";\r\n break;\r\n case \"8\":\r\n digitName10 = \"EIGHTEEN\";\r\n break;\r\n case \"9\":\r\n digitName10 = \"NINETEEN\";\r\n break;\r\n }\r\n } else {\r\n //Define tenth digit place if tenth digit place is not \"1\"\r\n switch (numberString[0]) {\r\n case \"0\":\r\n digitName10 = \"\";\r\n break;\r\n case \"2\":\r\n digitName10 = \"TWENTY\";\r\n break;\r\n case \"3\":\r\n digitName10 = \"THIRTY\";\r\n break;\r\n case \"4\":\r\n digitName10 = \"FORTY\";\r\n break;\r\n case \"5\":\r\n digitName10 = \"FIFTY\";\r\n break;\r\n case \"6\":\r\n digitName10 = \"SIXTY\";\r\n break;\r\n case \"7\":\r\n digitName10 = \"SEVENTY\";\r\n break;\r\n case \"8\":\r\n digitName10 = \"EIGHTY\";\r\n break;\r\n case \"9\":\r\n digitName10 = \"NINETY\";\r\n break;\r\n }\r\n //Define first digit place if tenth digit place is not \"1\"\r\n switch (numberString[1]) {\r\n case \"0\":\r\n digitName1 = \"\";\r\n break;\r\n case \"1\":\r\n digitName1 = \"ONE\";\r\n break;\r\n case \"2\":\r\n digitName1 = \"TWO\";\r\n break;\r\n case \"3\":\r\n digitName1 = \"THREE\";\r\n break;\r\n case \"4\":\r\n digitName1 = \"FOUR\";\r\n break;\r\n case \"5\":\r\n digitName1 = \"FIVE\";\r\n break;\r\n case \"6\":\r\n digitName1 = \"SIX\";\r\n break;\r\n case \"7\":\r\n digitName1 = \"SEVEN\";\r\n break;\r\n case \"8\":\r\n digitName1 = \"EIGHT\";\r\n break;\r\n case \"9\":\r\n digitName1 = \"NINE\";\r\n break;\r\n }\r\n }\r\n\r\n return digitName10 + digitName1;\r\n}", "function dogAge(number) {\n return `Your doggo is ${number * 7} years old in human years!`\n}", "function spellDoubleDigit (number) {\n validate(number);\n // re-route if single digit value\n if (number < 10) return spellSingleDigit(number);\n\n var teens = [];\n var deca = [];\n teens[10] = 'ten';\n teens[11] = 'eleven';\n teens[12] = 'twelve';\n teens[13] = 'thirteen';\n teens[14] = 'fourteen';\n teens[15] = 'fifteen';\n teens[16] = 'sixteen';\n teens[17] = 'seventeen';\n teens[18] = 'eighteen';\n teens[19] = 'nineteen';\n\n deca[20] = 'twenty';\n deca[30] = 'thirty';\n deca[40] = 'forty';\n deca[50] = 'fifty';\n deca[60] = 'sixty';\n deca[70] = 'seventy';\n deca[80] = 'eighty';\n deca[90] = 'ninety';\n\n var result = '';\n if (number < 20) {\n result = teens[number];\n } if (number >= 20) {\n result = deca[number - number % 10];\n if (number % 10 > 0) {\n result += '-' + spellSingleDigit(number % 10);\n }\n }\n return result;\n }", "function humanizeNumber(num) {\n    if (typeof num == \"undefined\") {\n        return;\n    } else if (num % 100 >= 11 && num % 100 <= 13) {\n        return num + \"th\";\n    }\n\n    switch (num % 10) {\n        case 1:\n            return num + \"st\";\n        case 2:\n            return num + \"nd\";\n        case 3:\n            return num + \"rd\";\n    }\n    return num + \"th\";\n}", "function numberToString(test) {\r\n return `${test}`; \r\n }", "function plural$4(word,num){var forms=word.split('_');return num % 10 === 1 && num % 100 !== 11?forms[0]:num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)?forms[1]:forms[2];}", "function someName(numberOne, otherNumber){\n return numberOne + 10 + otherNumber;\n}", "function humanizeNumber(num) {\n if (typeof num == \"undefined\") {\n return;\n }\n\n if (num % 100 >= 11 && num % 100 <= 13) {\n return num + \"th\";\n }\n\n switch (num % 10) {\n case 1:\n return num + \"st\";\n case 2:\n return num + \"nd\";\n case 3:\n return num + \"rd\";\n }\n return num + \"th\";\n}", "function plural$4(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }", "function humanizeNumber(num) {\n if (typeof num == \"undefined\") {\n return;\n }\n if (num % 100 >= 11 && num % 100 <= 13) {\n return num + \"th\";\n }\n switch (num % 10) {\n case 1:\n return num + \"st\";\n case 2:\n return num + \"nd\";\n case 3:\n return num + \"rd\";\n }\n return num + \"th\";\n}", "function plural$4(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }", "function translate_10_Thousands(s){\n\tif(s == \"00000\"){\n\t\treturn \"\";\n\t}\n\tvar firstDigit = s.substring(0,2);\n\tvar remainingDigits = s.substring(2,5);\n\tvar firstDescription = translate_Tens(firstDigit);\n\tvar remainingDescription = translate_Hundreds(remainingDigits);\n\tvar output = \"\";\n\tif(firstDescription != \"\"){\n\t\toutput = output + firstDescription + \" \" + \"Thousand\";\n\t\tif(remainingDescription != \"\"){\n\t\t\toutput = output + \" \" + remainingDescription;\n\t\t}\n\t}else{\n\t\tif(remainingDescription != \"\"){\n\t\t\toutput = remainingDescription;\n\t\t}\n\t}\n\treturn output; \n}", "function plural(word,num){var forms=word.split(\"_\");return num%10===1&&num%100!==11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2]}", "function plural(word,num){var forms=word.split(\"_\");return num%10===1&&num%100!==11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2]}", "function plural(word,num){var forms=word.split(\"_\");return num%10===1&&num%100!==11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2]}", "function n(e,t){var r=e.split(\"_\");return t%10===1&&t%100!==11?r[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?r[1]:r[2]}", "function n(e,t){var r=e.split(\"_\");return t%10===1&&t%100!==11?r[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?r[1]:r[2]}", "function n(e,t){var r=e.split(\"_\");return t%10===1&&t%100!==11?r[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?r[1]:r[2]}", "function humanize(number) {\n if(number % 100 >= 11 && number % 100 <= 13)\n return number + \"th\";\n \n switch(number % 10) {\n case 1: return number + \"st\";\n case 2: return number + \"nd\";\n case 3: return number + \"rd\";\n }\n \n return number + \"th\";\n}", "function replaceNum(num) // Parses an int of format 123456 to an string in format 123,456 \r\n{\r\n\tvar string = String(num);\r\n\tvar temp = \"\";\r\n\tvar lentxt = string.length - ((String(Math.abs(num))).length) ; // different length between String and number \r\n\t\r\n\tfor ( j=string.length ; j > lentxt; j = j-3)\r\n\t{\r\n\t\tif (j-3 <= lentxt ) {temp = string.substring(0 , j) + temp}\r\n\t\telse\t\t\t\t{temp = unitSeparator + string.substr(j-3, 3) + temp}\r\n\t}\r\n\treturn temp;\r\n}", "function plural$6(word,num){var forms=word.split('_');return num % 10 === 1 && num % 100 !== 11?forms[0]:num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)?forms[1]:forms[2];}", "function calcDogAge(number) {\n return `Your doggo is ${number * 7} years old in human years!`;\n}", "function convertTensWord(){\n //determines if 0\n if(dollarReverseArray[1] !== \"0\" && (typeof(dollarReverseArray[1]) !== \"undefined\")){\n //determine tens place first\n if(dollarReverseArray[1] == 1){\n var tensPlace = teenObject[dollarReverseArray[0]]; //\"thirteen\"\n var tenOneString = `${tensPlace} `;\n }else{\n ///section where tens place is anything but 1....) should be empty\n var onesPlace = onesObject[dollarReverseArray[0]];\n var tensPlace = tensObject[dollarReverseArray[1]];\n var tenOneString = `${tensPlace} ${onesPlace} `;\n };\n }else{\n var tenOneString = \"\";\n };\n\n return tenOneString;\n}", "function thousand(number){\n\t\t\t\tif(number.length==4){\n\t\t\t\t\tsubnum=number[1]+number[2]+number[3];\n\t\t\t\t\tif(number[0]<1){\n\t\t\t\t\t\tunit[1]=\"\";\n\t\t\t\t\t}\n\t\t\t\t\tword= first[number[0]]+\" \"+unit[1]+\" \"+hundred(subnum);\n\t\t\t\t\treturn word;\n\t\t\t\t}\n\t\t\t\telse if(number.length==5){\n\t\t\t\t\tsubnum=number[2]+number[3]+number[4];\n\t\t\t\t\tif (number[0]!='0') {\n\t\t\t\t\t\tword= first2degred(number[0]+number[1])+\" \"+unit[1]+\" \"+hundred(subnum);\n\t\t\t\t\t}\n\t\t\t\t\telse if(number[1]!='0'){\n\t\t\t\t\t\tword=first2degred(number[1])+\" \"+unit[1]+hundred(subnum);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tword=hundred(subnum);\n\t\t\t\t\t}\n\t\t\t\t\treturn word;\n\t\t\t\t}\n\t\t\t}", "function displayHelper (num) {\n if (num < 10) {\n return '0' + num.toString()\n } else {\n return num.toString()\n }\n }", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "getDisplayNumber(number){\n const stringNumber = number.toString()\n //split turns numbers into an array after first number\n const integerDigits = parseFloat(stringNumber.split('.')[0])\n //getting numbers after the decimal place\n const decimalDigits = (stringNumber.split('.')[1])\n let integerDisplay\n if(isNaN(integerDigits)) {\n integerDisplay = ''\n } else {\n //maxfrac to ensure only on decimal point\n integerDisplay = integerDigits.toLocaleString('en', {maximumFractionDigits: 0})\n }\n if (decimalDigits != null){\n return `${integerDisplay}.${decimalDigits}`\n } else {\n return integerDisplay\n }\n }", "function twoDigitsNumberNameEn(number) {\r\n if (number > 99) {\r\n return;\r\n }\r\n\r\n var digitsNames,\r\n tensNames,\r\n numberName;\r\n\r\n //digits names\r\n digitsNames = {};\r\n digitsNames[0] = 'zero';\r\n digitsNames[1] = 'one';\r\n digitsNames[2] = 'two';\r\n digitsNames[3] = 'three';\r\n digitsNames[4] = 'four';\r\n digitsNames[5] = 'five';\r\n digitsNames[6] = 'six';\r\n digitsNames[7] = 'seven';\r\n digitsNames[8] = 'eight';\r\n digitsNames[9] = 'nine';\r\n\r\n //tens names\r\n tensNames = {};\r\n tensNames[10] = 'ten';\r\n tensNames[11] = 'eleven';\r\n tensNames[12] = 'twelve';\r\n tensNames[13] = 'thirteen';\r\n tensNames[14] = 'fourteen';\r\n tensNames[15] = 'fifteen';\r\n tensNames[16] = 'sixteen';\r\n tensNames[17] = 'seventeen';\r\n tensNames[18] = 'eighteen';\r\n tensNames[19] = 'nineteen';\r\n tensNames[20] = 'twenty';\r\n tensNames[30] = 'thirty';\r\n tensNames[40] = 'fourty';\r\n tensNames[50] = 'fifty';\r\n tensNames[60] = 'sixty';\r\n tensNames[70] = 'seventy';\r\n tensNames[80] = 'eighty';\r\n tensNames[90] = 'ninety';\r\n\r\n numberName = '';\r\n\r\n if (number >= 0 && number < 10) {\r\n numberName = digitsNames[number];\r\n } else if (number >= 10 && number < 20) {\r\n numberName = tensNames[number];\r\n } else {\r\n //20, 30, ... 90\r\n if ((number % 10) === 0) {\r\n numberName = tensNames[(number / 10) * 10];\r\n } else { //21, 22, 31, 32, ...\r\n numberName = tensNames[parseInt(number / 10, 10) * 10] + '-' + digitsNames[number % 10];\r\n }\r\n }\r\n\r\n return numberName;\r\n }", "function plural$6(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }", "function t(_,l){var h=_.split(\"_\");return l%10==1&&l%100!=11?h[0]:l%10>=2&&l%10<=4&&(l%100<10||l%100>=20)?h[1]:h[2]}", "function formatNumber(n,d) {\n let x=(''+n).length;\n const p=Math.pow;\n d=p(10,d);\n x-=x%3;\n return Math.round(n*d/p(10,x))/d+\" kMGTPE\"[x/3];\n }", "function plural(word,num){var forms=word.split('_');return num % 10 === 1 && num % 100 !== 11?forms[0]:num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)?forms[1]:forms[2];}", "function t(e,t){var i=e.split(\"_\");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}", "function t(e,t){var i=e.split(\"_\");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}", "function t(e,t){var i=e.split(\"_\");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}", "static nFormatter(num, digits) {\r\n var si = [\r\n { value: 1, symbol: \"\" },\r\n { value: 1E3, symbol: \"k\" },\r\n { value: 1E6, symbol: \"M\" },\r\n { value: 1E9, symbol: \"G\" },\r\n { value: 1E12, symbol: \"T\" },\r\n { value: 1E15, symbol: \"P\" },\r\n { value: 1E18, symbol: \"E\" }\r\n ];\r\n var rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\r\n var i;\r\n for (i = si.length - 1; i > 0; i--) {\r\n if (num >= si[i].value) {\r\n break;\r\n }\r\n }\r\n\r\n return \"$\" + (num / si[i].value).toFixed(digits).replace(rx, \"$1\") + si[i].symbol;\r\n }", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function plural$6(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}" ]
[ "0.6734674", "0.6685167", "0.664702", "0.65803826", "0.6502638", "0.6425919", "0.63972515", "0.6390857", "0.63722116", "0.63610184", "0.6358902", "0.6337197", "0.63318914", "0.63318914", "0.63318914", "0.63178265", "0.63178265", "0.63178265", "0.63061714", "0.6250846", "0.6225994", "0.6210498", "0.62010133", "0.6195393", "0.6194892", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61819816", "0.61620414", "0.61613715", "0.6160228", "0.61586726", "0.6157312", "0.6145175", "0.61402804", "0.61402804", "0.61402804", "0.6124629", "0.6122003", "0.6122003", "0.6122003", "0.6122003", "0.6122003", "0.6122003", "0.6120168", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665", "0.611665" ]
0.0
-1
Adds permissions from mapping
function addPermissions(app, perms) { var host = 'http://' + app + '.gaiamobile.org:8080'; var perm = Cc["@mozilla.org/permissionmanager;1"] .createInstance(Ci.nsIPermissionManager) var ios = Cc["@mozilla.org/network/io-service;1"] .getService(Ci.nsIIOService) uri = ios.newURI(host, null, null) for (var i=0, eachPerm; eachPerm = perms[i]; i++) { perm.add(uri, eachPerm, 1) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapPermissions() {\n\t\t\tvar nav = {}, permissionList = [];\n\t\t\tfor(var permission in service.access.permissions) {\n\t\t\t\tif(inRole(service.access.permissions[permission])) {\n\t\t\t\t\tpermissionList.push(permission);\n\t\t\t\t}\n\t\t\t}\n\t\t\tservice.permissionList = permissionList;\n\t\t\tservice.nav = nav;\n\t\t}", "function addPermissions (req, res, next) {\n const { acl, session } = req\n if (!acl) return next()\n\n // Turn permissions for the public and the user into a header\n const resource = utils.getFullUri(req)\n Promise.all([\n getPermissionsFor(acl, null, resource),\n getPermissionsFor(acl, session.userId, resource)\n ])\n .then(([publicPerms, userPerms]) => {\n debug.ACL(`Permissions on ${resource} for ${session.userId || '(none)'}: ${userPerms}`)\n debug.ACL(`Permissions on ${resource} for public: ${publicPerms}`)\n res.set('WAC-Allow', `user=\"${userPerms}\",public=\"${publicPerms}\"`)\n })\n .then(next, next)\n}", "if (ace.direct.toString() == \"true\")\n {\n var principalId = ace.principal.principalId.toString();\n for each (var permission in ace.permission)\n {\n principalIds[i] = principalId;\n permissions[i] = permission.toString();\n i++;\n }\n }", "function decorateWithPermissions(binding){\n var bindingEntry = function(entry){return entry[0]===binding.id;},\n filteredPermissions = this.declaredPermissions.filter(bindingEntry);\n binding.updatePermissions(filteredPermissions.map(function(p){return p[1];}));\n return binding;\n }", "function definePermissions() {\n var keys = {};\n var defaultPermissions = {};\n\n for (var _len = arguments.length, actions = Array(_len), _key = 0; _key < _len; _key++) {\n actions[_key] = arguments[_key];\n }\n\n actions.forEach(function (name) {\n keys[name] = Joi.boolean();\n defaultPermissions[name] = true;\n });\n return property(_crudlJoi2.default.object().keys(keys), defaultPermissions);\n}", "function setPermissions(content, context)\n{\n const permissions = (context.permissions == undefined)\n ? \"UNDEFINED\" : context.permissions;\n\n if (xdmp.nodeKind(content.value) == 'document' &&\n content.value.documentFormat == 'JSON') {\n // Convert input to mutable object and add new property\n const newDoc = content.value.toObject();\n\n // xdmp.log('Doc uri = ' + content.uri);\n // xdmp.log('Doc permissions = ' + JSON.stringify(permissions));\n\n let docPermissions = [];\n if (newDoc.alliance === 'rebel') {\n docPermissions = [{\"capability\":\"read\",\"roleId\": xdmp.role('rebel-reader')},{\"capability\":\"update\",\"roleId\": xdmp.role('starwars-writer')}];\n }\n else if (newDoc.alliance === 'empire') {\n docPermissions = [{\"capability\":\"read\",\"roleId\": xdmp.role('empire-reader')},{\"capability\":\"update\",\"roleId\": xdmp.role('starwars-writer')}];\n }\n else {\n docPermissions = [{\"capability\":\"read\",\"roleId\": xdmp.role('starwars-reader')},{\"capability\":\"update\",\"roleId\": xdmp.role('starwars-writer')}];\n }\n context.permissions = docPermissions;\n\n // Convert result back into a document\n content.value = xdmp.unquote(xdmp.quote(newDoc));\n }\n return content;\n}", "attachPermissionedDataToMap(permissionedDataMap, ot_objects) {\n if (Object.keys(permissionedDataMap).length > 0) {\n ot_objects.forEach((ot_object) => {\n if (ot_object['@id'] in permissionedDataMap) {\n if (!ot_object.properties) {\n throw Error(`Permissioned object ${ot_object['@id']} does not have properties`);\n }\n if (!ot_object.properties.permissioned_data) {\n throw Error(`Permissioned attribute not found for object ${ot_object['@id']}`);\n }\n if (!ot_object.properties.permissioned_data.data) {\n throw Error(`Permissioned data not found for object ${ot_object['@id']}`);\n }\n permissionedDataMap[ot_object['@id']] =\n Utilities.copyObject(ot_object.properties.permissioned_data);\n }\n });\n }\n }", "function bbedit_acpperms_init() {}", "function updatePermissions(){\n\n}", "function collectUsedPermissionNames(part, path) {\n if (!appLib.appModel.usedPermissions) {\n appLib.appModel.usedPermissions = new Set();\n }\n // According to 'Attaching Permissions' https://confluence.conceptant.com/pages/viewpage.action?pageId=1016055\n // There are many places where permissions are used\n\n // schema, list scopes\n addPermissionsFromScopes(part);\n\n // schema actions\n const actionFields = _.get(part, 'actions.fields');\n _.each(actionFields, val => {\n const actionPermissions = _.get(val, 'permissions');\n addToUsedPermissions(actionPermissions);\n });\n\n // add lookup scopes\n if (part.type.startsWith('LookupObjectID')) {\n const lookups = _.get(part, 'lookup.table');\n _.each(lookups, lookup => {\n addPermissionsFromScopes(lookup);\n });\n }\n\n // add fields permissions\n if (part.permissions) {\n addToUsedPermissions(part.permissions);\n }\n\n function addPermissionsFromScopes(aPart) {\n const scopeFields = _.get(aPart, 'scopes');\n _.each(scopeFields, scopeObj => {\n const scopePermissions = _.get(scopeObj, 'permissions');\n addToUsedPermissions(scopePermissions);\n });\n }\n\n function addToUsedPermissions(permissions) {\n if (!permissions) {\n return;\n }\n\n if (_.isString(permissions)) {\n appLib.appModel.usedPermissions.add(permissions);\n } else if (Array.isArray(permissions)) {\n _.flattenDeep(permissions).forEach(permission => {\n if (_.isString(permission)) {\n appLib.appModel.usedPermissions.add(permission);\n } else {\n errors.push(`Found permission with not String type. Permission: ${permission}, path: ${path}`);\n }\n });\n } else if (_.isPlainObject(permissions)) {\n _.each(permissions, objPermission => {\n addToUsedPermissions(objPermission);\n });\n }\n }\n }", "function repermission(currentFolder) {\n console.log(\"Repermissioning: \", currentFolder.name);\n \n if (currentFolder.content){\n currentFolder.content.map(item => {\n let newPermissions = duplicate(item.data.permission);\n newPermissions.default = desiredPermission;\n console.log(\" Item:\", item.data.name);\n item.update({permission: newPermissions});\n });\n }\n \n if (currentFolder.children && applyInSubfolders) {\n currentFolder.children.map(({data}) => {\n repermission(game.folders.entities.filter(f => f.data._id == data._id)[0]);\n });\n }\n}", "function StatePermissionMap(state) {\n var toStateObject = state.$$state();\n var toStatePath = toStateObject.path;\n\n angular.forEach(toStatePath, function (state) {\n if (areSetStatePermissions(state)) {\n var permissionMap = new PermissionMap(state.data.permissions);\n this.extendPermissionMap(permissionMap);\n }\n }, this);\n }", "get requiredPermissions () {\n return this.target.isAcl\n ? new Set([acl.CONTROL])\n : new Set([acl.WRITE])\n }", "addPermission(projectId, permission, callback) {\n crn.addPermission('projects', projectId, permission, (err, res) => {\n callback(err, res);\n });\n }", "function collectUsedPermissionNames(part) {\n if (!part.type) {\n return;\n }\n\n if (!appLib.appModel.usedPermissions) {\n appLib.appModel.usedPermissions = new Set();\n }\n // According to 'Attaching Permissions' https://confluence.conceptant.com/pages/viewpage.action?pageId=1016055\n // There are many places where permissions are used\n\n // schema, list scopes\n addPermissionsFromScopes(part);\n\n // schema actions\n const actionFields = _.get(part, 'actions.fields');\n _.each(actionFields, (val) => {\n const actionPermissions = _.get(val, 'permissions');\n addToUsedPermissions(actionPermissions);\n });\n\n // add lookup scopes\n if (part.type.startsWith('LookupObjectID')) {\n const lookups = _.get(part, 'lookup.table');\n _.each(lookups, (lookup) => {\n addPermissionsFromScopes(lookup);\n });\n }\n\n // add fields permissions\n if (part.permissions) {\n addToUsedPermissions(part.permissions);\n }\n\n function addPermissionsFromScopes(_part) {\n const scopeFields = _.get(_part, 'scopes');\n _.each(scopeFields, (scopeObj) => {\n const scopePermissions = _.get(scopeObj, 'permissions');\n addToUsedPermissions(scopePermissions);\n });\n }\n\n function addToUsedPermissions(permissions) {\n if (!permissions) {\n return;\n }\n\n if (_.isString(permissions)) {\n appLib.appModel.usedPermissions.add(permissions);\n } else if (_.isArray(permissions)) {\n _.flattenDeep(permissions).forEach((permission) => {\n appLib.appModel.usedPermissions.add(permission);\n });\n } else if (_.isPlainObject(permissions)) {\n _.each(permissions, (objPermission) => {\n addToUsedPermissions(objPermission);\n });\n }\n }\n }", "function StatePermissionMap(state) {\n var toStateObject = state.$$permissionState();\n var toStatePath = toStateObject.path;\n\n angular.forEach(toStatePath, function (state) {\n if (areSetStatePermissions(state)) {\n var permissionMap = new PermPermissionMap(state.data.permissions);\n this.extendPermissionMap(permissionMap);\n }\n }, this);\n }", "function addPermissionsCheckboxes(editor, ident, authz) {\n function createLoadCallback(action) {\n return function loadCallback(field, annotation) {\n field = util.$(field).show();\n\n var u = ident.who();\n var input = field.find(\"input\");\n\n // Do not show field if no user is set\n if (typeof u === \"undefined\" || u === null) {\n field.hide();\n }\n\n // Do not show field if current user is not admin.\n if (!authz.permits(\"admin\", annotation, u)) {\n field.hide();\n }\n\n // See if we can authorise without a user.\n if (authz.permits(action, annotation, null)) {\n input.attr(\"checked\", \"checked\");\n } else {\n input.removeAttr(\"checked\");\n }\n };\n }\n\n function createSubmitCallback(action) {\n return function submitCallback(field, annotation) {\n var u = ident.who();\n\n // Don't do anything if no user is set\n if (typeof u === \"undefined\" || u === null) {\n return;\n }\n\n if (!annotation.permissions) {\n annotation.permissions = {};\n }\n if (util.$(field).find(\"input\").is(\":checked\")) {\n delete annotation.permissions[action];\n } else {\n // While the permissions model allows for more complex entries\n // than this, our UI presents a checkbox, so we can only\n // interpret \"prevent others from viewing\" as meaning \"allow\n // only me to view\". This may want changing in the future.\n annotation.permissions[action] = [authz.authorizedUserId(u)];\n }\n };\n }\n\n editor.addField({\n type: \"checkbox\",\n label: _t(\"Allow anyone to <strong>view</strong> this annotation\"),\n load: createLoadCallback(\"read\"),\n submit: createSubmitCallback(\"read\"),\n });\n\n editor.addField({\n type: \"checkbox\",\n label: _t(\"Allow anyone to <strong>edit</strong> this annotation\"),\n load: createLoadCallback(\"update\"),\n submit: createSubmitCallback(\"update\"),\n });\n }", "createPermission(existingPermissions, application, permission) {\n\t const existingPermission = _.find(existingPermissions, { applicationId: application.id, name: permission });\n\t if (existingPermission) {\n\t return Promise.resolve(true);\n\t }\n\n\t const payload = {\n\t name: permission,\n\t description: permission.replace(/(\\w)(\\w*)/g, function(g0,g1,g2){return g1.toUpperCase() + g2.toLowerCase();}).replace(':', ' ').replace('-', ' '),\n\t applicationType: 'client',\n\t applicationId: application.id\n\t };\n\n\t return request.post({ uri: process.env.AUTHZ_API_URL + '/permissions', json: payload, headers: { 'Authorization': 'Bearer ' + this.accessToken } })\n\t .then((createdPermission) => {\n\t existingPermissions.push(createdPermission);\n\t log(chalk.green.bold('Permission:'), `Created ${permission}`);\n\t return permission;\n\t });\n\t}", "updatePermissions(requestConfig, successCallback, errorCallback, isEdit) {\n const config = requestConfig;\n const permissionURL = isEdit ? 'editPermissions' : 'addPermissions';\n config.url = `${globals.getRestUrl(permissionURL, 'user')}`;\n\n this.post(config, successCallback, errorCallback);\n }", "attachPermissionedDataToGraph(graph, permissionedData) {\n if (permissionedData && Object.keys(permissionedData).length > 0) {\n for (const otObject of graph) {\n if (otObject['@id'] in permissionedData) {\n if (!otObject.properties) {\n otObject.properties = {};\n }\n otObject.properties.permissioned_data = permissionedData[otObject['@id']];\n }\n }\n }\n }", "function checkPermissions() {\n for (i = 0; i < $scope.modules.length; i++) {\n for (j = 0; j < $scope.modules[i].use_cases.length; j++) {\n if ($scope.modules[i].use_cases[j].codename in $scope.useCases) {\n $scope.modules[i].use_cases[j].allowed = true;\n } else {\n delete $scope.modules[i].use_cases[j].allowed;\n }\n }\n }\n }", "allowActions(role, actions) {\n let list = this.access[role] || [];\n list = list.concat(actions || []);\n let index = {};\n list.forEach(function(action){\n index[action] = true;\n });\n this.access[role] = Object.keys(index);\n this._rebuildIndex();\n }", "function bbedit_acpperms_clicked() {}", "addRolePermissions(existingRoles, existingPermissions, application, role) {\n\t if (!role.permissions || role.permissions.length == 0) {\n\t return Promise.resolve();\n\t }\n\n\t const existingRole = _.find(existingRoles, { applicationId: application.id, name: role.name });\n\t const existingRoleId = existingRole._id;\n\t delete existingRole._id;\n\t existingRole.permissions = role.permissions.map(permissionName => {\n\t const permission = _.find(existingPermissions, { applicationId: application.id, name: permissionName });\n\t return permission._id;\n\t });\n\n\t log(chalk.blue.bold('Role:'), `Adding permissions to ${existingRole.name} (${existingRoleId})...`);\n\t return request.put({ uri: process.env.AUTHZ_API_URL + '/roles/' + existingRoleId, json: existingRole, headers: { 'Authorization': 'Bearer ' + this.accessToken } })\n\t .then(() => {\n\t log(chalk.green.bold('Role:'), `Added ${existingRole.permissions.length} permissions ${role.name}`);\n\t return Promise.resolve(true);\n\t });\n\t}", "function mapRoles(roles) {\n var mappedRoles = $scope.data.ACL.roles.map(function(aclRole) {\n _.find(roles, function(role) {\n if (aclRole.uid === role.uid) {\n aclRole[\"name\"] = role.name;\n aclRole['uid'] = role.uid;\n }\n });\n return aclRole;\n });\n\n $scope.data.ACL.roles = mappedRoles;\n }", "allow(id, perm, [customId, customPerm] = ['userId', 'permissionId']) {\n if (!id || !perm) {\n throw new Error('no input fields');\n } else {\n return { [customId]: id, [customPerm]: perm };\n }\n }", "add(name, description, order, basePermissions) {\r\n const postBody = jsS({\r\n BasePermissions: {\r\n High: basePermissions.High.toString(),\r\n Low: basePermissions.Low.toString(),\r\n },\r\n Description: description,\r\n Name: name,\r\n Order: order,\r\n __metadata: { \"type\": \"SP.RoleDefinition\" },\r\n });\r\n return this.postCore({ body: postBody }).then((data) => {\r\n return {\r\n data: data,\r\n definition: this.getById(data.Id),\r\n };\r\n });\r\n }", "function loadPermissions() {\n\tpool.getConnection(function(err, connection) {\n\t\tconnection.query('SELECT * FROM permission', function(err, results, fields) {\n\t\t\tfor(var i in results) {\n\t\t\t\tif(!permission.hasOwnProperty(\"server\" + results[i].serverID)) {\n\t\t\t\t\tpermission[\"server\" + results[i].serverID] = {};\n\t\t\t\t\tpermission[\"server\" + results[i].serverID][\"user\" + results[i].userID] = [results[i].permissionName];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(!permission[\"server\" + results[i].serverID].hasOwnProperty(\"user\" + results[i].userID)) {\n\t\t\t\t\t\tpermission[\"server\" + results[i].serverID][\"user\" + results[i].userID] = [results[i].permissionName];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tpermission[\"server\" + results[i].serverID][\"user\" + results[i].userID].push(results[i].permissionName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconsole.log(localDateString() + \" | \" + colors.green(\"[LOAD]\") + \" Permissions have been loaded!\");\n\t\t\tconnection.release();\n\t\t});\n\t});\n}", "async importPermission() {\n for(let permission of permissionData) {\n await manager.insertEmployee(permission);\n }\n }", "requestPermission(permission, siteInfo, callback) {\n\t\t// Already have permission\n\t\tif (siteInfo.settings.permissions.indexOf(permission) > -1) {\n\t\t\tcallback();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.cmdp(\"wrapperPermissionAdd\", [permission])\n\t\t\t.then(callback);\n\t}", "addPointerPermissions(\n schema: SchemaController.SchemaController,\n className: string,\n operation: string,\n query: any,\n aclGroup: any[] = []\n ): any {\n // Check if class has public permission for operation\n // If the BaseCLP pass, let go through\n if (schema.testPermissionsForClassName(className, aclGroup, operation)) {\n return query;\n }\n const perms = schema.getClassLevelPermissions(className);\n\n const userACL = aclGroup.filter(acl => {\n return acl.indexOf('role:') != 0 && acl != '*';\n });\n\n const groupKey =\n ['get', 'find', 'count'].indexOf(operation) > -1 ? 'readUserFields' : 'writeUserFields';\n\n const permFields = [];\n\n if (perms[operation] && perms[operation].pointerFields) {\n permFields.push(...perms[operation].pointerFields);\n }\n\n if (perms[groupKey]) {\n for (const field of perms[groupKey]) {\n if (!permFields.includes(field)) {\n permFields.push(field);\n }\n }\n }\n // the ACL should have exactly 1 user\n if (permFields.length > 0) {\n // the ACL should have exactly 1 user\n // No user set return undefined\n // If the length is > 1, that means we didn't de-dupe users correctly\n if (userACL.length != 1) {\n return;\n }\n const userId = userACL[0];\n const userPointer = {\n __type: 'Pointer',\n className: '_User',\n objectId: userId,\n };\n\n const queries = permFields.map(key => {\n const fieldDescriptor = schema.getExpectedType(className, key);\n const fieldType =\n fieldDescriptor &&\n typeof fieldDescriptor === 'object' &&\n Object.prototype.hasOwnProperty.call(fieldDescriptor, 'type')\n ? fieldDescriptor.type\n : null;\n\n let queryClause;\n\n if (fieldType === 'Pointer') {\n // constraint for single pointer setup\n queryClause = { [key]: userPointer };\n } else if (fieldType === 'Array') {\n // constraint for users-array setup\n queryClause = { [key]: { $all: [userPointer] } };\n } else if (fieldType === 'Object') {\n // constraint for object setup\n queryClause = { [key]: userPointer };\n } else {\n // This means that there is a CLP field of an unexpected type. This condition should not happen, which is\n // why is being treated as an error.\n throw Error(\n `An unexpected condition occurred when resolving pointer permissions: ${className} ${key}`\n );\n }\n // if we already have a constraint on the key, use the $and\n if (Object.prototype.hasOwnProperty.call(query, key)) {\n return this.reduceAndOperation({ $and: [queryClause, query] });\n }\n // otherwise just add the constaint\n return Object.assign({}, query, queryClause);\n });\n\n return queries.length === 1 ? queries[0] : this.reduceOrOperation({ $or: queries });\n } else {\n return query;\n }\n }", "applyPermission() {\n if (this.permission[2] == 0) {\n this.showEditColumn(false);\n }\n if (this.permission[3] == 0) {\n this.showDeleteColumn(false);\n }\n }", "or(...permissions){\n this._generated_permission = orShieldRule(this._generated_permission,...permissions.map(permission => permission._generated_permission));\n return this;\n }", "addPermissions() {\n this.template.Resources[`${this.lambdaLogicalId}SNSPermissions`] = {\n Type : 'AWS::Lambda::Permission',\n Properties : {\n FunctionName : {\n 'Fn::GetAtt' : [\n this.lambdaLogicalId,\n 'Arn'\n ]\n },\n Action : 'lambda:InvokeFunction',\n Principal : 'sns.amazonaws.com'\n }\n };\n }", "function getPermissions(scope) {\n const permissions = {\n 'autonomous_highlights': {\n permissions: ['tabs'],\n origins: ['<all_urls>']\n },\n 'global_highlighting': {\n permissions: ['tabs'],\n origins: ['<all_urls>']\n },\n 'copy_highlights': {\n permissions: ['clipboardWrite'],\n origins: []\n }\n };\n if (scope === null) {\n const _permissions = new Set();\n const origins = new Set();\n for (const [key, value] of Object.entries(permissions)) {\n value.permissions.forEach(x => _permissions.add(x));\n value.origins.forEach(x => origins.add(x));\n }\n const result = {\n permissions: Array.from(_permissions),\n origins: Array.from(origins)\n };\n return result;\n } else if (scope === undefined) {\n return permissions;\n } else {\n return permissions[scope];\n }\n}", "function addToMap(Policy) {\n var category = (Policy || {}).category;\n if (category) {\n // Create a new list for that category if needed...\n policyMap[category] = policyMap[category] || [];\n // ...and put an instance of this policy in that list.\n policyMap[category].push(instantiate(Policy));\n }\n }", "function getPermissions() {\n return permissions;\n }", "function fillAliasMap(path, list, map) {\n\treturn list.reduce(function (symlinkedList, mod) {\n\t\tvar realPath = relative(path, fs.realpathSync(join(path, mod)));\n\t\tif (realPath !== mod) {\n\t\t\tsymlinkedList[realPath] = (mod);\n\t\t}\n\t\treturn symlinkedList;\n\t}, map || {});\n}", "appendMapping(mapping) {\n for (let i = 0, startSize = this.maps.length; i < mapping.maps.length; i++) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i], mirr != null && mirr < i ? startSize + mirr : void 0);\n }\n }", "can(id, perm) {\n let auth = false;\n if (!id || !perm) {\n throw new Error('no input fields');\n } else {\n this.keys.forEach(key => {\n if (key.userId == id && key.permissionId == perm) {\n auth = true;\n }\n });\n }\n return auth;\n }", "function putPermissions(req, res) {\n\tlet roleModel;\n\tlogger.debug('Inside role-routes >> putPermissions(req,res)...');\n\tlogger.debug('req params id: '+req.params.id);\n\t//Role.forge({id: req.params.id}).fetch({require: true, withRelated:['permissions']})\n\tretrieveModelWithPermissions()\n\t\t.then(doAuth)\n\t\t.then(detachExistingPermissions)\n\t\t.then(attachNewPermissions)\n\t\t.then(retrieveModelWithPermissions) // re-retrieve the model so as to get new permissions\n\t\t.then(sendResponse)\n\t\t.catch(errorToNotify);\n\n\tfunction retrieveModelWithPermissions() {\n\t\tlogger.debug('retrieving role with permissions');\n\t\treturn Role.forge({id: req.params.id}).fetch({require: true, withRelated:['permissions']})\n\t}\n\tfunction doAuth(model) {\n\t\tthis.roleModel = model;\n\t\treturn auth.allowsEdit(req.decoded.id, 'roles-permissions', model); // check whether logged user is allowed to Edit this role model\n\t}\n\tfunction detachExistingPermissions(granted){ // remove existing permissions first\n\t\tlet model = this.roleModel;\n\t\tlogger.debug('Inside role-routes >> detachExistingPermissions(model)...');\n\t\tlogger.debug(model.toJSON());\n\t\treturn model.permissions().detach();\n\t}\n\n\tfunction attachNewPermissions(){\n\t\tlogger.debug('inside role-routes >> attachNewPermissions(model)...');\n\t\tlogger.debug(this.roleModel.toJSON());\n\t\treturn this.roleModel.permissions().attach(req.body.mypermissionsIds); // attach new permissions\n\t}\n\n/*\tfunction sendResponse(aColl) {\n\t\tlogger.debug('exploring aColl after putPermissions')\n\t\tlogger.debug(aColl.toJSON())\n\t\tres.json({error:false, data:{ message: 'My Permissions are attached to Role' }});\n\t} */\n\n\tfunction sendResponse(model) {\n\t\tlet modelJson = model.toJSON();\n\t\tlogger.debug('inside role-routes >> sendResponse(model)')\n\t\tlogger.debug(modelJson)\n\t\tres.json(modelJson.permissions);\n\t}\n\n\tfunction errorToNotify(err){\n\t\tlogger.error(err);\n\t\tres.status(500).json({error: true, data: {message: err.message}});\n\t}\n}", "async changePermission(filesVisibility) {\n const result = await this.doRequest({\n path: \"/files/permission\",\n method: \"PUT\",\n body: filesVisibility,\n });\n return result;\n }", "importPermissions() {\n PermissionsUtils.importFromPrefs(PREF_XPI_PERMISSIONS_BRANCH,\n XPIInternal.XPI_PERMISSION);\n }", "function setPermissions(id)\n{\n\tvar query = \"&publishPermi=\" + ((document.setPermissions.publishPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&unpublishPermi=\" + ((document.setPermissions.unpublishPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&editPermi=\" + ((document.setPermissions.editPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&removePermi=\" + ((document.setPermissions.removePermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&loggingPermi=\" + ((document.setPermissions.loggingPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&viewAllPermi=\" + ((document.setPermissions.viewAllPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&viewPublishedPermi=\" + ((document.setPermissions.viewPublishedPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&viewUnpublishedPermi=\" + ((document.setPermissions.viewUnpublishedPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&ipPermi=\" + ((document.setPermissions.ipPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&webUsersPermi=\" + ((document.setPermissions.webUsersPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&searchPermi=\" + ((document.setPermissions.searchPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&permissionPermi=\" + ((document.setPermissions.permissionPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&summaryPermi=\" + ((document.setPermissions.summaryPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&jotCallPermi=\" + ((document.setPermissions.jotCallPermi[0].checked) ? \"1\" : \"0\");\n\tquery += \"&defaultThemePermi=\" + ((document.setPermissions.defaultThemePermi[0].checked) ? \"1\" : \"2\");\n\tquery += \"&changeThemePermi=\" + ((document.setPermissions.changeThemePermi[0].checked) ? \"1\" : \"0\");\n\t\n\tquery += \"&defaultViewPermi=\" + document.setPermissions.defaultViewPermi.value;\n\tquery += \"&summaryResPerPagePermi=\" + document.setPermissions.summaryResPerPagePermi.value;\n\tquery += \"&resPerPagePermi=\" + document.setPermissions.resPerPagePermi.value;\n\tquery += \"&jotCallResPerPagePermi=\" + document.setPermissions.jotCallResPerPagePermi.value;\n\t\n\tquery += \"&createdDocsPermi=\" + \n\t\t((document.setPermissions.own0createdDocsPermi.checked) ? \"0\" : \n\t\t\t((document.setPermissions.own1createdDocsPermi.checked) ? \"1\" : \"\") + \n\t\t\t((document.setPermissions.own2createdDocsPermi.checked) ? \"2\" : \"\") + \n\t\t\t((document.setPermissions.own3createdDocsPermi.checked) ? \"3\" : \"\") + \n\t\t\t((document.setPermissions.own4createdDocsPermi.checked) ? \"4\" : \"\")\n\t\t);\n\tquery += \"&publishedDocsPermi=\" + \n\t\t((document.setPermissions.own0publishedDocsPermi.checked) ? \"0\" : \n\t\t\t((document.setPermissions.own1publishedDocsPermi.checked) ? \"1\" : \"\") + \n\t\t\t((document.setPermissions.own2publishedDocsPermi.checked) ? \"2\" : \"\") + \n\t\t\t((document.setPermissions.own3publishedDocsPermi.checked) ? \"3\" : \"\") + \n\t\t\t((document.setPermissions.own4publishedDocsPermi.checked) ? \"4\" : \"\")\n\t\t);\t\t\n\tquery += \"&editedDocsPermi=\" + \n\t\t((document.setPermissions.own0editedDocsPermi.checked) ? \"0\" : \n\t\t\t((document.setPermissions.own1editedDocsPermi.checked) ? \"1\" : \"\") + \n\t\t\t((document.setPermissions.own2editedDocsPermi.checked) ? \"2\" : \"\") + \n\t\t\t((document.setPermissions.own3editedDocsPermi.checked) ? \"3\" : \"\") + \n\t\t\t((document.setPermissions.own4editedDocsPermi.checked) ? \"4\" : \"\")\n\t\t);\n\t\t\t\n\t\n\tvar xmlHttp = ajaxRequest();\n\txmlHttp.open(\"GET\" , \"index.php?a=112&id=\" +mKey+ \"&permission=1&setPermissions=\" + id + query, true);\n\t\n\txmlHttp.onreadystatechange=function() \n\t{\n\t\tif(xmlHttp.readyState==1)\n\t\t\tdocument.getElementById(\"dataTable\").innerHTML = '<p><img src=\"' +baseUrl+modulePath+ 'images/loading.gif\" />' +lang_loading+ '</p>';\n\t\t\n\t\tif(xmlHttp.readyState==4 && xmlHttp.status==200)\n\t\t\tdocument.getElementById(\"dataTable\").innerHTML = xmlHttp.responseText;\n\t}\n\txmlHttp.send(null);\n}", "function updateGrantedPermissions(um, stream) {\n const audioTracksReceived = Boolean(stream) && stream.getAudioTracks().length > 0;\n const videoTracksReceived = Boolean(stream) && stream.getVideoTracks().length > 0;\n const grantedPermissions = {};\n\n if (um.indexOf('video') !== -1) {\n grantedPermissions.video = videoTracksReceived;\n }\n\n if (um.indexOf('audio') !== -1) {\n grantedPermissions.audio = audioTracksReceived;\n }\n\n eventEmitter.emit(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_10___default.a.GRANTED_PERMISSIONS, grantedPermissions);\n}", "function constructModulePermissions(scope, localStorage, access, permissionsObj, forceEnv) {\n\tfunction checkApiHasAccess(aclObject, serviceName, routePath, method, userGroups, callback) {\n\t\tvar environments = Object.keys(aclObject);\n\t\treturn validateAccess(environments, 0, callback);\n\t\t\n\t\tfunction validateAccess(environments, i, cb) {\n\t\t\tvar envCode = environments[i].toLowerCase();\n\t\t\t\n\t\t\tif (!aclObject[envCode] || !aclObject[envCode][serviceName]) {\n\t\t\t\ti++;\n\t\t\t\tif (i === environments.length) {\n\t\t\t\t\treturn cb(false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalidateAccess(environments, i, cb);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar system = aclObject[envCode][serviceName];\n\t\t\t\tif (system) {\n\t\t\t\t\tvar access = checkSystem(system);\n\t\t\t\t\treturn cb(access);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn cb(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction checkSystem(system) {\n\t\t\tfunction getAclObj(aclObj) {\n\t\t\t\tif (aclObj && (aclObj.apis || aclObj.apisRegExp)) {\n\t\t\t\t\treturn aclObj;\n\t\t\t\t}\n\t\t\t\tif (method) {\n\t\t\t\t\tif (aclObj[method] && typeof aclObj[method] === \"object\") {\n\t\t\t\t\t\tvar newAclObj = {};\n\t\t\t\t\t\tif (aclObj.hasOwnProperty('access')) {\n\t\t\t\t\t\t\tnewAclObj.access = aclObj.access;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (aclObj[method].hasOwnProperty('apis')) {\n\t\t\t\t\t\t\tnewAclObj.apis = aclObj[method].apis;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (aclObj[method].hasOwnProperty('apisRegExp')) {\n\t\t\t\t\t\t\tnewAclObj.apisRegExp = aclObj[method].apisRegExp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (aclObj[method].hasOwnProperty('apisPermission')) {\n\t\t\t\t\t\t\tnewAclObj.apisPermission = aclObj[method].apisPermission;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (aclObj.hasOwnProperty('apisPermission')) {\n\t\t\t\t\t\t\tnewAclObj.apisPermission = aclObj.apisPermission;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn newAclObj;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn aclObj;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn aclObj;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsystem = getAclObj(system);\n\t\t\t\n\t\t\tvar api = (system && system.apis ? system.apis[routePath] : null);\n\t\t\t\n\t\t\tif (!api && system && system.apisRegExp && Object.keys(system.apisRegExp).length) {\n\t\t\t\tfor (var jj = 0; jj < system.apisRegExp.length; jj++) {\n\t\t\t\t\tif (system.apisRegExp[jj].regExp && routePath.match(system.apisRegExp[jj].regExp)) {\n\t\t\t\t\t\tapi = system.apisRegExp[jj];\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\tif (Object.hasOwnProperty.call(system, 'access')) {\n\t\t\t\tif (Array.isArray(system.access)) {\n\t\t\t\t\tvar checkAPI = false;\n\t\t\t\t\tif (userGroups) {\n\t\t\t\t\t\tfor (var ii = 0; ii < userGroups.length; ii++) {\n\t\t\t\t\t\t\tif (system.access.indexOf(userGroups[ii]) !== -1) {\n\t\t\t\t\t\t\t\tcheckAPI = true;\n\t\t\t\t\t\t\t\tbreak;\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\tif (!checkAPI) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn api_checkPermission(system, userGroups, api);\n\t\t\t}\n\t\t\t\n\t\t\tif (api || (system && system.apisPermission === 'restricted')) {\n\t\t\t\treturn api_checkPermission(system, userGroups, api);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction api_checkPermission(system, userGroups, api) {\n\t\t\tif ('restricted' === system.apisPermission) {\n\t\t\t\tif (!api) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn api_checkAccess(api.access, userGroups);\n\t\t\t}\n\t\t\tif (!api) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn api_checkAccess(api.access, userGroups);\n\t\t}\n\t\t\n\t\tfunction api_checkAccess(apiAccess, userGroups) {\n\t\t\tif (!apiAccess) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tif (apiAccess instanceof Array) {\n\t\t\t\tif (!userGroups) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar found = false;\n\t\t\t\tfor (var ii = 0; ii < userGroups.length; ii++) {\n\t\t\t\t\tif (apiAccess.indexOf(userGroups[ii]) !== -1) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn found;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction buildPermittedOperationEnv(serviceName, routePath, method, env, cb) {\n\t\tvar user = localStorage.soajs_user;\n\t\tif (user) {\n\t\t\tvar userGroups = user.groups;\n\t\t\tvar acl = {};\n\t\t\tif (localStorage.acl_access) {\n\t\t\t\tacl[env.toLowerCase()] = localStorage.acl_access[env.toLowerCase()];\n\t\t\t\t\n\t\t\t\tcheckApiHasAccess(acl, serviceName, routePath, method, userGroups, function (access) {\n\t\t\t\t\treturn cb(access);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn cb(false);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn cb(false);\n\t\t}\n\t}\n\t\n\tfor (var permission in permissionsObj) {\n\t\tif (Array.isArray(permissionsObj[permission])) {\n\t\t\tvar env = 'dashboard';\n\t\t\tif (forceEnv) {\n\t\t\t\tenv = forceEnv;\n\t\t\t}\n\t\t\t\n\t\t\tenv = env.toLowerCase();\n\t\t\tbuildPermittedOperationEnv(permissionsObj[permission][0], permissionsObj[permission][1], permissionsObj[permission][2], env, function (hasAccess) {\n\t\t\t\taccess[permission] = hasAccess;\n\t\t\t\tif (!scope.$$phase) {\n\t\t\t\t\tscope.$apply();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\telse if (typeof(permissionsObj[permission]) === 'object') {\n\t\t\taccess[permission] = {};\n\t\t\tconstructModulePermissions(scope, localStorage, access[permission], permissionsObj[permission], forceEnv);\n\t\t}\n\t}\n}", "function addPermission(){\r\n\t//get pathname to find permission\r\n\tvar repositorypPath = $('addPM').value;\r\n\tvar grouplist = document.getElementsByName(\"apgroup\");\r\n\tvar accountlist = document.getElementsByName(\"apaccount\");\r\n\t//Add the user select, group part\r\n\tfor( var i =0; i < grouplist.length ; i++ ){\r\n\t\tvar membername = grouplist[i].getElementsByTagName('label')[0].innerHTML;\r\n\t\tvar checkbox = grouplist[i].getElementsByTagName('input')[0];\r\n\t\t//Identify the user select, and call action to add\r\n\t\tif( checkbox.checked ){\r\n\t\t\t/*\r\n\t\t\t Ajax to action, add a permission data\r\n\t\t\t*/\r\n\t\t\tnew Ajax.Request('addPermission.action',\r\n\t\t\t{\r\n\t\t\t\tparameters: { name: membername, type: 'group', path: repositorypPath},\r\n\t\t\t\tonSuccess: function(transport){\r\n\t\t\t\t\tvar result = transport.responseText;\r\n\t\t\t\t\tif( result == \"true\" ){\r\n\t\t\t\t\t\tlistPathMember(repositorypPath);\r\n\t\t\t\t\t\taddPermissionTable();\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\twindow.alert(\"加入失敗\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t//Add the user select, account part\r\n\tfor( var i =0; i < accountlist.length ; i++ ){\r\n\t\tvar membername = accountlist[i].getElementsByTagName('label')[0].innerHTML;\r\n\t\tvar checkbox = accountlist[i].getElementsByTagName('input')[0];\r\n\t\t//Identify the user select, and call action to add\r\n\t\tif( checkbox.checked ){\r\n\t\t\t/*\r\n\t\t\t Ajax to action, add a permission data\r\n\t\t\t*/\r\n\t\t\tnew Ajax.Request('addPermission.action',\r\n\t\t\t{\r\n\t\t\t\tparameters: { name: membername, type: 'account', path: repositorypPath},\r\n\t\t\t\tonSuccess: function(transport){\r\n\t\t\t\t\tvar result = transport.responseText;\r\n\t\t\t\t\tif( result == \"true\" ){\r\n\t\t\t\t\t\tlistPathMember(repositorypPath);\r\n\t\t\t\t\t\taddPermissionTable();\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\twindow.alert(\"加入失敗\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}", "static associate(models) {\n // define association here\n Permission.belongsTo(models.User, { onDelete: \"CASCADE\", foreignKey: 'user_id' });\n Permission.belongsTo(models.Module, { onDelete: \"CASCADE\", foreignKey: 'module_id' });\n }", "function _setRoutesMap(router) {\n // function _getRoutesMap() {\n\n var global = function () {\n if (scope.type === 'realm') {\n _navigateToPage('realm', scope.data);\n } else if (scope.type === 'error') {\n _navigateToPage('error');\n } else {\n _navigateToPage('global', config.permissions.realms.realm_list);\n }\n };\n\n var realm = function (realmId, realmTab, realmSection) {\n // console.log(\">> url realm handler \")\n // console.log(arguments)\n\n // TODO - Array.from()\n // var args = Array.prototype.slice.call(arguments);\n\n var tabs = config.permissions.ui.realm;\n // console.log(tabs)\n\n // var defaultArgs = [args[0], tabs[0].name];\n var defaultRoute = \"/realm/\" + arguments[0] + \"/\" + tabs[0].name;\n\n // default \"subpage\" is status tab\n if (!realmTab) {\n // console.log(\">>> no tab >> set first as default\")\n // args = defaultArgs;\n router.setRoute(defaultRoute);\n return;\n }\n\n // console.log(realmTab);\n var tabValid = false;\n for (var t in tabs) {\n var tab = tabs[t];\n if (realmTab == tab.name) {\n // console.log(\">>> Yes!\", tab.name)\n tabValid = true;\n\n var sections = tab.sections;\n var firstSection = sections[0].name.replace(tab.name + \"-\", \"\");\n\n if (realmSection) {\n // console.log(realmSection);\n var sectionValid = false;\n\n if (sections.length <= 1) {\n // console.log(\">>> WARNING - HAS SECTION PARAM... BUT THE TAB IS JUST ONE SECTIONS\")\n router.setRoute(\"/realm/\" + arguments[0] + \"/\" + arguments[1]);\n return;\n }\n\n for (var s in sections) {\n var section = sections[s];\n if (tab.name + \"-\" + realmSection == section.name) {\n // console.log(\">>> Yes!\", section.name)\n sectionValid = true;\n break;\n }\n }\n\n if (!sectionValid) {\n // console.log(\">>> WARNING - SECTION NOT VALID\")\n router.setRoute(\"/realm/\" + arguments[0] + \"/\" + arguments[1] + \"/\" + firstSection);\n // router.setRoute(defaultRoute);\n return;\n }\n \n } else if (sections.length > 1) {\n router.setRoute(\"/realm/\" + arguments[0] + \"/\" + arguments[1] + \"/\" + firstSection); \n return;\n }\n\n break;\n }\n }\n\n if (!tabValid) {\n // console.log(\">>> WARNING - TAB NOT VALID\")\n // args.splice();\n // args = defaultArgs;\n router.setRoute(defaultRoute);\n return;\n \n } else {\n // console.log(\"### Final args\")\n // console.log(args)\n // _navigateToPage.apply(this, args);\n var context = [];\n for (var arg in arguments) {\n context.push(arguments[arg]);\n }\n _navigateToPage(\"realm\", context);\n }\n\n };\n\n var host = function (realmId, hostId) {\n _navigateToPage('host', arguments);\n };\n\n var error = function () {\n _navigateToPage('error');\n };\n\n // var urls = {\n // // global page\n // '/': global,\n // // realm page\n // '/realm/:realmId': realm,\n // '/realm/:realmId/:realmTab': realm,\n // '/realm/:realmId/:realmTab/:tabSection': realm,\n // // '/realm/:realmId/status': realm,\n // // // '/realm/:realmId/assets': realmAssets,\n // // '/realm/:realmId/assets/hosts': realm,\n // // '/realm/:realmId/assets/host-groups': realm,\n // // '/realm/:realmId/assets/business-processes': realm,\n // // '/realm/:realmId/geomap': realm,\n // // host page\n // '/realm/:realmId/host/:hostId': host,\n // // error page\n // '/error': error\n // };\n // return urls;\n\n // global page\n router.on('/', global);\n\n // realm page (subpages)\n router.on('/realm/:realmId', realm);\n router.on('/realm/:realmId/:realmTab', realm);\n router.on('/realm/:realmId/:realmTab/:tabSection', realm);\n\n // host page (subpages)\n router.on('/realm/:realmId/host/:hostId', host);\n \n // error page\n router.on('/error', error);\n \n }", "function setUserPermission(panelName, userId, action, permission) {\n // set user permission in store\n window['permissionStore_' + panelName][userId]['permissions'][action] = permission;\n updateAclField(panelName);\n}", "handlePerm(perms) {\n Alert.alert('Permissions', JSON.stringify(perms));\n }", "setPermission(isEmbedded, permission) {\n let success = true\n if (!isEmbedded) {\n success = browser.execute((select, permissionCode) => {\n let element = document.querySelector(select)\n element.value = permissionCode\n return element.value === permissionCode\n }, uimap.permissionSelect, uimap.permissionOptions(permission))\n } else {\n if (permission === 'use different settings') {\n browser.click(uimap.embeddedPermission.nonInherited)\n } else {\n browser.click(uimap.embeddedPermission.inherited)\n }\n }\n return success\n }", "extractPermissions() {\n\t\tlet token = this.token;\n\n\t\t/* Decode the JWT if the token parameter is a string \n * or set permissions directly if the token is an object.\n * If none of the above types were sent, throw an invalid error\n */\n\t\tif (typeof token === 'string') {\n\t\t\ttry {\n\t\t\t\tlet decoded = jwt.verify(token, 'xperience');\n\n\t\t\t\t/* Decoded JWT should contain a 'roles' or 'permissions' object in the data object\n * Example:\n * permissions: {\n * user: [\"read\", \"create\", \"delete\"],\n * blog: [\"create\", \"delete\"],\n * invoice: [\"read\", \"delete\"]\n * }\n */\n\t\t\t\tthis.permissions = decoded.data.permissions || decoded.data.roles;\n\t\t\t} catch (e) {\n\t\t\t\tthis.permissions = null;\n\t\t\t\tconsole.log(e.toString());\n\t\t\t}\n\t\t} else if (typeof token === 'object') {\n\t\t\tthis.permissions = token;\n\t\t} else {\n\t\t\tthrow new Error('Please provide a valid JWT token or permissions object');\n\t\t}\n\t}", "function SetPermissionsForGroup()\n {\n var url = _spPageContextInfo.siteAbsoluteUrl + \"/_api/web/roleassignments/addroleassignment(principalid=\" + groupId + \", roledefid=\" + roleDefinitionId + \")\";\n jQuery.ajax({\n url: url,\n type: \"POST\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"content-type\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": $(\"#__REQUESTDIGEST\").val()\n },\n success: function (data) {\n $scope.$apply(function () {\n $scope.statusMessages += \"Assigned Read permissions to the Group - <b>'\" + $scope.newGrpName + \"'</b><br />\";\n });\n\n loopThroughUsersGroups().done(\n function(spUniqueUsers){\n if(typeof(spUniqueUsers) != \"undefined\" && spUniqueUsers.length > 0){\n AddUsersToGroup(spUniqueUsers);\n }\n }\n );\n //loopThroughUsersGroups();\n //AddUsersToGroup();\n },\n error: function (jqxr, errorCode, errorThrown) {\n $scope.$apply(function () {\n $scope.statusMessages += jqxr.responseText + \"<br />\";\n });\n }\n });\n }", "function create_role_mapping(os_org, os_space, role) {\n\ttry {\n\t\tvar role_mapping_obj = JSON.parse(role_mapping_template)\n\t} catch(err) {\n\t\tconsole.log(err)\n\t\tprocess.exit(9)\n\t}\n\n\tif (role == \"organization-user\") {\n\t\trole_mapping_obj.roles = os_org.toLowerCase() + \"_user_role\"\n\n\t\tapi_url = base_role_mapping_api_url + os_org.toLowerCase() + \"_\" + \"user_rolemapping\"\n\n\t\t// CH 08-06-2020\n\t\t// Remove the PCF AD groups when the cut over to the new cop AD is complete\n\t\tauditors_pcf = \"CN=PCF-GG-\" + os_org + \"-Auditors,OU=SecurityGroups,OU=EnterpriseGroups,OU=Corelogic,DC=infosolco,DC=net\"\n\n\t\tauditors_cop = \"CN=cop-gg-\" + os_org + \"-auditors,OU=GCP,OU=Domain Groups,OU=CLGX,DC=infosolco,DC=net\"\n\n\t\tvar field_text = '{\"field\" : {\"groups\" : [ \"' + auditors_pcf + '\",\"' + auditors_cop + '\" ]}}'\n\n\t\ttry {\n\t\t\tvar field_obj = JSON.parse(field_text)\n\t\t\trole_mapping_obj.rules.all[1] = field_obj\n\t\t} catch(err) {\n\t\t\tconsole.log(err)\n\t\t\tprocess.exit(10)\n\t\t}\n\t} else if (role == \"space-user\") {\n\t\trole_mapping_obj.roles = os_org.toLowerCase() + \"_user_role\"\n\n\t\tapi_url = base_role_mapping_api_url + os_org.toLowerCase() + \"_\" + os_space.toLowerCase() + \"_\" + \"user_rolemapping\"\n\n\t\t// CH 08-06-2020\n\t\t// Remove the PCF AD groups when the cut over to the new cop AD is complete\n\t\tmanagers_pcf = \"CN=PCF-GG-\" + os_org + \"-\" + os_space + \"-Managers,OU=SecurityGroups,OU=EnterpriseGroups,OU=Corelogic,DC=infosolco,DC=net\"\n\t\tquality_assurance_pcf = \"CN=PCF-GG-\" + os_org + \"-\" + os_space + \"-QualityAssurance,OU=SecurityGroups,OU=EnterpriseGroups,OU=Corelogic,DC=infosolco,DC=net\"\n\t\tdata_analyst_pcf = \"CN=PCF-GG-\" + os_org + \"-\" + os_space + \"-DataAnalysts,OU=SecurityGroups,OU=EnterpriseGroups,OU=Corelogic,DC=infosolco,DC=net\"\n\n\t\tmanagers_cop = \"CN=cop-gg-\" + os_org + \"-\" + os_space + \"-managers,OU=GCP,OU=Domain Groups,OU=CLGX,DC=infosolco,DC=net\"\n\t\tquality_assurance_cop = \"CN=cop-gg-\" + os_org + \"-\" + os_space + \"-qualityops,OU=GCP,OU=Domain Groups,OU=CLGX,DC=infosolco,DC=net\"\n\n\t\tvar field_text = '{\"field\" : {\"groups\" : [ \"' + managers_pcf + '\",\"' + quality_assurance_pcf + '\",\"' + data_analyst_pcf + \n\t\t\t\t\t\t\t'\",\"' + managers_cop + '\",\"' + quality_assurance_cop + '\" ]}}'\n\n\t\ttry {\n\t\t\tvar field_obj = JSON.parse(field_text)\n\t\t\trole_mapping_obj.rules.all[1] = field_obj\n\t\t} catch(err) {\n\t\t\tconsole.log(err)\n\t\t\tprocess.exit(11)\n\t\t}\n\t} else if (role == \"space-admin\") {\n\t\trole_mapping_obj.roles = os_org.toLowerCase() + \"_admin_role\"\n\n\t\tapi_url = base_role_mapping_api_url + os_org.toLowerCase() + \"_\" + os_space.toLowerCase() + \"_\" + \"admin_rolemapping\"\n\n\t\t// CH 08-06-2020\n\t\t// Remove the PCF AD groups when the cut over to the new cop AD is complete\n\t\tdevelopers_pcf = \"CN=PCF-GG-\" + os_org + \"-\" + os_space + \"-Developers,OU=SecurityGroups,OU=EnterpriseGroups,OU=Corelogic,DC=infosolco,DC=net\"\n\t\tinfra_operator_pcf = \"CN=PCF-GG-\" + os_org + \"-\" + os_space + \"-InfraOperators,OU=SecurityGroups,OU=EnterpriseGroups,OU=Corelogic,DC=infosolco,DC=net\"\n\t\tdata_operator_pcf = \"CN=PCF-GG-\" + os_org + \"-\" + os_space + \"-DataOperators,OU=SecurityGroups,OU=EnterpriseGroups,OU=Corelogic,DC=infosolco,DC=net\"\n\n\t\tdevelopers_cop = \"CN=cop-gg-\" + os_org + \"-\" + os_space + \"-developers,OU=GCP,OU=Domain Groups,OU=CLGX,DC=infosolco,DC=net\"\n\t\tinfra_operator_cop = \"CN=cop-gg-\" + os_org + \"-\" + os_space + \"-infraops,OU=GCP,OU=Domain Groups,OU=CLGX,DC=infosolco,DC=net\"\n\t\tdata_operator_cop = \"CN=cop-gg-\" + os_org + \"-\" + os_space + \"-dataops,OU=GCP,OU=Domain Groups,OU=CLGX,DC=infosolco,DC=net\"\n\t\tdata_analyst_cop = \"CN=cop-gg-\" + os_org + \"-\" + os_space + \"-datadevs,OU=GCP,OU=Domain Groups,OU=CLGX,DC=infosolco,DC=net\"\n\n\t\tvar field_text = '{\"field\" : {\"groups\" : [ \"' + developers_pcf + '\",\"' + infra_operator_pcf + '\",\"' + data_operator_pcf + \n\t\t\t\t\t\t\t'\",\"' + developers_cop + '\",\"' + infra_operator_cop + '\",\"' + data_operator_cop + '\",\"' + data_analyst_cop + '\" ]}}'\n\n\t\ttry {\n\t\t\tvar field_obj = JSON.parse(field_text)\n\t\t\trole_mapping_obj.rules.all[1] = field_obj\n\t\t} catch(err) {\n\t\t\tconsole.log(err)\n\t\t\tprocess.exit(12)\n\t\t}\n\t} else {\n\t\tconsole.log(\"invalid rolemapping role supplied [\" + role + \"]\");\n\t\tprocess.exit(13)\n\t}\n\n\tconsole.log(api_url)\n\n\tupdate_elastic(api_url, role_mapping_obj)\n}", "function changeManyPermissions(value, actions,roleId) {\n return $http({\n url: EnvironmentConfig.api + 'roles/skipAcl_change_permission/parent/'+roleId+'/'+value,\n method: 'POST',\n data : actions,\n })\n .then(getDataComplete)\n .catch(getDataFailed);\n }", "function has_permission(list, perm)\n {\n // multiple chars means \"either of\"\n if (String(perm).length > 1) {\n for (var i=0; i < perm.length; i++) {\n if (has_permission(list, perm[i])) {\n return true;\n }\n }\n }\n\n if (list.rights && String(list.rights).indexOf(perm) >= 0) {\n return true;\n }\n\n return (perm == 'i' && list.editable);\n }", "function SetPermissionsForGroup()\n {\n var url = _spPageContextInfo.siteAbsoluteUrl + \"/_api/web/roleassignments/addroleassignment(principalid=\" + groupId + \", roledefid=\" + roleDefinitionId + \")\";\n jQuery.ajax({\n url: url,\n type: \"POST\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"content-type\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": $(\"#__REQUESTDIGEST\").val()\n },\n success: function (data) {\n $scope.$apply(function () {\n $scope.statusMessages += \"Assigned Read permissions to the Group - <b>'\" + $scope.groupName + \"'</b><br />\";\n });\n AddUsersToGroup();\n //AddtoDSGListJSOM();\n AddtoDSGListREST(usersList);\n },\n error: function (jqxr, errorCode, errorThrown) {\n alert(jqxr.responseText);\n $scope.$apply(function () {\n $scope.statusMessages += jqxr.responseText + \"<br />\";\n });\n }\n });\n }", "get permissions() {\n if (!this._permissionsBitfield)\n this._permissionsBitfield = new permissions_1.default(BigInt(this._permissions));\n return this._permissionsBitfield;\n }", "constructor(permissions) {\n super();\n this._permissions = permissions;\n }", "function loadPermissionRoles(next) {\n\n var perm = calipso.permission.Helper,\n PermissionRole = calipso.db.model('PermissionRole');\n\n // Clear down first - this may cause strange behaviour to anyone\n // making a request at just this moment ...\n perm.clearPermissionRoles();\n\n // Load the permissions\n PermissionRole.find({}).sort('permission', 1).sort('role', 1).find(function (err, prs) {\n\n prs.forEach(function (pr) {\n perm.addPermissionRole(pr.permission, pr.role);\n });\n\n perm.structureAndSort();\n\n next();\n\n });\n\n}", "function aposPermissions(req, action, fileOrSlug, callback) {\n if (req.user && (req.user.username === 'admin')) {\n // OK\n return callback(null);\n } else {\n return callback('Forbidden');\n }\n}", "function updateRolesToPermission($event) {\r\n $event.preventDefault();\r\n\r\n var selectedRoles = [];\r\n selectedRole = $('select#permissionRoleSelect').val();\r\n selectedRole.forEach(function(element, index) {\r\n selectedRoles[index] = {\r\n 'role_id': element\r\n };\r\n });\r\n\r\n \r\n var permissionData = {\r\n 'roles': selectedRoles\r\n };\r\n\r\n if (permission_id) {\r\n \t $(\"#loading\").css(\"display\", \"block\");\r\n $.ajax({\r\n url: './role/permission/' + permission_id,\r\n contentType: 'application/json',\r\n dataType: \"json\",\r\n type: 'PUT',\r\n data: JSON.stringify(permissionData)\r\n }).then(function(response) {\r\n $(\"#permission-details\").html('');\r\n permissionService.getPermissions().then(function(allPermissions) {\r\n if (allPermissions && allPermissions.length) { \r\n permissionService.showAllPermissions(allPermissions);\r\n }\r\n });\r\n common.infoMessage('Role assigned successfully.', 'success');\r\n }, function(error) {\r\n \t$(\"#loading\").css(\"display\", \"none\");\r\n common.infoMessage(error.responseJSON['error-auxiliary-message'], 'error');\r\n });\r\n }\r\n }", "function updatePermissionByPermissionId(fileId, permissionId, newRole) {\n // First retrieve the permission from the API.\n var request = gapi.client.drive.permissions.get({\n 'fileId': fileId,\n 'permissionId': permissionId\n });\n request.execute(function(resp) {\n resp.role = newRole;\n var updateRequest = gapi.client.drive.permissions.update({\n 'fileId': fileId,\n 'permissionId': permissionId,\n 'resource': resp\n });\n updateRequest.execute(function(resp) { \n \tconsole.log(\"!!!!!!\",resp);\n });\n });\n}", "function setPermissions() {\n postPermission(\n success = function () {\n sweetAlert(\"User created\", \"User '\" + email + \"' has been created\", \"success\");\n viewController('users');\n },\n error = null,\n email = email,\n admin = isAdmin,\n editor = isEditor,\n dataVisPublisher = isDataVisPublisher\n );\n }", "function addMapping(router, mapping) {\n for (var url in mapping) {\n if (url.startsWith('GET ')) {\n var path = url.substring(4);\n router.get(path, mapping[url]);\n console.log(`register URL mapping: GET ${path}`);\n } else if (url.startsWith('POST ')) {\n var path = url.substring(5);\n router.post(path, mapping[url]);\n console.log(`register URL mapping: POST ${path}`);\n } else if (url.startsWith('PUT ')) {\n var path = url.substring(4);\n router.put(path, mapping[url]);\n console.log(`register URL mapping: PUT ${path}`);\n } else if (url.startsWith('DELETE ')) {\n var path = url.substring(7);\n router.del(path, mapping[url]);\n console.log(`register URL mapping: DELETE ${path}`);\n } else {\n console.log(`invalid URL: ${url}`);\n }\n }\n}", "hasPermissions (permissionSet) {\n return comparePermissions(this.permissionSet, permissionSet)\n }", "function addMapping(router, mapping) {\n for (let url in mapping.default) {\n if (url.startsWith('GET ')) {\n var path = url.substring(4);\n router.get(path, mapping[url]);\n console.log(`register URL mapping: GET ${path}`);\n\n } else if (url.startsWith('POST ')) {\n var path = url.substring(5);\n router.post(path, mapping[url]);\n console.log(`register URL mapping: POST ${path}`);\n\n } else if (url.startsWith('PUT ')) {\n var path = url.substring(4);\n router.put(path, mapping[url]);\n console.log(`register URL mapping: PUT ${path}`);\n\n } else if (url.startsWith('DELETE ')) {\n var path = url.substring(7);\n router.del(path, mapping[url]);\n console.log(`register URL mapping: DELETE ${path}`);\n\n } else {\n console.log(`invalid URL: ${url}`);\n }\n }\n}", "async getPermissions() {\n const files = glob.sync( `${rootDir}/modules/*/*.permissions.js`);\n\t//console.log(files); \n let permissions = [];\t\n files.forEach(filepath => {\n\t let module_permissions = require(filepath); // eslint-disable-line global-require, import/no-dynamic-require\n permissions = permissions.concat(module_permissions);\n });\n return permissions;\n }", "function addMapping(router, mapping) {\n for (let url in mapping) {\n\n if (url.startsWith('GET ')) {\n\n let path = url.substring(4);\n router.get(path, mapping[url]);\n\n } else if (url.startsWith('POST ')) {\n\n let path = url.substring(5);\n router.post(path, mapping[url]);\n\n } else if (url.startsWith('PUT ')) {\n\n let path = url.substring(4);\n router.put(path, mapping[url]);\n\n } else if (url.startsWith('DELETE ')) {\n\n let path = url.substring(7);\n router.delete(path, mapping[url]);\n\n } else {\n console.log(`invalid URL: ${url}`);\n }\n }\n}", "function insertPermission(fileId, value, type, role, callback) {\n\tvar successMessage = \"Grant new user permission completes.\";\n\tvar failMessage = \"Grant new user permission incompletes.\";\n\tvar body = {\n\t\t\t'value': value,\n\t\t\t'type': type,\n\t\t\t'role': role\n\t};\n\tvar request = gapi.client.drive.permissions.insert({\n\t\t'fileId': fileId,\n\t\t'resource': body\n\t});\n\trequest.execute(function(resp) {\n\t\tif (!resp.error){\n\t\t\tconsole.log(successMessage,resp);\n\t\t\tcallback && callback(successMessage,true,resp);\n\t\t}else{\n\t\t\tconsole.log(failMessage,resp);\n\t\t\tcallback && callback(failMessage,false,resp);\n\t\t}\n\t});\n}", "function setRight(accessRights,role,action,enabled){\n var roleIdx = wordLookup(role,$.roles);\n var actionIdx = wordLookup(action,$.allActions);\n accessRights[roleIdx][actionIdx].enabled = enabled;\n }", "function profilPermissionInit()\n\t{\n\t\tnavigationInit(\"profilPermission\", \"web_profil_rights\");\n\t}", "function saveToMetadata(user, groups, roles, permissions, cb) {\n user.app_metadata = user.app_metadata || {};\n user.app_metadata.authorization = {\n groups: groups,\n roles: roles,\n permissions: permissions\n };\n\n auth0.users.updateAppMetadata(user.user_id, user.app_metadata)\n .then(function() {\n cb();\n })\n .catch(function(err){\n cb(err);\n });\n }", "getPermissions(descriptor, finsembleConfig) {\n // Default object with no permissions. If there's a security policy, we'll grab the permissions from config and feed them down to e2o.\n let approvedPermissions = {\n System: {},\n Window: {},\n Application: {}\n };\n let requestedPermissions = {};\n // If the dev has set up this component with explicit permissions, we assign those. Any permission that is\n // defined on the security policy will overwrite component-specific permissions.\n try {\n requestedPermissions = JSON.parse(JSON.stringify(descriptor.permissions));\n }\n catch (e) {\n requestedPermissions = {};\n }\n approvedPermissions = merge(approvedPermissions, requestedPermissions);\n // finsembleConfig.securityPolicies will always exist. Defaults are exported from finsemble core.\n const securityPolicy = finsembleConfig.securityPolicies[descriptor.securityPolicy];\n // This should always be defined in the normal course of the program executing. Prior to calling getPermissions,\n // we call getSecurityPolicy. That method will assign a policy if the one that the dev supplies doesn't exist.\n // This check is here in case we do unit testing in the future.\n if (securityPolicy) {\n // this will be something like Application, Window, System.\n const namespaces = Object.keys(securityPolicy);\n // go through the permissions enumerated in the security policy and apply what the component requests,\n // unless it conflicts with the default security policy for this component.\n for (let i = 0; i < namespaces.length; i++) {\n const namespace = namespaces[i];\n const namespacePermissions = Object.keys(securityPolicy[namespace]);\n // Component permissions are a subset of system permissions. They do not have to specify anything for System, Window, or Application.\n if (!approvedPermissions[namespace])\n approvedPermissions[namespace] = {};\n for (let p = 0; p < namespacePermissions.length; p++) {\n const permissionName = namespacePermissions[p];\n const defaultPermission = securityPolicy[namespace][permissionName];\n // approvedPermissions is the merged object of defaults and what was requested by the component's config.\n let assignedPermission = approvedPermissions[namespace][permissionName];\n if (assignedPermission) {\n // If the component wants to have access to something that the security policy says\n // that it can't, we deny access.\n // Component permissions can only be _more_ restrictive, not less.\n // @NOTE: Only did === false for clarity. Makes the chunk below much more clear.\n if (defaultPermission === false) {\n assignedPermission = false;\n }\n }\n else if (typeof assignedPermission === \"undefined\") {\n // if the component doesn't specify whether they want access, fall back to whatever the system says should happen.\n assignedPermission = defaultPermission;\n }\n approvedPermissions[namespace][permissionName] = assignedPermission;\n }\n }\n }\n // The Window Service should not have a permission set to disable the ability to close windows.\n // If it does remove that permission, and log an error.\n const closeDisallowed = approvedPermissions.Window[\"close\"] === false;\n if (descriptor.name === \"windowService\" && closeDisallowed) {\n logger_1.default.system.error(\"Window Service cannot be restricted from closing windows, disabling restriction.\");\n approvedPermissions.Window[\"close\"] = true;\n }\n return approvedPermissions;\n }", "hasPermissions(value, perm) {\r\n if (!perm) {\r\n return true;\r\n }\r\n if (perm === PermissionKind.FullMask) {\r\n return (value.High & 32767) === 32767 && value.Low === 65535;\r\n }\r\n perm = perm - 1;\r\n let num = 1;\r\n if (perm >= 0 && perm < 32) {\r\n num = num << perm;\r\n return 0 !== (value.Low & num);\r\n }\r\n else if (perm >= 32 && perm < 64) {\r\n num = num << perm - 32;\r\n return 0 !== (value.High & num);\r\n }\r\n return false;\r\n }", "addMapping(mapping) {\n\t\t\tthis.assertUnlocked();\n\n\t\t\tconst {name, source} = mapping;\n\n\t\t\tthis.validatePosition(\n\t\t\t\t\"generated\",\n\t\t\t\tmapping.generated.line,\n\t\t\t\tmapping.generated.column,\n\t\t\t);\n\n\t\t\tif (mapping.original) {\n\t\t\t\tthis.validatePosition(\n\t\t\t\t\t\"original\",\n\t\t\t\t\tmapping.original.line,\n\t\t\t\t\tmapping.original.column,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (source !== undefined) {\n\t\t\t\tthis.sources.add(source.join());\n\t\t\t}\n\n\t\t\tif (name !== undefined) {\n\t\t\t\tthis.names.add(name);\n\t\t\t}\n\n\t\t\tthis.mappings.add(mapping);\n\t\t}", "add(name, description, order, basePermissions) {\n return __awaiter(this, void 0, void 0, function* () {\n const postBody = body({\n BasePermissions: { \"High\": basePermissions.High.toString(), \"Low\": basePermissions.Low.toString() },\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n const data = yield spPost(this, postBody);\n return {\n data: data,\n definition: this.getById(data.Id),\n };\n });\n }", "async function handlePermissionsNext(applyAll) {\n // Add password to the bundle\n const pass = document.getElementById(\"securesend_password\").value;\n\n // Default permissions\n let print = true;\n let modify = true;\n let annotate = true;\n let forms = true;\n\n if (currentFileNum === -1) {\n\n } else {\n // Get permission and add to bundle\n print = document.getElementById(\"checkbox-print\").checked;\n modify = document.getElementById(\"checkbox-modify\").checked;\n annotate = document.getElementById(\"checkbox-annotate\").checked;\n forms = document.getElementById(\"checkbox-forms\").checked;\n\n bundle.permissionsArray.push({ print, modify, annotate, forms, pass });\n }\n currentFileNum++;\n\n // If apply all, fill the permissions array\n while (applyAll && currentFileNum < bundle.files.length) {\n bundle.permissionsArray.push({ print, modify, annotate, forms, pass });\n currentFileNum++;\n }\n\n if (currentFileNum < bundle.files.length) {\n loadPermissions();\n } else {\n loadCoordinateSettings();\n }\n }", "function getPermissions(req, res) {\n\tRole.forge( {id: req.params.id} ).fetch({withRelated: ['permissions']})\n\t\t.then(model => {\n\t\t\tlet modelJson = model.toJSON();\n\t\t\tres.json(modelJson.permissions);\n\t\t})\n\t\t.catch(err => res.send(err));\n}", "function hasPermission(menuPerms, route) {\n if (route.meta && route.meta.perms) {\n if (!menuPerms || menuPerms.length <= 0) {\n return false\n }\n return menuPerms.some(perm => route.meta.perms.includes(perm))\n } else {\n return true\n }\n}", "function setupAccessControl(target) {\r\n if (!isPlainObject(target) ||\r\n isRaw(target) ||\r\n Array.isArray(target) ||\r\n isRef(target) ||\r\n isComponentInstance(target) ||\r\n accessModifiedSet.has(target))\r\n return;\r\n accessModifiedSet.set(target, true);\r\n var keys = Object.keys(target);\r\n for (var i = 0; i < keys.length; i++) {\r\n defineAccessControl(target, keys[i]);\r\n }\r\n}", "function setupAccessControl(target) {\r\n if (!isPlainObject(target) ||\r\n isRaw(target) ||\r\n Array.isArray(target) ||\r\n isRef(target) ||\r\n isComponentInstance(target) ||\r\n accessModifiedSet.has(target))\r\n return;\r\n accessModifiedSet.set(target, true);\r\n var keys = Object.keys(target);\r\n for (var i = 0; i < keys.length; i++) {\r\n defineAccessControl(target, keys[i]);\r\n }\r\n}", "* getPermissions(userId) {\n\t\t\tconst permissions = yield app.mysql.query(\n\t\t\t\t'SELECT permission.* ' +\n\t\t\t\t'FROM `employee` ' +\n\t\t\t\t\t'INNER JOIN `role_permission_mapping` map ' +\n\t\t\t\t\t'ON employee.phone = ? AND employee.roleId = map.roleId ' +\n\t\t\t\t'INNER JOIN `permission` ' +\n\t\t\t\t'ON permission.id = map.permissionId', [userId]);\n\t\t\treturn permissions;\n\t\t}", "isWritePermitted() {\n return this.checkAdminPermission('add')\n }", "function addFoldersToIndex(folder, map) {\n if (map === void 0) { map = {}; }\n if (folder) {\n var key = folder.key;\n if (key) {\n map[key] = folder;\n }\n angular.forEach(folder.children, function (child) { return addFoldersToIndex(child, map); });\n }\n return map;\n }", "_addMap(map) {\n this._selectedMaps.push(map);\n this._eventBus.trigger(EVENT.TOGGLE_VIDEO_MAP, this._selectedMaps);\n }", "function set_roles() {\n\n // Define roles, resources and permissions\n acl.allow([\n {\n roles: '0', //super -admin\n allows: [\n { resources: '/secret', permissions: '*' }\n ]\n }, {\n roles: '1', //organization-admin\n allows: [\n { resources: '/secret', permissions: 'get' },\n { resources: '/user', permissions: '*' }\n ]\n }, {\n roles: '2', //partipent\n allows: [\n {resources:'/secret' , permissions:'get'}\n ]\n }\n ]);\n\n acl.addRoleParents( 'user', 'guest' );\n acl.addRoleParents( 'admin', 'user' );\n}", "_loadMappingsForConcepts(concepts) {\n // Don't load if disabled in settings\n if (!this.loadConceptsMappedStatus) {\n return\n }\n const registry = this.currentRegistry\n const otherScheme = this.loadConceptsMappedStatusOtherScheme\n concepts = getItems(concepts.filter(concept => !_.get(concept, \"__MAPPED__\", []).find(item => this.$jskos.compareFast(item.registry, registry) && this.$jskos.compare(item.scheme, otherScheme))))\n const conceptUris = concepts.map(i => i.uri)\n if (otherScheme && conceptUris.length && registry) {\n Promise.all(_.chunk(conceptUris, 15).map(uris => this.getMappings({\n from: uris.join(\"|\"),\n toScheme: otherScheme.uri,\n direction: \"both\",\n registry: registry.uri,\n limit: 500,\n }))).then(() => {\n // Set to false for every concept that still has no entry for current registry + other scheme\n for (let concept of concepts.filter(c => !_.get(c, \"__MAPPED__\", []).find(item => this.$jskos.compareFast(item.registry, registry) && this.$jskos.compare(item.scheme, otherScheme)))) {\n modifyItem(concept, \"__MAPPED__\", [])\n concept.__MAPPED__.push({\n registry,\n scheme: otherScheme,\n exist: [],\n })\n }\n })\n }\n }", "setKeyboardShortcuts(mapping) {\n this[keyMapSym].setMapping(mapping);\n }", "function addpermissionfornewgroup(id){\n\t\t$('#permissiontogroup'+id).click(function(){\n\t\t\t$('#creategroupresult').html('');\n\t\t\tvar pms='';\n\t\t\t$('.permissiontogroup:checked').each(function(){\n\t\t\t\tpms=pms+','+$(this).attr('permission');\n\t\t\t});\n\t\t\t$('#grouppermission').val(pms.substring(1));\n\n\t\t});\n\t}", "* checkPermission(userId, permissionId) {\n\t\t\tconst mapping = yield app.mysql.query(\n\t\t\t\t'SELECT role_permission_mapping.id FROM `employee`' + \n\t\t\t\t'INNER JOIN `role_permission_mapping`' + \n\t\t\t\t\t'ON employee.phone = ? AND employee.roleId = role_permission_mapping.roleId ' +\n\t\t\t\t'WHERE role_permission_mapping.permissionid = ?', [userId, permissionId]);\n\t\t\treturn mapping && mapping.length > 0;\n\t\t}", "function SetPermissionsForGroup()\n {\n var url = _spPageContextInfo.siteAbsoluteUrl + \"/_api/web/roleassignments/addroleassignment(principalid=\" + groupId + \", roledefid=\" + roleDefinitionId + \")\";\n jQuery.ajax({\n url: url,\n type: \"POST\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"content-type\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": $(\"#__REQUESTDIGEST\").val()\n },\n success: function (data) {\n $scope.safeApply(function () {\n $scope.statusMessages += \"Assigned Read permissions to the Group - <b>'\" + $scope.groupName + \"'</b><br />\";\n });\n /* AddUsersToGroup().then(\n function (success) {\n if ($scope.usersToAdd.length > 0) {\n $scope.$apply(function () {\n $scope.hideUsersList = true;\n $scope.statusMessages += \"<b>\" + $scope.usersToAdd.length + \"</b> Users have been added to the group<br />\";\n $scope.statusMessages += \"<b>Completed</b><br />\";\n });\n }\n AddtoDSGListJSOM();\n });*/\n AddUsersToGroup();\n //AddtoDSGListREST();\n },\n error: function (jqxr, errorCode, errorThrown) {\n //alert(jqxr.responseText);\n $scope.safeApply(function () {\n $scope.statusMessages += jqxr.responseText + \"<br />\";\n });\n }\n });\n }", "function mapUsers(users) {\n var mappedUsers = $scope.data.ACL.users.map(function(aclUser) {\n _.find(users, function(user) {\n if (aclUser.uid === user.uid) {\n aclUser[\"email\"] = user.email;\n aclUser[\"username\"] = user.username;\n aclUser['_tenant'] = user._tenant;\n aclUser['uid'] = user.uid;\n }\n });\n if (aclUser.uid === \"anonymous\") {\n aclUser[\"id\"] = \"anonymous\";\n aclUser[\"text\"] = \"Anonymous (Non logged in users)\";\n aclUser[\"username\"] = \"Anonymous (Non logged in users)\";\n }\n return aclUser;\n });\n $scope.data.ACL.users = mappedUsers;\n }", "function addListenersMap(eventId, listenerMap) {\n \n for( var pattern in listenerMap ) {\n addPathOrNodeCallback(eventId, pattern, listenerMap[pattern]);\n }\n }", "function patchPermissionByPermissionId(fileId, permissionId, newRole) {\n var body = {'role': newRole};\n var request = gapi.client.drive.permissions.patch({\n 'fileId': fileId,\n 'permissionId': permissionId,\n 'resource': body\n });\n request.execute(function(resp) {\n \tconsole.log(\"!!!!!!\",resp);\n });\n}", "userHasPermissions(loginName, permission) {\r\n return this.getUserEffectivePermissions(loginName).then(perms => {\r\n return this.hasPermissions(perms, permission);\r\n });\r\n }", "get permissionsInput() {\n return this._permissions;\n }", "getPermissions () {\n return this.__request('GET', '/v1/me/getpermissions')\n }", "getRoles()\n {\n return this.loading\n .then((db) => db('role')\n .select()\n .map((role) =>\n {\n // We store the permissions as a JSON string, because that's way easier than doing crazy joins.\n // And this doesn't add much overhead at all.\n role.permissions = JSON.parse(role.permissions);\n return role;\n }));\n }" ]
[ "0.7538389", "0.6012295", "0.57734036", "0.56393194", "0.5588697", "0.5573623", "0.5569579", "0.5504963", "0.5437489", "0.54142624", "0.5366259", "0.53365684", "0.5328366", "0.53130364", "0.52692145", "0.52516556", "0.5237621", "0.51472634", "0.51453215", "0.5116701", "0.5114465", "0.51115733", "0.5034347", "0.50299364", "0.5028065", "0.5017802", "0.5001272", "0.49838418", "0.4971978", "0.4971701", "0.49589622", "0.4951169", "0.49344712", "0.49282485", "0.4926513", "0.4924101", "0.49234724", "0.48427078", "0.48302624", "0.48227906", "0.4820729", "0.48133028", "0.4811816", "0.4804169", "0.4784139", "0.47606897", "0.4757573", "0.47170693", "0.47151032", "0.4711134", "0.46959186", "0.4694249", "0.4678531", "0.4673638", "0.46716177", "0.4668032", "0.46508235", "0.4645373", "0.46417788", "0.4633421", "0.46181288", "0.46179372", "0.46132413", "0.46122673", "0.4600251", "0.45924488", "0.45923427", "0.45905542", "0.4587019", "0.45852983", "0.4582802", "0.4574506", "0.45720807", "0.45692608", "0.45677856", "0.4566909", "0.4561928", "0.45605865", "0.45591748", "0.4556398", "0.45542967", "0.45535883", "0.45535883", "0.4544144", "0.45341107", "0.4530106", "0.45239744", "0.4508995", "0.450773", "0.45054498", "0.44994113", "0.44958067", "0.44918296", "0.44864222", "0.44504198", "0.4444022", "0.4441896", "0.44342494", "0.44133878", "0.43927634" ]
0.54594237
8
We need to disable caching By default firefox will cache iframes, and we don't want that Disabling this for now, the real fix should be in httpd.js
function injectContent() { var data = require("sdk/self").data; require('sdk/page-mod').PageMod({ include: ["*.gaiamobile.org"], contentScriptFile: [ data.url("ffos_runtime.js"), data.url("hardware.js"), data.url("lib/activity.js"), data.url("lib/apps.js"), data.url("lib/bluetooth.js"), data.url("lib/cameras.js"), data.url("lib/idle.js"), data.url("lib/keyboard.js"), data.url("lib/mobile_connection.js"), data.url("lib/power.js"), data.url("lib/set_message_handler.js"), data.url("lib/settings.js"), data.url("lib/wifi.js") ], contentScriptWhen: "start", attachTo: ['existing', 'top', 'frame'] }) require('sdk/page-mod').PageMod({ include: ["*.homescreen.gaiamobile.org"], contentScriptFile: [ data.url("apps/homescreen.js") ], contentScriptWhen: "start", attachTo: ['existing', 'top', 'frame'] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function noCache(url){\n\tvar qs = new Array();\n\tvar arr = url.split('?');\n\tvar scr = arr[0];\n\tif(arr[1]) qs = arr[1].split('&');\n\tqs[qs.length]='nocache='+new Date().getTime();\nreturn scr+'?'+qs.join('&');\n}", "function cacheControl(response) {\n response.set({\n 'Cache-Control': 'no-cache, no-store, must-revalidate',\n 'Pragma': 'no-cache',\n 'Expires': '0'\n })\n}", "function uuajaxexpire() {\r\n _uuajax._cache = {}; // expire If-Modified-Since cache\r\n}", "function forceReload(cachebuster, url)\n{\n var id = url.replace(/[^a-zA-Z 0-9]+/g,\"\"); // remove non-alphanumerics\n if(Ext.get(id)==null)\n {\n // first time create the iframe\n var frame = document.createElement('iframe');\n frame.id = id;\n frame.name = id;\n frame.src = cachebuster + \"?src=\" + escape(url);\n frame.className = 'x-hidden';\n document.body.appendChild(frame);\n // give browser time to append new frame before reloading\n forceReload.defer(200, this, [cachebuster, url]);\n }\n else\n {\n parent.frames[id].location.reload();\n }\n}", "function invalidate_domain_cache_maybe() {\n if (acre.request.headers['cache-control'] &&\n acre.request.headers['cache-control'].indexOf('no-cache') !== -1) {\n\n var keys = [];\n i18n.LANGS.forEach(function(lang){\n keys.push(\"domains:\"+lang.key);\n });\n acre.cache.request.removeAll(keys);\n return true;\n\n } else {\n return false;\n }\n}", "function configNoCache($httpProvider) {\n $httpProvider.defaults.headers.common['Cache-Control'] = 'no-cache';\n }", "function reloadPageIfCached() {\n // moving the cache check to after page load as firefox calculates transfer size at the end\n $(function () {\n let isCached = window.performance.getEntriesByType(\"navigation\")[0].transferSize === 0;\n //adding a second check to ensure that if for whatever reason teh transfersize reads wrong, we don't reload on\n //a reload:\n let isReload = window.performance.getEntriesByType(\"navigation\")[0].type === \"reload\";\n if (isCached && !isReload) {\n window.location.reload();\n }\n });\n}", "function cacheBrowsing() {\n //$.notify(\"in cacheBrowsing()\");\n var currentUrl = window.location.href;\n var currentProtocol = window.location.protocol;\n var searchBaseUrl = currentProtocol + \"//webcache.googleusercontent.com/search?q=cache%3A\";\n var cacheViewUrl = searchBaseUrl + encodeURIComponent(currentUrl);\n\n /* Before making the redirection, check if\n * the request come back with no status code (404..)\n * Doing a HEAD request instead of the default GET will only returns the headers\n * and indicates whether the page exists (response codes 200 - 299 ) or not\n * (response codes 400 - 499)\n */\n var successfull = false;\n $.ajax({\n type: 'HEAD',\n url: cacheViewUrl,\n success: function() {\n successfull = true;\n chrome.runtime.sendMessage({\n redirect: cacheViewUrl\n })\n },\n complete: function() {\n if (!successfull)\n $.notify(chrome.i18n.getMessage(\"noCacheAvailable\"), \"warn\", { clickToHide: true, autoHide: false });\n }\n });\n}", "function initIframe() {\n // Set iframe to session viewport size\n iframe.width = session.viewport.width;\n iframe.height = session.viewport.height;\n browserContent.style.cssText = `height: ${session.viewport.height}px; width: ${session.viewport.width}px;`;\n iframe.onload = () => {\n iframeDocument = iframe.contentDocument;\n clickPath.appendTo(iframeDocument.body);\n heatMap.appendTo(iframeDocument.body);\n scrollMap.appendTo(iframeDocument.body);\n };\n iframe.src = site.url;\n}", "function nocache(req, res, next) {\n res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');\n res.header('Expires', '-1');\n res.header('Pragma', 'no-cache');\n next();\n}", "function nocache(req, res, next) {\n res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');\n res.header('Expires', '-1');\n res.header('Pragma', 'no-cache');\n next();\n}", "function cache() {\n document.documentElement.dataset.cached = true;\n var data = document.documentElement.outerHTML;\n fetch('./render-store/', { method: 'PUT', body: data }).then(function() {\n console.log('Page cached');\n });\n}", "function PreventCaching(url)\n{\n var newUrl;\n \n newUrl = url;\n \n if(newUrl.indexOf('?') != -1)\t//has ?\t \n newUrl += \"&ms=\" + new Date().getTime();\t \n else\t \n newUrl += \"?ms=\" + new Date().getTime();\n \n return newUrl;\n}", "function setNoCache(req, res, next) {\n res.set('Pragma', 'no-cache');\n res.set('Cache-Control', 'no-cache, no-store');\n next();\n}", "function eraseCache(){\r\n\t\t\t window.location = window.location.href+'?eraseCache=true';\r\n\t\t\t}", "function cookiesNotEnabled() \n{\n\treturn true; // We're not going to use cookies\n}", "function autoDetection() {\n //$.notify(\"in autodection()\");\n var currentUrl = window.location.href;\n $.ajax({\n type: 'GET',\n async: true,\n crossDomain: true,\n headers: { 'Cache-Control': 'no-cache'},\n url: currentUrl,\n dataType: 'html',\n error: function () {\n cacheBrowsing();\n }\n });\n}", "function tryIframeApproach() {\n var iframe = document.createElement(\"iframe\");\n iframe.style.border = \"none\";\n iframe.style.width = \"1px\";\n iframe.style.height = \"1px\";\n iframe.onload = function () {\n document.location = alt;\n };\n iframe.src = custom;\n document.body.appendChild(iframe);\n }", "function timerGo_vid() {\n IDx('response_iframe_id').src = ''; //makes iframe suddenly have no src turning to black background css\n IDx('response_iframe_id').style.display = 'none'; //makes iframe disappear abruptly\n }", "function response_cache(response) {\n if(response.status == 200) {\n var page = 1;\n var href = _url.split('?').pop().split('/');\n if(href[href.length - 2] == 'part') {\n page = parseInt(href[href.length - 1]);\n }\n\n /* We can't parse the cache as XML since we can't ensure it's wellformed or\n * valid. To extract the agerated tags we need to make them visible for\n * jQuery by replacing them with proper html tags beforhand */\n var part = response.cache.replace('<part />', '<part/>').split('<part/>')[page - 1];\n var properHtml = '<div>' + part.replace(/<agerated>/g, '<div class=\"agerated\">').replace(/<\\/agerated>/g, '</div>') + '</div>';\n var agerated = $('div', properHtml);\n\n $('div.g1plus.agecheck').each(function(i){\n $(this).empty();\n $(this).addClass('loading');\n\n var items = $('video', agerated[i]);\n for(var j = 0; j < items.length; ++j) {\n var src = items[j].getAttribute('src').split(':');\n var protocol = src[0];\n var id = src[1];\n\n if(protocol == 'riptide' || protocol == 'video') {\n var url = API_PREFIX + 'video_meta-' + id;\n if(id.indexOf('http') > -1) {\n url = 'file=' + id;\n }\n var player_swf = createPlayer(url, false, false);\n $(this).after(player_swf);\n player_swf.getDownloads = getDownloads;\n player_swf.getDownloads(id);\n } else if(protocol == 'youtube') {\n var youtube_swf = createYoutubePlayer(id.split('=')[1]);\n $(this).after(youtube_swf);\n } else if(protocol == 'gallery') {\n $(this).replaceWith(createWarning('Bei diesem altersbeschränkten Inhalt handelt es sich um eine Bilder-Galerie, Diese werden derzeit nicht von G1Plus erfasst. Dies kann sich in zukünftigen Versionen ändern, wenn gesteigertes Interesse besteht (<a href=\"https://github.com/g1plus/g1plus/issues/1\">Issue #1</a>)'));\n } else {\n $(this).replaceWith(createWarning('G1Plus konnte für diesen Inhalt keine Referenz finden. (<a href=\"http://g1plus.x10.mx/report/index.php?url=' + _url + '\">Problem melden?</a>)'));\n }\n }\n $(this).remove();\n });\n } else {\n $(this).after(createWarning('Problem beim Abfragen des Caches.'));\n }\n}", "function hideCache()\r\n{document.getElementById('Cache').style.display='none';}", "function softReload() {\n Turbolinks.enableTransitionCache(true);\n Turbolinks.visit(location.toString());\n Turbolinks.enableTransitionCache(false);\n}", "function useFallback() {\n return caches.match('offline.html');\n}", "if(iRequestStart >= oCache.oCacheData.length){\r\n \tbNeedServer=true;\r\n }", "function clearSecureIframe() {\n\tEmber.$('iframe[data-paymill=\"iframe\"]').remove();\n}", "function noCache(url) {\n return new Request(url, { cache: 'no-store' });\n}", "removeCachedSources_() {\n this.getCachedSources_().forEach((cachedSource) => {\n cachedSource.setAttribute(\n 'src',\n cachedSource.getAttribute('amp-orig-src')\n );\n cachedSource.removeAttribute('amp-orig-src');\n });\n }", "function iao_iframefix()\r\n{\r\n\tif(ulm_ie && !ulm_mac && !ulm_oldie && !ulm_ie7)\r\n\t\t{\r\n\t\t\tfor(var i=0;i<(x31=uld.getElementsByTagName(\"iframe\")).length;i++)\r\n\t\t\t{ \r\n\t\t\t\tif((a=x31[i]).getAttribute(\"x30\"))\r\n\t\t\t\t{\r\n\t\t\t\t\ta.style.height=(x32=a.parentNode.getElementsByTagName(\"UL\")[0]).offsetHeight;a.style.width=x32.offsetWidth;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n}", "function hackFrameScroll(){\n //document.head.appendChild(\"<style>html,body{height:auto;width: auto;}body{overflow-y:auto;}</style>\");\n var s=document.createElement(\"script\");\n s.type=\"text/javascript\";\n s.src=\"/js/jquery-2.1.4.min.js\";\n document.body.appendChild(s);\n var ss =document.createElement(\"script\");\n ss.type=\"text/javascript\";\n ss.src='/js/pym.min.js';\n document.body.appendChild(ss);\n}", "function d(b,c,d,h){var j,l,s,t,v,x=c;\n// Called once\n2!==u&&(u=2,i&&a.clearTimeout(i),e=void 0,g=h||\"\",w.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(t=S(m,w,d)),t=T(m,t,w,j),j?(m.ifModified&&(v=w.getResponseHeader(\"Last-Modified\"),v&&(fa.lastModified[f]=v),v=w.getResponseHeader(\"etag\"),v&&(fa.etag[f]=v)),204===b||\"HEAD\"===m.type?x=\"nocontent\":304===b?x=\"notmodified\":(x=t.state,l=t.data,s=t.error,j=!s)):(s=x,!b&&x||(x=\"error\",0>b&&(b=0))),w.status=b,w.statusText=(c||x)+\"\",j?p.resolveWith(n,[l,x,w]):p.rejectWith(n,[w,x,s]),w.statusCode(r),r=void 0,k&&o.trigger(j?\"ajaxSuccess\":\"ajaxError\",[w,m,j?l:s]),q.fireWith(n,[w,x]),k&&(o.trigger(\"ajaxComplete\",[w,m]),--fa.active||fa.event.trigger(\"ajaxStop\")))}", "function supportsGoWithoutReloadUsingHash(){return window.navigator.userAgent.indexOf('Firefox')===-1;}", "function check_server_and_reload()\n{\n if (use_advanced_page_reload)\n sm_send_request(\"GET\", window.location.href, \"\", \"replace_document\", false,\n reload_request_timeout, \"server_or_connect_error\", false, \"\", false);\n else\n sm_send_request(\"GET\", base_uri + \"images/spacer.png\", \"\", \"reload_now\", false,\n reload_request_timeout, \"server_or_connect_error\", false, \"\", true);\n}", "function reload_iframe(event) {\n\tvar parent = event.target.parentNode;\n\tvar frame = parent.firstElementChild;\n\tvar src = frame.src;\n\tframe.src = src;\n}", "get cacheControl() {\n return this.originalResponse.cacheControl;\n }", "get cacheControl() {\n return this.originalResponse.cacheControl;\n }", "get cacheControl() {\n return this.originalResponse.cacheControl;\n }", "get cacheControl() {\n return this.originalResponse.cacheControl;\n }", "function gaOpt() {\n if (theCookie == null) {\n document.cookie = disableStr + '=false; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';\n window[disableStr] = false;\n location.reload();\n }\n else {\n if (theCookie == 'true') {\n document.cookie = disableStr + '=false; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';\n window[disableStr] = false;\n location.reload();\n }\n if (theCookie == 'false') {\n document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';\n window[disableStr] = true;\n location.reload();\n }\n }\n}", "function loadMap(iframeObject) {\r\n // if the iframe has no src or a blank src, and it has a data-src attribute\r\n if (!(iframeObject.attr(\"src\") && iframeObject.attr(\"src\").length) && iframeObject.attr(\"data-src\")) {\r\n iframeObject.attr(\"src\", iframeObject.attr(\"data-src\"));\r\n }\r\n }", "resetContentSrc() {\n const root = this.doc.getroot();\n let contentElement = root.find('content');\n if (!contentElement) {\n contentElement = et.SubElement(root, 'content', { src: 'index.html' });\n }\n const originalSrc = contentElement.get('original-src');\n if (originalSrc) {\n contentElement.set('src', originalSrc);\n delete contentElement.attrib['original-src'];\n }\n const navElements = root.findall(`allow-navigation[@sessionid='${this.sessionid}']`);\n for (const navElement of navElements) {\n root.remove(navElement);\n }\n }", "function swFetch(event) {\n event.respondWith(caches.match(event.request).then(\n function cachesMatch(cachedResponse) {\n if (cachedResponse) {\n const newHeaders = new Headers(cachedResponse.headers);\n newHeaders.set('cache-control', 'no-cache');\n\n return new Response(cachedResponse.body, {\n status: cachedResponse.status,\n statusText: cachedResponse.statusText,\n headers: newHeaders,\n });\n }\n\n console.log('[Service Worker] Fallback (Fetch)', event.request.url);\n return fetch(event.request.clone());\n }\n ));\n}", "function updateIframes () {\n settings.iframes = document.querySelector(\"input[name=iframes]\").checked\n browser.storage.sync.set({\"settings\": settings}) \n sendUpdatedSettings()\n}", "denyAllCookies() {\n this.deleteAllCookies();\n this.removeCodeTags();\n //Set deny cookie\n const expires = this.cookieExpireDate();\n document.cookie = 'cookieconsent_status=deny;' + expires + ';path=/';\n console.log('All scripts for this website have been deactivated in this browser.');\n window.location.reload();\n }", "function loadGapiIframe() {\r\n // The developer may have tried to previously run gapi.load and failed.\r\n // Run this to fix that.\r\n resetUnloadedGapiModules();\r\n gapi.load('gapi.iframes', {\r\n callback: () => {\r\n resolve(gapi.iframes.getContext());\r\n },\r\n ontimeout: () => {\r\n // The above reset may be sufficient, but having this reset after\r\n // failure ensures that if the developer calls gapi.load after the\r\n // connection is re-established and before another attempt to embed\r\n // the iframe, it would work and would not be broken because of our\r\n // failed attempt.\r\n // Timeout when gapi.iframes.Iframe not loaded.\r\n resetUnloadedGapiModules();\r\n reject(_createError(auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */));\r\n },\r\n timeout: NETWORK_TIMEOUT.get()\r\n });\r\n }", "function loadGapiIframe() {\r\n // The developer may have tried to previously run gapi.load and failed.\r\n // Run this to fix that.\r\n resetUnloadedGapiModules();\r\n gapi.load('gapi.iframes', {\r\n callback: () => {\r\n resolve(gapi.iframes.getContext());\r\n },\r\n ontimeout: () => {\r\n // The above reset may be sufficient, but having this reset after\r\n // failure ensures that if the developer calls gapi.load after the\r\n // connection is re-established and before another attempt to embed\r\n // the iframe, it would work and would not be broken because of our\r\n // failed attempt.\r\n // Timeout when gapi.iframes.Iframe not loaded.\r\n resetUnloadedGapiModules();\r\n reject(_createError(auth, \"network-request-failed\" /* NETWORK_REQUEST_FAILED */));\r\n },\r\n timeout: NETWORK_TIMEOUT.get()\r\n });\r\n }", "function checkCache () {\n fetch('/cache/', {\n method: 'HEAD'\n }).then( function (response) {\n if (parseInt(response.headers.get('Last-modified'), 10) > CACHE_NAME) caches.delete(CACHE_NAME);\n });\n}", "function init(){\n // Most browsers don't need special methods here..\n set_history = get_history = function(val){ return val; };\n \n // But IE6/7 do!\n if ( is_old_ie ) {\n \n // Create hidden IFRAME at the end of the body.\n iframe = $('<iframe src=\"javascript:0\"/>').hide().appendTo( 'body' )[0].contentWindow;\n \n // Get history by looking at the hidden IFRAME's location.hash.\n get_history = function() {\n return get_fragment( iframe.document.location.href );\n };\n \n // Set a new history item by opening and then closing the IFRAME\n // document, *then* setting its location.hash.\n set_history = function( hash, history_hash ) {\n if ( hash !== history_hash ) {\n var doc = iframe.document;\n doc.open().close();\n doc.location.hash = '#' + hash;\n }\n };\n \n // Set initial history.\n set_history( get_fragment() );\n }\n }", "function stopCacheLoop() {\n $('#info_container').data('cache-enabled-first-time', false);\n $('#info_container').data('save-cache', false);\n}", "function ieAjaxWorkaround(){\n return \"time='\"+new Date().getTime() + \"'\";\n}", "function loadMap(iframeObject)\n\t\t{\n\t\t\t// if the iframe has no src or a blank src, and it has a data-src attribute\n\t\t\tif ( !(iframeObject.attr(\"src\") && iframeObject.attr(\"src\").length) && iframeObject.attr(\"data-src\") )\n\t\t\t{\n\t\t\t\tiframeObject.attr(\"src\", iframeObject.attr(\"data-src\"));\n\t\t\t}\n\t\t}", "function UciStorage() {\nvar oNewNode = document.createElement(\"iframe\");\n if(document.location.port) {\n oNewNode.setAttribute(\"src\", hebergementFullPath + 'cookie.html?hostname='+document.location.hostname+'&origin=' + document.location.protocol + '//' + document.location.hostname + ':' + document.location.port + document.location.pathname);\n } else {\n oNewNode.setAttribute(\"src\", hebergementFullPath + 'cookie.html?hostname='+document.location.hostname+'&origin=' + document.location.protocol + '//' + document.location.hostname + document.location.pathname);\n }\n oNewNode.setAttribute(\"id\", 'id_frame_cookie');\n oNewNode.setAttribute(\"name\", 'frame_cookie');\n oNewNode.setAttribute(\"width\", '0');\n oNewNode.setAttribute(\"height\", '0');\n oNewNode.setAttribute(\"style\", 'width:0;height:0;border:0;display:block;');\n oNewNode.setAttribute(\"aria-hidden\", 'true');\n oNewNode.setAttribute(\"title\", accessibilitytoolbar.get('uci_iframe_cookie'));\n\n /**\n * Update browser cookies in order to save each of user preference value.\n */\n this.updateUserPref = function(profilName) {\n // Update the cdu cookies with the stackv3 value\n if(profilName) {\n this.setStoredValue(this.encode(),profilName);\n }\n var UsageConfortpref = this.encodeUsageConfort();\n if(document.location.port) {\n document.getElementById('id_frame_cookie').src=hebergementFullPath+\"cookie.html?UsageConfort=\"+UsageConfortpref+\"&origin=\"+document.location.protocol + \"//\" + document.location.hostname + ':' + document.location.port + document.location.pathname;\n } else {\n document.getElementById('id_frame_cookie').src=hebergementFullPath+\"cookie.html?UsageConfort=\"+UsageConfortpref+\"&origin=\"+document.location.protocol + \"//\" + document.location.hostname + document.location.pathname;\n }\n\n\n };\n\n /**\n * Update browser cookies in order to save each of user preference value.\n */\n this.updateBlackList = function() {\n // Update the cdu cookies with the stackv3 value\n document.getElementById('id_frame_cookie').src=hebergementFullPath+\"cookie.html?hostname=\"+document.location.hostname;\n };\n\n /**\n * Receive message from the iframe\n */\n this.receiveMessage = function (event) {\n // Do we trust the sender of this message?\n if ( event.origin.replace('https:', '') !== hebergementDomaine.replace('https:', '') && event.origin.replace('https:', '') !== hebergementDomaine.replace('https:', '') || typeof event.data === 'object')\n return;\n\n // back from cookie Save\n if (event.data == \"saveDone\") {\n if(accessibilitytoolbar.needToReload)\n {\n accessibilitytoolbar.reloadToolbar();\n }\n }\n //cookieData\n else\n {\n // new version with profiles\n accessibilitytoolbar.userPref.decodeUsageConfort(event.data);\n }\n };\n\n /*****************************************************************************************************************/\n\n if (window.addEventListener) {\n window.addEventListener(\"message\", this.receiveMessage, false);\n }\n else if (window.attachEvent) {\n window.attachEvent(\"onmessage\", this.receiveMessage);\n }\n\n document.getElementsByTagName('body')[0].appendChild(oNewNode);\n}", "function isCacheEnabled() {\n return process.env.XDN_CACHE === 'true';\n}", "function frameBuster()\n{\n}", "function iao_iframefix() {\n if (ulm_ie && !ulm_mac && !ulm_oldie && !ulm_ie7) {\n for (var i = 0; i < (x31 = uld.getElementsByTagName(\"iframe\")).length; i++) {\n if ((a = x31[i]).getAttribute(\"x30\")) {\n a.style.height = (x32 = a.parentNode.getElementsByTagName(\"UL\")[0]).offsetHeight; \n a.style.width = x32.offsetWidth;\n } \n } \n } \n}", "function isNotModified () {\n return +cache.lastModified == +lastModified;\n }", "function clear_cache() {\n hidden_action('/admin/ajax/clearCache/true', false, false, false, false, false);\n }", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function cachePage(request, response) {\n const clonedResponse = response.clone();\n\n caches.open(swConfig.pageCache)\n .then(cache => cache.put(request, clonedResponse));\n\n return response;\n}", "function maybeCacheResponse(_a) {\n var response = _a.response, cacheKey = _a.cacheKey, context = _a.context;\n var _b;\n var method = (_b = cacheKey.method) === null || _b === void 0 ? void 0 : _b.toLowerCase();\n if (method && !constants_1.CACHEABLE_METHODS.has(method) && context.cacheRouteMethod !== method) {\n // POSTs should only be cached when the route explicitly defines the method criteria as POST\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.method);\n return false;\n }\n else if (cacheKey.body && Buffer.from(cacheKey.body, 'utf8').length > 8000) {\n // here we ensure that we're counting bytes by reading the string as utf8, which is a single byte per character\n // The 8000 character limit is the maximum size fastly can read from the request body\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.bodyTooBig);\n return false;\n }\n else if (response.statusCode && response.statusCode >= 400) {\n // we don't cache statuses 400 and above\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.code);\n return false;\n }\n else if (response.getHeader(constants_1.HTTP_HEADERS.setCookie)) {\n // we don't cache responses with set-cookie headers as they may contain personal data\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.setCookie);\n return false;\n }\n var cacheParams = getCacheParams(response);\n if (cacheParams.private && !context.forcePrivateCaching) {\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.private);\n return false;\n }\n else if (cacheParams.maxAge) {\n getCache().set(cacheKey.toString(), convertToCachedResponse(response), cacheParams.maxAge * 1000);\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.ok);\n return true;\n }\n else {\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.noMaxAge);\n return false;\n }\n}", "function loadContent(url, back_forward) {\r\n\t$(\"#loader\").show();\r\n\t\r\n\tvar search_timestamp = getQueryVariable(\"timestamp\", url);\r\n\t\r\n\tif (cached_data.hasOwnProperty(url) == 1) {\r\n\t\tupdateContent(cached_data[url], search_timestamp, back_forward);\r\n\t} else {\r\n\t\t$.ajax({\r\n\t\t\turl: domain + \"content\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tdata: {id: cleanURL(url)},\r\n\t\t\tasync: true,\r\n\t\t\tsuccess: function(content) {\r\n\t\t\t\tif ($.parseJSON(content.Cache) === true) {\r\n\t\t\t\t\tcached_data[url] = content;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tupdateContent(content, search_timestamp, back_forward);\r\n\t\t\t},\r\n\t\t\terror: function(xhr, textStatus, error) {\r\n\t\t\t\twindow.location.href = url;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function handleAppCache() {\n if (typeof applicationCache == 'undefined') {\n return;\n }\n\n if (applicationCache.status == applicationCache.UPDATEREADY) {\n applicationCache.swapCache();\n location.reload();\n return;\n }\n\n applicationCache.addEventListener('updateready', handleAppCache, false);\n}", "function checkNeverCacheList(url) {\n\tif ( this.match(url) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function fsr$setAlive(){var A=new Date().getTime();document.cookie=\"fsr.a=\"+A+\";path=/\"+((FSR.site.domain)?\";domain=\"+FSR.site.domain+\";\":\";\")\n}", "function enableYoutubeAPI(){\n container.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\n var sign = getUrlParamSign($(this).attr('src'));\n $(this).attr('src', $(this).attr('src') + sign + 'enablejsapi=1');\n });\n }", "function enableYoutubeAPI(){\n container.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\n var sign = getUrlParamSign($(this).attr('src'));\n $(this).attr('src', $(this).attr('src') + sign + 'enablejsapi=1');\n });\n }", "function httpNotModified( xhr, url ) {\n\tvar _lastModified = xhr.getResponseHeader(\"Last-Modified\"),\n\t\t_etag = xhr.getResponseHeader(\"Etag\");\n\n\tif ( _lastModified ) {\n\t\tlastModified[url] = _lastModified;\n\t}\n\tif ( _etag ) {\n\t\tetag[url] = _etag;\n\t}\n\t// Opera returns 0 when status is 304\n\treturn xhr.status === 304 || xhr.status === 0;\n}", "function clear_cache() {\n hidden_action('/admin/ajax/ClearCache', false, false, false, false, false);\n}", "function hideHack() {\n\t\t\tif (document.body) {\n\t\t\t\tdocument.body.style.visibility = \"hidden\";\n\t\t\t} else {\n\t\t\t\tKilauea.hackTimer = setTimeout(hideHack, 10);\n\t\t\t}\n\t\t}", "function iframeDataSrc() {\n\t\tvar thisElement = $(this),\n\t\t\tiframeSrc = thisElement.attr('src');\n\t\tif( iframeSrc )\n\t\t\tthisElement.attr('data-src', iframeSrc).attr('src', '');\n\t}", "function _url(url) {\n\turl = url + '?cache=' + new Date().getTime();\n\t//alert(url);\n\treturn url;\n}", "function resetFileContentCache() {\n FILE_CONTENT_CACHE.clear();\n}", "function preloadExternalPage(url){\n const iframe = document.createElement(\"iframe\");\n iframe.style.width = window.innerWidth + 'px';\n iframe.style.height = window.innerHeight + 'px';\n iframe.style.zIndex = \"1\";\n iframe.style.position = \"fixed\";\n iframe.style.top = \"0px\";\n iframe.style.left = \"0px\";\n iframe.style.margin = \"0px\";\n iframe.style.overflow = \"none\";\n iframe.style.display = \"none\";\n document.body.appendChild(iframe);\n iframe.src = url;\n tmp = iframe;\n return new Promise(function(resolve, reject){\n iframe.onload = resolve;\n iframe.onerror = reject;\n });\n}", "function clearCache() {\n cache = undefined;\n}", "function supportsReferrerPolicy(){if(!supportsFetch())return false;try{// eslint-disable-next-line no-new\nnew Request('pickleRick',{referrerPolicy:'origin'});return true;}catch(e){return false;}}", "function test_site_with_no_cookies(url) {\n open_cookie_slave_tab(url, delete_all_cookies_from_HTTP_request);\n}", "function getContentCookie()\n{\n\tvar contentCookie = GetCookie(\"content\");\n\tdocument.cookie = \"content=\";\n\n\t// What does this expression mean?\n\t// (contentCookie.indexOf(\"htm\") != -1)\n\tif ( (contentCookie != null) && (contentCookie.indexOf(\"htm\") != -1) ) \n\t{\n\t\tdocument.cookie = \"content=\"; // Wipe out the cookie\n\t\tdocument.cookie = \"histR=\" + contentCookie;\n\t\tlocation.replace(contentCookie);\n\t}\t\t\t\n}", "function blockMetaRefresh2() {\r\n\t\r\n\t\tvar allMetas, thisMeta, content, timeout, timeout_ms, url, view1, view2, link;\r\n\t\r\n\t\ttimeout = -1;\r\n\t\turl = 'none';\r\n\t\r\n\t\tallMetas = document.getElementsByTagName('meta');\r\n\t\tfor (var i = 0; i < allMetas.length; i++) {\r\n\t\t\tthisMeta = allMetas[i];\r\n\t\r\n\t\t\tif (thisMeta.httpEquiv.match(/refresh/i)) {\r\n\t\t\t\tif (thisMeta.content.match(/[\\D]/)) {\r\n\t\t\t\t\tcontent = thisMeta.content.split(';');\r\n\t\t\t\t\ttimeout = content[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\turl = thisMeta.content.match(/url=['\"]?([^'\"]+)['\"]?$/i);\r\n\t\t\t\t\turl = RegExp.lastParen;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttimeout = thisMeta.content;\r\n\t\t\t\t\turl = thisMeta.baseURI;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif (timeout > 0) {\r\n\t\t\ttimeout_ms = (timeout - 1) * 1000;\r\n\t\t}\r\n\t\r\n\t\tview1 = document.createElement('div');\r\n\t\tview1.setAttribute('style', 'padding-top: 1em; padding-bottom: 1em;');\r\n\t\tview2 = document.createElement('div');\r\n\t\tview2.setAttribute('style', 'border: 1px solid black; padding: 0.5em; background: rgb(255, 255, 191) none repeat scroll 0%; width: 90%; color: black; margin-left: auto; margin-right: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: sans-serif;');\r\n\t\tview2.appendChild(document.createTextNode('Refresh: '));\r\n\t\tlink = document.createElement('a');\r\n\t\tlink.href = url;\r\n\t\tlink.setAttribute('style', 'color: blue;');\r\n\t\tlink.appendChild(document.createTextNode(url));\r\n\t\tview2.appendChild(link);\r\n\t\tview2.appendChild(document.createTextNode(' Timeout: ' + timeout));\r\n\t\tview1.appendChild(view2);\r\n\t\r\n\t\tif (timeout >= 0) {\r\n\t\t\t// in case load hasn't finished when the refresh fires\r\n\t\t\tvar stopTimer = window.setTimeout(\"window.stop();\", timeout_ms); \r\n\t\t\twindow.addEventListener(\"load\", function() {\r\n\t\t\t\ttry { window.clearTimeout(stopTimer); } catch(ex) {}\r\n\t\t\t\twindow.stop();\r\n\t\t\t}, true);\r\n\t\r\n\t\t\tvar fc = document.body.firstChild;\r\n\t\t\tif (fc) {\r\n\t\t\t\tfc.parentNode.insertBefore(view1, fc);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar view3 = document.createElement('div');\r\n\t\t\t\tview3.appendChild(view1);\r\n\t\t\t\tdocument.body.innerHTML = view3.innerHTML + document.body.innerHTML;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "function checkNoCache (res) {\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'x-cache-channel'));\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'surrogate-key'));\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'cache-control')); // is this correct ?\n assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'last-modified')); // is this correct ?\n}", "function createFriendlyIframe() {\n //create friendly iframe to place ourselves inside\n friendlyIframe = document.createElement('iframe');\n\n // friendlyIframe.id = \"friendlyIframe_\" + countSelf.length;\n friendlyIframe.className = \"dwunlinkIframe\"\n friendlyIframe.width = '300';\n friendlyIframe.height = 600 - 250; //250 is the add height\n friendlyIframe.scrolling = 'no';\n friendlyIframe.style.overflow = 'hidden';\n friendlyIframe.name = currentScript.src;\n friendlyIframe.style.border = 'none';\n\n currentScript.parentNode.insertBefore(friendlyIframe, currentScript);\n\n //after getting querystring from js or iframe search query set currentScript to black\n friendlyIframeWindow = friendlyIframe.contentWindow;\n\n //create inline html for friendlyIframe\n friendlyIframeWindow.document.open();\n friendlyIframeWindow.document.write(htmlFile);\n friendlyIframeWindow.document.close();\n\n //listen to when the iframe window content has returned and send in the srcQuery if there is one before it gets\n if (friendlyIframeWindow.document.readyState == \"complete\" || friendlyIframeWindow.document.readyState == \"interactive\") { // if page is already loaded'\n setupIframe();\n } else { // elseonce page has finished loading, so as not to slowdown the page load at all\n friendlyIframeWindow.document.onreadystatechange = function() {\n if (friendlyIframeWindow.document.readyState == \"complete\" || friendlyIframeWindow.document.readyState == \"interactive\") {\n setupIframe();\n }\n }\n }\n }", "function isSandboxedIframe() {\n return window.top !== window && !window.frameElement;\n}", "function checkCache(path) {\n\treturn path+\"?\"+adobe.Math.Randomize.toId()+\"=1\";\n}", "function writeSafeFrame(doc, iframe, adContent) {\n iframe.name = `1-0-31;${adContent.length};${adContent}{\"uid\": \"test\"}`;\n iframe.src =\n '//iframe.localhost:9876/test/fixtures/served/iframe-safeframe.html';\n doc.body.appendChild(iframe);\n}", "function serveCached(res, url) {\n\tres.writeHead(200, {'Content-Type': 'application/javascript'});\n\tres.end(cache[url].data);\n}", "function cacheDom() {\n DOM.$quoteFeature = $('#quote');\n DOM.$quoteLink = $(document.createElement('a'));\n DOM.$author = $(document.createElement('p'));\n }", "function fixFirefoxXhrHeaders() {\n var _super = $.ajaxSettings.xhr;\n $.ajaxSetup({\n xhr: function() {\n var xhr = _super();\n var getAllResponseHeaders = xhr.getAllResponseHeaders;\n\n xhr.getAllResponseHeaders = function() {\n var allHeaders = getAllResponseHeaders.call(xhr);\n if (allHeaders) {\n return allHeaders;\n }\n\n allHeaders = \"\";\n var concatHeader = function(i, headerName) {\n if (xhr.getResponseHeader(headerName)) {\n allHeaders += headerName + \": \" + xhr.getResponseHeader(headerName) + \"\\n\";\n }\n };\n\n $([\"Cache-Control\", \"Content-Language\", \"Content-Type\", \"Expires\", \"Last-Modified\", \"Pragma\"]).each(concatHeader);\n\n // non-simple headers (add more as required)\n $([\"Location\", \"Range\", \"Offset\", \"Content-Range\"]).each(concatHeader);\n\n return allHeaders;\n };\n\n return xhr;\n }\n });\n }", "function isSuperSandboxedIframe() {\n const sacrificialIframe = window.document.createElement('iframe');\n try {\n sacrificialIframe.setAttribute('style', 'display:none');\n window.document.body.appendChild(sacrificialIframe);\n sacrificialIframe.contentWindow._testVar = true;\n window.document.body.removeChild(sacrificialIframe);\n return false;\n } catch (e) {\n window.document.body.removeChild(sacrificialIframe);\n return true;\n }\n}", "function fixJenkinsHtmlReportIframeIssue() {\n\n\tvar current_url = $(location).attr('href');\n\tvar parent_url = parent.window.location.href;\n\n\tif (parent_url.match('\\\\?$')) {\n\t\tparent.window.location.replace(current_url);\n\t}\n}", "workaround() {\n // For Safari browser\n window.onpageshow = function(e) {\n if (e.persisted) window.location.reload()\n }\n }", "function initiateIframeCheck(doc){\r\n\t\tvar iframes = doc.querySelectorAll(\"iframe\");\t\t\r\n\t\t\r\n\t\tiframes.forEach(function(iframe){\r\n\t\t\ttry{\r\n\t\t\t\tdoc = iframe.contentDocument;\r\n\t\t\t\t// make sure handler's not already attached\r\n\t\t\t\tif(!doc[uniqCSKey]){\r\n\t\t\t\t\tdoc[uniqCSKey] = true;\r\n\t\t\t\t\tdoc[docIsIframeKey] = true;\r\n\t\t\t\t\tattachNecessaryHandlers(iframe.contentWindow);\r\n\t\t\t\t\tsetInterval(initiateIframeCheck, 500, doc);\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\t// CORS :(\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function replace_with_cookies_from_shadow_cookie_store(details) {\n\tvar original_http_request_cookies = undefined;\n\tvar final_cookies = {};\n\tvar final_cookie_str = \"\";\n\tvar curr_domain = get_domain(details.url.split(\"/\")[2]);\n\n\tif (bool_is_cookie_testing_done) {\n\t return;\n\t}\n\n\treq_epch_table[details.requestid] = epoch_id;\n\t\n\tif (my_state == 'st_cookie_test_start') {\n\t for (var i = 0; i < details.requestHeaders.length; i++) {\n\t\tif (details.requestHeaders[i].name == \"Cookie\") {\n\t\t http_request_cookies = details.requestHeaders.splice(i, 1);\n\t\t break;\n\t\t}\n\t }\n\n\t return {requestHeaders: details.requestHeaders};\n\t}\n\t\n\tfor (var i = 0; i < details.requestHeaders.length; i++) {\n\t if (details.requestHeaders[i].name == \"Referer\") {\n\t\tif (get_domain(details.requestHeaders[i].value.split(\"/\")[2]) == 'live.com') {\n\t\t details.requestHeaders.splice(i, 1);\n\t\t break;\n\t\t}\n\t }\n\t}\n\t\t\t\n\tfor (var i = 0; i < details.requestHeaders.length; i++) {\n\t if (details.requestHeaders[i].name == \"Cookie\") {\n\t\toriginal_http_request_cookies = details.requestHeaders.splice(i, 1);\n\t\tbreak;\n\t }\n\t}\n\t\n\tvar original_cookie_array = [];\n\tif (original_http_request_cookies) {\n\t original_cookie_array = original_http_request_cookies[0].value.split(\";\");\n\t //console.log(\"Here here: Number of cookies in original HTTP request: \" + original_cookie_array.length);\n\t}\n\t\n\tvar curr_time = (new Date()).getTime()/1000;\n\tvar is_secure = (details.url.split('/')[0] == 'https:') ? true : false;\n\tvar my_cookies = [];\n\n\tfor (c in shadow_cookie_store) {\n\t var cookie_protocol = shadow_cookie_store[c].secure ? \"https://\" : \"http://\";\n\t var cookie_url = cookie_protocol + shadow_cookie_store[c].domain + shadow_cookie_store[c].path;\n\t var cookie_name_value = shadow_cookie_store[c].name + '=' + shadow_cookie_store[c].value;\n\t var shadow_cookie_name = cookie_url + ':' + shadow_cookie_store[c].name;\t \n\n\t if (is_subdomain(cookie_url, details.url)) {\n\t\tif (shadow_cookie_store[c].session) {\n\t\t my_cookies.push(cookie_name_value);\n\t\t}\n\t\telse if (shadow_cookie_store[c].expirationDate > curr_time) {\n\t\t my_cookies.push(cookie_name_value);\n\t\t}\n\t }\n\t}\n\n\t//\tconsole.log(\"Here here: Here here here: URL: \" + details.url);\n\t// console.log(\"Here here: Cookiessssssssss:\" + JSON.stringify(my_cookies));\n\t\n\t// console.log(\"APPU DEBUG: Original Cookies: \" + \n\t//\t original_cookie_array.length +\n\t//\t \", Length of shadow_cookie_store: \" +\n\t//\t Object.keys(shadow_cookie_store).length +\n\t//\t \", Number of cookies constructed from my shadow_cookie_store: \" + \n\t//\t my_cookies.length + \n\t//\t \", URL: \" + details.url);\n\t\n\tif (my_cookies.length == 0 &&\n\t my_domain == curr_domain) {\n\t if (my_state != \"st_start_with_no_cookies\" &&\n\t\tmy_state != \"st_GUB_cookiesets_block_DISABLED_and_NONDURING\" &&\n\t\tmy_state != \"st_testing\") {\n\t\tvar cit = cookie_investigating_tabs[my_tab_id];\n\t\tif (cit.bool_state_in_progress) {\n\t\t console.log(\"APPU DEBUG: URL: \" + details.url);\n\t\t console.log(\"APPU DEBUG: (RequestID: \" + details.requestId + \")Shadow Cookie Store: \" \n\t\t\t\t+ JSON.stringify(shadow_cookie_store));\n\t\t}\n\t\t//console.log(\"Here here: URL: \" + details.url);\n\t }\n\t}\n\tvar final_cookie_str = my_cookies.join(\"; \"); \n\t\n\tcookie_element = {\n\t name: \"Cookie\",\n\t value: final_cookie_str\n\t};\n\t\n\tdetails.requestHeaders.push(cookie_element);\n\t//console.log(\"Here here: Going to return requestHeaders: \" + JSON.stringify(details.requestHeaders));\n\treturn {requestHeaders: details.requestHeaders};\n }", "function _cacheDom() {\n DOM.$stats = $('#stats-module');\n DOM.$p = $(document.createElement('p'));\n }", "function make_iframe() {\n\tvar iframe = document.createElement('iframe');\n\tiframe.sandbox = \"allow-same-origin\";\n\tiframe.className = 'w-100p resize-height';\n\tdocument.body.appendChild(iframe);\n\treturn iframe;\n}", "function playerReady(){\n\t\t\t\t\tif(navigator.appName.indexOf(\"Internet Explorer\")!=-1){ //yeah, he's using IE\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t$(\"#container iframe\").each(function(){\n\t\t\t\t\t\t\t\tvar ifr_source = $(this).attr('src');\n\t\t\t\t\t\t\t\tvar wmode = \"wmode=opaque\";\n\t\t\t\t\t\t\t\tif(ifr_source.indexOf('?') != -1) {\n\t\t\t\t\t\t\t\t\tvar getQString = ifr_source.split('?');\n\t\t\t\t\t\t\t\t\tvar oldString = getQString[1];\n\t\t\t\t\t\t\t\t\tvar newString = getQString[0];\n\t\t\t\t\t\t\t\t\t$(this).attr('src',newString+'?'+wmode+'&'+oldString);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse $(this).attr('src',ifr_source+'?'+wmode);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},2000);\n\t\t\t\t\t}\n\t\t\t\t}", "static fixIframe(){\n const iframe = document.getElementsByTagName('iframe')[0];\n //console.log(iframe);\n iframe.setAttribute('title', 'Map of New York Restaurants');\n }", "function onloadEMT() { \n\tvar LPcookieLengthTest=document.cookie;\n\tif (lpMTag.lpBrowser == 'IE' && LPcookieLengthTest.length>1000){\n\t\tlpMTagConfig.sendCookies=false;\n\t}\n}", "function initObserver() {\n iframeObserver = new MutationObserver(function (mutations) {\n if (mutations.length > 1000) {\n // use a much faster method for very complex pages with 100,000 mutations\n // (observer usually receives 1k-10k mutations per call)\n addDocumentStylesToAllIFrames();\n return;\n }\n // move the check out of current execution context\n // because some same-domain (!) iframes fail to load when their \"contentDocument\" is accessed (!)\n // namely gmail's old chat iframe talkgadget.google.com\n setTimeout(process.bind(null, mutations), 0);\n });\n\n function process(mutations) {\n for (let m = 0, ml = mutations.length; m < ml; m++) {\n let mutation = mutations[m];\n if (mutation.type === \"childList\") {\n for (let n = 0, nodes = mutation.addedNodes, nl = nodes.length; n < nl; n++) {\n let node = nodes[n];\n if (node.localName === \"iframe\" && iframeIsDynamic(node)) {\n addDocumentStylesToIFrame(node);\n }\n }\n }\n }\n }\n\n iframeObserver.start = function () {\n // will be ignored by browser if already observing\n iframeObserver.observe(document, {\n childList: true,\n subtree: true\n });\n }\n}", "function modalCache(){\n\t\t//to prevent extra dom lookups we'll cache all (most) paths on init\n\t\tmodHolder\t= $(\"#g_block_modals\");\n\t\tmodElem\t\t= $(\"#g_block_modals div.g_block_modal\");\n\t\tmodBack\t\t= $(\"#g_block_modal_back\");\n\t\tpageElem\t= $(\"body\");\n\t\tdefTarget\t= 'div.g_middle .g_block_content';\n\t\tcached\t\t= true;\n\t\n\t\t//use jquery live to bind the close button (and all future buttons of the same type) to trigger modalCloseClicked\n\t\tmodElem.find(\"a.g_modal_bn_close\").live(\"click\", function(e){\n\t\t\te.preventDefault();\n\t\t\ttdc.Grd.Event.Pool.trigger(\"modalCloseClicked\");\n\t\t});\n\n\t}", "function noRefresh () {\n return false;\n}", "function cacheDom() {\n DOM.background = document.getElementById('background');\n }" ]
[ "0.65717083", "0.6526207", "0.63966906", "0.6377045", "0.6195906", "0.6112069", "0.60893005", "0.6080239", "0.60007465", "0.5958534", "0.5958534", "0.5934509", "0.59142774", "0.5891236", "0.5866132", "0.57909364", "0.57820886", "0.5737907", "0.56891406", "0.5645261", "0.56436133", "0.55449474", "0.548969", "0.548838", "0.5454418", "0.54260933", "0.54134303", "0.5406025", "0.54037905", "0.5397077", "0.53797996", "0.53778595", "0.53740734", "0.5363614", "0.5363614", "0.5363614", "0.5363614", "0.5361369", "0.534919", "0.5340686", "0.53365976", "0.53270894", "0.53213483", "0.53117305", "0.53117305", "0.53008413", "0.5277308", "0.5272837", "0.5265573", "0.52460575", "0.5236434", "0.5229794", "0.52269423", "0.52106416", "0.52054834", "0.5198905", "0.5198394", "0.5198394", "0.5198394", "0.5196914", "0.5185518", "0.5183234", "0.5183058", "0.51784086", "0.5175644", "0.51749486", "0.51749486", "0.516459", "0.51528966", "0.51505554", "0.5150502", "0.5139406", "0.51377743", "0.5128226", "0.51248604", "0.5113394", "0.5105468", "0.51041394", "0.5103586", "0.50920653", "0.5075508", "0.5069026", "0.50629026", "0.505595", "0.50516754", "0.50391215", "0.503485", "0.5034186", "0.50315243", "0.5028105", "0.5027394", "0.5026449", "0.50260806", "0.50222486", "0.5017096", "0.50164884", "0.5015988", "0.5012418", "0.5006734", "0.50017756", "0.50017726" ]
0.0
-1
Muestra todos los cursos de actualizacion activados en una tabla
function mostrarCarreras() { let sBuscar = document.querySelector('#txtBuscarCarreras').value; let listaCarreras = getListaCarrera(); let cuerpoTabla = document.querySelector('#tblCarreras tbody'); cuerpoTabla.innerHTML = ''; for (let i = 0; i < listaCarreras.length; i++) { if (listaCarreras[i][0].toLowerCase().includes(sBuscar.toLowerCase())) { if (listaCarreras[i][6] == true) { let fila = cuerpoTabla.insertRow(); fila.dataset.codigo = listaCarreras[i][0]; let checkSeleccion = document.createElement('input'); checkSeleccion.setAttribute('type', 'checkbox'); checkSeleccion.classList.add('checkbox'); checkSeleccion.dataset.codigo = listaCarreras[i][0]; checkSeleccion.addEventListener('click', verificarCheckCarreras); checkSeleccion.addEventListener('click', mostrarSedesCarrera); let cSeleccion = fila.insertCell(); let cCodigo = fila.insertCell(); let cNombreCarrera = fila.insertCell(); let cCreditos = fila.insertCell(); let sCodigo = document.createTextNode(listaCarreras[i][0]); let sNombreCarrera = document.createTextNode(listaCarreras[i][1]); let sCreditos = document.createTextNode(listaCarreras[i][3]); let listaCheckboxCarreras = document.querySelectorAll('#tblCursosActii tbody input[type=checkbox]'); cSeleccion.appendChild(checkSeleccion); cCodigo.appendChild(sCodigo); cNombreCarrera.appendChild(sNombreCarrera); cCreditos.appendChild(sCreditos); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inicializarActividades() {\n\t//Creamos actividades por defecto\n\tactividad1 = new Actividad(\"Yoga\", 60, 1);\n\tactividad2 = new Actividad(\"Cross-Fit\", 45, 2);\n\tactividad3 = new Actividad(\"Zumba\", 30, 1);\n\n\tvectorActividades.push(actividad1);\n\tvectorActividades.push(actividad2);\n\tvectorActividades.push(actividad3);\n\n\t//Aniadimos las actividades a una tabla\n\tvar tablaActividades = document.getElementById(\"actividades\");\n\t\n\tfor (var i = 0; i < vectorActividades.length; i++){\n\t\tvar nuevaActividad = tablaActividades.insertRow(-1);\n\t\tnuevaActividad.innerHTML = \"<td>\" + vectorActividades[i].nombre + \"</td><td>\" \n\t\t+ vectorActividades[i].duracion + \"</td>\"\n\t\t+ \"<td>\" + vectorActividades[i].sala + \"</td>\";\n\t}\n\t\n}", "function RealizarCorte() {\r\n let date = getDate();\r\n let count = 0;\r\n let usuario = \"\";\r\n for (let i = 0; i < ventaBD.length; i++) {\r\n for (let j = 0; j < usuariosBD.length; j++) {\r\n if (ventaBD[i].id_usuario === usuariosBD[j].id) {\r\n usuario = usuariosBD[j].nombre + \" \" + usuariosBD[j].apellido;\r\n }\r\n }\r\n if (ventaBD[i].fecha === date) {\r\n count++;\r\n document.getElementById(\r\n \"tabla-corte-body\"\r\n ).innerHTML += `<tr><td>${ventaBD[i].fecha}</td><td>${ventaBD[i].id_venta}</td><td>${ventaBD[i].id_usuario}</td><td>${usuario}</td><td>$${ventaBD[i].total}</td></tr>`;\r\n }\r\n }\r\n\r\n if (count === 0) {\r\n document.getElementById(\"div-tablacorte\").style.display = \"none\";\r\n document.getElementById(\"none-alert\").style.display = \"block\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = false;\r\n } else {\r\n document.getElementById(\"div-tablacorte\").style.display = \"block\";\r\n document.getElementById(\"none-alert\").style.display = \"none\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = true;\r\n }\r\n}", "function actualizarFactura() {\n\n let fecha = document.getElementById(\"txtFecha\").value;\n let cdniCliente = document.getElementById(\"cboCliente\").value;\n let cplaVehiculo = document.getElementById(\"cboVehiculo\").value;\n\n let serie = document.getElementById(\"txtSerie\").value;\n let numero = document.getElementById(\"txtNumero\").value;\n\n let importe = document.getElementById(\"txtImporte\").value;\n\n let cliente = buscarCliente(cdniCliente);\n let vehiculo = buscarVehiculo(cplaVehiculo);\n\n for (const factura of baseFactura) {\n if (factura.numero === numero) {\n factura.fecha = fecha;\n factura.cliente=cliente;\n factura.vehiculo=vehiculo;\n factura.importe=importe;\n \n break;\n }\n }\n\n document.getElementById(\"tablaFactura\").innerHTML = \"<tr><th>Fecha</th><th>Serie</th><th>Numero</th><th>Cliente</th><th>Vehiculo</th><th>Importe</th><th>Acción</th></tr> \";\n\n for (const factura of baseFactura) {\n mostrarFacturaRegistrado(factura);\n }\n\n document.getElementById(\"txtSerie\").disabled = false;\n document.getElementById(\"txtNumero\").disabled = false;\n \n let btnRegistrar = document.getElementById(\"btnRegistrar\");\n btnRegistrar.value = \"Registrar\";\n\n registrarBaseFactura();\n}", "function mostrarDescendente() {\n\n\n let listaCursos = getListaCursosActii();\n\n listaCursos.reverse(); // copiar esto abajo\n\n let cuerpoTabla = document.querySelector('#table tbody');\n cuerpoTabla.innerHTML = '';\n\n for (let i = 0; i < listaCursos.length; i++) {\n let fila = cuerpoTabla.insertRow(i);\n let cSeleccionar = fila.insertCell();\n let cNombre = fila.insertCell();\n let cCodigo = fila.insertCell();\n let cCantidad = fila.insertCell();\n let cCosto = fila.insertCell();\n\n\n let sSeleccionar = document.createTextNode(\"\");\n let sNombre = document.createTextNode(listaCursos[i][0]);\n let sCodigo = document.createTextNode(listaCursos[i][1]);\n let sCantidad = document.createTextNode(listaCursos[i][2]);\n let sCosto = document.createTextNode(listaCursos[i][3]);\n\n cSeleccionar.appendChild(sSeleccionar);\n cNombre.appendChild(sNombre);\n cCodigo.appendChild(sCodigo);\n cCantidad.appendChild(sCantidad);\n cCosto.appendChild(sCosto);\n\n\n // inicio boton Editar \n let botonEditar = document.createElement(\"button\");\n botonEditar.innerText = \"Editar\";\n botonEditar.dataset.codigo = (listaCursos[i][2]);\n botonEditar.classList.add (\"botonTabla\");\n botonEditar.classList.add (\"botonNormal\");\n\n\n botonEditar.addEventListener(\"click\", editar);\n\n cSeleccionar.appendChild(botonEditar);\n\n\n\n // inicio boton deshabilitar \n let botonDeshabilitar = document.createElement(\"button\");\n botonDeshabilitar.innerText = \"Desactivar\";\n botonDeshabilitar.dataset.codigo = (listaCursos[i][2]);\n botonDeshabilitar.classList.add(\"botonTabla\");\n botonDeshabilitar.classList.add(\"botonDesactivar\");\n\n botonDeshabilitar.addEventListener(\"click\",deshabilitar);\n \n cSeleccionar.appendChild(botonDeshabilitar);\n \n\n \n }\n }", "function obtener_cursos_guardados() {\n var consulta = conexion_ajax(\"/servicios/dh_cursos.asmx/obtener_datos_cursos\")\n $(\".datos_curso\").remove()\n $.each(consulta, function (index, item) {\n\n var filla = $(\"<tr class='datos_curso'></tr>\")\n filla.append($(\"<td></td>\").append(item.id_curso).css({\"width\":\"30px\",\"text-align\":\"center\"}))\n filla.append($(\"<td></td>\").append(item.nombre_curso))\n filla.append($(\"<td></td>\").append(item.puesto_pertenece).css({ \"text-align\": \"center\" }))\n filla.append($(\"<td></td>\").append(\n (function (valor) {\n var dato;\n $(\"#puestos option\").each(function (index, item) {\n if (valor == parseInt($(this).attr(\"name\")))\n dato = $(this).val();\n })\n return dato;\n }(item.puesto_pertenece))\n ))\n filla.append($(\"<td></td>\").append(\n (function (estatus) {\n if (estatus == \"v\" || estatus==\"V\")\n return \"vigente\";\n else if (estatus == \"c\" || estatus == \"C\")\n return \"cancelado\"\n else return \"indefinido\"\n }(item.estatus))\n ).css({ \"text-align\": \"center\" }))\n $(\"#tabla_cursos\").append(filla)\n })\n filtrar_tabla_cursos();\n //funcion onclick tabla Cursos\n $(\".datos_curso\").on(\"click\", function () {\n Habilitar_bloquear_controles(true);\n var consulta = { \n id_curso: \"\"\n , nombre_curso: \"\"\n , estatus: \"\"\n , puesto_pertenece: \"\"\n };\n $(this).children(\"td\").each(function (index, item) {\n switch (index) {\n case 0:\n consulta.id_curso = $(this).text();\n case 1:\n consulta.nombre_curso = $(this).text();\n case 3:\n consulta.puesto_pertenece = $(this).text();\n case 4:\n consulta.estatus = $(this).text();\n } \n })\n\n $(\"#folio_curso\").val(consulta.id_curso)\n $(\"#Nombre_curso\").val(consulta.nombre_curso)\n $(\"#estatus_cusro\").val(\n (function (estatus) {\n if (estatus == \"vigente\")\n return \"V\";\n else if (estatus == \"cancelado\")\n return \"C\"\n else return \"\"\n }(consulta.estatus))\n )\n $(\"#selector_puestos\").val(consulta.puesto_pertenece)\n $(\".datos_curso\").removeClass(\"seleccio_curso\")\n $(this).toggleClass(\"seleccio_curso\")\n // checar_imagen_cambio();\n obtener_imagen()\n })\n \n}", "function cargarCgg_gem_informacion_laboralCtrls(){\n\t\tif(inRecordCgg_gem_informacion_laboral){\n\t\t\ttxtCginf_codigo.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_CODIGO'));\n\t\t\ttxtCrper_codigo.setValue(inRecordCgg_gem_informacion_laboral.get('CRPER_CODIGO'));\n\t\t\ttxtCginf_disponibilidad.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_DISPONIBILIDAD'));\n\t\t\tcbxCginf_Calificacion.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_VEHICULO'))||0;\n\t\t\tsetCalificacion(cbxCginf_Calificacion.getValue());\n\t\t\ttxtCginf_licencia_conducir.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_LICENCIA_CONDUCIR'));\n\t\t\tchkCginf_discapacidad.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_DISCAPACIDAD'));\n\t\t\ttxtCginf_estado_laboral.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_ESTADO_LABORAL'));\n\t\t\ttxtCginf_observaciones.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_OBSERVACIONES'));\n\t\t\tisEdit = true;\t\t\n\t}}", "function activar(tbody, table){\n\t\t$(tbody).on(\"click\", \"span.activar\", function(){\n var data=table.row($(this).parents(\"tr\")).data();\n statusConfirmacion('EsquemaComision/status_esquema_comision', data.id_esquema_comision, 1, \"¿Esta seguro de activar el registro?\", 'activar');\n });\n\t}", "function recargarTablaActividad() {\n var tabla = $('#lista-actividad').DataTable();\n tabla.ajax.reload();\n}", "function atualizaOrdenacao(){\n\n var resort = true, callback = function(table){};\n\n tabela.trigger(\"update\", [resort, callback]);\n\n }", "function atualizaDados(){\n\t\t\tatendimentoService.all($scope.data).then(function (response) {\n\t\t\t\tlimpar();\n\t\t\t\t$scope.atendimentos = response.data;\n\t\t\t\t$log.info($scope.atendimentos);\n\t\t\t}, function (error) {\n\t\t\t\t$scope.status = 'Unable to load customer data: ' + error.message;\n\t\t\t});\n\t\t\t$scope.usuario={};\n\t\t}", "updateTable() {\n\t\tthis.manager.get(\"WWSUanimations\").add(\"djs-update-table\", () => {\n\t\t\tif (this.table) {\n\t\t\t\tthis.table.clear();\n\t\t\t\tthis.find().forEach((dj) => {\n\t\t\t\t\tlet icon = `<span class=\"badge badge-danger\" title=\"INACTIVE: This DJ is inactive and will be deleted one year from the Last Seen date unless they air a broadcast.\"><i class=\"far fa-times-circle p-1\"></i>No</span>`;\n\t\t\t\t\tif (!dj.active) {\n\t\t\t\t\t\ticon = `<span class=\"badge badge-danger\" title=\"INACTIVE: This DJ is inactive and will be deleted one year from the Last Seen date unless they air a broadcast.\"><i class=\"far fa-times-circle p-1\"></i>No</span>`;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t!dj.lastSeen ||\n\t\t\t\t\t\tmoment(dj.lastSeen)\n\t\t\t\t\t\t\t.add(30, \"days\")\n\t\t\t\t\t\t\t.isBefore(\n\t\t\t\t\t\t\t\tmoment(\n\t\t\t\t\t\t\t\t\tthis.manager.get(\"WWSUMeta\")\n\t\t\t\t\t\t\t\t\t\t? this.manager.get(\"WWSUMeta\").meta.time\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\ticon = `<span class=\"badge badge-warning\" title=\"ACTIVE, but did not air a broadcast for over 30 days.\"><i class=\"far fa-question-circle p-1\"></i>30+ Days Ago</span>`;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tmoment(dj.lastSeen)\n\t\t\t\t\t\t\t.add(7, \"days\")\n\t\t\t\t\t\t\t.isBefore(\n\t\t\t\t\t\t\t\tmoment(\n\t\t\t\t\t\t\t\t\tthis.manager.get(\"WWSUMeta\")\n\t\t\t\t\t\t\t\t\t\t? this.manager.get(\"WWSUMeta\").meta.time\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\ticon = `<span class=\"badge badge-info\" title=\"ACTIVE, but did not air a broadcast for between 7 and 30 days.\"><i class=\"far fa-check-circle p-1\"></i>7 - 30 Days Ago</span>`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ticon = `<span class=\"badge badge-success\" title=\"ACTIVE; this DJ aired a broadcast in the last 7 days.\"><i class=\"fas fa-check-circle p-1\"></i>Yes</span>`;\n\t\t\t\t\t}\n\t\t\t\t\tthis.table.row.add([\n\t\t\t\t\t\tdj.name || \"\",\n\t\t\t\t\t\tdj.realName || \"\",\n\t\t\t\t\t\t`${icon}`,\n\t\t\t\t\t\tdj.lastSeen\n\t\t\t\t\t\t\t? moment\n\t\t\t\t\t\t\t\t\t.tz(\n\t\t\t\t\t\t\t\t\t\tdj.lastSeen,\n\t\t\t\t\t\t\t\t\t\tthis.manager.get(\"WWSUMeta\")\n\t\t\t\t\t\t\t\t\t\t\t? this.manager.get(\"WWSUMeta\").meta.timezone\n\t\t\t\t\t\t\t\t\t\t\t: moment.tz.guess()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.format(\"LLLL\")\n\t\t\t\t\t\t\t: \"Unknown / Long Ago\",\n\t\t\t\t\t\tdj.active\n\t\t\t\t\t\t\t? `<div class=\"btn-group\"><button class=\"btn btn-sm btn-primary btn-dj-analytics\" data-id=\"${dj.ID}\" title=\"View DJ and Show Analytics\"><i class=\"fas fa-chart-line\"></i></button><button class=\"btn btn-sm btn-secondary btn-dj-logs\" data-id=\"${dj.ID}\" title=\"View Show Logs\"><i class=\"fas fa-clipboard-list\"></i></button><button class=\"btn btn-sm bg-indigo btn-dj-notes\" data-id=\"${dj.ID}\" title=\"View/Edit Notes and Remote Credits\"><i class=\"fas fa-sticky-note\"></i></button><button class=\"btn btn-sm btn-warning btn-dj-edit\" data-id=\"${dj.ID}\" title=\"Edit DJ\"><i class=\"fas fa-edit\"></i></button><button class=\"btn btn-sm bg-orange btn-dj-inactive\" data-id=\"${dj.ID}\" title=\"Mark DJ as inactive\"><i class=\"fas fa-times-circle\"></i></button></div>`\n\t\t\t\t\t\t\t: `<div class=\"btn-group\"><button class=\"btn btn-sm btn-primary btn-dj-analytics\" data-id=\"${dj.ID}\" title=\"View DJ and Show Analytics\"><i class=\"fas fa-chart-line\"></i></button><button class=\"btn btn-sm btn-secondary btn-dj-logs\" data-id=\"${dj.ID}\" title=\"View Show Logs\"><i class=\"fas fa-clipboard-list\"></i></button><button class=\"btn btn-sm bg-indigo btn-dj-notes\" data-id=\"${dj.ID}\" title=\"View/Edit Notes and Remote Credits\"><i class=\"fas fa-sticky-note\"></i></button><button class=\"btn btn-sm btn-success btn-dj-active\" data-id=\"${dj.ID}\" title=\"Mark DJ as active\"><i class=\"fas fa-check-circle\"></i></button><button class=\"btn btn-sm btn-danger btn-dj-delete\" data-id=\"${dj.ID}\" title=\"Permanently remove this DJ\"><i class=\"fas fa-trash\"></i></button></div>`,\n\t\t\t\t\t]);\n\t\t\t\t});\n\t\t\t\tthis.table.draw();\n\t\t\t}\n\t\t});\n\t}", "function verPacientesActivos() {\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('PACIENTES ACTIVOS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('MODIFICA O ELIMINA LOS USUARIOS ACTIVOS');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Información de Usuarios');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let tablaResponsiva = document.createElement(\"div\");\n tablaResponsiva.setAttribute('class', 'table-responsive');\n let tablas = document.createElement(\"table\");\n tablas.setAttribute('class', 'table table-bordered');\n tablas.setAttribute('id', 'dataTable');\n tablas.setAttribute('width', '100%');\n tablas.setAttribute('cellspacing', '0');\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(tablaResponsiva);\n tablaResponsiva.appendChild(tablas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('activos=');\n}", "function updateTableView() {\n status_array = [\n \"active\",\n \"private_active\",\n \"inactive\",\n \"private_inactive\",\n \"finished\",\n \"private_finished\",\n \"archived\"\n ]\n\n for (var i = 0; i < status_array.length; i++) {\n status = status_array[i]\n\n var tableRef = $(\"#projectsTable-\"+status).DataTable();\n var rows = tableRef\n .rows()\n .remove()\n .draw();\n getProjects(status)\n }\n\n console.log('updated table view')\n}", "function tarea_activa(req,res){\n\tlet idempresa = req.params.id_empresa;\n\tlet idtareas = req.params.id_tarea;\n\tlet datoactivo = new Tareas(\n\t\treq.body.id_empresa);\n\n\tCONN('tareas').where('id_empresa',idempresa)\n\t\t\t.andWhere('id_tarea',idtareas).update('status','1')\n\t\t\t.then(statusactivo =>{\n\t\t\t\tconsole.log(statusactivo);\n\t\t\t\tif (!statusactivo){\n\t\t\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t\t\t}else{\n\t\t\t\t\tres.status(200).send({ resp: 'consulta exitosa de status activo ', statusactivo:statusactivo});\n\t\t\t\t}\n\t\t\t})\n\n}", "async listTables() {\n try {\n\n //Lista de mesas\n let listTables = [];\n\n //Obtiene el numero de mesas que hay registradas en el contrato ElectoralProcessContract\n let numTables = await this.state.electoralContract.methods.getNumberTables().call({ from: this.state.account });\n\n //Itera el numero de mesas para obtener datos sobre las mismas\n for (let i = 0; i < numTables; i++) {\n\n //Obtiene la mesa i del contrato ElectoralProcessContract\n let datos = await this.state.electoralContract.methods.getTable(i).call({ from: this.state.account })\n\n //Aniade la tabla al array de mesas\n listTables.push({\n \"address\": datos[0],\n \"codeTable\": datos[1],\n });\n }\n\n //Actualiza el array de mesas del state de React\n this.setState({\n listTables: listTables\n });\n\n } catch (error) {\n if (error.message.includes(\"user denied\")) {\n this.notify(\"Notificación\", \"info\", \"Acción cancelada por el usuario\");\n\n } else {\n this.notify(\"Error\", \"danger\", error.message);\n }\n }\n }", "async function preencheTabela() {\n\n let moduloSelecionado = document.getElementById('selecionaModulo').value\n \n const dadosRecebidos = await recebeDadosTabela();\n \n removeTr();\n \n dadosRecebidos.forEach(dadoRecebido => {\n if (dadoRecebido.modulo === moduloSelecionado) {\n infoTables(\n dadoRecebido.nome,\n dadoRecebido.matriculados,\n dadoRecebido.desistentes,\n dadoRecebido.aptos,\n dadoRecebido.naoAptos.total); \n }\n\n });\n\n}", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function updateTables(){\n\n // Don't update tables if container details is open\n if(!DETAILS_CONTAINER_OPENED_FLAG){\n // Empty all tables\n $(\"#runningVAssetsTable tbody\").empty();\n $(\"#notRunningVAssetsTable tbody\").empty();\n $(\"#otherContainers tbody\").empty();\n\n addRowsToTable(historyDB.runningVAssets, \"runningVAssetsTable\");\n addRowsToTable(historyDB.notRunningVAssets, \"notRunningVAssetsTable\");\n addRowsToTable(historyDB.otherContainers, \"otherContainersTable\");\n }\n\n}", "function mostrarServicios(){\n\n //llenado de la tabla\n cajas_hoy();\n cajas_ayer() ;\n}", "function mostrarCursosAsociados() {\n\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]:checked');\n\n let cursosAsociados = [];\n let infoCurso;\n\n for (let i = 0; i < listaCheckboxCursos.length; i++) {\n infoCurso = listaCheckboxCursos[i].dataset.codigo;\n cursosAsociados.push(buscarCursoPorCod(infoCurso));\n }\n\n\n let sBuscar = document.querySelector('#txtBuscarCursosPeriodo').value;\n let cuerpoTabla = document.querySelector('#tblCursosPeriodo tbody');\n cuerpoTabla.innerHTML = '';\n\n for (let i = 0; i < cursosAsociados.length; i++) {\n // if (listaCursos[i][1].toLowerCase().includes(sBuscar.toLowerCase())) {\n\n if (cursosAsociados[i][5] == true) {\n let fila = cuerpoTabla.insertRow();\n fila.dataset.id = cursosAsociados[i][0];\n\n let checkSeleccion = document.createElement('input');\n checkSeleccion.setAttribute('type', 'checkbox');\n checkSeleccion.addEventListener('click', verificarCheckCursos);\n checkSeleccion.dataset.codigo = cursosAsociados[i][0];\n checkSeleccion.addEventListener('click', mostrarProfCurso);\n\n let cSeleccion = fila.insertCell();\n let cCodigo = fila.insertCell();\n let cNombre = fila.insertCell();\n\n let sCodigo = document.createTextNode(cursosAsociados[i][0]);\n let sNombre = document.createTextNode(cursosAsociados[i][1]);\n\n let listaCheckboxCursos = document.querySelectorAll('#tblCursosPeriodo tbody input[type=checkbox]');\n\n cSeleccion.appendChild(checkSeleccion);\n cCodigo.appendChild(sCodigo);\n cNombre.appendChild(sNombre);\n }\n }\n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function cargarActividad(){\n\n\tmostrarActividad(); \n\n\tcomienzo = getActual();\n\n}", "function cargaLista () {\n setTimeout(esperehide, 1000);\n setTimeout(function(){\n $(\"#tabla > thead > tr > th:last-child\").removeClass('sorting');\n }, 200);\n $(\"#tabla > thead > tr > th:last-child\").on('click', desactivarAccion);\n $(\".new-reg\").on(\"click\", nuevoVolver);\n $(\".acciones\").on(\"click\", accionRegistro);\n}", "function aplicarGatilhosTabela(){\n\n tabela.find('[data-crud-create]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-create');\n\n self.abrirPostForm( form_url );\n\n });\n\n tabela.find('[data-crud-update]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-update');\n\n var object_id = $(this).closest('tr').attr('data-object-id');\n\n self.abrirPatchForm( form_url, object_id );\n\n });\n\n tabela.find('[data-crud-read]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-read');\n\n var object_id = $(this).closest('tr').attr('data-object-id');\n\n self.abrirGetForm( form_url, object_id );\n\n });\n\n tabela.find('[data-crud-drop]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-drop');\n\n var object_id = $(this).closest('tr').attr('data-object-id')\n\n self.abrirDeleteForm( form_url, object_id );\n\n });\n\n tabela.unbind('click', '.bostable_select_all_checkbox').on('click', '.bostable_select_all_checkbox', function(){\n\n if(this.checked){\n\n tabela.find('.bostable_select_row_checkbox').prop('checked', true);\n\n } else {\n\n tabela.find('.bostable_select_row_checkbox').prop('checked', false);\n\n }\n\n });\n\n }", "function asociarCursosCarrera() {\n let codigoCarrera = guardarCarreraAsociar();\n\n let carrera = buscarCarreraPorCodigo(codigoCarrera);\n\n let cursosSeleccionados = guardarCursosAsociar();\n\n\n\n let listaCarrera = [];\n\n let sCodigo = carrera[0];\n let sNombreCarrera = carrera[1];\n let sGradoAcademico = carrera[2];\n let nCreditos = carrera[3];\n let sVersion = carrera[4];\n let bAcreditacion = carrera[5]\n let bEstado = carrera[6];\n let cursosAsociados = cursosSeleccionados;\n let sedesAsociadas = carrera[8];\n\n if (cursosAsociados.length == 0) {\n swal({\n title: \"Asociación inválida\",\n text: \"No se le asignó ningun curso a la carrera.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n } else {\n listaCarrera.push(sCodigo, sNombreCarrera, sGradoAcademico, nCreditos, sVersion, bAcreditacion, bEstado, cursosAsociados, sedesAsociadas);\n actualizarCarrera(listaCarrera);\n\n swal({\n title: \"Asociación registrada\",\n text: \"Se le asignaron cursos a la carrera exitosamente.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n limpiarCheckbox();\n }\n}", "function refreshStoredCategorias() {\n getStoredCategorias();\n refreshTableCategorias();\n}", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "function actTable() {\n\tif(scholar.scholarship.confirmDispersion != \"\"){\n\t\t$(\"#accordion-deposit\").parent().show();\n\t\t$(\"#accordion-deposit\").show();\n\t\t$(\"#tableConfirm > tbody tr td\").remove();\n\n\t scholar.scholarship.confirmDispersion.forEach(function (confirms){\n\t $(\"#tableConfirm > tbody tr:last\").after('<tr><td class=\"text-center\">'+confirms.monthConfirm+\" \"+confirms.yearConfirm+'</td>');\n\n\t if (confirms.statusScholarshipReceived === \"Incompleta\") $(\"td:last\").after('<td class=\"text-center warning\">Dep&oacute;sito incompleto</td>');\n\t else if (confirms.statusScholarshipReceived === \"No\") $(\"td:last\").after('<td class=\"text-center error\">Sin dep&oacute;sito</td>');\n\t else if (confirms.statusScholarshipReceived === \"Sí\") $(\"td:last\").after('<td class=\"text-center success\">'+\"Dep&oacute;sito completo\"+'</td>');\n\n\t if (confirms.statusReview === \"En proceso\") $(\"td:last\").after('<td class=\"text-center warning\">'+confirms.statusReview+'</td>');\n\t else $(\"td:last\").after('<td>'+confirms.statusReview+'</td>');\n\n\t if (confirms.staffAnswer === \"En proceso\") $(\"td:last\").after('<td class=\"text-center warning\">'+confirms.staffAnswer+'</td>');\n\t else if (confirms.staffAnswer === \"Resuelto\") $(\"td:last\").after('<td class=\"text-center success\">'+confirms.staffAnswer+'</td>');\n\t else $(\"td:last\").after('<td class=\"text-center\">'+confirms.staffAnswer+'</td>');\n\n\t });\n\t}else {\n\t\t$(\"#accordion-deposit\").parent().hide();\n\t\t$(\"#accordion-deposit\").hide();\n\t}\n}", "function llenaTabla(){\n\t\n $(\".fila_usuario\").remove();\n \n\t\n $.ajax({\n data:{},\n url:\"GET_USUARIO\",\n type:\"POST\",\n success: function (response) {\n \t\n\n var ESTADO=\"\";\n $.each( response, function( key, value ) {\n \t \n \t if(value.ESTADO===true){\n \t\t \n \t\t ESTADO=\"ACTIVO\";\n \t\t \n \t }else{\n \t\t ESTADO=\"INACTIVO\";\n \t\t \n \t }\n \t \n \t \n $(\"#tb_usuario\").append('<tr id='+value.OID_USUARIO+' class=fila_usuario><td>'+value.OID_USUARIO+'</td><td>'+value.USUARIO+'</td><td><a onclick=changeState('+value.OID_USUARIO+','+value.ESTADO+')>'+ESTADO+'</a></td><td><a onclick=update('+value.OID_USUARIO+',\"'+value.USUARIO+'\")>ACTUALIZAR</a></td></tr>');\n\n \t\t});\n \n \t/*PAGINACION DE LA TABLA*/\n table= $('#table_usuario').DataTable();\n\n \n }, error: function (err) {\n alert(\"Error en el AJAX LLena tabla\" + err.statusText);\n }\n });\n \n\t\n\t\n\t\n}", "function ListarOrdenesCompra() {\n $(\".alert\").remove();\n\n if ($(\"#txtFechaInicio\").val() == \"\") {\n notify(\"Ingrese la fecha de inicio.\", 'warning', 'center'); $(\"#txtFechaInicio\").focus(); return;\n } else if ($(\"#txtFechaFin\").val() == \"\") {\n notify(\"Ingrese la fecha de fin.\", 'warning', 'center'); $(\"#txtFechaFin\").focus(); return;\n }\n var data = { fecha_inicio: $(\"#txtFechaInicio\").val(), fecha_fin: $(\"#txtFechaFin\").val() }\n\n var success = function (rpta) {\n if (tablaOrdenes != undefined) tablaOrdenes.bootgrid(\"destroy\");\n $(\"#tblOrdenCompra tbody\").empty();\n\n if (rpta.d.Resultado == 'NoOk') { notify(rpta.d.Mensaje, 'danger', 'center'); return; }\n\n var obj = $.parseJSON(rpta.d.oc);\n var tam = obj.length;\n if (tam == 0) { notify('No se registraron ordenes de compra en el rango de fechas asignado.', 'inverse', 'center'); return; }\n\n var tabla = \"\";\n for (var i = 0; i < tam; i++) {\n tabla += '<tr>' +\n '<td>' + (i + 1) + \"</td>\" +\n '<td>' + obj[i].fecha + '</td>' +\n '<td>' + obj[i].fecha_vencimiento + '</td>' +\n '<td>' + obj[i].proveedor.razon_social + '</td>' +\n '<td>' + obj[i].contacto_proveedor.nombres + '</td>' +\n '<td>' + obj[i].moneda.descripcion + '</td>' +\n '<td>' + obj[i].total.toFixed(2) + '</td>' +\n '<td><span class=\"badge bgm-indigo\">' + obj[i].estado + '</span></td>' +\n '<td style=\"display:none\">' + obj[i].id_orden_compra + '</td>'\n '</tr>';\n }\n $(\"#tblOrdenCompra tbody\").html(tabla);\n tablaOrdenes = $(\"#tblOrdenCompra\").bootgrid({\n selection: true, multiSelect: true, rowSelect: true, keepSelection: true,\n formatters: {\n \"commands\": function (column, row) {\n return \"<button type='button' class='btn btn-info btn-sm' data-toogle='modal' data-target='#modalDetalleOrdenCompra' onclick='MostrarDetalleOrdenCompra(\\\"\" + row.id + \"\\\")' title='Detalle'><i class='md md-menu'></i></button> \" +\n \"<a title='Modificar' class='btn btn-warning btn-sm' onclick='MostrarOrdenCompra(\\\"\" + row.id + \"\\\")' href='javascript:;' ><i class='md md-edit'></i> </a> \" +\n \"<a title='Anular' class='btn btn-danger btn-sm' onclick='AnularOrdenCompra(\\\"\" + row.id + \"\\\")'><i class='md md-close'></i> </a> \";\n }\n }\n });\n var temp = $(\".actionBar .actions\").children(\"div:nth-child(2)\").children(\"ul\").children(\"ul li:last-child\").prev();\n //temp.children().children().children(\":first-child\").click();\n temp.remove();\n };\n\n var error = function (xhr, ajaxOptions, thrownError) {\n notify('Error inesperado. Por favor, vuelta a intentarlo.', 'danger', 'center');\n };\n\n fn_callmethod(\"gestionarOrdenCompra.aspx/Listar_OrdenesCompra\", JSON.stringify(data), success, error);\n}", "function cargarTablas() {\n\n\n\n var dataTableRutas_const = function () {\n if ($(\"#dt_rutas\").length) {\n $(\"#dt_rutas\").DataTable({\n dom: \"Bfrtip\",\n bFilter: true,\n ordering: false,\n buttons: [\n {\n extend: \"copy\",\n className: \"btn-sm\",\n text: \"Copiar\"\n },\n {\n extend: \"csv\",\n className: \"btn-sm\",\n text: \"Exportar a CSV\"\n },\n {\n extend: \"print\",\n className: \"btn-sm\",\n text: \"Imprimir\"\n }\n\n ],\n \"columnDefs\": [\n {\n targets: 4,\n className: \"dt-center\",\n render: function (data, type, row, meta) {\n var botones = '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"showRutasByID(\\''+row[0]+'\\');\">Cargar</button> ';\n botones += '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"deleteRutasByID(\\''+row[0]+'\\');\">Eliminar</button>';\n return botones;\n }\n }\n\n ],\n pageLength: 2,\n language: dt_lenguaje_espanol,\n ajax: {\n url: '../backend/agenda/controller/rutasController.php',\n type: \"POST\",\n data: function (d) {\n return $.extend({}, d, {\n action: \"showAll_rutas\"\n });\n }\n },\n drawCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {\n $('#dt_rutas').DataTable().columns.adjust().responsive.recalc();\n }\n });\n }\n };\n\n\n\n TableManageButtons = function () {\n \"use strict\";\n return {\n init: function () {\n dataTableRutas_const();\n $(\".dataTables_filter input\").addClass(\"form-control input-rounded ml-sm\");\n }\n };\n }();\n\n TableManageButtons.init();\n}", "function crearTablaAuditoriaInspeccionesEscaleras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_escaleras (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "function User_Update_Ecritures_Liste_des_écritures_comptables0(Compo_Maitre)\n{\n var Table=\"ecriture\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ec_libelle=GetValAt(93);\n if (!ValiderChampsObligatoire(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle))\n \treturn -1;\n var ec_compte=GetValAt(94);\n if (!ValiderChampsObligatoire(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte))\n \treturn -1;\n var ec_debit=GetValAt(95);\n if (!ValiderChampsObligatoire(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit))\n \treturn -1;\n var ec_credit=GetValAt(96);\n if (!ValiderChampsObligatoire(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit))\n \treturn -1;\n var pt_numero=GetValAt(97);\n if (pt_numero==\"-1\")\n pt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"pt_numero\",TAB_GLOBAL_COMPO[97],pt_numero,true))\n \treturn -1;\n var lt_numero=GetValAt(98);\n if (lt_numero==\"-1\")\n lt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"lt_numero\",TAB_GLOBAL_COMPO[98],lt_numero,true))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ec_libelle=\"+(ec_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_libelle)+\"'\" )+\",ec_compte=\"+(ec_compte==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_compte)+\"'\" )+\",ec_debit=\"+(ec_debit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_debit)+\"'\" )+\",ec_credit=\"+(ec_credit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_credit)+\"'\" )+\",pt_numero=\"+pt_numero+\",lt_numero=\"+lt_numero+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function User_Update_Exercice_Liste_des_exercices_comptables0(Compo_Maitre)\n{\n var Table=\"exercice\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ex_datedebut=GetValAt(35);\n if (!ValiderChampsObligatoire(Table,\"ex_datedebut\",TAB_GLOBAL_COMPO[35],ex_datedebut,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ex_datedebut\",TAB_GLOBAL_COMPO[35],ex_datedebut))\n \treturn -1;\n var ex_datefin=GetValAt(36);\n if (!ValiderChampsObligatoire(Table,\"ex_datefin\",TAB_GLOBAL_COMPO[36],ex_datefin,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ex_datefin\",TAB_GLOBAL_COMPO[36],ex_datefin))\n \treturn -1;\n var ex_cloture=GetValAt(37);\n if (!ValiderChampsObligatoire(Table,\"ex_cloture\",TAB_GLOBAL_COMPO[37],ex_cloture,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ex_cloture\",TAB_GLOBAL_COMPO[37],ex_cloture))\n \treturn -1;\n var ex_compteattente=GetValAt(38);\n if (!ValiderChampsObligatoire(Table,\"ex_compteattente\",TAB_GLOBAL_COMPO[38],ex_compteattente,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ex_compteattente\",TAB_GLOBAL_COMPO[38],ex_compteattente))\n \treturn -1;\n var ex_actif=GetValAt(39);\n if (!ValiderChampsObligatoire(Table,\"ex_actif\",TAB_GLOBAL_COMPO[39],ex_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ex_actif\",TAB_GLOBAL_COMPO[39],ex_actif))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ex_datedebut=\"+(ex_datedebut==\"\" ? \"null\" : \"'\"+ValiderChaine(ex_datedebut)+\"'\" )+\",ex_datefin=\"+(ex_datefin==\"\" ? \"null\" : \"'\"+ValiderChaine(ex_datefin)+\"'\" )+\",ex_cloture=\"+(ex_cloture==\"true\" ? \"true\" : \"false\")+\",ex_compteattente=\"+(ex_compteattente==\"\" ? \"null\" : \"'\"+ValiderChaine(ex_compteattente)+\"'\" )+\",ex_actif=\"+(ex_actif==\"true\" ? \"true\" : \"false\")+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function atualizaTabela(json)\n{ \n bDestroy : true, \n linha = '<tr>' + \n '<td>' + json.codigoDemanda + '</td>' +\n '<td>' + json.nomeCliente + '</td>' +\n '<td>' + json.contratoCaixa + '</td>' +\n '<td>' + json.contratoBndes + '</td>' +\n '<td>' + json.contaDebito + '</td>' +\n '<td>' + json.valorOperacao.replace(\".\", \",\").replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1.\") + '</td>' +\n '<td>' + json.tipoOperacao.replace(\"A\",\"AMORTIZAÇÃO\").replace(\"L\",\"LIQUIDAÇÃO\") + '</td>' +\n '<td>' + json.status.replace(\"GEPOD RESIDUO SIFBN\",\"RESIDUO SIFBN\")\t\t + '</td>' +\n '<td>'\t+\t\t\t\t\n '<button class=\"btn btn-info btn-xs tip visualiza fa fa-binoculars center-block\" id=\"botaoCadastrar\" onclick =\"visualizaDemanda(\\'' + json.codigoDemanda + '\\')\" ></button> ' + \n '</td>' +\n '<td>'\t+\t\t\t\t\n '<button class=\"btn btn-warning btn-xs tip edita fa fa-edit center-block\" id=\"botaoEditar\" onclick =\"editarContrato(\\'' + json.codigoDemanda\t+ '\\')\" ></button> ' + \n '</td>' +\n '</tr>';\n return linha;\n}", "function VerLibros(_inicio, _fin, _filtro) {\n var Autores_retreived = JSON.parse(localStorage.getItem('autores'));\n var Temas_retreived = JSON.parse(localStorage.getItem('temas'));\n var libros_html = `<thead><tr>\n <th>#</th>\n <th class=\"ordenable\" id=\"th_libro_Libro\">Libro</th>\n <th class=\"ordenable\" id=\"th_libro_Autor\">Autor</th>\n <th class=\"ordenable\" id=\"th_libro_Tema\">Tema</th>\n <th class=\"ordenable\" id=\"th_libro_Ubicacion\">Ubicación</th>\n <th>Disp</th>\n <th>Operaciones</th>\n </tr></thead><tbody>`;\n if (_filtro == undefined) {\n $.each(Libros, function(index, libro) {\n if ((index >= _inicio) && (index < _fin)) {\n libros_html += '<tr>';\n libros_html += '<td class=\"libro_seleccionado\">' + libro.libro_id + '</td>';\n libros_html += '<td class=\"td_libro_titulo\">' + libro.titulo + '</td>';\n libros_html += '<td class=\"td_libro_autor\">' + ObtenerDatosAutor(libro.autor_id, Autores_retreived) + '</td>';\n libros_html += '<td class=\"td_libro_tema\">' + ObtenerDatosTema(libro.tema_id, Temas_retreived) + '</td>';\n libros_html += '<td class=\"td_libro_ubicacion\">' + libro.ubicacion + '</td>';\n libros_html += '<td>' + libro.disponibles + '</td>';\n libros_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Editar\" onclick=\"ObtenerIdEditarLibroTabla(this)\"> - ' +\n '<input type=\"button\" class=\"button tabla_button\" value=\"Eliminar\" onclick=\"EliminarLibroTabla(this)\"> </td>';\n libros_html += '</tr>';\n } else return;\n });\n libros_html += '</tbody>';\n $('#table_libros').html(libros_html);\n Libros.length < saltos_tabla ? $('#lbl_rango_libros').html(`Del ${inicio_actual+1} al ${Libros.length} de ${Libros.length}`) : $('#lbl_rango_libros').html(`Del ${inicio_actual+1} al ${fin_actual} de ${Libros.length}`);\n if (Libros.length == 0) $('#lbl_rango_libros').html('Del 0 al 0 de 0');\n } else {\n $.each(_filtro, function(index, libro) {\n if ((index >= _inicio) && (index < _fin)) {\n libros_html += '<tr>';\n libros_html += '<td class=\"libro_seleccionado\">' + libro.libro_id + '</td>';\n libros_html += '<td class=\"td_libro_titulo\">' + libro.titulo + '</td>';\n libros_html += '<td class=\"td_libro_autor\">' + ObtenerDatosAutor(libro.autor_id, Autores_retreived) + '</td>';\n libros_html += '<td class=\"td_libro_tema\">' + ObtenerDatosTema(libro.tema_id, Temas_retreived) + '</td>';\n libros_html += '<td class=\"td_libro_ubicacion\">' + libro.ubicacion + '</td>';\n libros_html += '<td>' + libro.disponibles + '</td>';\n libros_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Editar\" onclick=\"ObtenerIdEditarLibroTabla(this)\"> - ' +\n '<input type=\"button\" class=\"button tabla_button\" value=\"Eliminar\" onclick=\"EliminarLibroTabla(this)\"> </td>';\n libros_html += '</tr>';\n } else return;\n });\n libros_html += '</tbody>';\n $('#table_libros').html(libros_html);\n _filtro.length < saltos_tabla ? $('#lbl_rango_libros').html(`Del ${inicio_actual+1} al ${_filtro.length} de ${_filtro.length}`) : $('#lbl_rango_libros').html(`Del ${inicio_actual+1} al ${fin_actual} de ${_filtro.length}`);\n if (_filtro.length == 0) $('#lbl_rango_libros').html('Del 0 al 0 de 0');\n }\n\n}", "toggleCompletadas(ids=[]) {\n\n //Este primer pedazo es para cambiar el estado de completadoEn de\n //las tareas como completadas por la fecha en que se completo\n ids.forEach(id => {\n \n const tarea = this._listado[id];\n if( !tarea.completadoEn){\n\n //La funcion new Date().toISOString ya esta predeterminada por node y me permite extraer un string\n //con la fecha actual en la que se completo la tarea y se le asigna dicho valor a la tarea\n\n //Tener en cuenta que a pesar que el cambio se le esta haciendo a una constante dentro del metodo, \n //como se esta haciendo por referencia global esta implicitamente se cambia dentro del objeto global _listado\n tarea.completadoEn = new Date().toISOString()\n }\n });\n\n //Ya este pedazo es para volver a cambiar el estado de una tarea que habia marcado como confirmada\n //ya no es asi\n this.listadoArr.forEach(tarea=>{\n\n //ids.includes(tarea.id) me permite mirar si dentro del arreglo que recibo de ids \n //se encuentra el id de tarea.id si no es asi lo cambio nuevamente a nulo \n if( !ids.includes(tarea.id) ){\n\n this._listado[tarea.id].completadoEn=null;\n }\n })\n }", "function ramplirtabLan(){\n clairtxtBoxLan();\n $('#tableLan').bootstrapTable('refresh');\n} // End ramplir", "function ramplirtabAut(){\n clairtxtBoxAut();\n $('#tableAut').bootstrapTable('refresh');\n} // end ramplir", "function getOrdenes() {\n\tvar tabla = $(\"#ordenes_trabajo\").anexGrid({\n\t class: 'table-striped table-bordered table-hover',\n\t columnas: [\n\t \t{ leyenda: 'Acciones', style: 'width:100px;', columna: 'Sueldo' },\n\t \t{ leyenda: 'ID', style:'width:20px;', columna: 'id', ordenable:true},\n\t { leyenda: 'Clave de orden de trabajo', style: 'width:200px;', columna: 'o.clave', filtro:true},\n\t { leyenda: 'Tipo de orden', style: 'width:100px;', columna: 'o.t_orden', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'INSPECCIÓN' },\n\t { valor: '2', contenido: 'VERIFICACIÓN' },\n\t { valor: '3', contenido: 'SUPERVISIÓN' },\n\t { valor: '4', contenido: 'INVESTIGACIÓN' },\n\t ]\n\t });\n\t }},\n\t { leyenda: 'Número de oficio', style: 'width:200px;', columna: 'of.no_oficio',filtro:true},\n\t { leyenda: 'Fecha', columna: 'o.f_creacion', filtro: function(){\n \t\treturn anexGrid_input({\n \t\t\ttype: 'date',\n \t\t\tattr:[\n \t\t\t\t'name=\"f_ot\"'\n \t\t\t]\n \t });\n\t } },\n\t //{ leyenda: 'Participantes', style: 'width:300px;', columna: 'Correo' },\n\t { leyenda: 'Estado', style: 'width:120px;', columna: 'o.estatus', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'Cumplida' },\n\t { valor: '2', contenido: 'Parcial sin resultado' },\n\t { valor: '3', contenido: 'Parcial con resultado' },\n\t { valor: '4', contenido: 'Cumplida sin resultado' },\n\t { valor: '5', contenido: 'Cancelada' },\n\t ]\n\t });\n\t }},\n\t \n\t ],\n\t modelo: [\n\t \t\n\t \t{ class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n ];\n\t \t\t}else{\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n { href: \"javascript:open_modal('modal_cancelar_ot',\"+obj.id+\");\", contenido: '<i class=\"fa fa-ban text-red\"></i><b class=\"text-red\">Cancelar</b> '},\n ];\n\t \t\t}\n\t return anexGrid_dropdown({\n contenido: '<i class=\"glyphicon glyphicon-cog\"></i>',\n class: 'btn btn-primary ',\n target: '_blank',\n id: 'editar',\n data: acciones\n });\n\t }},\n\t \t\n\t { class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\ttr.addClass('bg-red-active');\n\t \t\t}\n\t return obj.id;\n\t }},\n\t { propiedad: 'clave' },\n\t { propiedad: 't_orden' },\n\t { propiedad: 'oficio' },\n\t { propiedad: 'f_creacion' },\n\t //{ propiedad: 'id'},\n\t { propiedad: 'estatus'}\n\t \n\t \n\t ],\n\t url: 'controller/puente.php?option=8',\n\t filtrable: true,\n\t paginable: true,\n\t columna: 'id',\n\t columna_orden: 'DESC'\n\t});\n\treturn tabla;\n}", "function fijasAdministrativas(){\n\tdocument.getElementById(\"titleSDL\").innerHTML = \"<h1>Folios Vacantes Fijas Administrativas </h1>\";\n\tdocument.getElementById(\"SolicitudesSolicitadas\").innerHTML = \"\";\n\tdocument.getElementById(\"SolicitudesSolicitadas\").innerHTML = \"<img src='img/Loading_icon.gif'>\";\n\tsetTimeout(function(){\n\t\tdocument.getElementById(\"SolicitudesSolicitadas\").innerHTML = \"<table class='table table-striped' id='tablaEmployesSDLC'><tr class='info'><th>Fecha</th><th>Hora</th><th>Cargo</th><th>Dependencia</th><th>Titular</th><th>Motivo</th><th>Propuesta</th><th>Observaciones</th><th>Opcion</th></tr></table>\";\n\t\tdatos[0] = \"<tr><td>12/01/2017</td><td>13:18:09</td><td>Oficial III</td><td>Area Administrativa</td><td>Rodrigo Macario</td><td>Licencia Estudios</td><td>Dionicio Lopez</td><td>Papeleria Completa</td><td><a id='1' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[1] = \"<tr><td>16/01/2017</td><td>12:18:09</td><td>Comisario</td><td>Juzgado de Sentencia</td><td>Pablo Sac</td><td>Suspencion</td><td>Marcos Tax</th><td>Papeleria Completa</td><td><a id='2' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[2] = \"<tr><td>19/01/2017</td><td>11:18:09</td><td>Secretario</td><td>Area Administrativa</td><td>Raul Velasco</td><td>Traslado</td><td>Juan Carlos</td><td>Papeleria Completa</td><td><a id='3' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[3] = \"<tr><td>17/01/2017</td><td>14:18:09</td><td>Oficial II</td><td>Juzgado de Paz</th><td>Mariano Galvez</td><td>Destitucion</td><td>Pedro Barreno</td><td>Papeleria Completa</td><td><a id='4' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[4] = \"<tr><td>20/01/2017</td><td>16:18:09</td><td>Notificador</td><td>Area Administrativa</td><td>Saul Tale</td><td>Fallecimiento</td><td>Dionicio Lopez</td><td>Papeleria Completa</td><td><a id='5' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tfor(var i in datos){\n\t\t\t$(\"#tablaEmployesSDLC\").append(datos[i]);\t\n\t\t}\n\t},500);\n}", "function CargarTablaPorFechasRegistro()\n {\n var table = $(\"#TablaPolizaPorFecha\").DataTable({\n //Especificacion de Ancho y Alto de la tabla\n \"rowCallback\": function( row, data, index ) {\n if ( data.Activo == \"1\" ) \n {\n $('td:eq(3)', row).html( '<b>Activo</b>' );\n $('td:eq(3)', row).css('background-color', '#98FEE6');\n }\n else\n {\n $('td:eq(3)', row).html( '<b>Inactivo</b>' );\n $('td:eq(3)', row).css('background-color', '#FEE698');\n }\n $('td:eq(0)', row).css('background-color', '#ECECEC');\n },\n \"scrollY\": \"200px\",\n \"scrollX\": \"600px\",\n \"destroy\": true,\n //Especificaciones de las Columnas que vienen y deben mostrarse\n \"columns\" : [\n { data : 'Idn' },\n { data : 'Codigo' },\n { data : 'Cliente.CedulaRif' },\n { data : 'Cliente.Nombre' },\n { data : 'Cliente.Apellido' },\n { data : 'Analista.CedulaRif' },\n { data : 'Analista.Nombre' },\n { data : 'Aseguradora.Nombre' },\n { data : 'Relacionado.Cedula' },\n { data : 'Relacionado.Nombre' },\n { data : 'Relacionado.Apellido' },\n { data : 'Producto.Nombre' },\n { data : 'Productor.RIF' },\n { data : 'Productor.Nombre' },\n { data : 'Moneda.Nombre' },\n { data : 'TipoPoliza.Nombre' },\n { data : 'TipoPago.Nombre' },\n { data : 'EstatusPoliza.Nombre' },\n { data : 'Comision' },\n { data : 'FechaEmision' },\n { data : 'FechaInicio' },\n { data : 'FechaRegistro' },\n { data : 'FechaVencimiento' },\n { data : 'Observacion' },\n { data : 'Deducible' },\n { data : 'SumaAseguradora' },\n { data : 'PrimaAseguradora' }\n \n ,\n { data : 'Activo' }\n ], \n //Especificaciones de la URL del servicio para cargar la tabla\n \"ajax\": {\n url: \"\"+ global + \"/Polizas/FechaEmision\",\n dataSrc : ''\n }\n\n }); \n //Al hacer clic en la tabla carga los campos en los TXT\n\n\n }", "function povoateTable(){\n if (all_orders != []) {\n all_orders.forEach(_order => {\n appendOrder(_order);\n });\n }\n}", "function listarActividades() {\n\n var paramentros = {\n \"idTarea\": $('#c1_txtIdTarea').val()\n\n };\n\n idTarea = JSON.stringify(paramentros);\n $.ajax({\n\n url: '../../Controlador/ctrlRESTfulTareas.aspx/listarActividades',\n data: idTarea,\n dataType: 'json',\n type: 'post',\n contentType: \"application/json; charset=utf-8\",\n success: function (respuesta) {\n\n $.each(respuesta.d,\n /**\n * funcion en la que se procesa los datos que vienen desde el controlador\n * para mostrarlos en la vista en este caso en una tabla\n * @param {any} i\n * @param {any} detalle parametro con los datos a procesar\n */\n function (i, detalle) {\n\n var fecha = detalle.Actividades.Fecha;\n var nuevaFecha = new Date(parseInt(fecha.match(/\\d+/)[0]));\n nuevaFecha = nuevaFecha.getDate() + '/' + (nuevaFecha.getMonth() + 1) + '/' + nuevaFecha.getFullYear();\n\n $(\"#aFecha\").html(nuevaFecha);\n $(\"#aDuracion\").html(detalle.Actividades.Duracion);\n $(\"#aDescripcion\").html(detalle.Actividades.Descripcion);\n $(\"#aEstado\").html(detalle.Actividades.Estado);\n $(\"#c1_lblDesTarea\").text(detalle.Descripcion);\n\n $(\"#tblActividades tbody\").append($(\"#aFila\").clone(true));\n\n\n });\n\n $('#tblActividades').DataTable({\n 'ordering': true,\n 'order': [[0, 'desc']],\n 'language': {\n 'url': 'https://cdn.datatables.net/plug-ins/1.10.19/i18n/Spanish.json',\n }\n });\n\n $(\"#tblActividades tbody tr\").first().hide();\n\n }\n\n });\n\n}", "function listadoTrabajoSucursal(){\n\t$.ajax({\n\t\turl:'routes/routeFormcliente.php',\n\t\ttype:'post',\n\t\tdata: {action: 'clientesSucursales', info: idClienteGLOBAL},\n\t\tdataType:'json',\n\t\terror: function(error){\n\t\t\ttoast1(\"Error!\", \"Ocurrió un error, intentelo mas tarde o pongase en contacto con el administrador\", 4000, \"error\");\n\t\t\t// $.dreamAlert.close()\n\t\t},\n\t\tsuccess: function(data){\n\t\t\tconsole.log(data);\n\t\t\tvar tabla = \"\";\n\t\t\t$.each(data, function (val, key){\n\t\t\t\tvar accionBtn = \"\";\n\t\t\t\tif(key.tipo === \"Perifoneo\")\n\t\t\t\t\taccionBtn = \"accionTrabPerif\";\n\t\t\t\telse\n\t\t\t\t\taccionBtn = \"accionTrab\";\n\n\t\t\t\tvar estilo = \"\";\n\t\t\t\tvar boton = \"\";\n\t\t\t\tif(key.status === \"1\" || key.status === \"3\"){\n\t\t\t\t\testilo = \"success\";\n\t\t\t\t\tboton = '<button onclick=\"accionTrab(' + key.idtrabajo+ ',' + key.idsucursal + ','+ \"'configurarTrab'\" + ')\" class=\"btn btn-xs btn-default\">&nbsp;<span class=\"glyphicon glyphicon-cog\"></span>&nbsp;Config/Editar Trabajo&nbsp;</button>';\n\t\t\t\t}else if(key.status === \"6\"){\n\t\t\t\t\testilo = \"success\";\n\t\t\t\t\tboton = '<button class=\"btn btn-xs btn-success\" onclick=\"verEstadistica('+key.idtrabajo+',' + key.idsucursal + ')\"><span class=\"fa fa-area-chart\"></span> Trab. Iniciado</button>';\n\t\t\t\t}else if(key.status === \"7\"){\n\t\t\t\t\testilo = \"active\";\n\t\t\t\t\tboton = '<button class=\"btn btn-xs btn-primary\">Completado</button>';\n\t\t\t\t}else{\n\t\t\t\t\testilo = \"warning\";\n\t\t\t\t\tboton = '<button class=\"btn btn-xs btn-warning\">En Revisión</button>';\n\t\t\t\t}\n\t\t\t\ttabla += '<tr class=\"' + estilo + '\"><td>' + key.idtrabajo + '</td><td>' + key.alias + '</td><td id=\"tipo_' + key.idtrabajo + '\">' + key.tipo + '</td><td>' + key.vigencia + '</td><td>' + boton + '</td><td><button class=\"btn btn-xs btn-primary\" onclick=\"' + accionBtn + '(' + key.idtrabajo + ',' + key.idsucursal + ',' + \"'detallesTrab'\" + ')\">Detalle</button></td><td><button class=\"btn btn-xs btn-info\" onclick=\"showLvl2(' + key.idtrabajo + ',' + key.idsucursal + /*',' + \"'detallesTrab'\" + */')\">Seguimiento</button></td></tr>';\n\t\t\t});\n\t\t\t$('#contenidoWeb').html('');\n\t\t\t$('#contenidoWeb').append(llenadoTrabajos);\n\t\t\t$('#tbody2').append(tabla);\n\t\t}\n\t});\n}", "function CargarTablaPorFechasEmision()\n {\n var table = $(\"#TablaPolizaPorFecha\").DataTable({\n //Especificacion de Ancho y Alto de la tabla\n \"rowCallback\": function( row, data, index ) {\n if ( data.Activo == \"1\" ) \n {\n $('td:eq(3)', row).html( '<b>Activo</b>' );\n $('td:eq(3)', row).css('background-color', '#98FEE6');\n }\n else\n {\n $('td:eq(3)', row).html( '<b>Inactivo</b>' );\n $('td:eq(3)', row).css('background-color', '#FEE698');\n }\n $('td:eq(0)', row).css('background-color', '#ECECEC');\n },\n \"scrollY\": \"200px\",\n \"scrollX\": \"600px\",\n \"destroy\": true,\n //Especificaciones de las Columnas que vienen y deben mostrarse\n \"columns\" : [\n { data : 'Idn' },\n { data : 'Codigo' },\n { data : 'Cliente.CedulaRif' },\n { data : 'Cliente.Nombre' },\n { data : 'Cliente.Apellido' },\n { data : 'Analista.CedulaRif' },\n { data : 'Analista.Nombre' },\n { data : 'Aseguradora.Nombre' },\n { data : 'Relacionado.Cedula' },\n { data : 'Relacionado.Nombre' },\n { data : 'Relacionado.Apellido' },\n { data : 'Producto.Nombre' },\n { data : 'Productor.RIF' },\n { data : 'Productor.Nombre' },\n { data : 'Moneda.Nombre' },\n { data : 'TipoPoliza.Nombre' },\n { data : 'TipoPago.Nombre' },\n { data : 'EstatusPoliza.Nombre' },\n { data : 'Comision' },\n { data : 'FechaEmision' },\n { data : 'FechaInicio' },\n { data : 'FechaRegistro' },\n { data : 'FechaVencimiento' },\n { data : 'Observacion' },\n { data : 'Deducible' },\n { data : 'SumaAseguradora' },\n { data : 'PrimaAseguradora' }\n \n ,\n { data : 'Activo' }\n ], \n //Especificaciones de la URL del servicio para cargar la tabla\n \"ajax\": {\n url:''+ global + '/Poliza/Fecha',\n dataSrc : ''\n }\n\n }); \n //Al hacer clic en la tabla carga los campos en los TXT\n}", "function listarTablas(){\n //var idCedente = $('#cedente').val(); \n //var idCedente = GlobalData.id_cedente;\n if (typeof GlobalData.id_cedente == \"undefined\"){\n idCedente = \"\";\n }else{\n idCedente = GlobalData.id_cedente;\n }\n var data = \"idCedente=\"+idCedente;\n $.ajax({\n type: \"POST\",\n url: \"../includes/estrategia/GetListar_periodo.php\",\n data: data,\n dataType: \"json\",\n success: function(data){ \n // si no tengo un cedente seleccionado desactivo el boton --- si el cedente ya tiene un periodo desactivo el boton \n if((((idCedente == \"\")) || ((data.length != 0) && (idCedente != \"\")))){\n $('#AddPeriodo').attr('disabled', 'disabled');\n }else{\n $('#AddPeriodo').removeAttr(\"disabled\");\n } \n TablaPeriodo = $('#listaPeriodo').DataTable({\n data: data, // este es mi json\n paging: false,\n columns: [\n { data : 'fechaInicio' }, // campos que trae el json\n { data : 'fechaTermino' },\n { data: 'Actions' }\n ],\n \"columnDefs\": [\n \n {\n \"targets\": 2,\n \"data\": 'Actions',\n \"render\": function( data, type, row ) {\n return \"<div style='text-align: center;' id='\"+data+\"'><i style='cursor: pointer; margin: 0 10px;' class='btn eliminar fa fa-trash btn-danger btn-icon icon-lg'></i></div>\";\n }\n }\n ]\n }); \n },\n error: function(){\n alert('error');\n }\n });\n }", "function inicializarSalas() {\t\n\t//Creamos salas por defecto -- No vamos a dar opcion de crear mas\n\tsala1 = new Sala(1, 25, vectorActividades); // Las 3 actividades por defecto se pueden hacer en las dos salas\n\tsala2 = new Sala(2, 20, vectorActividades);\n\n\tvectorSalas.push(sala1);\n\tvectorSalas.push(sala2);\n\n\t//Aniadimos las salas a una tabla\n\tvar tablaSalas = document.getElementById(\"salas\");\n\t\n\tvar nuevaSala1 = tablaSalas.insertRow(-1);\n\tnuevaSala1.innerHTML = \"<td>\" + sala1.id + \"</td><td>\" + sala1.capacidad + \"</td>\";\n\n\tvar nuevaSala2 = tablaSalas.insertRow(-1);\n\tnuevaSala2.innerHTML = \"<td>\" + sala2.id + \"</td><td>\" + sala2.capacidad + \"</td>\";\n\n\tvar textoActividades = \"\";\n\tfor (var i = 0; i < vectorActividades.length; i++){\n\t\ttextoActividades += vectorActividades[i].nombre + \" - \";\n\t}\n\n\tnuevaSala1.innerHTML += \"<td>\" + textoActividades + \"</td>\";\n\tnuevaSala2.innerHTML += \"<td>\" + textoActividades + \"</td>\";\n}", "async atualiza_status_descarregamento( request, response ){\n const { ID, Status, Peso, Comentario, Atualizado_por } = request.body;\n\n\n const [{ Unidade, Placa, Dia, Chegada }] = await connection('fDescarregamento')\n .select('*')\n .where('ID','=', ID)\n .catch( () => response.status(404).json({ err: 'Caminhão não encontrado na base de dados' }));\n\n // Reflete a mudança do status na tabela de status do sqlite\n module.exports.on_status_change({ ID, Status, Unidade, Placa, Dia });\n\n /* Se o status for do tipo 'Em carregamento',\n guardar a Hora e o peso da balança na entrada na unidade */\n if ( Status === evento_chegada ) {\n\n const agora = module.exports.agora();\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update({\n Status,\n Chegada: agora,\n Comentario,\n Atualizado: agora,\n Atualizado_por\n })\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else if ( Status === evento_pos_pesagem_1 ){\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Peso_chegada: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Peso_chegada: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else if ( Status === evento_pos_pesagem_2 ){\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Peso_saida: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Peso_saida: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else if ( Status === evento_saida ){\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Saida: agora,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Saida: agora,\n Comentario,\n Atualizado: agora,\n Atualizado_por\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else {\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Atualizado: agora,\n Atualizado_por\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n };\n\n }", "function comprobarBD(){\n comprobarExistenciaTablaAscensorItemsCabina();\n}", "function remplirTableau() {\r\n tabIsEmpty = false;\r\n tbody.empty();\r\n var html = \"\";\r\n data.forEach(function (element) {\r\n html = '<tr>' +\r\n '<th>' + element.order + '</th>' +\r\n '<td>' + element.activity + '</td>' +\r\n '<td>' + element.manager + '</td>' +\r\n '<td>' + element.numofsub + '</td>' +\r\n '</tr>';\r\n tbody.append(html);\r\n });\r\n }", "function atualizaTabela(){\n\t$.ajax({\n\t\tmethod: 'POST',\n\t\turl: '/relatorio_visitante',\n\t\tdata:{atualizar:'atualizar'}\n\t}).done(function(data){\n\t\t$('.col-sm-8 .table-responsive:first').empty();\n\t\t$('.col-sm-8 .table-responsive:first').append($.parseHTML(data));\n\n\t\t$('#minhaTabela').DataTable({\n \n // Remove a paginacao da tabela\n \"bPaginate\": false,\n // Remove ordenacao\n \"ordering\" : true,\n \"order\" : [[2, \"desc\"]],\n // Este recurso desativa a ordenação em algumas colunas\n //\"columnDefs\": [\n // { \"orderable\": false, \"targets\": [1] }\n // ],\n // Ativar a movimentação das colunas\n \"colReorder\" : true,\n // Ativa a barra de rolagem vertical\n \"scrollY\": 300,\n // se o eixo Y for menor que onde a tabela deve estar, então não colocar barra de rolagem\n \"scrollCollapse\": true,\n // E ordena em rolagem horizontal\n \"scrollX\": true,\n \n // Retira a informacao inferior\n \"info\" : false,\n // Ativa a responsividade\n\t \"responsive\": true,\n // Desativar largura inteligente\n \"autoWidth\": false,\n \n // Utilizar expressoes regulares\n \"search\" : {\n \"regex\": true\n },\n // Reiniciar o datatables\n retrieve: true,\n // Atualiza campos no texto informado\n \"language\": {\n \"search\": \"Procurar na tabela\",\n \"emptyTable\" : \"Nao ha dados\",\n \"zeroRecords\": \"Sem registros com valor informado\",\n\t\"decimal\":\",\",\n\t\"thousands\":\".\"}\n});\n\t$('#minhaTabela tbody tr').slice(0, 4).css({color:'red', 'font-weight':'bold', 'font-size':'1.5em'});\n // Data da atualizacao\n var d = new Date();\n $('h5').empty();$('h5').append('Atualizado em: <time>'+d+'</time>');\n\t});\n}", "function editTableModificarDescuento() {\n var nameTable = \"ModificarDescuento\";\n var nameCols = crearListaColumnas();\n var activaAdd = true;\n var activaDelete = true;\n\n return buildTableTools(nameTable, nameCols, activaAdd, activaDelete);\n}", "function transactionTable() { }", "function crearTablaEscalerasValoresObservacionFinal(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_finales (k_codusuario,k_codinspeccion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores finales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function upgradeInfoSec(obj){\n var newRows = obj.newRows;\n var angScope = angular.element(document.getElementById(\"infoTab\")).scope();\n angScope.removeLastRow();\n for (var i = 0; i < newRows.length; i++) {\n angScope.addRow(newRows[i].row,newRows[i].type);\n }\n }", "function crearTablaPuertasValoresObservacionFinal(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_finales (k_codusuario,k_codinspeccion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores finales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresObservacionFinal(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_finales (k_codusuario,k_codinspeccion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores finales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function fillUpTable() {\r\n\tgetInstantValues();\r\n}", "function obtener_datos_por_establecimiento() {\n var lista = conexion_resultados();\n //var promedios = conexion_resultados_promedio_por_fecha();\n var contenido = \"\";\n var fecha = \"\";\n\n //removemos los datos previos de la tabla\n\n //checamos si la tabla tiene datos\n if (lista.length > 0) {\n $(\".celda_tabla_res\").remove();\n $.each(lista, function (index, item) {\n\n //obtenemos el nombre de usuario por medio de una consulta\n //var nombre_cuest = nombres_cuestionarios_por_folio(item.zona);\n var cuestionario = resultados_cuestionario_por_dia(item.fecha, item.id_cuestionario);\n\n if (index == 0) {\n fecha = item.fecha;\n // console.log(fecha + \">\");\n //creamos el contenido\n contenido = \" <tr class='celda_tabla_res fecha'> <td id='indice'colspan='6' > \" + nombre_fecha(fecha) + \"<td></tr><tr class='celda_tabla_res'> <th>#</th><th>CUESTIONARIO</th> <th>LIMPIEZA %</th> <th>SURTIDO % </th> <th>IMAGEN %</th> <th>APLICADOR</th> </tr>\"\n // $(\"#tabla_res\").append(contenido);\n }//fin if\n if (fecha == item.fecha) {\n\n //creamos el contenido\n contenido += \" <tr class='celda_tabla_res dato' onclick='llenar_modal_cuestionarios(\\\"\" + item.fecha + \"\\\",\" + item.id_cuestionario + \")'> <td id='indice'>\" + item.id_cuestionario + \"</td><td class='nombre' >\" + cuestionario.cuestionario + \"</td> <td id='zona_lim' >\" + cuestionario.limpieza + \"</td> <td id='zona_surt' >\" + cuestionario.surtido + \"</td> <td id='zona_imag' >\" + cuestionario.imagen + \"</td> <td id='zona_aplicador'>\" + item.aplicador + \"</td> </tr>\";\n //$(\"#tabla_res\").append(contenido);\n //llenamos los datos de pie\n }//fin if\n else if (fecha != item.fecha) {\n\n //$(\"#tabla_res\").append(contenido);\n\n var promedio = conexion_resultados_promedio_por_fecha(fecha);\n\n // console.log(promedios[contador_fecha].fecha + \":\" + promedios[contador_fecha].aspecto+\":\"+promedios[contador_fecha].aspecto);\n fecha = item.fecha;\n //creamos el contenido\n contenido += \" <tr class='celda_tabla_res'><th colspan='2'>Total:</th> <th>\" + promedio.limpieza + \"</th> <th>\" + promedio.surtido + \"</th> <th>\" + promedio.imagen + \"</th><th>\" + promedio.total + \"</th> </tr><tr class='celda_tabla_res fecha'> <td id='indice'colspan='6' > \" + nombre_fecha(fecha) + \"<td> <tr class='celda_tabla_res'> <th>#</th><th>CUESTIONARIO</th> <th>LIMPIEZA %</th> <th>SURTIDO %</th> <th>IMAGEN %</th> <th>APLICADOR</th> </tr> </tr><tr class='celda_tabla_res dato' onclick='llenar_modal_cuestionarios(\\\"\" + item.fecha + \"\\\",\" + item.id_cuestionario + \")' > <td id='indice'>\" + item.id_cuestionario + \"</td><td class='nombre' >\" + cuestionario.cuestionario + \"</td> <td id='zona_lim' >\" + cuestionario.limpieza + \"</td> <td id='zona_surt' >\" + cuestionario.surtido + \"</td> <td id='zona_imag' >\" + cuestionario.imagen + \"</td> <td id='zona_aplicador'>\" + item.aplicador + \"</td> <</tr>\"\n // $(\"#tabla_res\").append(contenido);\n \n }//fin if\n\n });\n var promedio = conexion_resultados_promedio_por_fecha(fecha);\n contenido += \" <tr class='celda_tabla_res'><th colspan='2'>Total:</th> <th>\" + promedio.limpieza + \"</th> <th>\" + promedio.surtido + \"</th> <th>\" + promedio.imagen + \"</th><th>\" + promedio.total + \"</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n //ajustamos los decimales de total \n // total_limpieza = r(total_limpieza) ;\n //total_limpieza = Math.round(total_limpieza);\n //total_limpieza = total_limpieza / 100;\n var totales = conexion_resultados_ckl_total_por_fechas_establecimiento();\n //console.log(r(total_limpieza / contador) + \":\" + r(total_surtido / contador) + \":\" + r(total_imagen / contador));\n $(\"#total_limpieza\").val(totales.limpieza), $(\"#total_surtido\").val(totales.surtido), $(\"#total_imagen\").val(totales.imagen);\n var res = (total_limpieza + total_surtido + total_imagen);\n //console.log(res);\n $(\"#total_neto\").val(totales.total);\n\n }//fin\n //si no hay datos manda una advertencia\n else {\n alert(\"No Hay Datos...\");\n }\n\n}//fin", "function listarAlumnosBec() {\n\ttablabecAlm = $(\"#tbListadoBecadosAlm\").dataTable({\n\t\t\"aProcessing\" : true,\n\t\t\"aServerSide\" : true,\n\t\tdom : 'Bftrip',\n\t\tbuttons: [\n\t\t],\n\t\t\"ajax\" : {\n\t\t\turl : \"../ajax/doc/tutFunctions.php?oper=listarAlumnosBec\",\n\t\t\ttype : \"GET\",\n\t\t\tdataType : \"json\",\n\t\t\terror : function(e) {\n\t\t\t\tconsole.log(e.responseText);\n\t\t\t}\n\t\t},\n\t\t\"bDestroy\" : true,\n\t\t\"iDisplayLength\" : 5,\n\t\t\"order\" : [[0, \"desc\"]]\n\t}).DataTable();\n}", "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "function mostrarContenidoBitacora() {\n ppActividades.style.display = \"block\";\n let idBitacora = this.dataset._id;\n inputIdBitacora.value = idBitacora;\n let infoBitacora = buscarBitacora(idBitacora);\n // Este titulo se adquiere del curso al que pertenece la bitacora\n let tituloBitacora = document.querySelector('#sct_actividades>div>h1');\n tituloBitacora.textContent = 'Bitácora de: ' + infoBitacora['curso_bitacora'];\n\n // Esto crea el boton de agregar actividad\n let btnAgregarActividad = document.querySelector('#btnAgregarActividad');\n if (rolUsuarioActual == 'Asistente' || rolUsuarioActual == 'Administrador') {\n btnAgregarActividad.addEventListener('click', function () {\n ppActividades.style.display = \"none\";\n ppRegistrarActividad.style.display = \"block\";\n });\n btnAgregarActividad.addEventListener('click', cambiarDatosFormularioActividad);\n } else {\n btnAgregarActividad.hidden = true;\n document.querySelector('#sct_actividades .popup-content').style.display = 'block';\n }\n\n let table = document.querySelector('#tblActividades');\n let msgNoActividad = document.querySelector('#msjActividad');\n\n let listaActividades = infoBitacora['actividades_bitacora'];\n\n if (infoBitacora['actividades_bitacora'].length == 0 || infoBitacora['actividades_bitacora'].length == null || infoBitacora['actividades_bitacora'].length == undefined) {\n table.style.display = \"none\";\n document.querySelector('#sct_actividades .popup-content').style.width = '60%';\n msgNoActividad.style.display = \"block\";\n } else {\n table.style.display = \"table\";\n document.querySelector('#sct_actividades .popup-content').style.width = '90%';\n msgNoActividad.style.display = \"none\";\n }\n\n let tbody = document.querySelector('#tblActividades tbody');\n\n tbody.innerHTML = '';\n\n for (let i = 0; i < listaActividades.length; i++) {\n\n let fila = tbody.insertRow();\n let celdaFechaRegistro = fila.insertCell();\n let celdaFechaActividad = fila.insertCell();\n let celdaHoraInicio = fila.insertCell();\n let celdaHoraFin = fila.insertCell();\n let celdaHorasTrabajadas = fila.insertCell();\n let celdaAccionActividad = fila.insertCell();\n let celdaEstudianteAtendido = fila.insertCell();\n let celdaDescripcion = fila.insertCell();\n\n celdaFechaRegistro.innerHTML = formatDate(listaActividades[i]['fecha_registro_actividad']);\n celdaFechaActividad.innerHTML = formatDate(listaActividades[i]['fecha_actividad_actividad']);\n celdaHoraInicio.innerHTML = listaActividades[i]['hora_inicio_actividad'];\n celdaHoraFin.innerHTML = listaActividades[i]['hora_fin_actividad'];\n if (listaActividades[i]['horas_trabajadas_actividad'] != undefined || listaActividades[i]['horas_trabajadas_actividad'] != \"\") {\n celdaHorasTrabajadas.innerHTML = listaActividades[i]['horas_trabajadas_actividad'].toFixed(2);\n } else {\n celdaHorasTrabajadas.innerHTML = '-';\n }\n\n celdaAccionActividad.innerHTML = listaActividades[i]['accion_actividad'];\n\n if (listaActividades[i]['estudiantes_atendidos_actividad'] != \"\") {\n celdaEstudianteAtendido.innerHTML = listaActividades[i]['estudiantes_atendidos_actividad'];\n } else {\n celdaEstudianteAtendido.innerHTML = \"-\";\n }\n\n celdaDescripcion.innerHTML = listaActividades[i]['descripcion_actividad'];\n\n // Imprime la columna de opciones si el usuario no es asistente\n if (rolUsuarioActual == 'Asistente' || rolUsuarioActual == 'Administrador') {\n\n let cOpciones = document.querySelector('#cOpcionesActividad');\n cOpciones.hidden = false;\n let celdaOpciones = fila.insertCell();\n\n // Este es el boton de editar\n let botonEditar = document.createElement('span');\n botonEditar.classList.add('fas');\n botonEditar.classList.add('fa-cogs');\n\n botonEditar.dataset.id_actividad = listaActividades[i]['_id'];\n botonEditar.name = \"btnEditarActividad\"\n\n if (rolUsuarioActual == 'Asistente' || rolUsuarioActual == 'Administrador') {\n botonEditar.addEventListener('click', function () {\n ppActividades.style.display = \"none\";\n ppRegistrarActividad.style.display = \"block\";\n });\n botonEditar.addEventListener('click', cambiarDatosFormularioActividad);\n botonEditar.addEventListener('click', llenarFormularioActualizar);\n }\n\n celdaOpciones.appendChild(botonEditar);\n\n\n let botonEliminar = document.createElement('span');\n botonEliminar.classList.add('fas');\n botonEliminar.classList.add('fa-trash-alt');\n botonEliminar.dataset.id_actividad = listaActividades[i]['_id'];\n\n celdaOpciones.appendChild(botonEliminar);\n botonEliminar.addEventListener('click', eliminar_actividad);\n\n celdaOpciones.appendChild(botonEliminar);\n }\n\n }\n displayActividadesScroll();\n\n\n}", "function ramplirtabVil(){\n clairtxtBoxVil();\n $('#tableVil').bootstrapTable('refresh');\n} // end ramplir", "function botonEditarContacto(){\n var btn_editar = tableBody[0].querySelectorAll('.editarBtn');\n for (var i = 0; i < btn_editar.length; i++) {\n btn_editar[i].addEventListener('click', function(){\n\n //desabilitar los demas campos cuando se requiera de editar uno\n desabilitarEdicion();\n\n //ir de un hijo a un padre\n var registroActivo = this.parentNode.parentNode;\n registroActivo.classList.add('modo_edicion');\n registroActivo.classList.remove('desactivado');\n\n //actualizar registro en especifico\n actualizarRegistro(registroActivo.id);\n\n });\n }\n console.log(btn_editar);\n}", "function activeToAll() {\r\n\t// If selectActiveItem is not empty\r\n\tif (selectActiveItem.length > 0){\r\n\t\tfor (var i = 0; i < selectActiveItem.length; i++) {\r\n\t\t\tvar item = findItem(listActiveItem, selectActiveItem[i]);\r\n\t\t\tif (typeof item != 'undefined') {\r\n\t\t\t\t//listActiveItem.splice(item, 1);\r\n\t\t\t\tlistAllItem.push(item);\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t\tselectAllItem = [];\r\n\t\tselectActiveItem = [];\r\n\t\tdrawDatatable(tableActiveItem, listActiveItem, 1);\r\n\t\tdrawDatatable(tableAllItem, listAllItem, null);\r\n\t\tisChange = true;\r\n\t}\r\n}", "function ramplirtabCla(){\n $('#tableCla').bootstrapTable('refresh');\n clairtxtBoxCla();\n} // end ramplir", "function ramplirtabUti(){\n clairtxtBoxUti();\n $('#tableUti').bootstrapTable('refresh');\n/*\n\tvar request = new XMLHttpRequest();\n var url =\"\";\n\turl = \"/tusers\";\n\trequest.open(\"GET\", url, true);\n\t\n\trequest.onreadystatechange = function() {\n if (request.readyState === 4 && request.status === 200) {\n var info = JSON.parse(request.responseText); \n var tbody = document.getElementById(\"tbodyutiResult\");\n clairtxtBoxUti();\n tbody.innerHTML = \"\";\n for (i = 0; i < info.length; i++) {\n var tr = document.createElement('TR'); \n setCelulle(info[i].coduser,null,tr);\n setCelulle(info[i].password || '',null,tr);\n setCelulle(info[i].nom,null,tr);\n setCelulle(info[i].prenom,null,tr);\n setCelulle(info[i].admin,null,tr);\n setCelulle(info[i].inactif,null,tr);\n setCelulle(info[i].utilise,true,tr);\n tbody.appendChild(tr);\n }\n }\n };\n request.send(); */\n} // end ramplir", "function mostrarDatos(usuarios) {\n tableBody.innerHTML = \"\";\n usuarios.forEach(u => {\n agregarFila(u);\n });\n }", "function impostaCausaliEntrata (list) {\n var opts = {\n aaData: list,\n oLanguage: {\n sZeroRecords: \"Nessun accertamento associato\"\n },\n aoColumnDefs: [\n {aTargets: [0], mData: defaultPerDataTable('distinta.descrizione')},\n {aTargets: [1], mData: computeStringMovimentoGestione.bind(undefined, 'accertamento', 'subAccertamento', 'capitoloEntrataGestione')},\n {aTargets: [2], mData: readData(['subAccertamento', 'accertamento'], 'descrizione')},\n {aTargets: [3], mData: readData(['subAccertamento', 'accertamento'], 'importoAttuale', 0, formatMoney), fnCreatedCell: tabRight},\n {aTargets: [4], mData: readData(['subAccertamento', 'accertamento'], 'disponibilitaIncassare', 0, formatMoney), fnCreatedCell: tabRight}\n ]\n };\n var options = $.extend(true, {}, baseOpts, opts);\n $(\"#tabellaMovimentiEntrata\").dataTable(options);\n }", "function agregarFilas(estados){\n $('#estado_data').DataTable().clear().draw();\n for(var i=0 ; estados[i] ; i++){\n var estado = estados[i],\n nombre = estado.nombre,\n codigo = estado.codestado,\n estatus = estado.estatus,\n nombre_pais = estado.nombre_pais;\n getFilas(nombre, codigo, estatus,nombre_pais)\n }\n $('#estado_data').DataTable().draw();\n}", "function inactiveToAll() {\r\n\t// If selectActiveItem is not empty\r\n\tif (selectInactiveItem.length > 0){\r\n\t\tfor (var i = 0; i < selectInactiveItem.length; i++) {\r\n\t\t\tvar item = findItem(listInactiveItem, selectInactiveItem[i]);\r\n\t\t\tif (typeof item != 'undefined') {\r\n\t\t\t\t//listInactiveItem.splice(item, 1);\r\n\t\t\t\tlistAllItem.push(item);\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t\tselectAllItem = [];\r\n\t\tselectInactiveItem = [];\r\n\t\tdrawDatatable(tableInactiveItem, listInactiveItem, 0);\r\n\t\tdrawDatatable(tableAllItem, listAllItem, null);\r\n\t\tisChange = true;\r\n\t}\r\n}", "create_table() {\n\n const print_estado_etiquetado = (estado) => {\n if (estado === \"Pendiente\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-danger\" />\n Pendiente\n </Badge>\n )\n }\n else if (estado === \"Finalizado\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-success\" />\n Finalizado\n </Badge>\n )\n }\n else if (estado === \"Pendiente de revision\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-warning\" />\n Pendiente de revision\n </Badge>\n )\n }\n else if (estado === \"Etiquetado Rechazado\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-warning\" />\n Etiquetado Rechazado\n </Badge>\n )\n };\n };\n\n // // Si la variable \"fotografias\" del estado esta vacia se imprime un mensaje correspondiente\n // // de lo contrario se crea la lista con las fotografias\n if (this.state.table_data.length === 0) {\n return (\n <>\n <h3 className=\"ml-6 mt-4 mb-4\">No se tiene ninguna fotografia registrada en esta muestra </h3>\n </>\n )\n }\n else {\n return this.state.table_data.map((foto) => {\n\n return (\n <tr key={foto.idFotografias} >\n <th\n scope=\"row\"\n onClick={(e) => {\n // Checar el tipo de usuario que dio cick\n // Se abre el modal primero\n if (foto.etiquetado.Estado === \"Etiquetado Rechazado\") {\n this.setState({\n etiquetado_rechazado: true,\n observaciones_del_rechazo: foto.etiquetado.Observaciones\n })\n console.log(foto.etiquetado.Observaciones)\n }\n else {\n this.setState({\n etiquetado_rechazado: false,\n observaciones_del_rechazo: \"\"\n })\n }\n\n this.setState({\n fotografia_seleccionada: foto.idFotografias,\n form_data: {\n zoom: foto.zoom,\n resolucion: foto.resolucion,\n idCamara: foto.idCamara,\n fileFoto: this.format_image(foto.fileFoto),\n etiquetado: \"Pendiente a revision\",\n idMuestra: foto.idMuestra\n }\n })\n this.toggle_etiquetado_intermedio_modal()\n }\n }>\n <Media>\n <a\n className=\"avatar rounded-circle mr-3\"\n onClick={(e) => e.preventDefault()}\n href=\"#\"\n >\n <img\n alt={this.format_image(foto.fileFoto)}\n src={\"/static/fotografias/\" + this.format_image(foto.fileFoto)}\n />\n </a>\n </Media>\n </th>\n <td\n onClick={(e) => {\n // Checar el tipo de usuario que dio cick\n // Se abre el modal primero\n if (foto.etiquetado.Estado === \"Etiquetado Rechazado\") {\n this.setState({\n etiquetado_rechazado: true,\n observaciones_del_rechazo: foto.etiquetado.Observaciones\n })\n console.log(foto.etiquetado.Observaciones)\n }\n else {\n this.setState({\n etiquetado_rechazado: false,\n observaciones_del_rechazo: \"\"\n })\n }\n\n this.setState({\n fotografia_seleccionada: foto.idFotografias,\n form_data: {\n zoom: foto.zoom,\n resolucion: foto.resolucion,\n idCamara: foto.idCamara,\n fileFoto: foto.fileFoto,\n etiquetado: \"Pendiente a revision\",\n idMuestra: foto.idMuestra\n }\n })\n this.toggle_etiquetado_intermedio_modal()\n }\n }>\n {print_estado_etiquetado(foto.etiquetado.Estado)}\n </td>\n {(this.props.user_data.data.is_superuser || this.props.user_data.data.is_staff) ?\n <>\n <td className=\"text-right\" >\n <UncontrolledDropdown>\n <DropdownToggle\n className=\"btn-icon-only text-light\"\n href=\"#pablo\"\n role=\"button\"\n size=\"m\"\n color=\"\"\n onClick={(e) => e.preventDefault()}\n >\n <i className=\"fas fa-ellipsis-v\" />\n </DropdownToggle>\n <DropdownMenu className=\"dropdown-menu-arrow\" container=\"body\" right>\n <DropdownItem\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n this.toggle_edit_modal()\n this.setState({\n fotografia_seleccionada: foto.idFotografias,\n form_data: {\n zoom: foto.zoom,\n resolucion: foto.resolucion,\n idCamara: foto.idCamara,\n fileFoto: foto.fileFoto,\n etiquetado: foto.etiquetado,\n idMuestra: foto.idMuestra\n }\n })\n }}\n >\n Editar\n </DropdownItem>\n <DropdownItem\n href=\"#pablo\"\n onClick={(e) => {\n e.preventDefault()\n this.toggle_delete_modal()\n this.setState({ fotografia_seleccionada: foto.idFotografias })\n }}\n >\n Eliminar\n </DropdownItem>\n </DropdownMenu>\n </UncontrolledDropdown>\n </td>\n </>\n :\n <></>\n }\n </tr>\n );\n });\n }\n }", "function listarTodosEvaluacionGenerico(metodo){\r\n\r\n\tvar idCuerpoTabla = $(\"#cuerpoTablaEvaluacion\");\r\n\tvar idLoaderTabla = $(\"#loaderTablaEvaluacion\");\t\r\n\tvar idAlertaTabla = $(\"#alertaTablaEvaluacion\");\r\n\r\n\tlimpiarTabla(idCuerpoTabla,idLoaderTabla,idAlertaTabla);\r\n\r\n\tloaderTabla(idLoaderTabla,true);\r\n\r\n\r\n\tconsultar(\"evaluacion\",metodo,true).done(function(data){\r\n\t\t\r\n\t\tvar cantidadDatos = data.length;\r\n\t\tvar contador = 1;\r\n\r\n\t\tdata.forEach(function(item){\r\n\r\n\t\t\tvar datoNumero = $(\"<td></td>\").text(contador);\r\n\t\t\tvar datoAprendiz = $(\"<td></td>\").text(item.aprendiz.nombreCompleto);\r\n\t\t\tvar datoInstructor = $(\"<td></td>\").text(item.instructor.nombreCompleto);\r\n\t\t\tvar datoPregunta = $(\"<td></td>\").text(item.pregunta.nombre);\r\n\t\t\tvar datoPeriodo = $(\"<td></td>\").text(item.detallePeriodo.nombre);\r\n\t\t\tvar datoEstado = $(\"<td></td>\").text(item.detalleEstado.nombre);\r\n\t\t\tvar datoRespuesta = $(\"<td></td>\").text(item.respuesta);\r\n\t\t\tvar datoObservaciones = $(\"<td></td>\").text(item.observaciones);\r\n\t\t\tvar datoFecha = $(\"<td></td>\").text(devolverFecha(item.fecha));\r\n\r\n\t\t\tvar datoOpciones = \"<td>\"+\r\n\t\t\t'<button id=\"btnModificarAprendiz'+contador+'\" class=\"btn btn-table espacioModificar\" data-toggle=\"modal\" data-target=\"#modalModificarAprendiz\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></button>'+\r\n\t\t\t\"</td>\";\r\n\r\n\r\n\r\n\t\t\tvar fila = $(\"<tr></tr>\").append(datoNumero,datoAprendiz,datoInstructor,datoPregunta,datoPeriodo,datoEstado,datoRespuesta,datoObservaciones,datoFecha);\r\n\r\n\t\t\tidCuerpoTabla.append(fila);\r\n\r\n\t\t\t\r\n//\t\t\tasignarEventoClickAprendiz(item.id,item.identificacion,item.nombreCompleto,item.ficha.id,item.detalleEstado.id,contador);\r\n\r\n\t\t\tcontador++; \t\r\n\t\t})\r\n\t\t\r\n\t\tloaderTabla(idLoaderTabla,false);\r\n\t\tverificarDatosTabla(idAlertaTabla,cantidadDatos);\r\n\r\n\t}).fail(function(){\t\r\n\t\tloaderTabla(idLoaderTabla,false);\r\n\t\tagregarAlertaTabla(idAlertaTabla,\"error\");\r\n\t})\r\n}", "AcceptChanges() {\n for (var i = 0, ln = this.Tables.length; i < ln; i++) {\n this.Tables[i].AcceptChanges();\n }\n }", "function desactivarAccion (datos) {\n setTimeout(function(){\n if($(\"#tabla > thead > tr > th:last-child\").hasClass('sorting_asc')){\n $(\"#tabla > thead > tr > th:last-child\").removeClass('sorting_asc');\n }\n else if($(\"#tabla > thead > tr > th:last-child\").hasClass('sorting_desc')){\n $(\"#tabla > thead > tr > th:last-child\").removeClass('sorting_desc');\n }\n else{\n $(\"#tabla > thead > tr > th:last-child\").removeAttr('class');\n }\n }, 0);\n}", "function showRequisition (requisicion, table) {\n let productos = requisicion.productos;\n let numeroProductos = productos.length;\n let producto, tr;\n \n for (let i = 0; i < numeroProductos; i++) {\n producto = productos[i];\n\n tr = createRequisitionProduct (producto);\n table.appendChild(tr);\n }\n\n // crear la fila de las observaciones\n if (requisicion.observaciones != \"\") {\n producto = {\n product: requisicion.observaciones,\n cant: 1,\n unimed: \"p\",\n marcaSug: \"...\",\n enCamino: 0,\n entregado: 0,\n status: 0\n };\n \n let entregado = requisicion.observaciones.split(\"_\");\n entregado = entregado[entregado.length-1];\n if (entregado == \"entregado\") {\n producto.entregado = 1;\n producto.status = 1;\n }\n if (requisicion.comentarios != \"\") {\n producto.enCamino = 1;\n }\n \n tr = createRequisitionProduct (producto);\n table.appendChild(tr);\n }\n}", "function generarTablaEntregasSinDevolucion(){\r\n document.querySelector(\"#divEntregas\").style.display = \"block\";\r\n document.querySelector(\"#divEntregas\").innerHTML = `<table id=\"tabEntregas\" border='2px' style='background-color: #FA047F; position: relative;'>\r\n <th>Alumno</th><th>Nivel</th><th>Título</th><th>Audio</th><th>Corrección</th><th>Realizar devolución</th>\r\n </table>`\r\n ;\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.Docente.nombreUsuario;\r\n if(element === usuarioLoggeado && !entregas[i].devolucion){\r\n document.querySelector(\"#tabEntregas\").innerHTML += `<tr id=\"${i}\" class=\"filaEntregasSinDev\"> \r\n <td style=\"padding: 10px\"> ${entregas[i].Alumno.nombre} </td>\r\n <td style=\"padding: 10px\"> ${entregas[i].Alumno.nivel} </td>\r\n <td style=\"padding: 10px\"> ${entregas[i].Ejercicio.titulo} </td>\r\n <td style=\"padding: 10px\"><audio controls><source src=\"${entregas[i].audPath}\"></audio></td> \r\n <td><textarea id=\"devolucion${i}\"></textarea> \r\n <td style=\"padding: 10px\"> <input type=\"button\" id=\"i${i}\" class=\"btnEntrega \"value=\"Enviar\"></td>\r\n </tr>`;\r\n }\r\n }\r\n let botones = document.querySelectorAll(\".btnEntrega\");\r\n for(let i=0; i<botones.length; i++){\r\n const element = botones[i];\r\n element.addEventListener(\"click\", realizarDevolucion);\r\n }\r\n}", "function desactivar(tbody, table){\n\t\t$(tbody).on(\"click\", \"span.desactivar\", function(){\n var data=table.row($(this).parents(\"tr\")).data();\n statusConfirmacion('EsquemaComision/status_esquema_comision', data.id_esquema_comision, 2, \"¿Esta seguro de desactivar el registro?\", 'desactivar');\n });\n\t}", "function VerTemas(_inicio, _fin, _filtro) {\n var Temas;\n if (localStorage.temas != null) Temas = JSON.parse(localStorage.temas);\n else return;\n var temas_html = `<thead><tr>\n <th class=\"ordenable\">#</th>\n <th class=\"ordenable\">Tema</th>\n <th>Operaciones</th>\n </tr></thead><tbody>`;\n if (_filtro == undefined) {\n $.each(Temas, function(index, tema) {\n if ((index >= _inicio) && (index < _fin)) {\n temas_html += '<tr>';\n temas_html += '<td>' + tema.tema_id + '</td>';\n temas_html += '<td>' + tema.tema + '</td>';\n temas_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Ver\" onclick=\"MostrarLibrosTema(' + tema.tema_id + ')\"> </td>';\n temas_html += '</tr>';\n } else return;\n });\n temas_html += '</tbody>';\n $('#table_temas').html(temas_html);\n if (Temas.length < saltos_tabla_temas) {\n $('#lbl_rango_temas').html(`Del ${inicio_actual_temas+1} al ${Temas.length} de ${Temas.length}`);\n } else {\n $('#lbl_rango_temas').html(`Del ${inicio_actual_temas+1} al ${fin_actual_temas} de ${Temas.length}`);\n }\n } else {\n $.each(_filtro, function(index, tema) {\n if ((index >= _inicio) && (index < _fin)) {\n temas_html += '<tr>';\n temas_html += '<td>' + tema.tema_id + '</td>';\n temas_html += '<td>' + tema.tema + '</td>';\n temas_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Ver\" onclick=\"MostrarLibrosTema(' + tema.tema_id + ')\"> </td>';\n temas_html += '</tr>';\n } else return;\n });\n temas_html += '</tbody>';\n $('#table_temas').html(temas_html);\n if (_filtro.length < saltos_tabla_temas) {\n $('#lbl_rango_temas').html(`Del ${inicio_actual_temas+1} al ${_filtro.length} de ${_filtro.length}`);\n } else {\n $('#lbl_rango_temas').html(`Del ${inicio_actual_temas+1} al ${fin_actual_temas} de ${_filtro.length}`);\n }\n }\n}", "function Actualizar () {\n var renglon, TotalAlMomento;\n $(\"#ContenidoRegistroPedido\").empty();\n ajaxgeneral({NombreFuncion:\"Actualizados\",idEncabezado:Pedido.idEncabezado},\"Servicios/addPedido.php\",\"json\").success(function (actualizados) {\n if(actualizados.length>0)\n {\n $(\"#ContenedorTotales\").show()\n $.each(actualizados, function(index, RegistroPedido) {\n renglon+='<tr class=\"RegistroPedido\" title=\"Da clic sobre cualquier elemento de la tabla para edita la información o eliminar el registro.\">\\\n <td class=\"Servicio\">'+RegistroPedido.Servicio+'</td>\\\n <td class=\"Cantidad\" >'+RegistroPedido.Cantidad+'</td>\\\n <td class=\"Tiempo\" >'+RegistroPedido.TiempoProcesosPedido+'</td>\\\n <td class=\"Total\" id=\"'+index+'\">'+RegistroPedido.Total+'</td>\\\n <td class=\"iconoEliminar\"><a data-toggle=\"modal\" href=\"#BorrarPedido\"><span class=\"fa fa-minus-circle\"></a></span></td>\\\n </tr>';\n $(\"#ContenidoRegistroPedido\").html(renglon);\n });\n }\n else{\n alert(\"No hay datos del pedido\")\n $(\"#ContenedorTotales\").hide()\n }\n })\n}", "function VerLibrosPrestados(_inicio, _fin, _filtro) {\n var autores;\n var temas;\n var prestamos;\n var prestamos_activos = [];\n var usuarios;\n if (localStorage.autores != null) autores = JSON.parse(localStorage.autores);\n else return;\n if (localStorage.temas != null) temas = JSON.parse(localStorage.temas);\n else return;\n if (localStorage.prestamos != null) prestamos = JSON.parse(localStorage.prestamos);\n else return;\n if (localStorage.usuarios != null) usuarios = JSON.parse(localStorage.usuarios);\n else return;\n var prestamos_html = ` <thead>\n <tr>\n <th>#</th>\n <th class=\"ordenable\" id=\"th_prestamo_Codigo\">Codigo</th>\n <th class=\"ordenable\" id=\"th_prestamo_Libro\">Libro</th>\n <th class=\"ordenable\" id=\"th_prestamo_Autor\">Autor</th>\n <th class=\"ordenable\" id=\"th_prestamo_Tema\">Tema</th>\n <th class=\"ordenable\" id=\"th_prestamo_Prestamo\">Prestamo</th>\n <th class=\"ordenable\" id=\"th_prestamo_Devolucion\">Devolucion</th>\n <th class=\"ordenable\" id=\"th_prestamo_Usuario\">Usuario</th>\n <th class=\"ordenable\" id=\"th_prestamo_Estado\">Estado</th>\n <th>Operacion</th>\n </tr>\n </thead>\n <tbody>`;\n if (_filtro == undefined) {\n $.each(prestamos, function(index, prestamo) {\n var datos_libro = ObtenerDatosLibro(prestamo.libro_id, Libros);\n var fecha_actual = ObtenerFechaFormatoUSA(ObtenerFechaHoy());\n var fecha_devolucion = ObtenerFechaFormatoUSA(prestamo.fecha_devolucion);\n var diferencia_dias = Math.abs(parseInt(ObtenerDiferenciaDias(fecha_devolucion, fecha_actual)));\n var estado;\n var boton = '';\n if (prestamo.estado == 1) {\n estado = '<td style=\"color: rgb(21, 219, 172);\" class=\"prestamo_estado\"> ' + diferencia_dias + ' dias</td>';\n } else if (prestamo.estado == 2) {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Mora</td>';\n } else if (prestamo.estado == 3) {\n estado = '<td style=\"color: green;\" class=\"prestamo_estado\">Devuelto</td>';\n } else {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Devuleto con mora</td>';\n }\n\n if ((index >= _inicio) && (index < _fin)) {\n var usuario_datos = ObtenerDatosUsuario(prestamo.usuario_id, usuarios);\n prestamos_html += '<tr>';\n prestamos_html += '<td>' + prestamo.prestamo_id + '</td>';\n prestamos_html += '<td class=\"prestamo_seleccionado td_prestamo_Codigo\">' + prestamo.token + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Titulo\">' + datos_libro.titulo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Autor\">' + ObtenerDatosAutor(datos_libro.autor_id, autores) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Tema\">' + ObtenerDatosTema(datos_libro.tema_id, temas) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Prestamo\">' + prestamo.fecha_prestamo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Devolucion\">' + prestamo.fecha_devolucion + '</td>';\n prestamos_html += '<td class=\"td_prestamo_usuario_Nombre\">' + usuario_datos.nombres + ' ' + usuario_datos.apellidos + '</td>';\n prestamos_html += estado;\n if (prestamo.estado < 3) prestamos_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Devolver\" onclick=\"ObtenerTokenDevolverLibroTabla(this)\"> </td>';\n else prestamos_html += '<td> <input type=\"button\" class=\"\" value=\"Devolver\" disabled> </td>';\n prestamos_html += '</tr>';\n } else return;\n });\n prestamos_html += '</tbody>';\n $('#table_libros_prestados').html(prestamos_html);\n prestamos.length < saltos_tabla_prestamos ? $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${prestamos.length} de ${prestamos.length}`) : $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${fin_actual_prestamos} de ${prestamos.length}`);\n if (prestamos.length == 0) $('#lbl_rango_libros_prestados').html('Del 0 al 0 de 0');\n } else {\n $.each(_filtro, function(index, prestamo) {\n var datos_libro = ObtenerDatosLibro(prestamo.libro_id, Libros);\n var fecha_actual = ObtenerFechaFormatoUSA(ObtenerFechaHoy());\n var fecha_devolucion = ObtenerFechaFormatoUSA(prestamo.fecha_devolucion);\n var diferencia_dias = Math.abs(parseInt(ObtenerDiferenciaDias(fecha_devolucion, fecha_actual)));\n var estado;\n var boton = '';\n if (prestamo.estado == 1) {\n estado = '<td style=\"color: rgb(21, 219, 172);\" class=\"prestamo_estado\"> ' + diferencia_dias + ' dias</td>';\n } else if (prestamo.estado == 2) {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Mora</td>';\n } else if (prestamo.estado == 3) {\n estado = '<td style=\"color: green;\" class=\"prestamo_estado\">Devuelto</td>';\n } else {\n estado = '<td style=\"color: red;\" class=\"prestamo_estado\">Devuleto con mora</td>';\n }\n\n if ((index >= _inicio) && (index < _fin)) {\n var usuario_datos = ObtenerDatosUsuario(prestamo.usuario_id, usuarios);\n prestamos_html += '<tr>';\n prestamos_html += '<td>' + prestamo.prestamo_id + '</td>';\n prestamos_html += '<td class=\"prestamo_seleccionado td_prestamo_Codigo\">' + prestamo.token + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Titulo\">' + datos_libro.titulo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Autor\">' + ObtenerDatosAutor(datos_libro.autor_id, autores) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_libro_Tema\">' + ObtenerDatosTema(datos_libro.tema_id, temas) + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Prestamo\">' + prestamo.fecha_prestamo + '</td>';\n prestamos_html += '<td class=\"td_prestamo_fecha_Devolucion\">' + prestamo.fecha_devolucion + '</td>';\n prestamos_html += '<td class=\"td_prestamo_usuario_Nombre\">' + usuario_datos.nombres + ' ' + usuario_datos.apellidos + '</td>';\n prestamos_html += estado;\n if (prestamo.estado < 3) prestamos_html += '<td> <input type=\"button\" class=\"button tabla_button\" value=\"Devolver\" onclick=\"ObtenerTokenDevolverLibroTabla(this)\"> </td>';\n else prestamos_html += '<td> <input type=\"button\" value=\"Devolver\" disabled> </td>';\n prestamos_html += '</tr>';\n } else return;\n });\n prestamos_html += '</tbody>';\n $('#table_libros_prestados').html(prestamos_html);\n _filtro.length < saltos_tabla_prestamos ? $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${_filtro.length} de ${_filtro.length}`) : $('#lbl_rango_libros_prestados').html(`Del ${inicio_actual_prestamos+1} al ${fin_actual_prestamos} de ${_filtro.length}`);\n if (_filtro.length == 0) $('#lbl_rango_libros_prestados').html('Del 0 al 0 de 0');\n }\n}", "function eduMatriCursoPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('eduMatriCursoListLayer', 'O');\n\t\tvisibilidad('eduMatriCursoListButtonsLayer', 'O');\n\t\tif(get('eduMatriCursoFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:eduMatriCursoViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, eduMatriCursoChoiceColumn) + \"</A>\",\n\t\t\ti, eduMatriCursoChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\teduMatriCursoList.setDatos(datosTmp.filtrar([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\teduMatriCursoTimeStamps = datosTmp.filtrar([44],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\teduMatriCursoMorePagesFlag = true;\n\t\teduMatriCursoList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\teduMatriCursoMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('eduMatriCursoFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('eduMatriCursoListLayer', 'V');\n\tvisibilidad('eduMatriCursoListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('eduMatriCursoList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\teduMatriCursoList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(eduMatriCursoMorePagesFlag){\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(eduMatriCursoPageCount > 1){\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('eduMatriCursoPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "function changeTable2() {\n \n }", "function inizializzaTabellaRisultati() {\n var tableId = 'tabellaRisultatiRicerca';\n var opts = {\n bServerSide: true,\n sServerMethod: 'POST',\n sAjaxSource: 'risultatiRicercaConciliazionePerTitoloAjax.do',\n bPaginate: true,\n bLengthChange: false,\n iDisplayLength: 5,\n bSort: false,\n bInfo: true,\n bAutoWidth: false,\n bFilter: false,\n bProcessing: true,\n bDestroy: true,\n oLanguage: {\n sInfo: '_START_ - _END_ di _MAX_ risultati',\n sInfoEmpty: '0 risultati',\n sProcessing: 'Attendere prego...',\n sZeroRecords: 'Non sono presenti risultati di ricerca secondo i parametri inseriti',\n oPaginate: {\n sFirst: 'inizio',\n sLast: 'fine',\n sNext: 'succ.',\n sPrevious: 'prec.',\n sEmptyTable: 'Nessun dato disponibile'\n }\n },\n fnPreDrawCallback: function () {\n $('#' + tableId + '_processing').parent('div').show();\n },\n fnDrawCallback: function () {\n $('#' + tableId + '_processing').parent('div').hide();\n $('a[rel=\"popover\"]', '#' + tableId).popover();\n },\n aoColumnDefs: [\n {aTargets: [0], mData: 'stringaClassificatore'},\n {aTargets: [1], mData: 'stringaClasse'},\n {aTargets: [2], mData: 'stringaConto'},\n {aTargets: [3], mData: 'stringaDescrizioneConto'},\n {aTargets: [4], mData: function(source) {\n return faseBilancioChiuso ? '' : source.azioni;\n }, fnCreatedCell: function(nTd, sData, oData) {\n $(nTd).find('a.aggiornaConciliazione')\n .eventPreventDefault('click', aperturaAggiornamentoConciliazione.bind(undefined, nTd, oData))\n .end()\n .find('a.annullaConciliazione')\n .eventPreventDefault('click', aperturaAnnullamentoConciliazione.bind(undefined, oData));\n }}\n ]\n };\n return $('#' + tableId).dataTable(opts);\n }", "function User_Update_Comptes_auxiliaires_Liste_des_comptes_auxiliaires0(Compo_Maitre)\n{\n var Table=\"compteaux\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ca_numcompte=GetValAt(128);\n if (!ValiderChampsObligatoire(Table,\"ca_numcompte\",TAB_GLOBAL_COMPO[128],ca_numcompte,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_numcompte\",TAB_GLOBAL_COMPO[128],ca_numcompte))\n \treturn -1;\n var ca_libelle=GetValAt(129);\n if (!ValiderChampsObligatoire(Table,\"ca_libelle\",TAB_GLOBAL_COMPO[129],ca_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_libelle\",TAB_GLOBAL_COMPO[129],ca_libelle))\n \treturn -1;\n var ac_numero=GetValAt(130);\n if (ac_numero==\"-1\")\n ac_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ac_numero\",TAB_GLOBAL_COMPO[130],ac_numero,true))\n \treturn -1;\n var ca_debit=GetValAt(131);\n if (!ValiderChampsObligatoire(Table,\"ca_debit\",TAB_GLOBAL_COMPO[131],ca_debit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_debit\",TAB_GLOBAL_COMPO[131],ca_debit))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ca_numcompte=\"+(ca_numcompte==\"\" ? \"null\" : \"'\"+ValiderChaine(ca_numcompte)+\"'\" )+\",ca_libelle=\"+(ca_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ca_libelle)+\"'\" )+\",ac_numero=\"+ac_numero+\",ca_debit=\"+(ca_debit==\"true\" ? \"true\" : \"false\")+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "async function colocarTabela(alunos){\n \n for (let i = 0; i < alunos.length; i++) {\n\n var element = alunos[i];\n\n //Cria uma linha e suas colunas \n var linha = document.createElement(\"tr\");\n linha.classList.add(\"linhas\");\n\n //Coluna do RA\n var colunaRa = document.createElement(\"td\");\n colunaRa.textContent = element.matricula;\n\n //Busca os dados do usuario no banco \n var resposta = await usarApi(\"GET\", \"http://localhost:8080/usuarios/\"+element.fk_usuario);\n var usuario = JSON.parse(resposta);\n\n //Coluna do nome\n var colunaNome = document.createElement(\"td\");\n colunaNome.textContent = usuario.nome;\n\n //Adiciona a linha na tabela \n var tabela = document.getElementById(\"tab\");\n linha.appendChild(colunaRa);\n linha.appendChild(colunaNome);\n\n tabela.appendChild(linha);\n }\n \n $(\".linhas\").dblclick(function() { \n var isConfirm = confirm(\"Deseja expulsar o aluno?\");\n\n if(isConfirm){\n var idAluno = alunos[$(this).index()-1].idAluno;\n apagar(idAluno);\n }\n });\n}", "function limparTaxasParaSalvar() {\n $scope.taxasAdministrativas.forEach((taxaAdm) => {\n taxaAdm.listaSalvar = [];\n });\n\n $scope.taxasAdministrativasSalvar = []\n }", "function actualizar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_actualizar\", 'EsquemaComision/actualizar_esquema_comision', '#cuadro4');\n\t}", "actualizarDatosAuditoria(idDummy, auditoriaActualizada){\n this.lista = this.lista.map(auditoria=> {\n if (auditoria.idDummy == idDummy) {\n auditoria = Object.assign(auditoria, auditoriaActualizada)\n }\n return auditoria\n })\n }", "function initTable() {\r\n\r\n const TaskTable = document.getElementById('task-table'); //recupero tabella da svuotare, attarverso il suo id\r\n \r\n TaskTable.innerHTML = ''; //svuoto la tabella, e poi inserisco nulla('')\r\n\r\n }", "onRefresh() {\n this.setState({citas: []});\n this.TraeDatos();\n }", "function addActiveAttributeToAllRows()\n {\n $('#ContractTable tr').each(function(i, row)\n {\n /** First row is our headers. */\n if(i!==0)\n {\n /** Add on click function. */\n $(row).click(function ()\n {\n /** If we click an already selected row, we can des-select it. */\n if($(row).css(\"background-color\") === \"rgb(255, 0, 0)\")\n {\n $('#editContractButton').prop('disabled', true);\n $('#editContractButton').css('background-color', '#cacaca');\n $('#deleteContractButton').prop('disabled', true);\n $('#deleteContractButton').css('background-color', '#cacaca');\n $(row).css('background-color', 'rgb(0, 0, 0)');\n /** We have to set the correct color back to the row, since colors differ every other row. */\n if(i%2!==0)\n {\n $(row).children().css({'background-color': '#dadada', 'color': '#332c28'}).find(\"a\").css({'color': 'blue'});\n }\n else\n {\n $(row).children().css({'background-color': '#cecece', 'color': '#332c28'}).find(\"a\").css({'color': 'blue'});\n }\n }\n /** The row selected wasn't already selected. */\n else\n {\n /** De-select any other rows that were selected. */\n checkForAlreadySelectedContract();\n var $tds = $(row).find(\"td\");\n $.each($tds, function()\n {\n rowData.push($(this).text());\n });\n /** Allow for edit and delete if Admin. */\n $('#editContractButton').prop('disabled', false);\n $('#editContractButton').css('background-color', '#d7451a');\n $('#deleteContractButton').prop('disabled', false);\n $('#deleteContractButton').css('background-color', '#d7451a');\n /** Populate the details/edit/detail modal values. */\n $('#editContractContract').val(rowData[0]);\n $('#editContractCustomer').val(rowData[1]);\n $('#editContractContractMgr').val(rowData[2]);\n $('#contractDetailsCm').val(rowData[2]);\n $('#contractDetailsCustomer').val(rowData[1]);\n $('#contractDetailsContract').val(rowData[0]);\n $('#contractDelete').val(rowData[0]);\n \n /** Update the associated products lists and add the function that allows linking between contracts and products. */\n var items = [];\n $('#associatedProductsEditList').empty();\n $.each(rowData[3].split(',') , function(key, val)\n {\n let length = $('#associatedProductsEditList option').length;\n $('#associatedProductsEditList').append(\"<option id='associatedProductEditOption\"+ length +\"' >\"+val+\"</option>\");\n $('#associatedProductsEditPlaceHolder').append(\"<input style='display: none;' id='associatedProductEdit' name='associatedProducts[\"+length+\"]' value='\"+ val +\"'/>\");\n items.push(\"<a href='#' id = 'associatedProduct-\" + key + \"' onclick=\\\"$(window.localStorage.setItem('tab', '0'), window.localStorage.setItem('productCpn', '\" + val + \"'), \"\n +\"window.localStorage.setItem('productEqpttype', ''), \"\n +\"window.localStorage.setItem('productPlant', ''), \"\n +\"window.localStorage.setItem('productMakeorbuy', ''), \"\n +\"window.localStorage.setItem('productBu', ''), \"\n +\"window.localStorage.setItem('productPortfolio', ''), \"\n +\"window.localStorage.setItem('productPoc', ''), \"\n +\"window.localStorage.setItem('productNewprograms', ''), \"\n +\"window.localStorage.setItem('productEop', ''), \"\n +\"window.localStorage.setItem('productEos', ''), \"\n +\"window.localStorage.setItem('productReplacement', ''), \"\n +\"window.localStorage.setItem('productPage', 1), \"\n +\"window.localStorage.setItem('productNotes', ''), window.location.reload())\\\">\" + val + \"</a>\");\n });\n $('#contractDetailsAssociatedProducts').empty();\n $('#contractDetailsAssociatedProducts').append(items.join(\"\"));\n rowData = [];\n $(row).css('background-color', 'rgb(255, 0, 0)');\n $(row).children().css({'background-color': '#332c28', 'color': 'white'}).find(\"a\").css({'color': '#8fffee'});\n }\n });\n }\n });\n }", "function pintarRespuesta(items) {\n\n //desactivo el boton de actulizar registro\n $(\"#btnActualizar\").hide();\n $(\"#btnConsultar\").hide();\n\n let myTable = \"<table id='tbl' class='table table-dark table-striped'>\";\n myTable += \"<tr class='table-dark'>\";\n // myTable += \"<th>\" + \" \" + \"</th>\";\n myTable += \"<th>\" + \" Id \" + \"</th>\";\n myTable += \"<th>\" + \" Nombre \" + \"</th>\";\n myTable += \"<th>\" + \" Descripción \" + \"</th>\";\n myTable += \"<th>\" + \" \" + \"</th>\";\n myTable += \"</tr>\";\n\n for (i = 0; i < items.length; i++) {\n myTable += \"<tr class='table-dark'>\";\n // myTable += \"<td> <button class='btn btn-info' onclick='editarInformacionForId(\" + items[i].id + \")'> Actualizar </button> </td>\";\n myTable += \"<td>\" + items[i].id + \"</td>\";\n myTable += \"<td>\" + items[i].name + \"</td>\";\n myTable += \"<td>\" + items[i].description + \"</td>\";\n myTable += \"<td> <button class='btn btn-danger' onclick='EliminarCategoria(\" + items[i].id + \")'> Eliminar </button> </td>\";\n myTable += \"<tr>\";\n }\n myTable += \"</table>\";\n $(\"#resultado\").append(myTable);\n\n}", "function verTodosAvisos() {\n\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('TODAS LAS ALERTAS CONFIRMADAS GUARDADAS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('REVISA TODAS LAS ALERTAS');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Alertas');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let tablaResponsiva = document.createElement(\"div\");\n tablaResponsiva.setAttribute('class', 'table-responsive');\n let tablas = document.createElement(\"table\");\n tablas.setAttribute('class', 'table table-bordered');\n tablas.setAttribute('id', 'dataTable');\n tablas.setAttribute('width', '100%');\n tablas.setAttribute('cellspacing', '0');\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(tablaResponsiva);\n tablaResponsiva.appendChild(tablas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('verTodosAvisos=');\n\n}", "function crearTablaAuditoriaInspeccionesAscensores(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_ascensores (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "function getListTramites() {\n if (vm.usuarioOficina == \"rc\") {\n if (vm.usuarioTramites == 'A') {\n fire.ref('rh/tramites/registroyControl').orderByChild('tipoUsuario').equalTo('A').on('value', function(snapshot){\n vm.listaTramites = snapshot.val();\n $rootScope.$apply();\n });\n }\n else{\n if (vm.usuarioTramites == 'B') {\n fire.ref('rh/tramites/registroyControl').orderByChild(\"tipoUsuario\").equalTo(\"B\").on('value', function(snapshot){\n vm.listaTramites = snapshot.val();\n $rootScope.$apply();\n });\n }\n }\n }\n else{\n if (vm.usuarioOficina == \"sp\") {\n fire.ref('rh/tramites/serviciosalPersonal').on('value', function(snapshot){\n vm.listaTramites = snapshot.val();\n });\n }\n }\n }", "function refreshTable(table, url, getActive, httpType, projectIds, modelIds, typeIds,\n locIds, assyIds, personIds, startDate, endDate) {\n\n getActive = (typeof getActive !== \"undefined\" && getActive == false) ? false : true;\n httpType = (typeof httpType !== \"undefined\") ? httpType : \"GET\";\n projectIds = (typeof projectIds !== \"undefined\") ? projectIds : [];\n modelIds = (typeof modelIds !== \"undefined\") ? modelIds : [];\n typeIds = (typeof typeIds !== \"undefined\") ? typeIds : [];\n locIds = (typeof locIds !== \"undefined\") ? locIds : [];\n assyIds = (typeof assyIds !== \"undefined\") ? assyIds : [];\n personIds = (typeof personIds !== \"undefined\") ? personIds : [];\n startDate = (typeof startDate !== \"undefined\") ? startDate : {};\n endDate = (typeof endDate !== \"undefined\") ? endDate : {};\n\n table.clear().search(\"\").draw();\n showModalWait();\n\n $.ajax({\n type: httpType, url: url, timeout: 120000,\n data: {getActive: getActive, projectIds: projectIds, modelIds: modelIds, typeIds: typeIds,\n locIds: locIds, assyIds: assyIds, personIds: personIds, startDate: startDate, endDate: endDate\n },\n dataType: \"json\",\n })\n .always(function () { $(\"#ModalWait\").modal(\"hide\"); })\n .done(function (data) {\n table.rows.add(data).order([1, \"asc\"]).draw();\n })\n .fail(function (xhr, status, error) {\n showModalAJAXFail(xhr, status, error);\n });\n}", "function muestraHistorial(tipo) {\n var tamanio = historial.length;\n var html =\n `<table id=\"myTable\" class=\"table table-bordered table-striped\">\n <thead>\n <tr>\n <th>No. de nomina</th>\n <th>Fecha</th>\n <th>Elaborada por</th>\n <th class=\"text-center\">Acciones</th>\n </tr>\n </thead>\n <tfoot>\n <tr>\n <th>No. de nomina</th>\n <th>Fecha</th>\n <th>Elaborada por</th>\n <th>Acciones</th>\n </tr>\n </tfoot>\n <tbody>`;\n for(var x=0; x<tamanio; x++) {\n\n html += `<tr>\n <td>${historial[x].Semana}</td>\n <td><i class=\"fa fa-clock-o\"></i> ${historial[x].Fecha}</td>\n <td>${historial[x].usuario}</td>\n <td class=\"text-center\">\n <a href=\"nomina${tipo}/detalles/${historial[x].Semana}\" data-toggle=\"tooltip\" data-original-title=\"Ver detalles\"> <i class=\"icon-eye \"></i> </a>\n </td>\n\n </tr>`;\n }\n html += `<tbody>\n </table>`;\n $( \".tablaHistorial\" ).append(html);\n $('#myTable').DataTable({\n \"order\": [[ 1, \"desc\" ]]\n });\n}", "function User_Update_Agents_Liste_des_agents0(Compo_Maitre)\n{\n var Table=\"agent\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ag_nom=GetValAt(110);\n if (!ValiderChampsObligatoire(Table,\"ag_nom\",TAB_GLOBAL_COMPO[110],ag_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_nom\",TAB_GLOBAL_COMPO[110],ag_nom))\n \treturn -1;\n var ag_prenom=GetValAt(111);\n if (!ValiderChampsObligatoire(Table,\"ag_prenom\",TAB_GLOBAL_COMPO[111],ag_prenom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_prenom\",TAB_GLOBAL_COMPO[111],ag_prenom))\n \treturn -1;\n var ag_initiales=GetValAt(112);\n if (!ValiderChampsObligatoire(Table,\"ag_initiales\",TAB_GLOBAL_COMPO[112],ag_initiales,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_initiales\",TAB_GLOBAL_COMPO[112],ag_initiales))\n \treturn -1;\n var ag_actif=GetValAt(113);\n if (!ValiderChampsObligatoire(Table,\"ag_actif\",TAB_GLOBAL_COMPO[113],ag_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_actif\",TAB_GLOBAL_COMPO[113],ag_actif))\n \treturn -1;\n var ag_role=GetValAt(114);\n if (!ValiderChampsObligatoire(Table,\"ag_role\",TAB_GLOBAL_COMPO[114],ag_role,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_role\",TAB_GLOBAL_COMPO[114],ag_role))\n \treturn -1;\n var eq_numero=GetValAt(115);\n if (eq_numero==\"-1\")\n eq_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"eq_numero\",TAB_GLOBAL_COMPO[115],eq_numero,true))\n \treturn -1;\n var ag_telephone=GetValAt(116);\n if (!ValiderChampsObligatoire(Table,\"ag_telephone\",TAB_GLOBAL_COMPO[116],ag_telephone,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_telephone\",TAB_GLOBAL_COMPO[116],ag_telephone))\n \treturn -1;\n var ag_mobile=GetValAt(117);\n if (!ValiderChampsObligatoire(Table,\"ag_mobile\",TAB_GLOBAL_COMPO[117],ag_mobile,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_mobile\",TAB_GLOBAL_COMPO[117],ag_mobile))\n \treturn -1;\n var ag_email=GetValAt(118);\n if (!ValiderChampsObligatoire(Table,\"ag_email\",TAB_GLOBAL_COMPO[118],ag_email,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_email\",TAB_GLOBAL_COMPO[118],ag_email))\n \treturn -1;\n var ag_commentaire=GetValAt(119);\n if (!ValiderChampsObligatoire(Table,\"ag_commentaire\",TAB_GLOBAL_COMPO[119],ag_commentaire,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ag_commentaire\",TAB_GLOBAL_COMPO[119],ag_commentaire))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ag_nom=\"+(ag_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_nom)+\"'\" )+\",ag_prenom=\"+(ag_prenom==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_prenom)+\"'\" )+\",ag_initiales=\"+(ag_initiales==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_initiales)+\"'\" )+\",ag_actif=\"+(ag_actif==\"true\" ? \"true\" : \"false\")+\",ag_role=\"+(ag_role==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_role)+\"'\" )+\",eq_numero=\"+eq_numero+\",ag_telephone=\"+(ag_telephone==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_telephone)+\"'\" )+\",ag_mobile=\"+(ag_mobile==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_mobile)+\"'\" )+\",ag_email=\"+(ag_email==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_email)+\"'\" )+\",ag_commentaire=\"+(ag_commentaire==\"\" ? \"null\" : \"'\"+ValiderChaine(ag_commentaire)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}" ]
[ "0.60757035", "0.5925722", "0.59054965", "0.58916247", "0.5874251", "0.58151865", "0.5761008", "0.57493025", "0.5747138", "0.5725846", "0.56563157", "0.5639805", "0.5608928", "0.5605054", "0.55886406", "0.5570171", "0.55697393", "0.5569697", "0.55443937", "0.553147", "0.5483779", "0.5471442", "0.54550755", "0.54512763", "0.54297805", "0.54122543", "0.53955716", "0.53955716", "0.53903353", "0.53891975", "0.5387647", "0.5385433", "0.53828126", "0.53806615", "0.5378575", "0.5376665", "0.5376471", "0.53663605", "0.53633314", "0.5354618", "0.53262335", "0.53119045", "0.5308492", "0.52967495", "0.5295976", "0.5282387", "0.5281911", "0.5256559", "0.52520245", "0.52493197", "0.5246034", "0.5245213", "0.52428865", "0.52426386", "0.5241415", "0.5232293", "0.52303684", "0.52253294", "0.52227235", "0.52140033", "0.5212526", "0.5210215", "0.5209134", "0.52055013", "0.5203474", "0.5201613", "0.51996833", "0.5188775", "0.518723", "0.5182072", "0.5165941", "0.5163115", "0.5157127", "0.5156698", "0.5154966", "0.5150581", "0.5147442", "0.5146184", "0.5145654", "0.51453316", "0.5144276", "0.51386416", "0.5132012", "0.5131933", "0.5131927", "0.5130713", "0.5130713", "0.5126415", "0.51254994", "0.5123197", "0.51215243", "0.5121262", "0.5116937", "0.5114448", "0.51144147", "0.51117176", "0.51092577", "0.5108186", "0.5107805", "0.51050305", "0.5104965" ]
0.0
-1
Muestra todos los profesores activados en una tabla
function mostrarCursos() { let sBuscar = document.querySelector('#txtBuscarCursos').value; let listaCursos = getListaCursos(); let cuerpoTabla = document.querySelector('#tblCursos tbody'); cuerpoTabla.innerHTML = ''; for (let i = 0; i < listaCursos.length; i++) { if (listaCursos[i][0].toLowerCase().includes(sBuscar.toLowerCase())) { if (listaCursos[i][5] == true) { let fila = cuerpoTabla.insertRow(); let checkSeleccion = document.createElement('input'); checkSeleccion.setAttribute('type', 'checkbox'); checkSeleccion.classList.add('checkbox'); checkSeleccion.dataset.codigo = listaCursos[i][0]; let cSeleccionar = fila.insertCell(); let cCodigo = fila.insertCell(); let cNombre = fila.insertCell(); let cCreditos = fila.insertCell(); let sCodigo = document.createTextNode(listaCursos[i][0]); let sNombre = document.createTextNode(listaCursos[i][1]); let sCreditos = document.createTextNode(listaCursos[i][2]); let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]'); cSeleccionar.appendChild(checkSeleccion); cCodigo.appendChild(sCodigo); cNombre.appendChild(sNombre); cCreditos.appendChild(sCreditos); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inicializarActividades() {\n\t//Creamos actividades por defecto\n\tactividad1 = new Actividad(\"Yoga\", 60, 1);\n\tactividad2 = new Actividad(\"Cross-Fit\", 45, 2);\n\tactividad3 = new Actividad(\"Zumba\", 30, 1);\n\n\tvectorActividades.push(actividad1);\n\tvectorActividades.push(actividad2);\n\tvectorActividades.push(actividad3);\n\n\t//Aniadimos las actividades a una tabla\n\tvar tablaActividades = document.getElementById(\"actividades\");\n\t\n\tfor (var i = 0; i < vectorActividades.length; i++){\n\t\tvar nuevaActividad = tablaActividades.insertRow(-1);\n\t\tnuevaActividad.innerHTML = \"<td>\" + vectorActividades[i].nombre + \"</td><td>\" \n\t\t+ vectorActividades[i].duracion + \"</td>\"\n\t\t+ \"<td>\" + vectorActividades[i].sala + \"</td>\";\n\t}\n\t\n}", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "async function preencheTabela() {\n\n let moduloSelecionado = document.getElementById('selecionaModulo').value\n \n const dadosRecebidos = await recebeDadosTabela();\n \n removeTr();\n \n dadosRecebidos.forEach(dadoRecebido => {\n if (dadoRecebido.modulo === moduloSelecionado) {\n infoTables(\n dadoRecebido.nome,\n dadoRecebido.matriculados,\n dadoRecebido.desistentes,\n dadoRecebido.aptos,\n dadoRecebido.naoAptos.total); \n }\n\n });\n\n}", "function activar(tbody, table){\n\t\t$(tbody).on(\"click\", \"span.activar\", function(){\n var data=table.row($(this).parents(\"tr\")).data();\n statusConfirmacion('EsquemaComision/status_esquema_comision', data.id_esquema_comision, 1, \"¿Esta seguro de activar el registro?\", 'activar');\n });\n\t}", "function crearTablaAuditoriaInspeccionesPuertas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_puertas (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "function verPacientesActivos() {\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('PACIENTES ACTIVOS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('MODIFICA O ELIMINA LOS USUARIOS ACTIVOS');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Información de Usuarios');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let tablaResponsiva = document.createElement(\"div\");\n tablaResponsiva.setAttribute('class', 'table-responsive');\n let tablas = document.createElement(\"table\");\n tablas.setAttribute('class', 'table table-bordered');\n tablas.setAttribute('id', 'dataTable');\n tablas.setAttribute('width', '100%');\n tablas.setAttribute('cellspacing', '0');\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(tablaResponsiva);\n tablaResponsiva.appendChild(tablas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('activos=');\n}", "function ramplirtabUti(){\n clairtxtBoxUti();\n $('#tableUti').bootstrapTable('refresh');\n/*\n\tvar request = new XMLHttpRequest();\n var url =\"\";\n\turl = \"/tusers\";\n\trequest.open(\"GET\", url, true);\n\t\n\trequest.onreadystatechange = function() {\n if (request.readyState === 4 && request.status === 200) {\n var info = JSON.parse(request.responseText); \n var tbody = document.getElementById(\"tbodyutiResult\");\n clairtxtBoxUti();\n tbody.innerHTML = \"\";\n for (i = 0; i < info.length; i++) {\n var tr = document.createElement('TR'); \n setCelulle(info[i].coduser,null,tr);\n setCelulle(info[i].password || '',null,tr);\n setCelulle(info[i].nom,null,tr);\n setCelulle(info[i].prenom,null,tr);\n setCelulle(info[i].admin,null,tr);\n setCelulle(info[i].inactif,null,tr);\n setCelulle(info[i].utilise,true,tr);\n tbody.appendChild(tr);\n }\n }\n };\n request.send(); */\n} // end ramplir", "function currentProfile(event) {\n\tfor (let i = 0; i < hires.length; i++) {\n\t\thires[i].classList.remove('active');\n\t}\n\tevent.currentTarget.classList.add('active');\n}", "function checkActive(arr) {\n let rows = container.querySelectorAll(\".table__row\");\n let activeRow;\n for (let row of rows) {\n row.classList.contains(\"table__row_selected\") ? activeRow = row : false;\n }\n let id = activeRow.querySelector(\".id\").textContent;\n let name = activeRow.querySelector(\".name\").textContent;\n let infoBlock = container.querySelector(\".info-block\");\n infoBlock.innerHTML = \"<div><b>Profile info:</b></div>\";\n for (let user of arr) {\n if (id == user.id && name == user.firstName) {\n let userName = document.createElement(\"div\");\n userName.textContent = \"Selected profile: \" + user.firstName + \" \" + user.lastName;\n let userDesc = document.createElement(\"div\");\n userDesc.textContent = \"Description: \" + user.description;\n let userAddress = document.createElement(\"div\");\n userAddress.textContent = \"Address: \" + user.adress.streetAddress;\n let userCity = document.createElement(\"div\");\n userCity.textContent = \"City: \" + user.adress.city;\n let userState = document.createElement(\"div\");\n userState.textContent = \"State: \" + user.adress.state;\n let userZip = document.createElement(\"div\");\n userZip.textContent = \"Index: \" + user.adress.zip;\n\n infoBlock.append(userName);\n infoBlock.append(userDesc);\n infoBlock.append(userAddress);\n infoBlock.append(userCity);\n infoBlock.append(userState);\n infoBlock.append(userZip);\n }\n }\n }", "function mostrarEstudiante() {\n\n\n //agregar las filas y columnas a la tabla\n var columnas = \"<tr><th>Foto</th><th>Cedula</th><th>Nombre</th><th>Carrera</th><th>Estado de Ingles</th><th>Opciones</th></tr>\";\n // leer datos\n var estudiantes = JSON.parse(localStorage.getItem('estudiantes'));\n var estudiante = columnas;\n //agregar los usuarios a la tabla \n for (var i = 0; i < estudiantes.length; i++) {\n //agregar datos de forma html a la tabla\n if (estudiantes[i] != undefined) {\n estudiante += \"<tr>\";\n estudiante += '<td class=\"lbl-imagen\"><img width=\"100px\" heigth=\"100px\" src=\"Imagenes/' + estudiantes[i].imagen + '\"></img></td>';\n estudiante += '<td class=\"lbl-cedula\"><a class=\"vista\" data-toggle=\"modal\" data-target=\"#vista-estudiante\">' + estudiantes[i].cedula + '</a></td>';\n estudiante += '<td class=\"lbl-nobre\">' + estudiantes[i].nombre + '</td>';\n estudiante += '<td class=\"lbl-carrera\">' + estudiantes[i].carrera + '</td>';\n estudiante += '<td class=\"lbl-role\">' + estudiantes[i].role + '</td>';\n estudiante += \"<td>\";\n estudiante += '<div class=\"btn-group\">';\n estudiante += ' <button type=\"button\" class=\"btn btn-warning dropdown-toggle\" data-toggle=\"dropdown\">Opciones<span class=\"caret\"></span></button>';\n estudiante += '<ul class=\"dropdown-menu\" role=\"menu\"><li><a data-toggle=\"modal\" data-target=\"#miventana\" class=\"editar\" id=\"' + estudiantes[i].cedula + '\" href=\"editar.html?codigo=' + estudiantes[i].cedula + '\">Editar</a></li><li><a class=\"eliminar\" id=\"' + estudiantes[i].cedula + '\" href=\"#\">Eliminar</a></li></ul>';\n estudiante += '</div>';\n estudiante += \"</td>\";\n estudiante += \"</tr>\";\n }\n };\n //mostrarlos en la tabla\n document.getElementById(\"tabla-estudiante\").innerHTML = estudiante;\n}", "function mostrarJornadaUsuario(partidos){\n\n\n\tfor (index = 0; index < partidos.length; index++) {\n\n\t\tvar row = $(\"<tr></tr>\").attr(\"scope\", \"row\");\n\t\trow.append($(\"<td></td>\").text(partidos[index].fecha));\n\t\trow.append($(\"<td></td>\").text(partidos[index].horario));\n\t\trow.append($(\"<td></td>\").text(partidos[index].equipo_local));\n\n\t\tvar resultado = partidos[index].resultado;\n\n\t\tif (resultado === \"vs\")\n\t\t\trow.append($(\"<td></td\").append($(\"<span></span>\").attr(\"class\", \"badge badge-pill badge-danger\").text(\"vs\")));\n\t\telse{\n\t\t\tvar RL = resultado.substring(0, 1);\n\t\t\tvar RV = resultado.substring(1, 2);\n\t\t\trow.append($(\"<td></td\").append($(\"<span></span>\").attr(\"class\", \"badge badge-pill badge-danger\").text(RL + \" - \" + RV)));\n\t\t}\n\n\t\trow.append($(\"<td></td>\").text(partidos[index].equipo_visitante));\n\t\trow.append($(\"<td></td>\").attr(\"class\", \"tabla-estadio\").text(partidos[index].estadio));\n\t\t$(\"#tabla_fixture\").append(row);\n\t}\n\n}", "function userTable() { }", "create_table() {\n\n const print_estado_etiquetado = (estado) => {\n if (estado === \"Pendiente\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-danger\" />\n Pendiente\n </Badge>\n )\n }\n else if (estado === \"Finalizado\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-success\" />\n Finalizado\n </Badge>\n )\n }\n else if (estado === \"Pendiente de revision\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-warning\" />\n Pendiente de revision\n </Badge>\n )\n }\n else if (estado === \"Etiquetado Rechazado\") {\n return (\n <Badge color=\"\" className=\"badge-dot\">\n <i className=\"bg-warning\" />\n Etiquetado Rechazado\n </Badge>\n )\n };\n };\n\n // // Si la variable \"fotografias\" del estado esta vacia se imprime un mensaje correspondiente\n // // de lo contrario se crea la lista con las fotografias\n if (this.state.table_data.length === 0) {\n return (\n <>\n <h3 className=\"ml-6 mt-4 mb-4\">No se tiene ninguna fotografia registrada en esta muestra </h3>\n </>\n )\n }\n else {\n return this.state.table_data.map((foto) => {\n\n return (\n <tr key={foto.idFotografias} >\n <th\n scope=\"row\"\n onClick={(e) => {\n // Checar el tipo de usuario que dio cick\n // Se abre el modal primero\n if (foto.etiquetado.Estado === \"Etiquetado Rechazado\") {\n this.setState({\n etiquetado_rechazado: true,\n observaciones_del_rechazo: foto.etiquetado.Observaciones\n })\n console.log(foto.etiquetado.Observaciones)\n }\n else {\n this.setState({\n etiquetado_rechazado: false,\n observaciones_del_rechazo: \"\"\n })\n }\n\n this.setState({\n fotografia_seleccionada: foto.idFotografias,\n form_data: {\n zoom: foto.zoom,\n resolucion: foto.resolucion,\n idCamara: foto.idCamara,\n fileFoto: this.format_image(foto.fileFoto),\n etiquetado: \"Pendiente a revision\",\n idMuestra: foto.idMuestra\n }\n })\n this.toggle_etiquetado_intermedio_modal()\n }\n }>\n <Media>\n <a\n className=\"avatar rounded-circle mr-3\"\n onClick={(e) => e.preventDefault()}\n href=\"#\"\n >\n <img\n alt={this.format_image(foto.fileFoto)}\n src={\"/static/fotografias/\" + this.format_image(foto.fileFoto)}\n />\n </a>\n </Media>\n </th>\n <td\n onClick={(e) => {\n // Checar el tipo de usuario que dio cick\n // Se abre el modal primero\n if (foto.etiquetado.Estado === \"Etiquetado Rechazado\") {\n this.setState({\n etiquetado_rechazado: true,\n observaciones_del_rechazo: foto.etiquetado.Observaciones\n })\n console.log(foto.etiquetado.Observaciones)\n }\n else {\n this.setState({\n etiquetado_rechazado: false,\n observaciones_del_rechazo: \"\"\n })\n }\n\n this.setState({\n fotografia_seleccionada: foto.idFotografias,\n form_data: {\n zoom: foto.zoom,\n resolucion: foto.resolucion,\n idCamara: foto.idCamara,\n fileFoto: foto.fileFoto,\n etiquetado: \"Pendiente a revision\",\n idMuestra: foto.idMuestra\n }\n })\n this.toggle_etiquetado_intermedio_modal()\n }\n }>\n {print_estado_etiquetado(foto.etiquetado.Estado)}\n </td>\n {(this.props.user_data.data.is_superuser || this.props.user_data.data.is_staff) ?\n <>\n <td className=\"text-right\" >\n <UncontrolledDropdown>\n <DropdownToggle\n className=\"btn-icon-only text-light\"\n href=\"#pablo\"\n role=\"button\"\n size=\"m\"\n color=\"\"\n onClick={(e) => e.preventDefault()}\n >\n <i className=\"fas fa-ellipsis-v\" />\n </DropdownToggle>\n <DropdownMenu className=\"dropdown-menu-arrow\" container=\"body\" right>\n <DropdownItem\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n this.toggle_edit_modal()\n this.setState({\n fotografia_seleccionada: foto.idFotografias,\n form_data: {\n zoom: foto.zoom,\n resolucion: foto.resolucion,\n idCamara: foto.idCamara,\n fileFoto: foto.fileFoto,\n etiquetado: foto.etiquetado,\n idMuestra: foto.idMuestra\n }\n })\n }}\n >\n Editar\n </DropdownItem>\n <DropdownItem\n href=\"#pablo\"\n onClick={(e) => {\n e.preventDefault()\n this.toggle_delete_modal()\n this.setState({ fotografia_seleccionada: foto.idFotografias })\n }}\n >\n Eliminar\n </DropdownItem>\n </DropdownMenu>\n </UncontrolledDropdown>\n </td>\n </>\n :\n <></>\n }\n </tr>\n );\n });\n }\n }", "function crearTablaAuditoriaInspeccionesAscensores(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_ascensores (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAuditoriaInspeccionesEscaleras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_escaleras (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "function cargarCgg_titulo_profesionalCtrls(){\n\t\tif(inRecordCgg_titulo_profesional){\n\t\t\ttxtCgtpr_codigo.setValue(inRecordCgg_titulo_profesional.get('CGTPR_CODIGO'));\n\t\t\tcodigoNivelEstudio = inRecordCgg_titulo_profesional.get('CGNES_CODIGO');\t\t\t\n\t\t\ttxtCgnes_codigo.setValue(inRecordCgg_titulo_profesional.get('CGNES_DESCRIPCION'));\n\t\t\ttxtCgtpr_descripcion.setValue(inRecordCgg_titulo_profesional.get('CGTPR_DESCRIPCION'));\n\t\t\tisEdit = true;\n\t\t\thabilitarCgg_titulo_profesionalCtrls(true);\n\t}}", "function mostrarUsuarios(tipo) {\n const inscriptions = course.inscriptions;\n let lista = null;\n\n users = inscriptions?.map((inscription) => inscription.user);\n const teacher = new Array(course.creator);\n const delegate = new Array(course.delegate);\n\n if (tipo === 'Profesor') {\n lista = <UsersList courseId={courseId} users={teacher} setSelectedUser={(a)=>{console.log(a);}}/>;\n } else if (tipo === 'Delegados') {\n lista = <UsersList courseId={courseId} users={delegate} setSelectedUser={(a)=>{console.log(a);}} />;\n } else {\n lista = <UsersList courseId={courseId} users={users} setSelectedUser={(a)=>{console.log(a);}} />;\n }\n\n return lista;\n }", "function getProgress() {\n \n let select = document.getElementById(\"cboUsers\");\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n let cont=0;\n if (xhttp.readyState === 4 && xhttp.status === 200) { \n // mi json lo paso a una variable \n let arrayProgress = JSON.parse(xhttp.responseText);\n //mi variable que contiene a mi json lo convierto en un array que seleccionando sus valores intro y units\n //sera almacenado en variable arrayunits\n let arrayUnits = arrayProgress[select.value]['intro']['units'];\n //en mi html imprimo que mi tabla progreso estara vacia \n document.getElementById(\"progressTable\").innerText = null;\n //el for in recorre mi ...............\n for (let i in arrayUnits) {\n let fila = \"<tr><t d>\" + i + \"</td><td>\" + arrayUnits[i].completedParts + \"</td></tr>\";\n let btn = document.createElement(\"TR\");\n \n btn.innerHTML = fila;\n document.getElementById(\"progressTable\").appendChild(btn);\n }\n \n // hago un recorrido con mi for in para q chekee todas mis propiedades de mis objetos dentro de mi json progress y\n for (let key in arrayProgress){\n // si mi condicion es verdadera (y lo es porque todos los users tienen exercicies con valor 1)\n if (arrayProgress[select.value]['intro']['units']['02-variables-and-data-types']['parts']['06-exercises']['exercises']['01-coin-convert']['completed'] == 1 && arrayProgress[select.value]['intro']['units']['02-variables-and-data-types']['parts']['06-exercises']['exercises']['02-restaurant-bill']['completed'] == 1){\n //ira aumentando de uno en uno \n cont++;\n }\n }\n //creo una variable que almacenara mi contador que contiene todos los 1\n let fila2 = \"<tr><td>Total de Alumnas que realizarón los ejercicios : </td><td>\" + cont + \"</td></tr>\";\n //una variable que contiene mi elemento creado tr para el html \n let btn2 = document.createElement(\"TR\");\n \n btn2.innerHTML = fila2;\n document.getElementById(\"progressTable\").appendChild(btn2);\n \n }\n };\n xhttp.open(\"GET\", \"../data/cohorts/lim-2018-03-pre-core-pw/progress.json\", true);\n xhttp.send();\n }", "function mostrarHoteles() {\n if (mostraStatus) {\n mostrarHotelesActivados();\n } else {\n mostrarHotelesDesactivados();\n }\n}", "function generarTablaEnt(){\r\n document.querySelector(\"#divEntAlumno\").innerHTML = `<table id=\"tabEntAlumno\" border='2px' style='background-color: #FA047F; position: relative;'>\r\n <th>Título</th><th>Nivel</th><th>Imagen</th><th>Entrega</th><th>Corrección</th>`;\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n document.querySelector(\"#tabEntAlumno\").innerHTML += `\r\n <tr id=\"filaEntregas${i}\" class=\"filaEntregaAlumno\">\r\n <td style=\"padding: 10px\"> ${entregas[i].Ejercicio.titulo} </td>\r\n <td style=\"padding: 10px\"> ${entregas[i].Ejercicio.nivel} </td>\r\n <td style=\"padding: 10px\"><img src=\"${entregas[i].Ejercicio.imgPath}\" height=\"75px\" width=\"125px\"/> </td> \r\n <td style=\"padding: 10px\"><audio controls> <source src=\"${entregas[i].audPath}\"/></audio></td>\r\n <td style=\"padding: 10px\"> ${entregas[i].correccion} </td> \r\n </tr>`; \r\n }\r\n } \r\n \r\n}", "function mostrarDatos(usuarios) {\n tableBody.innerHTML = \"\";\n usuarios.forEach(u => {\n agregarFila(u);\n });\n }", "async function carregaFiltrosProfissionais() {\n let codAtivo = $(\".nav-link.active\").attr(\"data-func-id\");\n\n $(\"#func-tabs\").find(\".nav-p-filtro\").remove();\n\n await $.get(\"agendamentos/api/profissionais\")\n .then(function (data) {\n data.forEach(function (item, index, array) {\n $(\"#func-tabs\").append(`\n <li class=\"nav-item nav-p-filtro\" role=\"presentation\">\n <a class=\"nav-link\" id=\"func-${item.codPessoa}\" data-func-id=\"${item.codPessoa}\" data-toggle=\"tab\" href=\"#${item.nomePessoa}\" role=\"tab\" aria-controls=\"contact\" aria-selected=\"false\">${item.nomePessoa}</a>\n </li>\n `);\n });\n\n $(\".nav-link[data-func-id=\" + codAtivo + \"]\").addClass(\"active\");\n });\n }", "function pintarDatosPantalla(datos) {\n try {\n\n \n //PINTAR HTML (PROFESIONALES)\n var tblProfesionales = \"<tbody><tr>\";\n\n tblProfesionales += \" <td class='w100'>\" + datos.profevh + \"</td>\";\n tblProfesionales += \" <td class='w100'>\" + datos.profevm + \"</td>\";\n\n \n tblProfesionales += \" <td class='w100'> <span>\" + datos.profevt + \"</span> </td>\";\n\n tblProfesionales += \"<td class='pl'>\";\n\n if (datos.profevt != 0) {\n tblProfesionales += \" <i class='fa fa-file-pdf-o fkOpcion1' onclick='informes(1)'></i>\";\n }\n\n else {\n tblProfesionales += \" <i class='fa fa-file-pdf-o transparent fkOpcion1'></i>\";\n }\n\n tblProfesionales += \"</td>\";\n\n tblProfesionales += \" <td class='w100'>\" + datos.profevhant + \"</td>\";\n tblProfesionales += \" <td class='w100'>\" + datos.profevmant + \"</td>\";\n tblProfesionales += \" <td class='w100'><span>\" + datos.profevantt + \"</span> </td>\";\n\n\n tblProfesionales += \"<td class='pl'>\";\n if (datos.profevt != 0) {\n tblProfesionales += \" <i class='fa fa-file-pdf-o' onclick='informes(2)'></i>\";\n }\n\n else {\n tblProfesionales += \" <i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblProfesionales += \"</td>\";\n\n \n tblProfesionales += \"</tr>\";\n tblProfesionales += \" <tr>\";\n tblProfesionales += \"<td>\" + datos.profnoevh + \"</td><td>\" + datos.profnoevm + \"</td><td><span>\" + datos.profnoevt + \"</span></td>\";\n\n tblProfesionales += \"<td class='pl'>\";\n\n if (datos.profnoevt != 0) {\n tblProfesionales += \"<i class='fa fa-file-pdf-o' onclick='informes(3)'></i>\";\n }\n else {\n tblProfesionales += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblProfesionales += \"</td>\";\n \n tblProfesionales += \"<td>\" + datos.profnoevhant + \"</td><td>\" + datos.profnoevmant + \"</td>\";\n tblProfesionales += \"<td><span>\" + datos.profnoevantt + \"</span></td>\";\n\n\n tblProfesionales += \"<td class='pl'>\";\n if (datos.profnoevantt != 0) {\n tblProfesionales += \"<i class='fa fa-file-pdf-o' onclick='informes(4)'></i>\";\n }\n else {\n tblProfesionales += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblProfesionales += \"</td>\";\n\n tblProfesionales += \"</tr>\";\n\n\n tblProfesionales += \"<tr></td> <td>\" + datos.profht + \"</td> <td>\" + datos.profmt + \"</td><td> <span>\" + datos.proft + \"</span></td>\";\n\n\n tblProfesionales += \"<td class='pl'>\";\n if (datos.proft != 0) {\n tblProfesionales += \"<i class='fa fa-file-pdf-o' onclick='informes(5)'></i>\";\n }\n else {\n tblProfesionales += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblProfesionales += \"</td>\";\n \n \n tblProfesionales += \"<td>\" + datos.profhantt + \"</td> <td>\" + datos.profmantt + \"</td><td><span>\" + datos.profantt + \"</span> </td>\";\n \n \n tblProfesionales += \"<td class='pl'>\";\n if (datos.profantt != 0) {\n tblProfesionales += \"<i class='fa fa-file-pdf-o' onclick='informes(6)'></i>\";\n }\n\n else {\n tblProfesionales += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblProfesionales += \"</td>\";\n\n tblProfesionales += \"</tr>\"; \n tblProfesionales += \"</tbody></table></div>\";\n \n //PINTAR HTML (EVALUACIONES)\n tblEvaluaciones = \"<tbody><tr>\";\n tblEvaluaciones += \"<td class='w100'>\" + datos.evabiertah + \"</td> <td class='w100'>\" + datos.evabiertam + \"</td><td class='w100'><span>\" + datos.evabiertat + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evabiertat != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(7)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n //tblEvaluaciones += \"<td class='pl'><i class='fa fa-file-pdf-o'></i></td>\";\n tblEvaluaciones += \" <td class='w100'>\" + datos.evabiertahant + \"</td> <td class='w100'>\" + datos.evabiertamant + \"</td><td class='w100'<span>\" + datos.evabiertaantt + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evabiertaantt != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(8)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n tblEvaluaciones += \"</tr>\";\n\n tblEvaluaciones += \"<tr>\";\n tblEvaluaciones += \"<td class='w100'>\" + datos.evcursoh + \"</td> <td class='w100'>\" + datos.evcursom + \"</td><td class='w100'><span>\" + datos.evcursot + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evcursot != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(9)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n \n tblEvaluaciones += \" <td class='w100'>\" + datos.evcursohant + \"</td> <td class='w100'>\" + datos.evcursomant + \"</td><td class='w100'<span>\" + datos.evcursoantt + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evcursoantt != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(10)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n\n tblEvaluaciones+= \"</tr>\";\n \n tblEvaluaciones += \"<tr><td>\" + datos.evcerradah + \"</td><td>\" + datos.evcerradam + \"</td><td> <span>\" + datos.evcerradat + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evcerradat != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(11)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n\n tblEvaluaciones += \"<td>\" + datos.evcerradahant + \"</td><td>\" + datos.evcerradamant + \"</td><td><span>\" + datos.evcerradaantt + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evcerradaantt != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(12)'></i>\";\n }\n\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n\n tblEvaluaciones += \"</tr>\";\n\n\n tblEvaluaciones += \"<tr><td>\" + datos.evfirmadah + \"</td> <td>\" + datos.evfirmadam + \"</td><td><span>\" + datos.evfirmadat + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evfirmadat != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(13)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n \n tblEvaluaciones += \"<td>\" + datos.evfirmadahant + \"</td><td>\" + datos.evfirmadamant + \"</td> <td> <span>\" + datos.evfirmadaantt + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evfirmadaantt != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(14)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n tblEvaluaciones += \"</tr>\";\n\n\n tblEvaluaciones += \"<tr><td>\" + datos.evautomaticah + \"</td><td>\" + datos.evautomaticam + \"</td><td> <span>\" + datos.evautomaticat + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evautomaticat != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(15)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n tblEvaluaciones += \"<td>\" + datos.evautomaticahant + \"</td><td>\" + datos.evautomaticamant + \"</td><td><span>\" + datos.evautomaticaantt + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evautomaticaantt != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(16)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n\n tblEvaluaciones += \"</tr>\";\n\n tblEvaluaciones += \"<tr><td>\" + datos.evht + \"</td> <td>\" + datos.evmt + \"</td><td><span>\" + datos.evt + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evt != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(17)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n \n tblEvaluaciones += \"<td>\" + datos.evhantt + \"</td><td>\" + datos.evmantt + \"</td><td> <span>\" + datos.evantt + \"</span></td>\";\n\n tblEvaluaciones += \"<td class='pl'>\";\n if (datos.evantt != 0) {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o' onclick='informes(18)'></i>\";\n }\n else {\n tblEvaluaciones += \"<i class='fa fa-file-pdf-o transparent'></i>\";\n }\n tblEvaluaciones += \"</td>\";\n \n tblEvaluaciones+= \"</tr></tbody>\";\n\n \n //Inyectar html en la página\n $(\"#tblProfesionales\").html(tblProfesionales);\n \n setTimeout(function () {\n $(\"#tblEvaluaciones\").html(tblEvaluaciones);\n }, 20);\n\n //$(\"#tblEvaluaciones\").html(tblEvaluaciones)\n \n }\n catch (e) {\n mostrarErrorAplicacion(\"Ocurrió un error al pintar la tabla.\", e.message)\n }\n}", "function listUsers() {\n const Table = require('cli-table');\n const User = require('../models/user');\n const mongoose = require('../mongoose');\n\n User\n .find()\n .exec()\n .then((users) => {\n let table = new Table({\n head: [\n 'ID',\n 'Display Name',\n 'Profiles',\n 'Roles',\n 'State'\n ]\n });\n\n users.forEach((user) => {\n table.push([\n user.id,\n user.displayName,\n user.profiles.map((p) => p.provider).join(', '),\n user.roles.join(', '),\n user.disabled ? 'Disabled' : 'Enabled'\n ]);\n });\n\n console.log(table.toString());\n mongoose.disconnect();\n })\n .catch((err) => {\n console.error(err);\n mongoose.disconnect();\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 = '<tr>' +\r\n '<th>' + element.order + '</th>' +\r\n '<td>' + element.activity + '</td>' +\r\n '<td>' + element.manager + '</td>' +\r\n '<td>' + element.numofsub + '</td>' +\r\n '</tr>';\r\n tbody.append(html);\r\n });\r\n }", "function listarInstrutores () {\n instrutorService.listar().then(function (resposta) {\n //recebe e manipula uma promessa(resposta)\n $scope.instrutores = resposta.data;\n })\n instrutorService.listarAulas().then(function (resposta) {\n $scope.aulas = resposta.data;\n })\n }", "function mostrarContenidoBitacora() {\n ppActividades.style.display = \"block\";\n let idBitacora = this.dataset._id;\n inputIdBitacora.value = idBitacora;\n let infoBitacora = buscarBitacora(idBitacora);\n // Este titulo se adquiere del curso al que pertenece la bitacora\n let tituloBitacora = document.querySelector('#sct_actividades>div>h1');\n tituloBitacora.textContent = 'Bitácora de: ' + infoBitacora['curso_bitacora'];\n\n // Esto crea el boton de agregar actividad\n let btnAgregarActividad = document.querySelector('#btnAgregarActividad');\n if (rolUsuarioActual == 'Asistente' || rolUsuarioActual == 'Administrador') {\n btnAgregarActividad.addEventListener('click', function () {\n ppActividades.style.display = \"none\";\n ppRegistrarActividad.style.display = \"block\";\n });\n btnAgregarActividad.addEventListener('click', cambiarDatosFormularioActividad);\n } else {\n btnAgregarActividad.hidden = true;\n document.querySelector('#sct_actividades .popup-content').style.display = 'block';\n }\n\n let table = document.querySelector('#tblActividades');\n let msgNoActividad = document.querySelector('#msjActividad');\n\n let listaActividades = infoBitacora['actividades_bitacora'];\n\n if (infoBitacora['actividades_bitacora'].length == 0 || infoBitacora['actividades_bitacora'].length == null || infoBitacora['actividades_bitacora'].length == undefined) {\n table.style.display = \"none\";\n document.querySelector('#sct_actividades .popup-content').style.width = '60%';\n msgNoActividad.style.display = \"block\";\n } else {\n table.style.display = \"table\";\n document.querySelector('#sct_actividades .popup-content').style.width = '90%';\n msgNoActividad.style.display = \"none\";\n }\n\n let tbody = document.querySelector('#tblActividades tbody');\n\n tbody.innerHTML = '';\n\n for (let i = 0; i < listaActividades.length; i++) {\n\n let fila = tbody.insertRow();\n let celdaFechaRegistro = fila.insertCell();\n let celdaFechaActividad = fila.insertCell();\n let celdaHoraInicio = fila.insertCell();\n let celdaHoraFin = fila.insertCell();\n let celdaHorasTrabajadas = fila.insertCell();\n let celdaAccionActividad = fila.insertCell();\n let celdaEstudianteAtendido = fila.insertCell();\n let celdaDescripcion = fila.insertCell();\n\n celdaFechaRegistro.innerHTML = formatDate(listaActividades[i]['fecha_registro_actividad']);\n celdaFechaActividad.innerHTML = formatDate(listaActividades[i]['fecha_actividad_actividad']);\n celdaHoraInicio.innerHTML = listaActividades[i]['hora_inicio_actividad'];\n celdaHoraFin.innerHTML = listaActividades[i]['hora_fin_actividad'];\n if (listaActividades[i]['horas_trabajadas_actividad'] != undefined || listaActividades[i]['horas_trabajadas_actividad'] != \"\") {\n celdaHorasTrabajadas.innerHTML = listaActividades[i]['horas_trabajadas_actividad'].toFixed(2);\n } else {\n celdaHorasTrabajadas.innerHTML = '-';\n }\n\n celdaAccionActividad.innerHTML = listaActividades[i]['accion_actividad'];\n\n if (listaActividades[i]['estudiantes_atendidos_actividad'] != \"\") {\n celdaEstudianteAtendido.innerHTML = listaActividades[i]['estudiantes_atendidos_actividad'];\n } else {\n celdaEstudianteAtendido.innerHTML = \"-\";\n }\n\n celdaDescripcion.innerHTML = listaActividades[i]['descripcion_actividad'];\n\n // Imprime la columna de opciones si el usuario no es asistente\n if (rolUsuarioActual == 'Asistente' || rolUsuarioActual == 'Administrador') {\n\n let cOpciones = document.querySelector('#cOpcionesActividad');\n cOpciones.hidden = false;\n let celdaOpciones = fila.insertCell();\n\n // Este es el boton de editar\n let botonEditar = document.createElement('span');\n botonEditar.classList.add('fas');\n botonEditar.classList.add('fa-cogs');\n\n botonEditar.dataset.id_actividad = listaActividades[i]['_id'];\n botonEditar.name = \"btnEditarActividad\"\n\n if (rolUsuarioActual == 'Asistente' || rolUsuarioActual == 'Administrador') {\n botonEditar.addEventListener('click', function () {\n ppActividades.style.display = \"none\";\n ppRegistrarActividad.style.display = \"block\";\n });\n botonEditar.addEventListener('click', cambiarDatosFormularioActividad);\n botonEditar.addEventListener('click', llenarFormularioActualizar);\n }\n\n celdaOpciones.appendChild(botonEditar);\n\n\n let botonEliminar = document.createElement('span');\n botonEliminar.classList.add('fas');\n botonEliminar.classList.add('fa-trash-alt');\n botonEliminar.dataset.id_actividad = listaActividades[i]['_id'];\n\n celdaOpciones.appendChild(botonEliminar);\n botonEliminar.addEventListener('click', eliminar_actividad);\n\n celdaOpciones.appendChild(botonEliminar);\n }\n\n }\n displayActividadesScroll();\n\n\n}", "function llenaTabla(){\n\t\n $(\".fila_usuario\").remove();\n \n\t\n $.ajax({\n data:{},\n url:\"GET_USUARIO\",\n type:\"POST\",\n success: function (response) {\n \t\n\n var ESTADO=\"\";\n $.each( response, function( key, value ) {\n \t \n \t if(value.ESTADO===true){\n \t\t \n \t\t ESTADO=\"ACTIVO\";\n \t\t \n \t }else{\n \t\t ESTADO=\"INACTIVO\";\n \t\t \n \t }\n \t \n \t \n $(\"#tb_usuario\").append('<tr id='+value.OID_USUARIO+' class=fila_usuario><td>'+value.OID_USUARIO+'</td><td>'+value.USUARIO+'</td><td><a onclick=changeState('+value.OID_USUARIO+','+value.ESTADO+')>'+ESTADO+'</a></td><td><a onclick=update('+value.OID_USUARIO+',\"'+value.USUARIO+'\")>ACTUALIZAR</a></td></tr>');\n\n \t\t});\n \n \t/*PAGINACION DE LA TABLA*/\n table= $('#table_usuario').DataTable();\n\n \n }, error: function (err) {\n alert(\"Error en el AJAX LLena tabla\" + err.statusText);\n }\n });\n \n\t\n\t\n\t\n}", "function pintarActividades(pListaActividades){ //aqui repintamos la lista completa\n seccionActividades.innerHTML = \"\"; //aqui estoy borrando todas actividades antes pintadas para que se muestren las que pinto ahora\n\n if(pListaActividades.length !=0) {\n pListaActividades.forEach( actividad => { //aqui estamos recorriendo los elementos de la lista para ver cual cumple lo que buscamos\n pintarActividad(actividad); //aqui reutilizamos la funcion pintarActividad que se encuentra en la linea 133\n })\n\n } else{\n seccionActividades.innerHTML = \"<h2>No hay registros con esas condiciones</h2>\" \n }\n}", "async function colocarTabela(alunos){\n \n for (let i = 0; i < alunos.length; i++) {\n\n var element = alunos[i];\n\n //Cria uma linha e suas colunas \n var linha = document.createElement(\"tr\");\n linha.classList.add(\"linhas\");\n\n //Coluna do RA\n var colunaRa = document.createElement(\"td\");\n colunaRa.textContent = element.matricula;\n\n //Busca os dados do usuario no banco \n var resposta = await usarApi(\"GET\", \"http://localhost:8080/usuarios/\"+element.fk_usuario);\n var usuario = JSON.parse(resposta);\n\n //Coluna do nome\n var colunaNome = document.createElement(\"td\");\n colunaNome.textContent = usuario.nome;\n\n //Adiciona a linha na tabela \n var tabela = document.getElementById(\"tab\");\n linha.appendChild(colunaRa);\n linha.appendChild(colunaNome);\n\n tabela.appendChild(linha);\n }\n \n $(\".linhas\").dblclick(function() { \n var isConfirm = confirm(\"Deseja expulsar o aluno?\");\n\n if(isConfirm){\n var idAluno = alunos[$(this).index()-1].idAluno;\n apagar(idAluno);\n }\n });\n}", "function crearTablaPuertasValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_desc_puerta,o_tipo_puerta,o_motorizacion,o_acceso,o_accionamiento,o_operador,o_hoja,o_transmision,o_identificacion,f_fecha,v_ancho,v_alto,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function cargarCgg_gem_perfil_profCtrls(){\n\t\tif(inRecordCgg_gem_perfil_prof){\n\t\t\tcbxCgnes_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGNES_CODIGO'));\n\t\t\ttxtCgppr_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_CODIGO'));\t\t\t\n\t\t\tcodigoEspecialidad = inRecordCgg_gem_perfil_prof.get('CGESP_CODIGO');\n\t\t\ttxtCgesp_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGESP_NOMBRE'));\n\t\t\tcodigoTitulo = inRecordCgg_gem_perfil_prof.get('CGTPR_CODIGO');\n\t\t\ttxtCgtpr_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGTPR_DESCRIPCION'));\t\t\t\n\t\t\tcbxCgmdc_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGMDC_CODIGO'));\n\t\t\tcodigoPersona = inRecordCgg_gem_perfil_prof.get('CRPER_CODIGO')\n\t\t\ttxtCrper_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CRPER_NOMBRES')+\" \"+inRecordCgg_gem_perfil_prof.get('CRPER_APELLIDO_PATERNO')+\" \"+inRecordCgg_gem_perfil_prof.get('CRPER_APELLIDO_MATERNO'));\t\t\t\n\t\t\tcodigoInstitucion = inRecordCgg_gem_perfil_prof.get('CGIEN_CODIGO');\n\t\t\ttxtCgien_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGIED_NOMBRE'));\t\t\t\n\t\t\tnumCgppr_nivel_aprobado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_NIVEL_APROBADO'));\n\t\t\tdtCgppr_fecha_inicio.setValue((inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_INICIO'))||'');\n\t\t\tdtCgppr_fecha_fin.setValue((inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_FIN'))||'');\n\t\t\tchkCgppr_confirmado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_CONFIRMADO'));\n\t\t\tdtCgppr_fecha_confirmacion.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_CONFIRMACION')||new Date());\n\t\t\tchkCgppr_predeterminado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_PREDETERMINADO'));\n\t\t\tisEdit = true;\n\t\t\t\n\t\t\tif (IN_PERSONA){\n\t\t\t\ttxtCrper_codigo.hidden = true;\n\t\t\t\tbtnCrper_codigoCgg_gem_perfil_prof.hidden=true;\n\t\t\t}else{\n\t\t\t\ttxtCrper_codigo.hidden = false;\n\t\t\t\tbtnCrper_codigoCgg_gem_perfil_prof.hidden=false;\n\t\t\t}\n\t\t\tif (inRecordCgg_gem_perfil_prof.get('CGPPR_NIVEL_APROBADO') > 0)\n {\n chkFormacionParcial.setValue(true);\n numCgppr_nivel_aprobado.enable();\n //numCgppr_nivel_aprobado.enable();\n }\n else\n {\n chkFormacionParcial.setValue(false);\n numCgppr_nivel_aprobado.disable();\n }\t\t\t\n\t}}", "function activarHerramientaPerfil() {\n console.log(\"Activar herramienta perfil\");\n\n crearYCargarCapaLineaPerfil();\n activarControlDibujo();\n\n\n}", "function tablausuarios(){\n\t\t$('#tablausuarios').dataTable().fnDestroy();\t\t \t\n\t\t$('#tablausuarios').DataTable({\n\n\t\t\t//PARA EXPORTAR\n\t\t\tdom: \"Bfrtip\",\n\t\t\tbuttons: [{\n\t\t\t\textend: \"copy\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"csv\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"excel\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"pdf\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"print\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}],\n\t\t\tresponsive: !0,\n\t\t\t\n\t\t\t\"order\" : [ [ 1, \"asc\" ] ],\n\t\t\t\"ajax\" : \"../usuario/getusuarios\",\n\t\t\t\"columns\" : [{\n\t\t\t\t\"data\" : \"IDUSUARIO\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"NOMBRE\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"AREA\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"STATUS\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"OPCIONES\"\n\t\t\t},\t\t\n\t\t\t],\n\t\t\t\"language\": {\n\t\t\t\t\"url\": \"/ugel06_dev/public/cdn/datatable.spanish.lang\"\n\t\t\t} \n\t\t});\t\n\t}", "function list() {\n console.log(\"Voici la liste de tous vos contacts\");\n tabPrenom.forEach(prenom => {\n console.log('Prénom :', prenom);\n });\n tabNom.forEach(nom => {\n console.log('Nom :', nom);\n });\n\n}", "function selectAllDataCore(){\n //console.log(\"create table\");\n var tableDiv = document.getElementById('fetchmemberslist');\n var table = document.createElement('table');\n table.setAttribute(\"id\", \"memberslist\");\n tableDiv.appendChild(table);\n //console.log(\"core selected\");\n firebase.database().ref('Users').once('value', function(AllRecords){\n AllRecords.forEach(\n function(CurrentRecord){\n var member = CurrentRecord.val().name;\n var meetuserid = CurrentRecord.val().uid;\n var boardMember = CurrentRecord.val().isAdmin;\n var guest = CurrentRecord.val().name;\n if(boardMember==false && guest != \"Guest User\"){\n AddItemsToTable(member, meetuserid);\n }\n }\n );\n });\n}", "function viewAllActiveEmployees(conn, start) {\n conn.query(`${qry_standardEmpList}\n WHERE e.active = true\n ORDER BY e.first_name;`, (err, results) => {\n if (err) throw err;\n console.table(results);\n start();\n });\n }", "function afficheTabPatiants(){\r\n\tvar listePat = document.getElementById(\"listePatients\");\r\n\twhile (listePat.firstChild) {\r\n listePat.removeChild(listePat.firstChild);\r\n\t\t}\r\n\tvar table = document.createElement('table');\r\n\tlistePat.appendChild(table);\r\n\tvar tr = document.createElement('tr');\r\n\ttable.appendChild(tr);\r\n\ttr.innerHTML+=\"<th>\"+ \"Dossier\" + \"</th>\" + \"<th>\" + \"Nom\" + \"</th>\" + \"<th>\" + \"Prenom\" + \"</th>\" + \"<th>\" + \"Date de Nessence\" + \"</th>\" + \"<th>\" + \"Sexe\" + \"</th>\";\r\n\tfor (var i in tabPatients){\r\n\t\t\ttr = document.createElement('tr');\r\n\t\t\ttable.appendChild(tr);\r\n\t\t\tvar th = document.createElement('th');\r\n\t\t\ttr.innerHTML+=\"<th>\"+tabPatients[i].dossier + \"</th>\"+ \"<th>\"+tabPatients[i].nom + \"</th>\"+ \"<th>\"+tabPatients[i].prenom+ \"</th>\" + \"<th>\"+tabPatients[i].naissence+ \"</th>\" + \"<th>\"+tabPatients[i].sexe+ \"</th>\";\t\r\n\t}\r\n}", "function showRequisition (requisicion, table) {\n let productos = requisicion.productos;\n let numeroProductos = productos.length;\n let producto, tr;\n \n for (let i = 0; i < numeroProductos; i++) {\n producto = productos[i];\n\n tr = createRequisitionProduct (producto);\n table.appendChild(tr);\n }\n\n // crear la fila de las observaciones\n if (requisicion.observaciones != \"\") {\n producto = {\n product: requisicion.observaciones,\n cant: 1,\n unimed: \"p\",\n marcaSug: \"...\",\n enCamino: 0,\n entregado: 0,\n status: 0\n };\n \n let entregado = requisicion.observaciones.split(\"_\");\n entregado = entregado[entregado.length-1];\n if (entregado == \"entregado\") {\n producto.entregado = 1;\n producto.status = 1;\n }\n if (requisicion.comentarios != \"\") {\n producto.enCamino = 1;\n }\n \n tr = createRequisitionProduct (producto);\n table.appendChild(tr);\n }\n}", "function primeratabla() {\n\n var tbody = document.getElementById(\"senate-data\");\n\n for (var n = 0; n < members.length; n++) {\n\n var fila = document.createElement(\"tr\");\n fila.setAttribute(\"class\", members[n].party);\n\n var cellname = document.createElement(\"td\");\n var cellparty = document.createElement(\"td\");\n var cellstate = document.createElement(\"td\");\n var cellseniority = document.createElement(\"td\");\n var cellvotes = document.createElement(\"td\");\n\n var linkname = document.createElement(\"a\");\n linkname.setAttribute(\"href\", members[n].url, );\n linkname.setAttribute(\"target\", \"_blank\");\n\n var firstname = members[n].first_name;\n var middlename = members[n].middle_name;\n if (middlename == null) {\n middlename = \"\"\n }\n var lastname = members[n].last_name;\n var party = members[n].party;\n var state = members[n].state;\n var seniority = members[n].seniority;\n var totalvotes = members[n].votes_with_party_pct + \" %\";\n\n var firstcell = (firstname + \" \" + middlename + \" \" + lastname);\n\n linkname.append(firstcell);\n cellname.append(linkname);\n cellparty.append(party);\n cellstate.append(state);\n cellseniority.append(seniority);\n cellvotes.append(totalvotes);\n\n fila.append(cellname);\n fila.append(cellparty);\n fila.append(cellstate);\n fila.append(cellseniority);\n fila.append(cellvotes);\n\n tbody.append(fila);\n\n }\n// \n// if ( trMember[n].style.display == \"none\" )\n// \n// var row = document.createElement(\"tr\");\n// \n// row.append(\"there are no members for this filter\");\n// tbody.append(row);\n\n}", "function filterTable(type) {\n var usersData = '';\n if(type == 'resaler') {\n $('#platform-header').hide();\n }\n else {\n $('#platform-header').show();\n }\n var usersData = '';\n for( var i = 0; i < USERS.length; i++) {\n if(type == 'resaler') {\n if(!USERS[i].hasOwnProperty(\"Platform\")) {\n usersData += `<tr><td>${USERS[i][\"First Name\"]}</td>`;\n usersData += `<td>${USERS[i][\"Last Name\"]}</td>`;\n usersData += `<td>${USERS[i][\"Phone\"]}</td>`;\n usersData += `<td>${USERS[i][\"Email\"]}</td>`;\n usersData += `<td class=\"text-right\"><a class=\"edit-user btn btn-simple btn-warning btn-icon edit\" data-id=${USERS[i][\"id\"]} href=\"#\" data-toggle=\"modal\" data-target=\"#edit-user-modal\">\n <i class=\"material-icons\">dvr</i></a>\n <a href=\"#\" class=\"btn btn-simple btn-danger btn-icon remove\" data-id=${USERS[i][\"id\"]}>\n <i class=\"material-icons\">close</i></a></td></tr>`;\n }\n }\n else if (type == 'white-label'){\n if(USERS[i].hasOwnProperty(\"Minimum Fee\")){\n usersData += `<tr><td>${USERS[i][\"Platform\"]}`;\n usersData += `<td>${USERS[i][\"First Name\"]}</td>`;\n usersData += `<td>${USERS[i][\"Last Name\"]}</td>`;\n usersData += `<td>${USERS[i][\"Phone\"]}</td>`;\n usersData += `<td>${USERS[i][\"Email\"]}</td>`;\n usersData += `<td class=\"text-right\"><a class=\"edit-user btn btn-simple btn-warning btn-icon edit\" data-id=${USERS[i][\"id\"]} href=\"#\" data-toggle=\"modal\" data-target=\"#edit-user-modal\">\n <i class=\"material-icons\">dvr</i></a>\n <a href=\"#\" class=\"btn btn-simple btn-danger btn-icon remove\" data-id=${USERS[i][\"id\"]}>\n <i class=\"material-icons\">close</i></a></td></tr>`;\n }\n }\n else if( type == 'franchise') {\n if(USERS[i].hasOwnProperty(\"Platform\") && !USERS[i].hasOwnProperty(\"Minimum Fee\")) {\n usersData += `<tr><td>${USERS[i][\"Platform\"]}`;\n usersData += `<td>${USERS[i][\"First Name\"]}</td>`;\n usersData += `<td>${USERS[i][\"Last Name\"]}</td>`;\n usersData += `<td>${USERS[i][\"Phone\"]}</td>`;\n usersData += `<td>${USERS[i][\"Email\"]}</td>`;\n usersData += `<td class=\"text-right\"><a class=\"edit-user btn btn-simple btn-warning btn-icon edit\" data-id=${USERS[i][\"id\"]} href=\"#\" data-toggle=\"modal\" data-target=\"#edit-user-modal\">\n <i class=\"material-icons\">dvr</i></a>\n <a href=\"#\" class=\"btn btn-simple btn-danger btn-icon remove\" data-id=${USERS[i][\"id\"]}>\n <i class=\"material-icons\">close</i></a></td></tr>`;\n }\n }\n }\n $('#user-data').html(usersData);\n initTable();\n}", "function printProfs(data) {\n $('#profTableBody').empty();\n $.each(data.results, function() {\n $('<tr>').attr('id', this.prof_id).appendTo('#profTableBody');\n $('<td>').attr('class', 'text-center align-middle').html(`<img src=\"../images/prof_images/${this.photo_id}.jpg\" style=\"vertical-align: middle;width: auto;height: auto;border-radius: 50%; max-width: 50px; max-height: 50px\">`).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.prof_id).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.prof_fname).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.prof_lname).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.last_updated).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.record_created).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(`<a onclick=\"delProf(this)\"><i class=\"fas fa-trash\" style=\"font-size: 20px\"></i></a>`).appendTo('#'+this.prof_id);\n });\n}", "function habilitador() {\n\tactivos = document.getElementsByClassName('activado')\n\tfor (var i = 0; i < activos.length; i++) {\n\t\tdocument.getElementsByClassName('activado')[i].innerText = 'No pagado'\n\n\t}\n\tdesactivos = document.getElementsByClassName('desactivado')\n\tfor (var i = 0; i < desactivos.length; i++) {\n\t\tdocument.getElementsByClassName('desactivado')[i].innerText = 'Pagado'\n\t\tdocument.getElementsByClassName('desactivado')[i].setAttribute('disabled', '')\n\t}\n}", "function exibeJogadoresNaTela(jogadores) {\n var elemento = \"\";\n // preenche a tabela em HTML\n for (var i = 0; i < jogadores.length; i++) {\n elemento += \"<tr><td>\" + jogadores[i].nome + \"</td>\";\n elemento += \"<td>\" + jogadores[i].status + \"</td>\";\n elemento += \"<td>\" + jogadores[i].vitorias + \"</td>\";\n elemento += \"<td>\" + jogadores[i].empates + \"</td>\";\n elemento += \"<td>\" + jogadores[i].derrotas + \"</td>\";\n elemento += \"<td>\" + jogadores[i].pontos + \"</td>\";\n elemento +=\n \"<td><button onClick='adicionarVitoria(\" + i + \")'>Vitória</button></td>\";\n elemento +=\n \"<td><button onClick='adicionarEmpate(\" + i + \")'>Empate</button></td>\";\n /* elemento +=\n \"<td><button onClick='adicionarDerrota(\" + i + \")'>Derrota</button></td>\";\n */\n elemento +=\n \"<td><button onClick='zeraPontos(\" +\n i +\n \")'>Zera os Pontos</button></td>\";\n elemento +=\n \"<td><button onClick='removerJogador(\" +\n i +\n \")'>Remover Jogador</button></td>\";\n elemento += \"</tr>\";\n }\n // pega o campo onde sera preenchida a tabela no HTML, e o id da tabela\n var tabelaJogadores = document.getElementById(\"tabelaJogadores\");\n tabelaJogadores.innerHTML = elemento; // monstra o conteudo na tela no HTML\n}", "function mostrarJornadaEnTabla(partidos){\n\t$(\"#tabla_fixture\").empty();\n\t$.get(\"/api/user_data\", function(data, status){\n\t\tif (!jQuery.isEmptyObject(data) && data.user.editor){\n\t\t\tif(vistaEditor){\n\t\t\t\tvar cont= 0;\n\t\t\t\t$(\"#th-editar\").text(\"Editar\");\n\t\t\t\tfor(index = 0; index < partidos.length; index++){\n\t\t\t\t\tif(partidos[index].editor === data.user.google.name){\n\t\t\t\t\t\tmostrarJornadaEditor(partidos, index);\n\t\t\t\t\t\tcont++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(cont === 0){\n\t\t\t\t\tmostrarMensajeEditor();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\"#th-editar\").text(\"Estadio\");\n\t\t\t\tmostrarJornadaUsuario(partidos);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$(\"#th-editar\").text(\"Estadio\");\n\t\t\tmostrarJornadaUsuario(partidos);\n\t\t}\n\t});\n}", "function selectAllDataCore(){\n //console.log(\"create table\");\n var tableDiv = document.getElementById('fetchmemberslist');\n var table = document.createElement('table');\n table.setAttribute(\"id\", \"memberslist\");\n tableDiv.appendChild(table);\n firebase.database().ref('Users').once('value', function(AllRecords){\n AllRecords.forEach(\n function(CurrentRecord){\n var member = CurrentRecord.val().name;\n var meetuserid = CurrentRecord.val().uid;\n var boardMember = CurrentRecord.val().isAdmin;\n var guest = CurrentRecord.val().name;\n if(boardMember==false && guest != \"Guest User\"){\n AddItemsToTable(member, meetuserid);\n }\n //AddItemsToTable(member, meetuserid);\n }\n );\n });\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "function fijasAdministrativas(){\n\tdocument.getElementById(\"titleSDL\").innerHTML = \"<h1>Folios Vacantes Fijas Administrativas </h1>\";\n\tdocument.getElementById(\"SolicitudesSolicitadas\").innerHTML = \"\";\n\tdocument.getElementById(\"SolicitudesSolicitadas\").innerHTML = \"<img src='img/Loading_icon.gif'>\";\n\tsetTimeout(function(){\n\t\tdocument.getElementById(\"SolicitudesSolicitadas\").innerHTML = \"<table class='table table-striped' id='tablaEmployesSDLC'><tr class='info'><th>Fecha</th><th>Hora</th><th>Cargo</th><th>Dependencia</th><th>Titular</th><th>Motivo</th><th>Propuesta</th><th>Observaciones</th><th>Opcion</th></tr></table>\";\n\t\tdatos[0] = \"<tr><td>12/01/2017</td><td>13:18:09</td><td>Oficial III</td><td>Area Administrativa</td><td>Rodrigo Macario</td><td>Licencia Estudios</td><td>Dionicio Lopez</td><td>Papeleria Completa</td><td><a id='1' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[1] = \"<tr><td>16/01/2017</td><td>12:18:09</td><td>Comisario</td><td>Juzgado de Sentencia</td><td>Pablo Sac</td><td>Suspencion</td><td>Marcos Tax</th><td>Papeleria Completa</td><td><a id='2' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[2] = \"<tr><td>19/01/2017</td><td>11:18:09</td><td>Secretario</td><td>Area Administrativa</td><td>Raul Velasco</td><td>Traslado</td><td>Juan Carlos</td><td>Papeleria Completa</td><td><a id='3' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[3] = \"<tr><td>17/01/2017</td><td>14:18:09</td><td>Oficial II</td><td>Juzgado de Paz</th><td>Mariano Galvez</td><td>Destitucion</td><td>Pedro Barreno</td><td>Papeleria Completa</td><td><a id='4' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tdatos[4] = \"<tr><td>20/01/2017</td><td>16:18:09</td><td>Notificador</td><td>Area Administrativa</td><td>Saul Tale</td><td>Fallecimiento</td><td>Dionicio Lopez</td><td>Papeleria Completa</td><td><a id='5' onclick='verListadoFolio(this.id);' ><span class = 'glyphicon glyphicon-user'></span> Ver Folio</a></td></tr>\";\n\t\tfor(var i in datos){\n\t\t\t$(\"#tablaEmployesSDLC\").append(datos[i]);\t\n\t\t}\n\t},500);\n}", "function mostrarUsuarios() {\n function armarFilasDeUsuarios(usuario) {\n const tr = `\n <tr>\n <td>${usuario.nombre}</td>\n <td>${usuario.rol}</td>\n <td>\n <!-- Button trigger modal -->\n <button onclick=\"mostrarDetalleUsuario('${usuario.id}')\" type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#modalDetalleUsuario\"> Ver detalle </button>\n <button onclick=\"cargarModalEditar('${usuario.id}')\" class=\"btn btn-warning\" data-bs-toggle=\"modal\" data-bs-target=\"#modalEditarUsuario\">Editar</button>\n <button onclick=\"eliminarUsuario('${usuario.id}')\" class=\"btn btn-danger\">Eliminar</button>\n </td>\n </tr>\n `;\n return tr;\n }\n\n // El método map genera un array nuevo sin modificar el array original.\n // Recibe por parámetros la función que debe ejecutarse por cada elemento del array.\n const contenido = usuarios.map(armarFilasDeUsuarios);\n\n contenidoTabla.innerHTML = contenido.join('');\n}", "function listarEstudiantes(){\n\tvar tabla=\"\";\n\tvar parrafo1=$(\"#p1\");\n\t\t\t\n\ttabla+='<table id=\"tabla\">';\n\ttabla+='<tr>';\n\ttabla+='<th>ID</th>';\n\ttabla+='<th>NOMBRE</th>';\n\ttabla+='<th>NOTA</th>';\n\ttabla+='<th>EDITAR</th>';\n\ttabla+='<th>ELIMINAR</th>';\n\ttabla+='</tr>';\n\t\t\t\n\tfor(var i=0;i<localStorage.length;i++){\n\t\tvar clave=localStorage.key(i);\n\t\tvar registro=$.parseJSON(localStorage.getItem(clave));\n\t\t\t\t\n\t\ttabla+='<tr>';\n\t\ttabla+='<td id=\"td1\">'+registro.id+'</td>';\n\t\ttabla+='<td>'+registro.nombre+'</td>';\n\t\ttabla+='<td>'+registro.nota+'</td>';\n\t\ttabla+='<td><button id=\"btnR\" onclick=\"editarRegistro(\\''+registro.id+'\\');\">Editar</button></td>';\n\t\ttabla+='<td><button id=\"btnE\" onclick=\"eliminarRegistro(\\''+registro.id+'\\');\">Eliminar</button></td>';\n\t\ttabla+='</tr>';\t\t\t\t\n\t}\n\t\ttabla+='</table>';\n\t\t$(parrafo1).html(tabla);\n\t}", "function cargarTablaPrincipal() {\n\n var correoUs = localStorage.getItem(\"correosRecibidos\");\n correoUs = JSON.parse(correoUs);\n var userN = JSON.parse(localStorage.getItem('usuLog'));\n var ULog = userN.usuario;\n $(\"#datarowPrincipal\").html(\"\");\n for (var i in carRec) {\n\n var s=JSON.stringify(carRec[i]);\n var d = JSON.parse(s);\n \n var con = 0;\n\n if (d.nomUsu == ULog) {\n console.log(i);\n con += 1;\n var tbody = document.querySelector('#tablaPrincipal tbody');\n \n $(\"#datarowPrincipal\").append(\n \"<tr>\" +\n \"<td>\" + d.destino + \"</td>\" + \n \"<td>\" + d.mensaje + \"</td>\" +\n \"<td>\" + d.fecha + \"</td>\" +\n \"<th><a onclick=' loadCorPri(\"+i+\") ' data-toggle='modal' data-target='#basicExampleModal' >👁️</a></th>\" +\n \"<th><a id='\" + i + \"' class='btnEliminar' href='#' onclick='deleted(\"+i+\")' >🗑️</a></th>\" +\n \"</tr>\"\n );\n\n }\n }\n if (con == 0) {\n alertaMod(\"¡No cuentas con mensajes en esta sección!\",\"danger\"); \n \n }\n \n}", "function fill_up(){\n $(\"#content\").html(\"<img src='img/loading.gif' width='200' />\");\n $.ajax({\n type: 'POST',\n url: 'profile/getallusers',\n dataType: 'json',\n success: function(resp){\n $(\"#content\").html(\"<table><tbody></tbody></table>\");\n $(\"tbody\").append(\"<tr><td>EMAIL</td><td>NOMBRE</td><td>TELEFONO</td><td>ROL</td><td colspan='2' id='btn-new-user'>Nuevo usuario</td></tr>\");\n for(i=0;i<resp.length;i++){\n $(\"tbody\").append(\"<tr id='\"+resp[i].id_usuario+\"'>\");\n $(\"tr:last\").append(\"<td>\"+resp[i].email+\"</td>\");\n $(\"tr:last\").append(\"<td>\"+resp[i].nombre+\"</td>\");\n $(\"tr:last\").append(\"<td>\"+resp[i].telefono_contacto+\"</td>\");\n switch(resp[i].rol){\n case '1': rol=\"Admin\";\n break;\n case '2': rol=\"User\";\n break;\n case '3': rol=\"Moderator\";\n break;\n default:rol=\"Undefined\";\n break;\n }\n $(\"tr:last\").append(\"<td>\"+rol+\"</td>\");\n $(\"tr:last\").append(\"<td class='btn-edit'>Editar</td>\");\n $(\"tr:last\").append(\"<td class='btn-delete'>Borrar</td>\");\n $(\"tbody\").append(\"</tr>\");\n }\n }\n });\n }", "function agregarFilas(estados){\n $('#estado_data').DataTable().clear().draw();\n for(var i=0 ; estados[i] ; i++){\n var estado = estados[i],\n nombre = estado.nombre,\n codigo = estado.codestado,\n estatus = estado.estatus,\n nombre_pais = estado.nombre_pais;\n getFilas(nombre, codigo, estatus,nombre_pais)\n }\n $('#estado_data').DataTable().draw();\n}", "function generarTablaEntregasSinDevolucion(){\r\n document.querySelector(\"#divEntregas\").style.display = \"block\";\r\n document.querySelector(\"#divEntregas\").innerHTML = `<table id=\"tabEntregas\" border='2px' style='background-color: #FA047F; position: relative;'>\r\n <th>Alumno</th><th>Nivel</th><th>Título</th><th>Audio</th><th>Corrección</th><th>Realizar devolución</th>\r\n </table>`\r\n ;\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.Docente.nombreUsuario;\r\n if(element === usuarioLoggeado && !entregas[i].devolucion){\r\n document.querySelector(\"#tabEntregas\").innerHTML += `<tr id=\"${i}\" class=\"filaEntregasSinDev\"> \r\n <td style=\"padding: 10px\"> ${entregas[i].Alumno.nombre} </td>\r\n <td style=\"padding: 10px\"> ${entregas[i].Alumno.nivel} </td>\r\n <td style=\"padding: 10px\"> ${entregas[i].Ejercicio.titulo} </td>\r\n <td style=\"padding: 10px\"><audio controls><source src=\"${entregas[i].audPath}\"></audio></td> \r\n <td><textarea id=\"devolucion${i}\"></textarea> \r\n <td style=\"padding: 10px\"> <input type=\"button\" id=\"i${i}\" class=\"btnEntrega \"value=\"Enviar\"></td>\r\n </tr>`;\r\n }\r\n }\r\n let botones = document.querySelectorAll(\".btnEntrega\");\r\n for(let i=0; i<botones.length; i++){\r\n const element = botones[i];\r\n element.addEventListener(\"click\", realizarDevolucion);\r\n }\r\n}", "function fnc_child_cargar_valores_iniciales() {\n\tf_create_html_table(\n\t\t\t\t\t\t'grid_lista',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t'data-row_data',\n\t\t\t\t\t\t'', false, false, false\n\t\t\t\t\t\t);\n\tf_load_select_ajax(fc_frm_cb, 'aac', 'ccod_aac', 'cdsc_aac', '/home/lq_usp_ga_aac_ct_list?ic_ccod_emp=' + gc_ccod_emp + '&ic_cest=' + '1' + '&ic_load_BD=', false, '');\n}", "function pintaActivas(arreglo,filtrados){\r\n\t$('#proceso').hide();\r\n\thtml=inicio();\r\n\r\n\tvar cont=0;\r\n\tvar existe_modulo=false;\r\n\tvar submodulos_global=[];\r\n\t\r\n\tfor(var i=0;i<arreglo.length;i++){\r\n\t\tvar existe_submodulo=false;\r\n\t\tvar existe_submodulo2=false;\r\n\t\tvar existe_submodulo3 = false;\r\n\t\t$.each($(\".permisos_sub\"),function(index, value){\r\n\t\t\tif(value.value=='PRIVILEGIO.MENU.VOKSE.16=true'){\r\n\t\t\t\texiste_modulo=true;\r\n\t\t\t}\r\n\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont].estatusid+'=true'){\r\n\t\t\t\texiste_submodulo=true;\r\n\t\t\t}\r\n\t\t\tif(arreglo[i]==2){\r\n\t\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont+1].estatusid+'=true'){\r\n\t\t\t\t\texiste_submodulo2=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(arreglo[i]==3){\r\n\t\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont+1].estatusid+'=true'){\r\n\t\t\t\t\texiste_submodulo2=true;\r\n\t\t\t\t}\r\n\t\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont+2].estatusid+'=true'){\r\n\t\t\t\t\texiste_submodulo3=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tvar cadenas=filtrados[cont].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\tvar cant=\"\";\r\n\t\tvar color=\"\";\r\n\t\tvar estatusId = filtrados[cont].estatusid;\r\n\t\t\r\n\t\tif(filtrados[cont].totalSum!=undefined){\r\n\t\t\tcant=filtrados[cont].totalSum;\r\n\t\t}else{\r\n\t\t\tcant=filtrados[cont].total;\r\n\t\t}\r\n\t\t\tif(existe_submodulo==true || existe_modulo==false && filtrados[cont].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont].estatusid);\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\tif(arreglo[i]==1){\r\n\t\t\thtml=html+simple(cadenas[1] ,cant ,cadenas[0], color, estatusId, MDS_ACTIVAS);\r\n\t\t}\r\n\t\tif(arreglo[i]==2){\r\n\t\t\tvar cadenas2= filtrados[cont+1].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\t\tvar cant2= \"\";\r\n\t\t\tvar color2=\"\";\r\n\t\t\tvar estatusId2 = filtrados[cont+1].estatusid;\r\n\t\t\t\r\n\t\t\tif(filtrados[cont+1].totalSum!=undefined){\r\n\t\t\t\tcant2=filtrados[cont+1].totalSum;\r\n\t\t\t}else{\r\n\t\t\t\tcant2=filtrados[cont+1].total;\r\n\t\t\t}\r\n\t\t\tif(existe_submodulo2==true || existe_modulo==false && filtrados[cont+1].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor2=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor2=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor2=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\thtml=html+doble(cadenas[1] ,cant ,cadenas[0],color ,cadenas2[1] ,cant2 ,cadenas2[0], color2, estatusId, estatusId2, MDS_ACTIVAS);\t\r\n\t\t\t\r\n\t\t\tcont++;\r\n\t\t}\r\n\t\tif(arreglo[i]==3){\r\n\t\t\tvar cadenas2= filtrados[cont+1].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\t\tvar cant2= \"\";\r\n\t\t\tvar color2=\"\";\r\n\t\t\tvar estatusId2 = filtrados[cont+1].estatusid;\r\n\t\t\tvar cadenas3= filtrados[cont+2].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\t\tvar cant3= \"\";\r\n\t\t\tvar color3=\"\";\r\n\t\t\tvar estatusId3 = filtrados[cont+2].estatusid;\r\n\t\t\t\r\n\t\t\tif(filtrados[cont+1].totalSum!=undefined){\r\n\t\t\t\tcant2=filtrados[cont+1].totalSum;\r\n\t\t\t}else{\r\n\t\t\t\tcant2=filtrados[cont+1].total;\r\n\t\t\t}\r\n\t\t\tif(filtrados[cont+2].totalSum!=undefined){\r\n\t\t\t\tcant3=filtrados[cont+2].totalSum;\r\n\t\t\t}else{\r\n\t\t\t\tcant3=filtrados[cont+2].total;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(existe_submodulo2==true || existe_modulo==false && filtrados[cont+1].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor2=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor2=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor2=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(existe_submodulo3==true || existe_modulo==false && filtrados[cont+2].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor3=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont+2].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor3=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor3=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont+2].estatusid);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\thtml=html+triple(cadenas[1] ,cant ,cadenas[0],color ,cadenas2[1] ,cant2 ,cadenas2[0].replace('CORRECCIÓN',''), color2, estatusId, estatusId2,estatusId3, MDS_ACTIVAS,cadenas3[1] ,cant3 ,cadenas3[0].replace('CORRECCIÓN',''),color3);\t\r\n\t\t\t\r\n\t\t\tcont += 2;\r\n\t\t}\r\n\t\tcont++;\r\n\t}\r\n\tEnviaSubmodulosAction(submodulos_global);\r\n\t\r\n\t$('#proceso').html(html);\r\n\t$('.hexa').css('background-image','url(\"img/hexaverde.svg\")');\r\n\t\r\n\t$('#proceso').fadeIn();\r\n\tcierraLoading();\r\n}", "function construirTabla() {\n let tabla = document.createElement(\"table\");\n let body = document.getElementById(\"paraTablas\");\n body.appendChild(tabla);\n tabla.setAttribute(\"id\", \"table\");\n tabla.setAttribute(\"class\", \"table table-hover\");\n let trheadcabeza = document.createElement(\"thead\");\n tabla.appendChild(trheadcabeza);\n trheadcabeza.setAttribute(\"class\", \"tabla_primerFila\");\n let trhead = document.createElement(\"tr\");\n trheadcabeza.appendChild(trhead);\n let tdhead0 = document.createElement(\"td\");\n tdhead0.innerHTML = \"Número de cuota\";\n trhead.appendChild(tdhead0);\n let tdhead1 = document.createElement(\"td\");\n tdhead1.innerHTML = \"Saldo pendiente al inicio\";\n trhead.appendChild(tdhead1);\n let tdhead2 = document.createElement(\"td\");\n tdhead2.innerHTML = \"Intereses sobre saldo\";\n trhead.appendChild(tdhead2);\n let tdhead3 = document.createElement(\"td\");\n tdhead3.innerHTML = \"Saldo con intereses\";\n trhead.appendChild(tdhead3);\n let tdhead4 = document.createElement(\"td\");\n tdhead4.innerHTML = \"Cuota a pagar\";\n trhead.appendChild(tdhead4);\n let tdhead5 = document.createElement(\"td\");\n tdhead5.innerHTML = \"Remanente post pago\";\n trhead.appendChild(tdhead5);\n let tbody = document.createElement(\"tbody\");\n tabla.appendChild(tbody);\n let prestamo = datosDePrestamo.length;\n for (let i = 0; i < prestamo; i++) {\n let tr1 = document.createElement(\"tr\");\n tbody.appendChild(tr1);\n let info0 = document.createElement(\"td\");\n info0.innerHTML = i + 1;\n tr1.appendChild(info0);\n let info = document.createElement(\"td\");\n info.innerHTML = redondear(datosDePrestamo[i].capital);\n tr1.appendChild(info);\n let info4 = document.createElement(\"td\");\n info4.innerHTML = redondear(datosDePrestamo[i].intereses);\n tr1.appendChild(info4);\n let info5 = document.createElement(\"td\");\n info5.innerHTML = redondear(datosDePrestamo[i].capitalPostInt);\n tr1.appendChild(info5);\n let info2 = document.createElement(\"td\");\n info2.innerHTML = redondear(datosDePrestamo[i].cuota);\n tr1.appendChild(info2);\n let info3 = document.createElement(\"td\");\n info3.innerHTML = redondear(datosDePrestamo[i].saldoRem);\n tr1.appendChild(info3);\n }\n $(\"#paraTablas\").append(`<button id=\"solicitarPrestamo\" class=\"btn btn-dark btn-align btn-margin\" onclick=\"solicitarPrestamo()\">Solicitar prestamo</button>`)\n $(\".tablaa\").fadeIn(\"slow\");\n}", "function agregarFila(usuario) {\n let row = document.createElement('tr');\n let columnauserName = document.createElement('td');\n let columnalevelUser = document.createElement('td');\n let columnaresetUser = document.createElement('td');\n let columnaviplevelUser = document.createElement('td');\n let columnaAcciones = document.createElement('td');\n columnaAcciones.classList.add('row');\n columnaAcciones.classList.add('table-acciones');\n columnaAcciones.classList.add('d-flex');\n columnaAcciones.classList.add('justify-content-between');\n columnaAcciones.id = 'table-acciones';\n columnauserName.innerHTML = usuario.thing.userName;\n columnalevelUser.innerHTML = usuario.thing.levelUser;\n columnaresetUser.innerHTML = usuario.thing.resetsUser;\n columnaviplevelUser.innerHTML = usuario.thing.viplevelUser;\n let btnEliminar = document.createElement('button');\n btnEliminar.innerHTML = \"Eliminar\";\n btnEliminar.id = 'btnEliminar';\n btnEliminar.classList.add('btn');\n btnEliminar.classList.add('btn-danger');\n btnEliminar.classList.add('col-xs-12');\n btnEliminar.classList.add('col-md-6');\n btnEliminar.addEventListener('click', (e) => {\n e.preventDefault();\n eliminar(usuario._id);\n });\n columnaAcciones.appendChild(btnEliminar);\n let btnEditar = document.createElement('button');\n btnEditar.innerHTML = \"Editar\";\n btnEditar.id = 'btnEditar';\n btnEditar.classList.add('btn');\n btnEditar.classList.add('btn-warning');\n btnEditar.classList.add('col-xs-12');\n btnEditar.classList.add('col-md-6');\n btnEditar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = true;\n columnauserName.innerHTML = \"<input type='text' id='userNameedit' class='col' value=\" + `${usuario.thing.userName}` + \">\";\n columnalevelUser.innerHTML = \"<input type='text' id='levelUseredit' class='col' value=\" + `${usuario.thing.levelUser}` + \">\";\n columnaresetUser.innerHTML = \"<input type='text' id='resetUseredit' class='col' value=\" + `${usuario.thing.resetsUser}` + \">\";\n columnaviplevelUser.innerHTML = \"<input type='text' id='viplevelUseredit' class='col' value=\" + `${usuario.thing.viplevelUser}` + \">\";\n let btnTerminar = document.createElement('button');\n btnTerminar.innerHTML = \"Terminar\";\n btnTerminar.id = 'btnTerminar';\n btnTerminar.classList.add('btn');\n btnTerminar.classList.add('btn-success');\n btnTerminar.classList.add('col-xs-12');\n btnTerminar.classList.add('col-md-6');\n btnTerminar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = false;\n let nuevousuario = {\n \"userName\": document.querySelector(\"#userNameedit\").value,\n \"levelUser\": parseInt(document.querySelector(\"#levelUseredit\").value),\n \"resetsUser\": parseInt(document.querySelector(\"#resetUseredit\").value),\n \"viplevelUser\": parseInt(document.querySelector(\"#viplevelUseredit\").value),\n }\n editar(usuario._id, nuevousuario);\n\n });\n columnaAcciones.appendChild(btnTerminar);\n btnEditar.style.display = \"none\";\n });\n columnaAcciones.appendChild(btnEditar);\n row.appendChild(columnauserName);\n row.appendChild(columnalevelUser);\n row.appendChild(columnaresetUser);\n row.appendChild(columnaviplevelUser);\n row.appendChild(columnaAcciones);\n tableBody.appendChild(row);\n\n //oculta los botones si la sesion no esta iniciada\n if (sesioniniciada === false) {\n let acc = document.querySelector(\"#table-acciones\");\n acc.style.display = 'none';\n let btnsEliminar = document.querySelectorAll(\"#btnEliminar\");\n btnsEliminar.forEach(botonEL => {\n botonEL.style.display = \"none\";\n });\n let btnsEditar = document.querySelectorAll(\"#btnEditar\");\n btnsEditar.forEach(botonED => {\n botonED.style.display = \"none\"\n });\n };\n }", "function obtener_cursos_guardados() {\n var consulta = conexion_ajax(\"/servicios/dh_cursos.asmx/obtener_datos_cursos\")\n $(\".datos_curso\").remove()\n $.each(consulta, function (index, item) {\n\n var filla = $(\"<tr class='datos_curso'></tr>\")\n filla.append($(\"<td></td>\").append(item.id_curso).css({\"width\":\"30px\",\"text-align\":\"center\"}))\n filla.append($(\"<td></td>\").append(item.nombre_curso))\n filla.append($(\"<td></td>\").append(item.puesto_pertenece).css({ \"text-align\": \"center\" }))\n filla.append($(\"<td></td>\").append(\n (function (valor) {\n var dato;\n $(\"#puestos option\").each(function (index, item) {\n if (valor == parseInt($(this).attr(\"name\")))\n dato = $(this).val();\n })\n return dato;\n }(item.puesto_pertenece))\n ))\n filla.append($(\"<td></td>\").append(\n (function (estatus) {\n if (estatus == \"v\" || estatus==\"V\")\n return \"vigente\";\n else if (estatus == \"c\" || estatus == \"C\")\n return \"cancelado\"\n else return \"indefinido\"\n }(item.estatus))\n ).css({ \"text-align\": \"center\" }))\n $(\"#tabla_cursos\").append(filla)\n })\n filtrar_tabla_cursos();\n //funcion onclick tabla Cursos\n $(\".datos_curso\").on(\"click\", function () {\n Habilitar_bloquear_controles(true);\n var consulta = { \n id_curso: \"\"\n , nombre_curso: \"\"\n , estatus: \"\"\n , puesto_pertenece: \"\"\n };\n $(this).children(\"td\").each(function (index, item) {\n switch (index) {\n case 0:\n consulta.id_curso = $(this).text();\n case 1:\n consulta.nombre_curso = $(this).text();\n case 3:\n consulta.puesto_pertenece = $(this).text();\n case 4:\n consulta.estatus = $(this).text();\n } \n })\n\n $(\"#folio_curso\").val(consulta.id_curso)\n $(\"#Nombre_curso\").val(consulta.nombre_curso)\n $(\"#estatus_cusro\").val(\n (function (estatus) {\n if (estatus == \"vigente\")\n return \"V\";\n else if (estatus == \"cancelado\")\n return \"C\"\n else return \"\"\n }(consulta.estatus))\n )\n $(\"#selector_puestos\").val(consulta.puesto_pertenece)\n $(\".datos_curso\").removeClass(\"seleccio_curso\")\n $(this).toggleClass(\"seleccio_curso\")\n // checar_imagen_cambio();\n obtener_imagen()\n })\n \n}", "function newUsers () {\n var o13male = 0, o13female = 0, o13undisclosed = 0, u13undisclosed = 0, u13male = 0, u13female = 0, adults = [], o13 = [], u13 = [];\n userDB('sys_user').select('init_user_type', 'id').where('when', '>', monthAgo.format(\"YYYY-MM-DD HH:mm:ss\")).then( function (rows) {\n for (var i in rows) {\n if ( _.includes(rows[i].init_user_type, 'attendee-o13')) {\n o13.push(rows[i].id);\n } else if ( _.includes(rows[i].init_user_type, 'attendee-u13')) {\n u13.push(rows[i].id);\n } else if ( _.includes(rows[i].init_user_type, 'parent-guardian')) {\n adults.push(rows[i].id);\n }\n }\n userDB('cd_profiles').select('user_id', 'gender').then( function (rows) {\n for (var i in o13) {\n for (var j = 0; j< rows.length; j++) {\n if (_.includes(rows[j], o13[i]) && _.includes(rows[j], 'Male')) {\n o13male++;\n j = rows.length;\n } else if (_.includes(rows[j], o13[i]) && _.includes(rows[j], 'Female')) {\n o13female++;\n j = rows.length;\n } else if (_.includes(rows[j], o13[i]) && !_.includes(rows[j], 'Male') && !_.includes(rows[j], 'Female')) {\n o13undisclosed++;\n j = rows.length;\n }\n }\n }\n for (var i in u13) {\n for (var j = 0; j< rows.length; j++) {\n if (_.includes(rows[j], u13[i]) && _.includes(rows[j], 'Male')) {\n u13male++;\n j = rows.length;\n } else if (_.includes(rows[j], u13[i]) && _.includes(rows[j], 'Female')) {\n u13female++;\n j = rows.length;\n } else if (_.includes(rows[j], u13[i]) && !_.includes(rows[j], 'Male') && !_.includes(rows[j], 'Female')) {\n u13undisclosed++;\n j = rows.length;\n }\n }\n }\n fs.appendFileSync(filename, '\\nNew users in the past ' + interval + ' days\\n');\n fs.appendFileSync(filename, 'Ninjas under 13 ' + u13.length + '\\n');\n fs.appendFileSync(filename, 'Male ' + u13male + ', female ' + u13female + ' Undisclosed ' + u13undisclosed + '\\n');\n fs.appendFileSync(filename, 'Ninjas over 13 ' + o13.length + '\\n');\n fs.appendFileSync(filename, 'Male ' + o13male + ', female ' + o13female + ' Undisclosed ' + o13undisclosed + '\\n');\n fs.appendFileSync(filename, 'Adults ' + adults.length + '\\n');\n console.log('that stupid long one is done, i blame the db');\n return true;\n }).catch(function(error) {\n console.error(error);\n });\n }).catch(function(error) {\n console.error(error);\n });\n}", "function loadtableActivePatrolBD() {\r\n\r\nvar newtable = '<table id=\"example_ActivePatrolBD\" class=\"display compact\" cellspacing=\"0\" width=\"100%\" height=\"100%\"><thead><tr><th></th><th>Patrol Name</th><th>Job Role</th><th>Payroll No</th><th>Call Sign</th><th>Mobile No</th><th>Region</th><th>Cell Number</th><th>Cell Type</th><th>Cluster</th><th>Service Delivery Manager</th><th>Patrol Team Manager</th><th>Agreement Type</th><th>Cost Centre</th><th>Regional Operations Manager</th></tr></thead><tfoot><tr><th></th><th>Patrol Name</th><th>Job Role</th><th>Payroll No</th><th>Call Sign</th><th>Mobile No</th><th>Region</th><th>Cell Number</th><th>Cell Type</th><th>Cluster</th><th>Service Delivery Manager</th><th>Patrol Team Manager</th><th>Agreement Type</th><th>Cost Centre</th><th>Regional Operations Manager</th></tfoot>';\r\n\r\nvar rows = $(\"#patrol\").dataTable().fnGetNodes();\r\n\r\nfor (var i=0; i<rows.length; i++){\r\nnewtable = newtable + '<tr>'+$(rows[i]).html()+'</tr>';\r\n}\r\nnewtable = newtable + '</table>';\r\n$('#ActivePatrolBD_div').find('img').find('loading').remove();\r\n$('#ActivePatrolBD_div').html(newtable);\r\ntabs.tabs( \"refresh\" );\r\n\r\n$('#example_ActivePatrolBD').DataTable({\r\n \"columnDefs\": [\r\n\t{ \"visible\": false, \"targets\": 13 },\r\n\t{ \"visible\": false, \"targets\": 14 },],\r\n \"displayLength\": -1,\r\n\t}); \r\n \r\n} // loadTableActivePatrolBD() ends", "function infotable()\n {\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token]').attr('content')\n }\n });\n $.ajax({\n type: \"POST\",\n url: url_prev + 'obtenerUsuariosEmpresa',\n data: {\n _token: $('input[name=\"_token\"]').val()\n } //esto es necesario, por la validacion de seguridad de laravel\n }).done(function(msg) {\n // se incorporan las opciones en la comuna\n var json = JSON.parse(msg);\n var html;\n \n for (let [key, value] of Object.entries(json.datos)) {\n if(json.datos[key].id != json.id)\n {\n html += \"<tr><td>\"+json.datos[key].nombre+\"</td><td>\"+json.datos[key].email+\"</td><td>\"+json.datos[key].fono+\"</td><td>\"+json.datos[key].cargo+\"</td><td>\"+json.datos[key].empresa+\"</td><td><button class='btn btn-warning editarfin ml-1' id='editarinfo\"+json.datos[key].id+\"' onclick='confirmarEliminacion(\"+json.datos[key].id+\")' disabled><i class='fas fa-edit' aria-hidden='true'></i></button><button class='btn btn-info ml-1' id='cancelar\"+json.datos[key].id+\"' onclick='cancelaredit(\"+json.datos[key].id+\")' disabled><i class='fas fa-window-close' aria-hidden='true'></i></button></td></tr>\";\n }\n\n \n $(\"#bodytabla\").html(\"\");\n $(\"#bodytabla\").html(html);\n \n var table = $('#tabla_usuarios').DataTable( {\n retrieve : true,\t\t\t\t \t\n paging\t\t\t: true,\n pageLength\t\t: 10,\n order \t\t\t: [],\n fixedHeader : true,\n responsive : true,\n autoWidth : true,\n scrollX : 'true',\n //scrollY : '850px',\n scrollCollapse: true,\n } );\n $('[data-toggle=\"tooltip\"]').tooltip();\n console.log(`${key}: ${json.datos[key].id}`);\n }\n \n }).fail(function(){\n console.log('Error en infotable()');\n });\n }", "function FilterByGrupo() {\n var number_alumnos = 0;\n Alumnos.forEach(alumno => {\n if (document.getElementById(alumno.alu_id) && document.getElementById(alumno.alu_id).nodeName == \"TR\") {\n var record = document.getElementById(alumno.alu_id);\n record.remove(record.parentNode);\n }\n\n if (document.getElementById('GrupoAlumnos').value == alumno.gru_id) {\n CreateRecord(alumno.alu_id, alumno.alu_app, alumno.alu_apm, alumno.alu_nom);\n number_alumnos++;\n }\n\n });\n\n cant_alumnos = number_alumnos;\n setCantAlumnos(number_alumnos);\n}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function popTable(){\n\tvar x = \"\";\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name != undefined){\n\t\t\tx += \"<tr class='EditRow' onclick='EditUser()'>\" + \"<td onclick='passName(this.innerText)'>\" + currentProject.members[i].name + \"</td>\";\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tx += \"<td class='mrole'>\" + currentProject.members[i].role[j] + \"</td>\" + \"</tr>\";\n\t\t\t}\n\t\t}\n\t}\n\tdocument.getElementById(\"bod\").innerHTML = x;\n}", "makeUserTable() {\n let infoSelected = this.checkSelected.map(checkBoxValue => this.checkData.find(checkBox => checkBox.value === checkBoxValue).text); //Get the text key of the checkbox selected to used on titles of the table\n this.tableTitlesMod = [\"Name\", ...infoSelected];\n this.tableKeysMod = [\"first_name\" , ...this.checkSelected];\n }", "function getListTramites() {\n if (vm.usuarioOficina == \"rc\") {\n if (vm.usuarioTramites == 'A') {\n fire.ref('rh/tramites/registroyControl').orderByChild('tipoUsuario').equalTo('A').on('value', function(snapshot){\n vm.listaTramites = snapshot.val();\n $rootScope.$apply();\n });\n }\n else{\n if (vm.usuarioTramites == 'B') {\n fire.ref('rh/tramites/registroyControl').orderByChild(\"tipoUsuario\").equalTo(\"B\").on('value', function(snapshot){\n vm.listaTramites = snapshot.val();\n $rootScope.$apply();\n });\n }\n }\n }\n else{\n if (vm.usuarioOficina == \"sp\") {\n fire.ref('rh/tramites/serviciosalPersonal').on('value', function(snapshot){\n vm.listaTramites = snapshot.val();\n });\n }\n }\n }", "function actTable() {\n\tif(scholar.scholarship.confirmDispersion != \"\"){\n\t\t$(\"#accordion-deposit\").parent().show();\n\t\t$(\"#accordion-deposit\").show();\n\t\t$(\"#tableConfirm > tbody tr td\").remove();\n\n\t scholar.scholarship.confirmDispersion.forEach(function (confirms){\n\t $(\"#tableConfirm > tbody tr:last\").after('<tr><td class=\"text-center\">'+confirms.monthConfirm+\" \"+confirms.yearConfirm+'</td>');\n\n\t if (confirms.statusScholarshipReceived === \"Incompleta\") $(\"td:last\").after('<td class=\"text-center warning\">Dep&oacute;sito incompleto</td>');\n\t else if (confirms.statusScholarshipReceived === \"No\") $(\"td:last\").after('<td class=\"text-center error\">Sin dep&oacute;sito</td>');\n\t else if (confirms.statusScholarshipReceived === \"Sí\") $(\"td:last\").after('<td class=\"text-center success\">'+\"Dep&oacute;sito completo\"+'</td>');\n\n\t if (confirms.statusReview === \"En proceso\") $(\"td:last\").after('<td class=\"text-center warning\">'+confirms.statusReview+'</td>');\n\t else $(\"td:last\").after('<td>'+confirms.statusReview+'</td>');\n\n\t if (confirms.staffAnswer === \"En proceso\") $(\"td:last\").after('<td class=\"text-center warning\">'+confirms.staffAnswer+'</td>');\n\t else if (confirms.staffAnswer === \"Resuelto\") $(\"td:last\").after('<td class=\"text-center success\">'+confirms.staffAnswer+'</td>');\n\t else $(\"td:last\").after('<td class=\"text-center\">'+confirms.staffAnswer+'</td>');\n\n\t });\n\t}else {\n\t\t$(\"#accordion-deposit\").parent().hide();\n\t\t$(\"#accordion-deposit\").hide();\n\t}\n}", "function usuario_activo() {\n $.ajax({\n url: 'controlador/sesion/usuarioActivo.php',\n dataType: 'json',\n type: 'GET',\n success: function(data){ \n $.each(data,function(k, registro) {\n $(\"#usuario_activo\").html('<span class=\"glyphicon glyphicon-user mr-2\"></span>' + registro.nombre);\n //console.log( 'nombre usuario activo = '+ registro.nombre );\n });\n },\n error: function(data) {\n alert('error al obtener el ususario activo '+data);\n }\n });\n }", "function carregarTabelaProjetos() {\n for (var i = 0; i < arrayProjects.length; i++) {\n $(\"#projectsTableBody\").append('<tr id=\"projId' + arrayProjects[i].id + '\"><td>' + arrayProjects[i].titulo + '</td><td class=\"tituloProjeto\">' + arrayProjects[i].categoria + '</td><td>' + arrayProjects[i].autor + '</td></tr>');\n }\n}", "static async getProfesoresForIc(idIc, idanio_lectivo) {\n\n //cursos para inspector de curso\n //let cursos = await db.query('SELECT idcurso FROM curso WHERE user_iduser = ? AND cur_estado = 1', [idIc]);\n let cursos = await Curso.getCursosForIc(idIc, idanio_lectivo);\n //Consulta para obtener las materias, cursos y profesores\n\n var sql = [];\n if (cursos.length > 0) {\n for (let index = 0; index < cursos.length; index++) {\n let mhc = await db.query(`\n SELECT \n idfuncionario,\n idmaterias_has_curso,\n profesor_idprofesor,\n fun_nombres,\n idmaterias,\n mat_nombre,\n cur_curso,\n idcurso\n FROM materias_has_curso\n INNER JOIN funcionario on funcionario.idfuncionario = materias_has_curso.profesor_idprofesor\n INNER JOIN materias on materias.idmaterias = materias_has_curso.materias_idmaterias\n INNER JOIN curso on curso.idcurso = materias_has_curso.curso_idcurso\n WHERE materias_has_curso.curso_idcurso = ?\n AND mat_has_cur_estado = 1 \n AND mat_has_curso_idanio_lectivo = ?\n `, [cursos[index].idcurso, idanio_lectivo]);\n\n if (mhc.length > 0) {\n mhc.forEach(element => {\n sql.push(element);\n });\n }\n }\n }\n\n return sql\n //return cursos\n }", "function cargaLista () {\n setTimeout(esperehide, 1000);\n setTimeout(function(){\n $(\"#tabla > thead > tr > th:last-child\").removeClass('sorting');\n }, 200);\n $(\"#tabla > thead > tr > th:last-child\").on('click', desactivarAccion);\n $(\".new-reg\").on(\"click\", nuevoVolver);\n $(\".acciones\").on(\"click\", accionRegistro);\n}", "function crearTablaAscensorValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaConsecutivoPuertas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE consecutivo_puertas (k_codusuario, k_consecutivo unique, n_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function listaNotificaciones(){\r\n\t\r\n\t$.ajax({\r\n url: \"dameUsuarios\"\r\n }).then(function(data) {\r\n \r\n \tif (data.userExist){\r\n\t\t\t\t\r\n \t\tvar textoHTML=\"\";\r\n \t\ttextoHTML += \"<div>\";\r\n \t\ttextoHTML += \"\";\r\n \t\ttextoHTML += \"<table id=\\\"mitabla\\\" class=\\\"table table-hover table-striped table-condensed table-responsive\\\" cellspacing=\\\"0\\\" width=\\\"100%\\\">\";\r\n \t\ttextoHTML += \"\t<thead>\";\r\n \t\ttextoHTML += \"\t\t<tr style='text-align:center; background-color:#222; color:#FFF;'>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-2'>Nombre<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-3'>Apellidos<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-3'>Email<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Login<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Clave<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Rol<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Enviar<\\/th>\";\r\n \t\ttextoHTML += \"\t\t<\\/tr>\";\r\n \t\ttextoHTML += \"\t<\\/thead>\";\r\n \t\t \t\t\r\n \t\ttextoHTML += \"\t<tbody>\";\r\n \t\t\r\n \t\tfor(var elm = 0;elm < data.listaUsuarios.length;elm++){\r\n \t\t\r\n \t\ttextoHTML += \"\t\t<tr>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].name+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].surname+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].email+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].login+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].password+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].rol.rolName+\"<\\/td>\";\r\n \t\t\r\n \t\ttextoHTML+=\"\t\t\t<td style='text-align:center'><button type='button' onclick='notificaUsuario(\\\"\"+data.listaUsuarios[elm].email+\"\\\")'\"\r\n\t\t\ttextoHTML+=\"\t\t\tclass='btn btn-info btn-xs' style='width:50px; height:30px'><span class='glyphicon glyphicon-envelope'></span></button></td>\"\r\n \t\t\r\n \t\ttextoHTML += \"\t\t<\\/tr>\";\r\n \t\t\r\n \t\t}\r\n \t\t\r\n \t\ttextoHTML += \"\t<\\/tbody>\";\r\n \t\ttextoHTML += \"<\\/table>\";\r\n \t\r\n\t\t\tdocument.getElementById(\"usuarioContent\").innerHTML=textoHTML;\r\n\t\t\t\r\n\t\t\t$('#mitabla').DataTable( {\r\n\t\t \"language\": {\r\n\t\t \r\n\t\t \t\"url\": \"bootstrap/js/spanish.json\"\r\n\t\t \t// \"url\": \"//cdn.datatables.net/plug-ins/1.10.12/i18n/Spanish.json\"\r\n\t\t } \r\n\t\t } );\t\r\n\t\t}\r\n \telse{\r\n \t\t\r\n \t\tif(data.errorConexion){\r\n \t\t\t\r\n \t\t\talertaConexion()\t\r\n \t\t}\r\n \t\telse{\r\n \t\t\t\r\n \t\t\tlistaVacia();\r\n \t\t}\r\n \t\t\r\n \t\t\r\n \t}\r\n });\t\t\r\n}", "function updateTableView() {\n status_array = [\n \"active\",\n \"private_active\",\n \"inactive\",\n \"private_inactive\",\n \"finished\",\n \"private_finished\",\n \"archived\"\n ]\n\n for (var i = 0; i < status_array.length; i++) {\n status = status_array[i]\n\n var tableRef = $(\"#projectsTable-\"+status).DataTable();\n var rows = tableRef\n .rows()\n .remove()\n .draw();\n getProjects(status)\n }\n\n console.log('updated table view')\n}", "function printPersonaje() {\n \n for (var i = 0; i < personajesList.length; i++) {\n \n var tableBody = document.getElementById('tableBody');\n \n var tr = document.createElement('tr');\n tableBody.append(tr);\n \n var tdVacio = document.createElement('td');\n tdVacio.textContent = \" \"\n tr.append(tdVacio);\n \n var tdName = document.createElement('td');\n tdName.textContent = personajesList[i].name\n tr.append(tdName);\n \n var tdGender = document.createElement('td');\n tdGender.textContent = personajesList[i].gender\n tr.append(tdGender);\n \n var tdHeight = document.createElement('td');\n tdHeight.textContent = personajesList[i].height\n tr.append(tdHeight);\n \n var tdMass = document.createElement('td');\n tdMass.textContent = personajesList[i].mass\n tr.append(tdMass);\n \n var tdEye_color = document.createElement('td');\n tdEye_color.textContent = personajesList[i].eye_color\n tr.append(tdEye_color); \n \n var button = document.createElement('button')\n button.className = 'btn btn-danger';\n button.textContent = 'Eliminar';\n tr.append(button);\n button.dataset.id = i;\n };\n }", "function afficherProfil(tx){\n alert(\"afficher profil\");\n tx.executeSql('SELECT * FROM UTILISATEUR',[],querySuccess,errorCB);\n}", "function _AtualizaTalentos() {\n // Talentos de classe.\n for (var chave_classe in gPersonagem.talentos) {\n var div_talentos_classe = Dom('div-talentos-' + chave_classe);\n var lista_classe = gPersonagem.talentos[chave_classe];\n var div_selects = Dom('div-talentos-' + chave_classe + '-selects');\n if (lista_classe.length > 0 || chave_classe == 'outros') {\n ImprimeNaoSinalizado(\n lista_classe.length,\n Dom('talentos-' + chave_classe + '-total'));\n for (var i = 0; i < lista_classe.length; ++i) {\n _AtualizaTalento(\n i, // indice do talento.\n lista_classe[i],\n i < div_selects.childNodes.length ?\n div_selects.childNodes[i] : null,\n chave_classe,\n div_selects);\n }\n // Se tinha mais talentos, tira os que estavam a mais.\n for (var i = 0; div_selects.childNodes.length > lista_classe.length; ++i) {\n RemoveUltimoFilho(div_selects);\n }\n div_talentos_classe.style.display = 'block';\n } else {\n div_talentos_classe.style.display = 'none';\n RemoveFilhos(div_selects.childNodes);\n }\n }\n}", "function crearContenidoTabla(members){\n\tvar table = '<thead class=\"thead\"><tr><th>Full name</th><th>Party</th><th>State</th><th>Seniority</th><th>Percentage of votes whith party</th></tr></thead>';\n\t\n\ttable += '<tbody>';\n\t\n\tmembers.forEach(function(member){\n\t\ttable += '<tr>';\n\t\tif(member.middle_name === null){\n\t\t\ttable += '<td ><a href =\"' +member.url+ '\">' + member.first_name+' '+member.last_name+'</td>';\n\t\t}else{\n\t\t\ttable +='<td><a href=\"' +member.url+ '\">'+member.first_name+' '+member.middle_name+' '+member.last_name+'</td>';\n\t\t}\n\ttable += '<td class=\"party\">'+member.party+'</td>';\n\ttable += '<td class=\"state\">'+member.state+'</td>';\n\ttable += '<td>'+member.seniority+'</td>';\n\ttable += '<td>% '+member.votes_with_party_pct+'</td>';\n\ttable += '</tr>';\n\t})\n\ttable += '</tbody>';\n\treturn table;\n}", "function mostrarEstudiantes(){\n document.getElementById('alumnos').style.display = \"table\";\n var notasTBody = document.getElementById('notas');\n\n while(notasTBody.hasChildNodes()){\n notasTBody.removeChild(notasTBody.lastChild);\n }\n\n for(var i = 0; i < estudiantes.length; ++i){\n var nuevoTr = document.createElement('tr');\n\n var idTd = document.createElement('td');\n idTd.textContent = estudiantes[i].codigo;\n nuevoTr.appendChild(idTd);\n\n var nombreTd = document.createElement('td');\n nombreTd.textContent = estudiantes[i].nombre;\n nuevoTr.appendChild(nombreTd);\n\n var notaTd = document.createElement('td');\n notaTd.textContent = estudiantes[i].nota;\n nuevoTr.appendChild(notaTd);\n\n notasTBody.appendChild(nuevoTr);\n }\n}", "async listTables() {\n try {\n\n //Lista de mesas\n let listTables = [];\n\n //Obtiene el numero de mesas que hay registradas en el contrato ElectoralProcessContract\n let numTables = await this.state.electoralContract.methods.getNumberTables().call({ from: this.state.account });\n\n //Itera el numero de mesas para obtener datos sobre las mismas\n for (let i = 0; i < numTables; i++) {\n\n //Obtiene la mesa i del contrato ElectoralProcessContract\n let datos = await this.state.electoralContract.methods.getTable(i).call({ from: this.state.account })\n\n //Aniade la tabla al array de mesas\n listTables.push({\n \"address\": datos[0],\n \"codeTable\": datos[1],\n });\n }\n\n //Actualiza el array de mesas del state de React\n this.setState({\n listTables: listTables\n });\n\n } catch (error) {\n if (error.message.includes(\"user denied\")) {\n this.notify(\"Notificación\", \"info\", \"Acción cancelada por el usuario\");\n\n } else {\n this.notify(\"Error\", \"danger\", error.message);\n }\n }\n }", "function readAllProds() {\n $(\"#tableProd td\").remove(); //destroi tabela e remonta\n listAllItems(\"produtos\", showProd);\n}", "function selectEventi(evt, tipoRecensione, tipoProfilo) {\r\n var i, tabcontent, button;\r\n \r\n // Prendo tutti gli elementi con class=\"tabcontent\" and li nascondo\r\n tabcontent = document.getElementsByClassName(\"tabcontent\" + tipoProfilo);\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n \r\n // Prendo tutti gli elementi con class=\"button\" e rimuovo la classe \"active\"\r\n button = document.getElementsByClassName(\"btn-profilo\");\r\n for (i = 0; i < button.length; i++) {\r\n button[i].className = button[i].className.replace(\" active\", \"\");\r\n }\r\n \r\n // Mostro la tab corrente e aggiungo un \"active\" class al bottone che ha aperto tab\r\n $(\".\" + tipoRecensione + tipoProfilo).css(\"display\",\"block\");\r\n evt.currentTarget.className += \" active\";\r\n \r\n if(tipoRecensione=='OspitatoProfilo'){\r\n $(\".OspitatoProfilo\" + tipoProfilo).empty(); //svuoto la tab\r\n appendRecensioni('Ospitato',tipoProfilo);\r\n }\r\n \r\n else if(tipoRecensione=='OspitanteProfilo'){\r\n $(\".OspitanteProfilo\" + tipoProfilo).empty();//svuoto la tab\r\n appendRecensioni('Ospitante',tipoProfilo);\r\n }\r\n}", "function generarTablaEj (){\r\n buscarEjXNivDocEntrega();\r\n document.querySelector(\"#divEjalumnos\").innerHTML = `<table id=\"tabEjAlumno\" border='2px' style='background-color: #FA047F; position: relative;'>\r\n <th>Título</th><th>Docente</th><th>Nivel</th>`;\r\n for(let iterador = 0; iterador<= ejerciciosAMostrar.length-1; iterador ++){\r\n document.querySelector(\"#tabEjAlumno\").innerHTML += `<tr id=\"${iterador}\" class=\"filaEjercicioAlumno\"> <td style=\"padding: 10px\"> ${ejerciciosAMostrar[iterador].titulo} </td> <td style=\"padding: 10px\"> ${ejerciciosAMostrar[iterador].Docente.nombre} </td><td style=\"padding: 10px\"> ${ejerciciosAMostrar[iterador].nivel} </td> </tr>`;\r\n }\r\n addEventsTablaEj();\r\n}", "function aplicarGatilhosTabela(){\n\n tabela.find('[data-crud-create]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-create');\n\n self.abrirPostForm( form_url );\n\n });\n\n tabela.find('[data-crud-update]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-update');\n\n var object_id = $(this).closest('tr').attr('data-object-id');\n\n self.abrirPatchForm( form_url, object_id );\n\n });\n\n tabela.find('[data-crud-read]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-read');\n\n var object_id = $(this).closest('tr').attr('data-object-id');\n\n self.abrirGetForm( form_url, object_id );\n\n });\n\n tabela.find('[data-crud-drop]').unbind('click').on('click', function(){\n\n var form_url = $(this).attr('data-crud-drop');\n\n var object_id = $(this).closest('tr').attr('data-object-id')\n\n self.abrirDeleteForm( form_url, object_id );\n\n });\n\n tabela.unbind('click', '.bostable_select_all_checkbox').on('click', '.bostable_select_all_checkbox', function(){\n\n if(this.checked){\n\n tabela.find('.bostable_select_row_checkbox').prop('checked', true);\n\n } else {\n\n tabela.find('.bostable_select_row_checkbox').prop('checked', false);\n\n }\n\n });\n\n }", "function crearActividad() {\n\tvar name = document.getElementById(\"nombreActividad\").value;\n\tvar duracion = document.getElementById(\"duracion\").value;\n\tvar selectorSala = document.getElementById(\"selectorSala\");\n\tvar sala = selectorSala.options[selectorSala.selectedIndex].value;\n\n\tif (name == \"\" || duracion == \"\" || sala == \"\"){ // Si falta algun dato no creamos la actividad\n\t\talert(\"Rellene todos los campos de la actividad\");\n\t\treturn false;\n\t}\n\t\t\n\n\tvar actividad = new Actividad(name, duracion, sala);\n\tvectorActividades.push(actividad);\n\talert(\"Actividad creada correctamente\");\n\n\t// reseteamos los controles\t\n\tvar inputNombre = document.getElementById(\"nombreActividad\");\n\tinputNombre.value = \"\";\n\n\tvar inputDuracion = document.getElementById(\"duracion\");\n\tinputDuracion.value = \"\";\n\n\tvar tablaActividades = document.getElementById(\"actividades\");\n\n\tvar nuevaActividad = tablaActividades.insertRow(-1);\n\t\tnuevaActividad.innerHTML = \"<td>\" + actividad.nombre + \"</td><td>\" \n\t\t+ actividad.duracion + \"</td>\"\n\t\t+ \"<td>\" + actividad.sala + \"</td>\";\n\n\treturn true;\n}", "function dibujar(tabler, estado){\n //console.clear();\n if(estado)\n console.log(\"Player 1:\")\n else\n console.log(\"Player 2:\")\n for (let f = 0; f < 3; f++) { \n console.log(tabler[f][0] + \"|\"+ tabler[f][1] + \"|\" + tabler[f][2] );\n }\n}", "function updatePlayersTable(obj) {\n\tconst table = document.getElementById('currentPlayers');\n\n\tlet tableBody = '';\n\tfor (let i = 0; i < obj['sessionPlayers'].length; ++i) {\n\t\ttableBody += '<tr>' +\n '<th>' + obj['sessionPlayers'][i] + '</th>' +\n '<td>' + obj['playersVictories'][i] + '</td>' +\n '</tr>';\n\t}\n\n\ttable.innerHTML = tableBody;\n}", "async function getUsers(){\n try{\n let rows = await knex('users');\n let tab = []; \n let i=0;\n for (var r of rows) {\n tab[i]=r.login; i++;\n tab[i]=r.password; i++;\n tab[i]=r.nom; i++;\n tab[i]=r.prenom; i++;\n tab[i]=r.partiesGagnees; i++;\n tab[i]=r.partiesPerdues; i++;\n tab[i]=r.etat; i++;\n }\n return tab;\n }\n catch(err){\n console.error('Erreur dans l\\'affichage des éléments de la table users'); \n }\n}", "function informacionUsuarios(){\n $.ajax({\n url: \"https://localhost:3000/volvo/api/GU/GU_GESTION_USUARIOS\",\n headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')},\n data: {\n \"accion\" : 'SELECT',\n \"idEstadoUsuario\" : $('#selectEstadoUsuario').val(),\n \"idAreaTrabajo\" : $('#selectAreaTrabajo').val()\n\n },\n dataType: \"json\",\n method: \"POST\",\n success: function(respuesta){\n if(respuesta.output.pcodigoMensaje == 0){\n for(i=0; i < respuesta.data.length; i++){\n $('#bodyTable').append(`\n <tr>\n <th>\n <input type=\"checkbox\" id=\"${respuesta.data[i].idUsuario}\" value=\"${respuesta.data[i].idUsuario}\" style=\"width:10px; height:100%;\"/> \n <label for=\"${respuesta.data[i].idUsuario}\"></label>\n </th>\n <td style=\"width:15px; text-align:center;\">${respuesta.data[i].idUsuario}</td>\n <td id=\"${'nombrePersona'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombrePersona}</td>\n <td id=\"${'nombreUsuario'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombreUsuario}</td>\n <td id=\"${'correoElectronico'+respuesta.data[i].idUsuario}\">${respuesta.data[i].correoElectronico}</td>\n <td id=\"${'numeroTelefono'+respuesta.data[i].idUsuario}\">${respuesta.data[i].numeroTelefono}</td>\n <td id=\"${'areaTrabajo'+respuesta.data[i].idUsuario}\">${respuesta.data[i].AreaTrabajo}</td>\n </tr>`\n );\n }\n }\n }\n });\n}", "function getTramitesProceso() {\n if (vm.usuarioOficina == \"rc\") {\n if (vm.usuarioTramites == 'A') {\n fire.ref('rh/tramitesProceso').orderByChild('usuarioOficina').equalTo('A').on('value', function(snapshot){\n vm.listaTramitesProceso = snapshot.val();\n $rootScope.$apply();\n });\n }\n else{\n if (vm.usuarioTramites == 'B') {\n fire.ref('rh/tramitesProceso').orderByChild(\"usuarioOficina\").equalTo(\"B\").on('value', function(snapshot){\n vm.listaTramitesProceso = snapshot.val();\n $rootScope.$apply();\n });\n }\n }\n }\n else{\n if (vm.usuarioOficina == \"sp\") {\n fire.ref('rh/tramitesProceso').orderByChild(\"oficina\").equalTo(\"sp\").on('value', function(snapshot){\n vm.listaTramitesProceso = snapshot.val();\n $rootScope.$apply();\n });\n }\n }\n }", "function assignTableClasses(hook){\n t = $(hook);\n t.each(function(){\n $(this).addClass('edit');\n $(this).bind('contextmenu', async function(e) {\n // parse the remaining count from the table cell content\n let remainingCount = parseInt(e.target.textContent);\n // either the cell is the org name or is already zero\n if (isNaN(remainingCount)) return;\n // reduce the remaining count for the org by 1\n remainingCount = Math.max(remainingCount + 1, 0);\n e.target.textContent = remainingCount;\n\n let row = $(e.target.parentNode);\n row.removeClass('text-muted');\n row.removeClass('inactive');\n if (remainingCount === 1) {\n await sleep(150);\n row.parent('tbody').prepend(row);\n }\n });\n $(this).attr('oncontextmenu', 'return false;');\n });\n}", "function iniciarTablaHistorial(tx) {\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS Historial (IDUsuario, CuentaDesde, CuentaHasta, Monto, FechaHora)');\n}", "function getTablesForCustomer() {\n var nrOfTables = getNumTables();\n\n for (let i = 0; i < nrOfTables; i++) {\n //var table = getTableByIndex(i);\n var listElem = document.createElement('div');\n var listElemContent = `\n <li>\n <a href=\"#\" id=\"table-${i}\" onclick=\"customersTable(${i})\">Table ${i + 1}</a>\n </li>`\n listElem.innerHTML = listElemContent;\n var list = document.getElementsByClassName('pick-table-menu-list')[0];\n list.append(listElem);\n }\n\n customersTable(0); //TODO: change to activeTable-element? Shouldn't be here?\n}", "function showTable() {\n\tmyDB.transaction(function(transaction) {\n\ttransaction.executeSql('SELECT * FROM patients_local', [], function (tx, results) {\n\t\tvar len = results.rows.length, i;\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tpatients[i] = {\"id\":results.rows.item(i).id, \"name\":results.rows.item(i).name, \"date\":results.rows.item(i).date, \"image\":results.rows.item(i).image};\n\t\t}\n\t\tdisplayList(patients);\n\t}, null);\n\t});\n}", "function createTable() {\n\n //set people as an array of member information\n\n let tbody = document.createElement('tbody');\n\n for (i = 0; i < membersInfo.length; i++) {\n let row = document.createElement('tr');\n let cols = membersInfo[i];\n\n let a = document.createElement('a');\n a.setAttribute('href', cols[cols.length - 1]);\n a.setAttribute('class', 'text-decoration-none')\n a.innerHTML = cols[0];\n let colName = document.createElement('td');\n colName.appendChild(a);\n row.appendChild(colName);\n\n for (n = 1; n < cols.length - 1; n++) {\n let col = document.createElement('td');\n let content = document.createTextNode(cols[n]);\n col.setAttribute('class', cols[n]);\n col.appendChild(content)\n row.appendChild(col);\n };\n tbody.appendChild(row);\n }\n\n let table = document.getElementById('members-data');\n table.appendChild(tbody);\n\n // header of the table\n\n let tableHead = ['Senator ', 'Party Affilication ', 'State ', 'Seniority ', 'Party Votes ']\n\n let header = document.createElement('thead')\n header.setAttribute('class', 'thead-dark')\n let headRow = document.createElement('tr')\n\n for (i = 0; i < tableHead.length; i++) {\n let th = document.createElement('th');\n th.setAttribute('scope', 'col');\n let headContent = document.createTextNode(tableHead[i]);\n th.appendChild(headContent);\n\n //<button type=\"button\" class=\"btn btn-sm bg-dark border-secondary\"><i class=\"fas fa-caret-square-down text-white\"></i></button>\n\n let btn = document.createElement('button');\n btn.setAttribute('type', 'button');\n btn.setAttribute('class', 'btn btn-sm bg-dark border-secondary btn-sort');\n\n let arrow = document.createElement('i')\n arrow.setAttribute('class', 'fas fa-caret-square-down text-white');\n arrow.setAttribute('id', i);\n\n btn.appendChild(arrow);\n th.appendChild(btn);\n\n headRow.appendChild(th);\n }\n\n header.appendChild(headRow);\n\n table.insertBefore(header, tbody)\n\n}", "function golist() {\n /*Ajustar la petición para mostrar la tabla de resultados procesos*/\n var columnasdata = [{ \"data\": \"AA\" },\n { \"data\": \"BB\" },\n { \"data\": \"CC\" },\n { \"data\": \"ACCIONES\" }];\n\n /*Consultar procesos y mostrar*/\n autogenDatatablesminHeaders(columnasdata, \"DT_listado\", \"JFunctionData\", \"listas\", \"{}\");\n document.getElementById(\"FW_resultados\").style.display = \"block\";\n}", "function fntViewUsuario(idpersona){\n\t// let btnViewUsuario = document.querySelectorAll('.btnViewUsuario');\n\t// btnViewUsuario.forEach(function(btnViewUsuario){\n\t// \tbtnViewUsuario.addEventListener('click', function(){\n\t\t\t// let idpersona = this.getAttribute('us');\n\t\t\tvar idpersona = idpersona;\n\t\t\tlet request = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n\t\t\tlet ajaxUrl = base_url+'/Usuarios/getUsuario/'+idpersona;\n\t\t\trequest.open(\"GET\", ajaxUrl, true);\n\t\t\trequest.send();\n\t\t\trequest.onreadystatechange = function(){\n\t\t\t\tif (request.readyState == 4 && request.status == 200) {\n\t\t\t\t\tlet objData = JSON.parse(request.responseText);\n\n\t\t\t\t\tif (objData.status)\n\t\t\t\t\t{\n\t\t\t\t\t\tlet estadoUsuario = objData.data.status == 1 ?\n\t\t\t\t\t\t'<span class=\"badge badge-success\">Activo</span>' :\n\t\t\t\t\t\t'<span class=\"badge badge-danger\">Inactivo</span>' ;\n\n\t\t\t\t\t\tdocument.querySelector('#celIdentificacion').innerHTML = objData.data.identificacion;\n\t\t\t\t\t\tdocument.querySelector('#celNombre').innerHTML = objData.data.nombres;\n\t\t\t\t\t\tdocument.querySelector('#celApellido').innerHTML = objData.data.apellidos;\n\t\t\t\t\t\tdocument.querySelector('#celTelefono').innerHTML = objData.data.telefono;\n\t\t\t\t\t\tdocument.querySelector('#celEmail').innerHTML = objData.data.email_user;\n\t\t\t\t\t\tdocument.querySelector('#celTipoUsuario').innerHTML = objData.data.nombrerol;\n\t\t\t\t\t\tdocument.querySelector('#celEstado').innerHTML = estadoUsuario;\n\t\t\t\t\t\tdocument.querySelector('#celFechaRegistro').innerHTML = objData.data.fechaRegistro;\n\t\t\t\t\t\t$('#modalViewUser').modal('show');\n\t\t\t\t\t}else{\n\t\t\t\t\t\tswal(\"Error\", objData.msg, \"error\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t// });\n\t// });\n}", "function viewAllUsers() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n }\n };\n data[0] = [\"User ID\".cyan, \"Full Name\".cyan, \"Username\".cyan, \"User Type\".cyan];\n let queryStr = \"users\";\n let columns = \"user_id, full_name, username, user_type\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n Users\".magenta);\n for (let i = 0; i < res.length; i++) {\n data[i + 1] = [res[i].user_id.toString().yellow, res[i].full_name, res[i].username, res[i].user_type];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}" ]
[ "0.59145796", "0.56666297", "0.56666297", "0.5654033", "0.55522376", "0.5484885", "0.5477175", "0.54707", "0.54546374", "0.53671783", "0.5339979", "0.53270227", "0.52824354", "0.5233508", "0.5233092", "0.52303493", "0.5221472", "0.5215338", "0.52122384", "0.5196835", "0.51826245", "0.51656544", "0.51645213", "0.5137538", "0.51306194", "0.5130174", "0.5117119", "0.5092843", "0.5092372", "0.5087746", "0.5079415", "0.5077594", "0.50668323", "0.5061933", "0.50599396", "0.50549436", "0.50523245", "0.5048515", "0.5047095", "0.50463015", "0.50390047", "0.50263584", "0.5012051", "0.50052667", "0.50049514", "0.5004221", "0.5002871", "0.49887508", "0.49879056", "0.4987425", "0.4986558", "0.49850544", "0.4982971", "0.49707812", "0.4959026", "0.49547443", "0.4948438", "0.4945576", "0.49433014", "0.4937795", "0.49350435", "0.4932653", "0.49247414", "0.49245256", "0.4923057", "0.49184674", "0.49176618", "0.4916538", "0.49140018", "0.4911889", "0.4901089", "0.48990044", "0.48964202", "0.4879115", "0.48775232", "0.4873518", "0.48730922", "0.48730662", "0.48677257", "0.48644385", "0.48626477", "0.48598504", "0.48578548", "0.4855426", "0.48542684", "0.4851636", "0.48501536", "0.48490578", "0.48473302", "0.4840004", "0.48374295", "0.48352715", "0.48330852", "0.48326507", "0.48275983", "0.4824426", "0.48201695", "0.48191234", "0.4815826", "0.48136985", "0.48132804" ]
0.0
-1
Verifica que solo un curso sea seleccionado o que al menos uno sea seleccionado antes de asociar profesores
function verificarCheckCarreras() { let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]'); let checkeado = false; for (let i = 0; i < checkboxes.length; i++) { if (checkboxes[i].checked) { checkeado = true; } } if (checkeado == true) { disableCarreras(); enableCursos(); } else { enableCarreras(); disableCursos(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 CornerCheck() {\n //comprobando las esquinas\n if (\n selected[0][0] &&\n called[0][0] &&\n selected[0][3] &&\n called[0][3] &&\n selected[3][0] &&\n called[3][0] &&\n selected[3][3] &&\n called[3][3]\n ) {\n hasWon = true;\n console.log(\"gano en las esquinas\");\n msg = \"Ganaste en las esquinas!\";\n return true;\n }\n}", "checkSelected() {\n let counter = 0;\n let midAnimation = this.checkMidAnimation();\n if(!midAnimation && !this.locked){\n counter = this.setSelected(this.view.thanosPieces, counter);\n counter = this.setSelected(this.view.gamoraPieces, counter);\n if (this.selectedPiece != null)\n //console.log(\"Selected:\" + counter);\n if (counter == 1)\n return \"OK\"; //One piece selected\n else if (counter == 0) {\n this.selectedPiece.swapText();\n this.selectedPiece = null;\n return \"NOTOK\"; // No pieces selected\n }\n }\n else{\n this.deselectAllPieces();\n }\n }", "function checkSelected(){\n\tvar noSelection = $('#ne-list').find('.ne-selected').length == 0 || $('.ne-selected').css('display') == 'none';\n\t$('#ne-edit, #ne-delete').prop('disabled', noSelection);\n\tnoSelection ? clearSide() : setPreview($('.ne-selected'));\n}", "function activeShutter_haveValidSelection()\r\n\t\t{\r\n\t\t\tif (app.project == null)\r\n\t\t\t{\r\n\t\t\t\tasPal.grp.statusBar.msg.text = activeShutterData.strErrNoProj;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif ((app.project.activeItem == null) || ((app.project.activeItem != null) && !(app.project.activeItem instanceof CompItem)))\r\n\t\t\t{\r\n\t\t\t\tasPal.grp.statusBar.msg.text = activeShutterData.strErrNoActiveComp;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "function checkerSelection(evt){\n if(scores.winner !== null) return;\n evt.stopImmediatePropagation();\n const target = evt.target;\n \n if((target.attributes.player.value === playerTurn) && (pieceSelected === true)) {\n selectedPieceArray[0].classList.remove('selected')\n }\n if((target.attributes.player.value !== playerTurn) && (pieceSelected === true)){\n readyJump(target, selectedPieceArray);\n \n }else clearSelection();\n\n if(target.attributes.player.value !== playerTurn) return\n target.classList.add('selected')\n selectedPieceArray.push(target)\n pieceSelected = true;\n}", "function currentlyActive(sec){\n let position = sec.getBoundingClientRect();\n return(position.top >= 0 );\n}", "function co2Selected() {\n\ttempActive = false;\n\tlocationActive = false;\n\tradActive = false;\n\tco2Active = true;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function ValidarTipoContratoComEscolaridade() {\n\n if ($('#cphConteudo_ucContratoFuncao_chblContrato_1').attr('checked')) {\n if ($('.rcbList').find('.rcbHovered:first:contains(\"Incompleto\")').length == 0) {\n alert('Escolaridade não condiz com o tipo de contrato Estágio!');\n }\n }\n}", "function clickEnCasilla(x, y) {\n if (miPartida.tableroGirado) {\n x = 7 - x;\n y = 7 - y;\n }\n\n let blanca = esBlanca(miPartida.tablero[x][y]);\n let negra = esNegra(miPartida.tablero[x][y]);\n\n if (!miPartida.hayPiezaSelec) {\n if (miPartida.turno && blanca || !miPartida.turno && negra)\n realizarSeleccionPieza(x, y);\n } else {\n if (esMovValido(x, y)) {\n if (siPeonPromociona(x))\n modalPromocionPeon(x, y);\n else {\n enviarMovimiento(x, y, null);\n realizarMovimientoYComprobaciones(x, y, false);\n }\n } else {\n // Si la pieza pulsada no es la que estaba seleccionada, selecciono la nueva\n if (x !== miPartida.piezaSelec.x || y !== miPartida.piezaSelec.y) {\n // Compruebo que este pulsando una pieza y que sea de mi color\n if (miPartida.turno && blanca || !miPartida.turno && negra) {\n eliminarEstiloMovPosibles();\n realizarSeleccionPieza(x, y);\n }\n } else { // Si la pieza pulsada es la que estaba seleccionada, la deselecciono\n eliminarEstiloMovPosibles();\n deseleccionarPieza();\n }\n }\n }\n}", "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}", "function checkSelected(){\n\tvar noSelection = $('#ce-list').find('.ce-selected').length == 0 || $('.ce-selected').css('display') == 'none';\n\t$('#ce-edit, #ce-delete').prop('disabled', noSelection);\n\tnoSelection ? clearSide() : setPreview($('.ce-selected'));\n}", "function verificar_select_seleccionado(){\n\tif($(\"#id_provincia option:selected\").text()!= '-- Seleccione --'){\n\t\t$('#id_canton').prop('disabled', false);\n\t\t$('#id_parroquia').prop('disabled', false);\n\t}\n}", "function select() {\n let xPos = event.offsetX;\n let yPos = event.offsetY;\n player.cards.onHand.forEach(element => {\n if (\n yPos > element.y &&\n yPos < element.y + element.height &&\n xPos > element.x &&\n xPos < element.x + element.width\n ) {\n console.log(\"we got ya\");\n element.selected = true;\n element.degrees = 0;\n console.log(element);\n //than create event listener\n myDom.canvas3.addEventListener(\"mousemove\", getCurPos, false);\n }\n });\n}", "function mousePosIsInSelectableArea(pos) {\n\t\tif(pos.x > leftMarg - 2 && pos.x <= leftMarg + drawW + 2 && pos.y > topMarg - 2 && pos.y <= topMarg + drawH + 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function comprueba_puestos() {\nvar cuantos = 0;\nvar elementos = document.getElementsByName(\"puesto\"); // Es un array con los checkbox de nombre puesto\nvar span_puestos= document.getElementById(\"span_puestos\");\n\n\tfor(i in elementos) {\n if (elementos[i].checked) cuantos++;\n\t }\n\n\tif (!cuantos) { // Es lo mismo que cuantos==0\n span_puestos.style.color=\"red\";\n span_puestos.innerHTML=\" Debe seleccionar un puesto de trabajo\";\n puestos=false;\n }\n\t \n else {\n span_puestos.innerHTML=\"\";\n\t puestos=true;\n }\n}", "function CenterCheck() {\n //comprobando el centro\n if (\n selected[1][1] &&\n called[1][1] &&\n selected[1][2] &&\n called[1][2] &&\n selected[2][1] &&\n called[2][1] &&\n selected[2][2] &&\n called[2][2]\n ) {\n hasWon = true;\n console.log(\"gano en el centro\");\n msg = \"Ganaste en el centro!\";\n return true;\n }\n}", "function selectionIsSane() {\n\t\t\tvar minSize = 5;\n\t\t\treturn Math.abs(selection.second.x - selection.first.x) >= minSize &&\n\t\t\t\tMath.abs(selection.second.y - selection.first.y) >= minSize;\n\t\t}", "function selecao(selecionado){\n if(selecionado != 'null'){\n renderAllPatrimonios()\n }\n \n}", "function setDrawFlgWhenClick() {\n console.log(\"setDrawFlgWhenClick\");\n for (var i in selectedAnnos) {\n var e = SVG.get(selectedAnnos[i]);\n if (hasIntersection(iv.sMultipleSvg, e)) {\n return false;\n }\n }\n\n if (clickOnSelectedBound) {\n return false;\n }\n return true;\n}", "function showSelection() {\n \tif (controlSelected && selectedControl === 2) {\n \t\t\tselectedControl = 2; \n\t \t\tnextState = true;\n\t \t}\n \tif (selectMode && mousePressed) {\n \t\t// yes\n\t \tif (anim.frame === 1) {\n\t \t\tnextScreen();\n\t \t\tcontrolSelected = true;\n\t \t}\n\t \t// no\n\t \tif (anim.frame === 0) {\n\t \t\treset = true;\n\t \t}\n\t }\n\t if (!selectMode && !mousePressed && !controlSelected) {\n\t \tselection = game.add.sprite(700, 230, 'selection');\n\t selection.animations.add('click', [1, 0]);\n\t keyboard.animations.stop(true, '0');\n\t mouse.animations.stop(true, '0');\n\t anim = selection.animations.play('click', 1, true);\n\t mousePressed = true;\n\t selectMode = true;\n\t }\n\t if (reset) {\n\t \tresetSelection();\n\t }\n\t \n \t}", "checkSelection(){\n Ember.run.next(() =>{\n let sel = this.getSelection(),\n hasSelection = !!$.trim(sel.toString());\n\n this.$toolpane.css('visibility', hasSelection ? 'visible' : 'hidden');\n\n if(hasSelection) {\n this.$toolpane.css(this.getToolpaneCoords(sel));\n }\n });\n }", "function abilitarTipoCadastro() {\n var tipoCadastro = document.querySelector(\"#tipoCadastro\");\n \n if(tipoCadastro.selectedIndex == 1) {\n document.querySelector(\"#usuario-juridico\").style.display = \"none\";\n document.querySelector(\"#usuario-pessoa\").style.display = \"block\";\n document.querySelector(\"#abilitar-botoes-envio\").style.display = \"block\";\n }else if(tipoCadastro.selectedIndex == 2) {\n document.querySelector(\"#usuario-pessoa\").style.display = \"none\";\n document.querySelector(\"#usuario-juridico\").style.display = \"block\";\n document.querySelector(\"#abilitar-botoes-envio\").style.display = \"block\";\n }else {\n document.querySelector(\"#abilitar-botoes-envio\").style.display = \"none\";\n document.querySelector(\"#usuario-pessoa\").style.display = \"none\";\n document.querySelector(\"#usuario-juridico\").style.display = \"none\"; \n }\n}", "function checkSelect() {\n let btnSelect = this.id;\n arraySelect.push(btnSelect);\n\n for (let i = 0; i < arraySelect.length; i++) {\n if (arraySelect[i] != arrayRnd[i]) {\n buttons.style.visibility = 'hidden';\n lvl.style.visibility = 'hidden';\n currentLVL = 1;\n arrayRnd = [];\n arraySelect = [];\n beginGame.disabled = false;\n clickDisabled = true;\n color = true;\n alert(\"Ha fallado\");\n return;\n }\n }\n if (arraySelect.length == arrayRnd.length) {\n arraySelect = [];\n guide.innerHTML = 'Memorice...';\n disableClickCell();\n color = true;\n game();\n }\n}", "function dogadjaj(nivo) {\r\n const polje = document.querySelector(`#${nivo} .polje`);\r\n //Dodavanje dogadjaja polju\r\n polje.addEventListener('click', function (event) {\r\n //event.target tamo gde kliknemo:\r\n let klik = event.target;\r\n //ne dozvoljavamo da se selektuje ceo deo section iza kartica, vec samo kartica moze, i to samo jednom\r\n if (klik.nodeName === 'SECTION' || klik.parentNode.classList.contains('selected')) {\r\n return;\r\n };\r\n if (moves < 2) {\r\n moves++;\r\n if (moves === 1) {\r\n //Definisanje prvog pokusaja\r\n prvi = klik.parentNode.dataset.name;\r\n console.log(prvi);\r\n klik.parentNode.classList.add('selected');\r\n } else {\r\n //Definisanje drugog pokusaja\r\n drugi = klik.parentNode.dataset.name;\r\n console.log(drugi);\r\n klik.parentNode.classList.add('selected');\r\n\r\n brojac();\r\n console.log(brojPokusaja);\r\n };\r\n //Ako oba pokusaja nisu prazni...\r\n if (prvi !== '' && drugi !== '') {\r\n //i prvi i drugi pokusaj su pogodjeni\r\n if (prvi === drugi) {\r\n //niz u koji ubacujemo uparene kartice\r\n upareneKartice.push(izabrano);\r\n console.log(upareneKartice);\r\n\r\n //pozivanje funkcije match sa odlaganjem\r\n setTimeout(match, 1200);\r\n //pozivanje funkcije resetPokusaja\r\n setTimeout(resetPokusaja, 1200);\r\n } else {\r\n setTimeout(resetPokusaja, 1200);\r\n };\r\n };\r\n //Set previous target to clicked (I'll assign the clicked value to prevousTarget after the first click.)\r\n prethodniKlik = klik;\r\n };\r\n otvaranje(nivo);\r\n });\r\n}", "function select_cambio(){\n\n \tvar select = document.getElementById('pais').value;\n\n \tvar seleccion_departamento = document.getElementById('seleccion_departamento');\n \tvar escribir_departamento = document.getElementById('escribir_departamento');\n \tvar contenedor = document.getElementById('escribir_departamento');\n \tif(select == \"Colombia\"){\n \t\tseleccion_departamento.className = 'select-visible';\n \t\tseleccion_departamento.name = 'departamento';\n \t\tescribir_departamento.className = 'select-invisible';\n \t\tescribir_departamento.name = 'nada';\n \t}\n \telse{\n \t\tseleccion_departamento.className = 'select-invisible';\n \t\tseleccion_departamento.name = 'nada';\n\n \t\tescribir_departamento.className = 'select-visible';\n \t\tescribir_departamento.name = 'departamento';\n\n \t}\n }", "function chosenClick() {\n if (core || all || career) { // If any other tab is currently open, set them to false and show user's chosen courses\n setAll(false);\n setCore(false);\n setCareer(false);\n setChosen(true);\n }\n }", "function verifyClose_conexion(){\n let band = true;\n if (window.v_selected === \"Articulo\") {\n if(document.getElementById(\"input_1\").value === \"\" || \n document.getElementById(\"input_2\").value === \"\" || \n document.getElementById(\"input_3\").value === \"\" ){\n alert(\"Ingrese todos los datos de ARTICULO.\");\n band = false;\n }\n } else if (window.v_selected === \"Categoria\") {\n if(document.getElementById(\"input_1\").value === \"\" || document.getElementById(\"input_2\").value === \"\"){\n alert(\"Ingrese todos los datos de CATEGORIA.\");\n band = false;\n }\n } else if (window.v_selected === \"Cliente\") {\n if(document.getElementById(\"input_1\").value === \"\" ||\n document.getElementById(\"input_2\").value === \"\" ||\n document.getElementById(\"input_3\").value === \"\" ||\n document.getElementById(\"input_4\").value === \"\" ||\n document.getElementById(\"input_5\").value === \"\" ||\n document.getElementById(\"input_6\").value === \"\"){\n alert(\"Ingrese todos los datos de CLIENTE.\");\n band = false;\n }\n } else if (window.v_selected === \"Factura\") {\n if(document.getElementById(\"input_5\").value === \"\" ){\n alert(\"Ingrese todos los datos de Factura.\");\n band = false;\n }\n } else if (window.v_selected === \"Metodo_pago\" || window.v_selected === \"Ciudad\") {\n if(document.getElementById(\"input_1\").value === \"\" ){\n alert(\"Ingrese todos los datos de Factura.\");\n band = false;\n }\n }\n if(band){\n window.close_conexion();\n }\n}", "function comprarCurso(e){\n e.preventDefault();\n //delegation para agregar carrito\n\n if(e.target.classList.contains('agregar-carrito')){\n const curso = e.target.parentElement.parentElement;\n //acá lo que hizo es seleccionar una parte del interior de la card del curso\n //se tiene que seleccionar toda la cart, por esto, hizo el segundo parent element,\n //para llegar al padre anterior, ahi ya selecciono toda la card\n\n leerDatosCursos(curso);\n //esta funcion va recibir la info de curso y va a leerla.\n } //se envian los cursos seleccionados pa tomar datos\n\n \n}", "_isDragStartInSelection(ev) {\n const selectedElements = this.root.querySelectorAll('[data-is-selected]');\n for (let i = 0; i < selectedElements.length; i++) {\n const element = selectedElements[i];\n const itemRect = element.getBoundingClientRect();\n if (this._isPointInRectangle(itemRect, { left: ev.clientX, top: ev.clientY })) {\n return true;\n }\n }\n return false;\n }", "function seleccionNormal(){\r\n\t\tcontrol=\"inactivo\";\r\n\t\tTweenMax.to(izq, 0.2, {alpha:0});\r\n\t\tTweenMax.to(dch, 0.2, {alpha:0});\r\n\t\tTweenMax.to(tit_tra, 0.2, {alpha:0});\r\n\t\t\r\n\t\tTweenMax.to(fondo, 2, {css:{left:\"107vw\"},ease:Power2.easeInOut,delay:0.5});\r\n\t\tTweenMax.to(vackslash, 2, {css:{left:\"107vw\"},ease:Power2.easeInOut,delay:0.5});\r\n\t\tTweenMax.to(mountains, 2, {css:{left:\"107vw\"},ease:Power2.easeInOut,delay:0.5});\r\n\t\tsetTimeout(function(){\r\n\t\t\t\tizq.css(\"display\",\"none\");\r\n\t\t\t\tdch.css(\"display\",\"none\");\r\n\t\t\t\ttit_dis.css(\"display\",\"none\");\r\n\t\t\t\ttit_tra.addClass('titcentro');\r\n\t\t\t\tTweenMax.to(tit_tra, 0, {y:+1000});\r\n\t\t\t\tTweenMax.to(tit_tra, 0.5, {alpha:1,delay:1.5});\r\n\t\t\t\tTweenMax.to(tit_tra, 2, {y:0,delay:1.5,ease:Power2.easeInOut});\r\n\t\t\t\t\r\n\t\t\t\tintro_tra.css(\"display\",\"block\");\r\n\t\t\t\tTweenMax.to(intro_tra, 0, {alpha:0});\r\n\t\t\t\tTweenMax.to(intro_tra, 0.5, {alpha:1,delay:3.5});\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n \t},200);\r\n}", "function isSelectedCripto(id) {\n return selectedCripto === id;\n }", "function isSelectedCripto(id) {\n return selectedCripto === id;\n }", "function testjeu() {\n if (selectionmanu == choix) {\n alert (\"Vous avez fait le même choix que l'ordinateur\");\n } else {\n alert (\"Vous avez fait un choix différent de l'ordinateur\");\n }\n}", "function tempSelected() {\n\ttempActive = true;\n\tlocationActive = false;\n\tradActive = false;\n\tco2Active = false;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function seleccionaPieza() {\n if (turno == 1){\n if(!piezaMovilSeleccionada && this.firstElementChild) {\n casilla = this; \n piezaMovil = casilla.innerHTML;\n this.querySelector('img[alt=\"Pieza_Blanca\"]').classList.add(\"pintado\"); \n piezaMovilSeleccionada = true;\n \n //Pinta la ficha del titulo del jugador de turno\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.add(\"pintado\");\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.remove(\"pintado\");\n \n //Pinta el nombre del jugador de turno y despinta al otro\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = 'lightblue';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = '';\n \n }\n else if(piezaMovilSeleccionada && !this.querySelector('img[alt=\"Pieza_Blanca\"]') ){\n casilla.innerHTML= ''; \n this.innerHTML = piezaMovil;\n piezaMovilSeleccionada = false;\n posicion = this;\n if (posicion != casilla ){\n turno = 2;\n\n //Despinta ficha de titulo cuando ya no es tu turno\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.remove(\"pintado\");\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.add(\"pintado\");\n\n //Despinta nombre cuando ya no es tu turno\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = '';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = 'lightblue';\n } \n }\n \n} //Turno 2 Piezas Rojas\n else if (turno == 2){\n if(!piezaMovilSeleccionada && this.firstElementChild) {\n casilla = this; \n piezaMovil = casilla.innerHTML; \n this.querySelector('img[alt=\"Pieza_Roja\"]').classList.add(\"pintado\"); \n piezaMovilSeleccionada = true;\n \n //Pinta la ficha del titulo del jugador de turno\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.add(\"pintado\");\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.remove(\"pintado\");\n //Pinta el nombre del jugador de turno y despinta al otro\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = '';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = 'lightblue'; \n \n }\n else if(piezaMovilSeleccionada && !this.querySelector('img[alt=\"Pieza_Roja\"]')){\n casilla.innerHTML= ''; \n this.innerHTML = piezaMovil; \n piezaMovilSeleccionada = false;\n posicion = this;\n console.log(casilla.id);\n if (posicion != casilla){\n turno = 1;\n //Despinta ficha de titulo cuando ya no es tu turno\n var fichaJugador2 = document.getElementById(\"img-jugador2\");\n fichaJugador2.classList.remove(\"pintado\");\n var fichaJugador1 = document.getElementById(\"img-jugador1\");\n fichaJugador1.classList.add(\"pintado\");\n\n //Despinta nombre cuando ya no es tu turno\n var jugador1 = document.getElementById(\"jugador1\");\n jugador1.style.color = 'lightblue';\n var jugador2 = document.getElementById(\"jugador2\");\n jugador2.style.color = '';\n } \n } \n }\n \n}", "function seleccionarImagen(posicion) {\n alternarVista(posicion);\n alternarIndicador(posicion);\n }", "function selctionFilm(event){\n\t\tvar film=event.target.parentNode;\n\t\tvar selct1=document.getElementById(\"selction1\");\n\t\tvar selct2=document.getElementById(\"selction2\");\n\t\tconsole.log(event.target.parentNode);\n\t\t//crerer de varaiable pour span fils \n\t\tvar selctChild1=selct1.childNodes;\n\t\tvar selctChild2=selct2.childNodes;\n\t\t//console.log(selctChild1);\n\t\tif(selctChild1.length==1)\n\t\t{\n\t\t//partie selction 1 est vide\n\t\tselct1.insertBefore(film,selctChild1[0]);\n\n\t\t}\n\t\telse if(selctChild2.length==1)\n\t\t{\n\t\t\t//partie selection 2 est vide \n\t\t\tselct2.insertBefore(film,selctChild2[0]);\n\t\t}\n\t\telse{\n\t\t\talert(\"vous avez déja choisi deux films!\");\n\t\t}\n\t}", "function selectAlimento() {\n if($(this).attr(\"style\") == \"background-color:black\") {\n $(this).attr(\"style\", \"background-color:white\");\n $(\".qt\").css(\"display\", \"none\");\n }else {\n $(this).attr(\"style\", \"background-color:black\");\n $(this).siblings().attr(\"style\", \"background-color:white\");\n $(\".qt\").css(\"display\", \"block\");\n var x = $(this);\n updateGraph(x);\n }\n }", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "function normal(boton) {\n\tif(boton.seleccionado==null || !boton.seleccionado)\n\t\tif(boton.fondo1!=null) \n\t\t\tboton.style.backgroundColor=boton.fondo1\n\treturn true\n}", "function leerDatosCurso(curso) {\n const infoCurso = {\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id'),\n };\n\tif (localStorage.getItem('cursos') !== null) {\n\t\tif (JSON.parse(localStorage.getItem('cursos')).some(curso => curso.titulo === infoCurso.titulo)) {\n\t\t\talert.textContent=\"El curso ya existe\";\n\t\t\talert.style.backgroundColor=\"red\";\n\t\t\talert.classList.add('alertAnim');\n\t\t\tsetTimeout(()=>{\n\t\t\t\talert.classList.remove('alertAnim');\n\t\t\t}, 1500);\n\t\t} else {\n\t\t\tcursosAgregados.push(infoCurso.titulo);\n\t\t\tinsertarCarrito(infoCurso);\n\t\t}\n\t} else {\n\t\tif (cursosAgregados.some(curso => curso === infoCurso.titulo)) {\n\t\talert.textContent=\"El curso ya existe\";\n\t\talert.style.backgroundColor=\"red\";\n\t\talert.classList.add('alertAnim');\n\t\tsetTimeout(()=>{\n\t\t\talert.classList.remove('alertAnim');\n\t\t}, 1500);\n\t\t} else {\n\t\t\tcursosAgregados.push(infoCurso.titulo);\n\t\t\tinsertarCarrito(infoCurso);\n\t\t}\n\t}\n\treturn true;\n}", "function checkPieceClicked(){\n var i;\n var piece;\n for(i = 0; i < _pieces.length; i ++){\n piece = _pieces[i];\n if(_mouse.x < piece.xPos || _mouse.x > (piece.xPos + _pieceWidth) || _mouse.y < piece.yPos || _mouse.y > (piece.yPos + _pieceHeight)){\n // This Piece is not selected \n }else{\n return piece;\n }\n }\n return null;\n}", "function checkSelection(){\n\t// find intersections\n\n\t// create a Ray with origin at the mouse position\n\t// and direction into the scene (camera direction)\n\tvar vector = new THREE.Vector3( mouse.x, mouse.y, 1 );\n\tprojector.unprojectVector( vector, camera );\n\tvar ray = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );\n var activeEU = 0;\n\tvar activeUS = 0;\n\tvar activeCHA = 0;\n\t// create an array containing all objects in the scene with which the ray intersects\n\tvar intersects = ray.intersectObjects( targetList );\n\n\t//if an intersection is detected\n\tif ( intersects.length > 0 )\n\t{\n\t\tconsole.log(\"Hit @ \" + toString( intersects[0].point ) );\n\n\t\t//test items in selected faces array\n\t\tvar test=-1;\n\t\tselectedFaces.forEach( function(arrayItem)\n\t\t{\n\n\t\t\tif (arrayItem.object.name === \"USD\")\n\t\t\t{\n\t\t\t\tif(intersects[0].faceIndex==arrayItem.faceIndex && intersects[0].object.id==arrayItem.object.id){\n\t\t\t\t\ttest=selectedFaces.indexOf(arrayItem);\n\t\t\t\t\tconsole.log(\"False\");\n\t\t\t\t\tactiveCHA = 0;\n\t\t\t\t\t$scope.$emit(\"messageUSD\", 0);\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeCHA === 0 && activeUS === 0 && activeEU)\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminwhole.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSA.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if (arrayItem.object.name === \"EU\")\n\t\t\t{\n\t\t\t\tif(intersects[0].faceIndex==arrayItem.faceIndex && intersects[0].object.id==arrayItem.object.id){\n\t\t\t\t\ttest=selectedFaces.indexOf(arrayItem);\n\t\t\t\t\tconsole.log(\"False\");\n\t\t\t\t\t$scope.$emit(\"messageEU\", 0);\n\t\t\t\t\tactiveCHA = 0;\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeCHA === 0 && activeUS === 0 && activeEU)\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminwhole.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (arrayItem.object.name === \"CHA\")\n\t\t\t{\n\t\t\t\tif(intersects[0].faceIndex==arrayItem.faceIndex && intersects[0].object.id==arrayItem.object.id){\n\t\t\t\t\ttest=selectedFaces.indexOf(arrayItem);\n\t\t\t\t\tconsole.log(\"False\");\n\t\t\t\t\t$scope.$emit(\"messageCHA\", 0);\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeCHA === 0 && activeUS === 0 && activeEU)\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminwhole.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHA.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t});\n\n\n\n\t\t//Change Touchpoint Color\n\t\t// if is a previously selected face, change the color back to green, otherswise change to blue\n\t\tif(test>=0){\n\t\t\tintersects[ 0 ].face.color=new THREE.Color( 0x17A0BF );\n\t\t\tselectedFaces.splice(test, 1);\n\n\t\t}\n\t\telse{\n\t\t\tintersects[ 0 ].face.color=new THREE.Color( 0x17A0BF );\n\t\t\tselectedFaces.push(intersects[0]);\n\t\t\tselectedFaces.forEach( function(arrayItem)\n\t\t\t{\n\t\t\t\tif (arrayItem.object.name === \"USD\")\n\t\t\t\t{\n\t\t\t\tconsole.log(\"True\");\n\t\t\t\tactiveUS = 1;\n\t\t\t\t$scope.$emit(\"messageUSD\", 1);\n if (activeUS === 1 && activeEU == 1)\n\t\t\t\t{\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSEU.png', {}, function(){\n\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 EU\")\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t});\n\n\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\tanimate();\n\t\t\t\t}\n\t\t\t\telse if (activeUS == 1 && activeCHA === 1)\n\t\t\t\t{\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSA.png', {}, function(){\n\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 CHA\")\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t});\n\n\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\tanimate();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSA.png', {}, function(){\n\t\t\t\t\tconsole.log(\"Loaded Texture for USA\")\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t});\n\n\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\tanimate();\n\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\telse if (arrayItem.object.name === \"EU\")\n\t\t\t\t{\n\t\t\t\t\tconsole.log(\"True\");\n\t\t\t\t\tactiveEU = 1;\n\t\t\t\t\t$scope.$emit(\"messageUEU\", 1);\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeUS === 1 && activeEU == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSAEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 EU\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse if (activeEU == 1 && activeCHA === 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHAEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"Loaded Texture for CHA <3 EU\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"Loaded Texture for EU\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\telse if (arrayItem.object.name === \"CHA\")\n\t\t\t\t{\n\n\t\t\t\t\t\tconsole.log(\"True\");\n\t\t\t\t\t\tactiveCHA = 1;\n\t\t\t\t\t\t$scope.$emit(\"messageCHA\", 1);\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tif (activeUS === 1 && activeCHA == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSAEU.png', {}, function(){\n\t\t\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 EU\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\t\tanimate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (activeEU == 1 && activeCHA === 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHAEU.png', {}, function(){\n\t\t\t\t\t\t\tconsole.log(\"Loaded Texture for CHA < EU\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\t\tanimate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHA.png', {}, function(){\n\t\t\t\t\t\t\tconsole.log(\"Loaded Texture for CHA\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\t\tanimate();\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t}\n\n\t\tintersects[ 0 ].object.geometry.colorsNeedUpdate = true;\n\t}\n}", "function updateSelectionState(piece) {\r\n // Coordinates of the piece and the rubberband in piece space:\r\n var rubbrX1P = rubberband.xP, rubbrY1P = rubberband.yP;\r\n var rubbrX2P = rubberband.xP + rubberband.widthP - 1;\r\n var rubbrY2P = rubberband.yP + rubberband.heightP - 1;\r\n var pieceX1P = piece.xP, pieceY1P = piece.yP;\r\n var pieceX2P = piece.xP + piece.widthP - 1;\r\n var pieceY2P = piece.yP + piece.heightP - 1;\r\n piece.selected =\r\n ((rubbrX1P <= pieceX1P && rubbrX2P >= pieceX1P) ||\r\n (rubbrX1P > pieceX1P && rubbrX1P <= pieceX2P)) &&\r\n ((rubbrY1P <= pieceY1P && rubbrY2P >= pieceY1P) ||\r\n (rubbrY1P > pieceY1P && rubbrY1P <= pieceY2P));\r\n }", "function excluyentes(seleccionado) {\n programador_web.checked = false; \n logistica.checked = false;\n peon.checked = false;\n \n seleccionado.checked = true; \n}", "function selectMen(men) {\n unselectAllCells();\n men.classList.add('select');\n if (men.getElementsByClassName('move-label')[0].classList.contains('green') ||\n men.getElementsByClassName('move-label')[0].classList.contains('yellow') ||\n men.getElementsByClassName('move-label')[0].classList.contains('yellow2')) {\n var surround = getSurroundCells(men, 1);\n for (i in surround) {\n // if men: user\n if (isUserUnit(men)) {\n if (isEnemyUnit(surround[i])) {\n surround[i].classList.add('men-atack');\n } else if (!isUnit(surround[i])) {\n surround[i].classList.add('move-men-r1');\n }\n // if men: enemy\n } else if (isEnemyUnit(men)) {\n if (isUserUnit(surround[i])) {\n surround[i].classList.add('men-atack');\n } else if (!isUnit(surround[i])) {\n surround[i].classList.add('move-men-r1');\n }\n }\n }\n }\n}", "function checkDraw() {\n return playerOSelections.length + playerXSelections.length >= cells.length\n}", "function comprobar(){\r\n var f=formElement;\r\n var checked=false;\r\n var checked2=false;\r\n var checked3=false;\r\n var checked4=false;\r\n\r\n for (i = 0; i < f.grupo.length; i++) { //\"colores\" es el nombre asignado a todos los radio\r\n if (f.grupo[i].checked) checked=true;\r\n }\r\n for (i = 0; i < f.cuenca.length; i++) { //\"colores\" es el nombre asignado a todos los radio\r\n if (f.cuenca[i].checked) checked2=true;\r\n }\r\n for (i = 0; i < f.mil.length; i++) { //\"colores\" es el nombre asignado a todos los radio\r\n if (f.mil[i].checked) checked3=true;\r\n }\r\n for (i = 0; i < f.color.length; i++) { //\"colores\" es el nombre asignado a todos los radio\r\n if (f.color[i].checked) checked4=true;\r\n }\r\n\r\n if (!checked4) { \r\n document.getElementById('radioDiv').focus();\r\n alert(\"Contesta la pregunta 1\");\r\n return false;\r\n } \r\n\r\n if (!checked3) { \r\n document.getElementById('radioDiv2').focus();\r\n alert(\"Contesta la pregunta 2\");\r\n return false;\r\n }\r\n\r\n if (document.getElementById('tex').value==\"\") {\r\n document.getElementById('tex').focus();\r\n alert(\"Contesta la pregunta 3\");\r\n return false;\r\n } \r\n\r\n if (document.getElementById('num').value==\"\") {\r\n document.getElementById('num').focus();\r\n alert(\"Contesta la pregunta 4\");\r\n return false;\r\n } \r\n \r\n if (!checked) { \r\n document.getElementById('checkboxDiv').focus();\r\n alert(\"Contesta la pregunta 5\");\r\n return false;\r\n } \r\n\r\n if (!checked2) { \r\n document.getElementById('checkboxDiv2').focus();\r\n alert(\"Contesta la pregunta 6\");\r\n return false;\r\n } \r\n\r\n if (document.getElementById('sel').selectedIndex==0) {\r\n document.getElementById('sel').focus();\r\n alert(\"Contesta la pregunta 7\");\r\n return false;\r\n } \r\n\r\n if (document.getElementById('sel2').selectedIndex==0) {\r\n document.getElementById('sel2').focus();\r\n alert(\"Contesta la pregunta 8\");\r\n return false;\r\n } \r\n\r\n if (document.getElementById('mul').selectedIndex<0) {\r\n document.getElementById('mul').focus();\r\n alert(\"Selecciona al menos una opcion de la pregunta 9\");\r\n return false;\r\n } \r\n\r\n if (document.getElementById('mul2').selectedIndex<0) {\r\n document.getElementById('mul2').focus();\r\n alert(\"Selecciona al menos una opcion de la pregunta 10\");\r\n return false;\r\n } \r\n\r\n else return true;\r\n\r\n\r\n}", "function activarArrastradoPuntos(activar){\r\n if(activar){\r\n dragPuntosRuta.activate();\r\n }else{\r\n dragPuntosRuta.deactivate();\r\n selectFeatures.activate();\r\n }\r\n}", "function agregarCurso(e) {\r\n\r\n // Ponemos una excepcion para que al momento de hacer clic sobre el div solo se seleccione una clase\r\n e.preventDefault();\r\n\r\n if (e.target.classList.contains('boton')) {\r\n\r\n const cursoSeleccionado = e.target.parentNode;\r\n\r\n console.log(cursoSeleccionado)\r\n listarCursos(cursoSeleccionado);\r\n }\r\n\r\n}", "function siguienteSeccion(){\n document.getElementById('segundaParte').style.display='block';\n document.getElementById('primeraParte').style.display='none';\n document.getElementById('Errores').style.display='none';\n document.getElementById('Exitoso').style.display='none';\n}", "function ClickEstilo(nome_estilo, id_select_secundario) {\n var select_secundario = Dom(id_select_secundario);\n if (nome_estilo == 'uma_arma' || nome_estilo == 'arma_escudo' || nome_estilo == 'arma_dupla' || nome_estilo == 'rajada' || nome_estilo == 'tiro_rapido') {\n select_secundario.disabled = true;\n } else if (nome_estilo == 'duas_armas') {\n select_secundario.disabled = false;\n } else {\n Mensagem(Traduz('Nome de estilo invalido') + ': ' + Traduz(nome_estilo));\n }\n AtualizaGeral();\n}", "function mostrarSedesCarrera() {\n let carreraSelect = this.dataset.codigo;\n let carrera = buscarCarreraPorCodigo(carreraSelect);\n let listaCursos = getListaCursos();\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n let codigosCursos = [];\n\n for (let i = 0; i < carrera[7].length; i++) {\n codigosCursos.push(carrera[7][i]);\n }\n\n for (let j = 0; j < listaCursos.length; j++) {\n for (let k = 0; k < codigosCursos.length; k++) {\n if (listaCursos[j][0] == codigosCursos[k]) {\n listaCheckboxCursos[j].checked = true;\n }\n }\n }\n verificarCheckCarreras();\n}", "function quitarSeleccion(mensaje){\n\n // Remueve la clase lesionActiva de cada elemento <li> de la lista #listaLesiones\n // Esto elimina el efecto de selección de la lesión\n $('.body_m_lesiones > .item_lesion').each(function (indice , elemento) {\n $(elemento).removeClass('lesionActiva');\n });\n\n // Remueve la clase lesionActiva de cada elemento <li> de la lista\n // #cont-barraFracturasSelectId\n // Elimina de la barra superior todas las lesiones\n $('#cont-barraFracturasSelectId li').each(function (indice , elemento) {\n $(elemento).remove();\n });\n\n // Setear variable global\n seleccion = false;\n\n var msjExito = false;\n\n // Si no hay ninguna selección no saco el mensaje de exito\n if (infoLesion.length > 0) {\n msjExito = true;\n }\n\n // Vaciar información de la selección\n infoLesion = [];\n\n // Actualizar valor de la cantidad de lesiones seleccionadas\n var bola_plus = document.getElementById('bola_plus');\n bola_plus.setAttribute('fracturasSeleccionadas' , '0');\n\n\n // Muestra la alerta si la variable mensaje es true\n // Esta condición se ejecuta cuando elimino toda la selección\n if (mensaje) {\n\n if (msjExito) {\n // alerta de exito de eliminación\n Notificate({\n tipo: 'success',\n titulo: 'Operación exitosa',\n descripcion: 'Se a eliminado la seleccion de las lesiones correctamente.',\n duracion: 4\n });\n }else {\n // alerta de información cuando no hay seleccion\n Notificate({\n tipo: 'info',\n titulo: 'Informacion:',\n descripcion: 'No hay ninguna selección.',\n duracion: 4\n });\n }\n\n }\n\n }", "function selectEventi(evt, tipoRecensione, tipoProfilo) {\r\n var i, tabcontent, button;\r\n \r\n // Prendo tutti gli elementi con class=\"tabcontent\" and li nascondo\r\n tabcontent = document.getElementsByClassName(\"tabcontent\" + tipoProfilo);\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n \r\n // Prendo tutti gli elementi con class=\"button\" e rimuovo la classe \"active\"\r\n button = document.getElementsByClassName(\"btn-profilo\");\r\n for (i = 0; i < button.length; i++) {\r\n button[i].className = button[i].className.replace(\" active\", \"\");\r\n }\r\n \r\n // Mostro la tab corrente e aggiungo un \"active\" class al bottone che ha aperto tab\r\n $(\".\" + tipoRecensione + tipoProfilo).css(\"display\",\"block\");\r\n evt.currentTarget.className += \" active\";\r\n \r\n if(tipoRecensione=='OspitatoProfilo'){\r\n $(\".OspitatoProfilo\" + tipoProfilo).empty(); //svuoto la tab\r\n appendRecensioni('Ospitato',tipoProfilo);\r\n }\r\n \r\n else if(tipoRecensione=='OspitanteProfilo'){\r\n $(\".OspitanteProfilo\" + tipoProfilo).empty();//svuoto la tab\r\n appendRecensioni('Ospitante',tipoProfilo);\r\n }\r\n}", "function elegidoSelect() {\n //recogemos el destino que se ha elegido.\n var elegidoSel = document.getElementById('otro').value;\n if (elegidoSel == \"\") {\n //si no se ha elegido ninguno volvemos a la funcion de inicio\n inicio();\n }\n\n //si si que se ha elegido alguno, lo llevamos a su funcion personalizada\n else if (elegidoSel == 'VQC') {\n vqc();\n } else if (elegidoSel == 'P.COLORES') {\n colores();\n } else if (elegidoSel == 'MALVINAS') {\n malvinas();\n } else {\n fin();\n }\n}", "function pintarPresionado(e){\n if (mousePrecionado === true) {\n cambiarColorGrilla(e);\n }\n}", "selectCity(){\n browser.click('#cmbCiudades');\n browser.click(`#cmbCiudades > option:nth-child(107)`);\n\n //browser.pause(6000);\n /* \n let annoyingBanner = browser.isExisting('#takeover-close');\n\n if (annoyingBanner == true) {\n browser.click('#takeover-close')\n browser.waitUntil(annoyingBanner == false, 7000)\n browser.click('#cmbCiudades');\n browser.click(`#cmbCiudades > option:nth-child(107)`);\n }\n\n else {\n browser.click('#cmbCiudades');\n browser.click(`#cmbCiudades > option:nth-child(107)`); \n } */\n \n }", "function mousePressedTeam() {\n if(mainMenu.selected)\n {\n mainMenu.selected=false;\n clearSelected();\n screen=1;\n }\n if(tactics.selected)\n {\n tactics.selected=false;\n currentSelect=[];\n screen = 7; //7\n }\n if(transfers.selected)\n {\n transfers.selected=false;\n currentSelect=[];\n screen = 8; //8\n }\n if(info.selected)\n {\n info.selected=false;\n currentSelect=[];\n screen = 9; //9\n }\n}", "function checkSelection(tipo, destino){\n\n\tif ( get('frmBuscar.txtNombrePerfil') != ''\n\t\t && (validaChars(get('frmBuscar.txtNombrePerfil')) == false) )\n\t{\n\t\tcdos_mostrarAlert(GestionarMensaje('121'));\n\t\tfocaliza('frmBuscar.txtNombrePerfil');\n\t\treturn false;\t\t\t\t\t\t\n\t}\n\t\n\tif(tipo!=\"busca\"){\n\t\tif(lstResultado.seleccion.longitud!=1){\n\t\t\tGestionarMensaje('50',null,null,null);\n\t\t\treturn false;\n\t\t}\n\t}\n\t/*\n\telse{\n\t\tif(get(\"frmBuscar.txtNombrePerfil\")==\"\"){\n\t\t\tGestionarMensaje('9');\n\t\t\treturn false;\n\t\t}\n\t}\n\t*/\n\tset('frmBuscar.accion',tipo);\n\tif(tipo=='elimina')\n\t{\t\t\t\t\t\n\t\tif(!window.confirm(GestionarMensaje('51',null,null,null)+\" \"+lstResultado.getSeleccion() + \" ?\"))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\tif(get('frmBuscar.seleccion')==\"\"){\n\t\tset('frmBuscar.seleccion',lstResultado.getSeleccion());\n\t}\n\tpostForm(tipo==\"busca\");\n}", "function drawSelections() {\n\t\thideSelectionRect();\n\t}", "function choosesquere(evt) {\n var mousePos = getMousePos(canvas, evt);\n var message = 'Mouse position: ' + mousePos.x + ',' + mousePos.y;\n var board_left=canvas.width-(canvas.width*9.5/10);\n var board_top=canvas.width-(canvas.width*9.25/10);\n var board_size=canvas.width*9/10;\n var leftspace=canvas.width-(canvas.width*9/10);\n\n if((mousePos.x>=board_left)&&(mousePos.x<=board_size+board_left)&&(mousePos.y>=board_top)&&(mousePos.y<=board_size+board_top)){\n //pastaudimu fiksavimas\n // 1-langelis\n //btclicksound.play();\n gamesounds(\"click\",mute);\n if((mousePos.x<=board_size/3+board_left)&&(mousePos.y<=board_size/3+board_top)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[0]==2){\n kur_piesti_x_ir_o[0]=1;\n which_player=0;\n kas_eina=\"O\";\n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[0]==2){\n kur_piesti_x_ir_o[0]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n //2-as langelis\n else if((mousePos.x>=board_size/3+board_left)&&(mousePos.y<board_size/3+board_top)&&(mousePos.x<=board_size/3*2+board_left)&&(mousePos.y<board_size/3+board_top)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[1]==2){\n kur_piesti_x_ir_o[1]=1;\n which_player=0;\n kas_eina=\"O\"; \n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[1]==2){\n kur_piesti_x_ir_o[1]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n //3-as langelis\n else if((mousePos.x>board_size/3*2+board_left)&&(mousePos.y<=board_size/3+board_top)&&(mousePos.x<board_size+board_left)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[2]==2){\n kur_piesti_x_ir_o[2]=1;\n which_player=0;\n kas_eina=\"O\"; \n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[2]==2){\n kur_piesti_x_ir_o[2]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n //4-as langelis\n else if((mousePos.x<=board_size/3+board_left)&&(mousePos.y<board_size/3*2+board_top)&&(mousePos.x<=board_size/3*2+board_left)&&(mousePos.y>board_size/3+board_top)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[3]==2){\n kur_piesti_x_ir_o[3]=1;\n which_player=0;\n kas_eina=\"O\"; \n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[3]==2){\n kur_piesti_x_ir_o[3]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n\n //5-as langelis\n else if((mousePos.x>board_size/3+board_left)&&(mousePos.y<=board_size/3*2+board_top)&&(mousePos.x<board_size/3*2+board_left)&&(mousePos.y>=board_size/3+board_top)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[4]==2){\n kur_piesti_x_ir_o[4]=1;\n which_player=0;\n kas_eina=\"O\";\n turn_count++; \n }\n \n }\n else{\n if(kur_piesti_x_ir_o[4]==2){\n kur_piesti_x_ir_o[4]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n //6-as langelis\n else if((mousePos.x<=board_size+board_left)&&(mousePos.y<board_size/3*2+board_top)&&(mousePos.x>=board_size/3*2+board_left)&&(mousePos.y>board_size/3+board_top)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[5]==2){\n kur_piesti_x_ir_o[5]=1;\n which_player=0;\n kas_eina=\"O\"; \n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[5]==2){\n kur_piesti_x_ir_o[5]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n //7-as langelis\n else if((mousePos.x<board_size/3+board_left)&&(mousePos.y>=board_size/3*2+board_top)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[6]==2){\n kur_piesti_x_ir_o[6]=1;\n which_player=0;\n kas_eina=\"O\"; \n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[6]==2){\n kur_piesti_x_ir_o[6]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n //8-as langelis\n else if((mousePos.x>=board_size/3+board_left)&&(mousePos.y>board_size/3*2+board_top)&&(mousePos.x<=board_size/3*2+board_left)&&(mousePos.y>board_size/3*2+board_top)){\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[7]==2){\n kur_piesti_x_ir_o[7]=1;\n which_player=0;\n kas_eina=\"O\"; \n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[7]==2){\n kur_piesti_x_ir_o[7]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n }\n \n }\n }\n\n else{\n ejimai++;\n if(which_player==1){\n if(kur_piesti_x_ir_o[8]==2){\n kur_piesti_x_ir_o[8]=1;\n which_player=0;\n kas_eina=\"O\"; \n turn_count++;\n }\n \n }\n else{\n if(kur_piesti_x_ir_o[8]==2){\n kur_piesti_x_ir_o[8]=0;\n which_player=1;\n kas_eina=\"X\";\n turn_count++;\n } \n }\n }\n //--------\n thetimeleft=45;\n } \n socket.emit('turn',{\n xo0: kur_piesti_x_ir_o[0],\n xo1: kur_piesti_x_ir_o[1],\n xo2: kur_piesti_x_ir_o[2],\n xo3: kur_piesti_x_ir_o[3],\n xo4: kur_piesti_x_ir_o[4],\n xo5: kur_piesti_x_ir_o[5],\n xo6: kur_piesti_x_ir_o[6],\n xo7: kur_piesti_x_ir_o[7],\n xo8: kur_piesti_x_ir_o[8],\n turn_count: turn_count,\n kas_eina: kas_eina,\n which_player: which_player,\n end_rezult: end_rezult,\n thetimeleft: thetimeleft,\n turn_text_color: turn_text_color,\n end_card_text_size: end_card_text_size \n }); \n on_off_ingame_click(which_player);\n gamelogic(turn_count);\n }", "function existe_filtro() {\n\n var filtros = document.getElementById(\"sfiltro\");\n var options = filtros.options;\n if (options[1].selected ||\n options[2].selected ||\n options[3].selected ||\n options[4].selected ||\n options[5].selected) {\n return true;\n }\n return false;\n}", "checkCursorIsInSelection(widget, point) {\n if (isNullOrUndefined(this.start) || this.isEmpty || isNullOrUndefined(widget)) {\n return false;\n }\n let isSelected = false;\n do {\n if (this.selectedWidgets.containsKey(widget)) {\n let top;\n let left;\n if (widget instanceof LineWidget) {\n top = this.owner.selection.getTop(widget);\n left = this.owner.selection.getLeft(widget);\n }\n else {\n top = widget.y;\n left = widget.x;\n }\n let widgetInfo = this.selectedWidgets.get(widget);\n isSelected = widgetInfo.left <= point.x && top <= point.y &&\n top + widget.height >= point.y && widgetInfo.left + widgetInfo.width >= point.x;\n }\n widget = (widget instanceof LineWidget) ? widget.paragraph : widget.containerWidget;\n } while (!isNullOrUndefined(widget) && !isSelected);\n return isSelected;\n }", "get hasSelection() {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[0] !== end[0] || start[1] !== end[1];\n }", "function ordenar() {\n let seleccion = $(\"#miSeleccion\").val().toUpperCase();\n popularListaCompleta();\n listaCompletaClases = listaCompletaClases.filter(Clase => Clase.dia ==\n seleccion);\n renderizarProductos();\n}", "function estaGirando(){\r\n\treturn idsSpinners.length > 0;\r\n}", "function select(){\n var Country = document.getElementById(\"Country\").value;\n var Users = document.getElementById(\"Users\").value;\n\n\n if(Country==\"All\" && Users==\"All\"){start()} //calls the initial overview drawing\n else{\n update(Country , Users); //updates the drawing according to the selection\n select1();\n }\n }", "function seleccionaCategoria() {\n document.getElementById('seleccionaCategoria').style.display = \"none\"\n if ((document.getElementById('r1').checked)) {\n tipo = \"cine\"\n } else {\n tipo = \"turismo\";\n }\n siguientePregunta();\n document.getElementById('preguntas').style.display = \"inline\";\n}", "function agregarCurso(e) {\n e.preventDefault();\n\n //2° Nos aseguramos que el usuario haya hecho click en agregar carrito\n if (e.target.classList.contains(\"agregar-carrito\")) {\n // 3° Y accedemos a todo el div que tiene el contenedor del curso\n //Situarse en el padre del elemento e.target.parentElement.parentElement)\n const cursoSeleccionado = e.target.parentElement.parentElement;\n\n leerDatosCurso(cursoSeleccionado);\n }\n}", "function radSelected() {\n\ttempActive = false;\n\tlocationActive = false;\n\tradActive = true;\n\tco2Active = false;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function clickable (){\n\tif ((window.innerHeight + window.scrollY) + 15 >= document.body.offsetHeight){\n\t\tvar cercles = d3.selectAll(\"g.loby\"+choices.length+\" path\")\n\t\t\t\t\t\t.style(\"cursor\", \"pointer\");\n\t\tcercles.on(\"click\", function (d,i){\n\t\t\t// On supprime l'écoute de l'événement\n\t\t\tcercles.on(\"mouseover\", function (){});\n\t\t\tcercles.on(\"mouseout\", function (){});\n\t\t\tcercles.on(\"click\", function (){});\n\n\t\t\t// On vire les cercles non selectionnés\n\t\t\tvar avirer = d3.selectAll(\"g:not(.cercle\"+i+\"loby\"+choices.length+\")\")\n\t\t\tavirer.transition()\n\t\t\t\t\t.duration(timetransition)\n\t\t\t\t\t.attr(\"transform\", \"translate(\"+(-2500)+\", \"+2500+\")\");\n\n\t\t\t// Traitement de l'élément cliqué\n\t\t\tvar selected = d3.select(\"g.cercle\"+i+\"loby\"+choices.length);\n\t\t\tselected.transition()\n\t\t\t\t\t.duration(timetransition)\n\t\t\t\t\t.attr(\"transform\", \"translate(\"+(0.5*width)+\", \"+(0.5*height)+\")\")\n\t\t\tselected.select(\"path\")\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(timetransition)\n\t\t\t\t\t.attr(\"d\", arc.outerRadius(function (){\n\t\t\t\t\t\treturn outerRadius;\n\t\t\t\t\t}))\n\t\t\tselected.select(\"text\")\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(timetransition)\n\t\t\t\t\t.attr(\"transform\", function (){\n\t\t\t\t\t\tvar textpos = this.getBoundingClientRect();\n\t\t\t\t\t\tvar string=\"translate(\";\n\t\t\t\t\t\tstring += (-textpos.right + textpos.left)/2;\n\t\t\t\t\t\tstring += \", \";\n\t\t\t\t\t\tstring += (-0.3*height);\n\t\t\t\t\t\tstring += \")\";\n\t\t\t\t\t\treturn string;\n\t\t\t\t\t})\n\n\t\t\t// Mémorisation du choix utilisateur\n\t\t\tvar indice = Number(selected.attr(\"class\")[6]);\n\t\t\tchoices.push(themelist[indice]);\n\t\t\tnbloby = piedata[indice];\n\t\t\tconsole.log(\"nbloby = \"+nbloby);\n\t\t\ttabnbloby.push(nbloby);\n\t\t\tconsole.log(tabnbloby);\n\n\t\t\t// Affichage du choix utilisateur dans #answers\n\t\t\tvar nbchoix = choices.length;\n\t\t\tif (nbchoix===1){\n\t\t\t\tvar element = d3.select(\"span.theme\");\n\t\t\t\telement.text(choices[0]);\n\t\t\t} else if (nbchoix===2){\n\t\t\t\tvar element = d3.select(\"span.position\");\n\t\t\t\telement.text(choices[1]);\n\t\t\t} else if (nbchoix===3){\n\t\t\t\tvar element = d3.select(\"span.type\");\n\t\t\t\telement.text(choices[2]);\n\t\t\t} else if (nbchoix===4){\n\t\t\t\tvar element = d3.select(\"span.secteur\");\n\t\t\t\telement.text(choices[3]);\n\t\t\t} else if (nbchoix===5){\n\t\t\t\tvar element = d3.select(\"span.country\");\n\t\t\t\telement.text(choices[4]);\n\t\t\t}\n\n\t\t\t// Création des nouvelles sections\t\n\t\t\td3.select(\"#sections\")\n\t\t\t\t.append(\"section\")\n\t\t\t\t.attr(\"id\", \"sec\"+(currentIndex+1))\n\t\t\t\t.append(\"p\")\n\t\t\t\t.text(function (){\n\t\t\t\t\treturn \"Chargement de nouvelles données\"\n\t\t\t\t})\n\t\t\t// Si nbloby = 1, une section suffit pour afficher le résultat\n\t\t\tif (nbloby!==1){\n\t\t\t\td3.select(\"#sections\")\n\t\t\t\t\t.append(\"section\")\n\t\t\t\t\t.attr(\"id\", \"sec\"+(currentIndex+2))\n\t\t\t\t\t.append(\"p\")\n\t\t\t\t\t.text(function (){\n\t\t\t\t\t\treturn \"Ceci est un test\"\n\t\t\t\t\t})\n\t\t\t}\n\n\t\t\t// MAJ des coordonnées des sections\n\t\t\tmajsectionspos();\n\n\t\t\t// On charge les données pour le choix suivant\n\t\t\tloadNewData();\n\t\t\tif (nbloby===1){\n\t\t\t\tgenerateResult();\n\t\t\t} else {\n\t\t\t\tgeneratePie();\n\t\t\t}\n\t\t})\n\t} else {\n\t\tvar cercles = d3.selectAll(\"path\")\n\t\t\t\t\t\t.style(\"cursor\", \"default\");\n\t\tcercles.on(\"click\", function (){});\n\t}\n}", "function choicePiramide(id){\r\n //variabili per id non selezionati\r\n var aelem1;\r\n var aelem2;\r\n \r\n //recupero il numero dell'id che ha generato il click\r\n var num = parseInt(id.charAt(id.length-1));\r\n \r\n if(num == 1){\r\n aelem1 = 'pir2';\r\n aelem2 = 'pir3';\r\n }\r\n else{\r\n if(num == 2){\r\n aelem1 = 'pir1';\r\n aelem2 = 'pir3';\r\n }\r\n else{\r\n aelem1 = 'pir1';\r\n aelem2 = 'pir2';\r\n }\r\n }\r\n setTimeout(function() {\r\n document.getElementById(id).setAttribute(\"visible\", false);\r\n document.getElementById(aelem1).setAttribute(\"visible\", false);\r\n document.getElementById(aelem2).setAttribute(\"visible\", false);\r\n document.getElementById(\"mobile\").setAttribute(\"visible\",false);\r\n document.getElementById(\"cursore\").setAttribute(\"visible\",false);\r\n }, 1000);\r\n \r\n feedbackPiramide(id); \r\n}", "function suivant(){\n if(active==\"idee\"){\n reunion_open();\n }else if (active==\"reunion\") {\n travail_open();\n }else if (active==\"travail\") {\n deploiement_open();\n }\n }", "function verificaTipo() {\n\n\t/*\n\tvar x = document.getElementById(\"tipo\").value;\n\tdocument.getElementById(\"demo\").innerHTML = \"You selected: \" + x;\n\n\tvar y = document.getElementById(\"tipoTrekking\").value;\n\tdocument.getElementById(\"demo2\").innerHTML = \"You selected: \" + y;\n\n\tvar z = document.getElementById(\"dificuldade\").value;\n\tdocument.getElementById(\"demo3\").innerHTML = \"You selected: \" + z;\n\t*/\n\n\t//Apos clicar, nao deixar escolher novamente pois ira bugar\n\t$(\"#tipo\").attr(\"disabled\", true);\n\t$(\"#tipo\").material_select();\n\n\t//Se for prelecao\n\tif($(\"#tipo\").find(\":selected\").val() == 1) {\n\t\t//Mostrar o campo para inserir a data da prelecao\n\t\t$(\"#dataPrelecao\").css(\"display\", \"block\");\n\t}\n\t\n\t//Se for trekking\n\tif($(\"#tipo\").find(\":selected\").val() == 2) {\n\t\t//mostrar os campos dificuldade e tipo do trekking\n\t\t$(\"#DificuldadeETipodoTrekking\").css(\"display\", \"block\");\n\t\t//Mostrar o campo para inserir a data do trekking\n\t\t$(\"#dataTrekking\").css(\"display\", \"block\");\n\t}\n\t\n\t//Se for acampa\n\tif($(\"#tipo\").find(\":selected\").val() == 3) {\n\t\t//Sumir dificuldade e colocar a dificuldade que ocupa todo o espaco\n\t\t$(\"#dificuldadeAcamp\").css(\"display\", \"block\");\n\t\t//Mostrar o campo para inserir a data do acampamento\n\t\t$(\"#dataAcampamento\").css(\"display\", \"block\");\n\t}\n\telse {\n\t\t$(\"#dataFim\").attr(\"disabled\", true);\n\t}\n}", "function formulario_validar_logistica_categoria() {\n if ($(\"#slc-icono li[name='categoria-icono'][aria-selected='true']\").length === 0) {\n $(\"#slc-icono-helptext\").css(\"aria-hidden\", \"false\");\n $(\"#slc-icono-helptext\").css(\"opacity\", 1);\n\n return false;\n } else {\n $(\"#slc-icono-helptext\").css(\"aria-hidden\", \"true\");\n $(\"#slc-icono-helptext\").css(\"opacity\", 0);\n }\n\n return true;\n}", "removeSelection() {\n let isFirst = true;\n if (this.selector.nodesAreSelected() || this.selector.loopsAreSelected() || this.selector.edgesAreSelected()) {\n if (this.selector.nodesAreSelected()) {\n this.selector.selectedNodes.forEach((node, i) => this.removeNodeCommand(node, i === 0 && isFirst));\n this.svgsManager.nodeManager.update();\n isFirst = false;\n }\n if (this.selector.loopsAreSelected()) {\n this.selector.selectedLoops.forEach((loop, i) => this.removeLoopCommand(loop, i === 0 && isFirst));\n this.svgsManager.loopManager.update();\n isFirst = false;\n }\n if (this.selector.edgesAreSelected()) {\n this.selector.selectedEdges.forEach((edge, i) => this.removeEdgeCommand(edge, i === 0 && isFirst));\n this.svgsManager.edgeManager.update();\n isFirst = false;\n }\n this.selector.resetSelection();\n return true;\n }\n InterfaceAndMisc_1.CustomWarn(\"Nothing to delete\");\n return false;\n }", "function locateSingleChoice () {\n\td3.selectAll (\"g#vertices circle\").each(function (h,i){\n\t\tvar vtx = d3.select(this);\n\t\tvtx.classed(\"singlechoice\", false);\n\t\tvar isBorder = false;\n\t\tfor (let g of h.ds.vertexCirculator(h)) {\n\t\t\tif (g.isBorder) {\n\t\t\t\tisBorder = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!isBorder) return;\n\t\tvar vtype = vertexNodeType(h);\n\t\tvar matches = archMatch(vtype);\n\t\tif (matches.length == 1) {\n\t\t\td3.select(this).classed(\"singlechoice\", true);\n\t\t}\t\n\t});\n}", "function selectObject(item){\n \n //Deselecciono todo\n deselectObjects();\n \n //Selecciono el nuevo elemento\n item.classList.add(\"selected\");\n \n}", "function resaltar(boton) {\n\tif(boton.seleccionado==null || !boton.seleccionado) {\n\t\tboton.fondo1=boton.style.backgroundColor\n\t\tboton.style.backgroundColor='#CCDEEB'\n\t}\n\treturn true\n}", "function selectProfile(prof){\n\n\tvar profHandle = $(prof).parent('.mainListItem').find('p.profhandle').text();\n\n\t//Check if profile is in the selectedProfs array\n\tif(selectedProfs.includes(profHandle)){\n\t\t//If in array, remove, re-enab;e hover and change color back to dark\n\t\tselectedProfs.splice(selectedProfs.indexOf(profHandle), 1);\n\t\tupdateJSON();\n\t\tenableHover(prof);\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#444444\"}, 100);\n\t}else{\n\t\t//If not in array, add to array, remove hover events and make item green\n\t\tselectedProfs.push(profHandle);\n\t\tupdateJSON();\n\t\t$(prof).parent('.mainListItem').unbind('mouseenter mouseleave');\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#417f50\"}, 100);\n\t\n\t}\n\n}", "checkSelection_() {\n const {activeElement} = this.win_.document;\n\n if (!activeElement) {\n return;\n }\n\n const changeOccurred = activeElement !== this.lastSelection_;\n\n if (activeElement.tagName === 'IFRAME' && changeOccurred) {\n this.incrementFrameClick_(activeElement);\n }\n\n this.lastSelection_ = activeElement;\n }", "function comprobar()\r\n{\r\n f=document.getElementById(\"in_1\").getElementsByTagName(\"input\")[0].value;\r\n checked=false;\r\n if (f==\"\")\r\n { \r\n document.getElementById(\"in_1\").elements[0].focus();\r\n alert(\"Introduce una respuesta: Pregunta 1\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_2\");\r\n checked=false;\r\n if (f.selectedIndex==0)\r\n { \r\n document.getElementById(\"in_2\").focus();\r\n alert(\"Selecciona una opción: Pregunta 2\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_3\").getElementsByTagName(\"option\");\r\n checked=false;\r\n for (i = 0; i < f.length; i++)\r\n {\r\n if (f[i].selected) checked=true;\r\n }\r\n if (!checked)\r\n { \r\n document.getElementById(\"in_3\").focus();\r\n alert(\"Selecciona alguna/s opción/es: Pregunta 3\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_4\").elements[\"checkbox\"];\r\n checked=false;\r\n for (i = 0; i < f.length; i++)\r\n {\r\n if (f[i].checked) checked=true;\r\n }\r\n if (!checked)\r\n { \r\n document.getElementById(\"in_4\").elements[0].focus();\r\n alert(\"Selecciona una opción del checkbox: Pregunta 4\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_5\").elements[\"radio\"];\r\n checked=false;\r\n for (i = 0; i < f.length; i++)\r\n {\r\n if (f[i].checked) checked=true;\r\n }\r\n if (!checked)\r\n { \r\n document.getElementById(\"in_5\").elements[0].focus();\r\n alert(\"Selecciona una opción: Pregunta 5\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_6\").getElementsByTagName(\"input\")[0].value;\r\n checked=false;\r\n if (f==\"\")\r\n { \r\n document.getElementById(\"in_6\").elements[0].focus();\r\n alert(\"Introduce una respuesta: Pregunta 6\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_7\");\r\n checked=false;\r\n if (f.selectedIndex==0)\r\n { \r\n document.getElementById(\"in_7\").focus();\r\n alert(\"Selecciona una opción: Pregunta 7\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_8\").getElementsByTagName(\"option\");\r\n checked=false;\r\n for (i = 0; i < f.length; i++)\r\n {\r\n if (f[i].selected) checked=true;\r\n }\r\n if (!checked)\r\n { \r\n document.getElementById(\"in_8\").focus();\r\n alert(\"Selecciona alguna/s opción/es: Pregunta 8\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_9\").elements[\"checkbox\"];\r\n checked=false;\r\n for (i = 0; i < f.length; i++)\r\n {\r\n if (f[i].checked) checked=true;\r\n }\r\n if (!checked)\r\n { \r\n document.getElementById(\"in_9\").elements[0].focus();\r\n alert(\"Selecciona una opción del checkbox: Pregunta 9\");\r\n return false;\r\n }\r\n\r\n f=document.getElementById(\"in_10\").elements[\"radio\"];\r\n checked=false;\r\n for (i = 0; i < f.length; i++)\r\n {\r\n if (f[i].checked) checked=true;\r\n }\r\n if (!checked)\r\n { \r\n document.getElementById(\"in_10\").elements[0].focus();\r\n alert(\"Selecciona una opción: Pregunta 10\");\r\n return false;\r\n }\r\n else return true;\r\n}", "function _alreadySelected(hero){\n if(_alliedTeam.indexOf(hero) === -1 && _enemyTeam.indexOf(hero) === -1){\n return true;\n } else {\n return false;\n }\n}", "selectChores(first, second, bot, count) {\n const getScores = this.getScores\n const randChoice = () => Math.random()\n randChoice() > 0.3\n ? this.executioner(first, bot, getScores, count) &&\n this.setState({ choreList: 'Indoor Chores' })\n : this.executioner(second, bot, getScores, count) &&\n this.setState({ choreList: 'Outdoor Chores' })\n }", "function isSelect() {\r\n let isBlack = false;\r\n for (let i = 1; i <= 5; i++) {\r\n let curDice = \"dice\" + i;\r\n let dicePath = document.getElementById(curDice).src;\r\n if (dicePath.includes('black')) {\r\n isBlack = true;\r\n }\r\n }\r\n return isBlack;\r\n}", "function precipitacion() {\n if ($(this).is(\":checked\"))\n {\n if ($(this).val() !== 'todos') {\n capa_actual = $(this).val();\n }\n conmutar_cobertura($(this).val(), true);\n $(\"#div_leyenda\").show();\n } else {\n capa_actual = '';\n conmutar_cobertura($(this).val(), false);\n if (listado_capas.length <= 1) {\n $(\"#div_leyenda\").hide();\n }\n }\n actualizar_coberturas();\n map.data.setStyle(style_bf);\n}", "function drawItemSelection(x,y,w,h,id){\n\t\n\tif (numberSelected() == 1) { //Change to == numberRuleItems\n\t\tallowed = false;\n\t} else if (numberSelected() == 0) { // < numberRuleItems\n\t\tallowed = true;\n\t}\n\t\tconsole.log(ruleType, ruleNumber, ruleColor)\n\t\n\t//Depending on which item you draw... Do the following...\n\tvar img = borderImage2; // deselected\n\tif (id == \"hat\"){\n\t\tif (hatSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[2] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (hatSelected){\n\t\t\t\t\thatSelected = false; // Hat selected\n\t\t\t\t} else if (allowed==true) {hatSelected = true;}\n\t\t\t\tconsole.log(\"hat selected.\")\n\t\t}, null, function() {});\n\t}\n\n\tif (id == \"shirt\"){\n\t\tif (shirtSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[3] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (shirtSelected){\n\t\t\t\t\tshirtSelected = false; // shirt selected\n\t\t\t\t}else if (allowed==true) {shirtSelected = true;}\n\t\t\t\tconsole.log(\"shirt selected.\")\n\t\t}, null, function() {});\t\t\n\t}\n\n\tif (id == \"pants\"){\n\t\tif (pantsSelected == true){\n\t\t\timg = borderImage; // selected\t\t\n\t\t}\n\t\tuiObjects[4] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (pantsSelected){\n\t\t\t\t\tpantsSelected = false; // pants selected\n\t\t\t\t}else if (allowed==true) {pantsSelected = true;}\n\t\t\t\tconsole.log(\"pants selected.\")\n\t\t}, null, function() {});\n\t}\n\n\tif (id == \"shoes\"){\n\t\tif (shoesSelected == true){\n\t\t\timg = borderImage; // selected\t\t\n\t\t}\n\t\tuiObjects[5] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (shoesSelected){\n\t\t\t\t\tshoesSelected = false; // shoes selected\n\t\t\t\t}else if (allowed==true) {shoesSelected = true;}\n\t\t\t\tconsole.log(\"shoes selected.\")\n\t\t}, null, function() {});\n\t}\n\t\n\t\tif (id == \"itemFront\"){\n\t\tif (itemfSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[6] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (itemfSelected){\n\t\t\t\t\titemfSelected = false; // Hat selected\n\t\t\t\t}else if (allowed==true) {itemfSelected = true;}\n\t\t\t\tconsole.log(\"front item selected.\")\n\t\t}, null, function() {});\n\t}\n\t\n\t\tif (id == \"itemBack\"){\n\t\tif (itembSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[7] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (itembSelected){\n\t\t\t\t\titembSelected = false; // Hat selected\n\t\t\t\t}else if (allowed==true) {itembSelected = true;}\n\t\t\t\tconsole.log(\"back item selected.\")\n\t\t}, null, function() {});\n\t}\n\n\t//create a box around each item.\n\tctx.drawImage(img,x,y,w,h);\n}", "function isSelectedCripto(id) {\n\t\treturn selectedCriptoId === id\n\t}", "function draw() {\n\n // If not visible stop.\n var element = get_selected_element();\n if (check_with_parents(element, \"display\", \"none\", \"==\") === true || check_with_parents(element, \"opacity\", \"0\", \"==\") === true || check_with_parents(element, \"visibility\", \"hidden\", \"==\") === true) {\n return false;\n }\n\n // selected boxed.\n draw_box(\".yp-selected\", 'yp-selected-boxed');\n\n // Select Others.\n iframe.find(\".yp-selected-others:not(.yp-multiple-selected)\").each(function (i) {\n draw_other_box(this, 'yp-selected-others', i);\n });\n\n // Tooltip\n draw_tooltip();\n\n // Dragger update.\n update_drag_handle_position();\n\n }", "function choiceSano(id) { \r\n \r\n //recupero coordinata x del cestino e dell'elemento cliccato\r\n var posizione = document.getElementById(id).getAttribute('position');\r\n var xCestino = document.getElementById(\"cestino\").getAttribute(\"position\").x;\r\n var xImg = posizione.x;\r\n var aelem;\r\n \r\n //recupero il numero dell'id che ha generato il click\r\n var num = parseInt(id.charAt(id.length-1));\r\n\r\n //se l'altro elemento è stato spostato torna alla sua posizione originaria\r\n if(num==1) {\r\n document.getElementById(\"elm2\").setAttribute(\"position\", {x: parseFloat(pos2[0]), y: parseFloat(pos2[1]), z: parseFloat(pos2[2])});\r\n aelem = 'elm2';\r\n }\r\n else if(num=2) {\r\n document.getElementById(\"elm1\").setAttribute(\"position\", {x: parseFloat(pos1[0]), y: parseFloat(pos1[1]), z: parseFloat(pos1[2])});\r\n aelem = 'elm1';\r\n }\r\n else \r\n console.log('errore');\r\n \r\n //sposto se non arriva al cestino, fase di scelta iniziata\r\n if(xImg < xCestino+0.2)\r\n document.getElementById(id).setAttribute(\"position\", {x:xImg+0.2, y:2.5, z:posizione.z});\r\n \r\n //butto nel cestino (si avvicina al cestino e sparisce dopo timeout) nonappena raggiungo il cestino stesso e parte la valutazione per feedback\r\n else {\r\n document.getElementById(id).setAttribute(\"position\", {x: xCestino+0.2, y: 1.5, z: posizione.z});\r\n document.getElementById(id).removeAttribute('onmouseenter');\r\n document.getElementById(aelem).removeAttribute('onmouseenter');\r\n setTimeout(function() {\r\n document.getElementById(id).setAttribute(\"visible\", false);\r\n document.getElementById(aelem).setAttribute(\"visible\", false);\r\n }, 1000);\r\n \r\n feedbackSano(id); \r\n } \r\n \r\n}", "function compruebaSexo() {\n var sexo_marcado=false;\n var span_sexo = document.getElementById(\"span_sexo\");\n\n var elementos_sexo = document.getElementsByName(\"sexo\"); // Es un array\n for(i in elementos_sexo) {\n if (elementos_sexo[i].checked) sexo_marcado=true;\n }\n\n if (!sexo_marcado) {\n span_sexo.style.color=\"red\";\n span_sexo.innerHTML=\" Debe seleccionar su sexo\";\n\t sexo=false;\n }\n\t \n\telse {\n\t\tspan_sexo.innerHTML=\"\";\n\t\tsexo=true;\n\t\t}\n}", "function reCheckSelection(doc) {\n\t\t setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n\t\t }", "function showSelectedTry() {\n document.querySelector(\"#TryButHover\").style.visibility = \"visible\";\n document.querySelector(\"#TryAllBut\").style.visibility = \"hidden\";\n }", "function selectCurve(){\n\t//seleciona todos os pontos da curva atual e as torna verde\n\tif(pointCB.checked){\n\t\tvar points = getPoints();\n\t\tfor (var i = points.length - 1; i >= 0; i--) {\n\t\t\tpoints[i].setAttribute(\"fill\", \"green\");\n\t\t}\n\t}\n\t//seleciona todas as linhas da curva atual e as torna roxa\n\tif(lineCB.checked){\n\t\tvar lines = getLines();\n\t\tfor (var i = lines.length - 1; i >= 0; i--) {\n\t\t\tlines[i].setAttribute(\"style\", 'stroke : #a832a0 ; stroke-width : 2');\n\t\t}\n\t}\n\tif(curveCB.checked){\n\t\tvar bezier = getBeziers();\n\t\tfor (var i = bezier.length - 1; i >= 0; i--) {\n\t\t\tbezier[i].setAttribute(\"style\", 'stroke : #fcba03 ; stroke-width : 2');\n\t\t}\n\t}\n}", "function fNivelarPP() {\n document.querySelector(\"#nivelActualEstudianteHTML\").innerHTML=\"\"; //limpiamos HTML que muestra nivel, en caso de que hubiese quedado algo mostrado previamente\n hideEverythingBut(\"#nivelarEstudiantePP\"); //mostramos la sección de nivelación de estudiantes, ocultamos el resto de secciones\n hideAndShow(\"#levelUpEstudianteHTML\", 0); //escondemos el select de nivel\n listaEstudiantesANivelarPP(); //cargamos la lista de estudiantes \n}", "function SesionActivada(val, idCurso) {\n if (val == true) {\n activarSesionCard.hide();\n ListarAsistenciasPorSesion(idCurso);\n asistEstudiantesCard.show();\n } else {\n activarSesionCard.show();\n asistEstudiantesCard.hide();\n }\n}", "function consultarTipoCapaSelected(capa, esCargaShape, fileName) {\n $(\"#modalTipoCapa\").modal(\"hide\");\n\n if(!isNaN(esCargaShape))\n _esCargaShape = esCargaShape;\n\n if(fileName)\n _fileName = fileName;\n\n _capa = capa;\n\n if (_esCargaShape == 0) {\n cargarShapeFile(_fileName);\n }\n else if (_esCargaShape == 1) {\n cargarKML(_fileName);\n }\n else if (_esCargaShape == 2) {\n var elem = $(\"#barraEdicion\");\n\n if (elem.hasClass(\"ocultar\"))\n elem.removeClass(\"ocultar\")\n else\n elem.addClass(\"ocultar\")\n\n drawFeature(_fileName)//en filename va el tipo Poligono o Circulo\n }\n\n}", "function rimuovi_preferiti(event){\n const elemento=event.currentTarget;\n const nodoSup=elemento.parentNode;\n nodoSup.remove();\n const lista_slot=document.querySelectorAll(\"#preferiti div h1\");\n if(lista_slot.length<=0){\n document.querySelector(\"#box_pref\").classList.add(\"nascondi\");\n }\n}", "function selectOption() {\n let selection = document.querySelector('.pveSelect');\n let pveModal = document.querySelector('.pveModal');\n pveModal.style.cssText = 'display: none'; \n first.value = 'X';\n second.value = 'O';\n // determines which parts of code run\n if (selection.value == '2') {\n bestMove();\n GBModule.power('off');\n firstPlayer.winner('X');\n computer.power('off');\n AIGame.switch('on 2');\n playAgainPrompt.playAgain('on');\n } else if (selection.value == '1') {\n GBModule.power('off');\n firstPlayer.winner('X');\n computer.power('off');\n AIGame.switch('on 1');\n AIGame.random();\n playAgainPrompt.playAgain('on');\n\n }\n }" ]
[ "0.62426996", "0.6105681", "0.60525477", "0.6016378", "0.59974015", "0.59609133", "0.595925", "0.5938594", "0.59063834", "0.5868851", "0.5820017", "0.57953286", "0.5793986", "0.5785449", "0.5780483", "0.57760084", "0.57559717", "0.5746923", "0.5744183", "0.56886333", "0.5671236", "0.56538856", "0.5626805", "0.56199324", "0.56182534", "0.56142473", "0.5612747", "0.5607486", "0.56062996", "0.5598841", "0.5590582", "0.5579137", "0.5579137", "0.55787194", "0.5578092", "0.55730027", "0.55727", "0.55628157", "0.5560384", "0.5543415", "0.55430895", "0.55325055", "0.55255187", "0.5520864", "0.5509411", "0.5509074", "0.5508497", "0.5489993", "0.5486651", "0.54864943", "0.54794294", "0.54741865", "0.54671025", "0.5453109", "0.5452631", "0.5446728", "0.54460204", "0.5443071", "0.5434241", "0.54313076", "0.5409194", "0.54058707", "0.54037786", "0.5392598", "0.5389753", "0.5388974", "0.537281", "0.53720224", "0.53674495", "0.5364588", "0.53597033", "0.53570175", "0.53561425", "0.5351255", "0.5350406", "0.5348432", "0.5348146", "0.534311", "0.53424746", "0.5341878", "0.53336364", "0.5309064", "0.53016084", "0.52982855", "0.52970755", "0.52968913", "0.529087", "0.52883184", "0.5286224", "0.52798295", "0.52682614", "0.52662784", "0.5266154", "0.5257485", "0.52565444", "0.52555656", "0.5254039", "0.5253004", "0.52516824", "0.5248413", "0.52451247" ]
0.0
-1
Deshabilita checkboxes de cursos actii
function disableCarreras() { let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]'); for (let i = 0; i < checkboxes.length; i++) { if (!(checkboxes[i].checked)) { checkboxes[i].disabled = true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function excluyentes(seleccionado) {\n programador_web.checked = false; \n logistica.checked = false;\n peon.checked = false;\n \n seleccionado.checked = true; \n}", "function deselectCBs() {\n d3.selectAll('.type-checkbox')\n .property('checked', false)\n update();\n d3.select('.kasiosCheckbox')\n .property('checked', false)\n kasios_update();\n}", "function selChkTodos(form, chkNombre, boo) {\r\n\tfor(i=0; n=form.elements[i]; i++) \r\n\t\tif (n.type == \"checkbox\" && n.name == chkNombre) n.checked = boo;\r\n}", "function selChoco(){\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled) {\r\n sws[i].disabled = false;\r\n }\r\n }\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled == false) {\r\n sav[i].disabled = true;\r\n }\r\n }\r\n}", "function syncronizeCheckboxes(clicked, pri, pub) {\n pri.checked = false;\n pub.checked = false;\n clicked.checked = true;\n }", "function selectCBs() {\n d3.selectAll('.type-checkbox')\n .property('checked', true);\n update();\n d3.select('.kasiosCheckbox')\n .property('checked', true)\n kasios_update();\n}", "function activarcheckbox(bigdata){\n $.each(bigdata, function(key, item) {\n //if(key==\"productos\"){\n let inicial=key.substring(0, 4);\n console.log(key, item, inicial);\n $('input#'+key).iCheck('check');\n if(!getAccess(item, 1)){\n $('#vie'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 2)){\n $('#adi'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 4)){\n $('#edi'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 8)){\n $('#del'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 16)){\n $('#pri'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 32)){\n $('#act'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 64)){\n $('#sel'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 128)){\n $('#pay'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 256)){\n $('#acc'+inicial).iCheck('uncheck')\n }\n //}\n });\n}", "function AcertaAoVoltar() {\r\n $(\":checkbox\").each(function (i) { // obtém a função wrapper que envolve a funcao MarcaCompra definido para\r\n // o evento onclick (se a MarcarCompra existir significa que o checkbox é da prateleira \r\n var fncMarca = $(this).attr(\"onclick\"); // forca o resultado ser convertido para string para ver se a funcao MarcaCompra esta sendo invocada no\r\n // onclick do checked.\r\n if ((\"\" + fncMarca).search(\"MarcarCompra\") > 0) {\r\n $(this).attr(\"checked\", \"\");\r\n }\r\n });\r\n}", "function reactionCheckbox () {\n vArrows = cb1.checked; // Pfeile für Bewegungsrichtung\n bArrows = cb2.checked; // Pfeile für Magnetfeld\n iArrows = cb3.checked; // Pfeile für Induktionsstrom\n if (!on) paint(); // Falls Animation abgeschaltet, neu zeichnen\n }", "function limparFiltros() {\n listarFiltros().forEach((elemento) => {\n elemento.checked = false;\n });\n}", "function tgboxes(el){\n\tvar i, boxes = el.querySelectorAll(\"input[type=checkbox]\");\n\tfor(i=0; i<boxes.length; i++) boxes[i].checked = !boxes[i].checked;\n}", "function chkTodos()\r\n{\r\n $(\":checkbox\").not(\"#chkTodos\").each(function(){\r\n if(this.checked)\r\n this.checked = false;\r\n else\r\n this.checked = true;\r\n });\r\n}", "function deSelectAnswers(){\r\n answer1.forEach((e) =>{\r\n e.checked=false;\r\n });\r\n}", "function diselectAns() {\n\n answers.forEach((selected) => {\n selected.checked = false;\n\n });\n}", "function updateCheckBoxes() {\n const checkboxes = [];\n\n checkboxes.push(document.querySelector('#inspiration'));\n\n checkboxes.push(document.querySelector('#dss1'));\n checkboxes.push(document.querySelector('#dss2'));\n checkboxes.push(document.querySelector('#dss3'));\n\n checkboxes.push(document.querySelector('#dsf1'));\n checkboxes.push(document.querySelector('#dsf2'));\n checkboxes.push(document.querySelector('#dsf3'));\n\n checkboxes.forEach((ele) => {\n if (ele.value === 'true') {\n ele.setAttribute('checked', 'checked');\n } else {\n ele.removeAttribute('checked');\n }\n });\n}", "function marcarLinhaComoSelecionada() {\n $scope.detalhesExcluir.forEach(detalheExcluir => {\n\n for (var i = 0; i < $scope.gestaoVendaResultados.length; i++) {\n\n if (detalheExcluir.idDetalhe == $scope.gestaoVendaResultados[i].idDetalhe) {\n $scope.gestaoVendaResultados[i].isChecked = true;\n break;\n }\n\n }\n })\n }", "function checar_todos() {\n\tvar asign = document.getElementsByName('asignadas')\n\tfor (var i = 0; i < asign.length; i++) {\n\t\tasign[i].checked = true\n\t}\n}", "function disableCursos() {\n let checkboxes = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n checkboxes[i].checked = false;\n checkboxes[i].disabled = true;\n }\n}", "function enableCursos() {\n let checkboxes = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (!(checkboxes[i].checked)) {\n checkboxes[i].disabled = false;\n }\n }\n}", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n\n cb.element.checked = cb.selected;\n }\n }", "function anular_seleccion_cliente() {\n\tvar clientes = document.getElementsByName(\"checkito\");\n\tfor (var i = 1; i <= clientes.length; i++) {\n\t\tnombre_cli = \"cli\" + i;\n\t\tdocument.getElementById(nombre_cli).checked = false;\n\t}\n\tmostrar_ayuda(false);\n}", "function uncheck(e) {\n // console.log(e);\n e.forEach((x) => x.checked = false)\n}", "function eveChck() {\n $('.chgrup').on('click',function(){\n var cuales = $(this).attr('id'); \n if( $(this).prop('checked')) {\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', 'checked');\n });\n }else{\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', false);\n });\n } \n });\n $('.cksub').on('click', function(){\n var mod = $(this).attr('for');\n if( $(this).prop('checked')) {\n if(!$('#'+mod).prop('checked')) {\n $('#'+mod).prop('checked', 'checked');\n } \n }else{\n var cuantas = 0;\n $('input[for ='+ mod +']').each(function(){\n if($(this).prop('checked')) {\n cuantas++;\n }\n });\n if (cuantas == 0) {\n $('#'+mod).prop('checked', false);\n }\n }\n \n });\n}", "function deselectFilter2Checkboxes() {\r\n let checkboxes = document.querySelectorAll('input[name='+filter+']');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = false;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.add(\"hidden\");\r\n \r\n }\r\n document.querySelector(\"#alamkorpused\").style.display = 'none';\r\n}", "function comprueba_puestos() {\nvar cuantos = 0;\nvar elementos = document.getElementsByName(\"puesto\"); // Es un array con los checkbox de nombre puesto\nvar span_puestos= document.getElementById(\"span_puestos\");\n\n\tfor(i in elementos) {\n if (elementos[i].checked) cuantos++;\n\t }\n\n\tif (!cuantos) { // Es lo mismo que cuantos==0\n span_puestos.style.color=\"red\";\n span_puestos.innerHTML=\" Debe seleccionar un puesto de trabajo\";\n puestos=false;\n }\n\t \n else {\n span_puestos.innerHTML=\"\";\n\t puestos=true;\n }\n}", "function checkboxSeleccionados(){\n var contactos = [];\n for(var i = 0; i < checkboxes.length; i++){//for para rellenar el array\n if(checkboxes[i].checked == true){ //establece el estado marcado de una casilla de verificación\n //agregando los check seleccionados con su respectivo id al array\n contactos.push(checkboxes[i].name);\n }\n }\n //creamos funcion para eliminar el contenido seleccionado por un check y un id en este caso contactos que\n //contiene un nùmero de id en el array\n contactosEliminar(contactos);\n}", "function unselect(){\r\n answerEls.forEach((answerEl)=>{\r\n answerEl.checked = false\r\n })\r\n}", "function mostrarTecnicosInactivos() {\n const mostrar = document.getElementById('check-tecnicos').checked;\n const elems = $(\"[data-activo=false]\");\n if (mostrar) {\n elems.css('display', '');\n } else {\n elems.css('display', 'none');\n }\n}", "function js_checkboxen_alle(name)\n\t\t{\n\t\tfor (var x = 0; x < document.forms[0].elements.length; x++)\n\t\t\t{\n\t\t\tvar obj = document.forms[0].elements[x];\n\t\t\t\n\t\t\tif (obj.name != name)\n\t\t\t\tobj.checked = document.form.elements[name].checked;\n\t\t\t}\n\t\t}", "function cbChange(obj) {\nvar instate=(obj.checked);\n var cbs = document.getElementsByClassName(\"cb\");\n for (var i = 0; i < cbs.length; i++) {\n cbs[i].checked = false;\n }\n if(instate)obj.checked = true;\n}", "function handle_checkboxes(){\n\t\t$.each($(\".anthrohack_checkbox\"), function(i, _box){\n\t\t\tvar id = \"#\" + $(_box).attr(\"id\") + \"_hidden\";\n\t\t\t$(_box).change(function(){\n\t\t\t\tif($(_box).prop(\"checked\")){\n\t\t\t\t\t$(id).val(\"on\").trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(id).val(\"off\").trigger('change');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n }\n }", "function toggleAll(name) {\n//name est le debut du nom des cases a cocher \n//exp: <input type=\"checkbox\" name=\"cb_act_<?php echo $oAct->get_id(); ?>\" ...>\n// name est egal a 'cb_act_'\n//'user-all' est le nom de la case qui permet de cocher ttes les autres \n\n\tvar inputs\t= document.getElementsByTagName('input');\n\tvar count\t= inputs.length;\n\tfor (i = 0; i < count; i++) {\n\t\n\t\t_input = inputs.item(i);\n\t\tif (_input.type == 'checkbox' && _input.id.indexOf(name) != -1) {\n\t\t\n\t\t\t_input.checked = document.getElementById('user-all').checked;\n\n\t\t\n\t\t}\n\t\t\n\t}\n \n}", "function uncheckAll(){\n $('#exploration').find('input[type=\"checkbox\"]:checked').prop('checked',false);\n for (var filter in checkboxFilters) {\n checkboxFilters[filter].active = false;\n }\n createDistricts();\n }", "function removeSelect(){\n answerEls.forEach(x=>{\n x.checked=false\n })\n }", "function checarTodosMarcados() {\n const todosOsCheckbox = Array.from(document.querySelectorAll('input[type=checkbox]'));\n console.log(typeof todosOsCheckbox)\n if (todosOsCheckbox.length === 0) {\n todosFeitos = false;\n } else {\n todosFeitos = todosOsCheckbox.every(checkboxIndividual => checkboxIndividual.checked === true);\n }\n }", "unCheck() {\n let checkboxes = document.getElementsByTagName('input');\n for (var i=0; i<checkboxes.length; i++) {\n if (checkboxes[i].type === 'checkbox') {\n checkboxes[i].checked = false;\n }\n }\n }", "function onChangeTipoEnvio() {\n $('#checkboxIsUrgentePedido').removeAttr(\"checked\");\n $('#tdIsUrgente').css('visibility', 'hidden');\n}", "function unselectOther(all) {\n\tvar element = document.getElementsByName('einzelplan[]');\n\tvar einzelplan = document.getElementsByName('einzelplan')[0];\n\n\tif (all) {\n\t\tfor (var i = 0; i < element.length; i++) {\n\t\t\telement[i].checked = false;\n\t\t}\n\t} else {\n\t\tvar allUnchecked = true;\n\n\t\tfor (var i = 0; i < element.length; i++) {\n\t\t\tif (element[i].checked) {\n\t\t\t\tallUnchecked = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (allUnchecked) {\n\t\t\teinzelplan.checked = true;\n\t \t} else {\n\t \t\teinzelplan.checked = false;\n\t \t}\n\t}\n\n\tdocument.getElementsByName('kapitel')[0].checked = true;\n\tresetForms('kapitel');\n\n\tlimitChapters();\n\n}", "function limpiar_terminos()\n{\n\tjQuery('#'+'gridCheck').prop(\"checked\", false);\n}", "selectDeselectAllLayers() {\n me.btnSelectDeseletClicked = !me.btnSelectDeseletClicked;\n me.compoData.layers.forEach(layer => layer.checked = me.btnSelectDeseletClicked);\n }", "function pastro()\n{\n\tfor( var i = 1; i <= LENDET.length; i++ )\n\t{\n\t\tvar tmp1 = document.getElementById( \"fusha\" + i );\n\n\t\ttmp1.value = \" \";\n\n\t\ttmp1.style.visibility = \"hidden\";\n\t}\n\n\tvar tmp2 = document.querySelectorAll( \".cb\" );\n\n\tfor( var j = 0; j < tmp2.length; j++ )\n\t\ttmp2[ j ].checked = false;\n\n\n\tvar x = document.querySelectorAll( \"button\" );\n\t\tfor( var mn = 0; mn < x.length; mn++ )\n\t\t\tx[ mn ].disabled = true;\n\n\n\tdocument.getElementById( \"pergjigja\" ).innerHTML = \"\";\n} /// FUND pastro", "function marcarCheckBox(){\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento-Tratamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n }\n else {\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n }\n else {\n if (document.formFuncionario.cargo.value == \"Dentista-Tratamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = false;\n }\n }\n }\n}", "function disabledChecbox(){\n\tvar element = document.getElementById('noticia');\n\t\n\tvar element2 = document.getElementById('seccions');\n\t\n\tif(element.checked){\n\t\telement2.style.display='none';\n\t\treturn false;\n\t}else{\n\t\telement2.style.display='block';\n\t}\n}", "function selCheese(){\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled) {\r\n sav[i].disabled = false;\r\n }\r\n }\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled== false) {\r\n sws[i].disabled = true;\r\n }\r\n }\r\n}", "function chbox() {\n let v;\n if (document.getElementById(`${i}`).checked == true) {v=false} else {v=true};\n for (let i=15;i<24;i++)\n document.getElementById(`${i}`).checked = v; }", "function verificaReprovacaoDistribuicao(box){\n if(box.checked){\n show_distribuicao = true;\n show_repetencia = false;\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('checked', true);\n showDistribuicaoReprovacao();\n showLegendasRepetencia(false);\n showLegendasDesempenho(false);\n mostrarAgrupamento(false);\n }else{\n mostrarAgrupamento(true);\n show_distribuicao = false;\n show_repetencia();\n\n }\n atualizarCheckBox(); \n}", "function fnc_child_nuevo()\n{\n\tfnc_checkbox_set_value(fc_frm_cb, 'cest', true);\n\t\n\t// Impuestos\n\tfnc_checkbox_set_value(fc_frm_cb, 'bexonerado', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bigv', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bisc', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bper', false);\n\n\tfnc_checkbox_set_value(fc_frm_cb, 'bserie', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'blote', false);\n\t\n\tfnc_row_um_nuevo();\n}", "function uncheck() {\n document.querySelector(\"#mcp1\").checked = false;\n document.querySelector(\"#mcp2\").checked = false;\n document.querySelector(\"#mcp3\").checked = false;\n document.querySelector(\"#mcp4\").checked = false;\n\n }", "function getAllNonSelectedTaskCheckboxes()\n{\n return $$(\"input.donotedit\");\n}", "function listItems(circuit_id,form){\n if (document.getElementById('todos_'+circuit_id).checked){\n \tfor (i=0;i<form.elements.length;i++) {\n \t\tif (form.elements[i].type == \"checkbox\" && form.elements[i].id == (\"case_\"+circuit_id)){\t\n \t\t\tform.elements[i].checked=true;\n \t\t}\n \t}\n }\n else{\n \tfor (i=0;i<form.elements.length;i++) {\n \t\tif (form.elements[i].type == \"checkbox\" && form.elements[i].id == (\"case_\"+circuit_id)){\n \t\t\tform.elements[i].checked=false;\n \t\t}\n \t}\n }\n}", "function TerminosyCondiciones_() {\n $(_G_ID_ + \"checkbox_acep_terms\").prop(\"checked\", false);\n $('#Modal_TerminosyCondicioones').modal('show')\n}", "function click5() {\n var ck1 = document.getElementById('ckb_cat').checked;\n if (ck1) {\n console.log(\"avilitado \" + \" \" + ck1);\n //AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n for (var i = 0; i < Catalogos.length; i++) {\n Catalogos[i] = true;\n }\n }\n else {\n console.log(\"apagado \" + \" \" + ck1);\n document.getElementById('ckb_cat').checked = false;\n for (var i = 0; i < Catalogos.length; i++) {\n Catalogos[i] = false;\n }\n }\n //asigna valores a sub-chekbox\n document.getElementById('etapas_item').checked = ck1;\n document.getElementById('unidad_insp_item').checked = ck1;\n document.getElementById('elem_insp_item').checked = ck1;\n document.getElementById('matrices_item').checked = ck1;\n\n console.log(Catalogos);\n\n return ck1;\n}", "function fechaMenu() {\n document.querySelector(\".check_input\").checked = false;\n}", "function selectCheckboxes(fm, v)\r\n\t{\r\n\t for (var i=0;i<fm.elements.length;i++) {\r\n\t var e = fm.elements[i];\r\n\t\t if (e.name.indexOf('active') < 0 &&\r\n\t\t e.type == 'checkbox')\r\n e.checked = v;\r\n\t }\r\n\t}", "function updateCheckboxes() {\n\t$('input[type=checkbox').each(function() {\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n}", "function mostrarSedesCarrera() {\n let carreraSelect = this.dataset.codigo;\n let carrera = buscarCarreraPorCodigo(carreraSelect);\n let listaCursos = getListaCursos();\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n let codigosCursos = [];\n\n for (let i = 0; i < carrera[7].length; i++) {\n codigosCursos.push(carrera[7][i]);\n }\n\n for (let j = 0; j < listaCursos.length; j++) {\n for (let k = 0; k < codigosCursos.length; k++) {\n if (listaCursos[j][0] == codigosCursos[k]) {\n listaCheckboxCursos[j].checked = true;\n }\n }\n }\n verificarCheckCarreras();\n}", "get noCheckboxesSelected() {\n return this.checkboxTargets.every(target => !target.checked)\n }", "function ocultarInvitados(){\n //Seleccionamos los checkbox 'confimado'\n var confirmado = document.getElementsByClassName('confirmar');\n \n //Si el input 'ocultar invitados' está marcado, ocultamos los invitados que no hayan confirmado\n if(ocultar.checked){\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n //Seleccionamos el elemento li\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n\n if(!confirmado[i].checked){\n li.style.display = 'none';\n }else{\n li.style.display = 'block';\n }\n }\n }\n //Si el input 'ocultar invitados' no está marcado, mostramos todos los invitados\n else{\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n \n li.style.display = 'block';\n }\n }\n}", "get unselected() {\n return this.checkboxTargets.filter(target => !target.checked)\n }", "function limpiarAsignacion() {\n $('#a_centro').empty();\n $('#a_empleadosCentro').empty();\n $('#a_todosEmpleados').prop(\"checked\", false);\n}", "function verificarCheckCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n let checkeado = false;\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n checkeado = true;\n }\n }\n if (checkeado == true) {\n disableCarreras();\n enableCursos();\n } else {\n enableCarreras();\n disableCursos();\n }\n\n}", "function celdaCheckbox(obj,parametrostrue,parametrosfalse){\n\tif(!obj.checked){\n\t\tsubmitajax(archivo+parametrostrue);\n\t}\n\telse\n\t{\n\t\tsubmitajax(archivo+parametrosfalse);\n\t}\n\t\n}", "function toggleCheckBoxes(checkboxName)\n{\n\tvar i = 0;\n\n\tvar checkBox;\n\n\tif(checkboxName == document.buildform.build) {\n\t\tcheckBox = document.buildform.linux;\n\t} \n\n\t// If more than one build is selected\n\tif(checkboxName.length)\n\t{\n\t\tfor(i = 0; i < checkboxName.length; i++)\n\t\t{\n\t\t\tcheckboxName[i].checked = checkBox.checked;\n\t\t}\n\t}\n\t// Only one build is selected\n\telse\n\t{\n\t\tcheckboxName.checked = checkBox.checked;\n\t}\n\n}", "function leerColumnas() {\n let $inputs_checkbox = [...document.getElementsByClassName(\"cb_columnas\")];\n $inputs_checkbox.map((i) => {\n i.checked = columnas[parseInt(i.parentElement.cellIndex)];\n });\n}", "function selezionaTutti() {\n var isChecked = $(this).prop(\"checked\");\n\n tabellaDaConvalidare.find(\"tbody\")\n .find(\"input[type='checkbox']:not([disabled])\")\n .prop(\"checked\", isChecked)\n .each(function(idx, el) {\n selectedDatas[+el.value] = {isSelected: isChecked, row: $(this).closest(\"tr\").clone()};\n });\n modificaTotali();\n }", "change(event) {\n if (this.noCheckboxesSelected) {\n this.selectAllTarget.checked = false\n this.selectAllTarget.indeterminate = false\n\n } else if (this.allCheckboxesSelected) {\n this.selectAllTarget.checked = true\n this.selectAllTarget.indeterminate = false\n\n } else {\n this.selectAllTarget.indeterminate = true\n }\n }", "function ReverseCheckAllSocialNetworkCategoryCheckBoxes ()\n{\n\tvar checkAllSocialNetworkCat = document.getElementById (\"checkAllSocialNetworkCat\");\n\tvar categoryCheckBox=document.getElementsByName(\"SocialNetworkCategoryCheckBox\");\n\tvar flag = true;\n\tif (categoryCheckBox.length > 0)\n\t{\n\t\tfor (var j = 0; j < categoryCheckBox.length; j++)\n\t\t{\n\t\t\tif (categoryCheckBox[j].checked != 1)\n\t\t\t{\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif(checkAllSocialNetworkCat!=null)\n\t{\n\t\tif (flag)\n\t\t\tcheckAllSocialNetworkCat.checked = 1;\n\t\telse\n\t\t\tcheckAllSocialNetworkCat.checked = 0;\n\t}\n}", "function updateInventario() {\n if ($('#inventario').prop('checked')) {\n $('#cantidad').prop('disabled', false);\n $('#minimo').prop('disabled', false);\n } else {\n $('#cantidad').prop('disabled', true);\n $('#minimo').prop('disabled', true);\n }\n}", "function quitarChecked(id){\n var filaCheck=0;\n $(\"input[name=\"+id+\"]\").each(function (index) { \n if(filaCheck!=0){\n if($(this).is(':checked')){\n $(this).prop('checked', false);\n } \n }else{\n $(this).prop('checked', true);\n } \n filaCheck++; \n });\n}", "function ActivarDesactivarDia(dia){\n\n\t//saber si el checkbox esta seleccionado\n\tif( $('#'+dia).prop('checked') ) {\n\t\t\n \t$(\"#inicioJornada\"+dia).prop('disabled', false);\n \t$(\"#finJornada\"+dia).prop('disabled', false);\n \t\n\t}else{\n\t\t\n \t$(\"#inicioJornada\"+dia).prop('disabled', true);\n \t$(\"#finJornada\"+dia).prop('disabled', true);\t\n \t\n \t$(\"#inicioJornada\"+dia).removeClass(\"valid\")\n \t$(\"#inicioJornada\"+dia).removeClass(\"invalid\");\n \n \t$(\"#finJornada\"+dia).removeClass(\"valid\");\n \t$(\"#finJornada\"+dia).removeClass(\"invalid\");\n \t \t \t\n \t$(\"#inicioJornada\"+dia).val(\"\");\n \t$(\"#finJornada\"+dia).val(\"\");\n \t\t\n\t}\n\t\n\t\n}", "function deselectKorpus() {\r\n let checkboxes = document.querySelectorAll('input[name=korpus]');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = false;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.add(\"hidden\");\r\n console.log(\"removed \" + next);\r\n }\r\n console.log(\"deselected\")\r\n loadMiniStats(null);\r\n document.querySelector(\"#alamkorpused\").style.display = 'none';\r\n}", "function enableCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (!(checkboxes[i].checked)) {\n checkboxes[i].disabled = false;\n }\n }\n}", "function initCheckboxes(){\n let checkboxes = document.getElementById(\"content1\").getElementsByTagName('input');\n let planetKeys = Object.keys(visualizer_list);\n let planetKeys2 = Object.keys(visualizer_list2);\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys.includes(checkBoxBody)){\n if(visualizer_list[checkBoxBody].hidden === true){\n checkbox.checked = false;\n }\n else {\n checkbox.checked = true;\n }\n //checkbox.checked = true;\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n else{\n checkbox.disabled = true;\n }\n }\n if(comparing){\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys2.includes(checkBoxBody)){\n checkbox.checked = true;\n // if(visualizer_list[checkBoxBody].hidden === true){\n // checkbox.checked = false;\n // }\n // else {\n // checkbox.checked = true;\n // }\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n }\n }\n addPlusToCheckboxes();\n}", "function moveSelected(bool) {\n allNotes.forEach((element) => {\n element.checkBoxVisible(bool);\n });\n}", "function setCheckBoxes(defaultChecked)\n\t{\n\t\t//ids of checkboxes set as the indices of the options array!! e.g. Subjects checkbox has id = 0\n\t\tvar options = [\"Subjects\",\"Birth place\",\"Death place\",\"Place of Activity\",\"Place of Visit/Tour\"];\n\t\t$(\"#checkboxes\").empty();\n\t\tvar toAppend = \"\";\n\t\tfor(var i = 0; i < options.length; i++)\n\t\t{\n\t\t\tif(options[i] == defaultChecked)\n\t\t\t{\n\t\t\t\ttoAppend = toAppend + '<input type=\"checkbox\" id=\"'+i+'\" checked=\"checked\"/>'+options[i]+'<br />';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttoAppend = toAppend + '<input type=\"checkbox\" id=\"'+i+'\" />'+options[i]+'<br />';\n\t\t\t}\n\t\t}\t\n\t\t$(\"#checkboxes\").append('<form name=\"form\" method=\"post\" action=\"\">'+toAppend+'</form>');\n\t}", "function click1_2(){\n var i = document.getElementById('usuario_item').checked;\n\n\tif (i) {console.log(\"avilitado\"+\" \"+i);\n\t\t\t//AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n\t document.getElementById('usuario_item').checked = true;\n\t Gestion_Infraestructura[1] = i;\n\t if (Gestion_Infraestructura[0] === true && Gestion_Infraestructura[1] === true && Gestion_Infraestructura[2] === true && Gestion_Infraestructura[3] === true && Gestion_Infraestructura[4] === true)\n\t\t\t document.getElementById('cbx_gest_infr').checked = true;\n\t\t\t}\n\telse {console.log(\"apagado\"+\" \"+i);\n\tdocument.getElementById('cbx_gest_infr').checked = false;\n\tdocument.getElementById('usuario_item').checked = false;\n\tGestion_Infraestructura[1] = i;\n\t\t\t}\n\tconsole.log(Gestion_Infraestructura);\n return i;\n}", "function precipitacion() {\n if ($(this).is(\":checked\"))\n {\n if ($(this).val() !== 'todos') {\n capa_actual = $(this).val();\n }\n conmutar_cobertura($(this).val(), true);\n $(\"#div_leyenda\").show();\n } else {\n capa_actual = '';\n conmutar_cobertura($(this).val(), false);\n if (listado_capas.length <= 1) {\n $(\"#div_leyenda\").hide();\n }\n }\n actualizar_coberturas();\n map.data.setStyle(style_bf);\n}", "function changeFacilities() {\n var ignore = document.getElementById('ignore_facilities');\n var wifiCheckbox = document.getElementById('wifi');\n var poolCheckbox = document.getElementById('pool');\n if(ignore.checked) {\n wifiCheckbox.checked = false;\n poolCheckbox.checked = false;\n }\n if(wifiCheckbox.checked || poolCheckbox.checked) {\n ignore.checked = false;\n }\n}", "function makeChecks(){\n/* 215 */ \t\t$(\"input[type=checkbox][rel]\").each(function (i,el){\n/* 216 */ \t\t\tel \t\t\t= $(el);\n/* 217 */ \t\t\tvar parent \t= el.parents('.checkbox_group'); //procura por um pai (check dentro de um grupo)\n/* 218 */ \t\t\tvar val \t= el.attr('rel');\n/* 219 */ \t\t\t//Elemento dentro de um grupo\n/* 220 */ \t\t\tif(parent.length > 0) {\n/* 221 */ \t\t\t\tvar values = parent.attr('rel');\n/* 222 */ \t\t\t\tel.attr('checked', (values[val] == 1));\n/* 223 */ \t\t\t}\n/* 224 */ \t\t\t//Elemento Sozinho\n/* 225 */ \t\t\telse{\n/* 226 */ \t\t\t\tel.attr('checked', (el.val() == val));\n/* 227 */ \t\t\t}\n/* 228 */ \t\t});\n/* 229 */ \t}", "updateCheckboxes() {\n for (const id of this.compareList.keys()) {\n this._checkCheckbox(id);\n }\n }", "function mouveLeaveCheckBoxes() {\n highlight.bubble = -1;\n highlight.inHist = null;\n refreshDisplay();\n}", "function selectNoneSent(){\r\n\r\n checkBoxSelection(false, 'divSent');\r\n}", "isThisCheckboxLabeless() {\n return this.type==='checkbox' && typeof this.label===\"undefined\";\n }", "function UncheckAll() {\n const el = document.querySelectorAll(\"input.checkboxFilter\");\n console.log(el);\n for (var i = 0; i < el.length; i++) {\n var check = el[i];\n if (!check.disabled) {\n check.checked = false;\n }\n }\n }", "function CheckBox() {\n return (\n <div\n css={css`\n display: innli;\n flex-direction: column;\n align-content: center;\n text-align: center;\n `}\n >\n <form class=\"checkList\">\n <ul style={{padding: 0}}>\n {checkboxList.list.map(checkbox => (\n <React.Fragment>\n <input value={checkbox.Cname} style={{margin: '1px', background: 'black', color: 'white'}} id=\"input\" type=\"button\" onClick={(e) => {\n //true or false value\n checkbox.value = !checkbox.value\n categoryName.splice(0, categoryName.length)\n categoryName.push(checkbox.Cname)\n categoryCTag = categoryName \n // console.log(checkboxList) //FOR DEBUGGING\n // console.log(\"checbklsit_: \", categoryName)//FOR DEBUGGING\n }}\n />\n {/* <label>{checkbox.Cname}</label> */}\n </React.Fragment>\n ))\n }\n <input value=\"Clear\" style={{margin: '1px', background: 'black', color: 'white'}} id=\"input\" type=\"button\" onClick={(e) => {\n categoryName = []\n categoryCTag = categoryName\n }}\n />\n </ul>\n </form>\n </div>\n )\n\n}", "function checkBoxToggle(chkBox)\n{\n\t//kony.print(JSON.stringify(chkBox));\n\t//frmProfile.chkBoxPushSubs[\"selectedKeys\"]=subs;\n\tswitch(chkBox[\"id\"])\n\t{\n\t\tcase \"chkBoxPushSubs\":\n\t\t\tif(audiencePushSubs)\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxSmsSubs\":\n\t\t\tif(audienceSmsSubs)\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxEmailSubs\":\n\t\t\tif(audienceEmailSubs)\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[];\n\t}\n}", "function deselectAnswers() {\r\n answerEls.forEach((answerEl) => {\r\n answerEl.checked = false;\r\n });\r\n}", "function chg_checkbox_posisi(){\n var id = \"#\"+tmp_id_posisi;\n console.log(id);\n $(id).prop('checked', true);\n}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "function marcarTodasLasCondiciones(valor) {\n //recuperamos el DIV (condiciones) en la variable seccion\n let seccion = document.getElementById('condiciones');\n //obtenemos la lista de input (checkbox)\n let listaCheck = seccion.getElementsByTagName('input');\n //las ponemos todos con checked = valor (true o false)\n for (elemento of listaCheck) {\n elemento.checked = valor\n };\n muestraSoluciones();\n}", "function CHMcheckUncheckAll(isCheck, formName, fieldName)\r\n{\r\n var obj = eval('document.'+formName+'.'+fieldName);\r\n\tvar len ;\r\n\t\r\n\tif(obj) len = obj.length;\r\n\telse return;\r\n\t\r\n\tif( len == null )\r\n\t\t{\r\n\t\t\tif(! obj.disabled)\r\n\t\t\t{\r\n\t\t\t\tobj.checked = isCheck;\r\n\t\t\t\tchangeStatus(formName,fieldName,obj)\r\n\t\t\t}\r\n\t\t}\r\n\telse\r\n\t{\r\n\t\tfor(var lvar_Cnt=0; lvar_Cnt < len; lvar_Cnt++)\r\n\t\t{\r\n\t\t if(! obj[lvar_Cnt].disabled) {\r\n\t\t\t obj[lvar_Cnt].checked = isCheck;\r\n \t\t\t changeStatus(formName,fieldName,obj[lvar_Cnt])\r\n\t\t }\r\n\t\t}\r\n\t}\r\n\treturn;\r\n}", "function limpiar_campos(){\r\n\r\n\t//NOMBRE\r\n\tdocument.getElementById(\"txt_nombre\").value = \"\";\r\n\t$(\"#div_nombre\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_nombre\").hide();\r\n\t\r\n\t//EMAIL\r\n\tdocument.getElementById(\"txt_email\").value = \"\";\r\n\t$(\"#div_email\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_email\").hide();\r\n\r\n\t//TELEFONO\r\n\tdocument.getElementById(\"txt_telefono\").value = \"\";\r\n\t$(\"#div_telefono\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_telefono\").hide();\r\n\r\n //TIENE HIJOS?\r\n tiene_hijos[0].checked=true;\r\n\r\n //ESTADO CIVIL\r\n document.getElementById(\"cbx_estadocivil\").value=\"SOLTERO\";\r\n\r\n //INTERESES\r\n document.getElementById(\"cbx_libros\").checked =false;\r\n document.getElementById(\"cbx_musica\").checked =false;\r\n document.getElementById(\"cbx_deportes\").checked =false;\r\n document.getElementById(\"cbx_otros\").checked =false;\r\n $(\"#div_intereses\").attr(\"class\",\"form-group\");\r\n $(\"#span_intereses\").hide();;\r\n}", "function chkall_fran_orders(franid) {\n var checkBoxes=$(\".chk_pick_list_by_fran_\"+franid);\n if($(\"#pick_all_fran_\"+franid).is(\":checked\")) {\n checkBoxes.attr(\"checked\", !checkBoxes.attr(\"checked\"));\n }\n else {\n checkBoxes.removeAttr(\"checked\", checkBoxes.attr(\"checked\"));\n }\n}", "function deseleccionarTodo() {\n $('#paciente').prop(\"checked\", false);\n $('#profesional').prop(\"checked\", false);\n $('#laboratorio').prop(\"checked\", false);\n $('#restaurante').prop(\"checked\", false);\n $('#dietetica').prop(\"checked\", false);\n $('#btn-paciente').removeClass('colorear');\n $('#btn-profesional').removeClass('colorear');\n $('#btn-laboratorio').removeClass('colorear');\n $('#btn-restaurante').removeClass('colorear');\n $('#btn-dietetica').removeClass('colorear');\n}", "function selectAllContacts(val){\r\n\r\n var scroll = document.getElementById('hidegroupmov');\r\n var checkAll = document.getElementById(scroll.value+\"Check\");\r\n checkAll.setAttribute(\"name\",\"true\");\r\n var vis = document.getElementById(scroll.value);\r\n var ch = vis.childNodes; \r\n \r\n for (var i=1; i<ch.length; i+=3){\r\n var check = ch.item(i-1);\r\n if (val == '1'){\r\n if (!check.checked) check.checked = \"checked\";\r\n } else if (val == '0') {\r\n if (check.checked) check.checked = \"\";\r\n }\r\n } \r\n}", "function controlarChk(){\n\n if( $(this).is(':checked') ){\n\t // Hacer algo si el checkbox ha sido seleccionado\n\t\t$(\"#imgP\").attr(\"disabled\",false);\n\t } else {\n\t // Hacer algo si el checkbox ha sido deseleccionado\n\t \t$(\"#imgP\").attr(\"disabled\",true);\n\t }\n\t\n}//end controlarChk", "function selectAllTrash(){\r\n\r\n checkBoxSelection(true, 'divTrash');\r\n}", "function checked(categories,checkAll,dialogform)\n{\n\t$('#'+dialogform+' :checkbox').unbind().bind('click',function(){\n\t\tvar checked = $(this).attr('checked');\n\t\tif($(this).attr('name') == categories){\n\t\t\tvar children = category_children($(this).val(),dialogform);\n\t\t for(var i=0;i<children.length;i++){\n\t\t children[i].prev().attr('checked',checked);\n\t\t }\n\t\t}\n\t\tif($(this).attr('name') == checkAll){\n\t\t\tvar checkbox = $(':checkbox[name='+categories+']');\n\t\t\tcheckbox.attr('checked',checked);\n\t\t}\n\t});\t\n}", "function setupCheckboxes() {\n\t$('input[type=checkbox]').each(function() {\n\t\t$(this).after('<i></i>');\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n\t$('input[type=checkbox]').change(function() {\n\t\t$(this).next().toggleClass('fas').toggleClass('far').toggleClass('fa-check-square').toggleClass('fa-square');\n\t});\n\t$('input[type=checkbox]').focus(function() {\n\t\t$(this).next().css('background-color','hsl(160, 50%, 80%)');\n\t});\n\t$('input[type=checkbox]').focusout(function() {\n\t\t$(this).next().css('background-color','');\n\t});\n\t$('input[type=checkbox]').css('cursor', 'pointer');\n\t$('label input[type=checkbox]').css('cursor', 'pointer');\n\t$('input[type=checkbox]').css('opacity', '0');\n\t$('input[type=checkbox]').css('margin-top', '5px');\n\t$('input[type=checkbox]').css('position', 'absolute');\n\n\t// update display if they change the checkbox value programmatically\n\t// even if they use code like:\n\t// $('#myCheckbox').prop('checked', true);\n\t// instead of\n\t// $('#myCheckbox').change();\n\t$.propHooks.checked = {\n\t\tset: function (el, value) {\n\t\t\tif (el.checked !== value) {\n\t\t\t\tel.checked = value;\n\t\t\t\t$(el).trigger('change');\n\t\t\t}\n\t\t}\n\t};\n}" ]
[ "0.75456697", "0.71342975", "0.71083796", "0.7026309", "0.68487376", "0.68395567", "0.6780356", "0.676236", "0.6725522", "0.6724679", "0.6710759", "0.6705947", "0.6653474", "0.6609601", "0.6604462", "0.6588969", "0.6575738", "0.6575453", "0.6574359", "0.65312696", "0.6528622", "0.6515563", "0.6513329", "0.64812905", "0.6480152", "0.6470723", "0.6468572", "0.6466065", "0.64595807", "0.64565647", "0.6452312", "0.64242226", "0.6415225", "0.64067674", "0.63792235", "0.6375214", "0.6373191", "0.63704926", "0.6344648", "0.6330809", "0.63274306", "0.6326122", "0.63181114", "0.6298789", "0.62899023", "0.62885195", "0.6284774", "0.62662387", "0.6258538", "0.62495214", "0.62410307", "0.6238752", "0.623864", "0.62332577", "0.62231696", "0.6217041", "0.6215733", "0.62140995", "0.62122357", "0.62065166", "0.6201667", "0.6191949", "0.61905414", "0.6183004", "0.61688", "0.61687833", "0.6157958", "0.6152307", "0.6145393", "0.61373657", "0.6135526", "0.61301327", "0.61288035", "0.612304", "0.61155224", "0.610517", "0.6103915", "0.60994834", "0.60961306", "0.60931754", "0.609221", "0.60895634", "0.60860753", "0.6081249", "0.607934", "0.60760003", "0.60736674", "0.6073084", "0.60673386", "0.6064372", "0.6058256", "0.60575616", "0.6055568", "0.6053721", "0.6050594", "0.60492665", "0.6048628", "0.60475254", "0.60459024", "0.60415584" ]
0.6080675
84
Habilita checkboxes de cursos actii
function enableCarreras() { let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]'); for (let i = 0; i < checkboxes.length; i++) { if (!(checkboxes[i].checked)) { checkboxes[i].disabled = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selChkTodos(form, chkNombre, boo) {\r\n\tfor(i=0; n=form.elements[i]; i++) \r\n\t\tif (n.type == \"checkbox\" && n.name == chkNombre) n.checked = boo;\r\n}", "function activarcheckbox(bigdata){\n $.each(bigdata, function(key, item) {\n //if(key==\"productos\"){\n let inicial=key.substring(0, 4);\n console.log(key, item, inicial);\n $('input#'+key).iCheck('check');\n if(!getAccess(item, 1)){\n $('#vie'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 2)){\n $('#adi'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 4)){\n $('#edi'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 8)){\n $('#del'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 16)){\n $('#pri'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 32)){\n $('#act'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 64)){\n $('#sel'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 128)){\n $('#pay'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 256)){\n $('#acc'+inicial).iCheck('uncheck')\n }\n //}\n });\n}", "function selectCBs() {\n d3.selectAll('.type-checkbox')\n .property('checked', true);\n update();\n d3.select('.kasiosCheckbox')\n .property('checked', true)\n kasios_update();\n}", "function reactionCheckbox () {\n vArrows = cb1.checked; // Pfeile für Bewegungsrichtung\n bArrows = cb2.checked; // Pfeile für Magnetfeld\n iArrows = cb3.checked; // Pfeile für Induktionsstrom\n if (!on) paint(); // Falls Animation abgeschaltet, neu zeichnen\n }", "function excluyentes(seleccionado) {\n programador_web.checked = false; \n logistica.checked = false;\n peon.checked = false;\n \n seleccionado.checked = true; \n}", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n\n cb.element.checked = cb.selected;\n }\n }", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n }\n }", "function selChoco(){\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled) {\r\n sws[i].disabled = false;\r\n }\r\n }\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled == false) {\r\n sav[i].disabled = true;\r\n }\r\n }\r\n}", "function AcertaAoVoltar() {\r\n $(\":checkbox\").each(function (i) { // obtém a função wrapper que envolve a funcao MarcaCompra definido para\r\n // o evento onclick (se a MarcarCompra existir significa que o checkbox é da prateleira \r\n var fncMarca = $(this).attr(\"onclick\"); // forca o resultado ser convertido para string para ver se a funcao MarcaCompra esta sendo invocada no\r\n // onclick do checked.\r\n if ((\"\" + fncMarca).search(\"MarcarCompra\") > 0) {\r\n $(this).attr(\"checked\", \"\");\r\n }\r\n });\r\n}", "function tgboxes(el){\n\tvar i, boxes = el.querySelectorAll(\"input[type=checkbox]\");\n\tfor(i=0; i<boxes.length; i++) boxes[i].checked = !boxes[i].checked;\n}", "function eveChck() {\n $('.chgrup').on('click',function(){\n var cuales = $(this).attr('id'); \n if( $(this).prop('checked')) {\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', 'checked');\n });\n }else{\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', false);\n });\n } \n });\n $('.cksub').on('click', function(){\n var mod = $(this).attr('for');\n if( $(this).prop('checked')) {\n if(!$('#'+mod).prop('checked')) {\n $('#'+mod).prop('checked', 'checked');\n } \n }else{\n var cuantas = 0;\n $('input[for ='+ mod +']').each(function(){\n if($(this).prop('checked')) {\n cuantas++;\n }\n });\n if (cuantas == 0) {\n $('#'+mod).prop('checked', false);\n }\n }\n \n });\n}", "function comprueba_puestos() {\nvar cuantos = 0;\nvar elementos = document.getElementsByName(\"puesto\"); // Es un array con los checkbox de nombre puesto\nvar span_puestos= document.getElementById(\"span_puestos\");\n\n\tfor(i in elementos) {\n if (elementos[i].checked) cuantos++;\n\t }\n\n\tif (!cuantos) { // Es lo mismo que cuantos==0\n span_puestos.style.color=\"red\";\n span_puestos.innerHTML=\" Debe seleccionar un puesto de trabajo\";\n puestos=false;\n }\n\t \n else {\n span_puestos.innerHTML=\"\";\n\t puestos=true;\n }\n}", "function checar_todos() {\n\tvar asign = document.getElementsByName('asignadas')\n\tfor (var i = 0; i < asign.length; i++) {\n\t\tasign[i].checked = true\n\t}\n}", "function syncronizeCheckboxes(clicked, pri, pub) {\n pri.checked = false;\n pub.checked = false;\n clicked.checked = true;\n }", "function enableCursos() {\n let checkboxes = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (!(checkboxes[i].checked)) {\n checkboxes[i].disabled = false;\n }\n }\n}", "function marcarLinhaComoSelecionada() {\n $scope.detalhesExcluir.forEach(detalheExcluir => {\n\n for (var i = 0; i < $scope.gestaoVendaResultados.length; i++) {\n\n if (detalheExcluir.idDetalhe == $scope.gestaoVendaResultados[i].idDetalhe) {\n $scope.gestaoVendaResultados[i].isChecked = true;\n break;\n }\n\n }\n })\n }", "function verificaCheckboxes(checkbox){\n\treturn checkbox == true;\n}", "function js_checkboxen_alle(name)\n\t\t{\n\t\tfor (var x = 0; x < document.forms[0].elements.length; x++)\n\t\t\t{\n\t\t\tvar obj = document.forms[0].elements[x];\n\t\t\t\n\t\t\tif (obj.name != name)\n\t\t\t\tobj.checked = document.form.elements[name].checked;\n\t\t\t}\n\t\t}", "function selectCheckboxes(fm, v)\r\n\t{\r\n\t for (var i=0;i<fm.elements.length;i++) {\r\n\t var e = fm.elements[i];\r\n\t\t if (e.name.indexOf('active') < 0 &&\r\n\t\t e.type == 'checkbox')\r\n e.checked = v;\r\n\t }\r\n\t}", "function selezionaTutti() {\n var isChecked = $(this).prop(\"checked\");\n\n tabellaDaConvalidare.find(\"tbody\")\n .find(\"input[type='checkbox']:not([disabled])\")\n .prop(\"checked\", isChecked)\n .each(function(idx, el) {\n selectedDatas[+el.value] = {isSelected: isChecked, row: $(this).closest(\"tr\").clone()};\n });\n modificaTotali();\n }", "function setupCheckboxes() {\n\t$('input[type=checkbox]').each(function() {\n\t\t$(this).after('<i></i>');\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n\t$('input[type=checkbox]').change(function() {\n\t\t$(this).next().toggleClass('fas').toggleClass('far').toggleClass('fa-check-square').toggleClass('fa-square');\n\t});\n\t$('input[type=checkbox]').focus(function() {\n\t\t$(this).next().css('background-color','hsl(160, 50%, 80%)');\n\t});\n\t$('input[type=checkbox]').focusout(function() {\n\t\t$(this).next().css('background-color','');\n\t});\n\t$('input[type=checkbox]').css('cursor', 'pointer');\n\t$('label input[type=checkbox]').css('cursor', 'pointer');\n\t$('input[type=checkbox]').css('opacity', '0');\n\t$('input[type=checkbox]').css('margin-top', '5px');\n\t$('input[type=checkbox]').css('position', 'absolute');\n\n\t// update display if they change the checkbox value programmatically\n\t// even if they use code like:\n\t// $('#myCheckbox').prop('checked', true);\n\t// instead of\n\t// $('#myCheckbox').change();\n\t$.propHooks.checked = {\n\t\tset: function (el, value) {\n\t\t\tif (el.checked !== value) {\n\t\t\t\tel.checked = value;\n\t\t\t\t$(el).trigger('change');\n\t\t\t}\n\t\t}\n\t};\n}", "function handle_checkboxes(){\n\t\t$.each($(\".anthrohack_checkbox\"), function(i, _box){\n\t\t\tvar id = \"#\" + $(_box).attr(\"id\") + \"_hidden\";\n\t\t\t$(_box).change(function(){\n\t\t\t\tif($(_box).prop(\"checked\")){\n\t\t\t\t\t$(id).val(\"on\").trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(id).val(\"off\").trigger('change');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function updateCheckBoxes() {\n const checkboxes = [];\n\n checkboxes.push(document.querySelector('#inspiration'));\n\n checkboxes.push(document.querySelector('#dss1'));\n checkboxes.push(document.querySelector('#dss2'));\n checkboxes.push(document.querySelector('#dss3'));\n\n checkboxes.push(document.querySelector('#dsf1'));\n checkboxes.push(document.querySelector('#dsf2'));\n checkboxes.push(document.querySelector('#dsf3'));\n\n checkboxes.forEach((ele) => {\n if (ele.value === 'true') {\n ele.setAttribute('checked', 'checked');\n } else {\n ele.removeAttribute('checked');\n }\n });\n}", "function makeChecks(){\n/* 215 */ \t\t$(\"input[type=checkbox][rel]\").each(function (i,el){\n/* 216 */ \t\t\tel \t\t\t= $(el);\n/* 217 */ \t\t\tvar parent \t= el.parents('.checkbox_group'); //procura por um pai (check dentro de um grupo)\n/* 218 */ \t\t\tvar val \t= el.attr('rel');\n/* 219 */ \t\t\t//Elemento dentro de um grupo\n/* 220 */ \t\t\tif(parent.length > 0) {\n/* 221 */ \t\t\t\tvar values = parent.attr('rel');\n/* 222 */ \t\t\t\tel.attr('checked', (values[val] == 1));\n/* 223 */ \t\t\t}\n/* 224 */ \t\t\t//Elemento Sozinho\n/* 225 */ \t\t\telse{\n/* 226 */ \t\t\t\tel.attr('checked', (el.val() == val));\n/* 227 */ \t\t\t}\n/* 228 */ \t\t});\n/* 229 */ \t}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "function verificarCheckCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n let checkeado = false;\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n checkeado = true;\n }\n }\n if (checkeado == true) {\n disableCarreras();\n enableCursos();\n } else {\n enableCarreras();\n disableCursos();\n }\n\n}", "function toggleAll(name) {\n//name est le debut du nom des cases a cocher \n//exp: <input type=\"checkbox\" name=\"cb_act_<?php echo $oAct->get_id(); ?>\" ...>\n// name est egal a 'cb_act_'\n//'user-all' est le nom de la case qui permet de cocher ttes les autres \n\n\tvar inputs\t= document.getElementsByTagName('input');\n\tvar count\t= inputs.length;\n\tfor (i = 0; i < count; i++) {\n\t\n\t\t_input = inputs.item(i);\n\t\tif (_input.type == 'checkbox' && _input.id.indexOf(name) != -1) {\n\t\t\n\t\t\t_input.checked = document.getElementById('user-all').checked;\n\n\t\t\n\t\t}\n\t\t\n\t}\n \n}", "function chbox() {\n let v;\n if (document.getElementById(`${i}`).checked == true) {v=false} else {v=true};\n for (let i=15;i<24;i++)\n document.getElementById(`${i}`).checked = v; }", "function click1_2(){\n var i = document.getElementById('usuario_item').checked;\n\n\tif (i) {console.log(\"avilitado\"+\" \"+i);\n\t\t\t//AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n\t document.getElementById('usuario_item').checked = true;\n\t Gestion_Infraestructura[1] = i;\n\t if (Gestion_Infraestructura[0] === true && Gestion_Infraestructura[1] === true && Gestion_Infraestructura[2] === true && Gestion_Infraestructura[3] === true && Gestion_Infraestructura[4] === true)\n\t\t\t document.getElementById('cbx_gest_infr').checked = true;\n\t\t\t}\n\telse {console.log(\"apagado\"+\" \"+i);\n\tdocument.getElementById('cbx_gest_infr').checked = false;\n\tdocument.getElementById('usuario_item').checked = false;\n\tGestion_Infraestructura[1] = i;\n\t\t\t}\n\tconsole.log(Gestion_Infraestructura);\n return i;\n}", "function checarTodosMarcados() {\n const todosOsCheckbox = Array.from(document.querySelectorAll('input[type=checkbox]'));\n console.log(typeof todosOsCheckbox)\n if (todosOsCheckbox.length === 0) {\n todosFeitos = false;\n } else {\n todosFeitos = todosOsCheckbox.every(checkboxIndividual => checkboxIndividual.checked === true);\n }\n }", "function checkbox(id,estado) {\n $(\"#customCheck\" + id).click(function () {\n accionesCheck(id,estado);\n });\n if (estado) {\n $(\"#customCheck\" + id).prop(\"checked\", true);\n $(\"#titulo\" + id).addClass(\"tachado\");\n $(\"#Fecha\" + id).addClass(\"tachado\");\n $(\"#des\" + id).addClass(\"tachado\");\n }\n}", "onCheckWeft(event) {\n for (var item of this.ItemsWeft) {\n item.Select = event.detail.target.checked;\n }\n }", "checkSelectedFilters() {\n const selectedFilters = this.anomalyFilterModel.getSelectedFilters();\n selectedFilters.forEach((filter) => {\n const [section, filterName] = filter;\n $(`#${section} .filter-item__checkbox[data-filter=\"${filterName}\"]`).prop('checked', true);\n });\n }", "function click5() {\n var ck1 = document.getElementById('ckb_cat').checked;\n if (ck1) {\n console.log(\"avilitado \" + \" \" + ck1);\n //AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n for (var i = 0; i < Catalogos.length; i++) {\n Catalogos[i] = true;\n }\n }\n else {\n console.log(\"apagado \" + \" \" + ck1);\n document.getElementById('ckb_cat').checked = false;\n for (var i = 0; i < Catalogos.length; i++) {\n Catalogos[i] = false;\n }\n }\n //asigna valores a sub-chekbox\n document.getElementById('etapas_item').checked = ck1;\n document.getElementById('unidad_insp_item').checked = ck1;\n document.getElementById('elem_insp_item').checked = ck1;\n document.getElementById('matrices_item').checked = ck1;\n\n console.log(Catalogos);\n\n return ck1;\n}", "function marcarCheckBox(){\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento-Tratamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n }\n else {\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n }\n else {\n if (document.formFuncionario.cargo.value == \"Dentista-Tratamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = false;\n }\n }\n }\n}", "updateCheckboxes() {\n for (const id of this.compareList.keys()) {\n this._checkCheckbox(id);\n }\n }", "function celdaCheckbox(obj,parametrostrue,parametrosfalse){\n\tif(!obj.checked){\n\t\tsubmitajax(archivo+parametrostrue);\n\t}\n\telse\n\t{\n\t\tsubmitajax(archivo+parametrosfalse);\n\t}\n\t\n}", "function chkTodos()\r\n{\r\n $(\":checkbox\").not(\"#chkTodos\").each(function(){\r\n if(this.checked)\r\n this.checked = false;\r\n else\r\n this.checked = true;\r\n });\r\n}", "function leerColumnas() {\n let $inputs_checkbox = [...document.getElementsByClassName(\"cb_columnas\")];\n $inputs_checkbox.map((i) => {\n i.checked = columnas[parseInt(i.parentElement.cellIndex)];\n });\n}", "function updateCheckboxes() {\n\t$('input[type=checkbox').each(function() {\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n}", "function marcarTodasLasCondiciones(valor) {\n //recuperamos el DIV (condiciones) en la variable seccion\n let seccion = document.getElementById('condiciones');\n //obtenemos la lista de input (checkbox)\n let listaCheck = seccion.getElementsByTagName('input');\n //las ponemos todos con checked = valor (true o false)\n for (elemento of listaCheck) {\n elemento.checked = valor\n };\n muestraSoluciones();\n}", "function displayCheckboxes() {\n $('#checkbox').text('');\n\n for (let i = 0; i < ingredientsArray.length; i++) {\n let pContainer = $(\"<p class=label>\");\n let labelContainer = $(\"<label class=option>\");\n let inputContainer = $(\"<input type=checkbox>\");\n let spanContainer = $('<span>');\n\n pContainer.addClass('col s2')\n inputContainer.addClass('filled-in checked=\"unchecked\"');\n spanContainer.text(ingredientsArray[i]);\n inputContainer.attr('value', ingredientsArray[i]);\n\n $('#checkbox').append(pContainer);\n pContainer.append(labelContainer);\n labelContainer.append(inputContainer);\n labelContainer.append(spanContainer);\n\n }\n}", "function toggleTickAllRows(e){\n e.preventDefault();\n var status = this.checked;\n console.log(status);\n\n $(\".checkbox input\").each(function(){\n this.checked = status;\n });\n }", "function setCheckBoxes(defaultChecked)\n\t{\n\t\t//ids of checkboxes set as the indices of the options array!! e.g. Subjects checkbox has id = 0\n\t\tvar options = [\"Subjects\",\"Birth place\",\"Death place\",\"Place of Activity\",\"Place of Visit/Tour\"];\n\t\t$(\"#checkboxes\").empty();\n\t\tvar toAppend = \"\";\n\t\tfor(var i = 0; i < options.length; i++)\n\t\t{\n\t\t\tif(options[i] == defaultChecked)\n\t\t\t{\n\t\t\t\ttoAppend = toAppend + '<input type=\"checkbox\" id=\"'+i+'\" checked=\"checked\"/>'+options[i]+'<br />';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttoAppend = toAppend + '<input type=\"checkbox\" id=\"'+i+'\" />'+options[i]+'<br />';\n\t\t\t}\n\t\t}\t\n\t\t$(\"#checkboxes\").append('<form name=\"form\" method=\"post\" action=\"\">'+toAppend+'</form>');\n\t}", "function tarkistaLeima(checkbox) {\n if (checkbox.checked) {\n return true;\n } else {\n return false;\n }\n }", "function select_all_checkboxes(e){\n $('input:checkbox[name=\"botcb\"]').each(function(){\n $(this).prop(\"checked\", $('input:checkbox[name=\"allbot\"]').prop(\"checked\"));\n });\n}", "function click4_2() {\n var j = document.getElementById('objetivos_hk_item').checked;\n\n if (j) {\n console.log(\"avilitado 2-1 \" + \" \" + j);\n //AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n document.getElementById('objetivos_hk_item').checked = true;\n hk[1] = j;\n if (hk[0] === true && hk[1] === true && hk[2] === true)\n document.getElementById('cbx_hk').checked = true;\n }\n else {\n console.log(\"apagado 2-1 \" + \" \" + j);\n document.getElementById('cbx_hk').checked = false;\n document.getElementById('objetivos_hk_item').checked = false;\n hk[1] = j;\n }\n console.log(hk);\n return j;\n}", "function showCheckBox(data) {\n \t// update checkboxes\n \tdojo.forEach(data, function(item){\n \t\t\t\t\titem.chkBoxUpdate = '<input type=\"checkbox\" align=\"center\" id=\"'+item.expdIdentifier+'\" onClick=\"getCheckedRows(this)\" />';\n \t\t\t\t\titem.chkBoxUpdate.id = item.expdIdentifier;\n \t\t\t\t});\n \t\n \t// Standard checkboxes\n \tdojo.forEach(data, function(item){\n \t\tif (item.includesStd == \"Y\"){\n \t\t\titem.chkBoxStd = '<input type=\"checkbox\" disabled align=\"center\" id=\"'+item.expdIdentifier+'cb'+'\" checked=\"checked\"/>';\n\t\t\t\t\t} else{\n\t\t\t\t\titem.chkBoxStd = '<input type=\"checkbox\" disabled align=\"center\" id=\"'+item.expdIdentifier+'cb'+'\"/>';\n\t\t\t\t\t}\n\t\t\t\t\titem.chkBoxStd.id = item.expdIdentifier + 'cb';\n\t\t\t\t});\n }", "function click5_1() {\n var i = document.getElementById('etapas_item').checked;\n\n if (i) {\n console.log(\"avilitado\" + \" \" + i);\n //AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n Catalogos[0] = i;\n if (Catalogos[0] === true && Catalogos[1] === true && Catalogos[2] === true && Catalogos[3] === true)\n document.getElementById('ckb_cat').checked = true;\n }\n else {\n console.log(\"apagado\" + \" \" + i);\n document.getElementById('ckb_cat').checked = false;\n document.getElementById('etapas_item').checked = false;\n Catalogos[0] = i;\n }\n console.log(Catalogos);\n return i;\n}", "function mostrarTecnicosInactivos() {\n const mostrar = document.getElementById('check-tecnicos').checked;\n const elems = $(\"[data-activo=false]\");\n if (mostrar) {\n elems.css('display', '');\n } else {\n elems.css('display', 'none');\n }\n}", "function anular_seleccion_cliente() {\n\tvar clientes = document.getElementsByName(\"checkito\");\n\tfor (var i = 1; i <= clientes.length; i++) {\n\t\tnombre_cli = \"cli\" + i;\n\t\tdocument.getElementById(nombre_cli).checked = false;\n\t}\n\tmostrar_ayuda(false);\n}", "function verificaReprovacaoDistribuicao(box){\n if(box.checked){\n show_distribuicao = true;\n show_repetencia = false;\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('checked', true);\n showDistribuicaoReprovacao();\n showLegendasRepetencia(false);\n showLegendasDesempenho(false);\n mostrarAgrupamento(false);\n }else{\n mostrarAgrupamento(true);\n show_distribuicao = false;\n show_repetencia();\n\n }\n atualizarCheckBox(); \n}", "function checked(categories,checkAll,dialogform)\n{\n\t$('#'+dialogform+' :checkbox').unbind().bind('click',function(){\n\t\tvar checked = $(this).attr('checked');\n\t\tif($(this).attr('name') == categories){\n\t\t\tvar children = category_children($(this).val(),dialogform);\n\t\t for(var i=0;i<children.length;i++){\n\t\t children[i].prev().attr('checked',checked);\n\t\t }\n\t\t}\n\t\tif($(this).attr('name') == checkAll){\n\t\t\tvar checkbox = $(':checkbox[name='+categories+']');\n\t\t\tcheckbox.attr('checked',checked);\n\t\t}\n\t});\t\n}", "function ocultarInvitados(){\n //Seleccionamos los checkbox 'confimado'\n var confirmado = document.getElementsByClassName('confirmar');\n \n //Si el input 'ocultar invitados' está marcado, ocultamos los invitados que no hayan confirmado\n if(ocultar.checked){\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n //Seleccionamos el elemento li\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n\n if(!confirmado[i].checked){\n li.style.display = 'none';\n }else{\n li.style.display = 'block';\n }\n }\n }\n //Si el input 'ocultar invitados' no está marcado, mostramos todos los invitados\n else{\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n \n li.style.display = 'block';\n }\n }\n}", "loadCheckboxInputEventListeners(dataCtrl,uiCtrl){\n const className = uiCtrl.returnIds().classNames.checkboxesSelector\n for(const input of document.getElementsByClassName(className)){\n input.addEventListener('click',(e)=>{\n dataCtrl.updateRegChecked(e.target.id)\n dataCtrl.addSelectedRow(parseInt(e.target.id),e.target.checked)\n uiCtrl.updateButtonTextValue(dataCtrl.returnData('selectedRow').length)\n })\n }\n }", "get selectedCheckboxes() {\n return this.checkboxes.filter((checkbox) => checkbox.checked === true);\n }", "function listItems(circuit_id,form){\n if (document.getElementById('todos_'+circuit_id).checked){\n \tfor (i=0;i<form.elements.length;i++) {\n \t\tif (form.elements[i].type == \"checkbox\" && form.elements[i].id == (\"case_\"+circuit_id)){\t\n \t\t\tform.elements[i].checked=true;\n \t\t}\n \t}\n }\n else{\n \tfor (i=0;i<form.elements.length;i++) {\n \t\tif (form.elements[i].type == \"checkbox\" && form.elements[i].id == (\"case_\"+circuit_id)){\n \t\t\tform.elements[i].checked=false;\n \t\t}\n \t}\n }\n}", "setCheckboxes(data) {\n // inputs to run through and check or uncheck\n const inputIds = [\n 'open_now',\n 'price-1',\n 'price-2',\n 'price-3',\n 'price-4',\n 'hot_and_new',\n 'reservation',\n 'cashback',\n 'deals',\n 'wheelchair_accessible',\n 'open_to_all',\n 'gender_neutral_restrooms',\n ];\n\n // For inputIds array if data object has the input id as a key\n // make that input checked, otherwise un-check.\n inputIds.forEach(id => {\n if (data[id]) $(`#${id}`).prop('checked', true);\n else $(`#${id}`).prop('checked', false);\n });\n }", "function SetClickCheckBox(event, controlePai) {\n\n var tr = $(controlePai).closest('tr');\n\n if (event.target.type != 'checkbox') {\n event.stopPropagation();\n tr.find('input:checkbox').attr('checked', !tr.find('input:checkbox').attr('checked'));\n }\n\n if (tr.find('input:checkbox').is(':checked')) {\n tr.addClass('linhaSelecionada');\n }\n else {\n tr.removeClass('linhaSelecionada');\n }\n}", "function unit_chkboxchange(status) {\r\n\tfor (i in trackerunitchk) {\r\n\t\t$(trackerunitchk[i]).checked = status;\r\n\t}\r\n}", "function controlarChk(){\n\n if( $(this).is(':checked') ){\n\t // Hacer algo si el checkbox ha sido seleccionado\n\t\t$(\"#imgP\").attr(\"disabled\",false);\n\t } else {\n\t // Hacer algo si el checkbox ha sido deseleccionado\n\t \t$(\"#imgP\").attr(\"disabled\",true);\n\t }\n\t\n}//end controlarChk", "function selectAllSent(){\r\n\r\n checkBoxSelection(true, 'divSent');\r\n}", "function toggleAjouterBtn()\n {\n //s'il y a un itinéraire prédéfini de choisi ou au moins une paire de choisie pour un itineraire sur mesure \n if (itinStandardChkBox.checked || (itinSurMesureChkBox.checked && polylineForSelectSelectedArray.length > 0))\n {\n btnAjouterItin.disabled = false; \n }\n else\n {\n btnAjouterItin.disabled = true; \n }\n }", "function loadChecked() {\n\tvar html = '';\n\tfor (var i = 0; i < selected.length; i++) {\n\t\tvar checkbox = document.getElementById(selected[i]);\n\t\t\thtml += '<input type=\"checkbox\" checked name=\"chooses\" value=\"'\n\t\t\t\t\t+ selected[i] + '\">';\n\t\t$('#' + selected[i]).prop('checked', true);\n\t}\n\t$('#addcheckbox').html(html);\n\n\t// set check all\n\tif (isCheckAll()) {\n\t\t$('#inputSelectAll').prop('checked', true);\n\t}\n}", "function estaSeleccionado(obj) { \n check = false;\n if(isNaN(obj.length)) {\n check = obj.checked;\n }\n else {\n longitud = obj.length; \t\t\n for(i = 0; i < longitud; i++) {\n if(obj[i].checked == true) {\n check = true;\n break;\n }\n }\n }\n return check;\n}", "function selectallcheckbox(thisEl,containerEl)\n{ \n\tvar thisEl = $(thisEl);\n\tvar attClass= thisEl.attr('class');\n\tvar sasCl \t= $(containerEl).hasClass('checked');\n\n\tvar len =$(containerEl).find(':checkbox').length;\n\n\tif(len>0)\n\t{\n\t\tif(sasCl==false) \n\t\t{\n\t\t\tif(attClass=='deleteallvips') thisEl.closest('td').find('a').attr('action','openDialog');\n\t\t\tthisEl.closest('td').find('a').removeClass('disabled').addClass('inviteAction');\n\t\t\t\n\t\t\t\n\t\t\t$(containerEl).addClass('checked');\n\t\t\t$(containerEl).find(':checkbox').prop('checked', true);\n\t\t}\n\t\telse \n\t\t{\n\t\t\tthisEl.closest('td').find('a').addClass('disabled').removeClass('inviteAction');\n\t\t\tif(attClass=='deleteallvips') thisEl.closest('td').find('a').attr('action','')\n\t\t\t$(containerEl).removeClass('checked');\n\t\t\t$(containerEl).find(':checkbox').prop('checked', false);\n\t\t}\n\t}\n\telse\n\t{\n\t\t $messageError(\"Records not available to perform this action.\"); \n\t}\n}", "function cbChange(obj) {\nvar instate=(obj.checked);\n var cbs = document.getElementsByClassName(\"cb\");\n for (var i = 0; i < cbs.length; i++) {\n cbs[i].checked = false;\n }\n if(instate)obj.checked = true;\n}", "function controles() {\n checkboxCapa = document.getElementById(\"controles\");\n if (checkboxCapa.checked) {\n var misOpciones = {\n disableDefaultUI: false,\n mapTypeControl: true\n };\n map.setOptions(misOpciones); \n\n }\n else {\n var misOpciones = {\n disableDefaultUI: true,\n mapTypeControl: false\n };\n map.setOptions(misOpciones); \n }\n}", "function deselectCBs() {\n d3.selectAll('.type-checkbox')\n .property('checked', false)\n update();\n d3.select('.kasiosCheckbox')\n .property('checked', false)\n kasios_update();\n}", "function click2_1(){\n var j = document.getElementById('unidad_n_item').checked;\n\n\tif(j) {console.log(\"avilitado 2-1 \"+\" \"+j);\n\t\t//AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n\t document.getElementById('unidad_n_item').checked = true;\n\t Gestion_Estrategica[0] = j;\n\t if (Gestion_Estrategica[0] === true && Gestion_Estrategica[1] === true && Gestion_Estrategica[2] === true)\n\t\t document.getElementById('cbx_gest_estra').checked = true;\n\t\t}\n\telse {console.log(\"apagado 2-1 \"+\" \"+j);\n\tdocument.getElementById('cbx_gest_estra').checked = false;\n document.getElementById('unidad_n_item').checked = false;\n Gestion_Estrategica[0] = j;\n\t\t\t\t}\n\tconsole.log(Gestion_Estrategica);\n return j;\n}", "function checkBox() {\n var foobar = $('#foobar'),\n checkbox;\n\n for (var key in FamilyGuy) {\n foobar.append('<input type=\"checkbox\" id=\"' + key + '\"/>' +\n '<label for=\"' + key + '\">' + FamilyGuy[key].last_name + '</label>')\n }\n\n foobar.append('<p><a href=\"#\" id=\"enable\">Enable All</a></div><br /><div><a href=\"#\" id=\"disable\">Disable All</a></p>');\n\n $('#enable').on('click', function () {\n en_dis_able(true);\n });\n\n $('#disable').on('click', function () {\n en_dis_able(false);\n });\n\n function en_dis_able(value) {\n checkbox = $('input[type=\"checkbox\"]');\n for (var i = 0, s = checkbox.length; i < s; i++) {\n checkbox[i].checked = value;\n }\n }\n }", "function mostrarSedesCarrera() {\n let carreraSelect = this.dataset.codigo;\n let carrera = buscarCarreraPorCodigo(carreraSelect);\n let listaCursos = getListaCursos();\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n let codigosCursos = [];\n\n for (let i = 0; i < carrera[7].length; i++) {\n codigosCursos.push(carrera[7][i]);\n }\n\n for (let j = 0; j < listaCursos.length; j++) {\n for (let k = 0; k < codigosCursos.length; k++) {\n if (listaCursos[j][0] == codigosCursos[k]) {\n listaCheckboxCursos[j].checked = true;\n }\n }\n }\n verificarCheckCarreras();\n}", "function fnc_child_nuevo()\n{\n\tfnc_checkbox_set_value(fc_frm_cb, 'cest', true);\n\t\n\t// Impuestos\n\tfnc_checkbox_set_value(fc_frm_cb, 'bexonerado', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bigv', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bisc', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bper', false);\n\n\tfnc_checkbox_set_value(fc_frm_cb, 'bserie', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'blote', false);\n\t\n\tfnc_row_um_nuevo();\n}", "function checkboxSeleccionados(){\n var contactos = [];\n for(var i = 0; i < checkboxes.length; i++){//for para rellenar el array\n if(checkboxes[i].checked == true){ //establece el estado marcado de una casilla de verificación\n //agregando los check seleccionados con su respectivo id al array\n contactos.push(checkboxes[i].name);\n }\n }\n //creamos funcion para eliminar el contenido seleccionado por un check y un id en este caso contactos que\n //contiene un nùmero de id en el array\n contactosEliminar(contactos);\n}", "function disableCursos() {\n let checkboxes = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n checkboxes[i].checked = false;\n checkboxes[i].disabled = true;\n }\n}", "function Tick(elem){\r\n\t// Чекбокс\r\n\tconst chbox = document.querySelector(\"header form .confirm input\");\r\n\t// Галочка\r\n\tconst tick = document.querySelector(\"header form .confirm .visible .tick\");\r\n\r\n\tif(chbox.checked) tick.style.opacity = \"0\";\r\n\telse tick.style.opacity = \"1\";\r\n\tconsole.log(chbox.checked);\r\n}", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n \n \n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "function styleCheckbox(table) {\n //\n // $(table).find('input:checkbox').addClass('ace')\n // .wrap('<label />')\n // .after('<span class=\"lbl align-top\" />')\n //\n //\n // $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n // .find('input.cbox[type=checkbox]').addClass('ace')\n // .wrap('<label />').after('<span class=\"lbl align-top\" />');\n }", "onCheckWarp(event) {\n for (var item of this.ItemsWarp) {\n item.Select = event.detail.target.checked;\n }\n }", "function click2_2(){\n var j = document.getElementById('procesos_item').checked;\n\n if (j) {\n console.log(\"avilitado 2-1 \" + \" \" + j);\n //AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n document.getElementById('procesos_item').checked = true;\n Gestion_Estrategica[1] = j;\n if (Gestion_Estrategica[0] === true && Gestion_Estrategica[1] === true && Gestion_Estrategica[2] === true)\n document.getElementById('cbx_gest_estra').checked = true;\n }\n else {\n console.log(\"apagado 2-1 \" + \" \" + j);\n document.getElementById('cbx_gest_estra').checked = false;\n document.getElementById('procesos_item').checked = false;\n Gestion_Estrategica[1] = j;\n }\n console.log(Gestion_Estrategica);\n return j;\n}", "function selCheese(){\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled) {\r\n sav[i].disabled = false;\r\n }\r\n }\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled== false) {\r\n sws[i].disabled = true;\r\n }\r\n }\r\n}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "function estaSeleccionado(obj) { \r\n check = false;\r\n if(isNaN(obj.length)) {\r\n check = obj.checked;\r\n }\r\n else {\r\n longitud = obj.length; \t\t\r\n for(i = 0; i < longitud; i++) {\r\n if(obj[i].checked == true) {\r\n check = true;\r\n break;\r\n }\r\n }\r\n }\r\n return check;\r\n}", "setParentCheckboxes(props = this.props) {\n const stateToSet = {};\n props.skillCones.data.forEach((cone) => {\n let allConeChildrenSelected = true;\n props.item.data.some((itemData) => {\n if (itemData.cone === cone.name && !itemData.isSelected) {\n allConeChildrenSelected = false;\n return true;\n }\n return false;\n });\n stateToSet[cone.id] = allConeChildrenSelected;\n });\n this.setState(stateToSet);\n }", "function limparFiltros() {\n listarFiltros().forEach((elemento) => {\n elemento.checked = false;\n });\n}", "function checkedGestionControlbyMail(){\n\tif(checkedN == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto1');\n\t\t\tpreInscriptionNoGood();\n\t\t}\n\t\telse if (checkedP == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto2');\n\t\t\tcliendNoGood();\n\t\t}\n\t\telse if (checkedI == \"checked\")\n\t\t{\n\t\t\telementManquant1=\"\";\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\tconsole.log('toto3');\t\n\t\t\tinscriptionNoGood();\n\t\t}\n}", "function setCheckboxValues() {\n includeLowercase = lowerCaseCheckbox.checked;\n includeUppercase = uppercaseCheckbox.checked;\n includeNumeric = numericCheckbox.checked;\n includeSpecial = specialCheckbox.checked;\n}", "function click4_1() {\n var j = document.getElementById('mvv_item').checked;\n\n if (j) {\n console.log(\"avilitado 2-1 \" + \" \" + j);\n //AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n document.getElementById('mvv_item').checked = true;\n hk[0] = j;\n if (hk[0] === true && hk[1] === true && hk[2] === true)\n document.getElementById('cbx_hk').checked = true;\n }\n else {\n console.log(\"apagado 2-1 \" + \" \" + j);\n document.getElementById('cbx_hk').checked = false;\n document.getElementById('mvv_item').checked = false;\n hk[0] = j;\n }\n console.log(hk);\n return j;\n}", "function chg_checkbox_posisi(){\n var id = \"#\"+tmp_id_posisi;\n console.log(id);\n $(id).prop('checked', true);\n}", "function precipitacion() {\n if ($(this).is(\":checked\"))\n {\n if ($(this).val() !== 'todos') {\n capa_actual = $(this).val();\n }\n conmutar_cobertura($(this).val(), true);\n $(\"#div_leyenda\").show();\n } else {\n capa_actual = '';\n conmutar_cobertura($(this).val(), false);\n if (listado_capas.length <= 1) {\n $(\"#div_leyenda\").hide();\n }\n }\n actualizar_coberturas();\n map.data.setStyle(style_bf);\n}", "function disabledChecbox(){\n\tvar element = document.getElementById('noticia');\n\t\n\tvar element2 = document.getElementById('seccions');\n\t\n\tif(element.checked){\n\t\telement2.style.display='none';\n\t\treturn false;\n\t}else{\n\t\telement2.style.display='block';\n\t}\n}", "function styleCheckbox(table) {\n\t /**\n\t $(table).find('input:checkbox').addClass('ace')\n\t .wrap('<label />')\n\t .after('<span class=\"lbl align-top\" />')\n\n\n\t $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t .find('input.cbox[type=checkbox]').addClass('ace')\n\t .wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t */\n\t }", "function limpiar_campos(){\r\n\r\n\t//NOMBRE\r\n\tdocument.getElementById(\"txt_nombre\").value = \"\";\r\n\t$(\"#div_nombre\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_nombre\").hide();\r\n\t\r\n\t//EMAIL\r\n\tdocument.getElementById(\"txt_email\").value = \"\";\r\n\t$(\"#div_email\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_email\").hide();\r\n\r\n\t//TELEFONO\r\n\tdocument.getElementById(\"txt_telefono\").value = \"\";\r\n\t$(\"#div_telefono\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_telefono\").hide();\r\n\r\n //TIENE HIJOS?\r\n tiene_hijos[0].checked=true;\r\n\r\n //ESTADO CIVIL\r\n document.getElementById(\"cbx_estadocivil\").value=\"SOLTERO\";\r\n\r\n //INTERESES\r\n document.getElementById(\"cbx_libros\").checked =false;\r\n document.getElementById(\"cbx_musica\").checked =false;\r\n document.getElementById(\"cbx_deportes\").checked =false;\r\n document.getElementById(\"cbx_otros\").checked =false;\r\n $(\"#div_intereses\").attr(\"class\",\"form-group\");\r\n $(\"#span_intereses\").hide();;\r\n}", "function CheckBox() {\n return (\n <div\n css={css`\n display: innli;\n flex-direction: column;\n align-content: center;\n text-align: center;\n `}\n >\n <form class=\"checkList\">\n <ul style={{padding: 0}}>\n {checkboxList.list.map(checkbox => (\n <React.Fragment>\n <input value={checkbox.Cname} style={{margin: '1px', background: 'black', color: 'white'}} id=\"input\" type=\"button\" onClick={(e) => {\n //true or false value\n checkbox.value = !checkbox.value\n categoryName.splice(0, categoryName.length)\n categoryName.push(checkbox.Cname)\n categoryCTag = categoryName \n // console.log(checkboxList) //FOR DEBUGGING\n // console.log(\"checbklsit_: \", categoryName)//FOR DEBUGGING\n }}\n />\n {/* <label>{checkbox.Cname}</label> */}\n </React.Fragment>\n ))\n }\n <input value=\"Clear\" style={{margin: '1px', background: 'black', color: 'white'}} id=\"input\" type=\"button\" onClick={(e) => {\n categoryName = []\n categoryCTag = categoryName\n }}\n />\n </ul>\n </form>\n </div>\n )\n\n}", "function getAllSelectedTaskCheckboxes()\n{\n return $$(\"input.doedit\");\n}", "async function selectFilter2Checkboxes() {\r\n filter = document.querySelector(\"#filterBy\").value;\r\n let checkboxes = document.querySelectorAll('input[name='+filter+']');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = true;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.remove(\"hidden\");\r\n next.classList.remove(\"add\");\r\n \r\n }\r\n updateKorpusCheckboxes();\r\n}", "function initCheckboxes(){\n let checkboxes = document.getElementById(\"content1\").getElementsByTagName('input');\n let planetKeys = Object.keys(visualizer_list);\n let planetKeys2 = Object.keys(visualizer_list2);\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys.includes(checkBoxBody)){\n if(visualizer_list[checkBoxBody].hidden === true){\n checkbox.checked = false;\n }\n else {\n checkbox.checked = true;\n }\n //checkbox.checked = true;\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n else{\n checkbox.disabled = true;\n }\n }\n if(comparing){\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys2.includes(checkBoxBody)){\n checkbox.checked = true;\n // if(visualizer_list[checkBoxBody].hidden === true){\n // checkbox.checked = false;\n // }\n // else {\n // checkbox.checked = true;\n // }\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n }\n }\n addPlusToCheckboxes();\n}", "function allCheckboxCheck() {\n // storing of all other categorieCheckboxes\n var allChecked = true;\n var cbs = document.querySelectorAll('input[id^=\"catCheckbox\"]');\n // checking if one of the checkboxes is not checked\n for (var cb of cbs) {\n if (cb.checked === false) {\n allChecked = false;\n break;\n }\n }\n // checks allCategoriesCheckbox if all other checkboxes are checked\n if (allChecked === true) {\n document.getElementById('checkboxAllCategories').checked = true;\n }\n // unchecks allCategoriesCheckbox if one other checkbox is unchecked\n else {\n document.getElementById('checkboxAllCategories').checked = false;\n }\n}", "function loadCustomCheckbox() {\n const items = document.getElementById(\"items-checkbox\");\n for (let i = 0; i < beverages.length; i++) {\n const b = beverages[i];\n const element = `\n <div class=\"ck-button\">\n <label class=\"ck-button-checked\">\n <input id=\"cb${i + 1}\" type=\"checkbox\" value=\"${b.Name}\" onclick=\"onClickCheckbox(${i})\">\n <span>${b.Name} Rp. ${b.Price}</span>\n </label>\n </div>\n `;\n\n items.innerHTML += element;\n }\n}", "function checkBoxToggle(chkBox)\n{\n\t//kony.print(JSON.stringify(chkBox));\n\t//frmProfile.chkBoxPushSubs[\"selectedKeys\"]=subs;\n\tswitch(chkBox[\"id\"])\n\t{\n\t\tcase \"chkBoxPushSubs\":\n\t\t\tif(audiencePushSubs)\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxSmsSubs\":\n\t\t\tif(audienceSmsSubs)\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxEmailSubs\":\n\t\t\tif(audienceEmailSubs)\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[];\n\t}\n}" ]
[ "0.7221631", "0.7090771", "0.70881206", "0.69570714", "0.69528186", "0.69250095", "0.6831477", "0.6817839", "0.67872065", "0.6698867", "0.6672699", "0.6627253", "0.6601612", "0.6552599", "0.65427727", "0.65071553", "0.65069383", "0.64954245", "0.64941454", "0.648912", "0.64857835", "0.6485215", "0.64829725", "0.647607", "0.64627993", "0.64613", "0.64555377", "0.6448306", "0.64434135", "0.6433647", "0.64294183", "0.6419856", "0.6413223", "0.64056563", "0.6404396", "0.6403652", "0.6394101", "0.6382522", "0.6371728", "0.63688153", "0.6346681", "0.6324057", "0.6283086", "0.6272299", "0.6248378", "0.62474114", "0.623957", "0.62337077", "0.6233353", "0.62274486", "0.6225841", "0.6222409", "0.62210655", "0.6218058", "0.6215998", "0.62139225", "0.6208078", "0.6207309", "0.6205703", "0.62021905", "0.6201225", "0.6190263", "0.61851513", "0.61811054", "0.6177996", "0.6177011", "0.61746275", "0.6173846", "0.61702687", "0.6166983", "0.61665297", "0.6165942", "0.61655664", "0.6163028", "0.61620086", "0.6161049", "0.61607724", "0.6160645", "0.6158381", "0.61548454", "0.61505336", "0.61484283", "0.61484283", "0.6147226", "0.61421305", "0.6140486", "0.61387295", "0.61341125", "0.6130899", "0.6126526", "0.6125681", "0.6124092", "0.61221004", "0.6118969", "0.6118919", "0.61156464", "0.6112605", "0.6109831", "0.6109582", "0.61093783", "0.61048126" ]
0.0
-1
Desahibilita los checkboxes de los profesores
function disableCursos() { let checkboxes = document.querySelectorAll('#tblCursos tbody input[type=checkbox]'); for (let i = 0; i < checkboxes.length; i++) { checkboxes[i].checked = false; checkboxes[i].disabled = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function excluyentes(seleccionado) {\n programador_web.checked = false; \n logistica.checked = false;\n peon.checked = false;\n \n seleccionado.checked = true; \n}", "function deselectCBs() {\n d3.selectAll('.type-checkbox')\n .property('checked', false)\n update();\n d3.select('.kasiosCheckbox')\n .property('checked', false)\n kasios_update();\n}", "function changeFacilities() {\n var ignore = document.getElementById('ignore_facilities');\n var wifiCheckbox = document.getElementById('wifi');\n var poolCheckbox = document.getElementById('pool');\n if(ignore.checked) {\n wifiCheckbox.checked = false;\n poolCheckbox.checked = false;\n }\n if(wifiCheckbox.checked || poolCheckbox.checked) {\n ignore.checked = false;\n }\n}", "function deselectKorpus() {\r\n let checkboxes = document.querySelectorAll('input[name=korpus]');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = false;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.add(\"hidden\");\r\n console.log(\"removed \" + next);\r\n }\r\n console.log(\"deselected\")\r\n loadMiniStats(null);\r\n document.querySelector(\"#alamkorpused\").style.display = 'none';\r\n}", "function limparFiltros() {\n listarFiltros().forEach((elemento) => {\n elemento.checked = false;\n });\n}", "function selChoco(){\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled) {\r\n sws[i].disabled = false;\r\n }\r\n }\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled == false) {\r\n sav[i].disabled = true;\r\n }\r\n }\r\n}", "function deSelectAnswers(){\r\n answer1.forEach((e) =>{\r\n e.checked=false;\r\n });\r\n}", "function onChangeTipoEnvio() {\n $('#checkboxIsUrgentePedido').removeAttr(\"checked\");\n $('#tdIsUrgente').css('visibility', 'hidden');\n}", "function habilitarGrupoPerfil2() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function comprueba_puestos() {\nvar cuantos = 0;\nvar elementos = document.getElementsByName(\"puesto\"); // Es un array con los checkbox de nombre puesto\nvar span_puestos= document.getElementById(\"span_puestos\");\n\n\tfor(i in elementos) {\n if (elementos[i].checked) cuantos++;\n\t }\n\n\tif (!cuantos) { // Es lo mismo que cuantos==0\n span_puestos.style.color=\"red\";\n span_puestos.innerHTML=\" Debe seleccionar un puesto de trabajo\";\n puestos=false;\n }\n\t \n else {\n span_puestos.innerHTML=\"\";\n\t puestos=true;\n }\n}", "function disabledChecbox(){\n\tvar element = document.getElementById('noticia');\n\t\n\tvar element2 = document.getElementById('seccions');\n\t\n\tif(element.checked){\n\t\telement2.style.display='none';\n\t\treturn false;\n\t}else{\n\t\telement2.style.display='block';\n\t}\n}", "function deselectFilter2Checkboxes() {\r\n let checkboxes = document.querySelectorAll('input[name='+filter+']');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = false;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.add(\"hidden\");\r\n \r\n }\r\n document.querySelector(\"#alamkorpused\").style.display = 'none';\r\n}", "function habilitarGrupoPerfil() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function removeSelect(){\n answerEls.forEach(x=>{\n x.checked=false\n })\n }", "function pastro()\n{\n\tfor( var i = 1; i <= LENDET.length; i++ )\n\t{\n\t\tvar tmp1 = document.getElementById( \"fusha\" + i );\n\n\t\ttmp1.value = \" \";\n\n\t\ttmp1.style.visibility = \"hidden\";\n\t}\n\n\tvar tmp2 = document.querySelectorAll( \".cb\" );\n\n\tfor( var j = 0; j < tmp2.length; j++ )\n\t\ttmp2[ j ].checked = false;\n\n\n\tvar x = document.querySelectorAll( \"button\" );\n\t\tfor( var mn = 0; mn < x.length; mn++ )\n\t\t\tx[ mn ].disabled = true;\n\n\n\tdocument.getElementById( \"pergjigja\" ).innerHTML = \"\";\n} /// FUND pastro", "function habilitarGrupoLlamadas() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function selChkTodos(form, chkNombre, boo) {\r\n\tfor(i=0; n=form.elements[i]; i++) \r\n\t\tif (n.type == \"checkbox\" && n.name == chkNombre) n.checked = boo;\r\n}", "function syncronizeCheckboxes(clicked, pri, pub) {\n pri.checked = false;\n pub.checked = false;\n clicked.checked = true;\n }", "function habilitarGrupoLlamadas1() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\t/*Para habilitar en ctas madres*/\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t/* - */\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\t/*Para Deshabilitar en ctas madres*/\r\n\t\tfrm.cuenta.disabled = true;\t\t\r\n\t\t/* - */\t\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function habilitarGrupoPerfil4() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.presubcuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.presubcuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function habilitarGrupoLlamadas2() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t/*Para habilitar en ctas madres*/\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\t/* - */\t\t\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\t/*Para habilitar en ctas madres*/\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\t/* - */\t\t\t\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function unselectOther(all) {\n\tvar element = document.getElementsByName('einzelplan[]');\n\tvar einzelplan = document.getElementsByName('einzelplan')[0];\n\n\tif (all) {\n\t\tfor (var i = 0; i < element.length; i++) {\n\t\t\telement[i].checked = false;\n\t\t}\n\t} else {\n\t\tvar allUnchecked = true;\n\n\t\tfor (var i = 0; i < element.length; i++) {\n\t\t\tif (element[i].checked) {\n\t\t\t\tallUnchecked = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (allUnchecked) {\n\t\t\teinzelplan.checked = true;\n\t \t} else {\n\t \t\teinzelplan.checked = false;\n\t \t}\n\t}\n\n\tdocument.getElementsByName('kapitel')[0].checked = true;\n\tresetForms('kapitel');\n\n\tlimitChapters();\n\n}", "function habilitarGrupo1() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\t//Ahorita lo creo CHVE\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\t//Ahorita lo creo CHVE\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\t\t\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function chkTodos()\r\n{\r\n $(\":checkbox\").not(\"#chkTodos\").each(function(){\r\n if(this.checked)\r\n this.checked = false;\r\n else\r\n this.checked = true;\r\n });\r\n}", "function cancelSetting() {\n $('input:checkbox').each(function (i, elem) {\n $(this).next('label').removeClass('without-pay');\n $(this).next('label').removeClass('paid');\n $(this).attr('checked', false);\n document.getElementById($(this).attr('id')).disabled = false;\n });\n}", "function limpiarAsignacion() {\n $('#a_centro').empty();\n $('#a_empleadosCentro').empty();\n $('#a_todosEmpleados').prop(\"checked\", false);\n}", "function habilitarGrupoLlamadas4() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.presubcuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.presubcuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function habilitarGrupoPerfil1() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function ActivacionDesactivacionEnvioInformes() {\r\n\tif (verEstadoCheckbox('ventriculografia_activacion')\r\n\t\t\t|| verEstadoCheckbox('aortograma_activacion')\r\n\t\t\t|| verEstadoCheckbox('bypass_activacion')\r\n\t\t\t|| verEstadoCheckbox('anatomia_coronaria_activacion')\r\n\t\t\t) {\r\n\t\t\r\n\t\taparecerElemento('Resultados_Informes');\r\n\t} else {\r\n\t\tdesaparecerElemento('Resultados_Informes');\r\n\t}\r\n}", "function updateInventario() {\n if ($('#inventario').prop('checked')) {\n $('#cantidad').prop('disabled', false);\n $('#minimo').prop('disabled', false);\n } else {\n $('#cantidad').prop('disabled', true);\n $('#minimo').prop('disabled', true);\n }\n}", "function controlarChk(){\n\n if( $(this).is(':checked') ){\n\t // Hacer algo si el checkbox ha sido seleccionado\n\t\t$(\"#imgP\").attr(\"disabled\",false);\n\t } else {\n\t // Hacer algo si el checkbox ha sido deseleccionado\n\t \t$(\"#imgP\").attr(\"disabled\",true);\n\t }\n\t\n}//end controlarChk", "function mostrarTecnicosInactivos() {\n const mostrar = document.getElementById('check-tecnicos').checked;\n const elems = $(\"[data-activo=false]\");\n if (mostrar) {\n elems.css('display', '');\n } else {\n elems.css('display', 'none');\n }\n}", "function ocultarInvitados(){\n //Seleccionamos los checkbox 'confimado'\n var confirmado = document.getElementsByClassName('confirmar');\n \n //Si el input 'ocultar invitados' está marcado, ocultamos los invitados que no hayan confirmado\n if(ocultar.checked){\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n //Seleccionamos el elemento li\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n\n if(!confirmado[i].checked){\n li.style.display = 'none';\n }else{\n li.style.display = 'block';\n }\n }\n }\n //Si el input 'ocultar invitados' no está marcado, mostramos todos los invitados\n else{\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n \n li.style.display = 'block';\n }\n }\n}", "function uncheck() {\n document.querySelector(\"#mcp1\").checked = false;\n document.querySelector(\"#mcp2\").checked = false;\n document.querySelector(\"#mcp3\").checked = false;\n document.querySelector(\"#mcp4\").checked = false;\n\n }", "function verificaReprovacaoDistribuicao(box){\n if(box.checked){\n show_distribuicao = true;\n show_repetencia = false;\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('checked', true);\n showDistribuicaoReprovacao();\n showLegendasRepetencia(false);\n showLegendasDesempenho(false);\n mostrarAgrupamento(false);\n }else{\n mostrarAgrupamento(true);\n show_distribuicao = false;\n show_repetencia();\n\n }\n atualizarCheckBox(); \n}", "unCheck() {\n let checkboxes = document.getElementsByTagName('input');\n for (var i=0; i<checkboxes.length; i++) {\n if (checkboxes[i].type === 'checkbox') {\n checkboxes[i].checked = false;\n }\n }\n }", "function diselectAns() {\n\n answers.forEach((selected) => {\n selected.checked = false;\n\n });\n}", "function habilitarGrupo() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function disableCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (!(checkboxes[i].checked)) {\n checkboxes[i].disabled = true;\n }\n }\n}", "function habilitarGrupo4() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.presubcuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.presubcuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function habilitarGrupo2() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t/*Al alterar consulta consumo */\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\t/*Para limpiarlo*/\r\n\t\t//frm.numero.value = \"\";\r\n\t\t//alert('Limpio');\r\n\t\t\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\t/*Al alterar consulta consumo */\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function unselect(){\r\n answerEls.forEach((answerEl)=>{\r\n answerEl.checked = false\r\n })\r\n}", "function editInsuranceAccepted () {\n var vehicleClassIndependentDriver = document.getElementById('taxi_driver_office_profile_vehicle_vehicleClass');\n var checkboxInsuranceAccepted = document.getElementById('taxi_driver_office_profile_insuranceAccepted');\n\n $(vehicleClassIndependentDriver).change( function(){\n var vehicleClassVal = $(this).val();\n\n if ( vehicleClassVal <= 0) {\n $(checkboxInsuranceAccepted).removeAttr('checked');\n // $(checkboxInsuranceAccepted).attr('checked',false);\n // alert('Мало');\n } else {\n // $(checkboxInsuranceAccepted).attr('checked', 'checked');\n $(checkboxInsuranceAccepted).attr('checked', true);\n // alert('Норм');\n }\n return true;\n });\n \n }", "function cbChange(obj) {\nvar instate=(obj.checked);\n var cbs = document.getElementsByClassName(\"cb\");\n for (var i = 0; i < cbs.length; i++) {\n cbs[i].checked = false;\n }\n if(instate)obj.checked = true;\n}", "function evaluateCheckboxes() {\n var checked = $('#photoTable :checkbox:checked');\n deleteButton.attr('disabled', checked.size() === 0);\n }", "function enabledOrganismo(form) {\r\n\tif (form.chkorganismo.checked) form.forganismo.disabled=false; \r\n\telse { form.forganismo.disabled=true; form.fdependencia.disabled=true; form.chkdependencia.checked=false; form.forganismo.value=\"\"; form.fdependencia.value=\"\"; }\r\n}", "function disableCheck(campo, causer) {\r\n\tif (causer.checked) {\r\n\tcampo.checked = false;\r\n\tcampo.disabled = true;\r\n\t}\r\n\telse {\r\n\tcampo.disabled = false;\r\n\t}\r\n\t}", "function masquerClient(){\n \n document.getElementById(\"masquer\").style.display = \"none\";\n document.getElementById(\"identifiant\").style.display=\"block\";\n document.getElementById(\"nouveau\").checked = false;\n}", "function masquerClient(){\n \n document.getElementById(\"masquer\").style.display = \"none\";\n document.getElementById(\"identifiant\").style.display=\"block\";\n document.getElementById(\"nouveau\").checked = false;\n}", "function unvalidateProduits(){\n\t \n\t var $zoneWaiting = $('.wdg_section_wait');\n\t\n\t /** recuperation des valeurs des criteres. */\n\t var activitesVal = []; // activites selectionnes.\n\t $(\"select[name='activites'] option\").each(function(index){\n\t activitesVal.push($(this).val());\n\t });\n\t \n\t var themesVal = []; // themes selectionnes\n\t $(\"select[name='themes'] option\").each(function(index){\n\t themesVal.push($(this).val());\n\t }); \n\t \n\t var publicsVal = []; // publics selectionnes\n\t $(\"select[name='publics'] option\").each(function(index){\n\t publicsVal.push($(this).val());\n\t }); \t \n\t \n\t /** initialisation de l'objet criteria. */\n\t var typesValues = []; // recuperation des types coches : occ, off, sof.\n\t $('.produit-options').hide(); // on cache les options.\n\t if ($('input[name=\"typesProduit\"]:checked').length > 0){\n\t\t $('input[name=\"typesProduit\"]:checked').each(function(index){\n\t\t\t var $elf = $(this);\n\t\t\t typesValues.push($elf.val());\n\t\t\t if ($elf.val()=='off' || $elf.val()=='sof') { $('.produit-options').show(); }\n\t\t });\n\t }\n\n\t \n\t // recuperation des options.\n\t var optionsValues = {\"seance\" : false, \"permanent\" : false, \"temporaire\" : false};\n\t if ($('input[name=\"produitOptions\"]:checked').length > 0){\n\t\t $('input[name=\"produitOptions\"]:checked').each(function(index){\n\t\t\t var $elf = $(this);\n\t\t\t if ($elf.val() == \"seance\") { optionsValues.seance = true; }\n\t\t\t if ($elf.val()== \"permanent\") {optionsValues.permanent = true; } \n\t\t\t if ($elf.val()== \"temporaire\") {optionsValues.temporaire = true; } \n\t\t });\n\t }\t \n\t \n\t // var $frmSection = $('form[name=\"frmSection\"\"]');\n\t var criteriasFilter = {\n\t type : typesValues.join(\",\"),\n\t options : {'seances' : optionsValues.seance, 'permanent' : optionsValues.permanent, 'temporaire' : optionsValues.temporaire},\n\t activites : activitesVal.join(\",\"),\n\t themes : themesVal.join(\",\"),\n\t publics : publicsVal.join(\",\")\n\t };\n\t \n\t /** renvoit true si le type du produit est valide. */\n\t var verifierType = function(produit){\n\t\tif (criteriasFilter.type.length > 0) {\n\t\t\treturn (criteriasFilter.type.toLowerCase().indexOf(produit.data(\"section\").type.toLowerCase()) > -1);\n\t\t}\n\t\treturn true;\n\t };\n\t \n\t /** renvoit true\n\t - pour les occupations.\n\t - pour les off et sof a seances quand dans criteres seance vaut true.\n\t */\n\t var verifierOptionsSeances = function(produit){\n\t if (\"off\" == produit.data(\"section\").type.toLowerCase() || \"sof\" == produit.data(\"section\").type.toLowerCase()) {\n\t if (criteriasFilter.options.seances) {\n\t return criteriasFilter.options.seances == produit.data(\"section\").seances;\n\t }\n\t }\n\t return true;\n\t };\t \n\t \n\t /**\n\t * renvoir les off et sof:\n\t * - temporaire : quand temporaire est en critere de filtre.\n\t * - permanent : quand permanent est en critere de filtre.\n\t */\n\t var verifierOptionsPermanent = function(produit){\n\t if (\"off\" == produit.data(\"section\").type.toLowerCase() || \"sof\" == produit.data(\"section\").type.toLowerCase()) {\n\t if (criteriasFilter.options.permanent) {\n\t return criteriasFilter.options.permanent == produit.data(\"section\").permanent;\n\t }\n\t if (criteriasFilter.options.temporaire) {\n\t return criteriasFilter.options.temporaire == !produit.data(\"section\").permanent;\n\t }\n\t }\n\t return true;\n\t };\t \n\t \n\t /**\n\t * renvoit true si le produit a au moins un\n\t * critere d activite correspondant au filtre.\n\t */\n\t var verifierCriteresActivites = function($produit){\n\t\t \tif (criteriasFilter.activites.length > 0) {\n\t\t \t\tvar activites = $produit.data(\"section\").activites; // renvoit une liste d objet activites.\n\t\t \t\tif (activites.length > 0) {\n\t\t \t\t\tvar state = false;\n\t\t \t\t\t$.each(activites, function(index, activite){\n\t\t \t\t\t\tif (criteriasFilter.activites.indexOf(activite.id) > -1 && !state) { state = true; }\n\t\t \t\t\t});\n\t\t \t\t\treturn state; // produit non valide au regard de ce critere.\n\t\t \t\t}\n\t\t \t}\n\t\t \treturn true; // pas de filtre sur activites.\n\t };\t \n\t \n\t /**\n\t * renvoit true si le produit a au moins un\n\t * critere d activite correspondant au filtre.\n\t */\n\t var verifierThemes = function($produit){\n\t\t \tif (criteriasFilter.themes.length > 0) {\n\t\t \t\tvar themes = $produit.data(\"section\").themes;\n\t\t \t\tif (themes.length > 0) {\n\t\t \t\t\tvar state = false;\n\t\t \t\t\t$.each(themes, function(index, theme){\n\t\t \t\t\t\tif (criteriasFilter.themes.indexOf(theme.id) > -1 && !state) { state = true; }\n\t\t \t\t\t});\n\t\t \t\t\treturn state; // produit non valide au regard de ce critere.\n\t\t \t\t}\n\t\t \t}\n\t\t \treturn true; // pas de filtre sur activites.\n\t };\t \n\t \n\t /**\n\t * renvoit true si le produit a au moins un\n\t * critere d activite correspondant au filtre.\n\t */\n\t var verifierPublics = function($produit){\n\t\t \tif (criteriasFilter.publics.length > 0) {\n\t\t \t\tvar publics = $produit.data(\"section\").publics;\n\t\t \t\tif (publics.length > 0) {\n\t\t \t\t\tvar state = false;\n\t\t \t\t\t$.each(publics, function(index, publi){\n\t\t \t\t\t\tif (criteriasFilter.publics.indexOf(publi.id) > -1 && !state) { state = true; }\n\t\t \t\t\t});\n\t\t \t\t\treturn state; // produit non valide au regard de ce critere.\n\t\t \t\t}\n\t\t \t}\n\t\t \treturn true; // pas de filtre sur publics.\n\t };\t \n\t \n\t // parcours de l ensemble des produits pour invalidation.\n\t $('.produit').removeClass(\"disable-product\").each(function(index){\n\t $elf = $(this);\n\t var state = false; // indique l etat non grise ou grise : true = grise.\n\t if (verifierType($elf)) { // check le type de produit\n\t \t if (verifierOptionsSeances($elf)) { // check des options seances.\n\t\t \t\tif (verifierOptionsPermanent($elf)) {\t\t \n\t\t \t\t if (verifierCriteresActivites($elf)) {\n\t\t \t\t\tif (verifierThemes($elf)) {\n\t\t\t\t\t\tif (!verifierPublics($elf)){ state = true };\n\t\t \t\t\t} else { state = true; }\n\t\t \t\t } else { state = true; }\n\t\t \t\t} else { state = true; }\n\t\t } else { state = true; }\n\t \t } else { state = true; }\n\n\t /** on grise ou non selon l etat. */\n\t if (state) {\n\t $elf.addClass(\"disable-product\");\n\t }\n\t });\n\t \n\t $zoneWaiting.hide();\n\t\n}", "get noCheckboxesSelected() {\n return this.checkboxTargets.every(target => !target.checked)\n }", "function TerminosyCondiciones_() {\n $(_G_ID_ + \"checkbox_acep_terms\").prop(\"checked\", false);\n $('#Modal_TerminosyCondicioones').modal('show')\n}", "function deSelectOptions() {\n answerOptions.forEach((option) => {\n option.checked = false;\n });\n}", "function editOption(){\r\n var inputCheck=document.querySelectorAll('#customCheck1');\r\n for(var i=0;i<inputCheck.length;i++){\r\n inputCheck[i].checked=false;\r\n inputCheck[i].disabled=false;\r\n }\r\n}", "function opcion (){\nif (document.getElementById(\"male\").checked = true) {\n document.getElementById(\"female\").checked = false;\n}\nelse {\n document.getElementById(\"male\").checked = false;\n}}", "function unCheckAllDepartmentBoxes() {\n $(\"#legend input[type='checkbox']\").removeAttr(\"checked\");\n hideAllCoursesAndLinks();\n}", "function uncheck(e) {\n // console.log(e);\n e.forEach((x) => x.checked = false)\n}", "function habilitarGrupo2DLlamadas() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\t//alert('Limpio FEcha');\r\n\t\t//frm.fechaFacturacion.value =0;\r\n\t\t//frm.fechaEmision.length =0;\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t/*Al alterar consulta consumo */\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\t/*Para limpiarlo*/\r\n\t\t//frm.numero.value = \"\";\r\n\t\t//alert('Limpio');\r\n\t\t\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\t/*Al alterar consulta consumo */\r\n\t\tfrm.subcuenta.disabled = true;\t\t\r\n\t\t\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function uncheckedAll()\n\t{\n\t \t var pollchecks = document.getElementsByTagName(\"INPUT\");\n\t\t var _return = false;\t \n\t\t for (var i = 0; i < pollchecks.length; i++)\n\t\t {\t\t\t\n\t\t\tif(pollchecks[i].type == \"checkbox\")\n\t\t\t{\n\t\t\t\t pollchecks[i].checked = false;\n\t\t\t\t\n\t\t\t}\n\t\t }\n\t\t \n\t}", "function activarcheckbox(bigdata){\n $.each(bigdata, function(key, item) {\n //if(key==\"productos\"){\n let inicial=key.substring(0, 4);\n console.log(key, item, inicial);\n $('input#'+key).iCheck('check');\n if(!getAccess(item, 1)){\n $('#vie'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 2)){\n $('#adi'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 4)){\n $('#edi'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 8)){\n $('#del'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 16)){\n $('#pri'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 32)){\n $('#act'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 64)){\n $('#sel'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 128)){\n $('#pay'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 256)){\n $('#acc'+inicial).iCheck('uncheck')\n }\n //}\n });\n}", "function CHMcheckUncheckAll(isCheck, formName, fieldName)\r\n{\r\n var obj = eval('document.'+formName+'.'+fieldName);\r\n\tvar len ;\r\n\t\r\n\tif(obj) len = obj.length;\r\n\telse return;\r\n\t\r\n\tif( len == null )\r\n\t\t{\r\n\t\t\tif(! obj.disabled)\r\n\t\t\t{\r\n\t\t\t\tobj.checked = isCheck;\r\n\t\t\t\tchangeStatus(formName,fieldName,obj)\r\n\t\t\t}\r\n\t\t}\r\n\telse\r\n\t{\r\n\t\tfor(var lvar_Cnt=0; lvar_Cnt < len; lvar_Cnt++)\r\n\t\t{\r\n\t\t if(! obj[lvar_Cnt].disabled) {\r\n\t\t\t obj[lvar_Cnt].checked = isCheck;\r\n \t\t\t changeStatus(formName,fieldName,obj[lvar_Cnt])\r\n\t\t }\r\n\t\t}\r\n\t}\r\n\treturn;\r\n}", "function uncheckAll(){\n $('#exploration').find('input[type=\"checkbox\"]:checked').prop('checked',false);\n for (var filter in checkboxFilters) {\n checkboxFilters[filter].active = false;\n }\n createDistricts();\n }", "function enableCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (!(checkboxes[i].checked)) {\n checkboxes[i].disabled = false;\n }\n }\n}", "function verificaReprovacao(box){\n if(box.checked){\n show_repetencia = true;\n show_distribuicao = false;\n showLegendasRepetencia(true);\n showLegendasDesempenho(false); \n showLegendasAgrupamento(false);\n mostrarAgrupamento(false);\n $('#ckb_distribuicao').prop('checked', false);\n }else{\n if(show_distribuicao==false){\n showLegendasRepetencia(false);\n if(show_agrupamento==true){\n showLegendasAgrupamento(true);\n showLegendasDesempenho(false); \n showLegendasRepetencia(false);\n }else{\n showLegendasDesempenho(true); \n showLegendasRepetencia(false);\n showLegendasAgrupamento(false);\n }\n mostrarAgrupamento(true); \n }\n show_repetencia = false;\n }\n mostrarBarrasParalelas();\n}", "function limpiar_terminos()\n{\n\tjQuery('#'+'gridCheck').prop(\"checked\", false);\n}", "isThisCheckboxLabeless() {\n return this.type==='checkbox' && typeof this.label===\"undefined\";\n }", "function afficheElement(){\n \n document.getElementById(\"masquer\").style.display = \"block\";\n document.getElementById(\"identifiant\").style.display=\"none\";\n document.getElementById(\"ancien\").checked = false;\n\n\n}", "function afficheElement(){\n \n document.getElementById(\"masquer\").style.display = \"block\";\n document.getElementById(\"identifiant\").style.display=\"none\";\n document.getElementById(\"ancien\").checked = false;\n\n\n}", "function uncheckAll()\n{\n\tvar checkboxes = $(\"#fieldPicker :checkbox\");\n\tfor (var i = 0; i < checkboxes.length; i++)\n\t{\n\t\t\tcheckboxes[i].checked = false;\n\t}\n\n}", "function precipitacion() {\n if ($(this).is(\":checked\"))\n {\n if ($(this).val() !== 'todos') {\n capa_actual = $(this).val();\n }\n conmutar_cobertura($(this).val(), true);\n $(\"#div_leyenda\").show();\n } else {\n capa_actual = '';\n conmutar_cobertura($(this).val(), false);\n if (listado_capas.length <= 1) {\n $(\"#div_leyenda\").hide();\n }\n }\n actualizar_coberturas();\n map.data.setStyle(style_bf);\n}", "function updateCheckBoxes() {\n const checkboxes = [];\n\n checkboxes.push(document.querySelector('#inspiration'));\n\n checkboxes.push(document.querySelector('#dss1'));\n checkboxes.push(document.querySelector('#dss2'));\n checkboxes.push(document.querySelector('#dss3'));\n\n checkboxes.push(document.querySelector('#dsf1'));\n checkboxes.push(document.querySelector('#dsf2'));\n checkboxes.push(document.querySelector('#dsf3'));\n\n checkboxes.forEach((ele) => {\n if (ele.value === 'true') {\n ele.setAttribute('checked', 'checked');\n } else {\n ele.removeAttribute('checked');\n }\n });\n}", "function enableCursos() {\n let checkboxes = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (!(checkboxes[i].checked)) {\n checkboxes[i].disabled = false;\n }\n }\n}", "function selCheese(){\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled) {\r\n sav[i].disabled = false;\r\n }\r\n }\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled== false) {\r\n sws[i].disabled = true;\r\n }\r\n }\r\n}", "function deselectAnswers() {\r\n answerEls.forEach((answerEl) => {\r\n answerEl.checked = false;\r\n });\r\n}", "function limpiar_campos(){\r\n\r\n\t//NOMBRE\r\n\tdocument.getElementById(\"txt_nombre\").value = \"\";\r\n\t$(\"#div_nombre\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_nombre\").hide();\r\n\t\r\n\t//EMAIL\r\n\tdocument.getElementById(\"txt_email\").value = \"\";\r\n\t$(\"#div_email\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_email\").hide();\r\n\r\n\t//TELEFONO\r\n\tdocument.getElementById(\"txt_telefono\").value = \"\";\r\n\t$(\"#div_telefono\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_telefono\").hide();\r\n\r\n //TIENE HIJOS?\r\n tiene_hijos[0].checked=true;\r\n\r\n //ESTADO CIVIL\r\n document.getElementById(\"cbx_estadocivil\").value=\"SOLTERO\";\r\n\r\n //INTERESES\r\n document.getElementById(\"cbx_libros\").checked =false;\r\n document.getElementById(\"cbx_musica\").checked =false;\r\n document.getElementById(\"cbx_deportes\").checked =false;\r\n document.getElementById(\"cbx_otros\").checked =false;\r\n $(\"#div_intereses\").attr(\"class\",\"form-group\");\r\n $(\"#span_intereses\").hide();;\r\n}", "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tvar checkBox1 = document.getElementById(\"lactoseF\");\n\tvar checkBox2 = document.getElementById(\"nutsF\");\n\tvar checkBox3 = document.getElementById(\"organique\");\n\tvar checkBox4 = document.getElementById(\"none\");\n\n\n\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\t/*if ((document.querySelector(\".organiqueCB\").checked)&&(document.querySelector(\".pasDeNoix\").checked) && (document.querySelector(\".lactoseFreeCB\").checked)&& (prods[i].all == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\n\t\t}*/\n\t\tif (checkBox1.checked==true && checkBox2.checked==true && checkBox3.checked==true && prods[i].all==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if(checkBox3.checked==true &&checkBox2.checked==true && prods[i].vegAndNut==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if (checkBox3.checked==true && checkBox1.checked==true && prods[i].vegAndGlu==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\n\t\telse if (checkBox1.checked==true && checkBox2.checked==true && prods[i].nutAndGlu==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if(checkBox1.checked==true && checkBox2.checked==false && checkBox3.checked==false && prods[i].glutenFree==true ){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if(checkBox2.checked==true && checkBox1.checked==false && checkBox3.checked==false && prods[i].no_nuts==true){\n\t\t\tproduct_names.push(prods[i].name);\n\n\t\t}\n\t\telse if (checkBox3.checked==true && checkBox1.checked==false&&checkBox2.checked==false && prods[i].vegetarian==true){\n\t\t\tproduct_names.push(prods[i].name);\n\n\t\t\n\t\t}\n\t\telse if (checkBox4.checked==true){\n\t\t\t\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t/*if (checkBox1.checked==false && checkBox2.checked==false && checkBox3.checked==false && (prods[i].vegetarian==true || prods[i].glutenFree==true || prods[i].no_nuts==true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\n\t\t/*else if ((document.querySelector(\".organiqueCB\").checked)&& (prods[i].vegetarian == true)){\n\n\t\t\tif ((document.querySelector(\".lactoseFreeCB\").checked) && (prods[i].glutenFree == true)){\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}\n\t\t\telse if ((restriction == \"pasDeNoix\")&& (prods[i].no_nuts == true)){\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}else{\n\t\t\tproduct_names.push(prods[i].name);}\n\t\t}\n\t\telse if ((document.querySelector(\".lactoseFreeCB\").checked) && (prods[i].glutenFree == true)){\n\t\t\tif ((restriction == \"pasDeNoix\")&& (prods[i].no_nuts == true)){\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}else{\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t/*else if ((restriction == \"pasDeNoix\")&& (prods[i].no_nuts == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\t\n\t\telse if ((restriction == \"none\")){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}*/\n\t\t\n\t}\n\treturn product_names;\n}", "function anular_seleccion_cliente() {\n\tvar clientes = document.getElementsByName(\"checkito\");\n\tfor (var i = 1; i <= clientes.length; i++) {\n\t\tnombre_cli = \"cli\" + i;\n\t\tdocument.getElementById(nombre_cli).checked = false;\n\t}\n\tmostrar_ayuda(false);\n}", "function showblocked() {\r\n\tcheckboxes = document.getElementsByName(\"checkbox\");\r\n\ttrash = document.getElementById(\"deleteCustomer\");\r\n\tmodify = document.getElementById(\"modifyCustomer\");\r\n\tvar cont = 0;\r\n\tfor (var i = 0; i < checkboxes.length; i++) {\r\n\t\tvar checkbox = checkboxes[i];\r\n\t\tif(checkbox.checked) {\r\n\t\t\tcont++;\r\n\t\t}\r\n\t}\r\n\r\n\tif(cont != 0)\r\n\t\ttrash.style.display='';\r\n\tif(cont == 1) \r\n\t\tmodify.style.display='';\r\n\tif(cont == 0) {\r\n\t\tmodify.style.display='none';\r\n\t\ttrash.style.display='none';\r\n\t}\r\n\tif(cont > 1)\r\n\t\tmodify.style.display='none';\r\n}", "function checkUncheckAllForMultipleDetail(isCheck, formName, fieldName, statusFlag)\r\n{\r\n var obj = eval('document.'+formName+'.'+fieldName);\r\n\tvar len ;\r\n\t\r\n\tif(obj) len = obj.length;\r\n\telse return;\r\n\t\r\n\tif( len == null )\r\n\t{\r\n\t\tif(!obj.disabled)\r\n\t\t{\r\n\t\t\tobj.checked = isCheck;\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tfor(var lvar_Cnt=0; lvar_Cnt < len; lvar_Cnt++)\r\n\t\t{\r\n\t\t if(! obj[lvar_Cnt].disabled) {\r\n\t\t\t obj[lvar_Cnt].checked = isCheck;\r\n \t\t\t changeStatusForMultipleDetail(formName,fieldName,obj[lvar_Cnt], statusFlag)\r\n\t\t }\r\n\t\t}\r\n\t}\r\n\treturn;\r\n}", "function eveChck() {\n $('.chgrup').on('click',function(){\n var cuales = $(this).attr('id'); \n if( $(this).prop('checked')) {\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', 'checked');\n });\n }else{\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', false);\n });\n } \n });\n $('.cksub').on('click', function(){\n var mod = $(this).attr('for');\n if( $(this).prop('checked')) {\n if(!$('#'+mod).prop('checked')) {\n $('#'+mod).prop('checked', 'checked');\n } \n }else{\n var cuantas = 0;\n $('input[for ='+ mod +']').each(function(){\n if($(this).prop('checked')) {\n cuantas++;\n }\n });\n if (cuantas == 0) {\n $('#'+mod).prop('checked', false);\n }\n }\n \n });\n}", "function asociarPermisoAUsuario(usersSelected){\n\n var form = document.getElementById(\"form_mis_tablones\");\n var e;\n var nombre;\n var text;\n var input;\n\n //alert(document.getElementById(\"paraeliminar\"));\n\n if(document.getElementById(\"paraeliminar\") != null){//si existe\n\n form.removeChild(document.getElementById(\"paraeliminar\"));\n }\n\n/*creo un div dinámicamente, estoy me favorece mucho a la hora de eliminar después todos sus nodos para reescribirlos*/\n e = document.createElement(\"div\");\n e.id = \"paraeliminar\";\n form.appendChild(e);\n \n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n /*crea la cadena: Asociar permiso a usuario:*/\n var p = document.createElement(\"p\"); \n var b = document.createElement(\"b\");\n b.name= \"eliminar\";\n var asociarCadena = document.createTextNode(\"Asociar permiso a usuario:\");\n b.appendChild(asociarCadena);\n e.appendChild(b);\n\n\n for(var i = 0; i<usersSelected.length; i++){\n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n p.name = \"eliminar\";\n e.appendChild(p);\n /**/\n\n\n nombre = document.createTextNode(usersSelected[i].name + \" \" + usersSelected[i].surname1 + \" \" + usersSelected[i].surname2);\n e.appendChild(nombre);\n\n \n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"1\";\n\n\n e.appendChild(document.createTextNode(\"Lectura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"2\";\n\n e.appendChild(document.createTextNode(\"Escritura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"4\";\n\n e.appendChild(document.createTextNode(\"Lectura remota\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"8\";\n\n e.appendChild(document.createTextNode(\"Escritura remota\"));\n e.appendChild(input);\n\n \n //alert(\"undefined? : \" + usersSelected[i].name);\n\n //checkbox.id = \"id\";\n\n\n \n\n e.appendChild(input);\n }\n\n}", "function prepareInitialCheckboxes() {\n\tfor (var i = 1; i <= $v(\"totalLines\");) {\n\t\tif (cellValue(i, \"application\") == 'All') {\n\t\t\tvar topRowId = i;\n\t\t\tvar preCompanyId = cellValue(topRowId, \"companyId\");\n\t\t\tvar preFacilityId = cellValue(topRowId, \"facilityId\");\n\t\t\tfor (i++; i <= $v(\"totalLines\"); i++) {\n\t\t\t\tif (preCompanyId == cellValue(i, \"companyId\") && preFacilityId == cellValue(i, \"facilityId\")) { //check if the row is still within scope\n\t\t\t\t\tfor (var j = 0; j <= $v(\"headerCount\"); j++) {\n\t\t\t\t\t\tvar colName = config[5 + 2 * j].columnId;\n\t\t\t\t\t\t//Note: 5 being the no. of columns before the Permission columns (starting from 0)\n\t\t\t\t\t\t// 2 * j is the index of the columns contain check boxes (skipping preceding hidden columns)\n\t\t\t\t\t\tif (cell(topRowId, colName).isChecked()) {\n\t\t\t\t\t\t\tif (cell(i, colName).isChecked())\n\t\t\t\t\t\t\t\tcell(i, colName).setChecked(false);\n\t\t\t\t\t\t\tcell(i, colName).setDisabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tpreCompanyId = cellValue(i, \"companyId\");\n\t\t\t\t\tpreFacilityId = cellValue(i, \"facilityId\");\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else\n\t\t\ti++;\n\t}\n}", "function chkall_fran_orders(franid) {\n var checkBoxes=$(\".chk_pick_list_by_fran_\"+franid);\n if($(\"#pick_all_fran_\"+franid).is(\":checked\")) {\n checkBoxes.attr(\"checked\", !checkBoxes.attr(\"checked\"));\n }\n else {\n checkBoxes.removeAttr(\"checked\", checkBoxes.attr(\"checked\"));\n }\n}", "function verificaGrupo(box){\n if(box.checked){\n box_grupo = box_grupo.concat(box.value);\n show_agrupamento = true;\n showLegendasAgrupamento(true);\n showLegendasDesempenho(false);\n }else{\n box_grupo.splice(box_grupo.indexOf(box.value), 1);\n if(box_grupo.length==0){\n show_agrupamento = false;\n showLegendasAgrupamento(false);\n showLegendasDesempenho(true);\n }\n }\n filtrar();\n // atualizarCheckBox();\n}", "function reactionCheckbox () {\n vArrows = cb1.checked; // Pfeile für Bewegungsrichtung\n bArrows = cb2.checked; // Pfeile für Magnetfeld\n iArrows = cb3.checked; // Pfeile für Induktionsstrom\n if (!on) paint(); // Falls Animation abgeschaltet, neu zeichnen\n }", "function deseleccionarTodo() {\n $('#paciente').prop(\"checked\", false);\n $('#profesional').prop(\"checked\", false);\n $('#laboratorio').prop(\"checked\", false);\n $('#restaurante').prop(\"checked\", false);\n $('#dietetica').prop(\"checked\", false);\n $('#btn-paciente').removeClass('colorear');\n $('#btn-profesional').removeClass('colorear');\n $('#btn-laboratorio').removeClass('colorear');\n $('#btn-restaurante').removeClass('colorear');\n $('#btn-dietetica').removeClass('colorear');\n}", "get unselected() {\n return this.checkboxTargets.filter(target => !target.checked)\n }", "function tgboxes(el){\n\tvar i, boxes = el.querySelectorAll(\"input[type=checkbox]\");\n\tfor(i=0; i<boxes.length; i++) boxes[i].checked = !boxes[i].checked;\n}", "function UncheckAll() {\n const el = document.querySelectorAll(\"input.checkboxFilter\");\n console.log(el);\n for (var i = 0; i < el.length; i++) {\n var check = el[i];\n if (!check.disabled) {\n check.checked = false;\n }\n }\n }", "function startYogaPlanClear(){\n\tdocument.getElementById(\"rundomAsanClear\").style.visibility = \"hidden\";\n\tfor (i = 0; i <= 4; i++){\n\t\tdocument.getElementsByName(\"yogaPlan\")[i].checked = false;\n\t\tdocument.getElementById(\"rundomAsanSubmit\").style.visibility = \"hidden\";\n\t}\n\tfor (i = 0; i <= 2; i++){\n\t\tdocument.getElementsByName(\"asans\")[i].checked = false;\n\t}\n}", "function setUnselected(){\n $(\"input:checkbox[name=selectFoods]:checked\").each(function() {\n name = $(this).val();\n genId = \"#\" + name + \"Ext\";\n\n $(this).attr('checked', false);\n document.getElementById(name).selected = false;\n $(genId).find('input[type=\"number\"]').remove();\n });\n}", "function stopListeningToCheckbox() {\n $('input[type=\"checkbox\"].quizMulti').\n off(\"change\");\n}", "function uncheckOnInit(){\r\n\t\t\r\n\t\tvar objCheckboxes = g_objWrapper.find(\".uc-filelist-checkbox\");\r\n\r\n\t\tobjCheckboxes.each(function(){\r\n\t\t\tvar checkbox = jQuery(this);\r\n\t\t\tvar initChecked = checkbox.data(\"initchecked\");\r\n\t\t\t\r\n\t\t\tif(!initChecked)\r\n\t\t\t\tcheckbox.prop('checked', false);\r\n\t\t});\r\n\t\t\r\n\t}", "function verificarCheckCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n let checkeado = false;\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n checkeado = true;\n }\n }\n if (checkeado == true) {\n disableCarreras();\n enableCursos();\n } else {\n enableCarreras();\n disableCursos();\n }\n\n}", "function marcarLinhaComoSelecionada() {\n $scope.detalhesExcluir.forEach(detalheExcluir => {\n\n for (var i = 0; i < $scope.gestaoVendaResultados.length; i++) {\n\n if (detalheExcluir.idDetalhe == $scope.gestaoVendaResultados[i].idDetalhe) {\n $scope.gestaoVendaResultados[i].isChecked = true;\n break;\n }\n\n }\n })\n }", "function initCheckboxes(){\n let checkboxes = document.getElementById(\"content1\").getElementsByTagName('input');\n let planetKeys = Object.keys(visualizer_list);\n let planetKeys2 = Object.keys(visualizer_list2);\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys.includes(checkBoxBody)){\n if(visualizer_list[checkBoxBody].hidden === true){\n checkbox.checked = false;\n }\n else {\n checkbox.checked = true;\n }\n //checkbox.checked = true;\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n else{\n checkbox.disabled = true;\n }\n }\n if(comparing){\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys2.includes(checkBoxBody)){\n checkbox.checked = true;\n // if(visualizer_list[checkBoxBody].hidden === true){\n // checkbox.checked = false;\n // }\n // else {\n // checkbox.checked = true;\n // }\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n }\n }\n addPlusToCheckboxes();\n}", "function hideAllCompareCheckboxes() {\n $(\".tabCompare\").children().hide().attr(\"checked\", false);\n }", "function atualizarCheckBox(){\n box_periodo = [];\n box_departamento = [];\n box_grupo = [];\n\n var periodosAluno = getPeriodos();\n var departamentosAluno = getDepartamentos();\n var gruposAluno = getGrupos();\n\n if (periodosAluno.indexOf(\"20111\") == -1 || show_distribuicao == true) {\n $('#p_20111').prop('disabled', true);\n $('#p_20111').prop('checked', false);\n }else {\n $('#p_20111').prop('disabled', false);\n $('#p_20111').prop('checked', true);\n box_periodo = box_periodo.concat([\"20111\"]);\n };\n\n if (periodosAluno.indexOf(\"20112\") == -1 || show_distribuicao == true) {\n $('#p_20112').prop('disabled', true);\n $('#p_20112').prop('checked', false);\n }else {\n $('#p_20112').prop('disabled', false);\n $('#p_20112').prop('checked', true);\n box_periodo = box_periodo.concat([\"20112\"]);\n };\n\n if (periodosAluno.indexOf(\"20121\") == -1 || show_distribuicao == true) {\n $('#p_20121').prop('disabled', true);\n $('#p_20121').prop('checked', false);\n }else {\n $('#p_20121').prop('disabled', false);\n $('#p_20121').prop('checked', true);\n box_periodo = box_periodo.concat([\"20121\"]);\n };\n\n if (periodosAluno.indexOf(\"20122\") == -1 || show_distribuicao == true) {\n $('#p_20122').prop('disabled', true);\n $('#p_20122').prop('checked', false);\n }else {\n $('#p_20122').prop('disabled', false);\n $('#p_20122').prop('checked', true);\n box_periodo = box_periodo.concat([\"20122\"]);\n };\n\n\n if (!show_disciplina) {\n if (departamentosAluno.indexOf(\"dsc\") == -1) {\n $('#d_dsc').prop('disabled', true);\n $('#d_dsc').prop('checked', false);\n }else {\n $('#d_dsc').prop('disabled', false);\n $('#d_dsc').prop('checked', true);\n box_departamento = box_departamento.concat([\"dsc\"]);\n };\n\n if (departamentosAluno.indexOf(\"dme\") == -1) {\n $('#d_dme').prop('disabled', true);\n $('#d_dme').prop('checked', false);\n }else {\n $('#d_dme').prop('disabled', false);\n $('#d_dme').prop('checked', true);\n box_departamento = box_departamento.concat([\"dme\"]);\n };\n\n if (departamentosAluno.indexOf(\"fisica\") == -1) {\n $('#d_fisica').prop('disabled', true);\n $('#d_fisica').prop('checked', false);\n }else {\n $('#d_fisica').prop('disabled', false);\n $('#d_fisica').prop('checked', true);\n box_departamento = box_departamento.concat([\"fisica\"]);\n };\n\n if (departamentosAluno.indexOf(\"humanas\") == -1) {\n $('#d_humanas').prop('disabled', true);\n $('#d_humanas').prop('checked', false);\n }else {\n $('#d_humanas').prop('disabled', false);\n $('#d_humanas').prop('checked', true);\n box_departamento = box_departamento.concat([\"humanas\"]);\n };\n\n if (departamentosAluno.indexOf(\"esportes\") == -1) {\n $('#d_esportes').prop('disabled', true);\n $('#d_esportes').prop('checked', false);\n }else {\n $('#d_esportes').prop('disabled', false);\n $('#d_esportes').prop('checked', true);\n box_departamento = box_departamento.concat([\"esportes\"]);\n };\n if (!show_repetencia) {\n var teste = dados_repetencia.filter(function(d){return d.matricula == id_aluno;}); \n if((dados_repetencia.filter(function(d){return d.matricula == id_aluno;})).length == 0){\n $('#ckb_reprovacao').prop('disabled', true);\n $('#ckb_reprovacao').prop('checked', false);\n \n }else {\n $('#ckb_reprovacao').prop('disabled', false);\n $('#ckb_reprovacao').prop('checked', false);\n };\n\n \n };\n \n }else{\n if (!show_repetencia) {\n var teste2 = dados_repetencia.filter(function(d){return d.disciplina == id_disciplina;});\n\n if((dados_repetencia.filter(function(d){return d.disciplina == id_disciplina;})).length == 0){\n $('#ckb_reprovacao').prop('disabled', true);\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('disabled', true);\n $('#ckb_distribuicao').prop('checked', false);\n }else {\n $('#ckb_reprovacao').prop('disabled', false);\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('disabled', false);\n $('#ckb_distribuicao').prop('checked', false);\n };\n \n if (gruposAluno.indexOf(\"1\") == -1) {\n $('#grupo1').prop('disabled', true);\n $('#grupo1').prop('checked', false);\n }else {\n $('#grupo1').prop('disabled', false);\n $('#grupo1').prop('checked', true);\n box_grupo = box_grupo.concat([\"1\"]);\n };\n\n if (gruposAluno.indexOf(\"2\") == -1) {\n $('#grupo2').prop('disabled', true);\n $('#grupo2').prop('checked', false);\n }else {\n $('#grupo2').prop('disabled', false);\n $('#grupo2').prop('checked', true);\n box_grupo = box_grupo.concat([\"2\"]);\n };\n\n if (gruposAluno.indexOf(\"3\") == -1) {\n $('#grupo3').prop('disabled', true);\n $('#grupo3').prop('checked', false);\n }else {\n $('#grupo3').prop('disabled', false);\n $('#grupo3').prop('checked', true);\n box_grupo = box_grupo.concat([\"3\"]);\n };\n\n if (gruposAluno.indexOf(\"4\") == -1 || show_distribuicao == true) {\n $('#grupo4').prop('disabled', true);\n $('#grupo4').prop('checked', false);\n }else {\n $('#grupo4').prop('disabled', false);\n $('#grupo4').prop('checked', true);\n box_grupo = box_grupo.concat([\"4\"]);\n };\n\n if (gruposAluno.indexOf(\"5\") == -1 || show_distribuicao == true) {\n $('#grupo5').prop('disabled', true);\n $('#grupo5').prop('checked', false);\n }else {\n $('#grupo5').prop('disabled', false);\n $('#grupo5').prop('checked', true);\n box_grupo = box_grupo.concat([\"5\"]);\n };\n\n if (gruposAluno.indexOf(\"6\") == -1 || show_distribuicao == true) {\n $('#grupo6').prop('disabled', true);\n $('#grupo6').prop('checked', false);\n }else {\n $('#grupo6').prop('disabled', false);\n $('#grupo6').prop('checked', true);\n box_grupo = box_grupo.concat([\"6\"]);\n };\n\n if (gruposAluno.indexOf(\"7\") == -1 || show_distribuicao == true) {\n $('#grupo7').prop('disabled', true);\n $('#grupo7').prop('checked', false);\n }else {\n $('#grupo7').prop('disabled', false);\n $('#grupo7').prop('checked', true);\n box_grupo = box_grupo.concat([\"7\"]);\n };\n\n if (gruposAluno.indexOf(\"8\") == -1 || show_distribuicao == true) {\n $('#grupo8').prop('disabled', true);\n $('#grupo8').prop('checked', false);\n }else {\n $('#grupo8').prop('disabled', false);\n $('#grupo8').prop('checked', true);\n box_grupo = box_grupo.concat([\"8\"]);\n };\n\n if (gruposAluno.indexOf(\"0\") == -1 || show_distribuicao == true) {\n $('#grupo9').prop('disabled', true);\n $('#grupo9').prop('checked', false);\n }else {\n $('#grupo9').prop('disabled', false);\n $('#grupo9').prop('checked', true);\n box_grupo = box_grupo.concat([\"0\"]);\n };\n\n }\n\n\n };\n \n}", "function ActivarDesactivarDia(dia){\n\n\t//saber si el checkbox esta seleccionado\n\tif( $('#'+dia).prop('checked') ) {\n\t\t\n \t$(\"#inicioJornada\"+dia).prop('disabled', false);\n \t$(\"#finJornada\"+dia).prop('disabled', false);\n \t\n\t}else{\n\t\t\n \t$(\"#inicioJornada\"+dia).prop('disabled', true);\n \t$(\"#finJornada\"+dia).prop('disabled', true);\t\n \t\n \t$(\"#inicioJornada\"+dia).removeClass(\"valid\")\n \t$(\"#inicioJornada\"+dia).removeClass(\"invalid\");\n \n \t$(\"#finJornada\"+dia).removeClass(\"valid\");\n \t$(\"#finJornada\"+dia).removeClass(\"invalid\");\n \t \t \t\n \t$(\"#inicioJornada\"+dia).val(\"\");\n \t$(\"#finJornada\"+dia).val(\"\");\n \t\t\n\t}\n\t\n\t\n}", "function checkProfesionalSalud() {\r\n\tvar esProSalud = document.getElementById(\"chkPSalud\");\r\n\tvar divMatricula = document.getElementById(\"divMatricula\");\r\n\tvar divAutoridad = document.getElementById(\"divAutoridad\");\r\n\tvar inpMatricula = document.getElementById(\"matricula\");\r\n\tvar inpAutoridad = document.getElementById(\"autoridad\");\r\n\t\r\n\t\r\n\t\tif(esProSalud.checked){\r\n\t\t\tdivMatricula.style.display = \"block\";\r\n\t\t\tdivAutoridad.style.display = \"block\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tdivMatricula.style.display = \"none\";\r\n\t\t\tdivAutoridad.style.display = \"none\";\r\n\t\t\t//inpMatricula.className.replace(\"invalid\",\"valid\"); no funciono esta opcion para actualizar el estado del className en valido \r\n\t\t\t//inpAutoridad.className.replace(\"invalid\",\"valid\"); y poder continuar sin los campos requeridos \r\n\t\t}\r\n\t}" ]
[ "0.7512081", "0.6724315", "0.6658563", "0.660186", "0.6548312", "0.65242004", "0.651267", "0.6511075", "0.6458063", "0.6451911", "0.6448067", "0.64476585", "0.6446657", "0.6413711", "0.64111525", "0.6397724", "0.6364209", "0.6347687", "0.6336978", "0.6325958", "0.63232154", "0.63194007", "0.63187945", "0.6312114", "0.63075954", "0.62970954", "0.6283896", "0.6281824", "0.62817377", "0.6280358", "0.6278973", "0.6276164", "0.6273397", "0.6272564", "0.627092", "0.6260446", "0.62548107", "0.6217704", "0.6210587", "0.6190222", "0.61856097", "0.6182586", "0.6182036", "0.6156809", "0.61560696", "0.6148433", "0.6148062", "0.6147476", "0.6147476", "0.61296", "0.612748", "0.6094846", "0.60905546", "0.6087414", "0.6074774", "0.6065347", "0.6064125", "0.6063813", "0.6062862", "0.6061359", "0.60612077", "0.60538197", "0.6053355", "0.6031579", "0.60263324", "0.6021656", "0.6013457", "0.6013457", "0.60111", "0.6009581", "0.6007448", "0.60022897", "0.5996203", "0.5983652", "0.5976387", "0.5974398", "0.5971446", "0.59645945", "0.59484106", "0.5943634", "0.59374934", "0.59368443", "0.59319293", "0.5931786", "0.5925153", "0.5925134", "0.5923642", "0.5914065", "0.5912896", "0.5910602", "0.5910286", "0.5906802", "0.58995295", "0.5889519", "0.5886271", "0.5884762", "0.58825123", "0.58733153", "0.58672947", "0.5862067" ]
0.6199957
39
Habilita los checkboxes de los profesores
function enableCursos() { let checkboxes = document.querySelectorAll('#tblCursos tbody input[type=checkbox]'); for (let i = 0; i < checkboxes.length; i++) { if (!(checkboxes[i].checked)) { checkboxes[i].disabled = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function excluyentes(seleccionado) {\n programador_web.checked = false; \n logistica.checked = false;\n peon.checked = false;\n \n seleccionado.checked = true; \n}", "function selChkTodos(form, chkNombre, boo) {\r\n\tfor(i=0; n=form.elements[i]; i++) \r\n\t\tif (n.type == \"checkbox\" && n.name == chkNombre) n.checked = boo;\r\n}", "function comprueba_puestos() {\nvar cuantos = 0;\nvar elementos = document.getElementsByName(\"puesto\"); // Es un array con los checkbox de nombre puesto\nvar span_puestos= document.getElementById(\"span_puestos\");\n\n\tfor(i in elementos) {\n if (elementos[i].checked) cuantos++;\n\t }\n\n\tif (!cuantos) { // Es lo mismo que cuantos==0\n span_puestos.style.color=\"red\";\n span_puestos.innerHTML=\" Debe seleccionar un puesto de trabajo\";\n puestos=false;\n }\n\t \n else {\n span_puestos.innerHTML=\"\";\n\t puestos=true;\n }\n}", "function activarcheckbox(bigdata){\n $.each(bigdata, function(key, item) {\n //if(key==\"productos\"){\n let inicial=key.substring(0, 4);\n console.log(key, item, inicial);\n $('input#'+key).iCheck('check');\n if(!getAccess(item, 1)){\n $('#vie'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 2)){\n $('#adi'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 4)){\n $('#edi'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 8)){\n $('#del'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 16)){\n $('#pri'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 32)){\n $('#act'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 64)){\n $('#sel'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 128)){\n $('#pay'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 256)){\n $('#acc'+inicial).iCheck('uncheck')\n }\n //}\n });\n}", "function selChoco(){\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled) {\r\n sws[i].disabled = false;\r\n }\r\n }\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled == false) {\r\n sav[i].disabled = true;\r\n }\r\n }\r\n}", "function selectCBs() {\n d3.selectAll('.type-checkbox')\n .property('checked', true);\n update();\n d3.select('.kasiosCheckbox')\n .property('checked', true)\n kasios_update();\n}", "function syncronizeCheckboxes(clicked, pri, pub) {\n pri.checked = false;\n pub.checked = false;\n clicked.checked = true;\n }", "function eveChck() {\n $('.chgrup').on('click',function(){\n var cuales = $(this).attr('id'); \n if( $(this).prop('checked')) {\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', 'checked');\n });\n }else{\n $('input[for ='+ cuales +']').each(function(){\n //alert($(this));\n $(this).prop('checked', false);\n });\n } \n });\n $('.cksub').on('click', function(){\n var mod = $(this).attr('for');\n if( $(this).prop('checked')) {\n if(!$('#'+mod).prop('checked')) {\n $('#'+mod).prop('checked', 'checked');\n } \n }else{\n var cuantas = 0;\n $('input[for ='+ mod +']').each(function(){\n if($(this).prop('checked')) {\n cuantas++;\n }\n });\n if (cuantas == 0) {\n $('#'+mod).prop('checked', false);\n }\n }\n \n });\n}", "function changeFacilities() {\n var ignore = document.getElementById('ignore_facilities');\n var wifiCheckbox = document.getElementById('wifi');\n var poolCheckbox = document.getElementById('pool');\n if(ignore.checked) {\n wifiCheckbox.checked = false;\n poolCheckbox.checked = false;\n }\n if(wifiCheckbox.checked || poolCheckbox.checked) {\n ignore.checked = false;\n }\n}", "function verificaReprovacaoDistribuicao(box){\n if(box.checked){\n show_distribuicao = true;\n show_repetencia = false;\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('checked', true);\n showDistribuicaoReprovacao();\n showLegendasRepetencia(false);\n showLegendasDesempenho(false);\n mostrarAgrupamento(false);\n }else{\n mostrarAgrupamento(true);\n show_distribuicao = false;\n show_repetencia();\n\n }\n atualizarCheckBox(); \n}", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n\n cb.element.checked = cb.selected;\n }\n }", "function updateCheckBoxes() {\n const checkboxes = [];\n\n checkboxes.push(document.querySelector('#inspiration'));\n\n checkboxes.push(document.querySelector('#dss1'));\n checkboxes.push(document.querySelector('#dss2'));\n checkboxes.push(document.querySelector('#dss3'));\n\n checkboxes.push(document.querySelector('#dsf1'));\n checkboxes.push(document.querySelector('#dsf2'));\n checkboxes.push(document.querySelector('#dsf3'));\n\n checkboxes.forEach((ele) => {\n if (ele.value === 'true') {\n ele.setAttribute('checked', 'checked');\n } else {\n ele.removeAttribute('checked');\n }\n });\n}", "function displayCheckboxes() {\n $('#checkbox').text('');\n\n for (let i = 0; i < ingredientsArray.length; i++) {\n let pContainer = $(\"<p class=label>\");\n let labelContainer = $(\"<label class=option>\");\n let inputContainer = $(\"<input type=checkbox>\");\n let spanContainer = $('<span>');\n\n pContainer.addClass('col s2')\n inputContainer.addClass('filled-in checked=\"unchecked\"');\n spanContainer.text(ingredientsArray[i]);\n inputContainer.attr('value', ingredientsArray[i]);\n\n $('#checkbox').append(pContainer);\n pContainer.append(labelContainer);\n labelContainer.append(inputContainer);\n labelContainer.append(spanContainer);\n\n }\n}", "function precipitacion() {\n if ($(this).is(\":checked\"))\n {\n if ($(this).val() !== 'todos') {\n capa_actual = $(this).val();\n }\n conmutar_cobertura($(this).val(), true);\n $(\"#div_leyenda\").show();\n } else {\n capa_actual = '';\n conmutar_cobertura($(this).val(), false);\n if (listado_capas.length <= 1) {\n $(\"#div_leyenda\").hide();\n }\n }\n actualizar_coberturas();\n map.data.setStyle(style_bf);\n}", "updateCheckboxes() {\n for (const id of this.compareList.keys()) {\n this._checkCheckbox(id);\n }\n }", "function updateCheckboxes() {\n\t$('input[type=checkbox').each(function() {\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n}", "function reactionCheckbox () {\n vArrows = cb1.checked; // Pfeile für Bewegungsrichtung\n bArrows = cb2.checked; // Pfeile für Magnetfeld\n iArrows = cb3.checked; // Pfeile für Induktionsstrom\n if (!on) paint(); // Falls Animation abgeschaltet, neu zeichnen\n }", "function limparFiltros() {\n listarFiltros().forEach((elemento) => {\n elemento.checked = false;\n });\n}", "function habilitarGrupoPerfil() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n }\n }", "function verificaGrupo(box){\n if(box.checked){\n box_grupo = box_grupo.concat(box.value);\n show_agrupamento = true;\n showLegendasAgrupamento(true);\n showLegendasDesempenho(false);\n }else{\n box_grupo.splice(box_grupo.indexOf(box.value), 1);\n if(box_grupo.length==0){\n show_agrupamento = false;\n showLegendasAgrupamento(false);\n showLegendasDesempenho(true);\n }\n }\n filtrar();\n // atualizarCheckBox();\n}", "function ocultarInvitados(){\n //Seleccionamos los checkbox 'confimado'\n var confirmado = document.getElementsByClassName('confirmar');\n \n //Si el input 'ocultar invitados' está marcado, ocultamos los invitados que no hayan confirmado\n if(ocultar.checked){\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n //Seleccionamos el elemento li\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n\n if(!confirmado[i].checked){\n li.style.display = 'none';\n }else{\n li.style.display = 'block';\n }\n }\n }\n //Si el input 'ocultar invitados' no está marcado, mostramos todos los invitados\n else{\n //Recorremos todos los invitados confirmados\n for(var i = 0; i<confirmado.length; i++){\n\n var label = confirmado[i].parentElement;\n var li = label.parentElement;\n \n li.style.display = 'block';\n }\n }\n}", "async function selectFilter2Checkboxes() {\r\n filter = document.querySelector(\"#filterBy\").value;\r\n let checkboxes = document.querySelectorAll('input[name='+filter+']');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = true;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.remove(\"hidden\");\r\n next.classList.remove(\"add\");\r\n \r\n }\r\n updateKorpusCheckboxes();\r\n}", "function limpiar_campos(){\r\n\r\n\t//NOMBRE\r\n\tdocument.getElementById(\"txt_nombre\").value = \"\";\r\n\t$(\"#div_nombre\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_nombre\").hide();\r\n\t\r\n\t//EMAIL\r\n\tdocument.getElementById(\"txt_email\").value = \"\";\r\n\t$(\"#div_email\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_email\").hide();\r\n\r\n\t//TELEFONO\r\n\tdocument.getElementById(\"txt_telefono\").value = \"\";\r\n\t$(\"#div_telefono\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_telefono\").hide();\r\n\r\n //TIENE HIJOS?\r\n tiene_hijos[0].checked=true;\r\n\r\n //ESTADO CIVIL\r\n document.getElementById(\"cbx_estadocivil\").value=\"SOLTERO\";\r\n\r\n //INTERESES\r\n document.getElementById(\"cbx_libros\").checked =false;\r\n document.getElementById(\"cbx_musica\").checked =false;\r\n document.getElementById(\"cbx_deportes\").checked =false;\r\n document.getElementById(\"cbx_otros\").checked =false;\r\n $(\"#div_intereses\").attr(\"class\",\"form-group\");\r\n $(\"#span_intereses\").hide();;\r\n}", "function unit_chkboxchange(status) {\r\n\tfor (i in trackerunitchk) {\r\n\t\t$(trackerunitchk[i]).checked = status;\r\n\t}\r\n}", "function verificaReprovacao(box){\n if(box.checked){\n show_repetencia = true;\n show_distribuicao = false;\n showLegendasRepetencia(true);\n showLegendasDesempenho(false); \n showLegendasAgrupamento(false);\n mostrarAgrupamento(false);\n $('#ckb_distribuicao').prop('checked', false);\n }else{\n if(show_distribuicao==false){\n showLegendasRepetencia(false);\n if(show_agrupamento==true){\n showLegendasAgrupamento(true);\n showLegendasDesempenho(false); \n showLegendasRepetencia(false);\n }else{\n showLegendasDesempenho(true); \n showLegendasRepetencia(false);\n showLegendasAgrupamento(false);\n }\n mostrarAgrupamento(true); \n }\n show_repetencia = false;\n }\n mostrarBarrasParalelas();\n}", "function checar_todos() {\n\tvar asign = document.getElementsByName('asignadas')\n\tfor (var i = 0; i < asign.length; i++) {\n\t\tasign[i].checked = true\n\t}\n}", "function checkBox() {\n var foobar = $('#foobar'),\n checkbox;\n\n for (var key in FamilyGuy) {\n foobar.append('<input type=\"checkbox\" id=\"' + key + '\"/>' +\n '<label for=\"' + key + '\">' + FamilyGuy[key].last_name + '</label>')\n }\n\n foobar.append('<p><a href=\"#\" id=\"enable\">Enable All</a></div><br /><div><a href=\"#\" id=\"disable\">Disable All</a></p>');\n\n $('#enable').on('click', function () {\n en_dis_able(true);\n });\n\n $('#disable').on('click', function () {\n en_dis_able(false);\n });\n\n function en_dis_able(value) {\n checkbox = $('input[type=\"checkbox\"]');\n for (var i = 0, s = checkbox.length; i < s; i++) {\n checkbox[i].checked = value;\n }\n }\n }", "function habilitarGrupoPerfil2() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function updateCheckboxes(){\n\t$(\"table.benchmarks input\").each(function(i,obj){\n\t\t$(obj).attr('checked',(checked_benchmarks.indexOf(obj.value)!=-1));\n\t});\n}", "function habilitarGrupo1() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\t//Ahorita lo creo CHVE\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\t//Ahorita lo creo CHVE\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\t\t\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function habilitarGrupoLlamadas() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function initCheckboxes(){\n let checkboxes = document.getElementById(\"content1\").getElementsByTagName('input');\n let planetKeys = Object.keys(visualizer_list);\n let planetKeys2 = Object.keys(visualizer_list2);\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys.includes(checkBoxBody)){\n if(visualizer_list[checkBoxBody].hidden === true){\n checkbox.checked = false;\n }\n else {\n checkbox.checked = true;\n }\n //checkbox.checked = true;\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n else{\n checkbox.disabled = true;\n }\n }\n if(comparing){\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys2.includes(checkBoxBody)){\n checkbox.checked = true;\n // if(visualizer_list[checkBoxBody].hidden === true){\n // checkbox.checked = false;\n // }\n // else {\n // checkbox.checked = true;\n // }\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n }\n }\n addPlusToCheckboxes();\n}", "function setupCheckboxes() {\n\t$('input[type=checkbox]').each(function() {\n\t\t$(this).after('<i></i>');\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n\t$('input[type=checkbox]').change(function() {\n\t\t$(this).next().toggleClass('fas').toggleClass('far').toggleClass('fa-check-square').toggleClass('fa-square');\n\t});\n\t$('input[type=checkbox]').focus(function() {\n\t\t$(this).next().css('background-color','hsl(160, 50%, 80%)');\n\t});\n\t$('input[type=checkbox]').focusout(function() {\n\t\t$(this).next().css('background-color','');\n\t});\n\t$('input[type=checkbox]').css('cursor', 'pointer');\n\t$('label input[type=checkbox]').css('cursor', 'pointer');\n\t$('input[type=checkbox]').css('opacity', '0');\n\t$('input[type=checkbox]').css('margin-top', '5px');\n\t$('input[type=checkbox]').css('position', 'absolute');\n\n\t// update display if they change the checkbox value programmatically\n\t// even if they use code like:\n\t// $('#myCheckbox').prop('checked', true);\n\t// instead of\n\t// $('#myCheckbox').change();\n\t$.propHooks.checked = {\n\t\tset: function (el, value) {\n\t\t\tif (el.checked !== value) {\n\t\t\t\tel.checked = value;\n\t\t\t\t$(el).trigger('change');\n\t\t\t}\n\t\t}\n\t};\n}", "function prepareInitialCheckboxes() {\n\tfor (var i = 1; i <= $v(\"totalLines\");) {\n\t\tif (cellValue(i, \"application\") == 'All') {\n\t\t\tvar topRowId = i;\n\t\t\tvar preCompanyId = cellValue(topRowId, \"companyId\");\n\t\t\tvar preFacilityId = cellValue(topRowId, \"facilityId\");\n\t\t\tfor (i++; i <= $v(\"totalLines\"); i++) {\n\t\t\t\tif (preCompanyId == cellValue(i, \"companyId\") && preFacilityId == cellValue(i, \"facilityId\")) { //check if the row is still within scope\n\t\t\t\t\tfor (var j = 0; j <= $v(\"headerCount\"); j++) {\n\t\t\t\t\t\tvar colName = config[5 + 2 * j].columnId;\n\t\t\t\t\t\t//Note: 5 being the no. of columns before the Permission columns (starting from 0)\n\t\t\t\t\t\t// 2 * j is the index of the columns contain check boxes (skipping preceding hidden columns)\n\t\t\t\t\t\tif (cell(topRowId, colName).isChecked()) {\n\t\t\t\t\t\t\tif (cell(i, colName).isChecked())\n\t\t\t\t\t\t\t\tcell(i, colName).setChecked(false);\n\t\t\t\t\t\t\tcell(i, colName).setDisabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tpreCompanyId = cellValue(i, \"companyId\");\n\t\t\t\t\tpreFacilityId = cellValue(i, \"facilityId\");\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else\n\t\t\ti++;\n\t}\n}", "function marcarLinhaComoSelecionada() {\n $scope.detalhesExcluir.forEach(detalheExcluir => {\n\n for (var i = 0; i < $scope.gestaoVendaResultados.length; i++) {\n\n if (detalheExcluir.idDetalhe == $scope.gestaoVendaResultados[i].idDetalhe) {\n $scope.gestaoVendaResultados[i].isChecked = true;\n break;\n }\n\n }\n })\n }", "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tvar checkBox1 = document.getElementById(\"lactoseF\");\n\tvar checkBox2 = document.getElementById(\"nutsF\");\n\tvar checkBox3 = document.getElementById(\"organique\");\n\tvar checkBox4 = document.getElementById(\"none\");\n\n\n\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\t/*if ((document.querySelector(\".organiqueCB\").checked)&&(document.querySelector(\".pasDeNoix\").checked) && (document.querySelector(\".lactoseFreeCB\").checked)&& (prods[i].all == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\n\t\t}*/\n\t\tif (checkBox1.checked==true && checkBox2.checked==true && checkBox3.checked==true && prods[i].all==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if(checkBox3.checked==true &&checkBox2.checked==true && prods[i].vegAndNut==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if (checkBox3.checked==true && checkBox1.checked==true && prods[i].vegAndGlu==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\n\t\telse if (checkBox1.checked==true && checkBox2.checked==true && prods[i].nutAndGlu==true){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if(checkBox1.checked==true && checkBox2.checked==false && checkBox3.checked==false && prods[i].glutenFree==true ){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if(checkBox2.checked==true && checkBox1.checked==false && checkBox3.checked==false && prods[i].no_nuts==true){\n\t\t\tproduct_names.push(prods[i].name);\n\n\t\t}\n\t\telse if (checkBox3.checked==true && checkBox1.checked==false&&checkBox2.checked==false && prods[i].vegetarian==true){\n\t\t\tproduct_names.push(prods[i].name);\n\n\t\t\n\t\t}\n\t\telse if (checkBox4.checked==true){\n\t\t\t\n\t\t\tproduct_names.push(prods[i].name);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t/*if (checkBox1.checked==false && checkBox2.checked==false && checkBox3.checked==false && (prods[i].vegetarian==true || prods[i].glutenFree==true || prods[i].no_nuts==true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\n\t\t/*else if ((document.querySelector(\".organiqueCB\").checked)&& (prods[i].vegetarian == true)){\n\n\t\t\tif ((document.querySelector(\".lactoseFreeCB\").checked) && (prods[i].glutenFree == true)){\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}\n\t\t\telse if ((restriction == \"pasDeNoix\")&& (prods[i].no_nuts == true)){\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}else{\n\t\t\tproduct_names.push(prods[i].name);}\n\t\t}\n\t\telse if ((document.querySelector(\".lactoseFreeCB\").checked) && (prods[i].glutenFree == true)){\n\t\t\tif ((restriction == \"pasDeNoix\")&& (prods[i].no_nuts == true)){\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}else{\n\t\t\t\tproduct_names.push(prods[i].name);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t/*else if ((restriction == \"pasDeNoix\")&& (prods[i].no_nuts == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\t\n\t\telse if ((restriction == \"none\")){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}*/\n\t\t\n\t}\n\treturn product_names;\n}", "function show_allergies_checkbox(){\n $('#delete_allergies').click(function(){\n remove_checkbox_show();\n addNew_form_hide();\n \n rm_click_listener('.allergy > :not(.bs-checkbox input)');\n add_checkbox_listener();\n add_all_checkbox_listener();\n add_removeVisit_btn_listener();\n add_cancel_removeVisit_btn_listener();\n });\n}", "function makeChecks(){\n/* 215 */ \t\t$(\"input[type=checkbox][rel]\").each(function (i,el){\n/* 216 */ \t\t\tel \t\t\t= $(el);\n/* 217 */ \t\t\tvar parent \t= el.parents('.checkbox_group'); //procura por um pai (check dentro de um grupo)\n/* 218 */ \t\t\tvar val \t= el.attr('rel');\n/* 219 */ \t\t\t//Elemento dentro de um grupo\n/* 220 */ \t\t\tif(parent.length > 0) {\n/* 221 */ \t\t\t\tvar values = parent.attr('rel');\n/* 222 */ \t\t\t\tel.attr('checked', (values[val] == 1));\n/* 223 */ \t\t\t}\n/* 224 */ \t\t\t//Elemento Sozinho\n/* 225 */ \t\t\telse{\n/* 226 */ \t\t\t\tel.attr('checked', (el.val() == val));\n/* 227 */ \t\t\t}\n/* 228 */ \t\t});\n/* 229 */ \t}", "function selectCheckboxes(fm, v)\r\n\t{\r\n\t for (var i=0;i<fm.elements.length;i++) {\r\n\t var e = fm.elements[i];\r\n\t\t if (e.name.indexOf('active') < 0 &&\r\n\t\t e.type == 'checkbox')\r\n e.checked = v;\r\n\t }\r\n\t}", "function hobbiesForCheckBoxes(hobbies, cat=null) { \n return hobbies.map(hobby => {\n if (cat && cat.hobby_ids.filter(hobbyId => hobbyId == hobby.id).length > 0) {\n hobby['checked'] = true;\n } else {\n hobby['checked'] = false;\n }\n return hobby;\n });\n}", "function habilitarGrupoLlamadas1() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\t/*Para habilitar en ctas madres*/\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t/* - */\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\t/*Para Deshabilitar en ctas madres*/\r\n\t\tfrm.cuenta.disabled = true;\t\t\r\n\t\t/* - */\t\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function click1_2(){\n var i = document.getElementById('usuario_item').checked;\n\n\tif (i) {console.log(\"avilitado\"+\" \"+i);\n\t\t\t//AQUIE SE LE ASIGNARA LOS PERMISOS AL USUSARIO\n\t document.getElementById('usuario_item').checked = true;\n\t Gestion_Infraestructura[1] = i;\n\t if (Gestion_Infraestructura[0] === true && Gestion_Infraestructura[1] === true && Gestion_Infraestructura[2] === true && Gestion_Infraestructura[3] === true && Gestion_Infraestructura[4] === true)\n\t\t\t document.getElementById('cbx_gest_infr').checked = true;\n\t\t\t}\n\telse {console.log(\"apagado\"+\" \"+i);\n\tdocument.getElementById('cbx_gest_infr').checked = false;\n\tdocument.getElementById('usuario_item').checked = false;\n\tGestion_Infraestructura[1] = i;\n\t\t\t}\n\tconsole.log(Gestion_Infraestructura);\n return i;\n}", "function controlarChk(){\n\n if( $(this).is(':checked') ){\n\t // Hacer algo si el checkbox ha sido seleccionado\n\t\t$(\"#imgP\").attr(\"disabled\",false);\n\t } else {\n\t // Hacer algo si el checkbox ha sido deseleccionado\n\t \t$(\"#imgP\").attr(\"disabled\",true);\n\t }\n\t\n}//end controlarChk", "function habilitarGrupoPerfil4() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.presubcuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.presubcuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function habilitarGrupoLlamadas2() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t/*Para habilitar en ctas madres*/\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\t/* - */\t\t\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\t/*Para habilitar en ctas madres*/\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\t/* - */\t\t\t\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function tgboxes(el){\n\tvar i, boxes = el.querySelectorAll(\"input[type=checkbox]\");\n\tfor(i=0; i<boxes.length; i++) boxes[i].checked = !boxes[i].checked;\n}", "function handle_checkboxes(){\n\t\t$.each($(\".anthrohack_checkbox\"), function(i, _box){\n\t\t\tvar id = \"#\" + $(_box).attr(\"id\") + \"_hidden\";\n\t\t\t$(_box).change(function(){\n\t\t\t\tif($(_box).prop(\"checked\")){\n\t\t\t\t\t$(id).val(\"on\").trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(id).val(\"off\").trigger('change');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "async function selectKorpus() {\r\n let checkboxes = document.querySelectorAll('input[name=korpus]');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = true;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.remove(\"hidden\");\r\n next.classList.remove(\"add\");\r\n console.log(\"added \" + next);\r\n }\r\n await updateKorpusCheckboxes();\r\n await fetchMiniStats();\r\n console.log(\"selected\")\r\n}", "function deschekaPersonalizados(numero) {\n $(\".contentIngredientes\").html(\"\");\n // $(\".contentIngredientes\").hide(\"slow\");\n if (numero == 1) {\n $('.imgPersonalizado2').attr('src', 'img/pizzas/per/per2_' + per2 + '.png');\n $(\".inp_personalizado2\").prop('checked', false);\n $(\".inp_personalizado2\").parent().removeClass(\"active\");\n $('.imgPersonalizado3').attr('src', 'img/pizzas/per/per3_' + per3 + '.png');\n $(\".inp_personalizado3\").prop('checked', false);\n $(\".inp_personalizado3\").parent().removeClass(\"active\");\n $('.imgPersonalizado4').attr('src', 'img/pizzas/per/per4_' + per4 + '.png');\n $(\".inp_personalizado4\").prop('checked', false);\n $(\".inp_personalizado4\").parent().removeClass(\"active\");\n } else\n if (numero == 2) {\n $('.imgPersonalizado1').attr('src', 'img/pizzas/per/per1_' + per1 + '.png');\n $(\".inp_personalizado1\").prop('checked', false);\n $(\".inp_personalizado1\").parent().removeClass(\"active\");\n $('.imgPersonalizado3').attr('src', 'img/pizzas/per/per3_' + per3 + '.png');\n $(\".inp_personalizado3\").prop('checked', false);\n $(\".inp_personalizado3\").parent().removeClass(\"active\");\n $('.imgPersonalizado4').attr('src', 'img/pizzas/per/per4_' + per4 + '.png');\n $(\".inp_personalizado4\").prop('checked', false);\n $(\".inp_personalizado4\").parent().removeClass(\"active\");\n } else\n if (numero == 3) {\n $('.imgPersonalizado2').attr('src', 'img/pizzas/per/per2_' + per2 + '.png');\n $(\".inp_personalizado2\").prop('checked', false);\n $(\".inp_personalizado2\").parent().removeClass(\"active\");\n $('.imgPersonalizado1').attr('src', 'img/pizzas/per/per1_' + per1 + '.png');\n $(\".inp_personalizado1\").prop('checked', false);\n $(\".inp_personalizado1\").parent().removeClass(\"active\");\n $('.imgPersonalizado4').attr('src', 'img/pizzas/per/per4_' + per4 + '.png');\n $(\".inp_personalizado4\").prop('checked', false);\n $(\".inp_personalizado4\").parent().removeClass(\"active\");\n } else\n if (numero == 4) {\n $('.imgPersonalizado2').attr('src', 'img/pizzas/per/per2_' + per2 + '.png');\n $(\".inp_personalizado2\").prop('checked', false);\n $(\".inp_personalizado2\").parent().removeClass(\"active\");\n $('.imgPersonalizado3').attr('src', 'img/pizzas/per/per3_' + per3 + '.png');\n $(\".inp_personalizado3\").prop('checked', false);\n $(\".inp_personalizado3\").parent().removeClass(\"active\");\n $('.imgPersonalizado1').attr('src', 'img/pizzas/per/per1_' + per1 + '.png');\n $(\".inp_personalizado1\").prop('checked', false);\n $(\".inp_personalizado1\").parent().removeClass(\"active\");\n }\n\n}", "function verificarCheckCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n let checkeado = false;\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n checkeado = true;\n }\n }\n if (checkeado == true) {\n disableCarreras();\n enableCursos();\n } else {\n enableCarreras();\n disableCursos();\n }\n\n}", "function marcarCheckBox(){\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento-Tratamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n }\n else {\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = false;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = true;\n }\n else {\n if (document.formFuncionario.cargo.value == \"Dentista-Tratamento\") {\n document.formFuncionario.grupoAcessoDentistaTratamento.checked = true;\n document.formFuncionario.grupoAcessoDentistaOrcamento.checked = false;\n }\n }\n }\n}", "function habilitarGrupoLlamadas4() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.presubcuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.presubcuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function atualizarCheckBox(){\n box_periodo = [];\n box_departamento = [];\n box_grupo = [];\n\n var periodosAluno = getPeriodos();\n var departamentosAluno = getDepartamentos();\n var gruposAluno = getGrupos();\n\n if (periodosAluno.indexOf(\"20111\") == -1 || show_distribuicao == true) {\n $('#p_20111').prop('disabled', true);\n $('#p_20111').prop('checked', false);\n }else {\n $('#p_20111').prop('disabled', false);\n $('#p_20111').prop('checked', true);\n box_periodo = box_periodo.concat([\"20111\"]);\n };\n\n if (periodosAluno.indexOf(\"20112\") == -1 || show_distribuicao == true) {\n $('#p_20112').prop('disabled', true);\n $('#p_20112').prop('checked', false);\n }else {\n $('#p_20112').prop('disabled', false);\n $('#p_20112').prop('checked', true);\n box_periodo = box_periodo.concat([\"20112\"]);\n };\n\n if (periodosAluno.indexOf(\"20121\") == -1 || show_distribuicao == true) {\n $('#p_20121').prop('disabled', true);\n $('#p_20121').prop('checked', false);\n }else {\n $('#p_20121').prop('disabled', false);\n $('#p_20121').prop('checked', true);\n box_periodo = box_periodo.concat([\"20121\"]);\n };\n\n if (periodosAluno.indexOf(\"20122\") == -1 || show_distribuicao == true) {\n $('#p_20122').prop('disabled', true);\n $('#p_20122').prop('checked', false);\n }else {\n $('#p_20122').prop('disabled', false);\n $('#p_20122').prop('checked', true);\n box_periodo = box_periodo.concat([\"20122\"]);\n };\n\n\n if (!show_disciplina) {\n if (departamentosAluno.indexOf(\"dsc\") == -1) {\n $('#d_dsc').prop('disabled', true);\n $('#d_dsc').prop('checked', false);\n }else {\n $('#d_dsc').prop('disabled', false);\n $('#d_dsc').prop('checked', true);\n box_departamento = box_departamento.concat([\"dsc\"]);\n };\n\n if (departamentosAluno.indexOf(\"dme\") == -1) {\n $('#d_dme').prop('disabled', true);\n $('#d_dme').prop('checked', false);\n }else {\n $('#d_dme').prop('disabled', false);\n $('#d_dme').prop('checked', true);\n box_departamento = box_departamento.concat([\"dme\"]);\n };\n\n if (departamentosAluno.indexOf(\"fisica\") == -1) {\n $('#d_fisica').prop('disabled', true);\n $('#d_fisica').prop('checked', false);\n }else {\n $('#d_fisica').prop('disabled', false);\n $('#d_fisica').prop('checked', true);\n box_departamento = box_departamento.concat([\"fisica\"]);\n };\n\n if (departamentosAluno.indexOf(\"humanas\") == -1) {\n $('#d_humanas').prop('disabled', true);\n $('#d_humanas').prop('checked', false);\n }else {\n $('#d_humanas').prop('disabled', false);\n $('#d_humanas').prop('checked', true);\n box_departamento = box_departamento.concat([\"humanas\"]);\n };\n\n if (departamentosAluno.indexOf(\"esportes\") == -1) {\n $('#d_esportes').prop('disabled', true);\n $('#d_esportes').prop('checked', false);\n }else {\n $('#d_esportes').prop('disabled', false);\n $('#d_esportes').prop('checked', true);\n box_departamento = box_departamento.concat([\"esportes\"]);\n };\n if (!show_repetencia) {\n var teste = dados_repetencia.filter(function(d){return d.matricula == id_aluno;}); \n if((dados_repetencia.filter(function(d){return d.matricula == id_aluno;})).length == 0){\n $('#ckb_reprovacao').prop('disabled', true);\n $('#ckb_reprovacao').prop('checked', false);\n \n }else {\n $('#ckb_reprovacao').prop('disabled', false);\n $('#ckb_reprovacao').prop('checked', false);\n };\n\n \n };\n \n }else{\n if (!show_repetencia) {\n var teste2 = dados_repetencia.filter(function(d){return d.disciplina == id_disciplina;});\n\n if((dados_repetencia.filter(function(d){return d.disciplina == id_disciplina;})).length == 0){\n $('#ckb_reprovacao').prop('disabled', true);\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('disabled', true);\n $('#ckb_distribuicao').prop('checked', false);\n }else {\n $('#ckb_reprovacao').prop('disabled', false);\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('disabled', false);\n $('#ckb_distribuicao').prop('checked', false);\n };\n \n if (gruposAluno.indexOf(\"1\") == -1) {\n $('#grupo1').prop('disabled', true);\n $('#grupo1').prop('checked', false);\n }else {\n $('#grupo1').prop('disabled', false);\n $('#grupo1').prop('checked', true);\n box_grupo = box_grupo.concat([\"1\"]);\n };\n\n if (gruposAluno.indexOf(\"2\") == -1) {\n $('#grupo2').prop('disabled', true);\n $('#grupo2').prop('checked', false);\n }else {\n $('#grupo2').prop('disabled', false);\n $('#grupo2').prop('checked', true);\n box_grupo = box_grupo.concat([\"2\"]);\n };\n\n if (gruposAluno.indexOf(\"3\") == -1) {\n $('#grupo3').prop('disabled', true);\n $('#grupo3').prop('checked', false);\n }else {\n $('#grupo3').prop('disabled', false);\n $('#grupo3').prop('checked', true);\n box_grupo = box_grupo.concat([\"3\"]);\n };\n\n if (gruposAluno.indexOf(\"4\") == -1 || show_distribuicao == true) {\n $('#grupo4').prop('disabled', true);\n $('#grupo4').prop('checked', false);\n }else {\n $('#grupo4').prop('disabled', false);\n $('#grupo4').prop('checked', true);\n box_grupo = box_grupo.concat([\"4\"]);\n };\n\n if (gruposAluno.indexOf(\"5\") == -1 || show_distribuicao == true) {\n $('#grupo5').prop('disabled', true);\n $('#grupo5').prop('checked', false);\n }else {\n $('#grupo5').prop('disabled', false);\n $('#grupo5').prop('checked', true);\n box_grupo = box_grupo.concat([\"5\"]);\n };\n\n if (gruposAluno.indexOf(\"6\") == -1 || show_distribuicao == true) {\n $('#grupo6').prop('disabled', true);\n $('#grupo6').prop('checked', false);\n }else {\n $('#grupo6').prop('disabled', false);\n $('#grupo6').prop('checked', true);\n box_grupo = box_grupo.concat([\"6\"]);\n };\n\n if (gruposAluno.indexOf(\"7\") == -1 || show_distribuicao == true) {\n $('#grupo7').prop('disabled', true);\n $('#grupo7').prop('checked', false);\n }else {\n $('#grupo7').prop('disabled', false);\n $('#grupo7').prop('checked', true);\n box_grupo = box_grupo.concat([\"7\"]);\n };\n\n if (gruposAluno.indexOf(\"8\") == -1 || show_distribuicao == true) {\n $('#grupo8').prop('disabled', true);\n $('#grupo8').prop('checked', false);\n }else {\n $('#grupo8').prop('disabled', false);\n $('#grupo8').prop('checked', true);\n box_grupo = box_grupo.concat([\"8\"]);\n };\n\n if (gruposAluno.indexOf(\"0\") == -1 || show_distribuicao == true) {\n $('#grupo9').prop('disabled', true);\n $('#grupo9').prop('checked', false);\n }else {\n $('#grupo9').prop('disabled', false);\n $('#grupo9').prop('checked', true);\n box_grupo = box_grupo.concat([\"0\"]);\n };\n\n }\n\n\n };\n \n}", "function deselectCBs() {\n d3.selectAll('.type-checkbox')\n .property('checked', false)\n update();\n d3.select('.kasiosCheckbox')\n .property('checked', false)\n kasios_update();\n}", "function updateInventario() {\n if ($('#inventario').prop('checked')) {\n $('#cantidad').prop('disabled', false);\n $('#minimo').prop('disabled', false);\n } else {\n $('#cantidad').prop('disabled', true);\n $('#minimo').prop('disabled', true);\n }\n}", "function selCheese(){\r\n let sav = gId('sav').getElementsByTagName('input');\r\n for (let i = 0; i < sav.length; i++) {\r\n if (sav[i].type == 'checkbox' && sav[i].disabled) {\r\n sav[i].disabled = false;\r\n }\r\n }\r\n let sws = gId('sw').getElementsByTagName('input');\r\n for (let i = 0; i < sws.length; i++) {\r\n if (sws[i].type == 'checkbox' && sws[i].disabled== false) {\r\n sws[i].disabled = true;\r\n }\r\n }\r\n}", "function habilitarGrupoPerfil1() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "function controles() {\n checkboxCapa = document.getElementById(\"controles\");\n if (checkboxCapa.checked) {\n var misOpciones = {\n disableDefaultUI: false,\n mapTypeControl: true\n };\n map.setOptions(misOpciones); \n\n }\n else {\n var misOpciones = {\n disableDefaultUI: true,\n mapTypeControl: false\n };\n map.setOptions(misOpciones); \n }\n}", "function deselectKorpus() {\r\n let checkboxes = document.querySelectorAll('input[name=korpus]');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = false;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.add(\"hidden\");\r\n console.log(\"removed \" + next);\r\n }\r\n console.log(\"deselected\")\r\n loadMiniStats(null);\r\n document.querySelector(\"#alamkorpused\").style.display = 'none';\r\n}", "function selezionaTutti() {\n var isChecked = $(this).prop(\"checked\");\n\n tabellaDaConvalidare.find(\"tbody\")\n .find(\"input[type='checkbox']:not([disabled])\")\n .prop(\"checked\", isChecked)\n .each(function(idx, el) {\n selectedDatas[+el.value] = {isSelected: isChecked, row: $(this).closest(\"tr\").clone()};\n });\n modificaTotali();\n }", "function setCheckValues() {\n // setting the values for merchant options\n var options = document.getElementById(\"merchant-options\").getElementsByClassName(\"fancy-checkbox\");\n var inputs = options[0].getElementsByTagName(\"input\");\n var labels = options[0].getElementsByTagName(\"label\");\n\n for (var i = 0; i < labels.length; i++) {\n if (selectedOptions[\"MerchantOptions\"].indexOf(labels[i].innerText) > -1) {\n inputs[i].checked = true;\n }\n else {\n inputs[i].checked = false;\n }\n }\n\n // setting the values for buyer options\n var options = document.getElementById(\"buyer-options\").getElementsByClassName(\"fancy-checkbox\");\n var inputs = options[0].getElementsByTagName(\"input\");\n var labels = options[0].getElementsByTagName(\"label\");\n\n for (var i = 0; i < labels.length; i++) {\n if (selectedOptions[\"BuyerOptions\"].indexOf(labels[i].innerText) > -1) {\n inputs[i].checked = true;\n }\n else {\n inputs[i].checked = false;\n }\n }\n}", "function cbChange(obj) {\nvar instate=(obj.checked);\n var cbs = document.getElementsByClassName(\"cb\");\n for (var i = 0; i < cbs.length; i++) {\n cbs[i].checked = false;\n }\n if(instate)obj.checked = true;\n}", "function asociarPermisoAUsuario(usersSelected){\n\n var form = document.getElementById(\"form_mis_tablones\");\n var e;\n var nombre;\n var text;\n var input;\n\n //alert(document.getElementById(\"paraeliminar\"));\n\n if(document.getElementById(\"paraeliminar\") != null){//si existe\n\n form.removeChild(document.getElementById(\"paraeliminar\"));\n }\n\n/*creo un div dinámicamente, estoy me favorece mucho a la hora de eliminar después todos sus nodos para reescribirlos*/\n e = document.createElement(\"div\");\n e.id = \"paraeliminar\";\n form.appendChild(e);\n \n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n /*crea la cadena: Asociar permiso a usuario:*/\n var p = document.createElement(\"p\"); \n var b = document.createElement(\"b\");\n b.name= \"eliminar\";\n var asociarCadena = document.createTextNode(\"Asociar permiso a usuario:\");\n b.appendChild(asociarCadena);\n e.appendChild(b);\n\n\n for(var i = 0; i<usersSelected.length; i++){\n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n p.name = \"eliminar\";\n e.appendChild(p);\n /**/\n\n\n nombre = document.createTextNode(usersSelected[i].name + \" \" + usersSelected[i].surname1 + \" \" + usersSelected[i].surname2);\n e.appendChild(nombre);\n\n \n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"1\";\n\n\n e.appendChild(document.createTextNode(\"Lectura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"2\";\n\n e.appendChild(document.createTextNode(\"Escritura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"4\";\n\n e.appendChild(document.createTextNode(\"Lectura remota\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"8\";\n\n e.appendChild(document.createTextNode(\"Escritura remota\"));\n e.appendChild(input);\n\n \n //alert(\"undefined? : \" + usersSelected[i].name);\n\n //checkbox.id = \"id\";\n\n\n \n\n e.appendChild(input);\n }\n\n}", "function toggleAll(name) {\n//name est le debut du nom des cases a cocher \n//exp: <input type=\"checkbox\" name=\"cb_act_<?php echo $oAct->get_id(); ?>\" ...>\n// name est egal a 'cb_act_'\n//'user-all' est le nom de la case qui permet de cocher ttes les autres \n\n\tvar inputs\t= document.getElementsByTagName('input');\n\tvar count\t= inputs.length;\n\tfor (i = 0; i < count; i++) {\n\t\n\t\t_input = inputs.item(i);\n\t\tif (_input.type == 'checkbox' && _input.id.indexOf(name) != -1) {\n\t\t\n\t\t\t_input.checked = document.getElementById('user-all').checked;\n\n\t\t\n\t\t}\n\t\t\n\t}\n \n}", "function verificarAcceso(checkboxAnonimo) {\n var alguna = false, todos = false, camposPermiso = $('.permiso-acceso');\n $.each(camposPermiso, function (i, node) {\n if ($(node).is(':checked')) {\n alguna = true;\n }\n });\n if (alguna && checkboxAnonimo.is(':checked')) {\n checkboxAnonimo.prop('checked', false);\n }\n $.each(camposPermiso, function (i, node) {\n var permiso = $(node);\n if (permiso.is(':checked') && permiso.attr('id') === 'Grupo1Acceso') {\n todos = true;\n }\n if (todos) {\n permiso.prop('checked', true);\n }\n });\n }", "function habilitarGrupo() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function change_opponenet_check_boxes(is_checked)\n{\n for (var ii = 0; ii < opponents.length; ii++)\n {\n checkbox = document.getElementById(\"opp_check_box_\" + opponents[ii]);\n checkbox.checked = is_checked;\n }\n redraw_head_to_head(slider.value);\n}", "function editInsuranceAccepted () {\n var vehicleClassIndependentDriver = document.getElementById('taxi_driver_office_profile_vehicle_vehicleClass');\n var checkboxInsuranceAccepted = document.getElementById('taxi_driver_office_profile_insuranceAccepted');\n\n $(vehicleClassIndependentDriver).change( function(){\n var vehicleClassVal = $(this).val();\n\n if ( vehicleClassVal <= 0) {\n $(checkboxInsuranceAccepted).removeAttr('checked');\n // $(checkboxInsuranceAccepted).attr('checked',false);\n // alert('Мало');\n } else {\n // $(checkboxInsuranceAccepted).attr('checked', 'checked');\n $(checkboxInsuranceAccepted).attr('checked', true);\n // alert('Норм');\n }\n return true;\n });\n \n }", "function verificaCheckboxes(checkbox){\n\treturn checkbox == true;\n}", "function pastro()\n{\n\tfor( var i = 1; i <= LENDET.length; i++ )\n\t{\n\t\tvar tmp1 = document.getElementById( \"fusha\" + i );\n\n\t\ttmp1.value = \" \";\n\n\t\ttmp1.style.visibility = \"hidden\";\n\t}\n\n\tvar tmp2 = document.querySelectorAll( \".cb\" );\n\n\tfor( var j = 0; j < tmp2.length; j++ )\n\t\ttmp2[ j ].checked = false;\n\n\n\tvar x = document.querySelectorAll( \"button\" );\n\t\tfor( var mn = 0; mn < x.length; mn++ )\n\t\t\tx[ mn ].disabled = true;\n\n\n\tdocument.getElementById( \"pergjigja\" ).innerHTML = \"\";\n} /// FUND pastro", "function chbox() {\n let v;\n if (document.getElementById(`${i}`).checked == true) {v=false} else {v=true};\n for (let i=15;i<24;i++)\n document.getElementById(`${i}`).checked = v; }", "onCheckWeft(event) {\n for (var item of this.ItemsWeft) {\n item.Select = event.detail.target.checked;\n }\n }", "function manageProbands(count, first){\n\n // get checked probands if its not the first draw of an image - in this case select only proband 1\n if(!first){\n var checkedProbands = [];\n for(var i = 0; i < count; i++){\n if($('input[id=user' + parseInt(i+1) + ']').attr('checked'))\n checkedProbands[i] = true;\n else\n checkedProbands[i] = false;\n }\n }\n\n var div = $('#multipleUserDiv');\n // clear div\n div.empty();\n\n // form div\n div.append('<h4>Blickdaten:</h4><br>');\n\n if(count < 1)\n alert('No gaze data available!');\n else{\n var visualization = $('#visSelect').val();\n \n for(var i=0; i < count; i++){\n \n var i_n = parseInt(i+1);\n \n // add checkboxes for probands\n var id = \"user\" + (parseInt(i)+1);\n div.append('<input type=\"checkbox\" id=\"' + id + '\" onchange=\"visualizationChanged()\"> Proband ' + i_n);\n \n // append fixation color pickers\n if(visualization == \"gazeplot\"){\n \n $('#'+id).css('float', 'left').css('overflow', 'hidden');\n \n var fp = 'fixColorpicker'+i_n;\n var fc = 'fixationColor'+i_n;\n \n div.append('<div id=\"' + fc + '\" style=\"background:' + color[i] + '; width:25px; height:25px; float:right; margin-right: 20px; z-index:5; border:2px solid #000000;\" onclick=\"showColorpicker(' + fp + ')\">');\n div.append('<div id=\"' + fp + '\"/><br><br>');\n \n fp = '#fixColorpicker'+i_n;\n fc = '#fixationColor'+i_n;\n \n // register color picker for fixation circles\n registerColorpicker($(fp), $(fc), color[i]);\n }\t\n // no seperate colorpickers needed\n else if(visualization == \"heatmap\" || visualization == \"attentionmap\"){\n div.append('<br>');\n }\n } \n }\n \n // preselect probands\n if(first)\n $('input[id=user1]').attr('checked', true);\n else{\n for(var i=0; i < count; i++){\n if(checkedProbands[i] && checkedProbands[i] != \"2\"){\n $('input[id=user' + parseInt(i+1) + ']').attr('checked', true);\n } \n }\n }\n \n div.show();\n}", "function setFormTraits(traits) {\n \"use strict\";\n var trait_checkboxes = document.querySelectorAll(\"input[name='traits']\");\n for (var i = 0; i < trait_checkboxes.length; i++) {\n if (traits.indexOf(trait_checkboxes[i].value) !== -1) {\n trait_checkboxes[i].checked = true;\n } else {\n trait_checkboxes[i].checked = false;\n }\n }\n}", "function setCertainCheckboxes(){\r\n $(\"#testlist INPUT[type='checkbox']\").prop('checked',false);\r\n $.each(selectedTestList,function(key,val) {\r\n $('#testlist input:checkbox[value='+val+']').prop('checked',true);\r\n });\r\n}", "function toggleAjouterBtn()\n {\n //s'il y a un itinéraire prédéfini de choisi ou au moins une paire de choisie pour un itineraire sur mesure \n if (itinStandardChkBox.checked || (itinSurMesureChkBox.checked && polylineForSelectSelectedArray.length > 0))\n {\n btnAjouterItin.disabled = false; \n }\n else\n {\n btnAjouterItin.disabled = true; \n }\n }", "function habilitarGrupo4() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\tfrm.presubcuenta.disabled = false;\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\tfrm.presubcuenta.disabled = true;\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function estaSeleccionado(obj) { \n check = false;\n if(isNaN(obj.length)) {\n check = obj.checked;\n }\n else {\n longitud = obj.length; \t\t\n for(i = 0; i < longitud; i++) {\n if(obj[i].checked == true) {\n check = true;\n break;\n }\n }\n }\n return check;\n}", "function comprobarSeleccionMultipleNuevaCita(id){\n\t\n\t//multipleCreando\n \t\t\n \t\t\n \tif( !$('#'+id).find('input').prop('checked') ) {\t \n\t\t\t\tid = id.slice(15);\n\t\t\t\tvar valorSelect = $(\"#otrosUsuarios\").val();\n\t\t\t\n\t\t\t\tvalorSelect = jQuery.grep(valorSelect, function(value) {\n\t\t\t\t return value != id;\n\t\t\t\t});\n\t\t\n\t\t\t\t$(\"#otrosUsuarios\").val(valorSelect);\n\t\n\t\t} \t\t\n \t\t\n\t\n\n\t\n\t\n}", "function deselectFilter2Checkboxes() {\r\n let checkboxes = document.querySelectorAll('input[name='+filter+']');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = false;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.add(\"hidden\");\r\n \r\n }\r\n document.querySelector(\"#alamkorpused\").style.display = 'none';\r\n}", "function estaSeleccionado(obj) { \r\n check = false;\r\n if(isNaN(obj.length)) {\r\n check = obj.checked;\r\n }\r\n else {\r\n longitud = obj.length; \t\t\r\n for(i = 0; i < longitud; i++) {\r\n if(obj[i].checked == true) {\r\n check = true;\r\n break;\r\n }\r\n }\r\n }\r\n return check;\r\n}", "function js_checkboxen_alle(name)\n\t\t{\n\t\tfor (var x = 0; x < document.forms[0].elements.length; x++)\n\t\t\t{\n\t\t\tvar obj = document.forms[0].elements[x];\n\t\t\t\n\t\t\tif (obj.name != name)\n\t\t\t\tobj.checked = document.form.elements[name].checked;\n\t\t\t}\n\t\t}", "function agregarEstrellas (puntuacion){\r\n if (puntuacion[0].checked) {\r\n return 5; \r\n }else if (puntuacion[1].checked) {\r\n return 4;\r\n }else if (puntuacion[2].checked) {\r\n return 3;\r\n }else if (puntuacion[3].checked) {\r\n return 2;\r\n }else if (puntuacion[4].checked) {\r\n return 1; \r\n }\r\n\r\n}", "function AcertaAoVoltar() {\r\n $(\":checkbox\").each(function (i) { // obtém a função wrapper que envolve a funcao MarcaCompra definido para\r\n // o evento onclick (se a MarcarCompra existir significa que o checkbox é da prateleira \r\n var fncMarca = $(this).attr(\"onclick\"); // forca o resultado ser convertido para string para ver se a funcao MarcaCompra esta sendo invocada no\r\n // onclick do checked.\r\n if ((\"\" + fncMarca).search(\"MarcarCompra\") > 0) {\r\n $(this).attr(\"checked\", \"\");\r\n }\r\n });\r\n}", "function chkTodos()\r\n{\r\n $(\":checkbox\").not(\"#chkTodos\").each(function(){\r\n if(this.checked)\r\n this.checked = false;\r\n else\r\n this.checked = true;\r\n });\r\n}", "function limitarChecksEncuesta() {\n $(\"input[name='encuesta-checkbox']\").change(function () {\n var limit = 1;\n var cantidadCkb = $(\"input[name='encuesta-checkbox']:checked\").length;\n if (cantidadCkb > limit) \n {\n $(this).prop(\"checked\", \"\");\n alert(\"Solo puede seleccionar: \"+ limit+\" encuesta\");\n }\n });\n}", "function applyCheckbox(box)\n{\n\tif (box.checked)\n\t{\n\t\tuncheckedCount--\n\t\tupdateUnchecked()\n\t}\n\telse\n\t{\t\n\t\tuncheckedCount++\n\t\tupdateUnchecked()\n\t}\n}", "function fnc_child_nuevo()\n{\n\tfnc_checkbox_set_value(fc_frm_cb, 'cest', true);\n\t\n\t// Impuestos\n\tfnc_checkbox_set_value(fc_frm_cb, 'bexonerado', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bigv', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bisc', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'bper', false);\n\n\tfnc_checkbox_set_value(fc_frm_cb, 'bserie', false);\n\tfnc_checkbox_set_value(fc_frm_cb, 'blote', false);\n\t\n\tfnc_row_um_nuevo();\n}", "function chekeBoxes(formName, elementName, isChake) {\n\tformEl = document[formName];\n\tlanght = formEl[elementName].length;\n\n\tif (langht > 0) {\n\t\tfor ( var i = 0; i < langht; i++) {\n\t\t\tvar e = formEl[elementName][i];\n\t\t\tif (!e.disabled) {\n\t\t\t\te.checked = isChake;\n\t\t\t}\n\t\t}\n\t} else if (formEl[elementName]) {\n\t\tvar e = formEl[elementName];\n\t\tif (!e.disabled) {\n\t\t\te.checked = isChake;\n\t\t}\n\t}\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 mostrarTecnicosInactivos() {\n const mostrar = document.getElementById('check-tecnicos').checked;\n const elems = $(\"[data-activo=false]\");\n if (mostrar) {\n elems.css('display', '');\n } else {\n elems.css('display', 'none');\n }\n}", "function opcion (){\nif (document.getElementById(\"male\").checked = true) {\n document.getElementById(\"female\").checked = false;\n}\nelse {\n document.getElementById(\"male\").checked = false;\n}}", "function checkBoxToggle(chkBox)\n{\n\t//kony.print(JSON.stringify(chkBox));\n\t//frmProfile.chkBoxPushSubs[\"selectedKeys\"]=subs;\n\tswitch(chkBox[\"id\"])\n\t{\n\t\tcase \"chkBoxPushSubs\":\n\t\t\tif(audiencePushSubs)\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxSmsSubs\":\n\t\t\tif(audienceSmsSubs)\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxEmailSubs\":\n\t\t\tif(audienceEmailSubs)\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[];\n\t}\n}", "function anular_seleccion_cliente() {\n\tvar clientes = document.getElementsByName(\"checkito\");\n\tfor (var i = 1; i <= clientes.length; i++) {\n\t\tnombre_cli = \"cli\" + i;\n\t\tdocument.getElementById(nombre_cli).checked = false;\n\t}\n\tmostrar_ayuda(false);\n}", "function enableCarreras() {\n let checkboxes = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]');\n\n for (let i = 0; i < checkboxes.length; i++) {\n if (!(checkboxes[i].checked)) {\n checkboxes[i].disabled = false;\n }\n }\n}", "function enabledOrganismo(form) {\r\n\tif (form.chkorganismo.checked) form.forganismo.disabled=false; \r\n\telse { form.forganismo.disabled=true; form.fdependencia.disabled=true; form.chkdependencia.checked=false; form.forganismo.value=\"\"; form.fdependencia.value=\"\"; }\r\n}", "function setCheckboxValues() {\n includeLowercase = lowerCaseCheckbox.checked;\n includeUppercase = uppercaseCheckbox.checked;\n includeNumeric = numericCheckbox.checked;\n includeSpecial = specialCheckbox.checked;\n}", "function habilitarGrupo2() {\r\n\tvar frm = document.forms[0];\r\n\tif(frm.grupo.checked){\r\n\t\tfrm.cuenta.disabled = false;\r\n\t\t/*Al alterar consulta consumo */\r\n\t\tfrm.subcuenta.disabled = false;\r\n\t\t\r\n\t\tfrm.numeros.disabled = false;\r\n\t\tfrm.numero.disabled = true;\r\n\t\t/*Para limpiarlo*/\r\n\t\t//frm.numero.value = \"\";\r\n\t\t//alert('Limpio');\r\n\t\t\r\n\t\tfrm.localidad.disabled = true;\r\n\t}else{\r\n\t\tfrm.cuenta.disabled = true;\r\n\t\t/*Al alterar consulta consumo */\r\n\t\tfrm.subcuenta.disabled = true;\r\n\t\tfrm.numeros.disabled = true;\r\n\t\tfrm.numero.disabled = false;\r\n\t\tfrm.localidad.disabled = false;\r\n\t}\r\n}", "function addCheckboxListeners() {\n document.querySelectorAll('div[class^=\"gymContent\"] input[type=\"checkbox\"]').forEach(checkbox => {\n checkbox.addEventListener('change', () => {\n let trainBox = document.querySelector(`li[class^=\"${checkbox.name}\"] div[class^=\"inputWrapper\"]`).parentElement;\n if (checkbox.checked) {\n trainBox.style['pointer-events'] = 'none';\n trainBox.style.opacity = '0.5';\n }\n else {\n trainBox.style['pointer-events'] = 'auto';\n trainBox.style.opacity = '1';\n }\n\n updateStoredSettings();\n });\n });\n}" ]
[ "0.7017461", "0.6600853", "0.6576097", "0.6511295", "0.642198", "0.6406354", "0.6393531", "0.6386989", "0.6346587", "0.6267492", "0.6262079", "0.6259343", "0.62470096", "0.6213213", "0.61997056", "0.61962587", "0.61944395", "0.61899686", "0.6172514", "0.6171546", "0.6168736", "0.6150336", "0.6139226", "0.6138109", "0.61270463", "0.6124626", "0.6106938", "0.60996777", "0.6096802", "0.60955465", "0.6090272", "0.608898", "0.60883945", "0.6088151", "0.60875344", "0.6085104", "0.60818225", "0.6072036", "0.60651124", "0.6058265", "0.60578126", "0.60543174", "0.60475945", "0.6044029", "0.6031159", "0.6023688", "0.6022411", "0.60216206", "0.6012898", "0.6009991", "0.59873825", "0.5982109", "0.5968414", "0.5959758", "0.5958505", "0.5951775", "0.59489703", "0.59461415", "0.5942843", "0.59315675", "0.5924213", "0.59224313", "0.5921265", "0.59171927", "0.5915437", "0.5914506", "0.591144", "0.5906736", "0.5902587", "0.58988786", "0.58983994", "0.5891731", "0.5886917", "0.5886812", "0.5875545", "0.58751065", "0.58667016", "0.5864605", "0.58567756", "0.58539927", "0.58529335", "0.5846534", "0.584393", "0.5842974", "0.583779", "0.583532", "0.58320284", "0.58310133", "0.5830206", "0.5829114", "0.5822549", "0.58194983", "0.58062756", "0.5801768", "0.5793204", "0.57881737", "0.5780737", "0.5776756", "0.57764935", "0.57722646", "0.5767328" ]
0.0
-1
Devuelve codigo de curso actii seleccionado
function guardarCarreraAsociar() { let listaCheckboxCarreras = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]:checked'); let carreraSeleccionada = []; let codigoCarrera; for (let i = 0; i < listaCheckboxCarreras.length; i++) { codigoCarrera = listaCheckboxCarreras[i].dataset.codigo; carreraSeleccionada.push(codigoCarrera); } return carreraSeleccionada; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leerCurso(curso) {\n const infoCurso = {\n imagen: curso.querySelector(\"img\").src,\n titulo: curso.querySelector(\"h4\").textContent,\n precio: curso.querySelector(\".precio span\").textContent,\n id: curso.querySelector(\"a\").getAttribute(\"data-id\"),\n };\n //Muestra el curso seleccionado en el carrito\n insertarCarrito(infoCurso);\n}", "function selItem(c){\n CargarVentana('buscador4','Nuevo Usuario del Sistema','../../ccontrol/control/control.php?p1=MostrarPersona&idformula=&estado=nuevo&c='+c,'500','300',false,true,'',1,'',10,10,10,10);\n}", "function asignarCurso() {\n const cursoId = document.getElementById(\"cursos\").value;\n document.getElementById(\"cursoId\").value = cursoId;\n}", "getMisCurso(curso, id) {\n document.getElementById(\"Curso\").value = curso[0];\n document.getElementById(\"Estudiante\").value = curso[1];\n document.getElementById(\"Profesor\").value = curso[2];\n document.getElementById(\"Grado\").value = curso[3];\n document.getElementById(\"Pago\").value = curso[4];\n document.getElementById(\"Fecha\").value = curso[5];\n inscripcionID = id;\n }", "function agregarCurso(e) {\r\n\r\n // Ponemos una excepcion para que al momento de hacer clic sobre el div solo se seleccione una clase\r\n e.preventDefault();\r\n\r\n if (e.target.classList.contains('boton')) {\r\n\r\n const cursoSeleccionado = e.target.parentNode;\r\n\r\n console.log(cursoSeleccionado)\r\n listarCursos(cursoSeleccionado);\r\n }\r\n\r\n}", "function leerDatosCurso(curso){\n const infoCurso={\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id')\n }\n\n insertarCarrito(infoCurso);\n \n}", "function leerDatosCurso(curso) {\n const infoCurso = {\n imagen: curso.querySelector(\"img\").src,\n titulo: curso.querySelector(\"h4\").textContent,\n precio: curso.querySelector(\".precio span\").textContent,\n id: curso.querySelector(\"a\").getAttribute(\"data-id\")\n };\n\n insertarCarrito(infoCurso);\n}", "function leerDatosCurso(curso){\n const infoCurso = {\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id')\n }\n\n insertarCarrito(infoCurso);\n}", "function seleccion(){\n\t\tvar seleccion = document.getElementById(\"cliente\");\n\t\tvar idCliente = seleccion.options[seleccion.selectedIndex].value;\n\t\tdocument.getElementById(\"idCliente\").value = idCliente;\n\t}", "function LeerDatosCurso(curso){\n const infoCurso = {\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id')\n }\n insertarCarrito(infoCurso);\n\n}", "function leerDatosCurso(curso){\n const infoCurso = {\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id')\n\n }\n\n insertarCarrito(infoCurso);\n\n}", "selectComic(value) {\n this.setState({ selectedComic: value });\n }", "function comprarCurso(e){\n e.preventDefault();\n //delegation para agregar carrito\n\n if(e.target.classList.contains('agregar-carrito')){\n const curso = e.target.parentElement.parentElement;\n //acá lo que hizo es seleccionar una parte del interior de la card del curso\n //se tiene que seleccionar toda la cart, por esto, hizo el segundo parent element,\n //para llegar al padre anterior, ahi ya selecciono toda la card\n\n leerDatosCursos(curso);\n //esta funcion va recibir la info de curso y va a leerla.\n } //se envian los cursos seleccionados pa tomar datos\n\n \n}", "function leerDatosCurso(curso) {\n const infoCurso = {\n image: curso.querySelector(\"img\").src,\n titulo: curso.querySelector(\"h4\").textContent,\n precio: curso.querySelector(\".precio span\").textContent,\n id: curso.querySelector(\"a\").getAttribute(\"data\"),\n };\n\n insertarCarrito(infoCurso);\n}", "function get_selection()\n {\n return selection;\n }", "function getSelection(){\n return selection;\n }", "select(e, value) {\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tcons:(this.second.current.state.selected.row[0] || ''), \n\t\t\t\tvowl: value\n\t\t\t}, this.props.onClick\n\t\t); \n\t}", "function selectCliente()\n{\n var mi_obj = {\n campos : \"idCliente, nombre\",\n order : \"nombre\",\n table : \"cliente\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='cliente']\")\n}", "function seleccionarCurso(codigoAsig){\n var agregarCurso =true;\n \n \n for(var i=0;i<codigoAsignatura.length;i++){\n if (codigoAsignatura[i]==codigoAsig) {\n var cicloAgregado=false;\n for (var j=0;j<=ciclosSeleccionados.length;j++){\n //alert(\"ciclo>\"+ciclosSeleccionados[j]);\n //alert(\"ciclo2>\"+$('#listaCiclos').val());\n if(ciclosSeleccionados[j]==$('#listaCiclos').val()){\n ciclosSeleccionados_creditos[j]=parseInt(ciclosSeleccionados_creditos[j])+parseInt($('#creditosAsig_'+codigoAsig).text());//Si se selecciona un curso de un nivel ya seleccionado, se aumenta los créditos correspondientes\n cicloAgregado=true;\n break;\n }\n }\n if (cicloAgregado==false) {\n //alert(\"Newciclo>\"+ciclosSeleccionados[j]);\n //alert(\"Newciclo2>\"+$('#listaCiclos').val());\n if (ciclosSeleccionados.length<100) {/*=========== AL NO SER MENOR QUE TRES PERMITE A LOS CONVALIDADOS MATRICULARSE EN MAS DE 3 ASIGNATURAS*/\n ciclosSeleccionados.push($('#listaCiclos').val());\n ciclosSeleccionados_creditos.push($('#creditosAsig_'+codigoAsig).text());//Si se selecciona un curso de un nivel aún no seleccionado, se agrega el nuevo nivel con los créditos correspondientes\n }\n else{\n alerta(\"¡Un momento! No es posible asignar asignaturas de más de 3 niveles. Esta asignatura no se agregará.\");\n agregarCurso=false;\n }\n }\n if (agregarCurso) {\n\n \n \n \n var params={};\n params['carEst']=car;\n params['espEst']=esp;\n params['asigCod']=codigoAsignatura[i];\n params['asigNiv']=ciclo_dosCifras(nivelAsignatura[i]);\n turnoManana[i]=false;\n turnoTarde[i]=false;\n turnoNoche[i]=false;\n \n $.ajax({\n data: params,\n type: \"GET\",\n url: \"consultarTurnos\",\n dataType: \"json\",\n context:$(this),\n async:false,\n success: function(data){\n\n \n var n_turnos = 0\n for(var j=0;typeof(data[j])!= \"undefined\";j++){\n if (data[j]=='MANANA') {turnoManana[i]=true; n_turnos++}\n else if (data[j]=='TARDE') {turnoTarde[i]=true; n_turnos++}\n else if (data[j]=='NOCHE') {turnoNoche[i]=true; n_turnos++}\n }\n //alert(\"JARM\"+n_turnos);\n if (n_turnos>0) {\n selecAsignatura[i]=true;\n matriculableAsignatura[i]=false;\n imprimirCursosSelectos();\n listarAsignaturasPorNivel();\n \n }\n else{\n aviso_adv(\"La Asignatura \"+nombreAsignatura[i]+\" no tiene turnos disponibles.\");\n }\n },\n error: function(){\n location.reload();\n //alert(\"Error sistema JSON, vuelva a intentarlo\");\n },\n complete:function(){\n \n \n \n \n }\n \n });\n \n \n }\n }\n }\n \n \n \n }", "function selectCliente()\n{\n var mi_obj = {\n campos : \"idCliente, nombre\",\n order : \"nombre\",\n table : \"cliente\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='cliente']\", \"option\" );\n}", "function pickColor() {\n color = this.id;\n doc.querySelector('.selected').classList.remove('selected');\n this.classList.add('selected');\n }", "function agregarCurso(e) {\n e.preventDefault();\n\n //2° Nos aseguramos que el usuario haya hecho click en agregar carrito\n if (e.target.classList.contains(\"agregar-carrito\")) {\n // 3° Y accedemos a todo el div que tiene el contenedor del curso\n //Situarse en el padre del elemento e.target.parentElement.parentElement)\n const cursoSeleccionado = e.target.parentElement.parentElement;\n\n leerDatosCurso(cursoSeleccionado);\n }\n}", "function caricaElencoScritture() {\n var selectCausaleEP = $(\"#uidCausaleEP\");\n caricaElencoScrittureFromAction(\"_ottieniListaConti\", {\"causaleEP.uid\": selectCausaleEP.val()});\n }", "function leer_datos_curso(curso){\n\n const info_curso = {\n imagen: curso.querySelector(\"img\").src,\n titulo: curso.querySelector(\"h4\").textContent,\n precio: curso.querySelector(\".precio span\").textContent, \n // El getAttribute no sale directamente\n id : curso.querySelector(\"a\").getAttribute(\"data-id\")\n }\n insertar_carrito(info_curso);\n}", "function contrato_selecionado_clicked(idContrato,id_campo){\n var idContrato = idContrato;\n var id_contrato = $(\"#no_contrato_infocarga_\"+idContrato).text();\n $(\"#contrato_asignado_\"+id_campo).val(id_contrato);\n $(\"#contrato_verificado_\"+id_campo).val(id_contrato);\n}", "function leeDatosCurso(curso) {\n // console.log(curso);\n\n // Crear un objeto con el contenido del curso actual\n const infoCurso = {\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id'),\n cantidad: 1\n }\n\n // agrega elementos al arreglo de carrito\n articulosCarrito = [...articulosCarrito, infoCurso];\n\n console.log(articulosCarrito);\n}", "function SeleccionarConcepto(elementoConcepto) {\n\tblankAllConceptos(); //seteo los demas conceptos\n\tnroConcepto = elementoConcepto.getAttribute('nroConcepto'); //me quedo con el ID del concepto\n\telementoConcepto.setAttribute('class', 'collection-item teal lighten-2 white-text text-darken-2'); //lo dejo seleccionado\n}", "function elimimarCurso(e){\n e.preventDefault();\n let curso,\n cursoId;\n \n if (e.target.classList.contains('borrar-curso') ){\n e.target.parentElement.parentElement.remove();\n curso = e.target.parentElement.parentElement;\n cursoId = curso.querySelector('a').getAttribute('data-id');\n\n \n }\n eliminarCursoLS(cursoId);\n}", "function isSelectedCripto(id) {\n return selectedCripto === id;\n }", "function isSelectedCripto(id) {\n return selectedCripto === id;\n }", "function selectProveedor()\n{\n var mi_obj = {\n campos : \"idProveedor, nombre\",\n table : \"proveedor\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='proveedor']\" );\n}", "function comboCita()\n{\n\tpeticionJSON=JSON.stringify(\n\t{\n\t\t\"Id\":generarID(),\n\t\t\"method\":\"comboCita\",\n\t\t\"clase\":CLASE_EXPEDIENTES,\n\t\t\"Params\":['2']\n\t});\n\t$.post(GATEWAY_EXPEDIENTES, peticionJSON, exitoLlamarComboCita);\n}", "function leerDatosCursos(curso){\n\nconst infoCurso = {\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id'),\n\n}\n\ninsertarCarrito(infoCurso);\n \n}", "function selectProveedor()\n{\n var mi_obj = {\n campos : \"idProveedor, nombre\",\n table : \"proveedor\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='proveedor']\", \"option\" );\n}", "function getSelectedComp() {\r \r comps = [];\r \r if ( app.project.activeItem !== null ) {\r \r alert( \"ActiveItme \");\r comps.push( app.project.activeItem );\r \r } else {\r var items = app.project.selection;\r for ( var i = 0; i < items.length; i++ ) {\r if ( items[i] instanceof CompItem )\r comps.push( items[i] );\r }\r }\r\r return ( comps.length ) != 0 ? comps : null;\r}", "function selectBoardFromPinModal(board_id, imgCount, collaboratorNum) {\n var parentUl = $('#panel-board-list').children('ul');\n var boardItems = parentUl.children('li');\n var boardItem = boardItems.get(0);\n\n // Set user to select..\n for(var i = 0; i < boardItems.length; i++) {\n boardItem = boardItems.get(i);\n if(boardItem.id == board_id) {\n boardItem.setAttribute(\"style\", \"background-color: #e8e8e8;\");\n }\n else {\n boardItem.setAttribute(\"style\", \"\");\n }\n }\n\n var suffix = \"\";\n if(imgCount > 1) suffix = \"s\";\n $('#panel-board-info').children('div:first').text(imgCount + \" Image\" + suffix);\n\n if(collaboratorNum > 1){\n suffix = \"s\";\n }\n else {\n suffix = \"\";\n }\n $('#panel-board-info').children('div:last').text(collaboratorNum + \" Collaborator\" + suffix);\n selectedBoardFromPinModal = board_id;\n}", "function CaricamentoIscrizioni() {\r\n\t\t\t// posiziono il cursore sul campo di ricerca Cognome\r\n\t\t\tsetTimeout(\"document.getElementById(\\\"txtCognome\\\").focus();\", 1);\t\t\t\t// la setTimeout serve a farlo funzionare con FF\r\n\t\t\t// carico la drop down dei luoli se è vuota\r\n\t\t\tvar RuoloIscritto = document.getElementById(\"RuoloIscritto\");\r\n\t\t\tif (RuoloIscritto.length == 0) {\r\n\t\t\t\t$.post(\"rpc_ruolo.php\", {queryString: \"\"}, function(data){\r\n\t\t\t\t\tif (data.length > 0) {\r\n\t\t\t\t\t\t$('#RuoloIscritto').html(data);\r\n\t\t\t\t\t\tRuoloIscritto.selectedIndex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t// imposto la dropdown degli eventi\r\n\t\t\tddlEventi = document.getElementById(\"Evento\");\r\n\t\t\tddlEventi.style.backgroundColor=ddlEventi.options[ddlEventi.selectedIndex].style.backgroundColor;\r\n\t\t\treturn;\r\n \t\t}", "function leerDatosCurso(curso) {\n\tconst infoCurso = {\n\t\tid: curso.querySelector('a').getAttribute('data-id'),\n\t\ttitulo: curso.querySelector('h4').textContent,\n\t\tprecio: curso.querySelector('.precio span').textContent,\n\t\timagen: curso.querySelector('img').src,\n\t\tcantidad: 1,\n\t};\n\t// agrega elementos al arreglo de carrito\n\tarticulosCarrito = [...articulosCarrito, infoCurso];\n\tconsole.log(articulosCarrito);\n\n\tcarritoHTML();\n}", "selectTheatre(){\n browser.click('#cmbComplejos')\n browser.click('#cmbComplejos > option:nth-child(2)');\n }", "function leerDatosCurso(cursoAgregado){\n\t// Obtener datos relevantes del curso agregado\n\tconst infoCurso = {\n\t\timagen: cursoAgregado.querySelector('img').src,\n\t\ttitulo: cursoAgregado.querySelector('h4').textContent,\n\t\tprecio: cursoAgregado.querySelector('.precio span').textContent,\n\t\tid: cursoAgregado.querySelector('a').getAttribute('data-id')\n\t}\n\n\t// console.log(cursoAgregado);\n\n\t// Información obtenida del curso, lista para usarse\n\t// console.log(infoCurso);\n\n\t// Pasar la información a un formato de HTML\n\tinsertarCarrito(infoCurso);\n}", "function selectConciergeFromList(){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n user.setAttribute(\"style\", \"\");\n }\n users.get(0).setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = 0;\n\n disableActionButton();\n var oneUser = {\n id : \"CONCIERGE\",\n contact_id: \"Concierge_\" + userSelf.email,\n username : \"Concierge\",\n email : \"CONCIERGE EMAIL\",\n img : \"/images/concierge.png\"\n };\n\n selectFlag = \"CON\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n\n curConvId = \"Concierge_\" + userSelf.email;\n // Load conversation content of this user..\n var msgObj = {\n from: userSelf.email,\n contact_id: \"Concierge_\" + userSelf.email\n };\n socket.emit('loadConv', msgObj);\n}", "function pintaOptionsCombo(listaColectivos, idcolectivo) {\n\n var s = \"\";\n //Si el colectivo viene null, le pintamos opción en blanco. Si ya tiene valor, no pintamos opción en blanco\n if (idcolectivo == null) \n s += \"<option value=''></option>\";\n for (var i = 0; i < listaColectivos.length; i++) { \n s += \"<option value=\" + listaColectivos[i].t941_idcolectivo;\n if (listaColectivos[i].t941_idcolectivo == idcolectivo)\n {\n s += \" selected= selected\";\n }\n\n s += \">\" + listaColectivos[i].t941_denominacion + \"</option>\"; \n }\n return s;\n}", "renderSelectedItem() {\n\t\treturn (\n\t\t\t<div>\n YOUR SELECTION ID IS { this.props.selectionId }\n\t\t\t</div>\n\t\t);\n\t}", "function al_seleccionar_canal(){\n\t\t$(form_publicidad.canal).on('change',function(e){\n\n\t\t\t//limpiarSelect(1);\n\t\t\tcargarSelectContenido(1);\n\n\t\t});\n\t}", "function select_cambio(){\n\n \tvar select = document.getElementById('pais').value;\n\n \tvar seleccion_departamento = document.getElementById('seleccion_departamento');\n \tvar escribir_departamento = document.getElementById('escribir_departamento');\n \tvar contenedor = document.getElementById('escribir_departamento');\n \tif(select == \"Colombia\"){\n \t\tseleccion_departamento.className = 'select-visible';\n \t\tseleccion_departamento.name = 'departamento';\n \t\tescribir_departamento.className = 'select-invisible';\n \t\tescribir_departamento.name = 'nada';\n \t}\n \telse{\n \t\tseleccion_departamento.className = 'select-invisible';\n \t\tseleccion_departamento.name = 'nada';\n\n \t\tescribir_departamento.className = 'select-visible';\n \t\tescribir_departamento.name = 'departamento';\n\n \t}\n }", "function comprarCursos(e){\n e.preventDefault();\n\n//OBTENER ID DEL BOTÓN PRESIONADO\nconst idCurso = e.target.id;\n\n//OBTENER OBJETO DEL CURSO CORRESPONDIENTE AL ID\nconst seleccionado = carrito.find(p => p.id == idCurso);\n\n//SI NO SE ENCONTRO EL ID BUSCAR CORRESPONDIENTE AL ID\nif (seleccionado == undefined){\n \n carrito.push(cursosDisponibles.find(p => p.id == idCurso));\n} else{\n //SI SE ENCONTRÓ AGREGAR CANTIDAD\n seleccionado.agregarCantidad(1);\n}\n\n// carrito.push(seleccionado);\n\n// //FUNCION QUE SE EJECUTA CUANDO SE CARGA EL DOM\n// $(document).ready (function(){\n// if(\"carrito\" in localStorage){\n// const arrayLiterales = JSON.parse(localStorage.getItem(\"carrito\"));\n// for(const literal of arrayLiterales){\n\n// carrito.push(new cursos(literal.id, literal.nombreCurso, literal.precioCurso, literal.categoria))\n \n// }\n \n// }\n// });\n\n//GUARDAR EN LOCALSTORAGE \nlocalStorage.setItem(\"carrito\", JSON.stringify(carrito));\n\n//GENERAR SALIDA CURSO\ncarritoUI(carrito);\n}", "select(value) {\n\n \n let selectables = this.object_item(value).selectables;\n let selections = this.object_item(value).selections;\n\n\n\n if (selectables.length > 0) {\n\n selectables.addClass('OPTION-selected')\n .hide(1000);\n\n selections.addClass('OPTION-selected')\n .show(1000);\n\n this.object_item(value).options.prop('selected', true); // active selected original select\n\n // effacer class css SELECT-hover de cursur chaque changement\n this.$newSelect.find(this.elemsSelector).removeClass('SELECT-hover');\n\n\n\n\n if (this.options.keepOrder) { // order de position des item( asec or none)\n var selectionLiLast = this.$selectionUl.find('.OPTION-selected'); //les elements non hide =>show\n if ((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {\n selections.insertAfter(selectionLiLast.last());\n }\n }\n\n\n this.$originalSelect.trigger('change'); // start onchange de element original\n this.afterSelect(value);\n\n }\n }", "function logo_click() {\n if (pasos.paso1.aseguradoraSeleccionada != null && pasos.paso1.aseguradoraSeleccionada.id == pasos.paso1.listaAseguradoras[$(this).index()].id) {\n componentes.progreso.porcentaje = 0;\n componentes.progreso.barra.css({width: '0px'});\n pasos.paso1.aseguradoraSeleccionada = null;\n $(this).removeClass(\"seleccionada\");\n componentes.pasos.paso1.numero_siniestro.prop('readonly', true);\n } else {\n if (pasos.paso1.aseguradoraSeleccionada == null) {\n componentes.progreso.porcentaje = 5;\n componentes.progreso.barra.css({width: '5%'});\n }\n pasos.paso1.aseguradoraSeleccionada = pasos.paso1.listaAseguradoras[$(this).index()];\n $.get('http://localhost:8080/ReForms_Provider/wr/perito/buscarPeritoPorAseguradora/' + pasos.paso1.aseguradoraSeleccionada.id, respuesta_buscarPeritoPorAseguradora, 'json');\n $(this).siblings(\".seleccionada\").removeClass(\"seleccionada\");\n $(this).addClass(\"seleccionada\");\n componentes.pasos.paso1.numero_siniestro.prop('readonly', false);\n }\n componentes.pasos.paso1.numero_siniestro.val('').focus();\n componentes.pasos.paso1.numero_siniestro.keyup();\n }", "function co2Selected() {\n\ttempActive = false;\n\tlocationActive = false;\n\tradActive = false;\n\tco2Active = true;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function leerDatosCurso(curso) {\n // Creamos un objeto con el contenido del curso\n const info_curso = {\n img: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('span').textContent,\n id: curso.querySelector('a').getAttribute('data-id'),\n cantidad: 1,\n };\n\n // Revisa si un elemento ya existe en el carrito\n const existe = articulos_carrito.some((curso) => curso.id === info_curso.id);\n\n if (existe) {\n // Actualizamos la cantidad\n const cursos = articulos_carrito.map((curso) => {\n if (curso.id === info_curso.id) {\n curso.cantidad++;\n return curso;\n } else {\n return curso;\n }\n });\n\n articulos_carrito = [...cursos];\n } else {\n // Agregamos elemento al arreglo del carrito\n articulos_carrito = [...articulos_carrito, info_curso];\n }\n\n mostrarCarrito();\n}", "function anularCurso(codigoAsig){\n //alert(\"JARM\");\n for(var i=0;i<codigoAsignatura.length;i++){\n if (codigoAsignatura[i]==codigoAsig) {\n //cursoEstado(codigoAsig,false);\n matriculableAsignatura[i]=true;\n selecAsignatura[i]=false;\n turnoAsignatura[i]=\"0\";\n qui_cupo(i);\n for (var j=0;j<codigoAsignatura.length;j++){\n if(parseInt(ciclosSeleccionados[j])==parseInt(nivelAsignatura[i])){\n ciclosSeleccionados_creditos[j]=parseInt(ciclosSeleccionados_creditos[j])-parseInt(creditosAsignatura[i]);\n if (parseInt(ciclosSeleccionados_creditos[j])==0) {\n ciclosSeleccionados.splice(j,1);\n ciclosSeleccionados_creditos.splice(j,1);\n \n }\n }\n \n }\n \n \n }\n }\n imprimirCursosSelectos();\n listarAsignaturasPorNivel();\n }", "function ObtenerCursos() {\n return cursos;\n}", "selecionarProduto() {\n cy.get('#\\\\31 37012_order_products').select('7')\n }", "function onChange(value) { // aca va el get para obtener las secciones de un ramo\n console.log(`selected ${value}`);\n props.parentCallback({\"codigo\":value}); //map de eso y se puede rellenar la tabla\n\n \n //console.log(props.ramosDisponibles) solo para saber q es lo que llega\n \n \n }", "function listar(){\n//funsiones a llenar combobox\n tipo();\n ciudad();\n inicializarSlider();\n playVideoOnScroll();\n\n}", "function seleccionarImagen(posicion) {\n alternarVista(posicion);\n alternarIndicador(posicion);\n }", "function selectTok(e) {\n if (e.buttons === 3 || e.buttons === 1) {\n var tok = $(this);\n var tok_id = parseInt(tok.attr(\"id\").substring(3));\n\n if (row_selected) {\n var tok_list = signals[id][index].tokens;\n if (tok_list.indexOf(tok_id) === -1) {\n tok_list.push(tok_id);\n tok.addClass(\"tok--selected\");\n }\n } else {\n if (!tok.hasClass(\"tok--selected\")) {\n tok.addClass(\"tok--selected\");\n }\n }\n }\n }", "function buscarClienteOnClick(){\n if ( get('formulario.accion') != 'clienteSeleccionado' ) {\n // var oid;\n // var obj = new Object();\n var whnd = mostrarModalSICC('LPBusquedaRapidaCliente','',new Object());//[1] obj);\n if(whnd!=null){\n \n //[1] }else{\n /* posicion N°\n 0 : oid del cliente\n 1 : codigo del cliente\n 2 : Nombre1 del cliente\n 3 : Nombre2 del cliente\n 4 : apellido1 del cliente\n 5 : apellido2 del cliente */\n \n var oid = whnd[0];\n var cod = whnd[1];\n //[1] var nombre1 = whnd[2];\n //[1] var nombre2 = whnd[3];\n //[1] var apellido1 = whnd[4]; \n //[1] var apellido2 = whnd[5]; \n \n // asigno los valores a las variables y campos corresp.\n set(\"frmFormulario.hOidCliente\", oid);\n set(\"frmFormulario.txtCodigoCliente\", cod);\n \n } \n }\n }", "function leerCurso(curso){\r\n \r\n const infoCurso = {\r\n id: curso.querySelector('a').getAttribute('data-id'),\r\n imagen: curso.querySelector('img').src,\r\n nombre: curso.querySelector('h4').textContent,\r\n autor: curso.querySelector('.autor-curso').textContent,\r\n calificacion: curso.querySelector('.estrellas-curso span').textContent,\r\n precio: curso.querySelector('.precio span').textContent,\r\n cantidad: 1\r\n\r\n\r\n }\r\n\r\n const cursoDuplicado = articulosCarrito.some( curso => curso.id === infoCurso.id);\r\n if(cursoDuplicado){\r\n const i = articulosCarrito.map(curso =>{\r\n if(curso.id === infoCurso.id){\r\n curso.cantidad++;\r\n return curso;\r\n }else{\r\n return curso;\r\n }\r\n });\r\n articulosCarrito = [...i];\r\n }else{\r\n articulosCarrito = [...articulosCarrito, infoCurso];\r\n //console.log(articulosCarrito);\r\n\r\n\r\n }\r\n\r\n llenarCarrito();\r\n \r\n}", "function selectObjParam(options) {\t\n\t\t\tif (!canvas.getActiveObject()){\t\n\t\t\t\tif (canvas.getActiveGroup()){\n\t\t\t\t\t// ========= ???????????????\n\t\t\t\t}\n\n\t\t\t\tconsole.log('None select= ');\n\t\t\t\tconsole.log('Bground img = ' + canvas.backgroundImage);\n\t\t\t\tif (canvas.backgroundImage == null){\n\t\t\t\t\thideTools();\n\t\t\t\t\tcanvas.renderAll();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\thideTools();\n\t\t\t\t}\n\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log('Selected = ' + canvas.selection);\n\t\t\t\tvar selectObj=canvas.getActiveObject();\n\t\t\t\tvar currcol = selectObj.getFill();\n\t\t\n\t\t\t\tswitch(selectObj.type) {\n\t\t\t\tcase 'path-group' :\n\t\t\t\t\tcurrcol = selectObj.paths[0].getFill();\n\t\t\t\tbreak;\n\t\t\t\tcase 'text':\n\t\t\t\t\tcurrcol = selectObj.getFill();\n\t\t\t\tbreak;\t\n\t\t\t\tcase 'circle':\n\t\t\t\t\tcurrcol = selectObj.getFill();\n\t\t\t\tbreak;\t\n\t\t\t\tcase 'rect':\n\t\t\t\t\tcurrcol = selectObj.getFill();\n\t\t\t\tbreak;\t\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\tconsole.log('color select obj = ' + currcol);\t\t\n\t\t\tshowAllBtn (selectObj.isType('text'));\t\t\n\t\t\tgetfillObj(currcol);\n\t\t\t\tif (selectObj.isType('text')) {\t\t\t\t\n\t\t\t\t\t$('#colorelement').css('display','block');\t\t\t\n\t\t\t\t\t$(\"#fontFamily > option\").removeAttr(\"selected\");\t\t\t\t\t\n\t\t\t\t\t$('#fontFamily option[value=\"'+selectObj.getFontFamily()+'\"]').attr(\"selected\", true);\n\t\t\t\t\t$('#fontFamily').val(selectObj.getFontFamily()); //// ===============!!!!!!!!!!!!!! Worked in FF IE etc. !!!!!!!!!!!!!!!!=====================//\n\t\t\t\t\tcanvas.renderAll();\t\t\t\t\t\n\t\t\t\t\tconsole.log( 'Font Family sss= '+selectObj.getFontFamily());\n\t\t\t\t\t// =========== switch button \"bold\" & \"italic\" =============== //\n\t\t\t\t\tswitch(selectObj.getFontStyle()) {\n\t\t\t\t\t\tcase 'normal' :\n\t\t\t\t\t\t\t$(\".btnFntI\").css(\"background-image\", \"url(../img/buttons/btn-italic.png)\");\n\t\t\t\t\t\t\tfntI = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'italic' :\n\t\t\t\t\t\t\t$(\".btnFntI\").css(\"background-image\", \"url(../img/buttons/btn-italic-on.png)\");\t\n\t\t\t\t\t\t\tfntI = true;\t\t\t\n\t\t\t\t\t\tbreak;\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tswitch(selectObj.getFontWeight()) {\n\t\t\t\t\t\tcase 'normal' :\n\t\t\t\t\t\t\t$(\".btnFntB\").css(\"background-image\", \"url(../img/buttons/btn-bold.png)\");\n\t\t\t\t\t\t\tfntB = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bold' :\n\t\t\t\t\t\t\t$(\".btnFntB\").css(\"background-image\", \"url(../img/buttons/btn-bold-on.png)\");\t\n\t\t\t\t\t\t\tfntB = true;\n\t\t\t\t\t\tbreak;\t\t\t\n\t\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t\tcanvas.renderAll();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t/*==========*/\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\n\t\t}", "function seleccionar(id_fila) {\n //2702id_fila_selected=id_fila;\n localStorage.setItem(\"proyecto\",id_fila);\n location.href = \"informacion.html\";\n \n }", "function selectArticulo()\n{\n var mi_obj = {\n campos : \"idArticulo, nombre\",\n table : \"articulo\",\n order : \"nombre\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='articulo']\" );\n}", "function tareaSeleccionada(cuentaSelect, idList){\n\t\t\t\tconsole.log('lista seleccionada')\n\t\t\t\tlet totalNotasPC = parseInt($(\"#\"+idList).attr(\"data-totalNotasP\")) + parseInt($(\"#\"+idList).attr(\"data-totalNotasC\")); //obtenemos total notas pendientes\n\t\t\t\t$(\".tarea-seleccionada li\").on('click', function(){\n\t\t\t\t\tfor (var i=1;i<=totalNotasPC;i++){\n\t\t\t\t\t\tif ($(this).attr('id') == 'nota'+i){\n\t\t\t\t\t\t\t$(\"#nota\"+i).removeClass(\"no-selected\").addClass(\"selected\"); // notas --> transforma el background de blanco a azul\n\t\t\t\t\t\t\t$(\".mostrar-opciones-mas\").removeClass(\"disabled\"); \t\t // mostrar opciones en AUBMENU MAS de lista tareas\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$(\"#nota\"+i).removeClass(\"selected\").addClass(\"no-selected\"); // notas --> transforma el background de blanco a azul\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tmostrarMenuDerecho(cuentaSelect, idList);\n\t\t\t}", "function consultarTipoCapaSelected(capa, esCargaShape, fileName) {\n $(\"#modalTipoCapa\").modal(\"hide\");\n\n if(!isNaN(esCargaShape))\n _esCargaShape = esCargaShape;\n\n if(fileName)\n _fileName = fileName;\n\n _capa = capa;\n\n if (_esCargaShape == 0) {\n cargarShapeFile(_fileName);\n }\n else if (_esCargaShape == 1) {\n cargarKML(_fileName);\n }\n else if (_esCargaShape == 2) {\n var elem = $(\"#barraEdicion\");\n\n if (elem.hasClass(\"ocultar\"))\n elem.removeClass(\"ocultar\")\n else\n elem.addClass(\"ocultar\")\n\n drawFeature(_fileName)//en filename va el tipo Poligono o Circulo\n }\n\n}", "function colorSelect() {\n let id = parseInt(this.id);\n\n changeColor(id, this);\n color = true;\n}", "function llenarSelec() {\n var limite = localStorage.length;\n for (var i = 0; i < limite; i++) {\n var cod = localStorage.key(i);\n console.log(localStorage.getItem(cod));\n var curso = JSON.parse(localStorage.getItem(cod));\n if (curso.type === \"curso\") {\n $(\"#fkcurso\").append(\"<option value='\" + curso.Cod + \"'>\" + curso.curso + \"</option>\");\n }\n }\n }", "cargarCuentaActiva(){\n $.ajax({\n type: 'GET',\n url: 'cuenta/'+this.props.params.siteId,\n context: this,\n dataType: 'json',\n cache: false,\n success: function (data) {\n //Obtener las opciones de la consulta\n this.setState({selectedCuentaObj: data});\n }.bind(this),\n error: function (xhr, status, err) {\n //Error\n console.error(this.props.url, status, err.toString());\n }.bind(this)\n });\n }", "function eliminarCurso(e){\n if(e.target.classList.contains('borrar-curso')){\n // id del curso a borrar\n const idCurso = e.target.dataset.id;\n \n // Eliminar curso del arreglo cursosCarrito\n // recorre todo el arreglo y reasigna todos los objetos con un id diferente al que hemos seleccionado\n // para eliminar. De esta forma eliminamos el curso de nuestro arreglo.\n cursosCarrito = cursosCarrito.filter( curso => curso.id !== idCurso);\n \n console.log(cursosCarrito);\n\n actualizarHTML();\n }\n}", "function selectArticulo()\n{\n var mi_obj = {\n campos : \"idArticulo, nombre\",\n table : \"articulo\",\n order : \"nombre\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='articulo']\", \"option\" );\n}", "function buscar_seleccionado(combo,valor)\n{\n for(i= 0; i<combo.length; i++)\n {\n combo.selectedIndex = i; //selecciona el registro de la pos i\n if(combo.value == valor)\n {\n var encontro = true;\n break; //sale del ciclo\n }\n }\n if(!encontro)\n\tcombo.selectedIndex = 0;\n}", "function setBier()\n{\n if(cur_bier)\n {\n document.getElementById(cur_bier).className = cur_bier;\n }\n\n this.className = this.id + \"_selected\";\n cur_bier = this.id;\n}", "function agregarCurso(indice) {\r\n cursosElegidos.push(cursos[indice])\r\n // console.log(cursoElegido) \r\n\r\n diagramarCursos()\r\n sumadordePrecios();\r\n\r\n\r\n}", "function obtener_datos_curso_por_folio(){\n var consulta = conexion_ajax(\"/servicios/dh_cursos.asmx/obtener_datos_cursos_folio\", { folio: $(\"#folio_curso\").val() })\n $(\"#folio_curso\").val(consulta.id_curso)\n $(\"#Nombre_curso\").val(consulta.nombre_curso)\n $(\"#estatus_cusro\").val(consulta.estatus)\n $(\"#selector_puestos\").val(\n (function (valor) {\n var dato;\n $(\"#puestos option\").each(function (index, item) {\n if (valor == parseInt($(this).attr(\"name\")))\n dato = $(this).val();\n })\n return dato;\n }(consulta.puesto_pertenece))\n )\n obtener_imagen()\n}", "function click() {\n if(seleccionado==this) {\n this.style.backgroundColor=\"transparent\";\n seleccionado=null;\n }\n else {\n if(seleccionado!=null) \n seleccionado.style.backgroundColor=\"transparent\";\n this.style.backgroundColor=\"#e0b\";\n seleccionado=this;\n }\n \n}", "function selectBotFromList(){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n user.setAttribute(\"style\", \"\");\n }\n users.get(1).setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = 1;\n\n disableActionButton();\n var oneUser = {\n id : \"BOT\",\n contact_id: \"BOT\",\n username : \"CHAT BOT\",\n email : \"CHATEMAIL\",\n img : \"/images/bot.png\"\n };\n\n selectFlag = \"BOT\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n connectChatBot();\n\n curConvId = \"BOT\";\n}", "function afficherChoix() {\n choix.textContent = this.id;\n switch (this.id) {\n case 'pierre':\n choix.style.color = '#971801';\n break;\n\n case 'feuille':\n choix.style.color = '#0F0E8F';\n break;\n\n case 'ciseau':\n choix.style.color = '#3A9018';\n break\n\n default:\n choix.style.color = \"#252525\";\n }\n}", "handleClothe(newState) {\n\t\t//console.log(\"Clothe selecionada: \" + newState.selected);\n\n\t\t// when selecting \"Qualquer\" pass a null so backend do not verify\n\t\tif(newState.selected == \"Qualquer\") {\n\t\t\tthis.setState({ selectedClothe: \"\" });\n\t\t}\n\t\telse {\n\t\t\t// save selected genre\n\t\t\tthis.setState({ selectedClothe: newState.selected });\n\t\t}\n\n\t\t// give options for next step\n\t\tthis.setState({ optionsColors: colors });\n\t}", "function comboParceiro() {\r\n\r\n //Criar o HTML (option) para todos os parceiros\r\n let strHtml = \"<option value=''>Escolher</option>\"\r\n for (let i = 0; i < partners.length; i++) {\r\n strHtml += `<option value='${partners[i]._id}'>${partners[i]._name}</option>`\r\n }\r\n let selParceiro = document.getElementById(\"idSelParc\")\r\n selParceiro.innerHTML = strHtml\r\n}", "cambioPolitica(e){\n //let idpol=JSON.parse(e.target.value)\n this.props.updPolitica(e.target.value)\n this.props.cargarComboPoliticas()\n }", "function mostrarSedesCarrera() {\n let carreraSelect = this.dataset.codigo;\n let carrera = buscarCarreraPorCodigo(carreraSelect);\n let listaCursos = getListaCursos();\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n let codigosCursos = [];\n\n for (let i = 0; i < carrera[7].length; i++) {\n codigosCursos.push(carrera[7][i]);\n }\n\n for (let j = 0; j < listaCursos.length; j++) {\n for (let k = 0; k < codigosCursos.length; k++) {\n if (listaCursos[j][0] == codigosCursos[k]) {\n listaCheckboxCursos[j].checked = true;\n }\n }\n }\n verificarCheckCarreras();\n}", "function seleccionarBicicleta2(id, marca, foto){\n //console.log(id, marca, foto);\n localStorage.setItem(\"idBicicleta\",id);\n localStorage.setItem(\"marcaBicicleta\",marca);\n\n //Se llenan los campos del modal de edicion\n var foto_=document.getElementById(\"imgSalidaEdicion\");\n foto_.setAttribute(\"src\",\"data:image/jpg;base64,\"+foto);\n var idBicicleta = document.getElementById(\"idBicicleta\");\n idBicicleta.setAttribute(\"value\",id);\n}", "function UISelection(){\n\n }", "select(itemValue) {\n\t\tthis.setState({\n\t\t\ttype: itemValue,\n\t\t\tshowSpecfic: true\n\t\t});\n\t\tfetch(`http://192.168.0.14:3000/seeSpicfic?type=${itemValue}`).then((data) => data.json()).then((data) => {\n\t\t\tvar arr = [];\n\t\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\t\tarr.push({ label: data[i].specfic, value: data[i].specfic });\n\t\t\t}\n\t\t\tthis.setState({\n\t\t\t\tspecficArr: arr\n\t\t\t});\n\t\t});\n\t}", "function grups_selected(id,nombre)\n{\n $('#sucursal_list').empty();\n $('#sucursal_list').hide();\n $('#nom_sucursal').val(nombre);\n $('#nom_sucursal').attr('value',id);\n}", "function ControlGranajeSeleccionado(id)\n{\n //carga_ajax(webroot+'produccion/BuscarKilosCartulina',id,document.getElementById(\"gramaje_seleccionado\").value,'hola');\t\n\t carga_ajax15(webroot+'produccion/BuscarKilosCartulina',id,document.getElementById(\"gramaje_seleccionado\").value,document.getElementById(\"ancho_seleccionado_de_bobina\").value,'hola');\t\t\t\n}", "function ClickBarra() {\n\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var planta = data.getValue(selectedItem.row, 0);\n click_grafica(planta);\n\n\n }\n }", "function seleccionarCajas(obj){\n var sede = obj.val(); \n if(sede != ''){\n $.ajax({\n type:\"POST\",\n url:\"/ajax/cajas/escogerCaja\",\n data: {\n idSede : sede\n },\n dataType:\"json\",\n success:function (respuesta){\n obj.parents(\"#contenedorSelectorCajas\").find(\"#selectorCajas\").html(respuesta.contenido);\n }\n\n }); \n \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}", "function select(obj) {\n\tif (start) {\n\t begin(); \n\t\tstart=false;\n\t}\n\tif (obj.getAttribute(\"class\")==\"selected\") {\n\t\talert(\"Can't choose slected courses\");\n\t\treturn;\n\t}\n\n\t\t\tid = obj.getAttribute(\"id\");\n\t\t\tif (id < 2300) {\n\t\t\t\tcourse_elem = document.getElementById(\"F\");\n\t\t\t\tcount_elem = document.getElementById(\"fc\"); \n\t\t\t}\n\t\t\telse if (id < 2400) {\n\t\t\t course_elem = document.getElementById(\"C\");\n\t\t\t\tcount_elem = document.getElementById(\"cc\");\n\t\t\t}\n\t\t\telse if (id < 2500) {\n\t\t\t\tvar area = prompt(\"Should this be 'C'ognitive or 'S'ystems\", \"\");\n\t\t\t\tif (area.toUpperCase().charAt(0)==\"C\") {\t\n\t\t\t\t\tcourse_elem = document.getElementById(\"C\");\n\t\t\t\t\tcount_elem = document.getElementById(\"cc\");\n\t\t\t\t}\n\t\t\t\telse if(area.toUpperCase().charAt(0)==\"S\"){\n\t\t\t\t\tcourse_elem = document.getElementById(\"S\");\n\t\t\t\t\tcount_elem = document.getElementById(\"sc\");\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(\"Can't choose this courses without area.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\telse {\n\t\t\t\tcourse_elem = document.getElementById(\"S\");\n\t\t\t\tcount_elem = document.getElementById(\"sc\");\n\t\t\t}\n\n\tnewnode = obj.cloneNode(true);\t\n\tnewnode.setAttribute(\"onclick\", \"deselect(this)\");\n\tobj.setAttribute(\"class\", \"selected\");\n\tnewnode.setAttribute(\"class\", \"chosen\");\n\tcourse_elem.appendChild(newnode);\n\tcount = course_elem.childNodes.length;\n\tctnode = document.createTextNode(count);\n\tcount_elem.removeChild(count_elem.childNodes[0]);\n\tcount_elem.appendChild(ctnode);\n\n\t\n}", "function cambioClave(codigo) {\n noEmp = codigo;\n $('#modalCambioClave').modal('show');\n // $('#input-correo-editar').val(email);\n // $('#select-posicion').val(posicion).attr(\"selected\", \"selected\");\n}", "function nodeSelection(nodeId){\n requestItemInfo('GET', baseUrl_js + \"SppNav/item/\" + nodeId);\n}", "onSelect(selAuthor) {\n if (this.selectedAuthor != selAuthor) {\n this.selectedAuthor = selAuthor;\n this.authId = selAuthor.authorId;\n this.service2.setSelectedAuthor(selAuthor.authorId);\n }\n else {\n this.selectedAuthor = null;\n this.authId = 0;\n this.service2.setSelectedAuthor(0);\n }\n }", "selectFriend (rowId) {\n\n }", "function geraComboUnidadesCurriculares(aluno)\r\n{\r\n\tvar combo;\r\n\tvar n_aluno;\r\n\tvar uc;\r\n\tvar className;\r\n\t\r\n\t\r\n\t// se o array ainda não foi preenchido\r\n\tif (unidadesCurriculares.length <= 0)\r\n\t{\r\n\t\t// carrega unidades curriculares do ficheiro XML\r\n\t\tvar alunos = global_xmlUnidadesCurriculares.getElementsByTagName(\"STUDENT\");\r\n\t\t\r\n\t\t// percorre os alunos até encontrar o atual e depois preenche o array com\r\n\t\t// as disciplinas do aluno\r\n\t\tfor (i = 0; i < alunos.length; i++ )\r\n\t\t{\r\n\t\t\tn_aluno = alunos[i].getElementsByTagName(\"NUMBER\")[0].childNodes[0].nodeValue;\r\n\t\t\t\r\n\t\t\t// se o aluno for o mesmo preenche a combobox das disciplinas com as unidades curriculares em\r\n\t\t\t// que o aluno se encontra matriculado\r\n\t\t\tif (n_aluno == aluno)\r\n\t\t\t{\r\n\t\t\t\t// \r\n\t\t\t\tuc = alunos[i].getElementsByTagName(\"CLASS\");\r\n\t\t\t\t\r\n\t\t\t\tfor (y=0; y<uc.length;y++)\r\n\t\t\t\t{\r\n\t\t\t\t\tclassName = uc[y].childNodes[0].nodeValue;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// adicionar as unidades curriculares ao array\r\n\t\t\t\t\tunidadesCurriculares[unidadesCurriculares.length] = className + \";\" + className;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tcombo = populateComboBox('', 'comboUnidadesCurriculares', 'Unidades Curriculares', unidadesCurriculares, '');\r\n\t\r\n\treturn combo;\r\n}", "function select_row_listColores(row){\n\n console.log('Selected color!');\n var id_row = row.getAttribute('id');\n\n /* do visible content button delete formula */\n document.getElementById('content_button_delete_color').classList.remove(\"hidden\");\n /* Prepare button delete */\n document.getElementById('btn_delete_color_fast_formula').setAttribute('data-id_row',id_row);\n\n\n }", "function selectObject(item){\n \n //Deselecciono todo\n deselectObjects();\n \n //Selecciono el nuevo elemento\n item.classList.add(\"selected\");\n \n}", "function selectComboxRow(id, value) {\n\tvar combox = Zeta$(id);\n\tvar options = combox.options;\n\tfor (var i = 0; i < options.length; i++) {\n\t\tif (options[i].value == value) {\n\t\t\tcombox.selectedIndex = i;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function selectorChange(obj,ruta,cargaSelect){\n\tcargaSelect.forEach(function(index){\n\t\tvar carga = index;\n\t\tvar valor = $(obj).val();\n\t\tvar _token = document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content');\n\t\tvar URLdomain = window.location.origin;\n\t\t$.ajax({\n\t\t\ttype:'POST',\n\t\t\turl:ruta,\n\t\t\tdata:{_token:_token, carga:carga, valor:valor},\n\t\t\theaders:{'Access-Control-Allow-Origin':URLdomain},\n\t\t\tsuccess:function(listado){\n\t\t\t\tcargaOptionsSelector(carga,listado);\n\t\t\t}\n\t\t});\n\t});\n}", "function comprobarIdioma(){\n\tif (idiomaPrincipal) {\n\t\t// Se selecciona el elemento por defecto\n\t\tif (idiomaPrincipal.toString().length > 0) {\t\t\t\n\t\t\t//$('#lstIdiomaPrincipal option[value='+idiomaPrincipal+']').attr('selected', 'selected');\n\t\t\t//$('#lstIdiomaPrincipal').selectmenu('refresh');\t\t\t\n\t\t\t\n\t\t\t// Actualización del idioma actual y cambio de recursos\n\t\t\t$.localise('js/idiomas', {language: $('#lstIdiomaPrincipal').attr('value'), loadBase: true});\n\t\t\tconsole.log({language: $('#lstIdiomaPrincipal').attr('value'), loadBase: true});\n\t\t\tCargarEtiquetas();\n\t\t}\n\t}\n\t\n\tif (idiomaSecundario){\n\t\t// Se selecciona el idioma secundario guardado en la variable local\n\t\tif (idiomaSecundario.toString().length > 0){\n\t\t\t//$('#lstIdiomaSecundario option[value='+idiomaSecundario+']').attr('selected', 'selected');\n\t\t\t//$('#lstIdiomaSecundario').selectmenu('refresh'); \n\t\t}\n\t}\n}", "function scribblePoser() {\n\tvar $elt = $(\"#poser_chooser\");\n\t$elt.click();\n}", "function selectProperLabor()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\t\n\t\tif(rows.length > 0)\n\t\t{\n\t\t\tvar record = null;\n\t\t\tvar selectedSize = size.getRawValue();\n\t\t\tvar labor = \"\";\n\t\t\t\n\t\t\tfor(var i = 0; i < dsLabor.getCount(); i++)\n\t\t\t{\n\t\t\t\trecord = dsLabor.getAt(i); \t\n\t\t\t\tlabor = record.data.name;\n\t\t\t\t\n\t\t\t\tif(labor.toString().indexOf(selectedSize) != -1)\n\t\t\t\t{\n\t\t\t\t\trows[0].set('labor', labor);\n\t\t\t\t\trows[0].set('labor_cost', record.data.cost);\n\t\t\t\n\t\t\t\t\tif(record.data.job_id == 21)//Weed\n\t\t\t\t\t{\n\t\t\t\t\t\trows[0].set('days', record.get('days'));\n\t\t\t\t\t\t\n\t\t\t\t\t\tsetScheduledDate(rows[0]);\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trows[0].set('labor', '');\n\t\t\trows[0].set('labor_cost', 0);\n\t\t}\n\t}" ]
[ "0.669607", "0.62107855", "0.6102101", "0.6071516", "0.606263", "0.59576225", "0.59354407", "0.5918056", "0.59075737", "0.58786607", "0.5874236", "0.5869105", "0.5857011", "0.58474225", "0.5821351", "0.57960355", "0.57367146", "0.5686316", "0.56829244", "0.56817746", "0.56798023", "0.56726444", "0.56359714", "0.5629337", "0.56159246", "0.56016654", "0.5596108", "0.5583617", "0.5562997", "0.5562997", "0.55473787", "0.55378217", "0.5536073", "0.55243355", "0.5516185", "0.55115736", "0.5507697", "0.55012804", "0.5484379", "0.547385", "0.5473783", "0.54717815", "0.54636574", "0.54559433", "0.5452565", "0.54484814", "0.5443756", "0.5440355", "0.5438046", "0.54202616", "0.54038256", "0.5403403", "0.5398991", "0.5397482", "0.5379033", "0.537808", "0.5377328", "0.5375265", "0.53687507", "0.53659815", "0.536479", "0.5364616", "0.5357579", "0.5352685", "0.5350133", "0.5331869", "0.53255075", "0.53248787", "0.53239304", "0.5318104", "0.53162956", "0.53015083", "0.5295805", "0.5284479", "0.5281271", "0.52770174", "0.5271314", "0.527", "0.5266259", "0.52641165", "0.52554524", "0.5253528", "0.5251321", "0.52511424", "0.5248244", "0.52470183", "0.5245063", "0.5244096", "0.5231721", "0.5231062", "0.5229604", "0.52255607", "0.52245706", "0.52232534", "0.5220014", "0.52197206", "0.5218206", "0.52086395", "0.52041495", "0.520291", "0.5196829" ]
0.0
-1
Devuelve las identificaciones de los profesores seleccionados
function guardarCursosAsociar() { let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]:checked'); let cursosSeleccionados = []; let codigoCurso; //Este ciclo for debe empezar en 1, ya que en el cero "0" se encuentra el id unico del elemento al que se le desea agregar elementos for (let i = 0; i < listaCheckboxCursos.length; i++) { codigoCurso = listaCheckboxCursos[i].dataset.codigo; cursosSeleccionados.push(codigoCurso); } return cursosSeleccionados; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fLlenarProfesoresRegistro(){\n //hacemos un for que recorra el array profesores (que guarda los objetos de cada profesor) y liste sus nombres en <option></option> que se añadirán al html\n let opciones = `<option hidden value=\"elegir\">Elegir profesor</option>`; //string que guardará todas las opciones de profesor, valor inicial dice \"Elegir profesor\"\n for (i=0; i < profesores.length; i++)\n {\n opciones += `<option value=\"${profesores[i].id}\">${profesores[i].nombre}</option>`;\n }\n return opciones;\n}", "function agarrarProfesor() {\n const profesorId = document.getElementById(\"profesores\").value;\n document.getElementById(\"profesorId\").value = profesorId;\n}", "function asignarProfesor() {\n const profesorId = document.getElementById(\"profesores\").value;\n document.getElementById(\"profesorId\").value = profesorId;\n const materiaId = document.getElementById(\"materias\").value;\n document.getElementById(\"materiaId\").value = materiaId;\n}", "function selectProfile(prof){\n\n\tvar profHandle = $(prof).parent('.mainListItem').find('p.profhandle').text();\n\n\t//Check if profile is in the selectedProfs array\n\tif(selectedProfs.includes(profHandle)){\n\t\t//If in array, remove, re-enab;e hover and change color back to dark\n\t\tselectedProfs.splice(selectedProfs.indexOf(profHandle), 1);\n\t\tupdateJSON();\n\t\tenableHover(prof);\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#444444\"}, 100);\n\t}else{\n\t\t//If not in array, add to array, remove hover events and make item green\n\t\tselectedProfs.push(profHandle);\n\t\tupdateJSON();\n\t\t$(prof).parent('.mainListItem').unbind('mouseenter mouseleave');\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#417f50\"}, 100);\n\t\n\t}\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}", "selectPerfil(profile) {\n // Agrega el id del perfil a la transición\n this.transitionTo('perfil', profile.get('id'));\n }", "static async getProfesoresForIc(idIc, idanio_lectivo) {\n\n //cursos para inspector de curso\n //let cursos = await db.query('SELECT idcurso FROM curso WHERE user_iduser = ? AND cur_estado = 1', [idIc]);\n let cursos = await Curso.getCursosForIc(idIc, idanio_lectivo);\n //Consulta para obtener las materias, cursos y profesores\n\n var sql = [];\n if (cursos.length > 0) {\n for (let index = 0; index < cursos.length; index++) {\n let mhc = await db.query(`\n SELECT \n idfuncionario,\n idmaterias_has_curso,\n profesor_idprofesor,\n fun_nombres,\n idmaterias,\n mat_nombre,\n cur_curso,\n idcurso\n FROM materias_has_curso\n INNER JOIN funcionario on funcionario.idfuncionario = materias_has_curso.profesor_idprofesor\n INNER JOIN materias on materias.idmaterias = materias_has_curso.materias_idmaterias\n INNER JOIN curso on curso.idcurso = materias_has_curso.curso_idcurso\n WHERE materias_has_curso.curso_idcurso = ?\n AND mat_has_cur_estado = 1 \n AND mat_has_curso_idanio_lectivo = ?\n `, [cursos[index].idcurso, idanio_lectivo]);\n\n if (mhc.length > 0) {\n mhc.forEach(element => {\n sql.push(element);\n });\n }\n }\n }\n\n return sql\n //return cursos\n }", "function selectProfile() {\n for (let x = 0; x < profileLink.length; x++) {\n profileLink[x].classList.add('selected');\n }\n}", "function profesores(){\n\t$.ajax({\n\t\ttype: 'POST',\n\t\tdataType: 'JSON',\n\t\tdata:{\n\t\t\ttypeQuery: \"selectProfesor\"\n\t\t},\n\t\turl: 'controller/ControladorGestionarGrupo.php',\n\t\tsuccess:function(data){\n\t\t\tvar profesores = data.length;\n\t\t\tfor (var i = 0; i < profesores; i++) {\n\t\t\t\t$('select.profesor').append('<option value=\"'+data[i].id_profesor+'\">'+data[i].nombres+' '+data[i].apellido_materno+' '+data[i].apellido_paterno+'</option>');\n\t\t\t}\n\t\t}\n\t});\n}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function elementSelectedProfileID(){\r\n\tvar choice = document.form.profileID.selectedIndex;\r\n\tchoice = padZeros(choice);\r\n\tif(choice == 0){\r\n\t\tprofileID = \"<Var>ProfileID</Var>\" + \"\\n \";\r\n\t\tenglishProfileID = \"anybody\";\r\n\t}\r\n\telse{\r\n\t\tprofileID = \"<Ind>p\" + choice + \"</Ind>\" + \"\\n \";\r\n\t\tenglishProfileID = \"p\" + choice;\r\n\t}\r\n\tcreateRuleML();\r\n}", "function pesoActividades() {\n const listaActividades = document.getElementById('ddlActividades').children;\n let peso = document.getElementById('pesoAct');\n \n for (let x = 0; x < listaActividades.length; x++) {\n if(listaActividades[x].selected === true){\n peso.innerHTML = listaActividades[x].id;\n }\n }\n calcularTotal();\n }", "function mostrarUsuarios(tipo) {\n const inscriptions = course.inscriptions;\n let lista = null;\n\n users = inscriptions?.map((inscription) => inscription.user);\n const teacher = new Array(course.creator);\n const delegate = new Array(course.delegate);\n\n if (tipo === 'Profesor') {\n lista = <UsersList courseId={courseId} users={teacher} setSelectedUser={(a)=>{console.log(a);}}/>;\n } else if (tipo === 'Delegados') {\n lista = <UsersList courseId={courseId} users={delegate} setSelectedUser={(a)=>{console.log(a);}} />;\n } else {\n lista = <UsersList courseId={courseId} users={users} setSelectedUser={(a)=>{console.log(a);}} />;\n }\n\n return lista;\n }", "function printUserSlections(dataKey,i) {\r\n var valueA = document.getElementById(dataKey);\r\n var pElement = document.createElement(\"li\");\r\n pElement.className = i;\r\n pElement.setAttribute(\"title\", \"selected\");\r\n var inPElement = document.createTextNode(valueA.value);\r\n pElement.appendChild(inPElement);\r\n displayCurrentSelec.appendChild(pElement);\r\n }", "function getIDStudent(){\n\t//Obtenim el ID de la part superior.\n\treturn $(\"#alumnes\").val();\n}", "function luminaire_selection() {\n\t// Check if luminaire is being selected, has a valid ID, and has not already been selected\n\tif ((LUMINAIRE_IDS.indexOf(luminaire_device_id) > -1) && (SELECTED_LUMINAIRES.indexOf(luminaire_device_id) == -1))\n\t{\n\t\t//console.log('Successfully added luminaire');\n\t\tSELECTED_LUMINAIRES.push(luminaire_device_id);\n\t}\n\t// Display selected luminaires\n\tconsole.log('Selected luminaires');\n\tif(SELECTED_LUMINAIRES.length > 0)\n\t{\n\tfor (var i = 0; i < SELECTED_LUMINAIRES.length; i++)\n\t{\n\t\tvar device_name;\n\t\tvar device_id = SELECTED_LUMINAIRES[i];\n\t\tvar device_index = LUMINAIRE_IDS.indexOf(device_id);\n\t\tswitch(device_index)\n\t\t{\n\t\t\tcase 0: device_name = 'a1';\n\t\t\tbreak;\n\t\t\tcase 1: device_name = 'a2';\n\t\t\tbreak;\n\t\t\tcase 2: device_name = 'a3';\n\t\t\tbreak;\n\t\t\tcase 3: device_name = 'b1';\n\t\t\tbreak;\n\t\t\tcase 4: device_name = 'b2';\n\t\t\tbreak;\n\t\t\tcase 5: device_name = 'b3';\n\t\t\tbreak;\n\t\t\tcase 6: device_name = 'c1';\n\t\t\tbreak;\n\t\t\tcase 7: device_name = 'c2';\n\t\t\tbreak;\n\t\t\tcase 8: device_name = 'c3';\n\t\t\tbreak;\n\t\t\tdefault: device_name = 'none';\n\t\t}\n\t\tconsole.log(device_name);\n\t}\n}\n}", "function currentProfile(event) {\n\tfor (let i = 0; i < hires.length; i++) {\n\t\thires[i].classList.remove('active');\n\t}\n\tevent.currentTarget.classList.add('active');\n}", "function getProfById(id) {\n return professors.find(prof => prof._id === id);\n }", "function SpecVraagP()\n{\n fullid = this.id.split(\"\");\n if(fullid.length == 2)\n {\n index = fullid[0];\n }\n else\n {\n index = fullid[0] + fullid[1];\n }\n SBid = \"SBP\" + index;\n \n if(SelecParties[index] == parties[index].name)\n {\n SelecParties[index] = false\n SpecPCount--;\n document.getElementById(SBid).classList.replace(\"SpecSelected\", \"SpecNotSelected\")\n }\n else if(SelecParties[index] != parties[index].name)\n {\n SelecParties[index] = parties[index].name\n SpecPCount++;\n document.getElementById(SBid).classList.replace(\"SpecNotSelected\", \"SpecSelected\")\n }\n console.log(SelecParties)\n}", "function goToProfile(profileInfo){\n //let profileInfo = document.getElementsByClassName(\"profileInfo\");\n \n for(let i = 0; i < profileInfo.length; i++){\n \n profileInfo[i].children[0].addEventListener(\"click\", findCurrentProfile);\n }\n}", "function selecter(channelNumber){\n let listAvatar = document.getElementById(\"avatarSelector\").getElementsByTagName(\"li\");\n for (let i = 0; i< avatarNumber; i++){\n listAvatar[i].className = i+1 === channelNumber ? \"selected\":\"\"; \n }\n choosenAvatar = document.getElementsByClassName(\"selected\")[0].id\n}", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "function userPick(evt) {\r\n userChoice = this.id;\r\n console.log(userChoice);\r\n playGame();\r\n}", "function displayProfiles(profiles) {\n member = profiles.values[0];\n console.log(member.emailAddress);\n $(\"#name\").val(member.emailAddress);\n $(\"#mail\").val(member.emailAddress);\n $(\"#pass\").val(member.id);\n apiregister(member.emailAddress,member.id);\n }", "function Seleccionar_persona_asis(id_persona, nombre_person) {\n window.document.asist_reg.id_persona.value = id_persona;\n document.getElementById(\"nombre_persona\").value = nombre_person;\n}", "function selectUserFromCollaboratorList(email) {\n var parentUl = $('#panel-collaborators').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n if(user.id == email) {\n user.setAttribute(\"style\", \"background-color: #c3c3c3; cursor: pointer;\");\n selectedCollaboratorIndex = i;\n selectedCollaboratorEmail = email;\n }\n else {\n user.setAttribute(\"style\", \"cursor: pointer;\");\n }\n }\n}", "function findProfiles() {}", "function alterarImagemPersonagemSelecionado(personagem) {\r\n\tconst imagemPersonagemGrande = document.querySelector(\".personagem-grande\");\r\n\t// passo 2 - alterar a imagem do personagem grande\r\n\tconst idPersonagem = personagem.attributes.id.value;\r\n\timagemPersonagemGrande.src = `./src/images/card-${idPersonagem}.png`;\r\n}", "function imprimir_nombre_de_coleccion(personas){\n for (var i =0; i< personas.length; i = i +1){\n console.log(personas[i].nombre);\n }\n}", "function buildIdentityList(){\n\t\tvar identities = EcIdentityManager.ids;\n\t\t\n\t $(\"#appMenuIdentityList\").html(\"\");\n var identitySelected = false;\n\t for (var index in identities)\n\t {\n\t \tvar ppk = identities[index].ppk.toPem().replaceAll(\"\\r?\\n\",\"\");\n\t var name = identities[index].displayName;\n\t \n\t var container = $(\"<li></li>\");\n\t var element = $(\"<div class='fake-a'></div>\");\n\t \n\t if(AppController.identityController.selectedIdentity != undefined && \n\t \t\tname == AppController.identityController.selectedIdentity.displayName)\n\t {\n\t \telement.addClass(\"selected\");\n\t \tidentitySelected = true;\n\t \t$(\"#appMenuUserIdentity\").children().first().text(name)\n\t }\n\t \t\n\t element.attr(\"title\", ppk);\n\t element.click(ppk, function(event){\n\t \tselectKey(event.data);\n\t });\n\t element.text(name);\n\t element.append($(\"<i class='fa fa-check'></i>\"))\n\t \n\t container.append(element);\n\t \n\t $(\"#appMenuIdentityList\").append(container);\n\t }\n\t \n\t var container = $(\"<li></li>\");\n var element = $(\"<div class='fake-a'></div>\");\n if(!identitySelected)\n {\n \telement.addClass(\"selected\");\n \t$(\"#appMenuUserIdentity\").children().first().text(PUBLIC_NAME+\" (Logged In)\")\n }\n \t\n element.attr(\"title\", PUBLIC_TITLE);\n element.click(ppk, function(event){\n \tdeselectKey();\n });\n element.text(PUBLIC_NAME);\n element.append($(\"<i class='fa fa-check'></i>\"))\n \n container.append(element);\n $(\"#appMenuIdentityList\").prepend(container);\n\t}", "function selectId (context) {\n if (selected == 0) {\n firstID = $(context).children(\"img\").attr(\"id\");\n $(context).addClass(\"inactive\"); // Make sure same card can't be select again\n } else if (selected == 1) {\n secondId = $(context).children(\"img\").attr(\"id\");\n $(\"td\").addClass(\"inactive\");\n }\n\n selected = $(\".show\").length;\n\n if (selected > 1) {\n checkId(firstID, secondId);\n selected = 0;\n }\n }", "function avatarOptions() {\n\tvar avatarType = document.querySelector('input[name=\"avatar\"]:checked').value;\n\tif (avatarType === \"previousAvatar\") {\n\t\tdocument.getElementById(\"selectAvatarType\").style.display='none';\n\t\tdocument.getElementById(\"selectPrevious\").style.display='';\n\t} else if (avatarType === \"newAvatar\") {\n\t\tdocument.getElementById(\"selectAvatarType\").style.display='none';\n\t\tdocument.getElementById(\"selectScript\").style.display='';\n\t}\n}", "function grups_selected(id,nombre)\n{\n $('#sucursal_list').empty();\n $('#sucursal_list').hide();\n $('#nom_sucursal').val(nombre);\n $('#nom_sucursal').attr('value',id);\n}", "function getHobbies(){\nlet skills = document.getElementsByName('skills')[0]\nlet select = skills.querySelectorAll('[selected=\"selected\"]')\nlet hobbies = document.getElementsByName('hobbies')[0]\nlet select2 = hobbies.querySelectorAll('[selected=\"selected\"]')\nfor(let skill of select){\n console.log(`${skill.value} : ${skill.innerText}`)\n}\nfor(let hobby of select2){\n console.log(`${hobby.value} : ${hobby.innerText}`)\n}\n}", "function listaEstados(){\n\tvar estados = document.getElementsByName('perfil')[0];\n\tfor(i=0;i<estados.options.length;i++){\n\t\testados.options[i].innerHTML.split(\"PRIMARIO_\")[1];\n\t\tards[i]\n\t}\n}", "function mostrarDatosProveedor() {\n //tomar el idProveedor desde el value del select\n let idProvedor = document.getElementById(\"idProveedor\").value;\n //buscar el proveedor en la lista\n for (let i = 0; i < listaProveedores.length; i++) {\n let dato = listaProveedores[i].getData();\n if(dato['idProveedor'] === parseInt(idProvedor)){\n //desplegar los datos en el formulario\n vista.setDatosForm(dato);\n break;\n }\n }\n}", "function setpliInfo(id)\n{\n\tvar pro = gerProObj();\n\tvar index=parseInt(_(\"ProfileIndex\").value);\n\tvar cp=pro[index];\n\tvar lb=getChildNodes(cp,\"label\");\n\thtml(lb[0],html(lb[0])+',\"profileID\":\"'+id+'\",\"prior\":\"1\"');\n\tbug(\"lable\",html(lb[0]));\n\t\n}", "whichProfile() {\n\t\tthis.profile = 'particle';\n\t\tthis.readProfileData();\n\t}", "function endModifyProfile(Id) {\n $('#MODI_'+Id).remove();\n $('#profil_'+Id).show();\n}", "function endModifyProfile(Id) {\n $('#MODI_'+Id).remove();\n $('#profil_'+Id).show();\n}", "function LlenarListaProveedores(){\r\n cargarDatosProveedores();\r\n var selector =\"\";\r\n\r\n for (let index = 0; index < proveedores.length; index++ ){ \r\n selector += '<option value=' + proveedores[index].nombre + '>'+proveedores[index].nombre+'</option>';\r\n } \r\n document.getElementById(\"idProveedoresOrden\").innerHTML = selector;\r\n}", "function userData() {\n let id = \"\"\n if (sessionStorage.getItem(\"loggedUserId\")) {\n id = JSON.parse(sessionStorage.getItem('loggedUserId'))\n }\n for (const user of users) {\n if (user._id == id) {\n document.querySelector('.avatar').src = user._avatar\n }\n }\n}", "function namesel (dpid) {\n var html, dp = dpdict[dpid];\n html = \n [\"div\", {id:\"profdispdiv\"},\n [[\"div\", {id:\"profclosexdiv\"},\n [\"a\", {href:\"#close\", onclick:jt.fs(\"mavisapp.closeprof()\")},\n \"x\"]],\n [\"div\", {id:\"profnamediv\"},\n [\"a\", {href:dp.url, \n onclick:jt.fs(\"window.open('\" + dp.url + \"')\")},\n dp.name.slice(0, -4)]],\n [\"div\", {id:\"profbodydiv\"},\n [[\"div\", {id:\"profpicdiv\"},\n [\"img\", {src:\"img/profpic/\" + dp.capic}]],\n [\"div\", {id:\"profteamdiv\"}, teamName(dp)],\n [\"div\", {id:\"profposdiv\"}, legisType(dp)],\n [\"div\", {id:\"profdistdiv\"}, dp.district || \"\"],\n [\"div\", {id:\"profphonediv\"}, phoneLink(dp)],\n [\"div\", {id:\"profroomdiv\"}, \"Room \" + (dp.room || \"Unknown\")],\n [\"div\", {id:\"profolcont\"}, onlineContactLinks(dp)],\n [\"div\", {id:\"proftitlediv\"}, titleCommittee(dp)]]]]];\n jt.out(\"mavisdetdiv\", jt.tac2html(html));\n jt.byId(\"mavisdetdiv\").style.display = \"block\";\n }", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "function cargarCgg_titulo_profesionalCtrls(){\n\t\tif(inRecordCgg_titulo_profesional){\n\t\t\ttxtCgtpr_codigo.setValue(inRecordCgg_titulo_profesional.get('CGTPR_CODIGO'));\n\t\t\tcodigoNivelEstudio = inRecordCgg_titulo_profesional.get('CGNES_CODIGO');\t\t\t\n\t\t\ttxtCgnes_codigo.setValue(inRecordCgg_titulo_profesional.get('CGNES_DESCRIPCION'));\n\t\t\ttxtCgtpr_descripcion.setValue(inRecordCgg_titulo_profesional.get('CGTPR_DESCRIPCION'));\n\t\t\tisEdit = true;\n\t\t\thabilitarCgg_titulo_profesionalCtrls(true);\n\t}}", "profile (state, getters) {\n return state.profile.filter(prof => {\n return prof.user === getters.user.id\n })\n }", "selectFriend (rowId) {\n\n }", "function usuarioSeleccionado(idUsuario){\n\n var Usuario = usuarios[idUsuario].nombre;\n document.getElementById('bienvedida').innerHTML=\n `<h1 style=\"font-weight: 900;color: #5c3286;\">¡Hola ${Usuario}</h1>\n <h3 style=\"color: #5c3286;\">¿Qué Necesitas?</h3>`; \n\n document.getElementById('dropdown01').innerHTML= Usuario; \n\n document.getElementById('nombreOrdenes').innerHTML= \n `<h3 style=\"font-weight: 600;color: white;\">${Usuario}, Estas son tus ordenes</h3>`; \n\n\n for(let i=0;i<usuarios[idUsuario].ordenes.length;i++)\n {\n document.getElementById('usuarios').innerHTML = '';\n document.getElementById('ordenes').innerHTML +=\n `<div class=\"col-12\" style=\"background-color: rgba(0,0,0,.075);\">\n <p>${usuarios[idUsuario].ordenes[i].nombreProducto}</p>\n <p>${usuarios[idUsuario].ordenes[i].descripcion}</p>\n <p>${usuarios[idUsuario].ordenes[i].precio}</p>\n </div>`; \n }\n \n}", "function seleccionar_parroquias(identificador){\n\t$(identificador).on('change', function(e){\n\t\t$('#id_parroquia option').remove();\n\t\t$('#id_parroquia').prop('disabled', true);\n\t\te.preventDefault();\n\t\tvar url = '/api/ciudades/select/';\n\t\tvar canton = $(identificador + ' option:selected').text();\n\t\tvar ctx = {'canton': canton}\n\n\t\t$.get(url, ctx, function(data){\n\t\t\tconsole.log(data.parroquias)\n\t\t\t$.each(data.parroquias, function(index, element){\n\t\t\t\t$('#id_parroquia').prop('disabled', false);\n\t\t\t\t$('#id_parroquia').append(element.option)\n\t\t\t});\n\t\t});\n\t})\n}", "function showAssignedTo() {\n\n document.getElementById('default-user').innerHTML = '';\n\n for (let i = 0; i < allUsers.length; i++) {\n if (allUsers[i]['checkedStatus'] == true) {\n document.getElementById('default-user').innerHTML += `<img id=\"profile-pic-${i}\" class=\"profile-pic\" title=\"${allUsers[i].name}\" src=\"http://gruppe-63.developerakademie.com/Join/uploads/${allUsers[i].img}\">`;\n }\n }\n}", "function onSelectedIll({ target }) {\n if (target.value) {\n const ill = dataIll.ills.filter(ill => ill.name === target.value)[0];\n ill && ill.id && setSelectedIllId(ill.id);\n }\n }", "function listarImpresoras(){\n\n $(\"#selectImpresora\").html(\"\");\n navigator.notification.activityStart(\"Buscando impresoras...\", \"Por favor espere\");\n\n ImpresoraBixolonSPPR300ySPPR310.buscar((devices)=>{\n\n var lista = devices.map((device)=>{\n\n var id = device.MAC + \"_\" + device.Nombre;\n var texto = device.Nombre + \"(\" + device.MAC + \")\";\n\n $('#selectImpresora').append($('<option>', {\n value: id,\n text : texto\n }));\n\n });\n\n navigator.notification.activityStop();\n $('#selectImpresora').selectmenu('enable');\n $('#selectImpresora').selectmenu('refresh');\n\n });\n\n }", "function getProfile(person){\n\tprofileString = 'GetProfile=True&ProfileId='; \n\tif(person == 'MyProfile'){\n\t\tprofileString += $('#loggedInUser').text().substr(14,30);\n\t}\n\telse if(person == 'Instructor'){\n\t\tvar i=0;\n\t\tselectedRow.find('td').each(function(){\n\t\t\tif(i==0){\n\t\t\t\tprofileString += $(this).text();\n\t\t\t}\n\t\t\ti++;\n\t\t});\n\t}\n\telse{\n\t\tprofileString += person;\n\t}\n\tprofileString += '&Profiles';\n\tdisplayPageInfo(profileString);\n}", "getAllProfilesForCurrentInterviewer(event){\n\t\tevent.preventDefault();\n\t\tconst basicString = this.props.userCredentials.email + ':' + this.props.userCredentials.password;\n\t\tlet arrayIndexToQuery = event.target.value;\n\t\tlet databaseIdToQuery = this.state.interviewers[arrayIndexToQuery].people_id; // their people_id is gonna be different from their spot in the array (index)\n\t\t//let arrayIndexToQuery = event.target.value;\n\t\t//let oldEventTargetValue = idToQuery - 1; // because event.target.value becomes null after the fetch call\n\t\t//console.log(\" here oldEventTargetValue is : \" + oldEventTargetValue);\n\t\tconsole.log(\"wait please my dude\");\n\t\tconsole.log(\" * [InterviewerList.jsx] databaseIdToQuery: \" + databaseIdToQuery);\n\t\t//fetch(`${process.env.API_URL}/oip/${this.state.interviewerId}`, {\n\t\tfetch(`${process.env.API_URL}/oip/${databaseIdToQuery}`, {\n\t\t\tmethod: 'GET',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'Authorization': 'Basic ' + btoa(basicString)\n\t\t\t}\n\t\t})\n\t\t.then(response => this.handleHTTPErrors(response))\n\t\t.then(response => response.json())\n\t\t.then(result => {\n\t\t\t// We need to extract just the profile_names from this object array...\n\t\t\tlet interviewerProfilesObjectArray = result;\n\n\t\t\t// ... into a set variable...\n\t\t\tlet interviewerProfilesSet = new Set();\n\t\t\tfor (let i = 0; i < interviewerProfilesObjectArray.length; i++){\n\t\t\t\tinterviewerProfilesSet.add(interviewerProfilesObjectArray[i].profile_name);\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tinterviewerProfiles: interviewerProfilesSet,\n\t\t\t\tshowSingleInterviewer: true,\n\t\t\t\tinterviewerEmail: this.state.interviewers[arrayIndexToQuery].email,\n\t\t\t\tinterviewerFirstName: this.state.interviewers[arrayIndexToQuery].first_name,\n\t\t\t\tinterviewerLastName: this.state.interviewers[arrayIndexToQuery].last_name,\n\t\t\t\tinterviewerId: this.state.interviewers[arrayIndexToQuery].people_id\n\t\t\t});\n\t\t\t//console.log(\"wait first: \" + this.state.interviewerFirstName + \" \" + this.state.interviewerLastName + \" \" + this.state.interviewerEmail + \" [\" + this.state.interviewerId + \"]\");\n\t\t})\n\t\t.catch(error => {\n\t\t\tconsole.log(error);\n\t\t});\n\t}", "function selectedProfile() {\n // Not the nicest way but if it works it works.\n const selectedId = event.srcElement.parentElement.parentElement.id;\n console.log(selectedId);\n console.log('Selected ID: ', selectedId);\n const items = document.querySelectorAll('.selectBtn');\n console.log(items);\n for (const item of items) {\n console.log('item ', item);\n if (item.classList.contains('selectedBtn')) {\n item.classList.remove('selectedBtn');\n console.log('it does contain .selectedBtn');\n }\n }\n\n event.target.classList.toggle('selectedBtn');\n localStorage.setItem('currentProfile', selectedId);\n}", "function printMealOptionsID() {\n var items = signupForm.getItems();\n Logger.log(\"ID: \" + items[6].getId() + ': ' + items[6].getType());\n}", "function alumnoRegistro(){\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n if(perfil === 2){\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML =\r\n `<label for=\"selListaDocentes\">Elija docente: </label><select id=\"selListaDocentes\"> \r\n </select>`;\r\n for (let i = 0; i < usuarios.length; i++) {\r\n const element = usuarios[i];\r\n if(element.perfil === \"docente\"){\r\n document.querySelector(\"#selListaDocentes\").innerHTML +=\r\n `<option value=\"${element.nombreUsuario}\">${element.nombre} (${element.nombreUsuario}) </option>`\r\n }\r\n }\r\n }else{\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML = \"\";//Esta funcion corre cada vez que hay alguien selecciona un perfil en el formulario de registro, si cambia para otro que no sea alumno (2) viene aca y elimina el <select> de docente\r\n }\r\n}", "function manageSelectedIds() {\n var financeCube = CoreCommonsService.findElementByKey($scope.originalFinanceCubes.sourceCollection, $scope.choosedFinanceCube, 'financeCubeVisId');\n selectedFinanceCubeId = financeCube.financeCubeId;\n $scope.selectedModelId = financeCube.model.modelId;\n $scope.selectedModelVisId = financeCube.model.modelVisId;\n }", "function consultarCitasUsuario(){\n\t\n\tvar idUsuario = $(\"#selectUsuario\").val();\n\t\n\t\n\tvar selectList = $(\"#otrosUsuarios\");\n\tselectList.find(\"option:gt(0)\").remove();\n\t\n\t//para mostrar nombre en spán de select usuarios\n\t$(\"#nombreUsuarioSeleccionado\").html( $(\"#selectUsuario option:selected\").text() );\n\t\n\t$(\"#selectUsuario option\").each(function(){\n // Add $(this).val() to your list\n \tif( ($(\"#selectUsuario\").val() != $(this).val()) && ($(\"#selectUsuario\").val() != \"\") && ($(\"#selectUsuario\").val() != null) && ($(this).val() != \"\") && ($(this).val() != null) ){\n \t\t\n \t\t$('#otrosUsuarios').append($('<option>', {\n\t\t \tvalue: $(this).val(),\n\t\t \ttext: $(this).text()\n\t\t\t}));\n \t\t\n \t}\n\t\t\n\t});\t\n\t\n \t $('#otrosUsuarios').material_select('destroy');\n \t $('#otrosUsuarios').material_select();\t\n \t \n \t //se recorre el select que se acabo de contruir para dar los ids a los checkbox de materialize\n \t $(\"#otrosUsuarios option\").each(function(){\n\t\t\n \t$(\"#nuevaCitaOtrosUsuariosMultiple\").find('span:contains(\"'+$(this).text()+'\")').parent('li').attr('id', 'multipleCreando'+$(this).val());\n \t$('#multipleCreando'+$(this).val()).attr(\"onClick\", 'comprobarSeleccionMultipleNuevaCita(this.id)');\n\t\t\n\t});\t\n \t \n\n\t$(\"#calendar\").fullCalendar( 'destroy' );\n\tcontruirCalendario();\t\n\t\n\t\n}", "function imprimirProfesiones(persona) {\n console.log(`${persona.nombre} es:`)\n if(persona.ingeniero) {\n console.log(`Ingeniero`);\n }\n else{\n console.log('No es ingeniero');\n }\n if(persona.cantante){\n console.log('Cantante');\n }\n else{\n console.log('No es cantante');\n }\n if(persona.cocinero){\n console.log('Cocinero');\n }\n else{\n console.log('No es cocinero');\n }\n if(persona.deportista){\n console.log('Deportista');\n }\n else{\n console.log('No es deportista');\n }\n if(persona.dj){\n console.log('Dj');\n }\n else{\n console.log('No es dj');\n }\n if(persona.guitarista){\n console.log('Guitarrista');\n }\n else{\n console.log('No es guitarrista');\n }\n}", "function jugar() {\n const playerSelection1 = gameForm.selection.value; //TIRO 1\n const playerSelection2 = gameForm2.selection.value; //TIRO 2\n\n const ganadorInfo = inicia(playerSelection1, playerSelection2); //AQUI SE GUARDAN AMBOS TIROS\n\n imprimeGanador(ganadorInfo);\n}", "function inicializartipos(datos) {\n \n let editartiposif = document.getElementById('tipo1informacionpersonaleditar');\n let id;\n let tipo;\n \n datos[0]['idtipodireccionseccional'] ? tipo = \"Dirección Seccional\" : tipo = \"Actividad Economica\";\n\n editartiposif.innerHTML = `\n <option selected=\"true\" disabled=\"disabled\" class=\"noselected\">Seleccione el tipo de ${tipo}</option>`;\n datos.forEach(tipos => {\n tipos['idtipodireccionseccional'] ? id = tipos['idtipodireccionseccional'] : id = tipos['idtipoactividad'];\n editartiposif.innerHTML += `<option value=\"${id}\">${tipos['nombre']}</option>`;\n });\n\n}", "function addProf() {\n var profName = document.getElementById(\"prof-name\").value;\n var profEmail = document.getElementById(\"prof-email\").value;\n var profPhone = document.getElementById(\"prof-tel\").value;\n var profBuilding = document.getElementById(\"prof-building\").value;\n var profRoom = document.getElementById(\"prof-room\").value;\n \n var profDays = [];\n var profDaysList = document.getElementsByClassName(\"prof-days\");\n for(var i = 0; i < profDaysList.length; i++) profDays[i] = profDaysList[i].value;\n var profStart = [];\n var profStartList = document.getElementsByClassName(\"prof-start-times\");\n for(var i = 0; i < profStartList.length; i++) profStart[i] = profStartList[i].value;\n var profEnd = [];\n var profEndList = document.getElementsByClassName(\"prof-end-times\");\n for(var i = 0; i < profEndList.length; i++) profEnd[i] = profEndList[i].value;\n \n var profObject = {\n\tname: profName,\n\temail: profEmail,\n\tphone_number: profPhone,\n\tbuilding: profBuilding,\n\toffice_number: profRoom,\n\toffice_days: profDays.slice(),\n\toffice_begin: profStart.slice(),\n\toffice_end: profEnd.slice()\n };\n \n if(_profList) {\n\tfor(var i = 0; i < _profList.length; i++) {\n if(profName == _profList[i].name) {\n window.alert(\"You already have this professor!\");\n return;\n }\n\t}\n }\n \n _profList.push(profObject);\n saveResources();\n updateUI();\n setupCanvas();\n \n closePopUps(\"add-prof\");\n }", "function cargarCgg_gem_perfil_profCtrls(){\n\t\tif(inRecordCgg_gem_perfil_prof){\n\t\t\tcbxCgnes_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGNES_CODIGO'));\n\t\t\ttxtCgppr_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_CODIGO'));\t\t\t\n\t\t\tcodigoEspecialidad = inRecordCgg_gem_perfil_prof.get('CGESP_CODIGO');\n\t\t\ttxtCgesp_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGESP_NOMBRE'));\n\t\t\tcodigoTitulo = inRecordCgg_gem_perfil_prof.get('CGTPR_CODIGO');\n\t\t\ttxtCgtpr_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGTPR_DESCRIPCION'));\t\t\t\n\t\t\tcbxCgmdc_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGMDC_CODIGO'));\n\t\t\tcodigoPersona = inRecordCgg_gem_perfil_prof.get('CRPER_CODIGO')\n\t\t\ttxtCrper_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CRPER_NOMBRES')+\" \"+inRecordCgg_gem_perfil_prof.get('CRPER_APELLIDO_PATERNO')+\" \"+inRecordCgg_gem_perfil_prof.get('CRPER_APELLIDO_MATERNO'));\t\t\t\n\t\t\tcodigoInstitucion = inRecordCgg_gem_perfil_prof.get('CGIEN_CODIGO');\n\t\t\ttxtCgien_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGIED_NOMBRE'));\t\t\t\n\t\t\tnumCgppr_nivel_aprobado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_NIVEL_APROBADO'));\n\t\t\tdtCgppr_fecha_inicio.setValue((inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_INICIO'))||'');\n\t\t\tdtCgppr_fecha_fin.setValue((inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_FIN'))||'');\n\t\t\tchkCgppr_confirmado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_CONFIRMADO'));\n\t\t\tdtCgppr_fecha_confirmacion.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_CONFIRMACION')||new Date());\n\t\t\tchkCgppr_predeterminado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_PREDETERMINADO'));\n\t\t\tisEdit = true;\n\t\t\t\n\t\t\tif (IN_PERSONA){\n\t\t\t\ttxtCrper_codigo.hidden = true;\n\t\t\t\tbtnCrper_codigoCgg_gem_perfil_prof.hidden=true;\n\t\t\t}else{\n\t\t\t\ttxtCrper_codigo.hidden = false;\n\t\t\t\tbtnCrper_codigoCgg_gem_perfil_prof.hidden=false;\n\t\t\t}\n\t\t\tif (inRecordCgg_gem_perfil_prof.get('CGPPR_NIVEL_APROBADO') > 0)\n {\n chkFormacionParcial.setValue(true);\n numCgppr_nivel_aprobado.enable();\n //numCgppr_nivel_aprobado.enable();\n }\n else\n {\n chkFormacionParcial.setValue(false);\n numCgppr_nivel_aprobado.disable();\n }\t\t\t\n\t}}", "function viewEditPersonSection(event){\n showSection(\"addAffiliate\", true);\n let targetID = event.target.id;\n \n atmWindow.document.getElementById(\"hiddenRowNum\").value = targetID;\n\n var TDs = affilRows_atm[targetID].querySelectorAll(\"td.confluenceTd\");\n var checkTopics = TDs[3].querySelectorAll(\"ul.inline-task-list li.checked\");\n var selectedTopicValues = [];\n for (var q = 0; q < checkTopics.length; q++){\n selectedTopicValues.push(checkTopics[q].innerHTML);\n }\n var topicOptions = atmWindow.document.querySelectorAll(\"#topicCheckList li input\");\n for (var z = 0; z < topicOptions.length; z++){\n let thisOne = topicOptions[z];\n if ( selectedTopicValues.includes(thisOne.value) ){\n thisOne.checked = true;\n }\n }\n atmWindow.document.getElementById(\"addAffiliateForm_SelectOrg\").value = TDs[0].innerHTML\n atmWindow.document.getElementById(\"newAffilName\").value = TDs[1].innerHTML\n atmWindow.document.getElementById(\"newAffilEmail\").value = TDs[2].innerHTML\n }", "function determinarTipoProfesor(profesores) {\n //valor que se utilizará para comparar\n var resultado = 100000;\n //tupla que almacenará la posición más cercana \n var numeroTupla = 0;\n //for que recorre todos los datos como parámetro de la consulta \n //de la tabla profesores\n for (var i = 0; i < profesores.length; i++) {\n //variables utilizadas para determinar los valores finales de\n //cada uno de los valores de la consulta cambiandolos por números\n var generoTupla, autoEvaluacionTupla, disciplinaTupla,\n pcTupla, habWebTupla, expWebTupla = 0;\n \n //se proporciona un número dependiendo del sexo del profesor\n //o si no quiere mostrarlo\n switch(profesores[i].b){\n case \"F\": \n generoTupla = 1;\n break;\n case \"M\": \n generoTupla = 2;\n break;\n case \"NA\": \n generoTupla = 3;\n break;\n }\n //se proporciona un número dependiendo de la autoEvalución del profesor\n //de 1 a 3\n switch(profesores[i].c){\n case \"B\": \n autoEvaluacionTupla = 1;\n break;\n case \"I\": \n autoEvaluacionTupla = 2;\n break;\n case \"A\": \n autoEvaluacionTupla = 3;\n break;\n }\n //se proporciona un número dependiendo de la disciplina del profesor\n //desde 1 a 3\n switch(profesores[i].e){\n case \"DM\": \n disciplinaTupla = 1;\n break;\n case \"ND\": \n disciplinaTupla = 2;\n break;\n case \"o\": \n disciplinaTupla = 3;\n break;\n } \n \n //se proporciona un número dependiendo de las habilidades con la computadora\n //del profesor de 1 a 3\n switch(profesores[i].f){\n case \"L\": \n pcTupla = 1;\n break;\n case \"A\": \n pcTupla = 2;\n break;\n case \"H\": \n pcTupla = 3;\n break;\n }\n \n //se proporciona un número dependiendo de la experiencia \n //utilizando tecnologías web para enseñanza del profesor\n //de 1 a 3\n switch(profesores[i].g){\n case \"N\": \n habWebTupla = 1;\n break;\n case \"S\": \n habWebTupla = 2;\n break;\n case \"O\": \n habWebTupla = 3;\n break;\n }\n \n //se proporciona un número dependiendo de la experiencia \n //del profesor para utilizar páginas web para enseñanza del profesor\n //de 1 a 3\n switch(profesores[i].h){\n case \"N\": \n expWebTupla = 1;\n break;\n case \"S\": \n expWebTupla = 2;\n break;\n case \"O\": \n expWebTupla = 3;\n break;\n } \n //distancia euclidiana aplicada a los valores de las tuplas para definir distancia\n var sumatoria = Math.pow(profesores[i].a - (parseInt(document.getElementById('edad').value)), 2) + Math.pow(generoTupla - (parseInt(document.getElementById('genero').value)), 2) + \n Math.pow(autoEvaluacionTupla - (parseInt(document.getElementById('autoevaluacion').value)), 2) + Math.pow(profesores[i].d - (parseInt(document.getElementById('numeroVeces').value)), 2) +\n Math.pow(disciplinaTupla - (parseInt(document.getElementById('disciplina').value)), 2) + Math.pow(pcTupla - (parseInt(document.getElementById('habilidadPC').value)), 2) +\n Math.pow(habWebTupla - (parseInt(document.getElementById('habilidadWeb').value)), 2) + Math.pow(expWebTupla - (parseInt(document.getElementById('experienciaWeb').value)), 2);\n var distancia = Math.sqrt(sumatoria);\n \n //aquí comparan para mostrar el más cercano al que entra como parámetro\n //comparando los datos de la tupla y los ingresados\n if (resultado > distancia) {\n resultado = distancia;\n numeroTupla = i;\n }\n }\n //salida en pantalla del tipo de profesor\n document.getElementById('mensaje5').innerHTML = 'El profesor es de tipo ' + profesores[numeroTupla].clase + ' en la posición '+profesores[numeroTupla].id+'.';\n}", "function selectProFromTree() {\n\tvar curTreeNode = View.panels.get(\"abWasteRptProByCodeTree1\").lastNodeClicked;\n\tvar proForm=abWasteRptProByCodeController.abWasteRptProByCodeForm;\n\tvar profile = curTreeNode.data['waste_profiles.waste_profile'];\n\tabWasteRptProByCodeController.profile=profile;\n\tvar restriction = new Ab.view.Restriction();\n\t//restriction record which has been clicked apply to details panel\n\trestriction.addClause('waste_profiles.waste_profile', profile);\n\tproForm.refresh(restriction);\n\tvar restriction1 = new Ab.view.Restriction();\n\trestriction1.addClause('waste_profile_reg_codes.waste_profile', profile);\n\tabWasteRptProByCodeController.abWasteRptProByCodeGrid.refresh(restriction1);\n}", "function showProfiles(id, color=['#BFBFBF', '#404040']) {\n document.getElementById(\"top_nav_container\").style.backgroundColor = '#404040'\n document.getElementById(id).style.display = 'block'\n var c = document.getElementById('icon_list').children;\n for(i=0; i < c.length; i++) {\n c[i].children[0].style.backgroundColor = color[0]\n c[i].children[0].style.color = color[1]\n }\n for (i=0; i < navs.length; i++) {\n if (navs[i] != id) {\n document.getElementById(navs[i]).style.display = 'none'\n }\n }\n}", "function checkActive(arr) {\n let rows = container.querySelectorAll(\".table__row\");\n let activeRow;\n for (let row of rows) {\n row.classList.contains(\"table__row_selected\") ? activeRow = row : false;\n }\n let id = activeRow.querySelector(\".id\").textContent;\n let name = activeRow.querySelector(\".name\").textContent;\n let infoBlock = container.querySelector(\".info-block\");\n infoBlock.innerHTML = \"<div><b>Profile info:</b></div>\";\n for (let user of arr) {\n if (id == user.id && name == user.firstName) {\n let userName = document.createElement(\"div\");\n userName.textContent = \"Selected profile: \" + user.firstName + \" \" + user.lastName;\n let userDesc = document.createElement(\"div\");\n userDesc.textContent = \"Description: \" + user.description;\n let userAddress = document.createElement(\"div\");\n userAddress.textContent = \"Address: \" + user.adress.streetAddress;\n let userCity = document.createElement(\"div\");\n userCity.textContent = \"City: \" + user.adress.city;\n let userState = document.createElement(\"div\");\n userState.textContent = \"State: \" + user.adress.state;\n let userZip = document.createElement(\"div\");\n userZip.textContent = \"Index: \" + user.adress.zip;\n\n infoBlock.append(userName);\n infoBlock.append(userDesc);\n infoBlock.append(userAddress);\n infoBlock.append(userCity);\n infoBlock.append(userState);\n infoBlock.append(userZip);\n }\n }\n }", "function abilitarTipoCadastro() {\n var tipoCadastro = document.querySelector(\"#tipoCadastro\");\n \n if(tipoCadastro.selectedIndex == 1) {\n document.querySelector(\"#usuario-juridico\").style.display = \"none\";\n document.querySelector(\"#usuario-pessoa\").style.display = \"block\";\n document.querySelector(\"#abilitar-botoes-envio\").style.display = \"block\";\n }else if(tipoCadastro.selectedIndex == 2) {\n document.querySelector(\"#usuario-pessoa\").style.display = \"none\";\n document.querySelector(\"#usuario-juridico\").style.display = \"block\";\n document.querySelector(\"#abilitar-botoes-envio\").style.display = \"block\";\n }else {\n document.querySelector(\"#abilitar-botoes-envio\").style.display = \"none\";\n document.querySelector(\"#usuario-pessoa\").style.display = \"none\";\n document.querySelector(\"#usuario-juridico\").style.display = \"none\"; \n }\n}", "function comprobarIdioma(){\n\tif (idiomaPrincipal) {\n\t\t// Se selecciona el elemento por defecto\n\t\tif (idiomaPrincipal.toString().length > 0) {\t\t\t\n\t\t\t//$('#lstIdiomaPrincipal option[value='+idiomaPrincipal+']').attr('selected', 'selected');\n\t\t\t//$('#lstIdiomaPrincipal').selectmenu('refresh');\t\t\t\n\t\t\t\n\t\t\t// Actualización del idioma actual y cambio de recursos\n\t\t\t$.localise('js/idiomas', {language: $('#lstIdiomaPrincipal').attr('value'), loadBase: true});\n\t\t\tconsole.log({language: $('#lstIdiomaPrincipal').attr('value'), loadBase: true});\n\t\t\tCargarEtiquetas();\n\t\t}\n\t}\n\t\n\tif (idiomaSecundario){\n\t\t// Se selecciona el idioma secundario guardado en la variable local\n\t\tif (idiomaSecundario.toString().length > 0){\n\t\t\t//$('#lstIdiomaSecundario option[value='+idiomaSecundario+']').attr('selected', 'selected');\n\t\t\t//$('#lstIdiomaSecundario').selectmenu('refresh'); \n\t\t}\n\t}\n}", "function(selection_map){\n\n\t\t// Grab level grids for each family member\n\n\t\tfor (var fam in selection_map){\n\n\t\t\tvar fam_grid = GlobalLevelGrid.getGrid(fam);\n\n\t\t\tfor (var g=0; g < selection_map[fam].length; g++) // gen\n\t\t\t{\n\t\t\t\tfor (var i=0; i < selection_map[fam][g].length; i++) // indiv\n\t\t\t\t{\n\t\t\t\t\tvar indiv = selection_map[fam][g][i];\n\t\t\t\t\tif (indiv.id){}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "constructor(nombre, edad, profesiones = []){\n this.nombre = nombre;\n this.edad = edad;\n this.profesiones = profesiones;\n }", "viewSingleInterviewer(event){\n\t\tevent.preventDefault();\n\t\tthis.getAllProfilesForCurrentInterviewer(event); // remember the this.\n\t}", "function load_personal() \r\n{\r\n $( \"#servidor, [name='servidor'], [name='servidor_edit']\" ).autocomplete({\r\n autoFocus:true,\r\n source: 'controller/puente.php?option=1',\r\n select: function( event, ui ){\r\n $('#servidor_id, [name=\"servidor_id\"], [name=\"servidor_id_edit\"]').val(ui.item.id);\r\n },\r\n delay:0\r\n });\r\n return false;\r\n}", "function builtInProfiles () {\n new Profile('Kevin', '../img/monk.png', 'martial arts', '1F6212', knownArray, interestArray);\n new Profile('Austin', '../img/fighter.png', 'watching movies', '404040', ['Javascript', 'HTML', 'CSS'], ['Python', 'Ruby']);\n new Profile('Zach', '../img/wizzard.png', 'Anime', '49F3FF', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Ramon', '../img/monk.png', 'Racing motorsports', 'FF0000', ['Javascript', 'HTML', 'CSS'], ['Python']);\n new Profile('Sooz', '../img/rogue.png', 'Knitting', 'FF8C00', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Kris', '../img/rogue.png', 'reading', 'B51A1F', ['Javascript', 'Python'], ['Java']);\n new Profile('Judah', '../img/druid.jpg', 'Cooking', '000000', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Allie', '../img/cleric.png', 'Cooking', '29B0FF', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Carl', '../img/wizzard.png', 'Cooking', '0560dd', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Jose', '../img/rogue.png', 'Youtubing', 'af111c', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Michael', '../img/rogue.png', 'Youtubing', '000000', ['Javascript'], ['Javascript']);\n new Profile('Han', '../img/monk.png', 'Coding', '29B0FF', ['Javascript', 'HTML', 'CSS', 'Python', 'Java'], ['C++']);\n}", "function selectList(op){\n listSelected = op.getAttribute(\"id\");\n}", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount');\n const profiles = await util.getProfilesByUserAccount(userId);\n\n await profiles.forEach(createProfileElement);\n}", "function toogleSelectionDiv(selection) {\r\n\tif (selection == \"M\") {\t\t\r\n\t\tif (document.getElementById(\"noOfUser2\")) {\r\n\t\t\tdocument.getElementById(\"noOfUser2\").value = \"\";\r\n\t\t}\t\t\r\n\t\tdocument.getElementById(\"fileUploadDiv\").style.display = \"none\";\r\n\t\tdocument.getElementById(\"manualEntry\").innerHTML = \"block\";\r\n\t\tdocument.getElementById(\"inputNoOFUser\").style.display = \"block\";\t\t\r\n\t\tif (document.getElementById(\"noOfUser2\")) {\r\n\t\t\tdocument.getElementById(\"noOfUser2\").style.display = \"none\";\r\n\t\t}\r\n\t\temailIdCSVString = \"\";\r\n\t\tdocument.getElementById(\"inputNoOFUser\").value = \"\";\r\n\t\tdocument.getElementById(\"noOfUserLabelId\").innerHTML = \"Number of Users:\";\r\n\t} else {\r\n\t\tif (document.getElementById(\"noOfUser2\")) {\r\n\t\t\tdocument.getElementById(\"noOfUser2\").value = \"\";\r\n\t\t}\r\n\t\tdocument.getElementById(\"manualEntry\").style.display = \"none\";\r\n\t\tdocument.getElementById(\"fileUploadDiv\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"inputNoOFUser\").style.display = \"none\";\t\t\r\n\t\tif (document.getElementById(\"noOfUser2\")) {\r\n\t\t\tdocument.getElementById(\"noOfUser2\").style.display = \"block\";\r\n\t\t}\r\n\t\tdocument.getElementById(\"noOfUserLabelId\").innerHTML = \"\";\r\n\t}\r\n}", "function elegirp(){\n var activeUser = JSON.parse(sessionStorage.getItem('usuario'));\n\n document.getElementById(\"usertypeheading\").innerHTML = activeUser[0].tipo;\n\n document.getElementById(\n \"usernametxt\"\n ).innerText = `${activeUser[0].nombre} ${activeUser[0].apellido}`;\n\n let navitems = [];\n\n switch (activeUser[0].tipo) {\n case \"operador\":\n navitems = document.getElementsByClassName(\"op\");\n break;\n case \"administrador\":\n navitems = document.getElementsByClassName(\"admin\");\n break;\n case \"superusuario\":\n navitems = document.getElementsByClassName(\"su\");\n break;\n }\n\n for (let i = 0; i < navitems.length; i++) {\n navitems[i].style.display = \"list-item\";\n }\n}", "function unhighlightUsers(roomCode) {\r\n\tlet players = Object.keys(roomState[roomCode]['players']);\r\n\tfor (let i = 0; i < players.length; i++) {\r\n\t\tlet toHighlight = document.getElementById(players[i]);\r\n\t\ttoHighlight.style.color = \"black\";\r\n\t}\r\n}", "function getProfesor(data, dataL) {\n clearDOM();\n\n const poDanu = { pon: [], uto: [], sri: [], cet: [], pet: [] };\n\n data.forEach((profesor, j) => {\n if (j === 0) return;\n\n if (\n profesor[0]\n .toUpperCase()\n .replace(/ /g, \"\")\n .indexOf(input.replace(/ /g, \"\")) !== -1\n ) {\n for (let i = 1; i < profesor.length; i++) {\n const sat = profesor[i];\n if (typeof sat === \"object\" && sat.dan) {\n poDanu[sat.dan].push(sat);\n }\n }\n }\n });\n\n Object.keys(poDanu).forEach((dan) => {\n const sati = poDanu[dan];\n let text = \"\";\n\n sati.forEach((celija) => {\n text += `\n <th>${celija.sat}.sat (${celija.trajanje})</th>\n </tr>\n <tr>\n <td>\n <p class='inline' style='${returnStyle(celija)}'>${celija.name}</p>\n </td>\n </tr>`;\n });\n\n document.getElementById(dan).innerHTML = text;\n });\n\n finalTouch(data[0]);\n }", "function populateUI() {\n const selectedSeats = JSON.parse(localStorage.getItem('selectedSeats')); //agrega los datos de array u objeto\n\n if(selectedSeats !== null && selectedSeats.length > 0) {//primero checkeamos si la variable esta declarada ene local storage y luego chekeamos si es un array vacio\n seats.forEach((seat, index) => {\n if(selectedSeats.indexOf(index) > -1) {//si checkeamos con indexOf y no esta el valor que buscamos devuelve -1\n seat.classList.add('selected');\n }\n });\n }\n\n const selectedMovieIndex = localStorage.getItem('selectedMovieIndex');\n \n if(selectedMovieIndex !== null) {\n movieSelect.selectedIndex = selectedMovieIndex;\n }\n}", "function genderSelect(e){\n\tvar checkId = e.slice(5);\n\tvar genderValue = gender[checkId];\n\tif ($('#'+e).is(\":checked\")==false){\n\n\t\tfor(let person of members){\n\t\t\tif(person.gender == genderValue){\n\t\t\t\tlet tempId = person.memberId;\n\t\t\t\t$(\"#card\"+tempId).remove();\n\t\t\t}\n\t\t}\t\n\t}else{\n\t\tfor(let person of members){\n\t\t\tif(person.gender == genderValue){\n\t\t\t\toverviewCardBuilder(person);\n\t\t\t}\n\t\t}\n\t}\n}", "getProfileId() {\n return this.person_id;\n }", "function selectID(belly) {\r\n return belly.id == userSelection;\r\n }", "function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}", "lb(){\n this.props.setProps('select',this.props.state.user.hunts_id);\n this.props.changePage('leaderboard');\n }", "selectId() {\n return this.id ? this.id : this._uid; // eslint-disable-line no-underscore-dangle\n }", "function devolver_campos_de_lista(map,id_male,id_female){\n\tconsole.log('ejecutando: devolver campos de lista');\n\tconsole.log(map);\n\t$('tbody td a.id_click').on('click',function(e){\n\t\tconsole.log('estoy aqui');\n\t\te.preventDefault();\n\t\t$(\"#id_buscar_mujeres\").modal('hide'); \n\t\t$(\"#id_buscar_hombres\").modal('hide');\n\t\tvar id = $(this).parents('tr').attr('id');\n\t\tconsole.log('id: ' + id);\n\t\tvar objeto = map[id];\n\t\tconsole.log('objeto: ' + objeto);\n\t\tif(objeto.sexo =='m'){\n\t\t\t$(id_male+' option').remove();\n\t\t\t$(id_male).append('<option value=\"\"> -- Seleccione --</option><option value='+objeto.id+' selected>'+ objeto.full_name+'</option>');\n\t\t\tlimpiar_campos('#id_query_nombres, #id_query_apellidos','#id_query_cedula');\n\t\t\tlimpiar_campos('#id_query_nombres_h, #id_query_apellidos_h','#id_query_cedula_h');\n\t\t\tlimpiar_campos('#id_query_nombres_m, #id_query_apellidos_m','#id_query_cedula_m');\n\t\t\tocultar_tablas('#id_table_busqueda_usuarios','#id_button_cedula','#id_button_nombres','#id_div_form_buscar');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_hombres','#id_button_cedula_h','#id_button_nombres_h','#id_div_form_buscar_h');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_mujeres','#id_button_cedula_m','#id_button_nombres_m','#id_div_form_buscar_m');\n\t\t\tocultar_bottom('.bottom');\n\n\t\t} \n\t\tif (objeto.sexo =='f') {\n\t\t\t$(id_female+' option').remove();\n\t\t\t$(id_female).append('<option value=\"\"> -- Seleccione --</option><option value='+objeto.id+' selected>'+ objeto.full_name+'</option>');\n\t\t\tlimpiar_campos('#id_query_nombres, #id_query_apellidos','#id_query_cedula');\n\t\t\tlimpiar_campos('#id_query_nombres_h, #id_query_apellidos_h','#id_query_cedula_h');\n\t\t\tlimpiar_campos('#id_query_nombres_m, #id_query_apellidos_m','#id_query_cedula_m');\n\t\t\tocultar_tablas('#id_table_busqueda_usuarios','#id_button_cedula','#id_button_nombres','#id_div_form_buscar');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_hombres','#id_button_cedula_h','#id_button_nombres_h','#id_div_form_buscar_h');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_mujeres','#id_button_cedula_m','#id_button_nombres_m','#id_div_form_buscar_m');\n\t\t\tocultar_bottom('.bottom');\n\n\t\t}\n\t});\n}", "function selectIdentifierSignature() {\n selectedIdSignature = this.id;\n idFilter.value = selectedIdSignature;\n selectButton.removeAttribute('disabled');\n}", "function intName() {\n numEquipos = document.getElementById(\"numEquipos\");\n numPersonas = document.getElementById(\"numPersonas\");\n\n if(parseInt(numEquipos.value) <= 0) {\n alert(\"Asegurate de crear al menos un equipo.\");\n return;\n }\n\n if(parseInt(numPersonas.value) <= 0) {\n alert(\"Asegurate de registrar al menos una persona.\");\n return;\n }\n\n // Ocultar página inicial\n var main = document.getElementsByClassName(\"main\");\n main[0].setAttribute(\"class\" , \"main hidden\");\n main[1].setAttribute(\"class\" , \"main hidden\");\n\n // Cargar página de nombre del integrante\n var name = document.getElementsByClassName(\"name\");\n name[0].setAttribute(\"class\" , \"name\");\n\n document.getElementById(\"numIntegrante\").innerHTML = \"Integrante \" + currIntegrante;\n\n for(var i = 0; i < parseInt(numPersonas.value); i++) {\n resIntegrante[i] = [\"\", 0, 0, 0, 0, 0, 0, 0, 0];\n roles[i] = [\"\", 0, false];\n }\n}", "function loadProfiles() {\n\n\t$.get(\"php/profiles.php\", function(data) {\n\n\t\t$(\"#profile-container\").html(data);\n\n\t\t$(\".button-edit-profile\").click(function() {\n\t\t\tvar profile = $(this).parents('.profile');\n\t\t\tprofile.children(\".edit\").toggle();\n\t\t\tprofile.children(\".view\").toggle();\n\t\t});\n\n\t\t$(\".button-cancel-profile\").click(function() {\n\t\t\tvar profile = $(this).parents('.profile');\n\t\t\tprofile.children(\".edit\").toggle();\n\t\t\tprofile.children(\".view\").toggle();\n\t\t});\n\n\t\t$(\".button-delete-profile\").click(function() {\n\n\t\t\tevent.preventDefault();\n\n\t\t\t\tvar profile = $(this).parents('.profile');\n\t\t\t\tvar result = confirm(\"Are You Sure Want to Delete This Profile And All Associated Infos?\");\n\t\t\t\tif(result) {\n\n\t\t\t\t\tvar id = profile.data('id');\n\n\t\t\t\t\t$.post('php/deleteprofile.php', { id: id }, function(data) {\n\t\t\t\t\t\tprofile.remove();\n\t\t\t\t\t\t$(\".alert-success span.message\").html(data);\n\t\t\t\t\t\t$(\".alert-success\").toggle();\n\n\t\t\t\t\t}).fail( function(data) {\n\t\t\t\t\t\t$(\".alert-danger span.message\").html(data);\n\t\t\t\t\t\t$(\".alert-danger\").toggle();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t});\n\n\t\t$(\".profile .edit\").submit(function() {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tvar form = $(this);\n\t\t\tvar info = $(this).parents('.info');\n\t\t\tvar view = info.children(\".view\");\n\n\t\t\tvar formData = form.serialize();\n\n\t\t\t$.post('php/updateprofile.php', formData, function(data){\n\n\t\t\t\tloadProfiles();\n\t\t\t\tload_infos(selectedID);\n\n\t\t\t\t$(\".alert-success span.message\").html(data);\n\t\t\t\t$(\".alert-success\").toggle();\n\n\t\t\t}).fail( function(data) {\n\t\t\t\t$(\".alert-danger span.message\").html(data);\n\t\t\t\t$(\".alert-danger\").toggle();\n\t\t\t}).done( function() {\n\t\t\t\tform.toggle();\n\t\t\t\tview.toggle();\n\t\t\t});\n\t\t});\n\n\t\t$(\".profile .view\").click( function() {\n\n\n\n\t\t\tvar profile = $(this).parents(\".profile\");\n\t\t\tvar id = profile.data(\"id\");\n\n\t\t\tselectedID = id;\n\n\t\t\tload_infos(id);\n\n\t\t\t$(\".profile.selected\").removeClass(\"selected\");\n\t\t\tprofile.addClass(\"selected\");\n\n\t\t});\n\n\t});\n}", "function idMateria() {\n const materiaId = document.getElementById(\"materias\").value;\n document.getElementById(\"materiaId\").value = materiaId;\n}", "function myLoad() {\n let htmlSelect = document.getElementById(\"test\");\n htmlSelect.style.visibility = \"hidden\";\n\n if (sessionStorage.getItem(\"hasCodeRunBefore\") === null) {\n // let arrayOfPersonObjects = [];\n sessionStorage.setItem(\"persons\", JSON.stringify(pers));\n sessionStorage.setItem(\"hasCodeRunBefore\", true);\n } else {\n pers = JSON.parse(sessionStorage.getItem(\"persons\"));//Get the array of person objects from sessionStorage and assign it to the array 'pers'\n let i = 0;\n pers.forEach(function(p) {//Loop through each person (p) in the pers array\n /*For each person in the array create an option element that displays \n that person's name and add it to the select (dropdown) element on the HTML page */\n let optItem = document.createElement(\"option\");\n optItem.innerHTML = p.name.first;\n optItem.value = i;\n i = i + 1;\n htmlSelect.appendChild(optItem);\n });\n if (i > 0) {//Only make the select element visible once there is at least one person object added that the user can select.\n htmlSelect.style.visibility = \"visible\";\n }\n }\n}", "function comprobarSeleccionMultipleNuevaCita(id){\n\t\n\t//multipleCreando\n \t\t\n \t\t\n \tif( !$('#'+id).find('input').prop('checked') ) {\t \n\t\t\t\tid = id.slice(15);\n\t\t\t\tvar valorSelect = $(\"#otrosUsuarios\").val();\n\t\t\t\n\t\t\t\tvalorSelect = jQuery.grep(valorSelect, function(value) {\n\t\t\t\t return value != id;\n\t\t\t\t});\n\t\t\n\t\t\t\t$(\"#otrosUsuarios\").val(valorSelect);\n\t\n\t\t} \t\t\n \t\t\n\t\n\n\t\n\t\n}", "function onUsrChange() {\n\tvar selectedName = document.getElementById(\"nameListSelect\").value;\n\tvar participatedUsr = JSON.parse(localStorage.getItem(\"already_participated\"));\n\tif (!participatedUsr) {\n\t\tparticipatedUsr = [];\n\t}\n\tif (participatedUsr.indexOf(selectedName) !== -1) {\n\t\talert(\"This User already participated in the Game!!! Please select diffrent user.\")\n\t}\n}", "function pickUpThings(objeto){\n \n quitaConsumible(objeto);\n mapaCargado.cogeConsumible(objeto);\n if(objeto.getId()==1)\n guardarEstado(idMapaAct);\n $('#valorArm').html(mapaCargado.personaje.getFuerza());\n $('#valorDef').html(mapaCargado.personaje.getVida());\n $('.valorLlave').html(mapaCargado.personaje.tieneLLave());\n\n refrescaInv()\n \n $('#barras').empty();\n barraProgreso();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n actualizaCanvas(mapaCargado,mapaCargado.mazmorraActual.idMazmorra);\n //console.log(mapaCargado.personaje.inventario)\n //refrescaInv();\n \n}", "function selectPeople() {\n let min = 1;\n let max = peopleSelectionRanges[peopleSelectionRanges.length-1].max;\n let selectedNum = game.math.between(min, max);\n\n let character = peopleSelectionRanges.find(x => x.min <= selectedNum && x.max >= selectedNum);\n\n return character.personTypeId;\n}", "function getIndice(){\n var i = 1;\n $('.utilisateur_profil_update').each(function() {\n $(this).attr('data-indice', i);\n $(this).find('.number_title').text(i);\n i++;\n });\n}", "function ProfileSelector(props) {\n var value = props.value,\n options = props.options,\n onChange = props.onChange,\n onContinue = props.onContinue,\n onClose = props.onClose;\n return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, null, /*#__PURE__*/react_default.a.createElement(Dialog_DialogContent, {\n minHeight: \"200px\"\n }, /*#__PURE__*/react_default.a.createElement(src[\"u\" /* Text */], {\n typography: \"h6\",\n mb: \"3\",\n caps: true,\n color: \"primary.contrastText\"\n }, \"Select Profile\"), /*#__PURE__*/react_default.a.createElement(RadioGroup, {\n options: options,\n selected: value,\n onChange: onChange\n })), /*#__PURE__*/react_default.a.createElement(Dialog_DialogFooter, null, /*#__PURE__*/react_default.a.createElement(src[\"f\" /* ButtonPrimary */], {\n mr: \"3\",\n onClick: onContinue\n }, \"Continue\"), /*#__PURE__*/react_default.a.createElement(src[\"g\" /* ButtonSecondary */], {\n onClick: onClose\n }, \"Cancel\")));\n}" ]
[ "0.6064636", "0.60621566", "0.59223", "0.5720054", "0.56902635", "0.56639564", "0.5613323", "0.5545179", "0.54886925", "0.5431871", "0.541561", "0.53976136", "0.53420305", "0.53412485", "0.5293167", "0.52687836", "0.52687603", "0.52671254", "0.52492315", "0.5180147", "0.51745373", "0.51422167", "0.51254547", "0.5115581", "0.5104436", "0.50799036", "0.5077663", "0.5061312", "0.50513047", "0.5044361", "0.5042929", "0.50399154", "0.5026782", "0.5025699", "0.5023545", "0.5004293", "0.49950293", "0.49805832", "0.49784008", "0.49784008", "0.4959777", "0.49493596", "0.49423757", "0.49338415", "0.49268463", "0.49193558", "0.49096966", "0.49053466", "0.4900527", "0.48847064", "0.48628646", "0.48595214", "0.48568997", "0.48562473", "0.4850642", "0.4846774", "0.48428145", "0.48406103", "0.4837609", "0.4836138", "0.48344475", "0.48309058", "0.48288062", "0.48248696", "0.48192912", "0.48160964", "0.48159623", "0.48140633", "0.4813398", "0.48106027", "0.48026302", "0.48013943", "0.47981787", "0.47939375", "0.47808632", "0.47773626", "0.47740623", "0.47723392", "0.47673658", "0.47667557", "0.47639036", "0.47627756", "0.47626355", "0.4760694", "0.47523406", "0.4748829", "0.47486633", "0.47477567", "0.47468138", "0.47460777", "0.47449663", "0.47432405", "0.4743125", "0.47368205", "0.4735877", "0.473515", "0.47344047", "0.47326013", "0.47322065", "0.47281218", "0.47220403" ]
0.0
-1
muestra chequeados los profesores ya asignados
function mostrarSedesCarrera() { let carreraSelect = this.dataset.codigo; let carrera = buscarCarreraPorCodigo(carreraSelect); let listaCursos = getListaCursos(); let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]'); let codigosCursos = []; for (let i = 0; i < carrera[7].length; i++) { codigosCursos.push(carrera[7][i]); } for (let j = 0; j < listaCursos.length; j++) { for (let k = 0; k < codigosCursos.length; k++) { if (listaCursos[j][0] == codigosCursos[k]) { listaCheckboxCursos[j].checked = true; } } } verificarCheckCarreras(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function imprimirProfesiones(persona) {\n console.log(`${persona.nombre} es:`)\n if(persona.ingeniero) {\n console.log(`Ingeniero`);\n }\n else{\n console.log('No es ingeniero');\n }\n if(persona.cantante){\n console.log('Cantante');\n }\n else{\n console.log('No es cantante');\n }\n if(persona.cocinero){\n console.log('Cocinero');\n }\n else{\n console.log('No es cocinero');\n }\n if(persona.deportista){\n console.log('Deportista');\n }\n else{\n console.log('No es deportista');\n }\n if(persona.dj){\n console.log('Dj');\n }\n else{\n console.log('No es dj');\n }\n if(persona.guitarista){\n console.log('Guitarrista');\n }\n else{\n console.log('No es guitarrista');\n }\n}", "function imprimirProfesiones(persona) {\n // primeramente le pedimos que nos muestre\n // por consola el nombre de la persons\n // con template string que nos permie interpolar-\n // variables\n console.log(`${persona.nombre} es:`);\n\n // con esta condicional imprimimos las profesiones-\n // que cumplan la condicion de true\n if (persona.ingeniero) {\n // este console se imprime si la condicion es true\n console.log(\"Ingeniero\");\n } else {\n // si no es true imprime este mensaje\n console.log(\"No es ingeniero\");\n }\n // las variables si se declaran en minusculas-\n // asi mismo se deben llamar\n // example cocinero === Cosinero retorna false\n if (persona.cocinero) {\n console.log(\"Cocinero\");\n }\n\n if (persona.dj) {\n console.log(\"DJ\");\n }\n\n if (persona.cantante) {\n console.log(\"Cantante\");\n }\n\n if (persona.guitarrista) {\n console.log(\"Gutiarrista\");\n }\n\n if (persona.drone) {\n console.log(\"Piloto de drone\");\n }\n}", "function selectProfile(prof){\n\n\tvar profHandle = $(prof).parent('.mainListItem').find('p.profhandle').text();\n\n\t//Check if profile is in the selectedProfs array\n\tif(selectedProfs.includes(profHandle)){\n\t\t//If in array, remove, re-enab;e hover and change color back to dark\n\t\tselectedProfs.splice(selectedProfs.indexOf(profHandle), 1);\n\t\tupdateJSON();\n\t\tenableHover(prof);\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#444444\"}, 100);\n\t}else{\n\t\t//If not in array, add to array, remove hover events and make item green\n\t\tselectedProfs.push(profHandle);\n\t\tupdateJSON();\n\t\t$(prof).parent('.mainListItem').unbind('mouseenter mouseleave');\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#417f50\"}, 100);\n\t\n\t}\n\n}", "function determinarTipoProfesor(profesores) {\n //valor que se utilizará para comparar\n var resultado = 100000;\n //tupla que almacenará la posición más cercana \n var numeroTupla = 0;\n //for que recorre todos los datos como parámetro de la consulta \n //de la tabla profesores\n for (var i = 0; i < profesores.length; i++) {\n //variables utilizadas para determinar los valores finales de\n //cada uno de los valores de la consulta cambiandolos por números\n var generoTupla, autoEvaluacionTupla, disciplinaTupla,\n pcTupla, habWebTupla, expWebTupla = 0;\n \n //se proporciona un número dependiendo del sexo del profesor\n //o si no quiere mostrarlo\n switch(profesores[i].b){\n case \"F\": \n generoTupla = 1;\n break;\n case \"M\": \n generoTupla = 2;\n break;\n case \"NA\": \n generoTupla = 3;\n break;\n }\n //se proporciona un número dependiendo de la autoEvalución del profesor\n //de 1 a 3\n switch(profesores[i].c){\n case \"B\": \n autoEvaluacionTupla = 1;\n break;\n case \"I\": \n autoEvaluacionTupla = 2;\n break;\n case \"A\": \n autoEvaluacionTupla = 3;\n break;\n }\n //se proporciona un número dependiendo de la disciplina del profesor\n //desde 1 a 3\n switch(profesores[i].e){\n case \"DM\": \n disciplinaTupla = 1;\n break;\n case \"ND\": \n disciplinaTupla = 2;\n break;\n case \"o\": \n disciplinaTupla = 3;\n break;\n } \n \n //se proporciona un número dependiendo de las habilidades con la computadora\n //del profesor de 1 a 3\n switch(profesores[i].f){\n case \"L\": \n pcTupla = 1;\n break;\n case \"A\": \n pcTupla = 2;\n break;\n case \"H\": \n pcTupla = 3;\n break;\n }\n \n //se proporciona un número dependiendo de la experiencia \n //utilizando tecnologías web para enseñanza del profesor\n //de 1 a 3\n switch(profesores[i].g){\n case \"N\": \n habWebTupla = 1;\n break;\n case \"S\": \n habWebTupla = 2;\n break;\n case \"O\": \n habWebTupla = 3;\n break;\n }\n \n //se proporciona un número dependiendo de la experiencia \n //del profesor para utilizar páginas web para enseñanza del profesor\n //de 1 a 3\n switch(profesores[i].h){\n case \"N\": \n expWebTupla = 1;\n break;\n case \"S\": \n expWebTupla = 2;\n break;\n case \"O\": \n expWebTupla = 3;\n break;\n } \n //distancia euclidiana aplicada a los valores de las tuplas para definir distancia\n var sumatoria = Math.pow(profesores[i].a - (parseInt(document.getElementById('edad').value)), 2) + Math.pow(generoTupla - (parseInt(document.getElementById('genero').value)), 2) + \n Math.pow(autoEvaluacionTupla - (parseInt(document.getElementById('autoevaluacion').value)), 2) + Math.pow(profesores[i].d - (parseInt(document.getElementById('numeroVeces').value)), 2) +\n Math.pow(disciplinaTupla - (parseInt(document.getElementById('disciplina').value)), 2) + Math.pow(pcTupla - (parseInt(document.getElementById('habilidadPC').value)), 2) +\n Math.pow(habWebTupla - (parseInt(document.getElementById('habilidadWeb').value)), 2) + Math.pow(expWebTupla - (parseInt(document.getElementById('experienciaWeb').value)), 2);\n var distancia = Math.sqrt(sumatoria);\n \n //aquí comparan para mostrar el más cercano al que entra como parámetro\n //comparando los datos de la tupla y los ingresados\n if (resultado > distancia) {\n resultado = distancia;\n numeroTupla = i;\n }\n }\n //salida en pantalla del tipo de profesor\n document.getElementById('mensaje5').innerHTML = 'El profesor es de tipo ' + profesores[numeroTupla].clase + ' en la posición '+profesores[numeroTupla].id+'.';\n}", "function cargarCgg_gem_perfil_profCtrls(){\n\t\tif(inRecordCgg_gem_perfil_prof){\n\t\t\tcbxCgnes_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGNES_CODIGO'));\n\t\t\ttxtCgppr_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_CODIGO'));\t\t\t\n\t\t\tcodigoEspecialidad = inRecordCgg_gem_perfil_prof.get('CGESP_CODIGO');\n\t\t\ttxtCgesp_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGESP_NOMBRE'));\n\t\t\tcodigoTitulo = inRecordCgg_gem_perfil_prof.get('CGTPR_CODIGO');\n\t\t\ttxtCgtpr_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGTPR_DESCRIPCION'));\t\t\t\n\t\t\tcbxCgmdc_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGMDC_CODIGO'));\n\t\t\tcodigoPersona = inRecordCgg_gem_perfil_prof.get('CRPER_CODIGO')\n\t\t\ttxtCrper_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CRPER_NOMBRES')+\" \"+inRecordCgg_gem_perfil_prof.get('CRPER_APELLIDO_PATERNO')+\" \"+inRecordCgg_gem_perfil_prof.get('CRPER_APELLIDO_MATERNO'));\t\t\t\n\t\t\tcodigoInstitucion = inRecordCgg_gem_perfil_prof.get('CGIEN_CODIGO');\n\t\t\ttxtCgien_codigo.setValue(inRecordCgg_gem_perfil_prof.get('CGIED_NOMBRE'));\t\t\t\n\t\t\tnumCgppr_nivel_aprobado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_NIVEL_APROBADO'));\n\t\t\tdtCgppr_fecha_inicio.setValue((inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_INICIO'))||'');\n\t\t\tdtCgppr_fecha_fin.setValue((inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_FIN'))||'');\n\t\t\tchkCgppr_confirmado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_CONFIRMADO'));\n\t\t\tdtCgppr_fecha_confirmacion.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_FECHA_CONFIRMACION')||new Date());\n\t\t\tchkCgppr_predeterminado.setValue(inRecordCgg_gem_perfil_prof.get('CGPPR_PREDETERMINADO'));\n\t\t\tisEdit = true;\n\t\t\t\n\t\t\tif (IN_PERSONA){\n\t\t\t\ttxtCrper_codigo.hidden = true;\n\t\t\t\tbtnCrper_codigoCgg_gem_perfil_prof.hidden=true;\n\t\t\t}else{\n\t\t\t\ttxtCrper_codigo.hidden = false;\n\t\t\t\tbtnCrper_codigoCgg_gem_perfil_prof.hidden=false;\n\t\t\t}\n\t\t\tif (inRecordCgg_gem_perfil_prof.get('CGPPR_NIVEL_APROBADO') > 0)\n {\n chkFormacionParcial.setValue(true);\n numCgppr_nivel_aprobado.enable();\n //numCgppr_nivel_aprobado.enable();\n }\n else\n {\n chkFormacionParcial.setValue(false);\n numCgppr_nivel_aprobado.disable();\n }\t\t\t\n\t}}", "function fLlenarProfesoresRegistro(){\n //hacemos un for que recorra el array profesores (que guarda los objetos de cada profesor) y liste sus nombres en <option></option> que se añadirán al html\n let opciones = `<option hidden value=\"elegir\">Elegir profesor</option>`; //string que guardará todas las opciones de profesor, valor inicial dice \"Elegir profesor\"\n for (i=0; i < profesores.length; i++)\n {\n opciones += `<option value=\"${profesores[i].id}\">${profesores[i].nombre}</option>`;\n }\n return opciones;\n}", "static async getProfesoresForIc(idIc, idanio_lectivo) {\n\n //cursos para inspector de curso\n //let cursos = await db.query('SELECT idcurso FROM curso WHERE user_iduser = ? AND cur_estado = 1', [idIc]);\n let cursos = await Curso.getCursosForIc(idIc, idanio_lectivo);\n //Consulta para obtener las materias, cursos y profesores\n\n var sql = [];\n if (cursos.length > 0) {\n for (let index = 0; index < cursos.length; index++) {\n let mhc = await db.query(`\n SELECT \n idfuncionario,\n idmaterias_has_curso,\n profesor_idprofesor,\n fun_nombres,\n idmaterias,\n mat_nombre,\n cur_curso,\n idcurso\n FROM materias_has_curso\n INNER JOIN funcionario on funcionario.idfuncionario = materias_has_curso.profesor_idprofesor\n INNER JOIN materias on materias.idmaterias = materias_has_curso.materias_idmaterias\n INNER JOIN curso on curso.idcurso = materias_has_curso.curso_idcurso\n WHERE materias_has_curso.curso_idcurso = ?\n AND mat_has_cur_estado = 1 \n AND mat_has_curso_idanio_lectivo = ?\n `, [cursos[index].idcurso, idanio_lectivo]);\n\n if (mhc.length > 0) {\n mhc.forEach(element => {\n sql.push(element);\n });\n }\n }\n }\n\n return sql\n //return cursos\n }", "async function filtrarProvisorio(solicitudAdopciones, sexo, tamañoFinal, tipoMascota, usuario) {\n \n let animales = [] \n let desde = solicitudAdopciones.length\n // if (solicitudAdopciones.length == undefined )\n // {\n // let filterProv = filter\n // console.log(filterProv)\n // filterProv._id = mongosee.Types.ObjectId(solicitudAdopciones.mascotaId)\n // console.log(filterProv)\n // desde = 0 \n // let animal = await Animal.find(filterProv)\n // if (!animal) return animales\n // if (usuario.tipoUsuario != 1 && usuario.Direccion.barrio != barrioNew && barrioNew) return animales\n // animales.push(animal)\n // }\n \n for (let i = 0 ; i < desde ; i ++ ){\n \n \n let animal = await Animal.findById(solicitudAdopciones[i].mascotaId)\n if(sexo && sexo != animal.sexo) continue\n if(tamañoFinal && tamañoFinal != animal.tamañoFinal) continue\n if(tipoMascota && tipoMascota != animal.tipoMascota) continue\n // if (usuario.tipoUsuario != 1 && usuario.Direccion.barrio != barrioNew && barrioNew) continue\n \n \n // console.log(\"entro al for\", filterProv)\n // if (!animal) continue\n // console.log(\"animales\")\n // if (usuario.tipoUsuario != 1 && usuario.Direccion.barrio != barrioNew && barrioNew) continue\n animales.push(animal)\n \n }\n return (animales)\n }", "function CorrigePericias() {\n for (var chave in tabelas_pericias) {\n var achou = false;\n for (var i = 0; i < gEntradas.pericias.length; ++i) {\n var entrada_pericia = gEntradas.pericias[i];\n if (entrada_pericia.chave == chave) {\n achou = true;\n break;\n }\n }\n if (!achou) {\n gEntradas.pericias.push({ 'chave': chave, pontos: 0 });\n }\n }\n}", "function findProfiles() {}", "function _DependenciasProficienciaArmas() {\n var todas_simples = false;\n var todas_comuns = false;\n gPersonagem.proficiencia_armas = {};\n for (var i = 0; i < gPersonagem.classes.length; ++i) {\n var chave_classe = gPersonagem.classes[i].classe;\n var tabela_classe = tabelas_classes[chave_classe];\n var armas_classe = tabela_classe.proficiencia_armas || [];\n for (var j = 0; j < armas_classe.length; ++j) {\n gPersonagem.proficiencia_armas[armas_classe[j]] = true;\n if (armas_classe[j] == 'arco_curto' || armas_classe[j] == 'arco_longo') {\n for (var arma_tabela in tabelas_armas_comuns) {\n if (arma_tabela.indexOf(armas_classe[j]) == 0) {\n gPersonagem.proficiencia_armas[arma_tabela] = true;\n } \n }\n }\n }\n // TODO usar a nova funcao de PersonagemProficienteTipoArma.\n var talentos_classe = tabela_classe.talentos || [];\n for (var j = 0; j < talentos_classe.length; ++j) {\n if (talentos_classe[j] == 'usar_armas_simples') {\n todas_simples = true;\n } else if (talentos_classe[j] == 'usar_armas_comuns') {\n todas_comuns = true;\n }\n }\n }\n gPersonagem.proficiencia_armas['desarmado'] = true;\n gPersonagem.proficiencia_armas['manopla'] = true;\n if (todas_simples) {\n for (var arma in tabelas_armas_simples) {\n gPersonagem.proficiencia_armas[arma] = true;\n }\n }\n if (todas_comuns) {\n for (var arma in tabelas_armas_comuns) {\n gPersonagem.proficiencia_armas[arma] = true;\n }\n // Familiaridade.\n for (var arma in tabelas_raca[gPersonagem.raca].familiaridade_arma) {\n gPersonagem.proficiencia_armas[arma] = true;\n }\n }\n // Raciais.\n var armas_raca = tabelas_raca[gPersonagem.raca].proficiencia_armas;\n for (var i = 0; armas_raca != null && i < armas_raca.length; ++i) {\n gPersonagem.proficiencia_armas[armas_raca[i]] = true;\n }\n\n // Talentos. Preciso obter o nome da chave na tabela de armas.\n for (var chave_classe in gPersonagem.talentos) {\n var lista_classe = gPersonagem.talentos[chave_classe];\n for (var i = 0; i < lista_classe.length; ++i) {\n var talento = lista_classe[i];\n if ((talento.chave == 'usar_arma_comum' ||\n talento.chave == 'usar_arma_exotica') &&\n (talento.complemento != null) &&\n talento.complemento.length > 0) {\n var chave_arma = tabelas_armas_invertida[talento.complemento];\n // TODO remover essa verificacao quando o input dos talentos estiver\n // terminado.\n if (chave_arma == null) {\n Mensagem(Traduz('Arma') + ' \"' + talento.complemento + '\" ' + Traduz('inválida para talento') + ' \"' +\n Traduz(tabelas_talentos[talento.chave].nome) + '\"');\n continue;\n }\n var arma_tabela = tabelas_armas[chave_arma];\n if (arma_tabela.talento_relacionado != talento.chave) {\n // verifica familiaridade.\n var familiar = false;\n if (arma_tabela.talento_relacionado == 'usar_arma_exotica' &&\n tabelas_raca[gPersonagem.raca].familiaridade_arma &&\n tabelas_raca[gPersonagem.raca].familiaridade_arma[chave_arma] &&\n talento.chave == 'usar_arma_comum') {\n familiar = true;\n }\n if (!familiar) {\n Mensagem(Traduz('Arma') + ' \"' + talento.complemento + '\" ' + Traduz('inválida para talento') + ' \"' +\n Traduz(tabelas_talentos[talento.chave].nome) + '\"');\n continue;\n }\n }\n gPersonagem.proficiencia_armas[chave_arma] = true;\n }\n }\n }\n}", "function cargarCgg_titulo_profesionalCtrls(){\n\t\tif(inRecordCgg_titulo_profesional){\n\t\t\ttxtCgtpr_codigo.setValue(inRecordCgg_titulo_profesional.get('CGTPR_CODIGO'));\n\t\t\tcodigoNivelEstudio = inRecordCgg_titulo_profesional.get('CGNES_CODIGO');\t\t\t\n\t\t\ttxtCgnes_codigo.setValue(inRecordCgg_titulo_profesional.get('CGNES_DESCRIPCION'));\n\t\t\ttxtCgtpr_descripcion.setValue(inRecordCgg_titulo_profesional.get('CGTPR_DESCRIPCION'));\n\t\t\tisEdit = true;\n\t\t\thabilitarCgg_titulo_profesionalCtrls(true);\n\t}}", "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 newUsers () {\n var o13male = 0, o13female = 0, o13undisclosed = 0, u13undisclosed = 0, u13male = 0, u13female = 0, adults = [], o13 = [], u13 = [];\n userDB('sys_user').select('init_user_type', 'id').where('when', '>', monthAgo.format(\"YYYY-MM-DD HH:mm:ss\")).then( function (rows) {\n for (var i in rows) {\n if ( _.includes(rows[i].init_user_type, 'attendee-o13')) {\n o13.push(rows[i].id);\n } else if ( _.includes(rows[i].init_user_type, 'attendee-u13')) {\n u13.push(rows[i].id);\n } else if ( _.includes(rows[i].init_user_type, 'parent-guardian')) {\n adults.push(rows[i].id);\n }\n }\n userDB('cd_profiles').select('user_id', 'gender').then( function (rows) {\n for (var i in o13) {\n for (var j = 0; j< rows.length; j++) {\n if (_.includes(rows[j], o13[i]) && _.includes(rows[j], 'Male')) {\n o13male++;\n j = rows.length;\n } else if (_.includes(rows[j], o13[i]) && _.includes(rows[j], 'Female')) {\n o13female++;\n j = rows.length;\n } else if (_.includes(rows[j], o13[i]) && !_.includes(rows[j], 'Male') && !_.includes(rows[j], 'Female')) {\n o13undisclosed++;\n j = rows.length;\n }\n }\n }\n for (var i in u13) {\n for (var j = 0; j< rows.length; j++) {\n if (_.includes(rows[j], u13[i]) && _.includes(rows[j], 'Male')) {\n u13male++;\n j = rows.length;\n } else if (_.includes(rows[j], u13[i]) && _.includes(rows[j], 'Female')) {\n u13female++;\n j = rows.length;\n } else if (_.includes(rows[j], u13[i]) && !_.includes(rows[j], 'Male') && !_.includes(rows[j], 'Female')) {\n u13undisclosed++;\n j = rows.length;\n }\n }\n }\n fs.appendFileSync(filename, '\\nNew users in the past ' + interval + ' days\\n');\n fs.appendFileSync(filename, 'Ninjas under 13 ' + u13.length + '\\n');\n fs.appendFileSync(filename, 'Male ' + u13male + ', female ' + u13female + ' Undisclosed ' + u13undisclosed + '\\n');\n fs.appendFileSync(filename, 'Ninjas over 13 ' + o13.length + '\\n');\n fs.appendFileSync(filename, 'Male ' + o13male + ', female ' + o13female + ' Undisclosed ' + o13undisclosed + '\\n');\n fs.appendFileSync(filename, 'Adults ' + adults.length + '\\n');\n console.log('that stupid long one is done, i blame the db');\n return true;\n }).catch(function(error) {\n console.error(error);\n });\n }).catch(function(error) {\n console.error(error);\n });\n}", "function currentProfile(event) {\n\tfor (let i = 0; i < hires.length; i++) {\n\t\thires[i].classList.remove('active');\n\t}\n\tevent.currentTarget.classList.add('active');\n}", "function activarHerramientaPerfil() {\n console.log(\"Activar herramienta perfil\");\n\n crearYCargarCapaLineaPerfil();\n activarControlDibujo();\n\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}", "function getProfesor(data, dataL) {\n clearDOM();\n\n const poDanu = { pon: [], uto: [], sri: [], cet: [], pet: [] };\n\n data.forEach((profesor, j) => {\n if (j === 0) return;\n\n if (\n profesor[0]\n .toUpperCase()\n .replace(/ /g, \"\")\n .indexOf(input.replace(/ /g, \"\")) !== -1\n ) {\n for (let i = 1; i < profesor.length; i++) {\n const sat = profesor[i];\n if (typeof sat === \"object\" && sat.dan) {\n poDanu[sat.dan].push(sat);\n }\n }\n }\n });\n\n Object.keys(poDanu).forEach((dan) => {\n const sati = poDanu[dan];\n let text = \"\";\n\n sati.forEach((celija) => {\n text += `\n <th>${celija.sat}.sat (${celija.trajanje})</th>\n </tr>\n <tr>\n <td>\n <p class='inline' style='${returnStyle(celija)}'>${celija.name}</p>\n </td>\n </tr>`;\n });\n\n document.getElementById(dan).innerHTML = text;\n });\n\n finalTouch(data[0]);\n }", "function addProf() {\n var profName = document.getElementById(\"prof-name\").value;\n var profEmail = document.getElementById(\"prof-email\").value;\n var profPhone = document.getElementById(\"prof-tel\").value;\n var profBuilding = document.getElementById(\"prof-building\").value;\n var profRoom = document.getElementById(\"prof-room\").value;\n \n var profDays = [];\n var profDaysList = document.getElementsByClassName(\"prof-days\");\n for(var i = 0; i < profDaysList.length; i++) profDays[i] = profDaysList[i].value;\n var profStart = [];\n var profStartList = document.getElementsByClassName(\"prof-start-times\");\n for(var i = 0; i < profStartList.length; i++) profStart[i] = profStartList[i].value;\n var profEnd = [];\n var profEndList = document.getElementsByClassName(\"prof-end-times\");\n for(var i = 0; i < profEndList.length; i++) profEnd[i] = profEndList[i].value;\n \n var profObject = {\n\tname: profName,\n\temail: profEmail,\n\tphone_number: profPhone,\n\tbuilding: profBuilding,\n\toffice_number: profRoom,\n\toffice_days: profDays.slice(),\n\toffice_begin: profStart.slice(),\n\toffice_end: profEnd.slice()\n };\n \n if(_profList) {\n\tfor(var i = 0; i < _profList.length; i++) {\n if(profName == _profList[i].name) {\n window.alert(\"You already have this professor!\");\n return;\n }\n\t}\n }\n \n _profList.push(profObject);\n saveResources();\n updateUI();\n setupCanvas();\n \n closePopUps(\"add-prof\");\n }", "function mostrarPermisos(data){\n\n\t\tif(data.add == 1){\n\t\t\taddIcoPermOk(\"add-est\");\n\t\t\taddBtnQuitar(\"add\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"add-est\");\n\t\t\taddBtnAdd(\"add\");\n\t\t}\n\t\tif(data.upd == 1){\n\t\t\taddIcoPermOk(\"upd-est\");\n\t\t\taddBtnQuitar(\"upd\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"upd-est\");\n\t\t\taddBtnAdd(\"upd\");\n\t\t}\n\t\tif(data.del == 1){\n\t\t\taddIcoPermOk(\"del-est\");\n\t\t\taddBtnQuitar(\"del\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"del-est\");\n\t\t\taddBtnAdd(\"del\");\n\t\t}\n\t\tif(data.list == 1){\n\t\t\taddIcoPermOk(\"list-est\");\n\t\t\taddBtnQuitar(\"list\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"list-est\");\n\t\t\taddBtnAdd(\"list\");\n\t\t}\n\n\t\t/*Una vez dibujados los permisos del usuario, \n\t\tel selector de usuario obtiene el foco */\n\t\t$('select#usuario').focus(); \n\n\t}", "function sedePromo(sede, promo) {\n // respondiendo primera pregunta. Hallando la cantidad de alumnas y el porcentaje recorriendo un array se puede contar cuantas alumnas hay\n var arr = data[sede][promo]['students'];\n var cant = 0;\n var nocant = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i].active === true) {\n cant++;\n } else {\n nocant++;\n }\n }\n var calculandoPorcentaje = parseInt((nocant / arr.length) * 100);\n total.textContent = cant;\n porcentaje.textContent = calculandoPorcentaje + '%';\n /* ***************************************************Cantida de alumnas que superan el objetivo*****************************************************/\n var sumaScore = 0;\n for (var i = 0; i < arr.length; i++) {\n debugger;\n var sumaHse = 0;\n var sumaTech = 0;\n for (var j = 0; j < data[sede][promo]['students'][i]['sprints'].length; j++) {\n var tech = data[sede][promo]['students'][i]['sprints'][j]['score']['tech'];\n var hse = data[sede][promo]['students'][i]['sprints'][j]['score']['hse'];\n sumaHse = sumaHse + hse;\n sumaTech = sumaTech + tech;\n }\n if (sumaHse > 3360 && sumaTech > 5040) {\n sumaScore++;\n }\n }\n meta.innerHTML = sumaScore;\n /* ***************************************************************cantida de nps*********************************************************************/\n var arrNps = data[sede][promo]['ratings'];\n var sum = 0;\n var npsTotal = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var npsPromoters = data[sede][promo]['ratings'][i]['nps']['promoters'];\n var npsDetractors = data[sede][promo]['ratings'][i]['nps']['detractors'];\n var npsPassive = data[sede][promo]['ratings'][i]['nps']['passive'];\n var npsResta = npsPromoters - npsDetractors;\n sum = sum + npsResta;\n var npsSuma = npsPromoters + npsDetractors + npsPassive;\n npsTotal = npsTotal + npsSuma;\n }\n var promoterPorcentaje = parseInt((npsPromoters / npsTotal) * 100);\n var detractorsPorcentaje = parseInt((npsDetractors / npsTotal) * 100);\n var passivePorcentaje = parseInt((npsPassive / npsTotal) * 100);\n var totalNps = sum / arrNps.length;\n nps.textContent = totalNps.toFixed(2);\n npsPorciento.innerHTML = promoterPorcentaje + '% Promoters' + '<br>' + detractorsPorcentaje + '% Passive' + '<br>' + passivePorcentaje + '% Detractors';\n /* *********************************************calculando los puntos obtenidos en tech********************************************************************/\n var cantidadTech = 0;\n for (var i = 0; i < arr.length; i++) {\n var arrSprint = data[sede][promo]['students'][i]['sprints'];\n var sumTech = 0;\n for (var j = 0; j < arrSprint.length; j++) {\n var tech2 = data[sede][promo]['students'][i]['sprints'][j]['score']['tech'];\n sumTech = sumTech + tech2;\n if (sumTech > (1260 * 4)) {\n cantidadTech++;\n }\n }\n }\n pointTech.textContent = cantidadTech;\n /* ********************************************************calculando los puntos en hse*******************************************************************/\n var cantidadHse = 0;\n for (var i = 0; i < arr.length; i++) {\n var arrSprint = data[sede][promo]['students'][i]['sprints'];\n var sumHse = 0;\n for (var j = 0; j < arrSprint.length; j++) {\n var hse2 = data[sede][promo]['students'][i]['sprints'][j]['score']['hse'];\n sumHse = sumHse + hse2;\n if (sumHse > (840 * 4)) {\n cantidadHse++;\n }\n }\n }\n pointHse.textContent = cantidadHse;\n /* **************************************porcentaje de la expectativa de las alumnas respecto a laboratoria**************************************************/\n var sumaExpectativa = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var studentNoCumple = data[sede][promo]['ratings'][i]['student']['no-cumple'];\n var studentCumple = data[sede][promo]['ratings'][i]['student']['cumple'];\n var studentSupera = data[sede][promo]['ratings'][i]['student']['supera'];\n var Expectativa = ((studentSupera + studentCumple) / (studentNoCumple + studentCumple + studentSupera)) * 100;\n sumaExpectativa = sumaExpectativa + Expectativa;\n }\n var porcentajeExpectativa = parseInt(sumaExpectativa / arrNps.length);\n boxExpectativa.textContent = porcentajeExpectativa + '%';\n /* *********************************************promedio de los profesores********************************************************************/\n var promedioTeacher = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var teacher = data[sede][promo]['ratings'][i]['teacher'];\n promedioTeacher = (promedioTeacher + teacher) / arrNps.length;\n }\n boxTeacher.textContent = promedioTeacher.toFixed(2);\n /* *************************************************promedio jedi*****************************************************************/\n var promedioJedi = 0;\n for (var i = 0; i < arrNps.length; i++) {\n var jedi = data[sede][promo]['ratings'][i]['jedi'];\n promedioJedi = (promedioJedi + jedi) / arrNps.length;\n }\n boxJedi.textContent = promedioJedi.toFixed(2);\n }", "function TwiceProfiles() {\n let profiles = Profiles();\n profiles.insertBefore(TwicePicture(), profiles.firstChild);\n return profiles;\n}", "function pickUpThings(objeto){\n \n quitaConsumible(objeto);\n mapaCargado.cogeConsumible(objeto);\n if(objeto.getId()==1)\n guardarEstado(idMapaAct);\n $('#valorArm').html(mapaCargado.personaje.getFuerza());\n $('#valorDef').html(mapaCargado.personaje.getVida());\n $('.valorLlave').html(mapaCargado.personaje.tieneLLave());\n\n refrescaInv()\n \n $('#barras').empty();\n barraProgreso();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n actualizaCanvas(mapaCargado,mapaCargado.mazmorraActual.idMazmorra);\n //console.log(mapaCargado.personaje.inventario)\n //refrescaInv();\n \n}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "function escucha_Permisos(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByClassName(\"work_data\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\tif($(this).find(\"input\").val()!=0){/*Encuentro el input con el valor de id de permiso*/\n\t\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\t\tlimpiar(\".work_data\");\n\t\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\t\tvar y=$(this).find(\"input\");/*Encuentro el input con el valor de id de permiso*/\n\t\t\t\tconfUsers[indice]=y.val();/*Obtengo el valor del input \"idPermiso\" y lo almaceno*/\n\t\t\t\tconsole.log(confUsers[indice]);\n\t\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\t\tsessionStorage.setItem(\"confp\", confUsers[indice]);\n\t\t\t}\n\t\t};\n\t}\n}", "function menuPrincipal() {\n let opcion = \"\";\n\n while (opcion !== 1 && opcion !== 2 && opcion !== 3 && opcion !== 4 && opcion !== 5 && opcion !== 6 && opcion !== 7 && opcion !== 8) {\n opcion = rl.question('Introduce la accion a realizar:\\n' +\n '1) Añadir\\n' +\n '2) Modificar\\n' +\n '3) Dar de baja\\n' +\n '4) Buscar\\n' +\n '5) Calcular el número de producciones científicas de un autor\\n' +\n '6) Calcular el factor de impacto acumulado por el autor en los últimos años\\n' +\n '7) Calcular el indice h de un actor\\n' +\n '8) Guardar y Salir\\n');\n\n if (opcion === '1') {\n menuAyadir();\n }\n else if (opcion === '2') {\n menuModificar();\n }\n else if (opcion === '3') {\n menuBaja();\n }\n else if (opcion === '4') {\n menuBuscar();\n }\n else if (opcion === '5') {\n numProduccionesCientíficas();\n }\n else if (opcion === '6') {\n factordeImpacto();\n }\n else if (opcion === '7') {\n indiceH();\n }\n else if (opcion === '8') {\n listados.salir();\n break;\n }\n }\n}", "selectPerfil(profile) {\n // Agrega el id del perfil a la transición\n this.transitionTo('perfil', profile.get('id'));\n }", "function PersonagemRenovaFeiticos() {\n for (var chave_classe in gPersonagem.feiticos) {\n if (!gPersonagem.feiticos[chave_classe].em_uso) {\n continue;\n }\n var slots_classe = gPersonagem.feiticos[chave_classe].slots;\n for (var nivel in slots_classe) {\n for (var indice = 0; indice < slots_classe[nivel].feiticos.length; ++indice) {\n slots_classe[nivel].feiticos[indice].gasto = false;\n }\n if ('feitico_dominio' in slots_classe[nivel] && slots_classe[nivel].feitico_dominio != null) {\n slots_classe[nivel].feitico_dominio.gasto = false;\n }\n if ('feitico_especializado' in slots_classe[nivel] && slots_classe[nivel].feitico_especializado != null) {\n slots_classe[nivel].feitico_especializado.gasto = false;\n }\n }\n }\n}", "function SetPoints(tablica,userPoints,score,user,kostki,time){\n\n // potwierdzanie punktow\n\n const confirmPoints = (e) => {\n\n // czyszczenie funkcji kostek\n\n for(let j = 0 ; j < 5 ; j++){\n kostki.querySelectorAll(\".kostka_side\").forEach(k => {\n k.style.backgroundColor = \"white\"\n } )\n kostki.children[j].dataset.save = \"false\"\n kostki.children[j].removeEventListener('click', kostkaSave,true)\n repeatBtn.removeEventListener(\"click\", NewRole,true)\n }\n \n \n repeatBtn.style.opacity = \"0\";\n setTimeout(() => {\n repeatBtn.style.display = \"none\";\n }, 300);\n\n // przypisywanie kliknietych punkow jako stalych nie zmiennych do konca gry\n \n let confirm = new Promise(resolve => {\n let value = Number(e.path[0].innerHTML)\n let cat = e.path[0].dataset.cat;\n \n userPoints[cat].score = value;\n userPoints[cat].confirm = true;\n \n \n tablica.forEach(t => {\n t.removeEventListener(\"click\", confirmPoints,true)\n })\n resolve(tablica)\n })\n\n confirm.then(r => {\n \n e.path[0].style.backgroundColor = \"rgba(0, 0, 0, 0.603)\"\n \n clearAndSumTable(r,userPoints) \n \n })\n \n // wywolanie bota\n\n confirm.then(r => {\n setTimeout(() => {\n StartGame(user2)\n }, 2000);\n })\n \n \n }\n\n\n // ustawanie punktow kiedy gra bot\n\n const BotConfirmPoints = () => {\n\n // szukanie najwyższej liczby punktow\n\n let findMaxPoint = new Promise(resolve => {\n let sort = [...score];\n sort = sort.sort((a,b) => a - b).reverse();\n let pos = 0;\n let max = sort[pos];\n let index;\n \n let findIndex = () => {\n \n index = score.indexOf(max) \n \n if(max == 0){\n \n let i = tablePoints.length - 1;\n let f = false;\n while(f == false){\n \n if(userPoints[tablePoints[i].dataset.cat].confirm == false){\n \n let value = Number(tablePoints[i].innerHTML)\n let cat = tablePoints[i].dataset.cat;\n userPoints[cat].score = value;\n userPoints[cat].confirm = true;\n index = i;\n f = true;\n }\n \n i--;\n }\n \n }else if(userPoints[tablePoints[index].dataset.cat].confirm == true){\n pos++;\n max = sort[pos];\n findIndex();\n }else{\n let value = Number(tablePoints[index].innerHTML)\n let cat = tablePoints[index].dataset.cat;\n userPoints[cat].score = value;\n userPoints[cat].confirm = true;\n }\n }\n \n findIndex()\n \n \n \n resolve(tablePoints[index])\n \n })\n \n // zatwierdzanie punkktow\n\n findMaxPoint.then(r => {\n \n r.style.backgroundColor = \"rgba(0, 0, 0, 0.603)\"\n clearAndSumTable(tablica,userPoints) ;\n \n });\n \n //wczytywanie kolejnego gracz\n\n findMaxPoint.then(r => {\n setTimeout(() => {\n switch(currentUser){\n case 1: StartGame(user2); break;\n case 2: StartGame(user3); break;\n case 3: StartGame(user4); break;\n case 4: StartGame(user1); break;\n }\n }, 1000);\n })\n \n \n }\n\n // usuwanie mozliwosci klikania punktow\n\n tablica.forEach(t => {\n t.removeEventListener(\"click\", confirmPoints,true)\n })\n\n // tworzenie tabelicy tylko z polami w ktorych maja sie znajdowac punkty\n\n let tablePoints = []\n // wpisywanie w td punktow\n\n let createTable = new Promise(resolve => {\n\n tablica.forEach(t => {\n if(t.classList == \"points\"){\n tablePoints.push(t)\n }\n })\n\n\n resolve(tablePoints)\n })\n\n // rzypisywanie do pol odpowiednie im punkty\n\n createTable.then(r => {\n score.forEach((s,b) => {\n if(userPoints[r[b].dataset.cat].confirm == false){\n r[b].innerHTML = s;\n }\n })\n })\n\n // nadawanie polom mozliwosci zatwierdzania ich\n\n createTable.then(r => {\n\n if(user == \"1\"){\n if(time == 1){\n r.forEach(x => {\n if(userPoints[x.dataset.cat].confirm == false){\n x.addEventListener(\"click\", confirmPoints,true)\n }\n })\n }\n }\n else{\n if(time == 1){\n setTimeout(() => {\n BotConfirmPoints()\n }, 1000);\n }\n }\n \n })\n\n}", "function builtInProfiles () {\n new Profile('Kevin', '../img/monk.png', 'martial arts', '1F6212', knownArray, interestArray);\n new Profile('Austin', '../img/fighter.png', 'watching movies', '404040', ['Javascript', 'HTML', 'CSS'], ['Python', 'Ruby']);\n new Profile('Zach', '../img/wizzard.png', 'Anime', '49F3FF', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Ramon', '../img/monk.png', 'Racing motorsports', 'FF0000', ['Javascript', 'HTML', 'CSS'], ['Python']);\n new Profile('Sooz', '../img/rogue.png', 'Knitting', 'FF8C00', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Kris', '../img/rogue.png', 'reading', 'B51A1F', ['Javascript', 'Python'], ['Java']);\n new Profile('Judah', '../img/druid.jpg', 'Cooking', '000000', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Allie', '../img/cleric.png', 'Cooking', '29B0FF', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Carl', '../img/wizzard.png', 'Cooking', '0560dd', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Jose', '../img/rogue.png', 'Youtubing', 'af111c', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Michael', '../img/rogue.png', 'Youtubing', '000000', ['Javascript'], ['Javascript']);\n new Profile('Han', '../img/monk.png', 'Coding', '29B0FF', ['Javascript', 'HTML', 'CSS', 'Python', 'Java'], ['C++']);\n}", "function incluir() {\n titulo(\"Inclusão de Filmes\") \n\n // adiciona a entrada do usuário ao vetor produtos e precos\n titulos.push(prompt(\"Título do Filme: \"))\n generos.push(prompt(\"Gênero.........: \"))\n tempos.push(Number(prompt(\"Duração........: \")))\n\n console.log(\"Ok! Filme cadastrado com sucesso\")\n}", "function _AtualizaTalentos() {\n // Talentos de classe.\n for (var chave_classe in gPersonagem.talentos) {\n var div_talentos_classe = Dom('div-talentos-' + chave_classe);\n var lista_classe = gPersonagem.talentos[chave_classe];\n var div_selects = Dom('div-talentos-' + chave_classe + '-selects');\n if (lista_classe.length > 0 || chave_classe == 'outros') {\n ImprimeNaoSinalizado(\n lista_classe.length,\n Dom('talentos-' + chave_classe + '-total'));\n for (var i = 0; i < lista_classe.length; ++i) {\n _AtualizaTalento(\n i, // indice do talento.\n lista_classe[i],\n i < div_selects.childNodes.length ?\n div_selects.childNodes[i] : null,\n chave_classe,\n div_selects);\n }\n // Se tinha mais talentos, tira os que estavam a mais.\n for (var i = 0; div_selects.childNodes.length > lista_classe.length; ++i) {\n RemoveUltimoFilho(div_selects);\n }\n div_talentos_classe.style.display = 'block';\n } else {\n div_talentos_classe.style.display = 'none';\n RemoveFilhos(div_selects.childNodes);\n }\n }\n}", "function comprobarCajas() {\n\n for (let i = 2, posCaja = 0; i < mapa.length; i += 3)\n for (let j = 1; j < mapa[0].length; j += 4, posCaja++)\n if (!cajasDescubiertas[posCaja] && mapa[i][j].classList.contains('caja'))\n if (cajaRodeada(i, j)) {\n\n cajasDescubiertas[posCaja] = true;\n descubrirCaja(i, j, posCaja);\n\n if (contenidoCajas[posCaja] == 'cofre') {\n puntos = parseInt(puntos) + 200;\n actualizarPuntuacion();\n insertarContenidoLeyenda('contenedorMonedas', 'leyendaCajaMoneda', 'cantidadMonedas');\n }\n else if (contenidoCajas[posCaja] == 'pergamino') {\n personaje.pergamino = true;\n applyContrastToMummies();\n }\n else if (contenidoCajas[posCaja] == 'llave') {\n insertarContenidoLeyenda('contenedorLlave', 'leyendaCajaLlave', 'cantidadLlaves');\n personaje.llave = true;\n }\n else if (contenidoCajas[posCaja] == 'urna') {\n insertarContenidoLeyenda('contenedorUrna', 'leyendaCajaUrna', 'cantidadUrnas');\n personaje.urna = true;\n }\n }\n\n}", "imprimirVehiculos() {\n\t\tthis.vehiculos.forEach(vehiculo => {\n\t\t\tif (vehiculo.puertas) {\n\t\t\t\tconsole.log(`Marca: ${vehiculo.marca} // Modelo: ${vehiculo.modelo} // Puertas: ${vehiculo.puertas} // Precio: $${this.formatearPrecio(vehiculo.precio)}`)\n\t\t\t}\n\t\t\tif (vehiculo.cilindrada) {\n\t\t\t\tconsole.log(`Marca: ${vehiculo.marca} // Modelo: ${vehiculo.modelo} // Cilindrada: ${vehiculo.cilindrada}cc // Precio: $${this.formatearPrecio(vehiculo.precio)}`)\n\t\t\t}\n\t\t});\n\t}", "function partida(){\n if (contadorUser >= nRondas || contadorPc >= nRondas){\n //declarar ganador \n openWinner()\n \n } \n}", "function makeFriendsPanel(fromId, login) {\n\n $(\"body\").html('<div id=\"loaded\"></div> <div id=\"loaded2\"></div>');\n $(\"body #loaded\").load(\"profile_page.html\");\n $(\"body #loaded2\").load(\"follow_page.html\");\n $(\"body\").append((env.following_online).getHtml());\n env.followers_profile = new Array();\n env.following_profile = new Array();\n //pour garder les amis possibles dans une liste et les recupurer apres \n\n alert(\"Pour follow/Unfollow quelqu'un, accédez au profil de l'utilisateur !\");\n\n /*si fromId undefiend, je cherche mes amis à moi*/\n if ((fromId == undefined) || (fromId == env.id)) {\n env.following_profile = env.following; /*on a deja la liste de following*/\n\n fromId = env.id;\n login = env.login;\n\n env.fromId = 0;\n\n getFollowers(fromId); /*on recupere les followers*/\n\n } else {\n getFollowers(fromId);\n getFollowing(fromId);\n env.fromId = fromId;\n }\n\n var profile = getVarProfileHtml(login);\n\n $(\"body\").append(profile);\n\n var tmp = \"\";\n\n /*on rajoute la liste de followers recuperes a la balise qui les contiendra*/\n for (var friend in env.followers_profile) {\n\n if (env.followers_profile[friend].id == env.id) {\n tmp = '<div class=\"items_f\"><img id=\"profilefr\" src= \"./TWISTER/empty-profile.png\" /><a id=\"profile_namefr\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(0, undefined, \\'' + env.followers_profile[friend].login + '\\')\" >' + env.followers_profile[friend].login + '</a>';\n tmp = tmp + '</div>';\n } else {\n tmp = '<div class=\"items_f\"><img id=\"profilefr\" src= \"./TWISTER/empty-profile.png\" /><a id=\"profile_namefr\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(' + env.followers_profile[friend].id + ', undefined, \\'' + env.followers_profile[friend].login + '\\')\" >' + env.followers_profile[friend].login + '</a>';\n\n\n /*si cet utilisateur n'est pas followe par l'utilisateur connecte, on mettra un bouton follow*/\n if (indexOfFriend(env.following, env.followers_profile[friend].id) == -1) {\n tmp = tmp + '<div class = \"item\"><a class=\"but\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(' + env.followers_profile[friend].id + ', undefined, \\'' + env.followers_profile[friend].login + '\\')\" >Follow</a></div></div>';\n }\n\n /*sinon on met un boutton unfollow*/\n else {\n tmp = tmp + '<div class = \"item\"><a class=\"but\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(' + env.followers_profile[friend].id + ', undefined, \\'' + env.followers_profile[friend].login + '\\')\" >Unfollow</a></div></div>';\n }\n }\n $(\"#followers_container\").append(tmp);\n }\n\n\n /*pareil que lq boucle d'avant*/\n for (var friend in env.following_profile) {\n\n if (env.following_profile[friend].id == env.id) {\n tmp = '<div class=\"items_f\"><img id=\"profilefr\" src= \"./TWISTER/empty-profile.png\" /><a id=\"profile_namefr\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(0, undefined, \\'' + env.following_profile[friend].login + '\\')\" >' + env.following_profile[friend].login + '</a>';\n tmp = tmp + '</div>';\n\n } else {\n\n tmp = '<div class=\"items_f\"><img id=\"profilefr\" src= \"./TWISTER/empty-profile.png\" /><a id=\"profile_namefr\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(' + env.following_profile[friend].id + ', undefined, \\'' + env.following_profile[friend].login + '\\')\" >' + env.following_profile[friend].login + '</a>';\n\n if (indexOfFriend(env.following, env.following_profile[friend].id) == -1) {\n tmp = tmp + '<div class = \"item\" id=\"benni\"><a class=\"butbenni\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(' + env.following_profile[friend].id + ', undefined, \\'' + env.following_profile[friend].login + '\\')\" >Follow</a></div></div>';\n } else {\n tmp = tmp + '<div class = \"item\" id=\"benni\"><a class=\"butbenni\" href=\"javascript:void(0);\" onClick=\"javascript:makeMainPanel(' + env.following_profile[friend].id + ', undefined, \\'' + env.following_profile[friend].login + '\\')\" >Unfollow</a></div></div>'\n }\n }\n\n $(\"#following_container\").append(tmp);\n }\n\n}", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "function agarrarProfesor() {\n const profesorId = document.getElementById(\"profesores\").value;\n document.getElementById(\"profesorId\").value = profesorId;\n}", "function addPratoSelecionado() {\n let qntMedidas = medidas.length;\n let qntValorSelecionado = arrayValores.length;\n\n if (qntValorSelecionado != qntMedidas) {\n alert(\"Selecione Um valor pra cada medidas ou escolha \\\"desativado\\\"\")\n } else {\n const criaArray = (array) => {\n const arr = [];\n for (const item of array) {\n arr.push(item.prato)\n }\n return arr;\n }\n\n let arrayPratos = criaArray(listaPratosDia);\n let existeItem = arrayPratos.findIndex(i => i == valueListaPrato);\n\n if (existeItem == -1) {\n listaPratosDia.push({\n prato: valueListaPrato,\n info: arrayValores\n });\n\n setctx_SP(listaPratosDia);\n } else {\n alert('Este prato já está na lista!');\n }\n /* console.log('-------------------------------------------------------------------------')\n console.log(ctx_SP);\n //console.log(listaPratosDia);\n console.log('-------------------------------------------------------------------------') */\n }\n }", "constructor(nombre, edad, profesiones = []){\n this.nombre = nombre;\n this.edad = edad;\n this.profesiones = profesiones;\n }", "function nuevo(){\n const avatares = document.querySelectorAll('#gallery img');\n console.trace(avatares);\n console.trace('nuevo');\n limpiarSelectores();\n pintarLista();\n\n //Preparar botones\n document.getElementById('botonNuevo').disabled = true;\n document.getElementById('botonGuardar').disabled = false;\n document.getElementById('botonModificar').disabled = true;\n \n document.getElementById('idForm').value = '';\n document.getElementById('nombreForm').value = '';\n document.getElementById('avatarForm').value = 'avatar7.png';\n\n avatares.forEach( el => {\n el.classList.remove('selected'); \n });\n \n console.trace( avatares[6]);\n avatares[6].classList.add('selected');\n\n document.nombreForm.sexoForm.value = 'h';\n}", "function iniciarJugadores(pUser) {\r\n\t\tuserId = parseInt(pUser);\r\n\t\tif(pUser == 1){\r\n\t\t\tMASTER = true;\r\n\t\t\tconnected = true;\r\n\t\t\tmessageGeneral = \"Waiting Opponents. MASTER. Online: \" + (numUsuarios) + \"/\" +maxSess;\r\n\t\t\t\r\n\t\t\tlocalPlayer = new LocalPlayer(1);\r\n\t\t\t\r\n\t\t\tfunction anim() {\r\n\t\t\t\tloop();\r\n\t\t\t\trequestAnimFrame(anim);\r\n\t\t\t}\r\n\t\t\tanim();\r\n\t\t} else {\r\n\t\t\tMASTER = false;\r\n\t\t\tconnected = true;\t\t\t\r\n\t\t\t\r\n\t\t\tlocalPlayer = new LocalPlayer(pUser);\t\r\n\t\t\tvar count = userId;\r\n\t\t\twhile(count>1){\r\n\t\t\t\tcount -= 1;\r\n\t\t\t\tplayers[count] = new Enemy(count);\t\t\t\t\r\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tfunction anim() {\r\n\t\t\t\tloop();\r\n\t\t\t\trequestAnimFrame(anim);\r\n\t\t\t}\r\n\t\t\tanim();\r\n\t\t\t\r\n\t\t\tif (pUser == maxSess) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//The last\r\n\t\t\t\tpriorWriteAction(MEN_TYPE_BEGIN + SEP + userId + SEP + MEN_ULTIMO);\t\t\t//START GAME ALL JOINED\r\n\t\t\t} else {\r\n\t\t\t\tpriorWriteAction(MEN_TYPE_BEGIN + SEP + userId + SEP + MEN_CONECTADO);\t\t//I log and I say to others\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tnumUsuarios = parseInt(pUser);\r\n\t\t\tmessageGeneral = \"Waiting Opponents. Online: \" + (numUsuarios) + \"/\" +maxSess;\t\t\t\r\n\t\t}\r\n\t}", "function asignarManejadores() {\n traerPersonajes();\n}", "async function iniciar(){\r\n sala.players.sort(utils.randOrd)\r\n utils.herois.sort(utils.randOrd);\r\n sala.posicoes[1][1] = utils.generatePlayer(1,1, sala.players[0].nick, 0)\r\n //sala.posicoes[1][4] = utils.generatePlayer(1,4, sala.players[1].nick, 1)\r\n //sala.posicoes[4][1] = utils.generatePlayer(4,1, sala.players[2].nick, 2)\r\n //sala.posicoes[4][4] = utils.generatePlayer(4,4, sala.players[3].nick, 3)\r\n\r\n for(i=0; i<6;i++){ \r\n for(j=0; j<6;j++){\r\n if(!sala.posicoes[i][j]){ // se a posição ainda não pertence a um heroi\r\n utils.vec_func.sort(utils.randOrd);\r\n sala.posicoes[i][j] = utils.vec_func[0](i, j);\r\n }\r\n }\r\n }\r\n}", "function _checkPrizeUser(name, classNam) {\n\tconsole.log('_checkPrizeUser:' + name);\n\tvar IdName = document.getElementById(\"changeImg\");\n\tvar Lname = document.getElementById(\"lotteryname\");\n\tfor(var i = 0; i < theDefault.first.length; i++) {\n\t\tif(Levenshtein_Distance_Percent(theDefault.first[i].name, name) > 0.6) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tvar nun = Math.floor(Math.random() * dataUser.length);\n\t\t\t\tIdName.setAttribute(\"src\", dataUser[nun].reheadimgurl);\n\t\t\t\tIdName.setAttribute(\"title\", dataUser[nun].renickname);\n\t\t\t\tIdName.setAttribute(\"data-id\", nun);\n\t\t\t\tLname.innerHTML = dataUser[nun].renickname;\n\t\t\t\t_checkPrizeUser(dataUser[nun].renickname);\n\t\t\t}, 50)\n\n\t\t\treturn;\n\t\t}\n\t}\n\n\tfor(var j = 0; j < theDefault.second.length; j++) {\n\t\tif(Levenshtein_Distance_Percent(theDefault.first[j].name, name) > 0.6) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tvar nun = Math.floor(Math.random() * dataUser.length);\n\t\t\t\tIdName.setAttribute(\"src\", dataUser[nun].reheadimgurl);\n\t\t\t\tIdName.setAttribute(\"title\", dataUser[nun].renickname);\n\t\t\t\tIdName.setAttribute(\"data-id\", nun);\n\t\t\t\tLname.innerHTML = dataUser[nun].renickname;\n\t\t\t\t_checkPrizeUser(dataUser[nun].renickname);\n\t\t\t}, 50)\n\n\t\t\treturn;\n\t\t}\n\t}\n\tfor(var k = 0; k < theDefault.third.length; k++) {\n\t\tif(Levenshtein_Distance_Percent(theDefault.first[k].name, name) > 0.6) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tvar nun = Math.floor(Math.random() * dataUser.length);\n\t\t\t\tIdName.setAttribute(\"src\", dataUser[nun].reheadimgurl);\n\t\t\t\tIdName.setAttribute(\"title\", dataUser[nun].renickname);\n\t\t\t\tIdName.setAttribute(\"data-id\", nun);\n\t\t\t\tLname.innerHTML = dataUser[nun].renickname;\n\t\t\t\t_checkPrizeUser(dataUser[nun].renickname);\n\t\t\t}, 50)\n\n\t\t\treturn;\n\t\t}\n\t}\n\n\tvar scr = IdName.getAttribute(\"src\");\n\tvar title = IdName.getAttribute(\"title\");\n\tconsole.log(title);\n\tif(title.length > 5) {\n\t\ttitle = title.substr(0, 10) + \"...\"\n\t}\n\tvar spliceI = IdName.getAttribute(\"data-id\");\n\tif(dataUser.length > 0) {\n\t\tdataUser.splice(spliceI, 1);\n\t}\n\n\tvar li = document.createElement(\"li\");\n\tvar str = '<span class=\\\"' + classNam + '\\\"></span><span class=\"userImg\">' +\n\t\t'<img src=\\\"' + scr + '\\\" /></span>' + title\n\n\tli.innerHTML = str;\n\t$(\"#userList\").prepend(li);\n\n\tvar unme = $(\"#userList li\").length;\n\t$(\".canyu\").eq(1).html(\"获奖人数:\" + unme)\n\t//弹出中奖名单\n\tshowLotteryResult(scr, title);\n\n}", "function asignarProfesor() {\n const profesorId = document.getElementById(\"profesores\").value;\n document.getElementById(\"profesorId\").value = profesorId;\n const materiaId = document.getElementById(\"materias\").value;\n document.getElementById(\"materiaId\").value = materiaId;\n}", "function profCheck(){\n //for workerA\n if(people[1]==people[5])\n\t{\n\t\tif(people[4]!=people[1])\n\t\t{\n\t\t\talert(\"Prof enforce worker to study\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t//for workerB\n\tif(people[1]==people[6])\n\t{\n\t\tif(people[4]!=people[1])\n\t\t{\n\t\t\talert(\"Prof enforce worker to study\");\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function avantiDiUno(){\n\t\tvar fotoCorrente = $(\"img.active\");\n var fotoSuccessiva = fotoCorrente.next(\"img\");\n // devo valutare se l img successiva esiste, in caso contrario riparto dalla prima,poi faro l incontrario per il precedente..sfrutto le classi first e last assegnate.. uso .length per valutare l esistenza!!!\n if (fotoSuccessiva.length == 0) {\n fotoSuccessiva = $(\"img.first\");\n }\n fotoCorrente.removeClass(\"active\");\n fotoSuccessiva.addClass(\"active\");\n // faccio la stessa cosa con i pallini\n var pallinoCorrente = $(\"i.active\");\n var pallinoSuccessivo = pallinoCorrente.next(\"i\");\n if (pallinoSuccessivo.length == 0) {\n pallinoSuccessivo = $(\"i.first\");\n }\n pallinoCorrente.removeClass(\"active\");\n pallinoSuccessivo.addClass(\"active\");\n // faccio variare anche qui l avariabile creata sopra per allinere i cambiamenti di frecce e pallini...vorrei tornare indietro nel tempo e dirlo al me stesso di un ora fa!!!\n if(current_img<3)\n\t\t\tcurrent_img++;\n\t\telse\n\t\t\tcurrent_img=0;\n\n\t}", "handleOnGoingSkills() {\n let gameInstance = this;\n for (let key in this.onGoingSkills) {\n let skill = gameInstance.onGoingSkills[key];\n let invoker = skill.invoker;\n\n if (skill.isSelfBuff) {\n gameInstance.toSend.push(invoker.name);\n invoker.KEYS.push('status')\n invoker.KEYS.push('tempBuff')\n }\n\n skill.duration -= 1 / server.tick_rate;\n if (skill.duration < 0) {\n if (skill.endEffect !== null) {\n skill.endEffect(gameInstance, invoker);\n }\n delete gameInstance.onGoingSkills[key];\n } else {\n skill.effect(gameInstance, invoker);\n }\n }\n\n // The reason we do it here is that we don't know who has been buffed\n // by aoe\n this.survivors.forEach(function (survivor) {\n gameInstance.calculatePlayerStatus(survivor.name);\n })\n }", "function remplirEntreprisesAsProf(anneeAcademique){\n\tmyApp.myajax({\n\t\tdata: {\n\t\t\t'action': 'visualiserEntreprisesAsProf',\n\t\t\t'anneeAcademique' : anneeAcademique\n\t\t},\n\t\tsuccess: function (data) {\n\t\t\tdtEntreprisesAsProf.clear();\n\t\t\tdtEntreprisesAsProf.rows.add(data).draw();\n\t\t\tif (rowSelectorEntreprise !== undefined){\n\t\t\t\tdtEntreprisesAsProf.row(rowSelectorEntreprise).select();\t\t\n\t\t\t}\n\t\t}\n\t});\n}", "function prefectClicked(selectedStudent) {\n console.log(selectedStudent);\n const studentStatus = checkPrefectStatus(selectedStudent);\n const prefectArray = studentList.filter((arrayObject) => arrayObject.prefect);\n console.log(prefectArray);\n const otherPrefectStudent = prefectArray.filter((student) => student.house === selectedStudent.house).shift();\n console.log(otherPrefectStudent);\n\n const checkForSameHouse = prefectArray.some((arrayObject) => arrayObject.house === selectedStudent.house);\n\n console.log(checkForSameHouse);\n\n if (studentStatus === true) {\n prefectStudent(selectedStudent);\n } else if (checkForSameHouse === true) {\n removeOther(otherPrefectStudent);\n } else if (prefectArray.length >= 2) {\n removeAorB(prefectArray[0], prefectArray[1]);\n } else {\n prefectStudent(selectedStudent);\n }\n\n function removeOther(other) {\n // Ask the use to ignore, or remove 'other'\n document.querySelector(\"#remove_other\").classList.remove(\"hide\");\n document.querySelector(\"#remove_other .closebutton\").addEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_other #removeother\").addEventListener(\"click\", clickRemoveOther);\n\n // show name of winner to remove\n document.querySelector(\"#remove_other [data-field=prefectOther]\").textContent = other.lastName;\n\n // If ignore, do nothing\n function closeDialog() {\n document.querySelector(\"#remove_other\").classList.add(\"hide\");\n document.querySelector(\"#remove_other .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_other #removeother\").removeEventListener(\"click\", clickRemoveOther);\n }\n\n // If remove other:\n function clickRemoveOther() {\n removePrefect(other);\n makePrefect(selectedStudent);\n buildList();\n closeDialog();\n }\n }\n\n function removeAorB(prefectA, prefectB) {\n //ask the user to ignore, or remove a or b\n document.querySelector(\"#remove_aorb\").classList.remove(\"hide\");\n document.querySelector(\"#remove_aorb .closebutton\").addEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_aorb #removea\").addEventListener(\"click\", removeA);\n document.querySelector(\"#remove_aorb #removeb\").addEventListener(\"click\", removeB);\n\n // show name on buttons\n document.querySelector(\"#remove_aorb [data-field=prefectA]\").textContent = prefectA.lastName;\n document.querySelector(\"#remove_aorb [data-field=prefectB]\").textContent = prefectB.lastName;\n // If ignore, do nothing\n function closeDialog() {\n document.querySelector(\"#remove_aorb\").classList.add(\"hide\");\n document.querySelector(\"#remove_aorb .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_aorb #removea\").removeEventListener(\"click\", removeA);\n document.querySelector(\"#remove_aorb #removeb\").removeEventListener(\"click\", removeB);\n }\n //if remove A:\n function removeA() {\n removePrefect(prefectA);\n makePrefect(selectedStudent);\n buildList();\n closeDialog();\n }\n //else - if removeB\n function removeB() {\n removePrefect(prefectB);\n makePrefect(selectedStudent);\n buildList();\n closeDialog();\n }\n }\n\n function removePrefect(prefectStudent) {\n prefectStudent.prefect = false;\n }\n\n function makePrefect(currentStudent) {\n currentStudent.prefect = true;\n }\n\n buildList();\n}", "function findPartner() {\n var users = JSON.parse(localStorage.getItem(\"usersTable\"));\n var values = Object.values(users);\n var keys = Object.keys(users);\n var minVal = Math.min(...values);\n for(let key in users) {\n if((users[keys[keys.length - 1]] === 1 ) || (users[key] > 1)) {\n document.querySelector('.modal-text').textContent = \"You've already connected with everyone! Try lunch instead.\";\n break;\n }\n else if(users[key] === minVal && users[key] < 2) {\n users[key]++;\n document.querySelector('.modal-text').textContent = `Get coffee with ${key}`;\n break;\n } \n }\n localStorage.setItem('usersTable', JSON.stringify(users));\n }", "async allUsernames(parent, args, ctx, info) {\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in to do that!\");\n }\n const users = await ctx.db.query.profiles({}, info);\n const notParticipants = users.filter(\n (user) =>\n user.permissions.includes(\"TEACHER\") ||\n user.permissions.includes(\"STUDENT\") ||\n user.permissions.includes(\"SCIENTIST\")\n );\n return notParticipants;\n }", "function copiafyv(principal, copia) {\n try {\n /*Analizo primero el root principal */\n principal.lista_Nodo.forEach(function (element) {\n if (element.tipo == \"Clase\") {\n MYFPrincipal = [];\n MYFfCopia = [];\n /*por cada calse encontrada, la busco en el otro arbol*/\n copia.lista_Nodo.forEach(function (element2) {\n if (element2.tipo == \"Clase\") {\n /*Por cada clase que encuentro en el otro root compruebo si son los mismos*/\n if (element.descripcion == element2.descripcion) {\n /*recorro para encontrar los metodos y funciones de la clase principal*/\n element.lista_Nodo.forEach(function (element3) {\n if (element3.tipo == \"Funcion\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosMF) {\n if (parametrosMF.tipo == \"Parametros\") {\n var parametroslst = returnLst(parametrosMF.lista_Nodo);\n element2.lista_Nodo.forEach(function (fmCopia) {\n if (fmCopia.tipo == \"Funcion\" && element3.tipodato == fmCopia.tipodato) {\n fmCopia.lista_Nodo.forEach(function (paramCopia) {\n if (paramCopia.tipo == \"Parametros\") {\n var parametroslstCopia = returnLst(paramCopia.lista_Nodo);\n if (parametroslst.toString() == parametroslstCopia.toString()) {\n console.log(\"las funciones \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia_Clase.push(element.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n else if (element3.tipo == \"Metodo\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosF) {\n if (parametrosF.tipo == \"Parametros\") {\n var parametroslstM = returnLst(parametrosF.lista_Nodo);\n element2.lista_Nodo.forEach(function (mCopia) {\n if (mCopia.tipo == \"Metodo\" && element3.descripcion == mCopia.descripcion) {\n mCopia.lista_Nodo.forEach(function (paramCopiaM) {\n if (paramCopiaM.tipo == \"Parametros\") {\n var parametroslstCopiaM = returnLst(paramCopiaM.lista_Nodo);\n if (parametroslstM.toString() == parametroslstCopiaM.toString()) {\n console.log(\"los metodos \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia.push(element3.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n });\n if (MYFPrincipal.toString() == MYFfCopia.toString()) {\n console.log(\"las clases \" + element.descripcion + \" Son iguales en ambos archivos\");\n }\n }\n }\n });\n }\n });\n }\n catch (error) {\n }\n}", "function obtener_superior() {\n\tcargando('Obteniendo información')\n\tvar superiores = document.getElementsByClassName('refer')\n\tfor (var i = 0; i < superiores.length; i++) {\n\t\tenvio = { numero: i, nombre: superiores[i].innerText }\n\t\t$.ajax({\n\t\t\tmethod: \"POST\",\n\t\t\turl: \"/admin-reportes/cabeza_principal\",\n\t\t\tdata: envio\n\t\t}).done((respuesta) => {\n\t\t\tdocument.getElementsByClassName('superior')[respuesta.numero].innerHTML = respuesta.referido\n\t\t\tvar env = { numero: respuesta.numero, nombre: document.getElementsByClassName('superior')[respuesta.numero].innerHTML }\n\t\t\t$.ajax({\n\t\t\t\tmethod: \"POST\",\n\t\t\t\turl: \"/admin-reportes/cabeza_principal\",\n\t\t\t\tdata: env\n\t\t\t}).done((respuesta) => {\n\t\t\t\tdocument.getElementsByClassName('principal')[respuesta.numero].innerHTML = respuesta.referido\n\t\t\t})\n\t\t})\n\t}\n\tno_cargando()\n}", "function desenhaPersonagemEsquerda() {\n\n context.drawImage(listaImagensCaminharEsquerda[imgEsqAtual], x, y, w, h);\n\n imgEsqAtual++;\n if (imgEsqAtual == 6)\n imgEsqAtual = 0;\n }", "function iniciarSesion() {\r\n // prompt(\"Ingresa tu usuario\")\r\n\r\n swal(\"Inicia sesión con tu nombre de usuario\", {\r\n content: 'input',\r\n })\r\n .then((name) => {\r\nfor( var i = 0; i < numUsers; i++){\r\nif(value==users[i]){\r\n swal(\"¡Bienvenido/a!\", name, \"success\");\r\n document.getElementById('usuario').innerHTML = value;\r\n document.getElementById('cerrar_Sesion').style.display = 'block';\r\n localStorage.setItem('nombreUsuario', value);\r\n console.log(value);\r\n document.getElementById('usuario').style.display = 'block';\r\n document.getElementById('iniciar_Sesion').style.display = 'none';\r\n console.log(i);\r\n} \r\n if (value !=users[i] & i == numUsers-1){\r\n swal(\"Debe registrarse primero\",\"\",\"warning\");\r\n }\r\n}\r\n})\r\n}", "function imprimir_nombre_de_coleccion(personas){\n for (var i =0; i< personas.length; i = i +1){\n console.log(personas[i].nombre);\n }\n}", "function noneInitializations(profile) {\n for (var i = 0; i < profile.length; i++) {\n if (profile[i])\n profile[i].style.display = \"none\"\n }\n} //end of noneInitializations", "programarPocoesLevel()\n\t//ps: soh o ControladorJogo chama esse metodo\n\t//programa para adicionar e remover todas as pocoes (tenta fazer com que o numero de maximo de pocoes do level seja adicionado antes do level acabar)\n\t{\n\t\tconst maxPocoesLevelAtual = ControladorPocaoTela._maxPocoesFromLevel(ControladorJogo.level);\n\t\tif (maxPocoesLevelAtual > this._qtdPocoesFaltaProgramar)\n\t\t//se usuario passou o level anterior mais rapido que o esperado e nao deu tempo de colocar algumas pocoes na tela, e, faltar mais pocoes doq o numero maximo de pocoes desse level, nao substitui\n\t\t{\n\t\t\tthis._qtdPocoesFaltaProgramar = maxPocoesLevelAtual;\n\t\t\tif (this._jahProgramouDeixarPocaoTela)\n\t\t\t\t//se jah deixou programado para colocar uma pocao na tela e ainda nao tirou essa pocao, teria uma pocao a mais nesse level\n\t\t\t\tthis._qtdPocoesFaltaProgramar--;\n\t\t}\n\n\t\t//dividir o tempo em qtdPocoesFaltaAdd vezes e deixar uma pocao para cada parcela desse tempo\n\t\tthis._intervaloCadaPocao = ControladorJogo.tempoEstimadoLevel(ControladorJogo.level) / this._qtdPocoesFaltaProgramar * 1000;\n\n\t\tthis._precisaSetarProgramarPocoes = this._jahProgramouDeixarPocaoTela;\n\t\t//se jah deixou programado de colocar uma pocao na tela e ainda nao tirou da tela, tem que esperar ela sair para programar de colocar a proxima pocao\n\t\t//nao tem como jah setar um Timer porque nao se saber quanto tempo falta para a pocao sair da tela\n\n\t\tif (!this._jahProgramouDeixarPocaoTela)\n\t\t\tthis._criarTmrsProgramarPocoes();\n\t}", "function profesores(){\n\t$.ajax({\n\t\ttype: 'POST',\n\t\tdataType: 'JSON',\n\t\tdata:{\n\t\t\ttypeQuery: \"selectProfesor\"\n\t\t},\n\t\turl: 'controller/ControladorGestionarGrupo.php',\n\t\tsuccess:function(data){\n\t\t\tvar profesores = data.length;\n\t\t\tfor (var i = 0; i < profesores; i++) {\n\t\t\t\t$('select.profesor').append('<option value=\"'+data[i].id_profesor+'\">'+data[i].nombres+' '+data[i].apellido_materno+' '+data[i].apellido_paterno+'</option>');\n\t\t\t}\n\t\t}\n\t});\n}", "function mostrarUsuarios(tipo) {\n const inscriptions = course.inscriptions;\n let lista = null;\n\n users = inscriptions?.map((inscription) => inscription.user);\n const teacher = new Array(course.creator);\n const delegate = new Array(course.delegate);\n\n if (tipo === 'Profesor') {\n lista = <UsersList courseId={courseId} users={teacher} setSelectedUser={(a)=>{console.log(a);}}/>;\n } else if (tipo === 'Delegados') {\n lista = <UsersList courseId={courseId} users={delegate} setSelectedUser={(a)=>{console.log(a);}} />;\n } else {\n lista = <UsersList courseId={courseId} users={users} setSelectedUser={(a)=>{console.log(a);}} />;\n }\n\n return lista;\n }", "function _AtualizaFeiticosConhecidosParaClassePorNivel(\n chave_classe, nivel, precisa_conhecer, feiticos_conhecidos) {\n // Se não precisa conhecer, o jogador pode adicionar feiticos como se fosse um grimório.\n if (feiticos_conhecidos.length == 0 && precisa_conhecer) {\n return;\n }\n var div_nivel = Dom('div-feiticos-conhecidos-' + chave_classe + '-' + nivel);\n AjustaFilhos(\n div_nivel,\n feiticos_conhecidos.length,\n // A funcao AjustaFilhos fornecera o indice.\n AdicionaFeiticoConhecido.bind(\n null, // this\n chave_classe,\n nivel));\n for (var indice = 0; indice < feiticos_conhecidos.length; ++indice) {\n // Adiciona os inputs.\n var dom = Dom('input-feiticos-conhecidos-' + chave_classe + '-' + nivel + '-' + indice);\n dom.value = feiticos_conhecidos[indice];\n var feitico_str = StringNormalizada(feiticos_conhecidos[indice]);\n if (feitico_str in tabelas_lista_feiticos_invertida) {\n feitico_str = tabelas_lista_feiticos_invertida[feitico_str];\n }\n if ((feitico_str in tabelas_lista_feiticos_completa) && ('descricao' in tabelas_lista_feiticos_completa[feitico_str])) {\n TituloSimples(tabelas_lista_feiticos_completa[feitico_str].descricao, dom);\n }\n }\n}", "recheckUserProfiles(data) {\n let key = 'UserProfiles_Re';\n return this.grabByIds({\n key: key,\n isByListOfIds: true,\n getTotalIdsCnt: () => data.totalIdsCnt,\n getListOfIds: () => data.listOfIds,\n getDataForIds: (indexes) => {\n let logins = {};\n for (let idx of indexes) {\n logins[idx] = data.listOfData[idx];\n }\n return logins;\n },\n fetch: (idx, login) => this.provider.getProfileInfo({login: login}),\n process: (idx, obj, login) => this.processer.processProfile(null, login, obj),\n });\n }", "function esProtesisf(diente, codigopieza){\n\t\t\n\t\tvar esProtesisf = false;\n\t\tvar color = 'blue';\n\t\tvar pdiente = \"\"; //primer diente\n\t\tvar udiente = \"\"; // ultimo diente\n\t\tvar protesisfcompleto = false;\n\t\tvar salida ='';\n\n\t\tvar esCor = false;\n\t\tvar color = 'blue';\n\n\t\tvar trat_protesisf = ko.utils.arrayFilter(vm.tratamientosAplicados(), function(t){\n\t\t\treturn t.tratamiento.id == codigopieza;\n\t\t});\t\n\n\t\ttry {\n\n \tfor (var i = 0; i <= trat_protesisf.length - 1; i++) {\n\t\t\tvar t = trat_protesisf[i];\n \n // Si esta completo el puente\n if (t.diente.id.indexOf('_') > -1) { \n\t\t pdiente = t.diente.id.substring(0, t.diente.id.indexOf('_'));\t\n\t\t\t udiente = t.diente.id.substring(t.diente.id.lastIndexOf('_')+3, t.diente.id.length - t.diente.id.lastIndexOf('_'));\n\n // si estan definidos ambos dientes del puente devuelvo el tratamiento\n\t\t\t if(pdiente>0 && udiente>0 && diente.id==pdiente){ \n\t\t\t \t esProtesisf = true;\n\t\t\t \t protesisfcompleto = true;\n\n\t\t if (t.tratamiento.id == \"01.09\" || t.tratamiento.id == \"01.03\" || t.tratamiento.id == \"01.10\"){\n\t\t\t\t\t color = t.tratamiento.color;\n\t\t } \n\t\t\t \t salida=[esProtesisf,color,pdiente,udiente, protesisfcompleto];\n\t\t\t }\n\t\t\t // con que uno este definido ya es puente\n\t\t\t if(pdiente>0 && udiente>0 && diente.id==pdiente){ \n\t\t\t \t esProtesisf = true;\n\t\t\t \t salida=[esProtesisf,color,pdiente,udiente, protesisfcompleto];\n\t\t\t }\n\t\t\t \n\t\t\t} \n\t\t};\n \n }\n catch(err) {\n\t\t \n\t\t}\n \treturn salida;\n\n\t}", "function cargarProvincias() {\n //Inicializamos el array.\n let array = [\"Guayaquil\",\n \"Quito\",\n \"Cuenca\",\n \"Santo Domingo\",\n \"Machala\",\n \"Duran\",\n \"Manta\",\n \"Portoviejo\",\n \"Loja\",\n \"Ambato\",\n \"Esmeraldas\",\n \"Quevedo\",\n \"Riobamba\",\n \"Gualaceo\",\n \"Cariamanga\",\n \"Montalvo\",\n \"Macara\",\n\n \"Zamora\",\n \"Puerto Ayora\",\n \"Salitre\",\n \"Tosagua\",\n \"Pelileo\",\n \"Pujili\",\n \"Tabacundo\",\n \"Puerto Lopez\",\n \"San Vicente\",\n \"Santa Ana\",\n \"Zaruma\",\n \"Balao\",\n \"Rocafuerte\",\n \"Yantzaza\",\n \"Cotacachi\",\n \"Santa Lucia\",\n \"Cumanda\",\n \"Palestina\",\n \"Alfredo Baquerizo Moreno\",\n \"Nobol\",\n \"Mocache\",\n \"Puebloviejo\",\n \"Portovelo\",\n \"Sucua\",\n \"Guano\",\n \"Pillaro\",\n \"Gualaquiza\",\n \"Paute\",\n \"Saquisili\",\n \"Pajan\",\n \"San Miguel\",\n \"Puerto Baquerizo Moreno\",\n \"Catacocha\",\n \"Palenque\",\n \"Alausi\",\n \"Catarama\",\n \"Flavio Alfaro\",\n \"Colimes\",\n \"Echeandia\",\n \"Jama\",\n \"Isidro Ayora\",\n \"Muisne\",\n \"Santa Isabel\",\n \"Pedro Vicente Maldonado\",\n \"Biblian\",\n \"Archidona\",\n \"Junin\",\n \"Baba\",\n \"Pimampiro\",\n \"Camilo Ponce Enriquez\",\n \"El Tambo\",\n \"El Angel\",\n \"Alamor\",\n \"Chambo\",\n \"Celica\",\n \"Chordeleg\",\n \"Balsas\",\n \"Saraguro\",\n \"El Chaco\",\n \"Giron\",\n \"Huaca\",\n \"Chunchi\",\n \"Pallatanga\",\n \"Marcabeli\",\n \"Sigsig\",\n \"Urcuqui\",\n \"Loreto\",\n \"Rioverde\",\n \"Zumba\",\n \"Palora\",\n \"Mira\",\n \"El Pangui\",\n \"Puerto Quito\",\n \"Sucre\",\n \"Chillanes\",\n \"Quero\",\n \"Guamote\",\n \"Cevallos\",\n \"Zapotillo\",\n \"Zumbi\",\n \"Patate\",\n \"Puerto Villamil\",\n \"Lumbaqui\",\n \"Palanda\",\n \"Sigchos\",\n \"Pindal\",\n \"Guayzimi\",\n \"Baeza\",\n \"El Corazon\",\n \"Paccha\",\n \"Amaluza\",\n \"Las Naves\",\n \"San Fernando\",\n \"Gonzanama\",\n \"San Juan Bosco\",\n \"Yacuambi\",\n \"Santa Clara\",\n \"Arajuno\",\n \"Tarapoa\",\n \"Tisaleo\",\n \"Suscal\",\n \"Nabon\",\n \"Mocha\",\n \"La Victoria\",\n \"Guachapala\",\n \"Santiago\",\n \"Chaguarpamba\",\n \"Penipe\",\n \"Chilla\",\n \"Paquisha\",\n \"Carlos Julio Arosemena Tola\",\n \"Sozoranga\",\n \"Pucara\",\n \"Huamboya\",\n \"Quilanga\",\n \"Mera\",\n \"Olmedo\",\n \"Deleg\",\n \"La Bonita\",\n \"El Pan\",\n \"Tiputini\"\n ];\n //Ordena el array alfabeticamente.\n array.sort();\n //Pasamos a la funcion addOptions(el ID del select, las provincias cargadas en el array).\n addOptions(\"provincia\", array);\n}", "function partidaGanada(){\n\tif(contParejas == (imagenesOcultas.length/2)){\n\t\tanadirTexto(\"Enhorabuena, has ganado la partida.\");\n\t\tanadirTexto(\"Después de \"+contIntentos+\" intentos has encontrado todas las parejas.\");\n if(contrarreloj)\n anadirTexto(\"Te han sobrado \"+minPasados+\" minutos y \"+segPasados+\" segundos.\"); \n gameStart=false;\n\t}\n}", "function asociarPermisoAUsuario(usersSelected){\n\n var form = document.getElementById(\"form_mis_tablones\");\n var e;\n var nombre;\n var text;\n var input;\n\n //alert(document.getElementById(\"paraeliminar\"));\n\n if(document.getElementById(\"paraeliminar\") != null){//si existe\n\n form.removeChild(document.getElementById(\"paraeliminar\"));\n }\n\n/*creo un div dinámicamente, estoy me favorece mucho a la hora de eliminar después todos sus nodos para reescribirlos*/\n e = document.createElement(\"div\");\n e.id = \"paraeliminar\";\n form.appendChild(e);\n \n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n /*crea la cadena: Asociar permiso a usuario:*/\n var p = document.createElement(\"p\"); \n var b = document.createElement(\"b\");\n b.name= \"eliminar\";\n var asociarCadena = document.createTextNode(\"Asociar permiso a usuario:\");\n b.appendChild(asociarCadena);\n e.appendChild(b);\n\n\n for(var i = 0; i<usersSelected.length; i++){\n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n p.name = \"eliminar\";\n e.appendChild(p);\n /**/\n\n\n nombre = document.createTextNode(usersSelected[i].name + \" \" + usersSelected[i].surname1 + \" \" + usersSelected[i].surname2);\n e.appendChild(nombre);\n\n \n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"1\";\n\n\n e.appendChild(document.createTextNode(\"Lectura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"2\";\n\n e.appendChild(document.createTextNode(\"Escritura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"4\";\n\n e.appendChild(document.createTextNode(\"Lectura remota\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"8\";\n\n e.appendChild(document.createTextNode(\"Escritura remota\"));\n e.appendChild(input);\n\n \n //alert(\"undefined? : \" + usersSelected[i].name);\n\n //checkbox.id = \"id\";\n\n\n \n\n e.appendChild(input);\n }\n\n}", "function rimuovi(){\n\n\tvar j = 0;\n\n\t// Per ogni elemento controllo la condizione\n\t// Se è idoneo, copio elemento in J\n\n\tfor(var i = 0; i<persone.length; i++){\n\t\tif(persone[i].altezza > 1.5) {\n\t\t\tpersone[j++] = persone[i];\n\t\t}\n\t}\n\t// Aggiorno array con valori nuovi messi in J\n\tpersone.length = j;\n\n\t// Visualizzo\n\tvisualizzaPersone();\n}", "function choquebloques() {\n let fichas = document.getElementsByClassName('ficha');\n let bolas = document.getElementsByClassName('bola');\n for (let c = 0; c < fichas.length; c++) {\n for (let x = 0 ; x < bolas.length; x++) {\n if (((bolas[x].offsetLeft + 16) > fichas[c].offsetLeft) && (bolas[x].offsetLeft < (fichas[c].offsetLeft + fichas[c].offsetWidth))) {\n if (((bolas[x].offsetTop + 16) > fichas[c].offsetTop) && (bolas[x].offsetTop < (fichas[c].offsetTop + fichas[c].offsetHeight)) && (bolas[x].getAttribute('puedegolp') == 1)) {\n bolas[x].setAttribute('puedegolp', 0);\n bolas[x].setAttribute('velocidad', (parseFloat(bolas[x].getAttribute('velocidad')) + 0.30));\n recargabola = setTimeout(carga, 22);\n choqueficha(fichas[c], bolas[x]);\n /*calculo angulo salida choque*/\n /*activacion de buff*/\n /*desaparicion ficha*/\n\n x = bolas.length;\n }\n }\n\n }\n }\n\n\n }", "function spin(){\n \n newPlayers();\n\n playersName();\n \n reglas();\n\n //Con este while se comienza el juego. Se repetira siempre y cuando el jugador de OK para la sig. ronda, y hasta que se contesten\n // todas las letras.\n \n ronda(preguntas);\n \n chequeo();\n\n \n\n crearLista();\n\n console.log(`Has acertado ${letrasAcertadas} palabras, has fallado en ${letrasErradas} palabras \\n\n y has dejado sin contestar ${noSabeNoContesta} palabras.`)ñ\n \n \n reset();\n \n //Esta funcion corrobora el total de letras contestas (bien o mal) y finaliza el juego si no hay mas letras que adivinar. \n function chequeo(){\n \n contador(preguntas);\n\n if(palabrasTotales == 27){\n final = true;\n alert('No quedan mas letras en el abecedario. :(');\n } else {\n proxturno = confirm('Desea seguir con la siguiente ronda?');\n }\n\n if(proxturno == false){ \n final = true;\n }\n }\n\n //Esta funcion muestra las reglas del juego.\n function reglas(){\n console.log(`Bienvenido ${nombreJugador}. Las reglas son las siguientes: \\n\n -Sumaras 1 punto por cada letra acertada.\n -Si contestas \"pasapalabra\", podras responder esa pregunta en la proxima ronda.\n -CUIDADO!! Si dejas en blanco y presionas OK, se considera como errada.\n -Puedes escribir \"END\" para finalizar el juego en el momento que quieras.\n Muchas suerte ${nombreJugador}. Y recuerda...no hagas trampa, porque lo sabremos ¬¬`)\n };\n\n //Esta funcion crea un elemento para el objeto listaJugadores, para luego ser usada para armar el ranking.\n function crearLista(){\n listaJugadores.push({nombre: nombreJugador, puntos: letrasAcertadas});\n };\n\n }", "function siguientePregunta() {\n if (i == 25 || completarPasapalabra) {\n // Aca solo vamos a entrar si llegamos a la Z o si estamos en un completar pasapalabra (o sea ya dimos x lo menos una vuelta)\n //la primera vez entra por el i despues entra por completarPasapalabra que es true\n completarPasapalabra = true;\n // Refrescar el indice i, con el primer estado.pasapalabra\n // Esta 'flag' es para que si encontramos un indice i siguiente no vuelva a modificarlo\n shouldEnter = true;\n //For que recorre todo el array de estados. e = elemento (estado) en la posicion indice \n arrResultados.forEach((e, indice) => {\n if (shouldEnter && e === estado.pasapalabra && indice >= i) {\n i = indice;\n shouldEnter = false;\n }\n });\n // La logica anterior no funciona si queremos pasar de un indice mayor a otro menor\n // Ej: Estamos en X y el pasapalabra siguiente esta en C\n if (shouldEnter) {\n // findIdex nos devuelve el indice del primer estado = pasapalabra en el arrResultados\n // Devuleve -1 en el caso que no existan estado = pasapalabra\n i = arrResultados.findIndex(x => x == estado.pasapalabra);\n }\n\n // Chequeamos que exista siguiente pasapalabra\n if (i != -1) {\n // Si existe le hacemos focus\n next();\n focusInput()\n } else {\n // Si no existe terminamos el juego\n i = 25;\n detener();\n }\n } else {\n next();\n focusInput()\n }\n}", "promptIndividualStandup() {\n let rmUserArr = [];\n this.getUsers().then(res => {\n res.forEach(res => {\n rmUserArr.push(res.username);\n });\n });\n this.getChannelMembers().then(res => {\n let allChannelUsers = res.members;\n allChannelUsers = allChannelUsers.filter(\n item => !rmUserArr.includes(item)\n );\n\n allChannelUsers.forEach(user => {\n this.sendMessageToUser(user, pickRandomPromptMsg());\n });\n });\n }", "function manageProbands(count, first){\n\n // get checked probands if its not the first draw of an image - in this case select only proband 1\n if(!first){\n var checkedProbands = [];\n for(var i = 0; i < count; i++){\n if($('input[id=user' + parseInt(i+1) + ']').attr('checked'))\n checkedProbands[i] = true;\n else\n checkedProbands[i] = false;\n }\n }\n\n var div = $('#multipleUserDiv');\n // clear div\n div.empty();\n\n // form div\n div.append('<h4>Blickdaten:</h4><br>');\n\n if(count < 1)\n alert('No gaze data available!');\n else{\n var visualization = $('#visSelect').val();\n \n for(var i=0; i < count; i++){\n \n var i_n = parseInt(i+1);\n \n // add checkboxes for probands\n var id = \"user\" + (parseInt(i)+1);\n div.append('<input type=\"checkbox\" id=\"' + id + '\" onchange=\"visualizationChanged()\"> Proband ' + i_n);\n \n // append fixation color pickers\n if(visualization == \"gazeplot\"){\n \n $('#'+id).css('float', 'left').css('overflow', 'hidden');\n \n var fp = 'fixColorpicker'+i_n;\n var fc = 'fixationColor'+i_n;\n \n div.append('<div id=\"' + fc + '\" style=\"background:' + color[i] + '; width:25px; height:25px; float:right; margin-right: 20px; z-index:5; border:2px solid #000000;\" onclick=\"showColorpicker(' + fp + ')\">');\n div.append('<div id=\"' + fp + '\"/><br><br>');\n \n fp = '#fixColorpicker'+i_n;\n fc = '#fixationColor'+i_n;\n \n // register color picker for fixation circles\n registerColorpicker($(fp), $(fc), color[i]);\n }\t\n // no seperate colorpickers needed\n else if(visualization == \"heatmap\" || visualization == \"attentionmap\"){\n div.append('<br>');\n }\n } \n }\n \n // preselect probands\n if(first)\n $('input[id=user1]').attr('checked', true);\n else{\n for(var i=0; i < count; i++){\n if(checkedProbands[i] && checkedProbands[i] != \"2\"){\n $('input[id=user' + parseInt(i+1) + ']').attr('checked', true);\n } \n }\n }\n \n div.show();\n}", "function generarCola(usuario,permiso) {\n\tconsole.log(\"generamos cola\");\n\tlet tabla = {\n\t\t\"datos\":[\n\t\t\t{\n\t\t\t\t\"Estado\":\"Genera permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdtes. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Ausencia finalizada\",\n\t\t\t\t\"Contador\":0\n\t\t\t}\n\t\t]\n\t};\n\tswitch (permiso) {\n\t\tcase \"Profesor\":\n\t\t\tpideDatos(\"peticion\",\"?usuario=\"+usuario,(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tbreak;\n\t\tcase \"Directivo\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\tif (dato[\"estado_proceso\"]===1 || dato[\"estado_proceso\"]===3){\n\t\t\t\t\t\t\tif (dato.usuario===usuario){\n\t\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\n\n\t\t\tbreak;\n\t\tcase \"Admin\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\t\t\tbreak;\n\t}\n}", "profile (state, getters) {\n return state.profile.filter(prof => {\n return prof.user === getters.user.id\n })\n }", "function updateUsernames(){\r\n\t\tconsole.log(\"#Update User\");\r\n\t\tpicsy = [];\r\n\t\tfor(i = 0; i< profilpics.size;i++){\r\n\t\t\tpicsy[i]=profilpics.get(Object.keys(users)[i]);\r\n\t\t\tconsole.log('##'+i+\"##\"+picsy[i]);\r\n\t\t}\r\n\t\tio.sockets.emit('get users', Object.keys(users), picsy);\r\n\t\tdatabaseGetUserNames();\r\n\t}", "function limpiarCapas(){\n limpiarCapaRecorridos();\n limpiarCapaParadas();\n limpiarCapaNuevaRuta();\n limpiarCapturaNuevaRuta();\n limpiarCapaEstudiantes();\n}", "busquedaUsuario(termino, seleccion) {\n termino = termino.toLowerCase();\n termino = termino.replace(/ /g, '');\n this.limpiar();\n let count = +0;\n let busqueda;\n this.medidoresUser = [], [];\n this.usersBusq = [], [];\n for (let index = 0; index < this.usuarios.length; index++) {\n const element = this.usuarios[index];\n switch (seleccion) {\n case 'nombres':\n busqueda = element.nombre.replace(/ /g, '').toLowerCase() + element.apellido.replace(/ /g, '').toLowerCase();\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n case 'cedula':\n busqueda = element.cedula.replace('-', '');\n termino = termino.replace('-', '');\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n default:\n count = -1;\n break;\n }\n }\n if (count < 1) {\n this.usersBusq = null;\n }\n this.conteo_usuario = count;\n }", "function escucha_users(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByTagName(\"article\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\tlimpiar(\"article\");\n\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\tvar y=$(this).find(\"input\");\n\t\t\tconfUsers[indice]=y.val();\n\t\t\tconsole.log(confUsers[indice]);\n\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\tsessionStorage.setItem(\"conf\", confUsers[indice]);\n\t\t};\n\t}\n}", "function enemyMortgage() {\n function mortgageUcards(obj) {\n if(obj.type == \"uCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgageU = propertyCards.filter(mortgageUcards);\n\n function mortgageVcards(obj) {\n if(obj.type == \"vCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgageV = propertyCards.filter(mortgageVcards);\n\n\n function mortgagePcards2(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 1 ){\n if(obj.color == \"darkblue\" || obj.color == \"purple\"){\n return true\n }\n }\n }\n var toMortgageP2 = propertyCards.filter(mortgagePcards2);\n\n\n function mortgagePcards3(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 1 ){\n if(obj.color !== \"darkblue\" || obj.color !== \"purple\"){\n return true\n }\n }\n }\n var toMortgageP3 = propertyCards.filter(mortgagePcards3);\n\n function mortgagePcards1(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 2 ){\n if(obj.color !== \"darkblue\" || obj.color !== \"purple\"){\n return true\n }\n }\n }\n var toMortgageP1 = propertyCards.filter(mortgagePcards1);\n\n function mortgagePcardsRest(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgagePRest = propertyCards.filter(mortgagePcardsRest);\n\n if(toMortgageU.length>0){\n for(var i =0; i<toMortgageU.length; i++){\n toMortgageU[i].inPlay = \"no\";\n enemyCash += toMortgageU[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageU[i].name)\n }\n }else if(toMortgageV.length>0){\n for(var i =0; i<toMortgageU.length; i++){\n toMortgageV[i].inPlay = \"no\";\n enemyCash += toMortgageV[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageV[i].name)\n }\n }else if (toMortgageP2.length>0){\n for(var i =0; i<toMortgageP2.length; i++){\n toMortgageP2[i].inPlay = \"no\";\n enemyCash += toMortgageP2[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP2[i].name)\n }\n }else if (toMortgageP3.length>0){\n for(var i =0; i<toMortgageP3.length; i++){\n toMortgageP3[i].inPlay = \"no\";\n enemyCash += toMortgageP3[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP3[i].name)\n }\n }else if (toMortgageP1.length>0){\n for(var i =0; i<toMortgageP1.length; i++){\n toMortgageP1[i].inPlay = \"no\";\n enemyCash += toMortgageP1[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP1[i].name)\n }\n }else if (toMortgagePRest.length>0){\n for(var i =0; i<toMortgagePRest.length; i++){\n toMortgagePRest[i].inPlay = \"no\";\n enemyCash += toMortgagePRest[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgagePRest[i].name)\n }\n }\n}", "function newUser() { // Ajout d'un nouvel utilisateur\n\n // Cible le container des profils\n const userProfileContainer = document.querySelector(\".user-profile-container\");\n\n let myName = prompt(\"Prénom de l'utilisateur\");\n\n if (myName.length !== 0) { // On vérifie que le prompt ne soit pas vide\n\n usersNumber+=1; // Incrémente le nombre d'utilisateurs\n\n // 1 - Créer un nouveau user-profile\n const userProfile = document.createElement(\"div\");\n // Lui assigner la classe userProfileContainer\n userProfile.classList.add(\"user-profile\");\n // Lui assigner un ID\n userProfile.id = `user-profile-${usersNumber}`; \n // L'ajouter au DOM \n userProfileContainer.insertBefore(userProfile, document.querySelector(\"#add-user\"));\n\n // 2 - Créer un nouveau user portrait\n const userPortrait = document.createElement(\"div\");\n // Lui assigner la classe portrait\n userPortrait.classList.add(\"user-portrait\");\n // Lui assigner un ID\n userPortrait.id = `user-portrait-${usersNumber}`;\n // L'ajouter au DOM\n document.getElementById(`user-profile-${usersNumber}`).appendChild(userPortrait);\n\n // 3 - Créer un nouveau user-portrait__image\n const userPortraitImage = document.createElement(\"img\");\n // Lui assigner la classe userImage\n userPortraitImage.classList.add(\"user-portrait__image\");\n // Lui assigner un ID\n userPortraitImage.id = `user-portrait-image-${usersNumber}`;\n // Ajouter une image automatiquement\n userPortraitImage.src = \"assets/img/new_user_added.png\";\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userPortraitImage);\n\n // 4 - Créer un nouveau user-name\n const userName = document.createElement(\"h2\");\n // Lui assigner la classe profileName\n userName.classList.add(\"user-name\");\n // Utiliser un innerHTML pour afficher le nom\n userName.innerHTML = myName;\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userName);\n }\n}", "function pintarActividades(pListaActividades){ //aqui repintamos la lista completa\n seccionActividades.innerHTML = \"\"; //aqui estoy borrando todas actividades antes pintadas para que se muestren las que pinto ahora\n\n if(pListaActividades.length !=0) {\n pListaActividades.forEach( actividad => { //aqui estamos recorriendo los elementos de la lista para ver cual cumple lo que buscamos\n pintarActividad(actividad); //aqui reutilizamos la funcion pintarActividad que se encuentra en la linea 133\n })\n\n } else{\n seccionActividades.innerHTML = \"<h2>No hay registros con esas condiciones</h2>\" \n }\n}", "function cruzamiento(poblacion,seleccion,ciudades,elite)\n\t\t\t{\n\t\t\t\tvar numPobla = poblacion.length;\n\t\t\t\tvar indice1,indice2;\n\t\t\t\tvar k = 0;\n\t\t\t\tvar new_poblation = new Array();\n\t\t\t\t/*Genero nueva poblacion*/\n\t\t\t\twhile(k < parseInt(numPobla / 2))\n\t\t\t\t{\n\t\t\t\t\t//Escogo el metodo de seleccion para tener dos PADRES\n\t\t\t\t\tswitch(seleccion)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Torneo\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t\tindice2 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Ranking\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Aleatorio\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t\tindice2 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(indice1);\n\t\t\t\t\t//console.log(indice2);\n\t\t\t\t\t/*Padres*/\n\t\t\t\t\tvar dad = poblacion[indice1].recorrido; \n\t\t\t\t\tvar mom = poblacion[indice2].recorrido;\n\t\t\t\t\t/*Camino para Hijos*/\n\t\t\t\t\tvar camino1 = new Array();\n\t\t\t\t\tvar camino2 = new Array();\n\t\t\t\t\t/*Numero entre 0 y numero de ciudades menos 1*/\n\t\t\t\t\tbp = parseInt( Math.random() * ciudades ); /*Punto de roptura*/\n\n\t\t\t\t/*-----------Genero 2 nuevos caminos-----------*/\n\t\t\t\t\t//Respaldo caminos de papa y mama hasta bp\n\t\t\t\t\tfor(var i = 0; i < bp; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcamino1.push(dad[i]);\n\t\t\t\t\t\tcamino2.push(mom[i]);\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i = 0; i < ciudades; i++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//Tomo el elemento a buscar en el segundo vector\n\t\t\t\t\t\tvar busca1 = mom[i];\n\t\t\t\t\t\tvar busca2 = dad[i];\n\t\t\t\t\t\tfor(var j = bp; j < ciudades; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(busca1 == dad[j])\n\t\t\t\t\t\t\t\tcamino1.push(busca1);\n\t\t\t\t\t\t\tif(busca2 == mom[j])\n\t\t\t\t\t\t\t\tcamino2.push(busca2); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*Hijos generados*/\n\t\t\t\t\tvar hijo1 = {recorrido: camino1, distancia: aptitud(camino1,region)}\n\t\t\t\t\tvar hijo2 = {recorrido: camino2,distancia : aptitud(camino2,region)}\n\n\t\t\t\t\tnew_poblation.push(hijo1);\n\t\t\t\t\tnew_poblation.push(hijo2);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\treturn new_poblation;\n\t\t\t}", "function pegapontos(i) {\n if (jogadores[i].pontos > maiorPontuacao) {\n maiorPontuacao = jogadores[i].pontos;\n indice = i;\n jogadores[indice].status = \"campeao\";\n } else if (jogadores[i].pontos == jogadores[indice].pontos) {\n jogadores[indice].status = \"empate\";\n jogadores[i].status = \"empate\";\n indice = 0;\n }\n for (var i = 0; i < jogadores.length; i++) {\n if (\n jogadores[i].status == \"empate\" &&\n jogadores[indice].status == \"campeao\"\n ) {\n jogadores[i].status = \"\";\n } // fechamento da comparacao do status\n } // fechamento do laco de repeticao do indice\n exibeJogadoresNaTela(jogadores);\n} // fim da função", "procesa() {\n if (!this.setFrase) //Si la frase es variable\n this.frase = prompt(\"Escribe una frase\", \"Hola\").toUpperCase();\n\n this.tempData = this.data.slice(); //Necesitamos una copia, dado que el fondo es blanco.\n this.limpiaCanvas(); // Limpiamos el fondo\n super.procesa((w, h) => {\n this.ctx.font = h+\"px Arial\"; //Asignamos el tamaño de letra a la altura de la seccion.\n });\n }", "function pintaActivas(arreglo,filtrados){\r\n\t$('#proceso').hide();\r\n\thtml=inicio();\r\n\r\n\tvar cont=0;\r\n\tvar existe_modulo=false;\r\n\tvar submodulos_global=[];\r\n\t\r\n\tfor(var i=0;i<arreglo.length;i++){\r\n\t\tvar existe_submodulo=false;\r\n\t\tvar existe_submodulo2=false;\r\n\t\tvar existe_submodulo3 = false;\r\n\t\t$.each($(\".permisos_sub\"),function(index, value){\r\n\t\t\tif(value.value=='PRIVILEGIO.MENU.VOKSE.16=true'){\r\n\t\t\t\texiste_modulo=true;\r\n\t\t\t}\r\n\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont].estatusid+'=true'){\r\n\t\t\t\texiste_submodulo=true;\r\n\t\t\t}\r\n\t\t\tif(arreglo[i]==2){\r\n\t\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont+1].estatusid+'=true'){\r\n\t\t\t\t\texiste_submodulo2=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(arreglo[i]==3){\r\n\t\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont+1].estatusid+'=true'){\r\n\t\t\t\t\texiste_submodulo2=true;\r\n\t\t\t\t}\r\n\t\t\t\tif(value.value=='PRIVILEGIO.SUBMENU.VOKSE.16,'+filtrados[cont+2].estatusid+'=true'){\r\n\t\t\t\t\texiste_submodulo3=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tvar cadenas=filtrados[cont].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\tvar cant=\"\";\r\n\t\tvar color=\"\";\r\n\t\tvar estatusId = filtrados[cont].estatusid;\r\n\t\t\r\n\t\tif(filtrados[cont].totalSum!=undefined){\r\n\t\t\tcant=filtrados[cont].totalSum;\r\n\t\t}else{\r\n\t\t\tcant=filtrados[cont].total;\r\n\t\t}\r\n\t\t\tif(existe_submodulo==true || existe_modulo==false && filtrados[cont].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont].estatusid);\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\tif(arreglo[i]==1){\r\n\t\t\thtml=html+simple(cadenas[1] ,cant ,cadenas[0], color, estatusId, MDS_ACTIVAS);\r\n\t\t}\r\n\t\tif(arreglo[i]==2){\r\n\t\t\tvar cadenas2= filtrados[cont+1].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\t\tvar cant2= \"\";\r\n\t\t\tvar color2=\"\";\r\n\t\t\tvar estatusId2 = filtrados[cont+1].estatusid;\r\n\t\t\t\r\n\t\t\tif(filtrados[cont+1].totalSum!=undefined){\r\n\t\t\t\tcant2=filtrados[cont+1].totalSum;\r\n\t\t\t}else{\r\n\t\t\t\tcant2=filtrados[cont+1].total;\r\n\t\t\t}\r\n\t\t\tif(existe_submodulo2==true || existe_modulo==false && filtrados[cont+1].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor2=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor2=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor2=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\thtml=html+doble(cadenas[1] ,cant ,cadenas[0],color ,cadenas2[1] ,cant2 ,cadenas2[0], color2, estatusId, estatusId2, MDS_ACTIVAS);\t\r\n\t\t\t\r\n\t\t\tcont++;\r\n\t\t}\r\n\t\tif(arreglo[i]==3){\r\n\t\t\tvar cadenas2= filtrados[cont+1].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\t\tvar cant2= \"\";\r\n\t\t\tvar color2=\"\";\r\n\t\t\tvar estatusId2 = filtrados[cont+1].estatusid;\r\n\t\t\tvar cadenas3= filtrados[cont+2].estatus.replace('VALIDACION','VOBO').split('-',2);\r\n\t\t\tvar cant3= \"\";\r\n\t\t\tvar color3=\"\";\r\n\t\t\tvar estatusId3 = filtrados[cont+2].estatusid;\r\n\t\t\t\r\n\t\t\tif(filtrados[cont+1].totalSum!=undefined){\r\n\t\t\t\tcant2=filtrados[cont+1].totalSum;\r\n\t\t\t}else{\r\n\t\t\t\tcant2=filtrados[cont+1].total;\r\n\t\t\t}\r\n\t\t\tif(filtrados[cont+2].totalSum!=undefined){\r\n\t\t\t\tcant3=filtrados[cont+2].totalSum;\r\n\t\t\t}else{\r\n\t\t\t\tcant3=filtrados[cont+2].total;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(existe_submodulo2==true || existe_modulo==false && filtrados[cont+1].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor2=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor2=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor2=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont+1].estatusid);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(existe_submodulo3==true || existe_modulo==false && filtrados[cont+2].areaValidacion==$('#areaId').val() && perfil!='3'){\r\n\t\t\t\tcolor3=\"verde cursor\";\r\n\t\t\t\tsubmodulos_global.push(filtrados[cont+2].estatusid);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcolor3=\"blanco\";\r\n\t\t\t\tif(perfil=='3'){\r\n\t\t\t\t\tcolor3=\"blanco cursor\";\r\n\t\t\t\t\tsubmodulos_global.push(filtrados[cont+2].estatusid);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\thtml=html+triple(cadenas[1] ,cant ,cadenas[0],color ,cadenas2[1] ,cant2 ,cadenas2[0].replace('CORRECCIÓN',''), color2, estatusId, estatusId2,estatusId3, MDS_ACTIVAS,cadenas3[1] ,cant3 ,cadenas3[0].replace('CORRECCIÓN',''),color3);\t\r\n\t\t\t\r\n\t\t\tcont += 2;\r\n\t\t}\r\n\t\tcont++;\r\n\t}\r\n\tEnviaSubmodulosAction(submodulos_global);\r\n\t\r\n\t$('#proceso').html(html);\r\n\t$('.hexa').css('background-image','url(\"img/hexaverde.svg\")');\r\n\t\r\n\t$('#proceso').fadeIn();\r\n\tcierraLoading();\r\n}", "function Criar_Ordem_Eventos(vetorPlayersUser)\r\n{\r\n Valor_Num_Jogadores=vetorPlayersUser.length;\r\n if ($Gen==1)\r\n {\r\n //Seleciona a ordem dos eventos do torneio\r\n switch(Valor_Num_Jogadores)\r\n {\r\n case 2:\r\n Eventos = {\r\n Player:[1,2,1,2,2,1,2,1,2,1,1,2,1,2,2,1,2,1,1,2,2,1,2,1,1,2,1,2,1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,2,2,1,2,1],\r\n Situacao:[\"B1\",\"B1\",\"P1\",\"P1\",\"B2\",\"B2\",\"P2\",\"P2\",\"B3\",\"B3\",\"B4\",\"B4\",\"B5\",\"B5\",\"B6\",\"B6\",\"P3\",\"P3\",\"B7\",\"B7\",\"B8\",\"B8\",\"B9\",\"B9\",\"B10\",\"B10\",\"P4\",\"P4\",\"B11\",\"B11\",\"B12\",\"B12\",\"B13\",\"B13\",\"B14\",\"B14\",\"P5\",\"P5\",\"B15\",\"B15\",\"B16\",\"B16\",\"B17\",\"B17\",\"B18\",\"B18\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,]\r\n };\r\n break;\r\n case 3:\r\n Eventos = {\r\n Player:[1,2,3,1,2,3,3,2,1,3,2,1,3,1,2,1,3,2,1,3,2,3,1,2,3,1,2,1,3,2,3,1,2,3,1,2,1,3,2,1,3,2,2,1,3,2,3,1,2,3,1,2,1,3,2,1,3,2,3,1,2,1,3,2,1,3,2,3,1,2,3,1],\r\n Situacao:[\"B1\",\"B1\",\"B1\",\"P1\",\"P1\",\"P1\",\"B2\",\"B2\",\"B2\",\"P2\",\"P2\",\"P2\",\"B3\",\"B3\",\"B3\",\"B4\",\"B4\",\"B4\",\"B5\",\"B5\",\"B5\",\"B6\",\"B6\",\"B6\",\"P3\",\"P3\",\"P3\",\"B7\",\"B7\",\"B7\",\"B8\",\"B8\",\"B8\",\"B9\",\"B9\",\"B9\",\"B10\",\"B10\",\"B10\",\"P4\",\"P4\",\"P4\",\"B11\",\"B11\",\"B11\",\"B12\",\"B12\",\"B12\",\"B13\",\"B13\",\"B13\",\"B14\",\"B14\",\"B14\",\"P5\",\"P5\",\"P5\",\"B15\",\"B15\",\"B15\",\"B16\",\"B16\",\"B16\",\"B17\",\"B17\",\"B17\",\"B18\",\"B18\",\"B18\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n case 4:\r\n Eventos = {\r\n Player:[1,2,3,4,1,2,3,4,4,3,2,1,3,4,1,2,2,1,4,3,3,4,1,2,2,1,4,3,3,4,1,2,2,1,4,3,4,3,1,2,1,2,4,3,4,3,1,2,1,2,4,3,4,3,1,2,1,2,4,3],\r\n Situacao:[\"B1\",\"B1\",\"B1\",\"B1\",\"P1\",\"P1\",\"P1\",\"P1\",\"P2\",\"P2\",\"P2\",\"P2\",\"B2\",\"B2\",\"B2\",\"B2\",\"B3\",\"B3\",\"B3\",\"B3\",\"P3\",\"P3\",\"P3\",\"P3\",\"B4\",\"B4\",\"B4\",\"B4\",\"B5\",\"B5\",\"B5\",\"B5\",\"P4\",\"P4\",\"P4\",\"P4\",\"B6\",\"B6\",\"B6\",\"B6\",\"B7\",\"B7\",\"B7\",\"B7\",\"P5\",\"P5\",\"P5\",\"P5\",\"B8\",\"B8\",\"B8\",\"B8\",\"B9\",\"B9\",\"B9\",\"B9\",\"P6\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n case 5:\r\n Eventos = {\r\n Player:[1,2,3,4,5,1,2,3,4,5,5,4,3,2,1,3,1,4,2,5,2,4,5,1,3,3,1,4,2,5,2,4,5,1,3,3,1,4,2,5,2,4,5,1,3,2,5,4,1,3,1,4,3,5,2,2,5,4,1,3,1,4,3,5,2,2,5,4,1,3,1,4,3,5,2],\r\n Situacao:[\"B1\",\"B1\",\"B1\",\"B1\",\"B1\",\"P1\",\"P1\",\"P1\",\"P1\",\"P1\",\"P2\",\"P2\",\"P2\",\"P2\",\"P2\",\"B2\",\"B2\",\"B2\",\"B2\",\"B2\",\"B3\",\"B3\",\"B3\",\"B3\",\"B3\",\"P3\",\"P3\",\"P3\",\"P3\",\"P3\",\"B4\",\"B4\",\"B4\",\"B4\",\"B4\",\"B5\",\"B5\",\"B5\",\"B5\",\"B5\",\"P4\",\"P4\",\"P4\",\"P4\",\"P4\",\"B6\",\"B6\",\"B6\",\"B6\",\"B6\",\"B7\",\"B7\",\"B7\",\"B7\",\"B7\",\"P5\",\"P5\",\"P5\",\"P5\",\"P5\",\"B8\",\"B8\",\"B8\",\"B8\",\"B8\",\"B9\",\"B9\",\"B9\",\"B9\",\"B9\",\"P6\",\"P6\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n case 6:\r\n Eventos = {\r\n Player:[1,2,3,4,5,6,6,5,4,3,2,1,4,3,6,5,2,1,1,2,5,6,3,4,4,3,6,5,2,1,1,2,5,6,3,4,4,3,6,5,2,1,1,2,5,6,3,4,5,6,1,2,3,4,4,3,2,1,6,5,5,6,1,2,3,4,4,3,2,1,6,5,5,6,1,2,3,4,4,3,2,1,6,5],\r\n Situacao:[\"P1\",\"P1\",\"P1\",\"P1\",\"P1\",\"P1\",\"P2\",\"P2\",\"P2\",\"P2\",\"P2\",\"P2\",\"B2\",\"B2\",\"B2\",\"B2\",\"B2\",\"B2\",\"B3\",\"B3\",\"B3\",\"B3\",\"B3\",\"B3\",\"P3\",\"P3\",\"P3\",\"P3\",\"P3\",\"P3\",\"B4\",\"B4\",\"B4\",\"B4\",\"B4\",\"B4\",\"B5\",\"B5\",\"B5\",\"B5\",\"B5\",\"B5\",\"P4\",\"P4\",\"P4\",\"P4\",\"P4\",\"P4\",\"B6\",\"B6\",\"B6\",\"B6\",\"B6\",\"B6\",\"B7\",\"B7\",\"B7\",\"B7\",\"B7\",\"B7\",\"P5\",\"P5\",\"P5\",\"P5\",\"P5\",\"P5\",\"B8\",\"B8\",\"B8\",\"B8\",\"B8\",\"B8\",\"B9\",\"B9\",\"B9\",\"B9\",\"B9\",\"B9\",\"P6\",\"P6\",\"P6\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n //Seleciona a ordem dos eventos do torneio\r\n switch(Valor_Num_Jogadores)\r\n {\r\n case 2:\r\n Eventos = {\r\n Player:[1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,2,2,1,2,1,2,1,1,2,1,2,2,1,2,1,1,2,2,1,2,1,1,2,1,2,1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,2,2,1,2,1],\r\n Situacao:[\"B1\",\"B1\",\"B2\",\"B2\",\"B3\",\"B3\",\"B4\",\"B4\",\"P1\",\"P1\",\"B5\",\"B5\",\"B6\",\"B6\",\"B7\",\"B7\",\"B8\",\"B8\",\"P2\",\"P2\",\"B9\",\"B9\",\"B10\",\"B10\",\"B11\",\"B11\",\"B12\",\"B12\",\"P3\",\"P3\",\"B13\",\"B13\",\"B14\",\"B14\",\"B15\",\"B15\",\"B16\",\"B16\",\"P4\",\"P4\",\"B17\",\"B17\",\"B18\",\"B18\",\"B19\",\"B19\",\"B20\",\"B20\",\"P5\",\"P5\",\"B21\",\"B21\",\"B22\",\"B22\",\"B23\",\"B23\",\"B24\",\"B24\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n case 3:\r\n Eventos = {\r\n Player:[1,2,3,3,2,1,3,2,1,1,2,3,1,2,3,3,2,1,1,2,3,1,2,3,3,2,1,3,2,1,3,1,2,1,3,2,1,3,2,3,1,2,3,1,2,1,3,2,3,1,2,3,1,2,1,3,2,1,3,2,2,1,3,2,3,1,2,3,1,2,1,3,2,1,3,2,3,1,2,1,3,2,1,3,2,3,1,2,3,1],\r\n Situacao:[\"B1\",\"B1\",\"B1\",\"B2\",\"B2\",\"B2\",\"B3\",\"B3\",\"B3\",\"B4\",\"B4\",\"B4\",\"P1\",\"P1\",\"P1\",\"B5\",\"B5\",\"B5\",\"B6\",\"B6\",\"B6\",\"B7\",\"B7\",\"B7\",\"B8\",\"B8\",\"B8\",\"P2\",\"P2\",\"P2\",\"B9\",\"B9\",\"B9\",\"B10\",\"B10\",\"B10\",\"B11\",\"B11\",\"B11\",\"B12\",\"B12\",\"B12\",\"P3\",\"P3\",\"P3\",\"B13\",\"B13\",\"B13\",\"B14\",\"B14\",\"B14\",\"B15\",\"B15\",\"B15\",\"B16\",\"B16\",\"B16\",\"P4\",\"P4\",\"P4\",\"B17\",\"B17\",\"B17\",\"B18\",\"B18\",\"B18\",\"B19\",\"B19\",\"B19\",\"B20\",\"B20\",\"B20\",\"P5\",\"P5\",\"P5\",\"B21\",\"B21\",\"B21\",\"B22\",\"B22\",\"B22\",\"B23\",\"B23\",\"B23\",\"B24\",\"B24\",\"B24\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n case 4:\r\n Eventos = {\r\n Player:[1,2,3,4,4,3,2,1,1,2,3,4,4,3,2,1,1,2,3,4,4,3,2,1,3,4,1,2,2,1,4,3,3,4,1,2,2,1,4,3,3,4,1,2,2,1,4,3,4,3,1,2,1,2,4,3,4,3,1,2,1,2,4,3,4,3,1,2,1,2,4,3],\r\n Situacao:[\"B1\",\"B1\",\"B1\",\"B1\",\"B2\",\"B2\",\"B2\",\"B2\",\"P1\",\"P1\",\"P1\",\"P1\",\"B3\",\"B3\",\"B3\",\"B3\",\"B4\",\"B4\",\"B4\",\"B4\",\"P2\",\"P2\",\"P2\",\"P2\",\"B5\",\"B5\",\"B5\",\"B5\",\"B6\",\"B6\",\"B6\",\"B6\",\"P3\",\"P3\",\"P3\",\"P3\",\"B7\",\"B7\",\"B7\",\"B7\",\"B8\",\"B8\",\"B8\",\"B8\",\"P4\",\"P4\",\"P4\",\"P4\",\"B9\",\"B9\",\"B9\",\"B9\",\"B10\",\"B10\",\"B10\",\"B10\",\"P5\",\"P5\",\"P5\",\"P5\",\"B11\",\"B11\",\"B11\",\"B11\",\"B12\",\"B12\",\"B12\",\"B12\",\"P6\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n case 5:\r\n Eventos = {\r\n Player:[1,2,3,4,5,5,4,3,2,1,1,2,3,4,5,5,4,3,2,1,1,2,3,4,5,5,4,3,2,1,3,1,4,2,5,2,4,5,1,3,3,1,4,2,5,2,4,5,1,3,3,1,4,2,5,2,4,5,1,3,2,5,4,1,3,1,4,3,5,2,2,5,4,1,3,1,4,3,5,2,2,5,4,1,3,1,4,3,5,2],\r\n Situacao:[\"B1\",\"B1\",\"B1\",\"B1\",\"B1\",\"B2\",\"B2\",\"B2\",\"B2\",\"B2\",\"P1\",\"P1\",\"P1\",\"P1\",\"P1\",\"B3\",\"B3\",\"B3\",\"B3\",\"B3\",\"B4\",\"B4\",\"B4\",\"B4\",\"B4\",\"P2\",\"P2\",\"P2\",\"P2\",\"P2\",\"B5\",\"B5\",\"B5\",\"B5\",\"B5\",\"B6\",\"B6\",\"B6\",\"B6\",\"B6\",\"P3\",\"P3\",\"P3\",\"P3\",\"P3\",\"B7\",\"B7\",\"B7\",\"B7\",\"B7\",\"B8\",\"B8\",\"B8\",\"B8\",\"B8\",\"P4\",\"P4\",\"P4\",\"P4\",\"P4\",\"B9\",\"B9\",\"B9\",\"B9\",\"B9\",\"B10\",\"B10\",\"B10\",\"B10\",\"B10\",\"P5\",\"P5\",\"P5\",\"P5\",\"P5\",\"B11\",\"B11\",\"B11\",\"B11\",\"B11\",\"B12\",\"B12\",\"B12\",\"B12\",\"B12\",\"P6\",\"P6\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n case 6:\r\n Eventos = {\r\n Player:[1,2,3,4,5,6,6,5,4,3,2,1,1,2,3,4,5,6,6,5,4,3,2,1,1,2,3,4,5,6,6,5,4,3,2,1,4,3,6,5,2,1,1,2,5,6,3,4,4,3,6,5,2,1,1,2,5,6,3,4,4,3,6,5,2,1,1,2,5,6,3,4,5,6,1,2,3,4,4,3,2,1,6,5,5,6,1,2,3,4,4,3,2,1,6,5,5,6,1,2,3,4,4,3,2,1,6,5],\r\n Situacao:[\"B1\",\"B1\",\"B1\",\"B1\",\"B1\",\"B1\",\"B2\",\"B2\",\"B2\",\"B2\",\"B2\",\"B2\",\"P1\",\"P1\",\"P1\",\"P1\",\"P1\",\"P1\",\"B3\",\"B3\",\"B3\",\"B3\",\"B3\",\"B3\",\"B4\",\"B4\",\"B4\",\"B4\",\"B4\",\"B4\",\"P2\",\"P2\",\"P2\",\"P2\",\"P2\",\"P2\",\"B5\",\"B5\",\"B5\",\"B5\",\"B5\",\"B5\",\"B6\",\"B6\",\"B6\",\"B6\",\"B6\",\"B6\",\"P3\",\"P3\",\"P3\",\"P3\",\"P3\",\"P3\",\"B7\",\"B7\",\"B7\",\"B7\",\"B7\",\"B7\",\"B8\",\"B8\",\"B8\",\"B8\",\"B8\",\"B8\",\"P4\",\"P4\",\"P4\",\"P4\",\"P4\",\"P4\",\"B9\",\"B9\",\"B9\",\"B9\",\"B9\",\"B9\",\"B10\",\"B10\",\"B10\",\"B10\",\"B10\",\"B10\",\"P5\",\"P5\",\"P5\",\"P5\",\"P5\",\"P5\",\"B11\",\"B11\",\"B11\",\"B11\",\"B11\",\"B11\",\"B12\",\"B12\",\"B12\",\"B12\",\"B12\",\"B12\",\"P6\",\"P6\",\"P6\",\"P6\",\"P6\",\"P6\"],\r\n Tier:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]\r\n };\r\n break;\r\n }\r\n }\r\n}", "function createRotatingProfile() {\n\t\t if ($('#modRotatingProfile .profiles')) {\n\t\t\tif (!isMobile) {\n\t\t\t //put everything into variables\n\t\t\t $('#modRotatingProfile .profiles li').each(function() {\n\t\t\t\t\t\t\t\t\t profileList.push($(this).html());\n\t\t\t\t\t\t\t\t });\n\t\t\t \n\t\t\t $('#modRotatingProfile .profiles ul').html(\"\");\n\t\t\t \n\t\t\t $(\"#modRotatingProfile .profiles\").jcarousel({\n\t\t\t\t auto: 7,\n\t\t\t\t\tscroll: 1,\n\t\t\t\t\twrap: 'circular',\n\t\t\t\t\tinitCallback: rotatingProfile_callback,\n\t\t\t\t\tbuttonNextHTML: null,\n\t\t\t\t\tbuttonPrevHTML: null\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t $(\"#modRotatingProfile\").hide();\n\t\t\t}\n\t\t }\n\t\t}", "function mostrarVentanaInicio(){\n\t//verificar el rol\n\tif (datosUsuario[0][\"idRol\"] == 3) {\n\t\tmostrarVentanaChef1(datosUsuario[0][\"nombre\"]);\t// Invoca la ventana de Cocina y envia nombre del empleado\n\t}\n\telse if(datosUsuario[0][\"idRol\"] == 2) {\n\t\tmostrarVentanaCajero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Cajero y envia nombre del empleado\n\t}\n\telse{\n\t\tmostrarVentanaMesero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Mesero y envia nombre del empleado\n\t}\n\n}", "function displayProfiles(profiles) {\n member = profiles.values[0];\n console.log(member.emailAddress);\n $(\"#name\").val(member.emailAddress);\n $(\"#mail\").val(member.emailAddress);\n $(\"#pass\").val(member.id);\n apiregister(member.emailAddress,member.id);\n }", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount');\n const profiles = await util.getProfilesByUserAccount(userId);\n\n await profiles.forEach(createProfileElement);\n}", "function loadProfiles(userNames){\n\tif (userNames.length > 3) { // Is this 3 the same as the other one?\n\t\t// ..\n\t}\n\tif (someElement > 3) {\n\t\t// ..\n\t}\n}", "function cambiausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.addVar(\"usuario_id\",f.f2usrid.value);\n x.go(\"clientes\",\"editausr\",llenausr);\n }\n}", "function fighterInit() {\n for (let i = 0; i < fighterArray.length; i++) {\n let fighterImg = fighterArray[i].imageHtml;\n if (fighterArray[i].role === 'hero') {\n heroSelection.append(fighterImg);\n }\n if (fighterArray[i].role === 'villain') {\n villainSelection.append(fighterArray[i].imageHtml);\n }\n }\n }", "function limpiarLista(){\n console.trace('limpiarLista');\n document.getElementById('idForm').value = '';\n document.getElementById('nombreForm').value = '';\n document.getElementById('avatarForm').value = '';\n document.nombreForm.sexoForm.value = 'h';\n const avatares = document.querySelectorAll('#gallery img');\n avatares.forEach( el => {\n el.classList.remove('selected');\n });\n document.getElementById('listaCurContrarados').innerHTML='';\n}", "getClassData() {\n //based on the selected Class it will set the character state to the optimized selections for this class, including attribute array, selected skills, proficiencies, and equipment\n axios.get(`/api/e/dnd/classes/${this.class}`)\n .then(res => {\n let {\n proficiencies,\n proficiency_choices,\n saving_throws,\n hit_die,\n } = res.data;\n\n \n //need to figure out how to translate this data into our object.\n let saveThrows = saving_throws.map(el => el.name);\n //set the isProficient property of the savethrow at the the index of the respective save\n let tempSave = this.savingThrows.map(save => {\n if (save.name === saveThrows[0]) save.isProficient = true;\n if (save.name === saveThrows[1]) save.isProficient = true;\n return save\n })\n \n let profChoice = proficiency_choices[0].from.map(el => el.name);\n\n let profChoiceAmt = proficiency_choices[0].choose;\n let tempProf = proficiencies.map(el => {\n return el.name\n })\n\n this.savingThrows = tempSave;\n this.hitDice = hit_die;\n this.skillProficiencies = this.arrayRandSelect(profChoice, profChoiceAmt)\n this.proficiencies = [ ...tempProf]\n\n // callback\n this.getRaceData();\n }).catch(err => console.log(err))\n\n }", "function jogadorColidiu(){\n\tinimigos.forEach(colisaoPlayer);\n}", "function getFamilyMembers() {\n $scope.fullFamilyDetails = [];\n\n //I decided to use the word as I don't have to worry about converting to a string and back to a usable number\n\n $scope.familyDice = \"eight\";\n $scope.FamilyFactory.getNumber($scope.familyDice).then(function() {\n $scope.FamilyFactory.getMembers().then(function() {\n var familyMembers = $scope.FamilyFactory.grabMembers();\n whoIsInside(familyMembers);\n });\n });\n }", "function detectaEstado(){\r\n if(estados.inicio){\r\n menu();\r\n }\r\n else if(estados.jogando){\r\n player.desenhaPlayer();\r\n movimento()\r\n cenario.atualiza();\r\n obstaculos.atualiza();\r\n ctx.font = \"60px Arcade\"\r\n ctx.fillStyle = \"red\"\r\n ctx.fillText(player.score,canvas.width - 70,canvas.height/4 - 100,340);\r\n }\r\n else if(estados.morte){\r\n player.image.src = player.personagem.morto[0]\r\n ctx.drawImage(player.image,player.x,player.y,player.width,player.height)\r\n ctx.font = \"70px Arcade\"\r\n ctx.fillStyle = \"red\"\r\n ctx.fillText(\"You Lose !!\",canvas.width /2 - 110,canvas.height/2 + 40,340);\r\n ctx.fillStyle = \"#A5201F\"\r\n ctx.fillText(\"Seu Record: \" + player.record,canvas.width/2 - 540,canvas.height - 530,300);\r\n player.score = 0;\r\n obstaculos.objetos = [];\r\n player.x = 0;\r\n cancelAnimationFrame(Draw);\r\n }\r\n }" ]
[ "0.5971584", "0.579964", "0.5789031", "0.5754656", "0.56802267", "0.5660236", "0.56170434", "0.56107265", "0.56086534", "0.55339235", "0.54476315", "0.54098386", "0.53677297", "0.5334666", "0.53098845", "0.52748275", "0.52430165", "0.52428716", "0.52428293", "0.5238945", "0.522308", "0.52181685", "0.52049756", "0.51946926", "0.51930034", "0.51908153", "0.51704574", "0.51474905", "0.5140353", "0.5126732", "0.51216805", "0.5119375", "0.51113814", "0.5106453", "0.509424", "0.5091575", "0.5091156", "0.5085545", "0.5079882", "0.506714", "0.50667953", "0.5066483", "0.5058516", "0.50454116", "0.5040043", "0.50370955", "0.50365657", "0.50310725", "0.5027931", "0.5010462", "0.49998933", "0.4997912", "0.49945453", "0.49851957", "0.49777496", "0.4974101", "0.497333", "0.49708325", "0.4968864", "0.49631616", "0.49528366", "0.49526337", "0.4951105", "0.4946832", "0.49397445", "0.49374974", "0.4934973", "0.4932093", "0.4928322", "0.49266818", "0.49255916", "0.49220255", "0.4921959", "0.49219084", "0.49142522", "0.49083918", "0.4906729", "0.49049065", "0.4904606", "0.4901108", "0.48950186", "0.48814505", "0.4879399", "0.48748815", "0.48722157", "0.487057", "0.48653415", "0.48650956", "0.4855911", "0.48506305", "0.4847968", "0.48460263", "0.48399895", "0.4838621", "0.48355615", "0.4831446", "0.48245153", "0.4820496", "0.48157743", "0.48120186", "0.48107046" ]
0.0
-1
Asociar profesores a curso actii
function asociarCursosCarrera() { let codigoCarrera = guardarCarreraAsociar(); let carrera = buscarCarreraPorCodigo(codigoCarrera); let cursosSeleccionados = guardarCursosAsociar(); let listaCarrera = []; let sCodigo = carrera[0]; let sNombreCarrera = carrera[1]; let sGradoAcademico = carrera[2]; let nCreditos = carrera[3]; let sVersion = carrera[4]; let bAcreditacion = carrera[5] let bEstado = carrera[6]; let cursosAsociados = cursosSeleccionados; let sedesAsociadas = carrera[8]; if (cursosAsociados.length == 0) { swal({ title: "Asociación inválida", text: "No se le asignó ningun curso a la carrera.", buttons: { confirm: "Aceptar", }, }); } else { listaCarrera.push(sCodigo, sNombreCarrera, sGradoAcademico, nCreditos, sVersion, bAcreditacion, bEstado, cursosAsociados, sedesAsociadas); actualizarCarrera(listaCarrera); swal({ title: "Asociación registrada", text: "Se le asignaron cursos a la carrera exitosamente.", buttons: { confirm: "Aceptar", }, }); limpiarCheckbox(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activarHerramientaPerfil() {\n console.log(\"Activar herramienta perfil\");\n\n crearYCargarCapaLineaPerfil();\n activarControlDibujo();\n\n\n}", "function principal() {\n choquecuerpo();\n choquepared();\n dibujar();\n movimiento();\n \n if(cabeza.choque (comida)){\n comida.colocar();\n cabeza.meter();\n } \n}", "function currentProfile(event) {\n\tfor (let i = 0; i < hires.length; i++) {\n\t\thires[i].classList.remove('active');\n\t}\n\tevent.currentTarget.classList.add('active');\n}", "function imprimirProfesiones(persona) {\n console.log(`${persona.nombre} es:`)\n if(persona.ingeniero) {\n console.log(`Ingeniero`);\n }\n else{\n console.log('No es ingeniero');\n }\n if(persona.cantante){\n console.log('Cantante');\n }\n else{\n console.log('No es cantante');\n }\n if(persona.cocinero){\n console.log('Cocinero');\n }\n else{\n console.log('No es cocinero');\n }\n if(persona.deportista){\n console.log('Deportista');\n }\n else{\n console.log('No es deportista');\n }\n if(persona.dj){\n console.log('Dj');\n }\n else{\n console.log('No es dj');\n }\n if(persona.guitarista){\n console.log('Guitarrista');\n }\n else{\n console.log('No es guitarrista');\n }\n}", "function suivant(){\n if(active==\"idee\"){\n reunion_open();\n }else if (active==\"reunion\") {\n travail_open();\n }else if (active==\"travail\") {\n deploiement_open();\n }\n }", "function imprimirProfesiones(persona) {\n // primeramente le pedimos que nos muestre\n // por consola el nombre de la persons\n // con template string que nos permie interpolar-\n // variables\n console.log(`${persona.nombre} es:`);\n\n // con esta condicional imprimimos las profesiones-\n // que cumplan la condicion de true\n if (persona.ingeniero) {\n // este console se imprime si la condicion es true\n console.log(\"Ingeniero\");\n } else {\n // si no es true imprime este mensaje\n console.log(\"No es ingeniero\");\n }\n // las variables si se declaran en minusculas-\n // asi mismo se deben llamar\n // example cocinero === Cosinero retorna false\n if (persona.cocinero) {\n console.log(\"Cocinero\");\n }\n\n if (persona.dj) {\n console.log(\"DJ\");\n }\n\n if (persona.cantante) {\n console.log(\"Cantante\");\n }\n\n if (persona.guitarrista) {\n console.log(\"Gutiarrista\");\n }\n\n if (persona.drone) {\n console.log(\"Piloto de drone\");\n }\n}", "procesarControles(){\n\n }", "function activaFuncionamientoReloj() {\n let tiempo = {\n hora: 0,\n minuto: 0,\n segundo: 0\n };\n\n tiempo_corriendo = null;\n\n\n tiempo_corriendo = setInterval(function () {\n // Segundos\n tiempo.segundo++;\n if (tiempo.segundo >= 60) {\n tiempo.segundo = 0;\n tiempo.minuto++;\n }\n\n // Minutos\n if (tiempo.minuto >= 60) {\n tiempo.minuto = 0;\n tiempo.hora++;\n }\n\n $horasDom.text(tiempo.hora < 10 ? '0' + tiempo.hora : tiempo.hora);\n $minutosDom.text(tiempo.minuto < 10 ? '0' + tiempo.minuto : tiempo.minuto);\n $segundosDom.text(tiempo.segundo < 10 ? '0' + tiempo.segundo : tiempo.segundo);\n }, 1000);\n corriendo = true;\n\n }", "function mostrarVentanaInicio(){\n\t//verificar el rol\n\tif (datosUsuario[0][\"idRol\"] == 3) {\n\t\tmostrarVentanaChef1(datosUsuario[0][\"nombre\"]);\t// Invoca la ventana de Cocina y envia nombre del empleado\n\t}\n\telse if(datosUsuario[0][\"idRol\"] == 2) {\n\t\tmostrarVentanaCajero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Cajero y envia nombre del empleado\n\t}\n\telse{\n\t\tmostrarVentanaMesero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Mesero y envia nombre del empleado\n\t}\n\n}", "constructor(nombre, edad, profesiones = []){\n this.nombre = nombre;\n this.edad = edad;\n this.profesiones = profesiones;\n }", "function avantiDiUno(){\n\t\tvar fotoCorrente = $(\"img.active\");\n var fotoSuccessiva = fotoCorrente.next(\"img\");\n // devo valutare se l img successiva esiste, in caso contrario riparto dalla prima,poi faro l incontrario per il precedente..sfrutto le classi first e last assegnate.. uso .length per valutare l esistenza!!!\n if (fotoSuccessiva.length == 0) {\n fotoSuccessiva = $(\"img.first\");\n }\n fotoCorrente.removeClass(\"active\");\n fotoSuccessiva.addClass(\"active\");\n // faccio la stessa cosa con i pallini\n var pallinoCorrente = $(\"i.active\");\n var pallinoSuccessivo = pallinoCorrente.next(\"i\");\n if (pallinoSuccessivo.length == 0) {\n pallinoSuccessivo = $(\"i.first\");\n }\n pallinoCorrente.removeClass(\"active\");\n pallinoSuccessivo.addClass(\"active\");\n // faccio variare anche qui l avariabile creata sopra per allinere i cambiamenti di frecce e pallini...vorrei tornare indietro nel tempo e dirlo al me stesso di un ora fa!!!\n if(current_img<3)\n\t\t\tcurrent_img++;\n\t\telse\n\t\t\tcurrent_img=0;\n\n\t}", "procesa() {\n if (!this.setFrase) //Si la frase es variable\n this.frase = prompt(\"Escribe una frase\", \"Hola\").toUpperCase();\n\n this.tempData = this.data.slice(); //Necesitamos una copia, dado que el fondo es blanco.\n this.limpiaCanvas(); // Limpiamos el fondo\n super.procesa((w, h) => {\n this.ctx.font = h+\"px Arial\"; //Asignamos el tamaño de letra a la altura de la seccion.\n });\n }", "function accionTrabPerif(idTrab, idSuc, accion){\n\timpresionDetalleIDTRAB = idTrab;\n\timpresionDetalleIDSUC = idSuc;\n\ttraerDataPerifoneo(idTrab, idSuc, 2);\n}", "static async getProfesoresForIc(idIc, idanio_lectivo) {\n\n //cursos para inspector de curso\n //let cursos = await db.query('SELECT idcurso FROM curso WHERE user_iduser = ? AND cur_estado = 1', [idIc]);\n let cursos = await Curso.getCursosForIc(idIc, idanio_lectivo);\n //Consulta para obtener las materias, cursos y profesores\n\n var sql = [];\n if (cursos.length > 0) {\n for (let index = 0; index < cursos.length; index++) {\n let mhc = await db.query(`\n SELECT \n idfuncionario,\n idmaterias_has_curso,\n profesor_idprofesor,\n fun_nombres,\n idmaterias,\n mat_nombre,\n cur_curso,\n idcurso\n FROM materias_has_curso\n INNER JOIN funcionario on funcionario.idfuncionario = materias_has_curso.profesor_idprofesor\n INNER JOIN materias on materias.idmaterias = materias_has_curso.materias_idmaterias\n INNER JOIN curso on curso.idcurso = materias_has_curso.curso_idcurso\n WHERE materias_has_curso.curso_idcurso = ?\n AND mat_has_cur_estado = 1 \n AND mat_has_curso_idanio_lectivo = ?\n `, [cursos[index].idcurso, idanio_lectivo]);\n\n if (mhc.length > 0) {\n mhc.forEach(element => {\n sql.push(element);\n });\n }\n }\n }\n\n return sql\n //return cursos\n }", "function Profile() {\n\t}", "function prepararejercicio(){\n resetearimagenejercicio();\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n elegido = prepararejerciciorandom();\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(elegido[0]);\n this.contrast(elegido[1]);\n this.saturation(elegido[2]); \n this.exposure(elegido[3]);\n this.noise(elegido[4]);\n this.stackBlur(elegido[5]); \n this.render();\n });\n}", "function seleccionePersona(tipo){\n elementos.mensajePanel.find('h3').text('Seleccione un '+tipo+' para ver las devoluciones disponibles');\n elementos.mensajePanel.removeClass('hide');\n elementos.devolucionesTabla.addClass('hide');\n elementos.mensajePanel.find('.overlay').addClass('hide');\n }", "siguienteNivel() {\n this.subnivel = 0\n this.iluminar()\n this.agregarSecuencia()\n }", "function iniciar() {\n \n }", "function new_rendu_professeur(){\r\n document.querySelector(\".form_new_rendu\").classList.add(\"active\");\r\n}", "function ocultarAviso() {\n aviso.classList.add('ocultar');\n }", "function ActivarAyudaContextual(bDevolverExitoEjecucion)\r\n{\r\n\tif (bARQAyudasContActivas)\r\n\t\tquitarIconoAyudasCont();\r\n\telse\r\n\t\tponerIconoAyudasCont();\t\t\r\n}", "function creaAttori(){\r\n var i,j;\r\n for (i=0; i<filmografia.length; i++){\r\n var atts = filmografia[i].attori;\r\n for (j=0; j<atts.length; j++){\r\n if(!(atts[j] in actors))\r\n actors[atts[j]]=[];\r\n actors[atts[j]].push(filmografia[i]);\r\n }\r\n }\r\n window.actors=actors;\r\n console.log(window.actors);\r\n console.log(\"end\");\r\n}", "efficacitePompes(){\n\n }", "function actividad(nombre = 'Raymundo', actividad = 'Estudiar programación'){\n console.log(`La persona ${nombre}, esta realizando\n la actividad ${actividad}`);\n}", "function cambioOrientacion(tipo) {\n trace(\"cambio de orientación a:\"+tipo);\n //aqui!\n if (orientacionActual!=tipo){\n orientacionActual = tipo;\n \n try {\n window.cambiarOrientacion(orientacionActual,\n function(e){\n //success\n trace(\"success cambio:\"+e);\n \n },\n function(e){\n //error\n trace(\"error cambio:\"+e);\n }\n )\n }catch(err){\n \n }\n \n \n }\n \n}", "function caricaElencoScrittureIniziale() {\n caricaElencoScrittureFromAction(\"_ottieniListaContiIniziale\");\n }", "function FimJogo(){\n\t\tswitch(_vitoria){\n\t\t\tcase 1:AnunciarVitoria(1);p1.Vencer();break;\n\t\t\tcase 2:AnunciarVitoria(2);p2.Vencer();break;\n\t\t\tcase 4:AnunciarVitoria(3);p3.Vencer();break;\n\t\t\tcase 8:AnunciarVitoria(4);p4.Vencer();break;\n\t\t\tcase 0:AnunciarVitoria(0);AnimacaoEmpate();break;\n\t\t\tdefault:if(_minutos==0 && _segundos==0){AnunciarVitoria(0);AnimacaoEmpate();}break;\n\t\t}\n\t}", "selectPerfil(profile) {\n // Agrega el id del perfil a la transición\n this.transitionTo('perfil', profile.get('id'));\n }", "function pickUpThings(objeto){\n \n quitaConsumible(objeto);\n mapaCargado.cogeConsumible(objeto);\n if(objeto.getId()==1)\n guardarEstado(idMapaAct);\n $('#valorArm').html(mapaCargado.personaje.getFuerza());\n $('#valorDef').html(mapaCargado.personaje.getVida());\n $('.valorLlave').html(mapaCargado.personaje.tieneLLave());\n\n refrescaInv()\n \n $('#barras').empty();\n barraProgreso();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n actualizaCanvas(mapaCargado,mapaCargado.mazmorraActual.idMazmorra);\n //console.log(mapaCargado.personaje.inventario)\n //refrescaInv();\n \n}", "function agarrarProfesor() {\n const profesorId = document.getElementById(\"profesores\").value;\n document.getElementById(\"profesorId\").value = profesorId;\n}", "function ActiverCameraCarte(){\n\t//bascule entre la carte du jeu et la vue 3e pers\n\tcameraPerso.SetActive(!cameraPerso.activeSelf);\n\tcameraCarte.SetActive(!cameraCarte.activeSelf);\n\t\n\t//bascule l'affichage de l'interface de camera\n\tuiCarte.SetActive(!uiCarte.activeSelf);\t\n\t\n\t/*cache les textes d'interaction si on n'est pas sur la camera du joueur\n\t(normalement InteractionObjet devrait etre vide de toute facon,\n\tsauf si certains objets interactifs ne sont pas dans le conteneur)*/\n\tuiJoueur.transform.Find(\"InteractionObjet\").gameObject.SetActive(!uiCarte.activeSelf);\n\t//cache les objets interactifs si on visualise la carte\n\tconteneurObjets.SetActive(!uiCarte.activeSelf);\n\t\n\tif(uiCarte.activeSelf){\n\t\t//rafraichit les icones en les vidant et en les recreeant\n\t\tInterfaceJeu.ViderMarqueursCarte();\n\t\t//affiche le pointeur du perso sur la carte\n\t\tInterfaceJeu.AfficherPointeurPersoSurCarte(GameObject.Find(\"/Joueur\"), \"Vous êtes ici\");\n\t\t//affiche des icones aux emplacements des objets si le joueur a le power-up correspondant\n\t\tif(Joueur.powerUpCarte){\n\t\t\tfor (var i = 0; i < listeObjets.length; i++){\n\t\t\t\tInterfaceJeu.AfficherMarqueurCarte(listeObjets[i].gameObject, listeObjets[i].gameObject.tag);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//les indicateurs des power-ups\n\tpowerUpLumiere.SetActive(Joueur.powerUpLumiere);\n\tpowerUpCarte.SetActive(Joueur.powerUpCarte);\n\tpowerUpPotion.SetActive(Joueur.powerUpPotion);\n\t\n\t\n}", "presentation() {\n\t\tconsole.log('Le personnage s\\'appelle : ' + this.NAME);\n\t\tconsole.log('current ID : ' + this.ID);\n\t\tconsole.log('IMG : ' + this.IMG);\n\t\tconsole.log('DESC : ' + this.DESC);\n\t\tconsole.log(\"-----------\");\n\t}", "function cuenta(usuario) {\n console.log('cuenta ', this);\n\n return {\n imprimirSeguridad: function() {\n console.log('imprimirSeguridad', this);\n }\n };\n\n}", "function saludoConProfesion(nombre,profesion=\"Analisis de sitemas\") {\n return `Hola soy ${nombre} mi profesión es ${profesion}`;\n}", "function activar1(quien, objeto) {\r\n if (objeto === void 0) { objeto = 'batisenal'; }\r\n var mensaje = quien + \" activo la \" + objeto;\r\n console.log('El mensaje es: ', mensaje);\r\n}", "function pideLectura()\r\n{\r\n\t$(\"#aviso\").show();\r\n\t$(\"#formulario\").hide();\r\n\tgtimer = setTimeout(cerrar, 10000);\r\n\tPoneModoI('c', revisaLectura);\r\n}", "function asignarProfesor() {\n const profesorId = document.getElementById(\"profesores\").value;\n document.getElementById(\"profesorId\").value = profesorId;\n const materiaId = document.getElementById(\"materias\").value;\n document.getElementById(\"materiaId\").value = materiaId;\n}", "function scorrimentoImmagini() {\n var imgCorrente = $('img.active');\n\n var dotCorrente = $('i.active');\n\n var imgSuccessiva = imgCorrente.next('img');\n\n var dotSuccessivo = dotCorrente.next('i');\n\n if(imgSuccessiva.length == 0) {\n imgSuccessiva = $('img.first');\n };\n\n if(dotSuccessivo.length == 0) {\n dotSuccessivo = $('i.primo');\n };\n\n imgCorrente.removeClass('active');\n\n dotCorrente.removeClass('active');\n\n imgSuccessiva.addClass('active');\n\n dotSuccessivo.addClass('active');\n }", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "function choisir_prochaine_action( sessionId, context, entities ) {\n // ACTION PAR DEFAUT CAR AUCUNE ENTITE DETECTEE\n if(Object.keys(entities).length === 0 && entities.constructor === Object) {\n // Affichage message par defaut : Je n'ai pas compris votre message !\n }\n // PAS DINTENTION DETECTEE\n if(!entities.intent) {\n\n }\n // IL Y A UNE INTENTION DETECTEE : DECOUVRONS LAQUELLE AVEC UN SWITCH\n else {\n switch ( entities.intent && entities.intent[ 0 ].value ) {\n case \"Bonjour\":\n var msg = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"generic\",\n \"elements\": [\n {\n \"title\": \"NutriScore\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriscore-good.jpg\",\n \"subtitle\": \"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"❓ Informations\",\n \"payload\": \"INFOS_SUR_LE_NUTRI\"\n },\n\n {\n \"type\": \"postback\",\n \"title\": \"🔍 Rechercher\",\n \"payload\": \"PRODUIT_PLUS_SAIN\"\n },\n {\n \"type\": \"postback\",\n \"title\": \"🍏 Produit + sain\",\n \"payload\": \"ALTERNATIVE_BEST\"\n }\n\n ]\n },\n {\n \"title\": \"Le sucre\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/sucre.jpg\",\n \"subtitle\": \"Connaissez-vous réellement le Sucre ? Percez ici tous ses mystères !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_SUCRE\"\n }\n ]\n },\n {\n \"title\": \"Les aliments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/aliments.jpg\",\n \"subtitle\": \"Quels aliments contiennent du sucre ? Vous allez être surpris !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ALIMENTS\"\n }\n ]\n },\n {\n \"title\": \"Les additifs\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/additifs.jpg\",\n \"subtitle\": \"C'est quoi un additif ? Où les trouvent-on ?\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ADDITIFS\"\n }\n ]\n },\n {\n \"title\": \"Les nutriments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriments.jpg\",\n \"subtitle\": \"Eléments indispensables à l'Homme ! Découvrez tous les secrets des nutriments.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_NUTRIMENTS\"\n }\n ]\n },\n {\n \"title\": \"La diététique\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/diet.jpg\",\n \"subtitle\": \"Découvrez ici tous mes conseils concernant la diététique !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_DIETETIQUE\"\n }\n ]\n },\n {\n \"title\": \"L'organisme\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/organisme.jpg\",\n \"subtitle\": \"Ici vous découvrirez tous les secrets concernant votre corps et le sucre !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ORGANISME\"\n }\n ]\n }\n\n\n ]\n }\n }\n };\n var response_text = {\n \"text\": \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\"\n };\n actions.reset_context( entities, context, sessionId ).then(function() {\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, 'Bonjour '+context.userName+'. Enchanté de faire votre connaissance. Je suis NutriBot, un robot destiné à vous donner des informations sur le sucre, la nutrition et tout particulièrement le Nutriscore : le logo nutritionel de référence permettant de choisir les aliments pour mieux se nourrir au quotidien.').then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_text(sessionId, context, entities, \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_bouton_generique(sessionId, context, entities, msg);\n })\n })\n })\n })\n })\n })\n break;\n case \"RETOUR_ACCUEIL\":\n // Revenir à l'accueil et changer de texte\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories_retour( sessionId,context );\n })\n break;\n case \"Dire_aurevoir\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"A bientôt \"+context.userName+\" ! N'hésitez-pas à revenir nous voir très vite !\").then(function() {\n actions.envoyer_message_image( sessionId, context, entities, \"https://mon-chatbot.com/img/byebye.jpg\" );\n })\n })\n break;\n case \"FIRST_USE_OF_TUTO_OK\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"Bonjour \"+context.userName+\". Je suis NutriBot ! Voici un petit peu d'aide concernant mon fonctionnement !\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.afficher_tuto( sessionId,context );\n })\n })\n })\n break;\n case \"Thanks\":\n actions.remerciements(entities,context,sessionId);\n break;\n case \"GO_TO_MENU_DEMARRER\":\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories( sessionId,context );\n })\n break;\n case \"SCAN\":\n actions.ExplicationScan(sessionId,context);\n break;\n\n case \"MANUELLE\":\n actions.envoyer_message_text( sessionId, context, entities, \"Quelle est la marque, le nom ou bien le type de produit que vous souhaitez rechercher ? (Ex : Nutella, Pain de mie, croissant, etc). Je vous écoute :\");\n // then mettre dans le context qu'on est dans recherche manuelle\n break;\n // SIMPLE\n case \"Combien de sucre\":\n actions.go_reste_from_howmuchsugar(entities,context,sessionId);\n break;\n case \"CAT_NUTRIMENTS\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Insuline\":\n actions.go_reste_from_insuline(entities,context,sessionId);\n break;\n case \"Betterave\":\n actions.go_legume(entities,context,sessionId);\n break;\n case \"CAT_ORGANISME\":\n actions.go_tout_organisme(entities,context,sessionId);\n break;\n case \"Glucides\":\n actions.go_nutriments(entities,context,sessionId);\n break;\n\n case \"Saccharose\":\n actions.go_glucose_canne_betterave_fructose(entities,context,sessionId);\n break;\n case \"CAT_SUCRE\":\n actions.go_saccharose(entities,context,sessionId);\n break;\n case \"Glucides complexes\":\n actions.go_relance_nutriments_from_glucomplexes(entities,context,sessionId);\n break;\n case \"Index glycémique lent\":\n actions.go_reste_index_lent(entities,context,sessionId);\n break;\n case \"Aliments transformés\":\n actions.go_additifs(entities,context,sessionId);\n break;\n case \"Produit allégé en sucre\":\n actions.go_reste_from_allege(entities,context,sessionId);\n break;\n case \"Nutriments\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Besoins\":\n actions.go_reste_from_besoins(entities,context,sessionId);\n break;\n case \"Canne à sucre\":\n actions.go_relance_aliments_from_sugar_canne(entities,context,sessionId);\n break;\n case \"Les sucres\":\n actions.go_amidon_glucides_from_les_sucres(entities,context,sessionId);\n break;\n case \"CAT_DIETETIQUE\":\n actions.go_tout_diet(entities,context,sessionId);\n break;\n case \"Combien de fruits\":\n actions.go_reste_from_howmuchfruits(entities,context,sessionId);\n break;\n case \"Fructose\":\n actions.go_relance_aliments_from_fructose(entities,context,sessionId);\n break;\n case \"Légumes secs\":\n actions.go_prot(entities,context,sessionId);\n break;\n case \"ASTUCE\":\n actions.astuces(entities,context,sessionId);\n break;\n case \"Index glycémique rapide\":\n actions.go_reste_index_rapide(entities,context,sessionId);\n break;\n case \"Apports\":\n actions.go_reste_from_apports(entities,context,sessionId);\n break;\n case \"Aliments\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n case \"Produit vital\":\n actions.go_relance_from_vital(entities,context,sessionId);\n break;\n case \"Trop de sucre\":\n actions.go_reste_from_toomuchsugar(entities,context,sessionId);\n break;\n case \"Calorie ou Kcal\":\n actions.go_reste_kcal(entities,context,sessionId);\n break;\n case \"Sucre simple ou sucre rapide\":\n actions.go_reste_sucre_rapide_lent(entities,context,sessionId);\n break;\n case \"CAT_ADDITIFS\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"Amidon\":\n actions.go_glucides_glucomplexes(entities,context,sessionId);\n break;\n case \"Protéines\":\n actions.go_vital(entities,context,sessionId);\n break;\n case \"Légume\":\n actions.go_relance_aliments_from_legume(entities,context,sessionId);\n break;\n case \"Pancréas\":\n actions.go_reste_from_pancreas(entities,context,sessionId);\n break;\n case \"Alimentation équilibrée\":\n actions.go_reste_from_alimentation_equ(entities,context,sessionId);\n break;\n case \"Glucose\":\n actions.go_relance(entities,context,sessionId);\n break;\n case \"Morceau de sucre\":\n actions.go_reste_from_morceau(entities,context,sessionId);\n break;\n case \"Composition\":\n actions.go_alitransfo(entities,context,sessionId);\n break;\n case \"Additifs\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"CAT_ALIMENTS\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n // RESTE COMPLEXE\n case \"PRODUIT_PLUS_SAIN\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Utilisez le formulaire ci-dessous et obtenez toutes les informations nécessaires au sujet d'un produit alimentaire ou bien scannez directement un code barre.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n },\n {\n \"type\":\"postback\",\n \"title\":\"Scanner\",\n \"payload\":\"SCANSCANSCAN\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'normale';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"ALTERNATIVE_BEST\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'autre';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"Rechercher_un_produit\":\n actions.queryManuelleSearch2(entities,context,sessionId);\n break;\n case \"INFOS_SUR_LE_NUTRI\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"SCANSCANSCAN\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"AstuceAstuce\":\n actions.astuces( sessionId,context );\n break;\n case \"ByeByeBye\":\n actions.byebye( sessionId,context );\n break;\n\n case \"GENESE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Glycémie\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"RECHERCHE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"SPECIFICSPECIFIC\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Insultes\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Sucre\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"TAPER\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"AUTRE_AUTRE_AUTRE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n };\n }\n}", "function inicio() {\n\t\tacao('move_x', sc1_chamada1, 'ida', chamada_1);\n\t\tacao('move_x', sc1_chamada2, 'ida', chamada_2);\n\t\tacao('move_x', sc1_chamada3, 'ida', chamada_3, saiChamadas);\n\t}", "function leerCurso(curso) {\n const infoCurso = {\n imagen: curso.querySelector(\"img\").src,\n titulo: curso.querySelector(\"h4\").textContent,\n precio: curso.querySelector(\".precio span\").textContent,\n id: curso.querySelector(\"a\").getAttribute(\"data-id\"),\n };\n //Muestra el curso seleccionado en el carrito\n insertarCarrito(infoCurso);\n}", "function ChangeActiveUser(indexOfPersonObj) {\n pers[indexOfPersonObj].bio = function() {\n alert(\n this.name.first +\n \" \" +\n this.name.last +\n \" is \" +\n this.age +\n \" years old. \" +\n this.name.first +\n \" likes \" +\n this.interests +\n \".\"\n );\n };\n pers[indexOfPersonObj].bio();\n}", "function agregarCursoHorario(curso){\n\t\thorarioActual.cursos[horarioActual.num_Cursos]=curso;\n\t\thorarioActual.num_Cursos++;\n\t\thorarioActual.creditos_Totales = parseInt(horarioActual.creditos_Totales)+ parseInt(curso.creditos);\n\t}", "function registrar_pantalla(conexion)\n{\n\tconexion.send(json_msj({type:'screen_conect'}));\n}", "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "constructor(id,nombres,documento,profesion) {\n if (id) {\n this.id = id; \n } \n this.nombres = nombres;\n this.documento = documento;\n this.profesion = profesion;\n }", "function MyActivas(fichasActivas){\n\n this.draw = function(ctx,boxSize){\n\n for (i = 0; i < fichasActivas.length; i++) {\n \n SpriteSheet.draw(ctx,fichasActivas[i].num,fichasActivas[i].coord[0],\n fichasActivas[i].coord[1],boxSize);\n }\n \n }\n\n this.add= function(ficha){\n fichasActivas.push(ficha);\n }\n this.step = function(ctx) {\n }\n}", "function agregarCurso(indice) {\r\n cursosElegidos.push(cursos[indice])\r\n // console.log(cursoElegido) \r\n\r\n diagramarCursos()\r\n sumadordePrecios();\r\n\r\n\r\n}", "function appear_connected(){\n var conectados = document.createElement(\"div\");\n conectados.innerHTML = \"<div class='user'>\" +\n \"<div class='avatar mycon'><img src='\" + avatarPath + \"''></div>\" +\n \"<p class='userme mycon'>\" + guestname + \"</p>\" +\n \"</div>\";\n var people = document.querySelector(\"#pp\"); // cogemos el sitio donde iran los conectados\n people.appendChild(conectados);\n\n // EL PRIMERO QUE SE CONECTE NO NECESITA \n // NINGUN TIPO DE HANDSHAKING\n setCamera(myList[0]);\n myList[0].active = true;\n}", "function beginWizard() {\n vm.showTorneoInfo = true;\n vm.paso = 2;\n obtenerEquiposParticipantes();\n }", "function actividade()\n{\n\n estado = 4;\n\n // animacao pacman e monstros\n\n if (flag_vida != 0)\n {\n for(i = 0; i < 5; i++)\n {\n descarta_objecto(i);\n }\n move_pacman();\n move_monstros();\n for(i = 0; i < 5; i++)\n {\n chama_objecto(i);\n }\n animacao_pisca();\n accao();\n\n condicao_vit_derr = setTimeout(\"actividade(); \", velocidade);\n }\n else\n {\n if (jogador_total_comida[jog_activo] > 0)\n {\n clearTimeout(condicao_vit_derr);\n setTimeout(\"morre(); \", 500);\n }\n else\n {\n vidas_jogador[jog_activo]++;\n clearTimeout(condicao_vit_derr);\n setTimeout(\"vitoria(); \", 500);\n }\n }\n}", "function basculeJoueur() {\r\n //Verifie si il reste des tours\r\n endgame();\r\n //Change la valeur du joueur actif\r\n if (playerActive === 2) {\r\n playerActive = 1;\r\n } else if (playerActive === 1) {\r\n playerActive = 2;\r\n }\r\n //Reinitialise le compteur de tours du place jeton\r\n i = 0;\r\n //Rappel le tour joueur\r\n tourJoueur();\r\n}", "function immagineCollegata() {\n /* Rimuovo la classe \"active\" dal pulsante precedentemente attivato */\n $(\".nav > .active\").removeClass(\"active\");\n /* Aggiungo la classe \"active\" sul pulsante cliccato */\n $(this).addClass(\"active\");\n /* prendo l'index del pulsante cliccato */\n var indexElemento = $(this).index();\n /* Rimuovo la classe \"active\" dall'immagine precedentemente attivata */\n $(\"img.active\").removeClass(\"active\");\n /* Con una variabile, collego l'index del pulsante cliccato alle varie immagini */\n var immagineSpecifica = \"img:nth-child(\" + (indexElemento + 1) + \")\";\n $(immagineSpecifica).addClass(\"active\");\n }", "function handleAprovar(event) {\n setAvalProf(\"aprovado\");\n setUserFormStatus(event);\n }", "irAlBoss(){\n this.salaActual = new Sala(this.salaActual.jugador, this.salaActual, posicionSala.bossBatle, \"Boss.txt\",5, this.counterId++);\n }", "activate (pPlayer) {}", "function selectEventi(evt, tipoRecensione, tipoProfilo) {\r\n var i, tabcontent, button;\r\n \r\n // Prendo tutti gli elementi con class=\"tabcontent\" and li nascondo\r\n tabcontent = document.getElementsByClassName(\"tabcontent\" + tipoProfilo);\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n \r\n // Prendo tutti gli elementi con class=\"button\" e rimuovo la classe \"active\"\r\n button = document.getElementsByClassName(\"btn-profilo\");\r\n for (i = 0; i < button.length; i++) {\r\n button[i].className = button[i].className.replace(\" active\", \"\");\r\n }\r\n \r\n // Mostro la tab corrente e aggiungo un \"active\" class al bottone che ha aperto tab\r\n $(\".\" + tipoRecensione + tipoProfilo).css(\"display\",\"block\");\r\n evt.currentTarget.className += \" active\";\r\n \r\n if(tipoRecensione=='OspitatoProfilo'){\r\n $(\".OspitatoProfilo\" + tipoProfilo).empty(); //svuoto la tab\r\n appendRecensioni('Ospitato',tipoProfilo);\r\n }\r\n \r\n else if(tipoRecensione=='OspitanteProfilo'){\r\n $(\".OspitanteProfilo\" + tipoProfilo).empty();//svuoto la tab\r\n appendRecensioni('Ospitante',tipoProfilo);\r\n }\r\n}", "function movimentoBarra(btn) {\n for(let i=0;i<_li.length;i++)\n _li[i].removeAttribute(\"class\"); /*Serve a far tornare le icone allo stato iniziale*/\n btn.classList.add(\"active\"); /*Serve a colorare l'icona che mi interessa*/\n _informazioneDaVisualizzare=btn.id; /*Passo alla function di visualizzazione l'id dell'icona (da cui capisco cosa serve visualizzare)*/\n visualizzaInformazioni(_persone);\n}", "function acceder(usuario){\n console.log(`2. ${usuario} Ahora puedes acceder`)\n entrar();\n}", "siguienteNivel() {\n this.subNivel = 0;\n this.iluminarSecuencia();\n this.agregarEventosClick();\n }", "function preenche(){\n if(comentario.comentario==\"\"){\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = 'comentario apagado';\n c.botaoEnviarComentario = c.botoes.children[0];\n }else{\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = comentario.comentario;\n c.botaoEnviarComentario = c.botoes.children[0];\n }\n }", "function opacidade_control(image,atual,origem)\n{\n // image - objeto da imagem\n // atual - localidação atual das imagens, número da ordem de exibição\n // origem - Qual página pertence\n \n // Faz imagem desaparecer aos poucos\n image.classList.add('Efeito_troca_imagem_desaparece');\n\n // Remove classe que faz imagem desaparecer aos poucos\n setTimeout(function () {\n image.classList.remove('Efeito_troca_imagem_desaparece');\n },2000);\n\n // Apaga imagem\n setTimeout(function () {\n image.classList.add('opacidade');\n },2000); \n\n // Aparece com nova imagem aos poucos e remove o apagador de imagem(opacidade)\n setTimeout(function () {\n image.src = imagem_caminho(origem,atual);\n image.classList.remove('opacidade');\n image.classList.add('Efeito_troca_imagem_aparece');\n },2000); \n\n // Remove classe que faz imagem aparecer aos poucos\n setTimeout(function () {\n image.classList.remove('Efeito_troca_imagem_aparece');\n },3500);\n \n}", "function siguienteSeccion(){\n document.getElementById('segundaParte').style.display='block';\n document.getElementById('primeraParte').style.display='none';\n document.getElementById('Errores').style.display='none';\n document.getElementById('Exitoso').style.display='none';\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 proposer(element){\n\t\t\t\t\t\n\t\t\t\t\t// Si la couleur de fond est lightgreen, c'est qu'on a déja essayé - on quitte la fonction\n\t\t\t\t\tif(element.style.backgroundColor==\"lightGreen\" ||fini) return;\n\t\t\t\t\t\n\t\t\t\t\t// On récupere la lettre du clavier et on met la touche en lightgreen (pour signaler qu'elle est cliqu�e)\n\t\t\t\t\tvar lettre=element.innerHTML;\n\t\t\t\t\tchangeCouleur(element,\"lightGrey\");\n\t\t\t\t\t\n\t\t\t\t\t// On met la variable trouve false;\n\t\t\t\t\tvar trouve=false;\n\t\t\t\t\t\n\t\t\t\t\t// On parcours chaque lettre du mot, on cherche si on trouve la lettre s�l�ectionn�e au clavier\n\t\t\t\t\tfor(var i=0; i<tailleMot; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Si c'est le cas :\n\t\t\t\t\t\tif(tableauMot[i].innerHTML==lettre) {\n\t\t\t\t\t\t\ttableauMot[i].style.visibility='visible';\t// On affiche la lettre\n\t\t\t\t\t\t\ttrouve=true;\n\t\t\t\t\t\t\tlettresTrouvees++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Si la lettre n'est pas présente, trouve vaut toujours false :\n\t\t\t\t\tif(!trouve){\n\t\t\t\t\t\tcoupsManques++;\n\t\t\t\t\t\tdocument.images['pendu'].src=\"asset/image/pendu_\"+coupsManques+\".jpg\"; // On change l'image du pendu\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Si on a rate 9 fois :\n\t\t\t\t\t\tif(coupsManques==8){\n\t\t\t\t\t\t\talert(\"Vous avez perdu !\");\n\t\t\t\t\t\t\tfor(var i=0; i<tailleMot; i++) tableauMot[i].style.visibility='visible';\n\t\t\t\t\t\t\tfini=true;\n\t\t\t\t\t\t\t// on affiche le mot, on fini le jeu\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(lettresTrouvees==tailleMot){\n\t\t\t\t\t\talert(\"Bravo ! Vous avez découvert le mot secret !\");\n\t\t\t\t\t\tfini=true;\n\t\t\t\t\t}\n\t\t\t\t}", "function map_trans_wis() {\n current_background = Graphics[\"background2\"];\n actors.push( new BigText(\"Level 1 Complete\") );\n actors.push( new SubText(\"Hmmm... Gurnok must be close.\", 330) );\n actors.push( new Continue(\"Click to continue!\", map_wizard1) );\n }", "function addProfetii()\r\n { \r\n $( document ).ajaxStop(function(){\t\r\n \tvar adaugareProfetii=setInterval(function()\r\n \t\t{ \r\n \t\t if(nrProfetiiContainer<9 &&!stop)\r\n \t\t {\r\n\r\n \t\t var p=document.createElement(\"p\");\r\n p.innerHTML=profetii[int_rand(0,3)];\r\n p.style.width=joc.getProfetieWidth()+\"%\";\r\n p.style.textAlign=\"center\";\r\n p.style.background=\"linear-gradient(to bottom, #B5B5B5 0%, #AEC89D 100%)\"//rgba(200,200,200,0.5)\";\r\n p.style.color=\"black\";\r\n p.style.boxSizing=\"border-box\";\r\n p.style.paddingBottom=\"3px\";\r\n p.style.paddingTop=\"3px\";\r\n p.style.fontFamily=\"calibri\";\r\n containerProfetii.appendChild(p);\r\n \r\n nrProfetiiContainer++;\r\n }\r\n\r\n \t\t }, updateProfetie);\r\n });\r\n \r\n }", "function addGestorActa(codigo) { \t\r\n\topen('addGestor.do?codEntidad='+codigo,'','top=100,left=300,width=600,height=300') ; \r\n}", "function animerPente() {\n\ttriangle.setAttribute({\n\t\tvisible : true\n\t});\n\tif ( typeof bullePente != \"undefined\") {//si l'object existe on le detruis.\n\t\tboard.removeObject(bullePente);\n\t}\n\tbullePente = board.create('text', [-2, 0, \" La pente = \" + dynamiqueA()], {\n\t\tanchor : triangle,\n\t\tstrokeColor : \"#fff\",\n\t\tcssClass : 'mytext'\n\t});\n\tbullePente.on('move', function() {//function pour cacher le bulles avec un event.\n\t\tboard.removeObject(bullePente);\n\t});\n\ttriangle.on('move', function() {//function pour cacher le bulles avec un event.\n\t\tbullePente.update();\n\t});\n}", "function activarArrastradoPuntos(activar){\r\n if(activar){\r\n dragPuntosRuta.activate();\r\n }else{\r\n dragPuntosRuta.deactivate();\r\n selectFeatures.activate();\r\n }\r\n}", "function choque(){\n\n isChoque = true;\n bntRestart = this.add.sprite(130,300,'btnNuevaPartida').setInteractive();\n //game.state.start(game.state.current);\n bntRestart.setOrigin(0);\n bntRestart.setScale(1.5);\n asteroids.setVelocity(0,0);\n stars.setVelocity(0,0);\n }", "function userStudent() {\n //Chiedo i dati\n let userName = prompt(\"Inserisci il nome\");\n let userSurname = prompt(\"Inserisci il cognome\");\n let userEta = parseInt(prompt(\"Inserisci l'età\"));\n //Creo oggetto per l'utente\n userInfo = {};\n userInfo.nome = userName;\n userInfo.cognome = userSurname;\n userInfo.eta = userEta;\n}", "function remplirEntreprisesAsProf(anneeAcademique){\n\tmyApp.myajax({\n\t\tdata: {\n\t\t\t'action': 'visualiserEntreprisesAsProf',\n\t\t\t'anneeAcademique' : anneeAcademique\n\t\t},\n\t\tsuccess: function (data) {\n\t\t\tdtEntreprisesAsProf.clear();\n\t\t\tdtEntreprisesAsProf.rows.add(data).draw();\n\t\t\tif (rowSelectorEntreprise !== undefined){\n\t\t\t\tdtEntreprisesAsProf.row(rowSelectorEntreprise).select();\t\t\n\t\t\t}\n\t\t}\n\t});\n}", "function dibujarFresado117(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n var line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\n\t\n\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x+alaIzquierda,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n var line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n }\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3)){\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t\n\t\n\t\n\t\n\t//Puntos extra para esta pieza\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueDer)\n var line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\top_fresado.addObject(line,false);\n\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+pliegueDer)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n var line = new RLineEntity(document, new RLineData( fresado9 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\n var line = new RLineEntity(document, new RLineData( fresado21 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado20 , fresado11 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\n\treturn op_fresado; \n}", "function MetodoCruzamento(){\n //Nivel+1 para sabermos que não são os pais, e um o fruto de um cruzamento do nivel 1.\n\tNivel++;\n\tswitch(MetodoCruzamen){\n\t\tcase 1:\n\t\t\tKillError(\"-s [1:Não definido,2]\");\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tconsole.log(\"Cruzamento em andamento!\");\n\t\t\tconsole.log(\"- Crossover PMX\");\n\t\t\tconsole.log(\"- - Geração: \"+Geracao);\n\t\t\tif(Torneio==1){\n\t\t\t\tconsole.log(\"- - - Torneio\");\n\t\t\t}else{\n\t\t\t\tconsole.log(\"- - - Roleta\");\n\t\t\t}\n\t\t\twhile(Geracao>=0){\n\t\t\t\tCrossover_PMX();\n\t\t\t\tGeracao=Geracao-1;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tKillError(\"-s [1,2]\");\n\t}\n\tQualidadeCheck();\n}", "function caricaElencoScritture() {\n var selectCausaleEP = $(\"#uidCausaleEP\");\n caricaElencoScrittureFromAction(\"_ottieniListaConti\", {\"causaleEP.uid\": selectCausaleEP.val()});\n }", "function fasesTorneo() {\n vm.paso = 3;\n obtenerFases();\n obtenerTiposDeFase();\n obtenerPenalizaciones();\n }", "function startInterview(){\n // timer start \n // database upate user data\n // user id will be the object id? is that going to be safe? simply i will bcrypt the roomid and make it userid \n }", "function criarAtualiza(){\n\t\n\t//Faz o cursor custom seguir o mouse\n\tcursor.x = stage.mouseX + cursor.regX - 20;\n\tcursor.y = stage.mouseY + cursor.regY - 20;\n\tcursor.scaleX = cursor.scaleY = 0.7;\n\t\n\tambNum.text = (contador + 1) + \" / 10\";\n\t\n\tif(criarArea.contains(retornar_bttn)){\n\t\tanimal_atual.rotation = 350;\n\t\tanimal_atual.x = 150;\n\t\tanimal_atual.y = 465;\n\t}\n\n}", "function iniciar(){\n\t\n\tvar btnOkAlerta = document.getElementById(\"okalerta\");\n\tvar btnWarning = document.getElementById(\"okwarning\");\n\tvar btnSucess = document.getElementById(\"oksucess\");\n\n\tbtnOkAlerta.addEventListener(\"click\", function(e){\n\t\te.target.parentNode.parentNode.classList.remove(\"active\");\n\t}, false);\n\tbtnWarning.addEventListener(\"click\", function(e){\n\t\te.target.parentNode.parentNode.classList.remove(\"active\");\n\t}, false);\n\tbtnSucess.addEventListener(\"click\", function(e){\n\t\t\te.target.parentNode.parentNode.classList.remove(\"active\");\n\t}, false);\n\n\tvar btnEnviar = document.getElementById(\"enviar\");\n\tbtnEnviar.addEventListener(\"click\", procesarRecarga, false);\n}", "function pfPerception(){\n\tthis.inheritFrom = pfSkill;\n this.inheritFrom();\n this.setName(\"perception\");\n this.stat\t\t\t= \"wis\";\n}", "function specialClic() {\n if (presenceEnnemi===0){\n dialogBox(\"Tu veux t'amuser à faire de l'esbrouffe sans spectateurs ? T'es quel genre de gars ? Le genre à boire tout seul chez lui ? A faire tourner les serviettes lors d'un dîner en tête à tête avec ton chat ? Garde ton energie pour tes prochaines rencontres.\")\n }else if (presenceEnnemi===1){\n if(specialReboot <3){\n dialogBox(\"Tu dois encore attendre pour relancer un special, t'es fou ou quoi ? T'ES UN CHEATER UN TRUC DU GENRE ? NAN MAIS T'ES QUI POUR VOULOIR ENVOYER DES COUPS SPECIAUX H24, TA MERE ELLE T'A EDUQUé COMMENT AU JUSTE ?\");\n }else if(specialReboot ===3){\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>COUP SPECIAL DE LA MORT QUI TACHE</br>Attend trois actions pour pouvoir relancer le bouzin\");\n switch (classeChoisie){\n \n \n case \"guerrier\":\n \n rndEnnemi.esquive = Number(15);\n degatAssomoir = Number(personnage.force*2);\n rndEnnemi.sante = rndEnnemi.sante - degatAssomoir;\n document.getElementById(\"santeEnnemi\").innerHTML = rndEnnemi.sante;\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>Votre coup était SANS SOMMATION, votre adversaire en est tout étourdi et il semble perdre en agilité, il aura du mal à esquiver vos prochains coups, et vous lui infligez \"+degatAssomoir+\" point de dégats dans sa teuté.</br>\");\n \n break;\n \n case \"moine\":\n \n personnage.esquive = personnage.esquive - 15;\n personnage.sante = personnage.sante + 250;\n document.getElementById(\"santePerso\").innerHTML = personnage.sante;\n document.getElementById(\"esquivePerso\").innerHTML = personnage.esquive;\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>Vous sortez une fiole de votre poche et prenez une lampée, vous vous santez en meilleure forme, mais votre agilité en prend un coup ! Avec modération s'il vous plait !</br>\");\n \n break;\n\n case \"mage\":\n\n //Decide d'une invocation random parmis 3 possibles\n\n var Min= Number(1)\n var Max= Number(3)\n\n function getRndInterger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;}\n incantation = getRndInterger(Min, Max);\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>Les incantations d'Akimieumieu sont instables, vous vous concentrez et \");\n \n\n switch (incantation){\n case (1) :\n incantationName=\"BOULE DE SHNECK ULTRA\";\n degatBoule= (rndEnnemi.sante/2)+30;\n rndEnnemi.sante = rndEnnemi.sante - degatBoule;\n document.getElementById(\"santeEnnemi\").innerHTML = rndEnnemi.sante;\n document.getElementById(\"aventure\").innerHTML += (\"lancez le sort '\"+incantationName+\"' qui amoche votre adversaire bien salement, lui ôtant \" + degatBoule + \" Points de vie</br>EN FAIT C'EST LA MOITIE DE SA VIE + 30 SI T'A CAPTé</br>\" ) \n \n break;\n\n case (2) :\n incantationName=\"INVISIBILITÉ BON MARCHÉ\";\n personnage.esquive = Number(88);\n document.getElementById(\"esquivePerso\").innerHTML = personnage.esquive;\n document.getElementById(\"aventure\").innerHTML += (\"lancez le sort '\"+incantationName+\"'. L'adversaire ne vous voit que sous une forme quasiment transparente. Un peu comme si il regardait au travers d'une pinte de bière vide. C'est le moment d'esquiver ses coups !</br>\" ) \n \n break;\n \n case (3) :\n incantationName=\"CARRESSE PSYCHIQUE\";\n degatCarresse= 1;\n rndEnnemi.sante = rndEnnemi.sante + degatCarresse;\n document.getElementById(\"santeEnnemi\").innerHTML = rndEnnemi.sante;\n document.getElementById(\"aventure\").innerHTML += (\"lancez le sort '\"+incantationName+\"' que vous aviez appris à lancer à la Fac pour séduire une jeune mage très douce, qui depuis votre séparation s'est étrangement passionnée pour la démonologie. Ce sort n'est pas vraiment un sort de combat, et votre adversaire semble même un peu plus excité qu'au paravant, vous lui avez rendu \" + degatCarresse + \" Point de vie</br>\" ) \n \n break;\n }\n break;\n case \"david\":\n attaquer();\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>VOTRE ENNEMI A SIMPLEMENT CESSé D'EXISTER.</br>\");\n resetEnnemi();\n \n break;\n \n default :\n dialogBox(\"Interaction cheloue du spécial, merci d'en faire part au MJ il code comme un pied, veuillez l'excuser.\")\n break;\n }\nesquiver();\nspecialReboot=0;\nconsole.log(\"Le spécial s'est exécuté\");\nscrollDown(\"fenetreCentrale\");\n}\n}\n}", "function AbrirMonitor()\n{\t \n //Monitor de impresiones\n if(ventana_monitor== null)\t\t\t\n ventana_monitor=\"VentanaMonitor\";\n}", "constructor() {\n this.inicializar();\n this.generarSecuencia();\n this.siguienteNivel(); \n }", "function detectaEstado(){\r\n if(estados.inicio){\r\n menu();\r\n }\r\n else if(estados.jogando){\r\n player.desenhaPlayer();\r\n movimento()\r\n cenario.atualiza();\r\n obstaculos.atualiza();\r\n ctx.font = \"60px Arcade\"\r\n ctx.fillStyle = \"red\"\r\n ctx.fillText(player.score,canvas.width - 70,canvas.height/4 - 100,340);\r\n }\r\n else if(estados.morte){\r\n player.image.src = player.personagem.morto[0]\r\n ctx.drawImage(player.image,player.x,player.y,player.width,player.height)\r\n ctx.font = \"70px Arcade\"\r\n ctx.fillStyle = \"red\"\r\n ctx.fillText(\"You Lose !!\",canvas.width /2 - 110,canvas.height/2 + 40,340);\r\n ctx.fillStyle = \"#A5201F\"\r\n ctx.fillText(\"Seu Record: \" + player.record,canvas.width/2 - 540,canvas.height - 530,300);\r\n player.score = 0;\r\n obstaculos.objetos = [];\r\n player.x = 0;\r\n cancelAnimationFrame(Draw);\r\n }\r\n }", "function leerDatosCurso(curso){\n const infoCurso={\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: curso.querySelector('.precio span').textContent,\n id: curso.querySelector('a').getAttribute('data-id')\n }\n\n insertarCarrito(infoCurso);\n \n}", "function imprimrir2( persona ) {\n\n console.log( persona.nombre+\" \"+persona.apellido );\n}", "function LodLiveProfile() {\n\n }", "function procurarComida() {\n console.log()\n console.log(\"Você pega sua faca, enche o cantil de água e sai pra procurar o que comer... saudade do iFood?\")\n prompt(textos.enter)\n\n //pode ocorrer de achar frutas, achar caça, ou não achar nada\n let x = Math.random()\n if (x < 0.33) {\n //fruta\n let tempoCaminhada = calcTempo(10,30)\n let f = infos.frutaAleatoria()\n console.log(`Após caminhar por ${tempoCaminhada} minutos, você encontrou um pé de ${f.toLowerCase()}!`)\n console.log(\"Depois de descobrir que você não é um exímio catador de frutas, você consegue matar a fome e leva alguns frutos para casa\")\n prompt(textos.enter)\n infos.addItem(f)\n infos.fome = 100\n sede(-10);\n passaTempo(tempoCaminhada);\n mainJogo();\n\n }\n else if (x < 0.66) {\n //caça\n eventos.encontroAnimal()\n }\n else {\n //nada\n let tempoCaminhada = calcTempo(20,40)\n console.log(`Após caminhar por ${tempoCaminhada} minutos, você não encontrou nada para comer... e só fez ficar com mais fome e sede`)\n fome(-10);\n sede(-10);\n passaTempo(tempoCaminhada);\n mainJogo();\n\n }\n}", "function limpiarCapas(){\n limpiarCapaRecorridos();\n limpiarCapaParadas();\n limpiarCapaNuevaRuta();\n limpiarCapturaNuevaRuta();\n limpiarCapaEstudiantes();\n}", "function principal(){\n\n borraCanvas();\n\n console.log(ratonX + ' - ' + ratonY);\n\n for(i=0; i<numParticulas;i++){\n particulas[i].actualiza();\n }\n\n}", "function correr(){\n requestAnimationFrame(correr); //inicalizador del timer\n actividad(); //actualizamos la actividad de los elementos del canvas(Lienzo)\n pintar(ctx); //pintamos los elementos en el lienzo\n\n //inicializamos los controladores de los botones del raton en cada iteracion\n ultinaPresion=null;\n ultimaliberacion=null;\n}", "function actividad(nombre = \"Walter White\", actividad = \"Enseñar Quimica\") {\n console.log(\n `La persona ${nombre}, esta realizando la actividad ${actividad}`\n );\n}", "constructor() {\n this.activePcos_ = {};\n }", "function corrExam(){inicializar(); corregirText1(); corregirSelect1(); corregirMulti1(); corregirCheckbox1(); corregirRadio1(); corregirText2(); corregirSelect2(); corregirMulti2(); corregirCheckbox2(); corregirRadio2(); presentarNota();}", "function IniciaPersonagem() {\n // entradas padroes para armas, armaduras e escudos.\n gPersonagem.armas.push(ConverteArma({\n chave: 'desarmado',\n nome_gerado: 'desarmado',\n texto_nome: Traduz('desarmado'),\n obra_prima: false,\n bonus: 0\n }));\n}", "function IndicadorSexo () {}", "function gameToProfile() {\n\tpauseGame()\n\t$(\"#ui_game\").hide()\n\t$(\"#ui_profile\").show()\n\tretrieveUserInfo()\n\tsessionStorage.setItem(\"currentScreen\", \"profile\")\n}", "function ejecutaAccion(elemt, type, proyect ){\n\tactividadPrevia = true;\n\tborradoMultiple = false;\n\tcambiandoCategoria = false;\n\t\n\tif(!$(\"#tipoIdentificacion\").length){\n\t\t if( $(elemt).closest(\"div\").text().indexOf(\"Frente\") != (-1)) {\n\t\t\t\t$(\".cred_image:eq(0) input.custumStlFileUploadPreview\").trigger(\"click\");\n\t\t\t\t//$(\".cred_image:eq(0)\").addClass(\"opacity\"); \n\t\t\t}\n\t\t\t\t\n\t\t if( $(elemt).closest(\"div\").text().indexOf(\"Reverso\") != (-1)) {\n\t\t\t\t$(\".cred_image:eq(1) input.custumStlFileUploadPreview\").trigger(\"click\");\n\t\t\t\t//$(\".cred_image:eq(1)\").addClass(\"opacity\");\n\t\t\t} \n\t\t if( $(elemt).closest(\"div\").text().indexOf(\"Pasaporte\") != (-1)) {\n\t\t\t\t console.log($(elemt).closest(\"div\").text());\n\t\t\t\t$(\".cred_image:eq(2) input.custumStlFileUploadPreview\").trigger(\"click\");\n\t\t\t\t//$(\".cred_image:eq(2)\").addClass(\"opacity\");\n\t\t } \n\t}\n\t\n \n if($(elemt).closest(\"form\").find(\"select\").attr(\"id\") != \"type_loan\"){\n \t$(elemt).closest(\"form\").find(\"select\").val(type);\n \t$(elemt).closest(\"form\").find(\"select\").change();\n \t$(elemt).closest(\"form\").find(\"select\").blur();\n \t$(elemt).closest(\"form\").find(\".custumStlFileUploadPreview input\").trigger(\"click\");\n }\n if($(elemt).closest(\"form\").find(\"select\").attr(\"id\") == \"type_loan\" ){\n \tcambiarArchivo(type, \"#file_compIncome\", \"#rubroIngresos\");\t\n }\n \n if($(elemt).closest(\"#listCredFm2\").length ){\n \tconsole.log(\"ya entro a tipoIdentificacion\");\n \t cambiarArchivo(type, \"#file_credIdentificacion\", \"#rubroTipoIdentificacion\");\n \t//$(element).closest(\"frm_loan\").find(\".btn_comprobante[tipodoc='\"+type+\"']\");\n }\n\n}" ]
[ "0.5963708", "0.58822644", "0.56693804", "0.5634325", "0.5582588", "0.557755", "0.55533856", "0.5459065", "0.54418147", "0.5434953", "0.5421094", "0.54125375", "0.54060173", "0.5399411", "0.5376673", "0.53719276", "0.53463143", "0.5340437", "0.53368", "0.5305828", "0.5291392", "0.5279407", "0.527399", "0.52701193", "0.5254202", "0.5249597", "0.52433205", "0.5228834", "0.52258146", "0.5215973", "0.52118045", "0.5211541", "0.52071375", "0.5206869", "0.520089", "0.5195868", "0.5181029", "0.5174356", "0.5173114", "0.51731", "0.51716185", "0.5168006", "0.5161939", "0.51477325", "0.5137165", "0.51341784", "0.51168674", "0.5114753", "0.5108071", "0.510632", "0.5106081", "0.5099543", "0.5098416", "0.5074595", "0.507452", "0.5072031", "0.5054303", "0.50518185", "0.5050502", "0.50482774", "0.5043854", "0.5043062", "0.50427526", "0.50405157", "0.5036888", "0.5032001", "0.5030839", "0.5030098", "0.50289816", "0.5028571", "0.5027622", "0.50258344", "0.5024135", "0.50172037", "0.5011943", "0.5002822", "0.50008583", "0.49945742", "0.49930343", "0.49872535", "0.4982244", "0.49785334", "0.49778882", "0.4976685", "0.4975249", "0.49748212", "0.4974143", "0.4972634", "0.49650532", "0.49631697", "0.49619296", "0.49606892", "0.49552992", "0.49531907", "0.49523747", "0.4951781", "0.49488407", "0.49388832", "0.49347433", "0.49347046", "0.49326095" ]
0.0
-1
helper function: store token in local storage and redirect to the home view
function authSuccessful(res) { $auth.setToken(res.token); $location.path('/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SAVE_TOKEN(state, token) {\n localStorage.setItem(\"auth-token\", token);\n }", "token(value){ window.localStorage.setItem('token', value)}", "function security() {\n if(!localStorage.getItem('token')){\n console.log(\"El usuari intentava entrar a la pàgina sense prèviament haver-se registrar o loggejat\");\n window.location.replace(\"../html/index.html\");\n }\n}", "function checkLogIn() {\n if (localStorage.getItem('token') === null) {\n window.location.href = './login.html';\n }\n}", "static authenticateUser(token) {\n localStorage.setItem('token', token);\n }", "static authenticateUser(token) {\n localStorage.setItem('token', token);\n }", "login(token, cb) {\n localStorage.setItem(\"safe-token\", token);\n cb();\n }", "static authenticateUser(token) {\n localStorage.setItem('token', token);\n }", "function checkUserToken() {\n if (localStorage.getItem('user-token') == null) {\n window.location.replace('index.html');\n return true;\n }\n return false;\n}", "function checkToken(){//checks for a valid token and refreshes if necessary, if one doesn't exist or is expired it will take user back to index.html\n\n if(state.token){//if there is a token, refresh it\n $.ajax({\n url:'/api/auth/refresh/',\n method: 'POST',\n headers:{\n 'Authorization':`Bearer ${state.token}`,\n }\n }).done((res) => {\n localStorage.setItem('authToken', res.authToken);\n state.token = res.authToken;\n })\n .fail(error => {//if we fail to refresh token, redirect to landing page\n window.location.href = \"index.html\";\n localStorage.removeItem('authToken');\n })\n }\n else{//else redirect to landing page\n window.location.href = \"index.html\";\n }\n}", "function setToken(){\n var token = document.getElementById(\"token\").value;\n localStorage.setItem('token', token);\n}", "function redirexted() {\r\n\r\n // here we create localStorage data\r\n \r\n localStorage.setItem(\"userInfo\", JSON.stringify(auth.currentUser));\r\n\r\n // here we change page\r\n\r\n window.location.href = \"home.html\";\r\n\r\n}", "setToken(value) {\n localStorage.setItem('token', value);\n }", "function setToken(token) {\n if (token) {\n localStorage.setItem('token', token); // localStorage is available on the global scope\n } else {\n localStorage.removeItem('token');\n }\n}", "function storeJWT(data) {\n // Store Jwt locally\n localStorage.setItem('token', data.authToken);\n console.log('JWT in local storage: ' + localStorage.getItem('token'));\n retrievePage('/api/protected',\n {\n dataType: 'json',\n contentType: \"application/json\",\n beforeSend: function (request)\n {\n request.setRequestHeader(\"Authorization\", \"Bearer \" + localStorage.getItem('token'));\n },\n type: 'GET',\n success: window.location.href=\"/profile\",\n error: reportError\n }\n );\n}", "function authorize() {\n let isAuthenticated = commonService.getFromStorage('token');\n if (!isAuthenticated) {\n commonService.redirect(\"login.html\");\n }\n}", "function handleResponse(data){\r\n if(data.authenticated){\r\n const token = data.accessToken;\r\n localStorage.setItem('accessToken', token);\r\n setTimeout(()=>{\r\n window.location='https://ciobotaruva.github.io/crud-movie-application.github.io/';\r\n }, 3000);\r\n };\r\n}", "userLogin() {\n if (!localStorage.token) {\n return (\n <Redirect to={{ pathname: '/login', state: this.props.location }} />\n );\n }\n }", "function storage(token) {\n // calls autoRefresh everytime token is saved\n autoRefresh();\n for (var key in token) {\n localStorage.setItem(key, token[key]);\n }\n }", "function setStorageToken(token) {\n localStorage.setItem(tokenNameStorage, JSON.stringify({\n token: token\n }))\n }", "static setToken(token) {\n window.localStorage[this.TOKEN_KEY] = token;\n }", "function generateUser(users){\r\n if (users.token == null ){\r\n\r\n \r\n document.getElementById(\"message\").classList.add(\"alert\", \"alert-danger\");\r\n document.getElementById(\"message\").textContent = \"Vous n'êtes pas inscrit.\"\r\n } else{ \r\n // let cookieUser = document.cookie = `token=${users.token}; max-age=86000`;\r\n let storageUser = localStorage.setItem('token', `${users.token}`);\r\n location.href = \"articles.html\";\r\n }\r\n}", "function getToken() {\n let token = getTokenInLocal();\n\n if(token === '' || token == null){\n alert('您未登录!');\n var url = window.location.href;\n var index = url.lastIndexOf('/');\n var base = '';\n if ( index > 0 ){\n base = url.substring(0, index);\n }\n $(location).attr('href', base + '/login.html');\n }\n return token;\n}", "handleAuthentication() {\n this.auth0.parseHash((err, authResult) => {\n if (authResult && authResult.accessToken && authResult.idToken) {\n let expiresAt = JSON.stringify((authResult.expiresIn)* 1000 + new Date().getTime());\n // this.setSession(authResult);\n localStorage.setItem('access_token', authResult.accessToken);\n localStorage.setItem('id_token', authResult.idToken);\n localStorage.setItem('expires_at', expiresAt);\n location.hash = '';\n location.pathname = LOGIN_SUCCESS;\n }else if(err){\n location.pathname = LOGIN_FAILURE;\n console.log(err);\n alert(`Error: ${err.error}. Check the console for further details.`);\n }\n });\n }", "function getToken(){\n var token = localStorage.getItem('token', token);\n if (token != ''){\n document.getElementById(\"token\").value = token;\n }\n return token;\n}", "function storeToken(token){\n try\n {\n LocalStorage.set(Constants.TOKEN,token);\n return true;\n }\n catch(err)\n {\n return false;\n }\n }", "save(token) {\n this._$window.localStorage[this._AppConstants.jwtKey] = token;\n }", "function getToken(){\n return localStorage.getItem(\"token\");\n}", "function requireVerification(nextState, replace) {\nvar userInfo = JSON.parse(localStorage.getItem(\"userInfo\"));\n\nif(userInfo){\nif(userInfo.id){\n console.log(\"This is token \",userInfo.id);\n} \n}else{\n replace({ pathname: \"/login\" });\n \n}\n\n}", "function logout() {\n localStorage.removeItem('token');\n localStorage.removeItem('email');\n window.location.href = \"index.html\";\n}", "function goLogIn(){\n\t\tlocalStorage.setItem(\"Sawintro\", \"true\");\n\t\t\t$state.go(\"app.home\");\t\n\t}", "function logout() {\n token = null;\n if (!window.localStorage) return;\n window.localStorage.setItem('token', token);\n}", "authLoadToken({ dispatch }) {\n const token = window.localStorage.getItem('auth_token');\n if (token) dispatch('authSetToken', token);\n }", "function addTokenAfterSigned(data) {\n $('#first-pop-up').css('visibility', 'hidden')\n\n localStorage.setItem(\"token\", data.token)\n localStorage.setItem(\"loggedIn\", data.full_name)\n\n $('#google-button').css('visibility', 'hidden')\n $('#error-message').css('visibility', 'hidden')\n $('#sign-out').css('visibility', 'visible')\n $('form').find(\"input[type=text], textarea\").val(\"\")\n $('form').find(\"input[type=password], textarea\").val(\"\")\n $('#content').css('display', 'block')\n $('#welcome').text(`${data.full_name}'s Todo List`)\n $('#todo-lists').empty()\n loadTodoList()\n}", "function storeUserCredentials(token) {\n window.localStorage.setItem(LOCAL_TOKEN_KEY, token);\n }", "getToken() {\n return localStorage.getItem(\"token\") || null\n }", "function checkAuth() {\n let auth = $cookies.get('authToken');\n if (auth){\n } else {\n $state.go('home');\n }\n }", "function checkAuth() {\n let auth = $cookies.get('authToken');\n if (auth){\n } else {\n $state.go('home');\n }\n }", "function gotoSubmitAd() {\n if (localStorage.getItem('user_id')) {\n window.location.href = \"../dashboard/dashboard.html\";\n }\n else {\n window.location.href = \"../login/login.html\";\n }\n}", "onLoggedIn(authData) {\n this.props.setUser(authData.user);\n localStorage.setItem('token', authData.token);\n localStorage.setItem('user' , authData.user.Username);\n }", "async function signInUser() {\n let tokenStore;\n let userSignIn = {\n username: $('#UserName').val(),\n password: $('#Password').val(),\n email: $('#UserName').val()\n }\n localStorage.setItem('UserName', $('#UserName').val())\n let body = JSON.stringify(userSignIn)\n fetch('/', {\n method: 'POST',\n headers: {\n 'Authorization': 'test',\n 'Content-Type': 'application/json'\n },\n body: body\n })\n .then(response => response.json())\n .then( data => {\n localStorage.setItem('token', data),\n window.location.href = \"http://localhost:5000/items\"\n })\n}", "saveToken(token, role){\n this.token = token; \n this.role = role; \n localStorage.setItem('token', token) \n localStorage.setItem('role', role)\n }", "function workoutPage() {\n window.location.href = `/#/workout?access_token=${TOKEN}`;\n }", "function storeAuth(data){\n\tAUTHORIZATION_CODE = data.authToken;\n\tlocalStorage.auth = data.authToken;\n\t$(\"#js-login-user-form\").unbind().submit();\n}", "login(event){\n // const { username, password, errors} = this.state\n event.preventDefault();\n if(!this.handleValidation()){\n console.log('Form has error')\n }else{\n const userData = JSON.parse(localStorage.getItem(\"user\"));\n // const userDetail = userData.find(item => item.user == this.state.username);\n if (userData.username != this.state.username) {\n console.log('User Not Found')\n }\n if (userData.password != this.state.password) {\n console.log('Invalid Credential');\n }\n localStorage.setItem('token', 'res.data.token');\n window.open('http://localhost:3000/home', '_self')\n }\n\n }", "setToken(idToken) {\n localStorage.setItem('id_token', idToken);\n }", "checkForToken() {\n let hash = this.props.location.hash || this.props.location.search;\n if (hash === \"\") return;\n\n const params = this.getParams(hash);\n if (params.access_token) this.attemptSignIn(params.access_token);\n if (params.error) {\n this.props.history.push(\"/\");\n }\n }", "setToken (token, expiration) {\n localStorage.setItem('token', token)\n localStorage.setItem('expiration', expiration)\n }", "storeToken(token) {\n this._localStorageService.set(tokenKey, token);\n }", "function UserLogin(res){\n sessionStorage.setItem('id', res.id);\n sessionStorage.setItem('user_type', res.attributes.user_type);\n sessionStorage.setItem('school', res.attributes.school);\n sessionStorage.setItem('username', res.attributes.name);\n sessionStorage.setItem('token', res.getSessionToken());\n window.location = '/';\n}", "function logout(){\n localStorage.clear();\n window.location.replace(\"https://stavflix.herokuapp.com/client/\");\n }", "setToken(idToken) {\n localStorage.setItem('id_token', idToken)\n }", "function checkJWT() {\n if (!isLoggedIn())\n window.location.replace('/sign-in/?return=/daily-data/');\n}", "onLocalLogin() {\n let accessToken = localStorage.getItem('access_token');\n let refreshToken = localStorage.getItem('refresh_token');\n let user = JSON.parse(localStorage.getItem('user'));\n\n if (accessToken && refreshToken && user) {\n this.saveTokens({access_token: accessToken, refresh_token: refreshToken});\n this.loginSuccess(user, true);\n }\n }", "function store(event) {\r\n event.preventDefault();\r\n localStorage.setItem(\"user-name\", userName.value);\r\n localStorage.setItem(\"password\", password.value);\r\n alert(\"registered successfully!\");\r\n window.location.href = \"./sign-in.html\";\r\n}", "function getToken() {\n if(window.localStorage.getItem('token') != null){\n return window.localStorage.getItem('token')\n } \n return ''\n}", "getToken() {\n return JSON.parse(localStorage.getItem(TOKEN_KEY));\n }", "function setToken(token) {\n\t\t\tif (token) {\n\t\t\t\tlocalStorage.addLocal('token', token);\n\t\t\t\t$http.defaults.headers.common.Authorization = 'Bearer ' + token;\n\t\t\t}\n\t\t}", "function getToken() {\n const token = localStorage.getItem('token');\n if (token) {\n return `Token ${token}`;\n }\n return false;\n}", "function getLocalToken() {\n return 'Bearer ' + localStorage[\"authToken\"];\n}", "static getToken() {\n return localStorage.getItem('token');\n }", "static getToken() {\n return localStorage.getItem('token');\n }", "function view(index) {\r\n localStorage.setItem(LOCKER_INDEX_KEY, index);\r\n window.location = \"view.html\";\r\n}", "login(idToken, user) {\n localStorage.setItem(\"id_token\", idToken);\n localStorage.setItem(\"user\", JSON.stringify(user));\n }", "componentWillMount(){\n if (!localStorage.getItem('token')) {\n browserHistory.push('/login');\n }\n }", "function guardarLS(user) {\n const token = {\n token: user\n };\n localStorage.setItem('token', JSON.stringify(token));\n}", "_redirect_to_page() {\n var stored_startingPage = localStorage.getItem(\"startingPage\");\n if (stored_startingPage) {\n console.log('TrackingApp: Redirecting to user preferred page: ', stored_startingPage);\n this.set('route.path', stored_startingPage);\n }\n }", "function handleLogout() {\n window.localStorage.clear();\n setToken(localStorage.getItem(\"token\"));\n setCurrentUser({});\n console.log(\"localStorage is:\", localStorage);\n history.push('/login');\n }", "setToken (state, params) {\n // token 写入本地存储\n localStorage.token = params\n state.token = params\n }", "login(context, creds, redirect) {\n context.$http.post(LOGIN_URL, creds).then(response => {\n // get body data\n let data = response.body;\n localStorage.setItem('id_token', data.id_token);\n localStorageObj.setItem('user', data.user);\n this.user.authenticated = true\n // Redirect to a specified route\n if(redirect) {\n router.push(redirect);\n }\n }, response => {\n // error callback\n });\n }", "componentWillMount() {\n if (!localStorage.getItem(\"token\")) {\n browserHistory.push(\"/users/login\");\n }\n }", "function confirmSystemHaker(){\n if (sessionStorage.getItem(\"loggedUserId\")==null) {\n location.href = '/HTML/loginAndSigup.html'\n }\n}", "function changer_page_co(){\r\n localStorage.setItem(\"mode\",\"1\");\r\n window.location='login.html';\r\n}", "function success(user, pass, host) {\n localStorage.setItem(\"jit_user\", user);\n localStorage.setItem(\"jit_pass\", pass);\n localStorage.setItem(\"jit_host\", host);\n\n window.location.href = '../index.html';\n}", "function logout() {\n authState.jwt_token = ''\n localStorage.setItem('token', '');\n window.location.reload()\n }", "function loginCompleted(data) {\n if (data.token) {\n $state.go('main');\n } else { window.alert('Invalid Credentials'); }\n }", "function zhuxiao(){\n localStorage.setItem(\"username\",\"\");\n localStorage.setItem(\"password\",\"\");\n window.location.href=\"../index.html\";\n}", "function login(redirectURL){\n // Force a logout first by clearing the local storage. This prevents getting stuck in a loop with an\n // invalid/expired token. The GET user API is called if a token is there on loading the page, so also if\n // there was an invalid/expired one. By removing the token before logging in, it doesn't have an invalid\n // token when it returns from OpenStreetMap.\n logout();\n var urlBeforeLoggingIn = '';\n if (!redirectURL){\n // Get the current page the user is on and remember it so we can go back to it\n urlBeforeLoggingIn = $location.path();\n }\n else {\n urlBeforeLoggingIn = redirectURL;\n }\n $window.location.href = configService.tmAPI + '/auth/login?redirect_to=' + urlBeforeLoggingIn;\n }", "function getTokenSuccess(data) {\n\n $(\"#overlay-div\").css(\"display\", \"none\");\n\n if (data.access_token && data.refresh_token) {\n\n //setting this value when the getting the token is successful\n localStorage.setItem(\"lastLoginDate\", new Date());\n var date = new Date();\n \n var format = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();\n var ss = new cordova.plugins.SecureStorage(\n function () {\n console.log('Success')\n },\n function (error) {\n console.log('Error ' + error);\n //@Sagar first set the message to display later on display the alert\n $(\"#message-to-display\").html(error);\n $(\"#alert-dialog\").foundation(\"open\");\n },\n 'my_app'\n );\n \n //setting the access token in secure storage\n ss.set(\n function (key) {\n //success block\n },\n function (error) {\n console.log('Failed to save access token ' + error);\n },\n 'AccessToken', data.access_token\n );\n //setting the refresh token in secure storage\n ss.set(\n function (key) {\n //success block\n },\n function (error) {\n console.log('Failed to save refresh token ' + error);\n },\n 'RefreshToken', data.refresh_token\n );\n ss.set(\n function (key) {\n //success block\n },\n function (error) {\n console.log('Failed to save lastLoginDate token ' + error);\n },\n 'LastLoginDate', format\n );\n //navigating the user to login success page\n inAppBrowserObject.close();\n window.location = \"html/login_success.html\";\n\n } else {\n inAppBrowserObject.close();\n $(\"#message-to-display\").html(\"There was an error loading the details.<br>Please close app and try again.<br>If the problem persists call us on<br><a href='tel:1800652525'>1800 652 525</a>\");\n $(\"#alert-dialog\").foundation(\"open\");\n }\n\n}", "function logout() {\n window.localStorage.clear();\n window.location.href = '/index.html';\n}", "function logout(){\n localStorage.clear();\n window.location.href = \"/login\";\n}", "function logout() {\n localStorage.removeItem(\"token\");\n}", "function redirect(router = '', queryParams = '') {\n\n if(queryParams != '') queryParams = '&' + queryParams;\n\n\n if(access_token) {\n\n window.location.href = \"http://localhost:3000\" + router + \"?access_token=\" + access_token + \"&refresh_token=\" + refresh_token + queryParams;\n\n }\n\n else { \n\n window.location.href = \"http://localhost:3000\" + router + queryParams;\n\n }\n\n}", "function redirectToHome(){\n\t\t\t\tvar form; // dynamic form that will call controller\t\n\t\t\t form = $('<form />', {\n\t\t\t action: \"dashboard.html\",\n\t\t\t method: 'get',\n\t\t\t style: 'display: none;'\n\t\t\t });\n\t\t\t //Form parameter insightId\n\t\t\t $(\"<input>\").attr(\"type\", \"hidden\").attr(\"name\", \"googleSession\").val(googleStatus).appendTo(form);\n\t\t\t //Form submit\n\t\t\t form.appendTo('body').submit();\n\t\t\t}", "function goToVT() {\n location.href = \"../vt/showVT.htm?csrfToken=\" + csrfToken;\n}", "function validaLogin() {\n \n $.ajax({\n type: \"POST\",\n url: url + \"usuarios/validatoken\", \n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': \"Bearer \" + localStorage.getItem(\"token\")\n },\n success: function (data) { \n },\n error: function (x, exception) { \n location.href = \"index\";\n }\n });\n}", "function getToken(){\n \n return $window.localStorage.getItem(tokenStorageName);\n\n }", "function redirectHome() {\n cleanUp();\n $state.go('app.home');\n }", "function logout(){\n localStorage.clear();\n window.location = \"/login\";\n}", "function goToSpotifyAuthLogin() {\n login().then((data) => {\n window.location.replace(data.authorizeURL);\n });\n }", "function checkLogin(req,res,next){\n var myToken= localStorage.getItem('myToken');\n try {\n jwt.verify(myToken, 'loginToken');\n } catch(err) {\n res.send (\"you need login to access this page\");\n }\n next();\n}", "function saveToken() {\n\n sparkLogin(function(data) {\n window.token = data[\"access_token\"];\n console.log('Grabbed token from Spark: ' + token);\n $.ajax({\n type: 'POST',\n url: '/savetoken',\n data: { token: window.token },\n success: function() {\n console.log('Saved token to SP database: ' + token);\n window.location.reload();\n }\n })\n });\n}", "setSession (authResult) {\n if (authResult && authResult.accessToken && authResult.idToken) {\n // Set the time that the access token will expire at\n let expiresAt = JSON.stringify(\n authResult.expiresIn * 1000 + new Date().getTime()\n )\n localStorage.setItem('access_token', authResult.accessToken)\n localStorage.setItem('id_token', authResult.idToken)\n localStorage.setItem('expires_at', expiresAt)\n this.authNotifier.emit('authChange', { authenticated: true, admin: this.isAdmin() })\n // navigate to the home route\n // router.push('/home')\n }\n }", "function onLoadFunctionForIndex() {\n if (localStorage.getItem(\"username\") != null) {\n window.location.replace(\"../html/forum.html\");\n }\n}", "componentDidMount() {\n let auth = JSON.parse(localStorage.getItem(\"authTokenX4E\"));\n\n if(auth){\n this.props.history.push(\"/home\");\n }\n }", "function logout() {\n localStorage.removeItem(\"storedID\");\n localStorage.removeItem(\"storedUsername\");\n localStorage.removeItem(\"storedPass\");\n\n //redirect to login page here\n console.log(\"cleared localstorage\");\n $(\"ion-app\").load(\"start.html\");\n}", "function set_token($token){\n $.AMUI.utils.cookie.set('s_token',$token);\n set_headers();\n }", "redirect() {\n if (get(this, 'session.isAuthenticated')) {\n this.transitionTo('index');\n }\n }", "function logout() {\n\t\tif (Modernizr.localstorage) {\n\t\t\tlocalStorage.removeItem('X-Authorization-Token');\n\t\t}\n\t\t\n\t\twindow.location.href = '/';\n\t}", "loadToken(){\n if(localStorage.getItem('token')){ //si no esta vacio\n this.token = localStorage.getItem('token') //carga \n } \n if(localStorage.getItem('role')) { //si no esta vacio\n this.role = localStorage.getItem('role') //carga \n } \n }" ]
[ "0.73591375", "0.7233373", "0.71618503", "0.7160674", "0.7115291", "0.7115291", "0.706719", "0.703535", "0.70125324", "0.692627", "0.6872878", "0.6740792", "0.6732468", "0.6690629", "0.66424763", "0.66030806", "0.66015", "0.65718013", "0.6570272", "0.6561352", "0.6550605", "0.6548694", "0.6532799", "0.65130097", "0.65084153", "0.6497705", "0.64837956", "0.6474065", "0.64645004", "0.64570117", "0.64495736", "0.64182776", "0.6386159", "0.6370344", "0.63692486", "0.63561213", "0.63351154", "0.63351154", "0.6328347", "0.63277525", "0.63063365", "0.6285691", "0.62847495", "0.62794214", "0.6275333", "0.62713504", "0.6267578", "0.6259725", "0.6237516", "0.6233541", "0.62250197", "0.6222881", "0.6218983", "0.6215975", "0.6214618", "0.6210096", "0.61919945", "0.6184954", "0.618364", "0.6176072", "0.617188", "0.617188", "0.6152585", "0.61464244", "0.6142204", "0.6140857", "0.6139121", "0.6133489", "0.6124141", "0.61231613", "0.61105406", "0.6109575", "0.6109288", "0.6107476", "0.6097797", "0.60878783", "0.6086397", "0.6082272", "0.608018", "0.60717815", "0.60710144", "0.6070769", "0.6070657", "0.60664284", "0.6063646", "0.60632944", "0.6059347", "0.6058565", "0.6056926", "0.6049117", "0.6044832", "0.60367", "0.60360885", "0.6031259", "0.6031215", "0.6029139", "0.6028862", "0.60143834", "0.60073113", "0.6006109" ]
0.60219425
97
helper function: error function callback
function handleError(err) { $log.warn('warning: Something went wrong', err.message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "error(error) {}", "function failureCB(){}", "function failureCB() { }", "onError() {}", "function yankError(callback) {\n\t return function (err, results) {\n\t if (err || (results[0] && results[0].error)) {\n\t callback(err || results[0]);\n\t } else {\n\t callback(null, results.length ? results[0] : results);\n\t }\n\t };\n\t}", "function _perror(callback) {\n return function(err) {\n callback(err);\n };\n}", "function statusError()\n\t{\n\t\tcallback();\n\t}", "function processErrors(data){\n \n}", "function error_callback(e) {\n\t\talert(\"chyba:\" + e);\n\t}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n callback(err || results[0]);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "error() {}", "function handleError(error) {\n console.log(\"failed!\".red);\n return callback(error);\n }", "function OnErr() {\r\n}", "onerror() {}", "onerror() {}", "callbackWrapper() {\n if (this.error == \"obstruction_error\") {\n this.error = false\n this.callback('obstruction_error')\n } else if (this.error == 'outofbounds_error') {\n this.error = false\n this.callback('outofbounds_error')\n } else\n this.callback()\n }", "function CustomError() {}", "errorCallback(callback) {\n\t\tthis._cbError = callback\n\t}", "function ErrorHandler() {}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "function onError(e) { console.log(e); }", "function yankError(callback, docId) {\n\t return function (err, results) {\n\t if (err || (results[0] && results[0].error)) {\n\t err = err || results[0];\n\t err.docId = docId;\n\t callback(err);\n\t } else {\n\t callback(null, results.length ? results[0] : results);\n\t }\n\t };\n\t}", "function yankError(callback, docId) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n err = err || results[0];\n err.docId = docId;\n callback(err);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n }", "handleFailure (error_)\n\t{\n\t\tthrow error_;\n\t}", "function failureCallback (err) {\n console.error(`Failed with ${err}`)\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function errorCB(err) {\n //alert(\"Error processing SQL: \"+err.code);\n \n }", "function errorFunction(errorThrown){\r\n alert(\"error\");\r\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function ErrorCB(err) {\n console.log(err);\n\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function OnErrorCallMaladie(jqXHR, status) {\n\t\t}", "function error(error) {\n console.log(\"Error : \" + error);\n}", "function handleError(errStat){\n alert(\"this isnt working\" + errStat);\n }", "function MyError() {}", "function MyError() {}", "function dataError(e){\r\n console.log(\"An error occured\");\r\n}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onError(callback) {\n return this.__internal.addErrorCallback(callback)\n }", "function error() {\n _error.apply(null, utils.toArray(arguments));\n }", "function loaderErrback(error, url) {\n//console.error(\"in loaderErrback\", error);\n\t\t\tLoader._error(\"Error loading url '\"+url+\"'\");\n\t\t\tif (errback) {\n\t\t\t\terrback(error, url);\n\t\t\t\tloadNext();\n\t\t\t} else {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}", "onError(fn) {\n\n this.eventEmitter.on(settings.socket.error, (data) => {\n\n fn(data)\n });\n }", "function search_errorCB(data) {\n console.log(\"Error callback: \" + data);\n }", "function yankError(callback, docId) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n err = err || results[0];\n err.docId = docId;\n callback(err);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback, docId) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n err = err || results[0];\n err.docId = docId;\n callback(err);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function yankError(callback, docId) {\n return function (err, results) {\n if (err || (results[0] && results[0].error)) {\n err = err || results[0];\n err.docId = docId;\n callback(err);\n } else {\n callback(null, results.length ? results[0] : results);\n }\n };\n}", "function errback(err) {\n //alert(err.toString());\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function defaultError(error)\n{\n msg(\"error \" + error.responseText);\n}", "onerror(err) {\n this.emitReserved(\"error\", err);\n }", "function errorCB(err) {\n console.log(\"Error processing SQL: \"+err.code);\n}", "function fail() {\n return error(\"Something failed\");\n}", "function fail() {\n return error(\"Something failed\");\n}", "function fail() {\n return error(\"Something failed\");\n}", "function fail() {\n return error(\"Something failed\");\n}", "function error(err) {\n if (err !== 'cancelled') { //We don't care about cancelled.\n //TODO: It may be useful in some cases to display the error. Which cases?\n console.error(err);\n }\n }", "function showError() {}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error ini : \" + error); \n}", "function error(err) {\n console.log('Request Failed', err); //error details will be in the \"err\" object\n}", "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "function onFail(message) {\n\n}", "function findErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot find data\")\n\t\tthrow error\n\t} else {\n\t\tlog(result) \n\t}\n}", "function error(err) {\n var problem;\n if (err.code == 1) {\n // user said no!\n problem = \"You won't share your location with us.\"\n }\n if (err.code == 2) {\n // location is unavailable - no satellites in range?\n problem = \"Your location is unavailable.\"\n }\n if (err.code == 3) {\n // request timed out\n problem = \"Something was too slow.\"\n }\n document.getElementById('location').innerHTML = \"Something went wrong! \"+problem;\n \n}", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n requestPhotos(fallBackLocation)\n \n}", "function onError(error) {\n throw error;\n}", "function onError(err, callback) {\n if (callback) {\n return callback(err);\n }\n\n throw err;\n}", "function errorCB(err) {\n\talert(\"Error processing SQL: \"+err.code+\" msg: \"+err.message);\n}", "function error(err) {\n\t deferred.reject(err.message);\n\t}", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "function error(error) {\n // error Parameter from Promise.reject()\n console.log(\"Error : \" + error);\n}", "function fail() {\n return error('Something failed');\n }", "function gotError(theerror) {\n console.log(theerror);\n}", "function errorFunction(position) {\n console.log('Error!');\n }", "function errorCallback(response) {\n console.log( 'The following error occurred: ' + response.name);\n}", "function handleError(err,callback)\n {\n logger.error(err); //to save more data (e.g. ts)\n var d = {};\n d['Error'] = err.toString();\n d['roundId'] = $scope.round.roundId;\n d['robotName'] = err.robotName;\n d['created'] = err.created;\n d['fileName'] = err.fileName;\n d['timestamp'] = (new Date()).getTime();\n db.collection('errors').insertOne(d,function(err,res)\n {\n $scope.round['errors'].push(res['_id']);\n setTimeout(callback,0);//to save id of error to current round and than save round to db with errorId\n });\n }", "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "function error(){\n return \"Invaild e-mail or password!\";\n }", "function gotError(theerror) {\n print(theerror);\n}", "function gotError(theerror) {\n print(theerror);\n}", "function onError(error) { handleError.call(this, 'error', error);}", "function errorCB(tx, err) {\n\t//alert(\"Error processing SQL: \"+err);\n}", "function VeryBadError() {}", "function errorReportCallback(err) {\n if (err) {\n process.nextTick(function () {\n if (typeof err === 'string') {\n throw new Error(err);\n } else {\n throw err;\n }\n });\n }\n}", "function errorHandler(error) { console.log('Error: ' + error.message); }", "error(error) {\n this.__processEvent('error', error);\n }", "function error(){\n alert('invalid info')\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error: \" + error);\n}", "function errback(err) {\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function errorCB(err) {\r\n alert(\"Error processing SQL: \"+err.code);\r\n }", "function updateErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot update data\")\n\t\tthrow error\n\t} else {\n\t\tlog(\"Update Success\") \n\t}\n}" ]
[ "0.80505323", "0.7849296", "0.7849296", "0.7849296", "0.7737044", "0.7559522", "0.74196345", "0.74135435", "0.7331549", "0.73024285", "0.727497", "0.7246456", "0.7195072", "0.7169237", "0.7169237", "0.7169237", "0.7169237", "0.7169237", "0.7169237", "0.7169237", "0.7169237", "0.7167891", "0.7112437", "0.7107343", "0.70967555", "0.70967555", "0.7043033", "0.7036186", "0.70295984", "0.7028314", "0.69909245", "0.694661", "0.6934953", "0.6931352", "0.69057804", "0.69038796", "0.6903352", "0.68982154", "0.6881074", "0.68719006", "0.68595636", "0.6858419", "0.6856233", "0.68206966", "0.6815351", "0.6814503", "0.6814503", "0.6812348", "0.67972773", "0.67972773", "0.6795254", "0.6791778", "0.6772537", "0.677131", "0.6765897", "0.6761679", "0.6761679", "0.6761679", "0.67610806", "0.67551345", "0.67502946", "0.67475384", "0.67463315", "0.67463315", "0.67463315", "0.67463315", "0.6743557", "0.6736163", "0.6734607", "0.6733715", "0.67301905", "0.67140096", "0.6710645", "0.67102563", "0.6680428", "0.66774327", "0.666994", "0.66510504", "0.6642796", "0.6638048", "0.6636518", "0.6634389", "0.6632421", "0.66291463", "0.6628946", "0.6626665", "0.6614228", "0.66102874", "0.6608502", "0.6608502", "0.6607763", "0.6606631", "0.6605146", "0.6604082", "0.6604025", "0.6592685", "0.65860105", "0.6584497", "0.6581188", "0.65781623", "0.6577951" ]
0.0
-1
What is the Greatest Common Divisor? The Greatest Common Divisor of two or more integers is the largest positive integer that divides each of the integers. For example, take two numbers 42 and 56. 42 can be completely divided by 1, 2, 3, 6, 7, 14, 21 and 42. 56 can be completely divided by 1, 2, 4, 7, 8, 14, 28 and 56. Therefore, the greatest common divisor of 42 and 56 is 14. Input Two variables testVariable1 and testVariable2 containing numbers. Output The greatest common divisor of testVariable1 and testVariable2. Sample Input 6, 9 Sample Output 3 ```
function gcd(testVariable1, testVariable2) { let value=0; for(let i = 0; i< testVariable1; i++){ for(let j= 0; j < testVariable2;j++){ if((testVariable1%i==0)&&(testVariable2%j==0)){ value=i; } } } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function greatestCommonDivisor (a, b) {\n var gcd = 1;\n var low = a <= b ? a : b;\n for (var i = 2; i < low; i++) {\n if (a % i == 0 && b % i == 0 ) {\n gcd *= i;\n a /= i; \n b /= i;\n low /= i;\n }\n }\n return gcd;\n}", "function greatestCommonDivisor(a, b) {\n\tvar divisor = 2,\n\t\tgreatestDivisor = 1;\n\n\tif (a < 2 || b < 2) \n\t\treturn 1;\n\n\twhile (a >= divisor && b >= divisor) {\n\t\tif (a % divisor == 0 && b % divisor == 0) {\n\t\t\tgreatestDivisor = divisor;\n\t\t}\n\n\t\tdivisor++;\n\t}\n\n\treturn greatestDivisor;\n}", "function greatestCommonDivisor(a, b) {\n var divisor = 2,\n greatestDivisor = 1;\n\n if (a < 2 || b < 2) {\n return 1;\n }\n\n while (a >= divisor && b >= divisor) {\n if (a % divisor == 0 && b % divisor == 0) {\n greatestDivisor = divisor;\n }\n divisor++;\n }\n return greatestDivisor;\n}", "function GreatestCOmmonDivisor(a, b){\n var divisor = 2;\n greatestDivisor = 1;\n\n if (a < 2 || b < 2){\n return 1;\n }\n\n while(a >= divisor && b >= divisor){\n if (a % divisor == 0 && b% divisor == 0) {\n greatestDivisor = divisor;\n }\n divisor ++;\n }\n return greatestDivisor;\n}", "function greatest_common_factor(number1, number2) {\n let divider = 1;\n let largeNum = number1 >= number2 ? number1 : number2;\n let smallNum = largeNum === number1 ? number2 : number1;\n while (divider <= smallNum) {\n let testNum = smallNum / divider;\n if (largeNum % testNum === 0) {\n return testNum;\n }\n divider++;\n }\n}", "function greatestCommonDivisor(a, b) {\n if (b === 0) {\n return a;\n }\n return greatestCommonDivisor(b, a % b);\n}", "function greatestCommonDivisor(a, b){\n if(b == 0)\n return a;\n else \n return greatestCommonDivisor(b, a%b);\n}", "function greatestCommonDivisor(num1, num2) {\n var divisor = 2,\n greatestDivisor = 1;\n\n // if num1 or num2 are negative values\n if (num1 < 2 || num2 < 2) return 1;\n\n while (num1 >= divisor && num2 >= divisor) {\n if (num1 % divisor == 0 && num2 % divisor == 0) {\n greatestDivisor = divisor;\n }\n divisor++;\n }\n return greatestDivisor;\n}", "function greatestCommonDivisor(a, b) {\n if(b == 0) {\n return a;\n } else {\n return greatestCommonDivisor(b, a%b);\n }\n}", "function gcd(num1, num2) {\n var commonDivisor = [ ];\n let highNum = num1;\n if(num1 < num2){\n highNum = num2;\n \n }\n \n for (let i = 1; i <= highNum; i++) {\n if(num1 % i === 0 && num2 % i === 0){\n commonDivisor.push(i);\n }\n } \n const returnNum = Math.max(...commonDivisor);\n return returnNum; \n \n}", "function greatesrDivisor(num1, num2) {\n let divisors = [];\n for(i=1; i <= num2; i++)\n if(num1%i === 0 && num2%i === 0){\n divisors.push(i)\n }\n let largestDivisors = divisors.reduce(function(a,b){\n return Math.max(a, b);\n })\n return largestDivisors;\n\n}", "function Division(num1, num2) {\n var greatestSoFar = 1;\n var min = Math.min(num1, num2);\n for(var i = 2; i <= min; i++) {\n if(num1%i === 0 && num2%i === 0) {\n greatestSoFar = i;\n }\n }\n return greatestSoFar;\n}", "function findGdivisor(num1, num2) {\n var tmp;\n for (var i = 0; i <= num2; i++) {\n if (num1 % i === 0 && num2 % i === 0) {\n tmp = i;\n }\n } return tmp;\n}", "function Division(num1,num2) { \n var gcf = 1; // gcf represents the greatest common factor, which is what we're ultimately trying to figure out here. The GCD for 2 numbers is always at least 1.\n for (var i = 0; i <= num1 && i <= num2; i++){ // FOR-LOOP: Starting at 0, and up until i reaches either the value of num1 or num2 (whichever is lesser), for each number up to that point...\n if (num1 % i == 0 && num2 % i == 0){ // IF: i is a common factor of both num1 and num2... \n // ^ Think about the code here. var i reprsents potential common factors. If there is no remainder after dividing num1 by i, then i is a factor of num1. Using the && allows us to test if i is a COMMON factor b/w num1 and num2\n\n gcf = i; // -> if i is a common factor -> then make the value of i as the greatest common factor (which is subject to change as we proceed thru the for-loop)\n }\n }\n return gcf; // return the value of the greatest common factor\n}", "function greatestDivisor(x, y) {\n \n if (x <= y) {\n var res = x;\n }else{\n res = y;\n }\n for (var i = res; i > 0; i--) {\n if (x % i === 0 && y % i === 0) {\n return i\n }\n } \n}", "function commonDivisor (numb1, numb2) {\n var divisor = 0;\n var min = numb1;\n if (numb2 < min) {\n min = numb2;\n }\n for (var i = min; i > 0; i--) {\n if (numb1 % i === 0 && numb2 % i === 0) {\n divisor = i;\n break;\n }\n }\n return divisor;\n}", "function gcd(a, b) {\r\n /**Return the greatest common divisor of the given integers**/\r\n if (b == 0) {\r\n return a;\r\n } else {\r\n return gcd(b, a % b);\r\n }\r\n }", "findGCD (num1, num2) {\n let max = num1 > num2 ? num1 : num2\n let min = num1 > num2 ? num2 : num1\n let diff = max - min\n while (diff !== 0) { \n let temp = min % diff\n min = diff\n diff = temp\n }\n return min\n }", "function gcd(a, b) {\n const commonFactors = [];\n const min = Math.min(a, b);\n const max = Math.max(a, b);\n for (let i = 1; i <= min; i++) {\n if (min % i === 0 && max % i === 0) {\n commonFactors.push(i);\n }\n }\n return commonFactors[commonFactors.length - 1];\n}", "function gcd(a,b) {\n if (Math.floor(a)!=a || Math.floor(b)!=b) return 1; // se i numeri non sono interi restituisce 1\n a = Math.abs(a); b = Math.abs(b);\n if (b > a)\n b = (a += b -= a) - b; // scambia le variabili in modo che b<a\n while (b !== 0) {\n var m = a % b;\n a = b;\n b = m;\n }\n return a;\n}", "function GCDivisor(a ,b){\n if (b == 0){\n return a;\n } else {\n return GCDivisor(b, a % b)\n }\n}", "function gcd_two_numbers(x, y) {\n if ((typeof x !== 'number') || (typeof y !== 'number')) \n return false;\n x = Math.abs(x);\n y = Math.abs(y);\n while(y) {\n var t = y;\n y = x % y;\n x = t;\n }\n return x;\n }", "function findGcd(num1, num2, divider = 1) {\r\n const max = Math.max(num1, num2);\r\n const min = Math.min(num1, num2);\r\n if (min % divider === 0 && max % (min / divider) === 0) {\r\n return min / divider;\r\n }\r\n divider++;\r\n return findGcd(max, min, divider);\r\n}", "function gcd(num1, num2){\n let numArray1 = [];\n let numArray2 = [];\n let finalArray = [];\n let longestArray;\n let shortestArray;\n for (let i = 1; i <= Math.floor(num1); i++) {\n if (num1 % i === 0) {\n numArray1.push(i);\n } \n }\n for (let i = 1; i <= Math.floor(num2); i++) {\n if (num2 % i === 0) {\n numArray2.push(i);\n } \n } \n for (let i = 0; i < numArray1.length || i < numArray2.length; i++) {\n if (numArray1.length > numArray2.length){\n longestArray = numArray1;\n shortestArray = numArray2;\n }\n else {\n longestArray = numArray2;\n shortestArray = numArray1;\n }\n }\n for (let i = 0; i < shortestArray.length; i++) {\n if(longestArray.indexOf(shortestArray[i]) > -1){\n finalArray.push(shortestArray[i]);\n } \n }\n return Math.max(...finalArray);\n }", "gcd(a, b) {\n // Euclid's algorithm\n let n = new Decimal(a);\n let d = new Decimal(b);\n if (!(n.isInteger() && d.isInteger())) {\n throw new TypeError('gcd() invalid arguments');\n }\n while (!n.isZero()) {\n let r = n.clone();\n n = integer.rem(d, r);\n d = r;\n }\n return d;\n }", "function gcd(a, b)\n{\n\t// a should be largest\n\tif (a < b)\n\t{\n\t\t[a, b] = [b, a];\n\t}\n\t\n\twhile (b !== 0)\n\t{\n\t\tconst t = b;\n\t\tb = a % b;\n\t\ta = t;\n\t}\n\treturn a;\n}", "function greatestDicisor(x, y) {\n if (x <= y) {\n var pom = x;\n }else{\n pom = y;\n }\n for (var i = pom; i > 0; i--) {\n if (x % i === 0 && y % i === 0) {\n return i\n }\n } \n}", "function gcd(a, b) {\n\tvar t;\t\t\t\t\t\t\t\t\t\t// variavel temp para troca de valores\n\tif (a < b) t=b, b=a, a=t;\t\t\t\t\t// garante que a >= b\n\twhile (b != 0) t=b, b=a%b, a=t;\t\t\t\t// algoritmo de Euclides para MDC\n\treturn a;\n}", "function gcd(a,b){\n let am=Math.abs(a), bm=Math.abs(b), min=Math.min(a,b);\n for (var i=min;i>0;i--){\n if (am%i===0 && bm%i===0) return i;\n }\n }", "function GCD (a,b) {\n\t// TODO\t\n\tvar r=a%b;\t\n\twhile (r!=0) {\n\t\ta=b;\t\n\t\tb=r; \n\t\tr=a%b;\t\t\n\t}\n\treturn b;\n}", "function gcd(a, b) {\r\n if (b > a) return gcd(b, a)\r\n if (b === 0) return a\r\n return gcd(b, a % b)\r\n}", "function gcd(a, b) {\n\twhile (b !== 0) {\n\t\tvar z = a % b;\n\t\ta = b;\n\t\tb = z;\n\t}\n\treturn a;\n}", "function getGCD(a,b) {\n if (b > a) {var temp = a; a = b; b = temp;}\n while (true) {\n if (b == 0) \n\t\t\treturn a;\n a %= b;\n if (a == 0) \n\t\t\treturn b;\n b %= a;\n }\n}", "function GCD(a, b) {\n if (b === 0)\n return a\n else\n return GCD(b, a % b)\n}", "function euclid_gcd(A, B) {\r\n\tif (B == 0)\r\n\t\treturn A;\r\n\telse\r\n\t\treturn euclid_gcd(B, A % B);\r\n}", "function gcd(x, y) {\n\tif (typeof x != \"number\" || typeof y != \"number\" || isNaN(x) || isNaN(y))\n\t\tthrow \"Invalid argument\";\n\tx = Math.abs(x);\n\ty = Math.abs(y);\n\twhile (y != 0) {\n\t\tvar z = x % y;\n\t\tx = y;\n\t\ty = z;\n\t}\n\treturn x;\n}", "function gcdEuclid(num1, num2) {\n let min = Math.min(num1, num2);\n let max = Math.max(num1, num2);\n if(max % min === 0) return min;\n else return gcdEuclid(min, max % min);\n}", "function hcf(){\n let a = 144;\n let b = 96;\n while (b > 0){\n let temp = a;\n a = b;\n b = temp%b;\n };\n console.log('The highest common factor is: '+ a);\n}", "function gcd(num1, num2) {\n\n}", "function gcd(x, y) {\n\twhile (y != 0) {\n\t\tvar z = x % y;\n\t\tx = y;\n\t\ty = z;\n\t}\n\treturn x;\n}", "function gcf(num1, num2){\n if (num1 > num2){ //this ensures num1 is the smaller number\n var temp = num1; // 1...\n num1 = num2;\n num2 = temp;\n }\n for (var i = num1; i > 1; i--){ // n - dictated by size of num1\n if (num1 % i === 0 && num2 % i === 0){ // 2\n return i;\n }\n }\n return 1;\n}", "function gcd(a,b)\n{\nif (b == 0)\n {return a}\nelse\n {return gcd(b, a % b)}\n}", "function solveGCD(firstNumber, secondNumber){\n while(secondNumber){\n let temp = secondNumber;\n secondNumber = firstNumber % secondNumber;\n firstNumber = temp; \n }\n return firstNumber;\n}", "function GCD(a, b){\n while (b != 0) {\n var c = a % b;\n a = b;\n b = c;\n }\n return a;\n }", "function gcd(x, y) {\n if ((typeof x !== 'number') || (typeof y !== 'number')) \n return false;\n x = Math.abs(x);\n y = Math.abs(y);\n while(y) {\n var t = y;\n y = x % y;\n x = t;\n }\n return x;\n}", "function gcd(x, y) {\n if ((typeof x !== 'number') || (typeof y !== 'number')) \n return false;\n x = Math.abs(x);\n y = Math.abs(y);\n while(y) {\n var t = y;\n y = x % y;\n x = t;\n }\n return x;\n }", "function gcd(a, b) {\n if (b == 0) return a;\n return gcd(b, a%b);\n}", "function highestCommonFactor2(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return highestCommonFactor2(b, a%b);\r\n}", "function gcd(x, y) {\r\n if ((typeof x !== 'number') || (typeof y !== 'number')) \r\n return false;\r\n x = Math.abs(x);\r\n y = Math.abs(y);\r\n while(y) {\r\n let t = y;\r\n y = x % y;\r\n x = t;\r\n }\r\n return x;\r\n}", "function gcd(a, b) {\n if (b === 0) {\n return a;\n }\n return gcd(b, a % b)\n}", "function gcd(a, b) {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n}", "function gcd(a, b) {\n\tif (a == b) return a;\n\n\treturn (a>b) ? gcd(a-b, b) : gcd(a, b-a);\n}", "function euclidGCD (a, b) {\n if (b === 0) {\n return a\n }\n else {\n return euclidGCD(b, a % b)\n }\n}", "function gcd(x, y) {\n x = Math.abs(x);\n y = Math.abs(y);\n\n while(y) {\n var t = y;\n y = x % y;\n x = t;\n }\n\n return x;\n }", "function gcd(a,b) {\n return (b===0) ? a : gcd( b, a%b);\n}", "function gcd(x, y) {\n\twhile (y) {\n\t\tvar t = y;\n\t\ty = x % y;\n\t\tx = t;\n\t}\n\treturn x;\n}", "function gcd(a, b) {\n if (b === 0)\n return a;\n return gcd(b, a % b);\n}", "function div(a, b) {\n var answer = a % b;\n console.log(\"Solution one = \" + answer);\n}", "_gcd(a, b) {\n return b === 0 ? a : this._gcd(b, a % b)\n }", "euclidean() {\n\t\t//This algorithm helps us find the GCD of two numbers\n\t\tif(this.dividend <= this.quotient) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tlet multiplier = 0, result, remainder, run = true;\n\n\t\t//First we find the remainder and multiplier\n\t\tremainder = this.dividend%this.quotient;\n\t\tmultiplier = this.dividend/this.quotient;\n\t\tresult = this.quotient;\n\t\tlet currentQuotient = this.quotient;\n\n\t\t//Then we run our algorithm to find the GCD\n\t\tdo {\n\t\t\tif(!(currentQuotient%remainder == 0)) {\n remainder = currentQuotient%remainder;\n\t\t\t} else {\n run = true;\n\t\t\t}\n\n\n\t\t} while(run === false);\n\n\t\t//Finally we return our result that contains our GCD\n\t\treturn result;\n\t}", "function GCD(x, y)\n{\n return y == 0 ? x : GCD(y, x % y);\n}", "function gcd(firstNumber, secondNumber) {\n var gcdArray = []\n\n for (var i = 0; i <= secondNumber; i++){\n if( (firstNumber % i == 0) && (secondNumber % i == 0)){\n gcdArray.push(i)\n }\n }\n\n var orderedArray = gcdArray.reverse()\n\n return orderedArray[0]\n}", "function gcd(int1, int2) {\r\n return int2 ? gcd(int2, int1 % int2) : int1;\r\n }", "function lcm(a,b)\n{\n return (a*b)/gcd(a,b);\n}", "function divisor (num1, num2) {\n var result;\n for(var i = 0; i <= num1; i++) {\n if( num1 % i === 0 && num2 % i === 0) {\n result = i;\n }\n }\n return result1;\n}", "function gcd(a,b) {\n return (!b) ? a : gcd(b, a%b);\n}", "lcm(a, b) {\n return a.mul(b).div(integer.gcd(a, b)).toInteger();\n }", "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "function h$ghcjsbn_gcd_ss(s1, s2) {\n h$ghcjsbn_assertValid_s(s1, \"gcd_ss s1\");\n h$ghcjsbn_assertValid_s(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n h$ghcjsbn_assertValid_s(b, \"gcd_ss result\");\n return b;\n}", "function lcmOfTwo( a, b ) {\n return ( a * b ) / gcd( a, b );\n}", "function gcd(a,b)\n{\n let [g, c, d] = GCD(a, b);\n return g;\n}", "function gcdMoreThanTwoNum(input){\n if (toString.call(input) !== \"[object Array]\"){\n return false;\n }\n var len, a, b;\n len = input.length;\n if (!len){\n return null;\n }\n a = input[0];\n for (var i=1; i<len; i++){\n b = input[i];\n a = gcdTwoNum(a, b);\n }\n return a;\n}", "function gcd(a, b) {\n return !b ? a : gcd(b, a % b);\n }", "function gcd(x, y) {\r\n return x === 0 ? y : gcd(y % x, x);\r\n}", "function lcm(a, b) {\r\n /**Return lowest common multiple.**/\r\n return Math.floor((a * b) / gcd(a, b));\r\n }", "function gcd_more_than_two_numbers(input) {\n if (toString.call(input) !== \"[object Array]\") \n return false; \n var len, a, b;\n len = input.length;\n if ( !len ) {\n return null;\n }\n a = input[ 0 ];\n for ( var i = 1; i < len; i++ ) {\n b = input[ i ];\n a = gcd_two_numbers( a, b );\n }\n return a;\n }", "function gcd(a, b) {\n return !b ? a : gcd(b, a % b);\n }", "function highestCommonFactor1(a, b) {\n if (b === 0) {\n return a;\n }\n return highestCommonFactor1(b, a%b);\n}", "function lcm(a, b) {\n return (a * b) / gcd(a, b); \n }", "function h$ghcjsbn_gcd_ss(s1, s2) {\n ASSERTVALID_S(s1, \"gcd_ss s1\");\n ASSERTVALID_S(s2, \"gcd_ss s2\");\n var a, b, r;\n a = s1 < 0 ? -s1 : s1;\n b = s2 < 0 ? -s2 : s2;\n if(b < a) {\n r = a;\n a = b;\n b = r;\n }\n while(a !== 0) {\n r = b % a;\n b = a;\n a = r;\n }\n ASSERTVALID_S(b, \"gcd_ss result\");\n return b;\n}", "function gcd (num1, num2) {\n var num1Factors = [];\n var num2Factors = [];\n for (var i = 1; i <= num1; i++) {\n if (num1 % i === 0) {\n num1Factors.push(i);\n }\n }\n for (var j = 1; j <= num2; j++) {\n if (num2 % j === 0) {\n num2Factors.push(j);\n }\n }\n var commonFactors = [];\n for (var k = 0; k < num1Factors.length; k++) {\n for (var m = 0; m < num2Factors.length; m++) {\n if (num1Factors[k] === num2Factors[m]) {\n commonFactors.push(num1Factors[k])\n }\n }\n }\n return commonFactors.pop();\n}", "function leastCommonMultiple(num1, num2){\n var smallerNumber = Math.min(num1, num2);\n var largerNumber = Math.max(num1, num2);\n var multiple = smallerNumber;\n\n while(true) {\n if (multiple % largerNumber === 0) {\n return multiple;\n }\n multiple += smallerNumber;\n }\n}", "function greatComDiv(a, b) {\n if ( ! b) {\n return a;\n }\n return greatComDiv(b, a % b);\n}", "function lcm (a, b) {\n // 有些input的計算過程會超出JavaScript能處理的整數位數\n if (a * b > Number.MAX_SAFE_INTEGER) {\n const aPlusB = Big(a).times(Big(b))\n return aPlusB.div(gcd(a, b)).toString()\n } else { // 一般情況\n return (a * b) / gcd(a, b)\n }\n}", "function gcd(a, b) {\n\tconsole.log('llegan', a, b);\n\tif (a % b === 0) \n\t\treturn b;\n\telse \n\t\treturn gcd(b, a % b);\n}", "function lcm(a, b) {\n\treturn a * b / gcd(a,b);\n}", "function lessCommonMultiplier(a, b) {\n return (a * b) / greatestCommonDivisor(a, b);\n}", "function bGcdInt(a, b) {\n a = a < 0n ? -a : a;\n b = b < 0n ? -b : b;\n // The below 2 commented lines represent Euclid's original algorithm.\n //if (a === b) { return a; }\n //return a > b ? gcdInt(a - b, b) : gcdInt(a, b - a);\n if (a === 0n) {\n return b;\n }\n if (b === 0n) {\n return a;\n }\n while (b !== 0n) {\n const t = b;\n b = a % b;\n a = t;\n }\n return a;\n}", "function divisor(num1, num2){\n var small = getSmall(num1, num2);\n //var primes = [2,3,5,7];\n \n for (var i = small; i > 0; i--){\n if ( num1 % i === 0 && num2 % i === 0){\n return i;\n }\n \n // else, check if divisible by primes starting with highest number\n // don't need this\n /*for (var j = primes.length; j > 0; j--){\n if ( num1 % primes[j - 1] === 0 && num2 % primes[j - 1] === 0 ){\n return i;\n }\n }*/\n \n }\n \n return 1;\n}", "function lcm(num1, num2) {\n var least = num2;\n if(num1 > num2){\n least = num1;\n }\n\n while (true) {\n if(least % num1 === 0 && least % num2 === 0){\n return least;\n }\n least += 1;\n }\n}", "function lcm(a, b) {\n\treturn console.log((a * b) / maximoComunDenominador(a, b))\n}", "function lcm(num1, num2){\n var sumNum = num1 * num2;\n// console.log(sumNum);\n //Using Math.min() returns the lowest number:\n if(sumNum % num1 !== 0 && sumNum % num2 !== 0){\n // console.log(Math.min(num1, num2));\n return Math.min(sumNum);\n }\n }", "function divison(num1, num2) {\n var divisonTotal = num1 / num2;\n return divisonTotal;\n}", "function GCD(a,b)\n{\n var [prevx, x] = [numone(a), numzero(a)];\n var [prevy, y] = [numzero(a), numone(a)];\n while (b) {\n var r = a%b;\n var q = (a-r)/b;\n [x, prevx] = [prevx - q*x, x];\n [y, prevy] = [prevy - q*y, y];\n [a, b] = [b, r];\n }\n return [a, prevx, prevy];\n}", "function div(a, b) {\n return (a-(a%b))/b;\n}", "function sc_gcd() {\n var gcd = 0;\n for (var i = 0; i < arguments.length; i++)\n\tgcd = sc_euclid_gcd(gcd, arguments[i]);\n return gcd;\n}", "function Division2(num1, num2) {\n // setup variables\n var a = num1;\n var b = num2;\n var r;\n\n // keep using the mod function until a or b hits 0\n while (a > 0 && b > 0) {\n r = a % b;\n a = b;\n b = r;\n }\n\n // return the non-zero answer\n return a === 0 ? b : a;\n}", "function bruteforceGCD (a, b) {\n hero.say(\"The naive algorithm.\");\n var cycles = 0;\n // We enumerate all possible divisors.\n var counter = b;\n while (true) {\n cycles++;\n if (cycles > 100) {\n hero.say(\"Calculating is hard. I'm tired.\");\n break;\n }\n // If both number have \"counter\" divisor.\n if (a % counter === 0 && b % counter === 0) {\n break;\n }\n counter--;\n }\n hero.say(\"I used \" + cycles + \" cycles\");\n return counter;\n}" ]
[ "0.80981576", "0.8086585", "0.80565685", "0.79981685", "0.7986235", "0.7951319", "0.79159164", "0.7913732", "0.7889797", "0.7804996", "0.7763214", "0.77033854", "0.7538353", "0.7504908", "0.7486855", "0.7456617", "0.74553585", "0.74071985", "0.72647154", "0.7192292", "0.7180228", "0.71564233", "0.714787", "0.7128169", "0.71241367", "0.71104413", "0.71095157", "0.7103505", "0.7103244", "0.70516443", "0.7051153", "0.704068", "0.7014554", "0.7003117", "0.6989435", "0.69859207", "0.6981166", "0.6980293", "0.69754666", "0.69584984", "0.69515973", "0.6951504", "0.6949977", "0.69421184", "0.6925021", "0.6920922", "0.691603", "0.6914696", "0.6905554", "0.6904724", "0.6879207", "0.68695486", "0.68646896", "0.68565005", "0.6855341", "0.6853202", "0.6853063", "0.6836885", "0.6831254", "0.6821518", "0.68176717", "0.68119365", "0.68093204", "0.6805019", "0.68026334", "0.6784281", "0.6778845", "0.6770513", "0.6770513", "0.6770513", "0.6770513", "0.67695886", "0.6741376", "0.6726498", "0.6717152", "0.67149067", "0.67117286", "0.6676438", "0.66567796", "0.6655486", "0.66535497", "0.6653047", "0.6652737", "0.664896", "0.66389096", "0.6624131", "0.6607937", "0.6587109", "0.6572824", "0.6544538", "0.6537821", "0.6505873", "0.6498554", "0.64949757", "0.64756304", "0.6469629", "0.64448214", "0.6440577", "0.6433703", "0.6417072" ]
0.78704405
9
input string of char will contain only ATCG will only give once case Test cases set length, not required though output arry of DNA pair DNA pair = 2 char arry A T && C G same length as input
function pairElement(str) { var charArray = str.split(""); console.log(charArray); // var firstChar = charArray[1]; // console.log(charArray[1]); var pairArray = []; console.log(pairArray); for (var i = 0; i < charArray.length; i++) { if (charArray[i] === "G") { pairArray.push(["G", "C"]); console.log(pairArray); } else if (charArray[i] == "C") { pairArray.push(["C", "G"]); console.log(pairArray); } else if (charArray[i] === "A") { pairArray.push(["A", "T"]); console.log(pairArray); } else if (charArray[i] === "T") { pairArray.push(["T", "A"]); console.log(pairArray); } } return pairArray; //return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pairDNA(str) {\r\n var pairs = {\r\n A: \"T\",\r\n T: \"A\",\r\n C: \"G\",\r\n G: \"C\"\r\n };\r\n return str.split(\"\").map(x => [x, pairs[x]]);\r\n}", "function stringCreation(str) {\n var pair = \"\";\n for(var i = 0; i <= str.length; i++){\n if(str[i] === \"C\"){\n pair = pair + \"G\";\n } else if(str[i] === \"G\"){\n pair = pair + \"C\";\n } else if (str[i] === \"A\"){\n pair = pair + \"T\";\n } else if (str[i] === \"T\"){\n pair = pair + \"A\";\n }\n }\n return pair;\n}", "function pairElement(str) {\n let dnaArr = [...str];\n let finalArr = [];\n for(let i = 0; i < dnaArr.length; i++){\n var paired;\n switch (dnaArr[i]){\n case \"C\":\n paired = \"G\";\n break;\n case \"A\":\n paired = \"T\";\n break;\n case \"G\":\n paired = \"C\";\n break;\n case \"T\":\n paired = \"A\";\n break;\n default:\n paired = \"N/A\";\n }\n finalArr.push([dnaArr[i], paired]);\n }\n return finalArr;\n}", "function dnaPair(str){\n var pairs = {\n \"A\": \"T\",\n \"T\": \"A\",\n \"C\": \"G\",\n \"G\": \"C\"\n }\n var arr = str.split(\"\");\n return arr.map(x => [x , pairs[x]]);\n}", "function runLengthEncoding(string) {\n // create list 'chars' to store result; no concatenating with a string as it isn't as efficient\n let chars = []\n // create variable 'length' to keep track of runs starting at 1\n let length = 1\n // loop through string starting at second character\n for (let i = 1; i < string.length; i++) {\n // if character is not the same as previous OR length is equal to 9\n if (string[i] !== string[i - 1] || length === 9) {\n // add 'length' to 'chars' + previous 'char'\n chars.push(length, string[i - 1])\n // reset length to 0 as next line will increment it by one regardless, \n // handling both cases of inside this conditional and outside \n // of the conditional for characters that are the same\n length = 0\n }\n // increment 'length', as character is the same as previous \n length++\n }\n // handle last element by adding 'length' + 'char' to 'chars'\n chars.push(length, string[string.length - 1])\n // join 'chars' into string and return\n return chars.join('')\n}", "function removePairs(char = '', char2 = '') {\n let res = [];\n\n for (let i = 0; i < string.length - 1; i++) {\n if (string[i] === char || string[i] === char2) continue;\n\n res.push(string[i]);\n if (res.length > 1) {\n let len = res.length;\n let currChar = res[len - 1].charCodeAt();\n let prevChar = res[len - 2].charCodeAt();\n\n //AZaz char codes are 65,90,97,122\n //Lower case and upper case are in different ranges and are off by 32\n if (\n (currChar >= 97 && currChar <= 122 && currChar === prevChar + 32) ||\n (currChar >= 65 && currChar <= 90 && currChar === prevChar - 32)\n )\n res.length = len - 2;\n }\n }\n\n //Input has a blank space at the end\n return res.length;\n}", "function pairDna(str){\n let dnaArr = [...str];\n let dnaObj = {\n \"A\": \"T\",\n \"T\": \"A\",\n \"C\": \"G\",\n \"G\": \"C\"\n }\n let finalArr = [];\n for(let i = 0; i < dnaArr.length; i++){\n finalArr.push([dnaArr[i], dnaObj[dnaArr[i]]]);\n }\n return finalArr;\n}", "function StringChallenge(str) {\n let obj = {\n 'ab': 'c',\n 'ba':'c',\n 'bc': 'a',\n 'cb': 'a',\n 'ac': 'b',\n 'ca': 'b',\n }\n\n let array = str.split('');\n let newarray = [];\n\n for(var i = 0; i<array.length; i += 2){\n if(obj[array[i]+array[i+1]]){\n let value = obj[array[i]+array[i+1]]\n array = array.slice(2, array.length);\n newarray.push(value);\n i = -2;\n } else if (array.length > 2) {\n newarray.push(array[i]);\n newarray.push(array[i+1]);\n array = array.slice(2, array.length)\n } else {\n newarray.push(array[i]);\n array = array.slice(1)\n }\n\n if(array.length === 0){\n StringChallenge(newarray.join(''))\n }\n }\n\n // code goes here\n return newarray.length - 1;\n\n}", "function twoCharaters(s) {\n let maxSize = 0;\n let duppedStr = s.slice(0);\n const chrsSet = new Set();\n\n for (let i = 0; i < s.length; i++) {\n chrsSet.add(duppedStr[i]);\n }\n\n const uniqChrs = Array.from(chrsSet);\n for (let i = 0; i < uniqChrs.length - 1; i++) {\n for (let j = i + 1; j < uniqChrs.length; j++) {\n duppedStr = duppedStr.split(\"\").filter((chr) => (chr === uniqChrs[i] || chr === uniqChrs[j])).join(\"\");\n if (validT(duppedStr)) {\n if (duppedStr.length > maxSize) {\n maxSize = duppedStr.length;\n }\n }\n duppedStr = s.slice(0);\n }\n }\n return maxSize;\n}", "function pairElement(str) {\n let dnaPairs = {\n A: ['A', 'T'],\n T: ['T', 'A'],\n C: ['C', 'G'],\n G: ['G', 'C'],\n }\n return str.split('').map(dnaCharacter => dnaPairs[dnaCharacter]);\n}", "function pairElement(str) {\n // array that will hold base pair arrays\n var dnaPairs = [];\n /* basePairs object that holds (ATGC) and their appropriate pairs. \n Used to return correct pair based on input. */ \n var basePairs = {\n \"A\" : \"T\",\n \"T\" : \"A\",\n \"G\" : \"C\",\n \"C\" : \"G\"\n };\n // Iterating through each character of str\n for (var character of str) {\n // Pair array where original char and it's pair will be pushed onto\n var pair = [];\n // Push onto pair -- the original character and value from basePairs that corresponds to that char.\n pair.push(character , basePairs[character]);\n // Push pair onto dnaPairs\n dnaPairs.push(pair);\n }\n\n return dnaPairs;\n }", "function pairElement(str) {\n let result = \"\"\n for (let i = 0; i < str.length; i++) {\n // if (str[i] == 'A') {\n // result = result + 'T'\n // } else if (str[i] == 'T') {\n // result = result + 'A'\n // } else if (str[i] == 'C') {\n // result = result + 'G'\n // } else if (str[i] == 'G') {\n // result = result + 'C'\n // }\n switch (str[i]) {\n case 'A':\n result = result + 'T'\n break\n case 'T':\n result = result + 'A'\n break;\n case 'C':\n result = result + 'G'\n break\n case 'G':\n result = result + 'C'\n break\n }\n }\n return result;\n}", "function pairElement(str) {\r\n var paired = [];\r\n str = str.split(\"\");\r\n for (let i = 0; i < str.length; i++) {\r\n if (str[i] === \"G\") {\r\n paired.push([\"G\", \"C\"]);\r\n } else if (str[i] === \"C\") {\r\n paired.push([\"C\", \"G\"]);\r\n } else if (str[i] === \"A\") {\r\n paired.push([\"A\", \"T\"]);\r\n } else if (str[i] === \"T\") {\r\n paired.push([\"T\", \"A\"]);\r\n } \r\n }\r\n console.table(paired);\r\n}", "function DNAStrand(dna) {\n dna.split('');\n let s=''\n for(let i=0; i<dna.length; i++){\n if(dna[i]==='A') s= s+ 'T';\n if(dna[i]==='T') s= s+ 'A';\n if(dna[i]==='G') s= s+ 'C';\n if(dna[i]==='C') s= s+ 'G';\n }\n return s;\n}", "function DNAStrand(dna){\n let match = {\n A: 'T',\n T: 'A',\n G: 'C',\n C: 'G'\n }\n let answerArray = [];\n dna.split('').map(function(letter){answerArray.push(match[letter])})\n return answerArray.join('')\n}", "function dnaStrand(strDna) {\n const arr = [];\n let char = ''; \n for(let i = 0; i < strDna.length; i++) {\n char = strDna.charAt(i);\n switch(char) {\n case 'G':\n arr.push('C', char);\n break;\n case 'T':\n arr.push('A', char);\n break;\n case 'g':\n arr.push('C', char.toUpperCase());\n break;\n case 't':\n arr.push('A', char.toUpperCase());\n break;\n default:\n break;\n }\n }\n return arr;\n}", "function pairElement7(str) {\n const pairs = {\n A: \"T\",\n T: \"A\",\n C: \"G\",\n G: \"C\"\n };\n const arr = str.split(\"\");\n return arr.map(char => [char, pairs[char]]);\n}", "function combinationSeeker(aString) {\n var testMatch = \"\";\n for(i = 0; i <= aString.length; i++) {\n for(j = 0; j <= aString.length; j++) {\n testMatch = aString.substr(i, j);\n if(matchString(testMatch)){\n addWord(testMatch);\n i+=j;\n }\n }\n }\n if(isSentenceCorrect(matchedWordsList, aString)) {\n wordsToSentence(matchedWordsList);\n sentenceCombinations(completeSentence);\n }\n}", "function DNAStrand(dna){\n var newDNA = \"\";\n for (var i = 0;i<dna.length;i++){ \n if (dna.charAt(i) == \"T\"){\n newDNA = newDNA + \"A\";\n }\n else if (dna.charAt(i) == \"A\"){\n newDNA = newDNA + \"T\";\n }\n else if (dna.charAt(i) == \"C\"){\n newDNA = newDNA + \"G\";\n }\n else if (dna.charAt(i) == \"G\"){\n newDNA = newDNA + \"C\";\n }\n }\n return newDNA;\n }", "function DNAStrand(dna){\n let new_arr = dna.split('');\n return new_arr.map(char => {\n if(char == 'A') {\n return 'T';\n }\n if(char == 'T') {\n return 'A';\n }\n if(char == 'G') {\n return 'C';\n }\n if(char == 'C') {\n return 'G';\n }\n }).join('')\n}", "function cntTwo(str) {\n //get character loop through string\n for (j = 0; j < str.length; j++) {\n var cnt = 0;\n // console.log(`Checking for character ${str.substring(j,j+1)}`);\n for (k = 0; k < str.length; k++){\n // console.log(`comparing ${str.substring(j,j+1)} to ${str.substring(k,k+1)}`);\n if (str.substring(j,j+1) === str.substring(k,k+1)){\n cnt++;\n }\n // console.log(`Count: ${cnt}`);\n }\n if (cnt === 2){\n return true;\n }\n }\n}", "function pairElement6(str) {\n let newArr = [];\n\n for (let i = 0; i < str.length; i++) {\n switch (str[i]) {\n case \"A\":\n newArr.push([\"A\", \"T\"]);\n break;\n case \"T\":\n newArr.push([\"T\", \"A\"]);\n break;\n case \"C\":\n newArr.push([\"C\", \"G\"]);\n break;\n case \"G\":\n newArr.push([\"G\", \"C\"]);\n break;\n }\n };\n\n return newArr;\n}", "function alternate(s) {\n let chars = [...new Set(s)];\n let max = 0;\n for (let i = 0; i < chars.length - 1; i++) {\n for (let j = i + 1; j < chars.length; j++) {\n let reg = new RegExp(`[${chars[i]}|${chars[j]}]`, \"gi\");\n let sub = s.match(reg);\n console.log(\"sub\", sub);\n let isValid = false;\n for (let x = 0; x < sub.length; x++) {\n if (sub[x] !== sub[x + 1]) {\n isValid = true;\n } else {\n console.log(\"not valid\");\n isValid = false;\n break;\n }\n }\n if (isValid) {\n console.log(\"valid\", max);\n if (max < sub.length) {\n max = sub.length;\n console.log(max);\n }\n }\n }\n }\n return max;\n}", "function repeatedString(s, n) {\n x = s.length\n a = []\n j = 0;\n for (i = 0; i < n; i) {\n if (j < x) {\n a.push(s[j])\n j++;\n i++;\n } else {\n j = 0;\n }\n\n }\n count = 0;\n for (let j = 0; j < n; j++) {\n if (a[j] === 'a') {\n count++;\n }\n }\n // let lenS = s.length;\n // let i = 0;\n // let charArr = [];\n // for (let j = 0; j < lenS; j) {\n // if (i < lenS) {\n // charArr.push(s[i]);\n // i++;\n // j++;\n // } else {\n // i = 0;\n // }\n // }\n // let count = 0;\n // for (let j = 0; j < n; j++) {\n // if (charArr[j] === 'a') {\n // count++;\n // }\n // }\n return count\n}", "function DNAStrand(dna) {\n let compDNA = \"\";\n\n for(let i = 0; i < dna.length; i++) {\n if(dna.charAt(i) === \"A\")\n compDNA += \"T\";\n else if(dna.charAt(i) === \"T\")\n compDNA += \"A\";\n else if(dna.charAt(i) === \"G\")\n compDNA += \"C\";\n else if(dna.charAt(i) === \"C\")\n compDNA += \"G\";\n }\n\n return compDNA;\n}", "function solution_1_e_reg_loop(){\n //let outputArr=[];\n let output='';\n for(let i=0; i<str.length-3; i++){\n if(str[i]==' '){\n //we found the space character\n if(str[i+1]=='c' && str[i+2]=='a' && str[i+3]=='t'){\n //if next three characters are c,a,t\n //outputArr.push(' '); \n //outputArr.push('b','i','r','d');\n output +=' bird';\n i=i+3; //incrementing the i by 3 as we can skip next three characters at this point\n }\n else{\n //it didn't find a cat\n //outputArr.push(str[i]); \n output +=str[i];\n }\n }\n else{\n //outputArr.push(str[i]);\n output +=str[i];\n }\n }\n return output;\n}", "function generateAll(str) {\n //build an output\n //separate chars into 1 and 1, 2 and 2 and so on\n let myStr = [];\n //separated 1 and 1\n for (let i = 0, j = 1; i < str.length; i++, j++) {\n // myStr.push(str[i]);\n myStr[i] = str.substring(i, j);\n }\n let kosing = [];\n let temp = \"\";\n let sizes = Math.pow(2, myStr.length);\n\n for (let j = 0; j < sizes; j++) {\n temp = \"\";\n for (let k = 0; k < myStr.length; k++) {\n if ((j & Math.pow(2, k))) {\n temp += myStr[k];\n }\n\n }\n if (temp !== \"\") {\n kosing.push(temp);\n }\n // str[j];\n\n }\n kosing.join(\"\\n\");\n return kosing;\n}", "function splitPairs(input) {\n\n //for even lengths:\n //split into pairs of characters\n if (input.length % 2 === 0) {\n input = input.split('')\n }\n\n let newStrEven = [];\n if (input.length % 2 === 0) {\n for (let i = 0; i < input.length; i++) {\n newStrEven.push(input[i] + input[i + 1]) //ok\n input = input.slice(1) //[a, y]\n }\n return newStrEven\n }\n// newStrEven = newStrEven.toString()\nlet newStrOdd = [];\n if (input.length % 2 !== 0) {\n for (let j = 0; j < input.length; j++) {\n if (input.length >= 2) {\n if (input[j] === input[input.length - 1] && input[j] !== input[0]) {\n newStrOdd.push(input[j] + \"_\")\n } else {\n newStrOdd.push(input[j] + input[j + 1])\n input = input.slice(1)\n // console.log(input)\n }\n }\n }\n return newStrOdd\n }\n}", "function runLengthEncoding(string) {\n let encodedArr = [];\n let count = 1;\n\n for (let i = 1; i < string.length + 1; i++) {\n let currentChar = string[i];\n let prevChar = string[i - 1];\n\n if (count === 9 || currentChar !== prevChar) {\n encodedArr.push(count, prevChar);\n count = 0;\n }\n count++;\n }\n\n return encodedArr.join('');\n}", "function solution(str) {\n // write your code in JavaScript (Node.js 8.9.4)\n\n // substring - semi alternating - should not have more than 2 repititions\n // hmm so temo shuld be 2 and we should have a system to keep resetting it?\n // we need a result and a temp to keep count and need to update them as we find // consecutive characters\n\n let len = str.length;\n // corner condition\n if (len < 3) return len;\n\n let temp = 2,\n result = 2;\n\n for (let i = 2; i < len; i++) {\n if (str.charAt(i) !== str.charAt(i - 1) ||\n str.charAt(i) !== str.charAt(i - 2)) {\n temp++; // looking for consecutive characters\n } else {\n result = Math.max(result, temp);\n // reset temp\n temp = 2;\n }\n }\n result = Math.max(result, temp);\n return result;\n}", "function pairElement(str) {\n let at = ['A','T'];\n let ta = ['T','A'];\n let gc = ['G','C'];\n let cg = ['C','G'];\n let returnArr = [];\n let arr = str.split(\"\");\n \n arr.map(k => {\n if(k === \"A\") {\n returnArr.push(at);\n } else if(k === \"T\") {\n returnArr.push(ta);\n } else if(k === \"G\") {\n returnArr.push(gc);\n } else {\n returnArr.push(cg);\n } \n })\n return returnArr;\n}", "function oneAway(s1, s2){\n if(s1===\"\" || s2===\"\" || !s1 || !s2) return \"Invalid input\";\n let greterlen = false\n const lendiff = Math.abs(s1.length - s2.length);\n const leng = s1.length>s2.length?s1.length:s2.length;\n greterlen = s1.length>s2.length?\"s1\":s1.length<s2.length?\"s2\":false\n // check if the length difference is 0 or 1\n if(lendiff !== 1 && lendiff !== 0) return \"Not one away 1\" \n let charObj = {};\n console.log(greterlen, lendiff)\n const looplen = greterlen?leng-1:leng\n for(let i=0; i<looplen; i++){\n if(!charObj[s1[i]]) charObj[s1[i]] = 1 \n else ++charObj[s1[i]]\n if(!charObj[s2[i]]) charObj[s2[i]] = 1 \n else ++charObj[s2[i]]\n }\n if(greterlen===\"s1\"){\n if(!charObj[s1[leng-1]]) charObj[s1[leng-1]] = 1 \n else ++charObj[s1[leng-1]]\n } else if(greterlen===\"s2\"){\n if(!charObj[s2[leng-1]]) charObj[s2[leng-1]] = 1 \n else ++charObj[s2[leng-1]]\n }\n console.log(Object.assign({}, charObj))\n let oneOdd = 0;\n for(let j=0; j<Object.keys(charObj).length; j++){\n let letter = Object.keys(charObj)[j];\n if(charObj[letter]%2 !==0 && oneOdd>=2) return \"Not one away 2\"\n if(charObj[letter]%2 !==0 && oneOdd<=2) ++oneOdd\n }\n console.log(lendiff, oneOdd)\n return (lendiff && oneOdd)?\"One away\":(!oneOdd && !lendiff)?\"Zero away\":\"One away 2\"\n}", "function alternative(s) {\n const counts = new Array(26).fill(0);\n\n for (let i = 0; i < s.length; i++) {\n counts[s.charCodeAt(i) - 97]++;\n }\n\n const result = new Array(Math.max(...counts)).fill('');\n\n // iterate through each letter of alphabet\n for (let i = 0; i < 26; i++) {\n // iterate through each count of a letter\n for (let j = 0; j < counts[i]; j++) {\n if (j % 2 === 0) {\n result[j] += String.fromCharCode(i + 97);\n } else {\n result[j] = String.fromCharCode(i + 97) + result[j];\n\n }\n }\n }\n\n return result.join('');\n}", "function DNAStrand(dna) {\n // Breakdown into array by separating characters\n var array = dna.split('');\n\n var newArray = [];\n\n // Go through array & compare characters w/ if/else statements\n for (var i = 0; i < array.length; i++) {\n if (array[i] == 'A') {\n newArray.push('T')\n } else if(array[i] == 'T') {\n newArray.push('A')\n } else if(array[i] == 'C') {\n newArray.push('G') \n } else if (array[i] == 'G') {\n newArray.push('C')\n }\n }\n return newArray.join('');\n }", "function s(s) {\n // const map = \"$abcdefghijklmnopqrstuvwxyz\"\n // .split(\"\")\n // .reduce((acc, char, idx) => ({ ...acc, [char]: idx }), {});\n\n return helper(0);\n\n function helper(i) {\n if (i >= s.length) {\n return 1;\n }\n if (s[i] === \"0\") {\n return 0;\n }\n\n let ways = helper(s, i + 1);\n if (i + 2 <= s.length && Number(s.substring(i, i + 2)) <= 26) {\n ways += helper(i + 2);\n }\n return ways;\n }\n}", "function DNAStrand(dna) { \n let vr1 = dna.split(''); \n let vr2 = []; \n vr1.forEach(element => { \n switch (element) { \n case 'A': \n vr2.push('T'); \n break; \n case 'T': \n vr2.push('A'); \n break; \n case 'C': \n vr2.push('G'); \n break; \n case 'G': \n vr2.push('C'); \n break; \n } \n }); \n vr2 = vr2.join(''); \n return vr2; \n}", "function characterMapping(str) {\n let repeat = [];\n let map = [];\n for (let i = 0; i < str.length; i++) {\n if (repeat.indexOf(str[i]) === -1) {\n repeat.push(str[i]);\n map.length === 0 ? map.push(0) : map.push(Math.max(...map) + 1)\n } else {\n map.push(repeat.indexOf(str[i]))\n }\n }\n return map \n}", "function alternatingCharacters(s) {\nlet originalArr = s.split('');\n let newArr = [originalArr[0]];\n for (let i = 1; i < originalArr.length; i++) {\n if (originalArr[i] !== originalArr[i-1]) {\n newArr.push(originalArr[i]);\n }\n }\n return originalArr.length - newArr.length;\n}", "function pairElement(str) {\r\n let arr=str.split('')\r\n\r\n for(var i = 0; i< arr.length; i++){\r\n if(arr[i] === 'C'){\r\n arr[i]=['C','G']\r\n }else if(arr[i] === 'G'){\r\n arr[i]=['G','C']\r\n }else if(arr[i] === 'A'){\r\n arr[i]=['A','T'] \r\n }else if(arr[i] === 'T'){\r\n arr[i]=['T', 'A']\r\n }\r\n }\r\n return arr;\r\n}", "function alternatingCharacters(s) {\n let ss = s.split('')\n let counter=0\n let current = s[0]\n for(let i=1; i<ss.length; i++){\n if (ss[i]===current){\n counter++\n }else{\n current = ss[i]\n }\n }\n\n return counter\n}", "function makingAnagrams(s1, s2) {\n let charMatched = 0;\n let s1Arr = s1.split('');\n let s2Arr = s2.split('');\n let deletionCount = s1Arr.length+s2Arr.length;\n for(let i=0;i<s1Arr.length;i++){\n for(let j=0;j<s2Arr.length;j++){\n if(s1Arr[i]===s2Arr[j]){\n charMatched+=2;\n s2Arr[j] = 0;\n break;\n }\n }\n }\n return deletionCount-charMatched;\n}", "function pair(str) {\n //define a map object with all pair possibilities\n var map = {T:'A', A:'T', G:'C', C:'G'};\n //split str into a char Array\n strArr = str.split('');\n //replace each Array item with a 2d Array using map\n for (var i=0;i<strArr.length;i++){\n strArr[i]=[strArr[i], map[strArr[i]]];\n }\n return strArr;\n}", "function runLengthEncoding(str) {\n\tvar count = 1;\n\tvar strArr = [];\n\tfor (var i = 0; i < str.length; i++) {\n\t\tif (str[i] === str[i+1]) {\n\t\t\tcount++;\n\t\t} else {\n\t\t\tstrArr.push(count + str[i]);\n\t\t\tcount = 1;\n\t\t}\n\t}\n\treturn strArr.join(\"\");\n}", "function alternatingCharacters(s) {\n // Write your code here\n let count = 0;\n for (let i = 0; i < s.length; i++) {\n if (s[i] === s[i + 1])\n count++;\n }\n return count;\n\n}", "function alternate(s) {\n if (s.length === 1){\n return 0\n }\n const arrayOfLetters = getArrayOfLetters(s); // 1 step\n const LengthOfCombinatins = getLengthOfCombinatins(arrayOfLetters); // 2 step\n \n const combineResultArr = []\n const result = [];\n result.length = LengthOfCombinatins;\n function combine(input, len, start) {\n if(len === 0) {\n // console.log( result.join(\"-\") ); //process here the result\n combineResultArr.push(result.join(\"-\"));\n return;\n }\n for (let i = start; i <= input.length - len; i++) {\n result[result.length - len] = input[i];\n combine(input, len-1, i+1 );\n }\n }\n combine(arrayOfLetters, result.length, 0) // 3 step\n const alternesArr = getAlternArray(s, combineResultArr) // 4 step\n const last_result = getFinalResult(alternesArr) // 5 step\n return last_result\n }", "function KUniqueCharacters(str) { \nlet arr = [];\nlet longest = str[0];\n \nfor (let i=1; i<str.length; i++) {\n let table = {}\n let ans = \"\"\n let count = 0\n for (let j=i; j<str.length; j++) {\n if (table[str[j]] === undefined) { \n table[str[j]] = 1\n count++\n }\n if (count <= str[0]) {\n ans += str[j]\n }\n }\n if (ans.length > longest) {\n longest = ans.length\n arr.push(ans)\n }\n}\nreturn arr.sort(function(a,b) {return b.length-a.length})[0]\n}", "function pairElement(str) {\n var result = [];\n var twoDeeArray = [];\n for (var x = 0; x < str.length; x++){\n switch(str[x].toUpperCase()){\n case \"A\":\n twoDeeArray.push(\"A\");\n twoDeeArray.push(\"T\");\n result.push(twoDeeArray);\n twoDeeArray = [];\n break;\n case \"C\":\n twoDeeArray.push(\"C\");\n twoDeeArray.push(\"G\");\n result.push(twoDeeArray);\n twoDeeArray = [];\n break;\n case \"G\":\n twoDeeArray.push(\"G\");\n twoDeeArray.push(\"C\");\n result.push(twoDeeArray);\n twoDeeArray = [];\n break;\n case \"T\":\n twoDeeArray.push(\"T\");\n twoDeeArray.push(\"A\");\n result.push(twoDeeArray);\n twoDeeArray = [];\n break;\n default:\n break;\n }\n }\n return result;\n}", "function generateCombinations(string) {\n let result = [];\n\n for (let i = 0; i < string.length; i++) { //d\n let character = string.charAt(i);\n let temporaryArray = [character];//[d]\n\n for (let j = 0; j < result.length; j++) {\n temporaryArray.push(result[j] + character);//[o;g]\n }\n result = result.concat(temporaryArray);\n // result = [...result, ...temporaryArray]; //[] + [d, o, g]\n }\n\n return result;\n}", "function encipherPair(str) {\n\t\tif (str.length != 2) return false;\n\t\tvar pos1 = getCharPosition(str.charAt(0));\n\t\tvar pos2 = getCharPosition(str.charAt(1));\n\t\tvar char1 = \"\";\n\t\t\n\t\t// Same Column - Increment 1 row, wrap around to top\n\t\tif (pos1.col == pos2.col) {\n\t\t\tpos1.row++;\n\t\t\tpos2.row++;\n\t\t\tif (pos1.row > 4) pos1.row = 0;\n\t\t\tif (pos2.row > 4) pos2.row = 0;\n\t\t\tchar1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n\t\t\t} else if (pos1.row == pos2.row) { // Same Row - Increment 1 column, wrap around to left\n\t\t\tpos1.col++;\n\t\t\tpos2.col++;\n\t\t\tif (pos1.col > 4) pos1.col = 0;\n\t\t\tif (pos2.col > 4) pos2.col = 0;\n\t\t\tchar1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n\t\t\t} else { // Box rule, use the opposing corners\n\t\t\tvar col1 = pos1.col;\n\t\t\tvar col2 = pos2.col;\n\t\t\tpos1.col = col2;\n\t\t\tpos2.col = col1;\n\t\t\tchar1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n\t\t}\n\t\t\n\t\treturn char1;\n\t}", "function repeatedString(s, n) {\n const length = s.length\n const times = Math.floor(n/length)\n const remain = n - times * length\n\n let as = 0\n for (let j = 0; j < s.length; j++) {\n if (s[j] === \"a\") {\n as++\n }\n }\n\n as *= times\n\n for (let i = 0; i < remain; i++) {\n if (s[i] === \"a\") {\n as++\n }\n }\n\n return as\n\n\n\n}", "function anagrams(stringA, stringB) {\n let charMap = {};\n let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');\n let specialChars = [0,0];\n for ( let i = 0; i < stringA.length; i++ ) {\n let currentChar = stringA[i].toLowerCase();\n if ( alphabet.indexOf(currentChar) !== -1 ) {\n if ( !charMap[currentChar] ) charMap[currentChar] = 0;\n charMap[currentChar] ++;\n }\n else {\n specialChars[0]++;\n }\n }\n \n for ( let i = 0; i < stringB.length; i++ ) {\n let currentChar = stringB[i].toLowerCase();\n if ( alphabet.indexOf(currentChar) === -1 ) specialChars[1]++;\n else {\n if ( !charMap[currentChar] ) {\n console.log(currentChar);\n return false;\n }\n charMap[currentChar]--;\n if ( charMap[currentChar] === 0 ) delete charMap[currentChar];\n }\n }\n if ( Object.keys(charMap).length > 0 ) return false;\n //console.log(st)\n return (stringA.length - specialChars[0]) === (stringB.length - specialChars[1])\n }", "function repeatedString(s, n) {\n let numA = s.split('').filter(x => x === 'a').length;\n if (Number.isInteger(n / s.length)) {\n return n / s.length * numA;\n } else {\n let extra = n - (Math.floor(n / s.length) * s.length);\n let plus = 0;\n s.split('').forEach((ele, i, a) => { \n if (i < extra && ele === 'a') {\n plus++;\n console.log(plus);\n } \n })\n return Math.floor(n / s.length) * numA + plus;\n }\n}", "function part2(data) {\n let items = data\n .map(answer => {\n let sorted = answer.join('').split('').sort().join('');\n let letterGroups = sorted.match(/(\\S)\\1*/g);\n return letterGroups.filter(letterGroup => letterGroup.length == answer.length).length;\n })\n .reduce((acc, cur) => acc + cur);\n return items;\n}", "function sol(chars) {\n let indexRes = 0;\n let index = 0;\n while (index < chars.length) {\n const cur = chars[index];\n let count = 1;\n while (index + 1 < chars.length && chars[index + 1] === cur) {\n index++;\n count++;\n }\n chars[indexRes] = cur;\n indexRes++;\n index++;\n if (count === 1) continue;\n for (let c of String(count).split(\"\")) {\n chars[indexRes] = c;\n indexRes++;\n }\n }\n return indexRes;\n}", "function getDna(dna) {\n let complements = ''\n for (let i = 0; i <dna.length; i++){\n switch (dna[i]){\n case \"A\":\n complements += \"T\"\n break;\n case \"T\":\n complements += \"A\"\n break;\n case \"C\":\n complements += \"G\"\n break;\n case \"G\":\n complements += \"C\"\n break\n }\n }\n return complements\n}", "function repeatedString(s, n) {\n /*while the string length is less than n, we want to concatenate the string on itself\n then we want to slice it at n\n then we make a new array and slice on each letter\n then we have an aCount and a for loop that says if array[i] === 'a' then aCount incerments\n then we return aCount\n */\n\n /*second way...\n do the loop first, see what a count is\n divide n by sting.length\n multiply by aCount?\n */\n let aCount = 0\n for (let i = 0; i < s.length; i++) {\n if (s[i] === 'a')\n aCount++\n }\n return Math.round(aCount * (n / s.length))\n //something here... possibly with modulo remainder, to add... 16/23 passed\n\n\n}", "function myspace(str) {\n\n var fuse=str.split('');\n for( let x=0;x<fuse.length;x++){\n if(fuse[x]==='a'){\n fuse[x]=4\n }else if(fuse[x]==='e'){\n fuse[x]=3\n }else if(fuse[x]==='i'){\n fuse[x]=1\n }else if(fuse[x]==='o'){\n fuse[x]=0\n }else if(fuse[x]==='s'){\n fuse[x]=5\n }\n }\n\n return fuse.join('')\n\n}", "function DNAStrand(dna){\n let ans = '';\n for (let i = 0; i < dna.length; i++){\n ans += dna[i] === 'A' ? 'T' : dna[i] === 'T' ? 'A' : dna[i] === 'C' ? 'G' : 'C';\n }\n return ans;\n }", "function validAnagram(s, t) {\n if (s.length !== t.length) {\n return false\n }\n let charMap = {}\n s = s.split('')\n for (let index = 0; index < s.length; index++) {\n if (charMap[s[index]]) {\n charMap[s[index]] += 1\n } else {\n charMap[s[index]] = 1\n }\n }\n for (let index = 0; index < t.length; index++) {\n if (!charMap[t[index]]) {\n return false\n } else {\n charMap[t[index]]--\n }\n }\n return true\n}", "function pair(str) {\r\n\tvar pair1 = [\"A\", \"T\"];\r\n\tvar pair2 = [\"C\", \"G\"];\r\n\tvar toPair = str.split(\"\");\r\n\tvar result = [];\r\n\tfor(var i = 0; i < toPair.length; i++) {\r\n\t\tvar arr = [];\r\n\t\tarr.push(toPair[i]);\r\n\t\tif(pair1[0] === toPair[i]) {\r\n\t\t\tarr.push(pair1[1]);\r\n\t\t}\r\n\t\telse if(pair1[1] === toPair[i]) {\r\n\t\t\tarr.push(pair1[0]);\r\n\t\t}\r\n\r\n\t\telse if(pair2[0] === toPair[i]) {\r\n\t\t\tarr.push(pair2[1]);\r\n\t\t}\r\n\t\telse if(pair2[1] === toPair[i]) {\r\n\t\t\tarr.push(pair2[0]);\r\n\t\t}\r\n\t\tresult.push(arr);\r\n\r\n\t}\t\r\n\tconsole.log(result);\r\n return result;\r\n}", "function pairElement(str) {\n let arr = str.split('');\n let newArr = []\n //console.log(arr)\n for (let i = 0; i < arr.length; i++){\n if(arr[i] == 'G'){\n newArr.push(['G', 'C']); \n } else if (arr[i] == 'C'){\n newArr.push(['C', 'G']);\n } else if (arr[i] == 'A'){\n newArr.push(['A', 'T']);\n } else if (arr[i] == 'T'){\n newArr.push(['T', 'A']);\n }\n }\n return newArr\n}", "function solution_1 (s1, s2) {\r\n if (s2.length < s1.length) return false;\r\n const freq = {};\r\n for (const char of s1) {\r\n freq[char] = freq[char] ? freq[char] - 1 : -1;\r\n }\r\n for (let i = 0; i < s2.length; i++) {\r\n const newChar = s2[i];\r\n freq[newChar] = freq[newChar] ? freq[newChar] + 1 : 1;\r\n if (!freq[newChar]) delete freq[newChar];\r\n if (i >= s1.length) {\r\n const oldChar = s2[i - s1.length]\r\n freq[oldChar] = freq[oldChar] ? freq[oldChar] - 1 : -1;\r\n if (!freq[oldChar]) delete freq[oldChar];\r\n }\r\n if (!Object.keys(freq).length) return true;\r\n }\r\n return false;\r\n}", "function cCipher(string, num){\n let finalString = \"\";\n let arr = [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];\n let shiftArr = [];\n let count = 0;\n let arrCount = 0;\n let shiftArrCount = 0;\n \n string = string.toUpperCase();\n \n for(let i = 0; i < arr.length; i++){\n if((i + num) <= arr.length - 1){\n arrCount = i + num;\n }\n \n else{\n arrCount = count;\n count++;\n }\n \n shiftArr[shiftArrCount] = arr[arrCount];\n shiftArrCount++;\n }\n \n for(let j = 0; j < string.length; j++){\n for(let k = 0; k < arr.length; k++){\n if(string[j] === arr[k])\n finalString += shiftArr[k];\n }\n }\n \n return finalString.replace(/(.{5})/g,\"$1 \");\n}", "function countChars(string, letter) {\n let evenStr = string.toLowerCase();\n let evenLtr = letter.toLowerCase();\n let stringCount = 0;\n for(let i = 0; i < evenStr.length; i++){\n if(evenStr[i] === evenLtr){\n stringCount++;\n }\n }\n return stringCount;\n}", "function pairElement(str) {\n var paired = [];\n \n var search = function(char){\n switch(char){\n case \"A\":\n paired.push(['A', 'T']);\n break;\n \n case \"T\":\n paired.push(['T', 'A']);\n break;\n case \"C\":\n paired.push([\"C\", \"G\"]);\n break;\n case \"G\":\n paired.push([\"G\", \"C\"]);\n break;\n }\n };\n \n for(var i = 0; i < str.length; i++){\n search(str[i])\n }\n return paired;\n }", "function oneTwo(str){\n let s = '';\n for (let i=0; i<str.length-2; i+=3){\n s = s + str.substring(i+1, i+3) + str.charAt(i);\n }\n return s; \n }", "function letterTallyHelper(str) {\n let map = {}\n function helper(word) {\n if(word.length === 0) return map \n if(map.hasOwnProperty(word[0])) map[word[0]]++\n if(!map.hasOwnProperty(word[0])) map[word[0]] = 1\n helper(word.slice(1))\n }\n helper(str)\n return map \n}", "function anagram(string, result = []) {\r\n if (string.length <= 1) {\r\n return string;\r\n }\r\n if ((string.length = 2)) {\r\n const first = string.charAt(0);\r\n const second = string.slice(1);\r\n const switchedLetters = second + first;\r\n return switchedLetters;\r\n }\r\n\r\n const firstLetter = string.charAt(0);\r\n // const reorder = string.slice(1);\r\n\r\n // result.push(` ${firstLetter + anagram(anagram(reorder, result), result)}`);\r\n // return result;\r\n return firstLetter + anagram(string.slice(1));\r\n}", "function cntThree(str) {\n //get character loop through string\n for (j = 0; j < str.length; j++) {\n var cnt = 0;\n // console.log(`Checking for character ${str.substring(j,j+1)}`);\n for (k = 0; k < str.length; k++){\n // console.log(`comparing ${str.substring(j,j+1)} to ${str.substring(k,k+1)}`);\n if (str.substring(j,j+1) === str.substring(k,k+1)){\n cnt++;\n }\n // console.log(`Count: ${cnt}`);\n }\n if (cnt === 3){\n return true;\n }\n }\n}", "function distSameLetter(s){\n var uniques = s.split('').filter((a, i) => s.indexOf(a) === i).join('');\n var arr = ['', 0];\n for(var i = 0; i < uniques.length; i++){\n diff = s.lastIndexOf(uniques[i]) - s.indexOf(uniques[i]) + 1;\n if(diff > arr[1]){\n arr = [uniques[i], diff];\n }\n }\n return arr.join('');\n}", "function pairElement(str) {\n\treturn str\n\t\t.split('')\n\t\t.map((letter) =>\n\t\t\tletter === 'A'\n\t\t\t\t? ['A', 'T']\n\t\t\t\t: letter === 'T'\n\t\t\t\t? ['T', 'A']\n\t\t\t\t: letter === 'C'\n\t\t\t\t? ['C', 'G']\n\t\t\t\t: ['G', 'C']\n\t\t);\n}", "function anagram(string) {\n const results = {}\n function buildCombos(combos, letters) {\n if(!letters.length) {\n return results[combos] = '';\n }\n for (var i = 0; i < letters.length; i++) {\n buildCombos(combos + letters.charAt(i), letters.slice(0, i) + letters.slice(i + 1));\n }\n}\n buildCombos('', string);\n return Object.keys(results);\n\n}", "function encipherPair(str) {\n if (str.length != 2) return false;\n var pos1 = getCharPosition(str.charAt(0));\n var pos2 = getCharPosition(str.charAt(1));\n var char1 = \"\";\n\n // Same Column - Increment 1 row, wrap around to top\n if (pos1.col == pos2.col) {\n pos1.row++;\n pos2.row++;\n if (pos1.row > cipher.maxRow - 1) pos1.row = 0;\n if (pos2.row > cipher.maxRow - 1) pos2.row = 0;\n char1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n } else if (pos1.row == pos2.row) {\n // Same Row - Increment 1 column, wrap around to left\n pos1.col++;\n pos2.col++;\n if (pos1.col > cipher.maxCol - 1) pos1.col = 0;\n if (pos2.col > cipher.maxCol - 1) pos2.col = 0;\n char1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n } else {\n // Box rule, use the opposing corners\n var col1 = pos1.col;\n var col2 = pos2.col;\n pos1.col = col2;\n pos2.col = col1;\n char1 = getCharFromPosition(pos1) + getCharFromPosition(pos2);\n }\n return char1;\n}", "function stringCompression (string) {\n \n if (string.length === 0) {\n console.log(\"Please enter valid string.\");\n return;\n }\n\n let output = \"\";\n let count = 0;\n\n for (let i = 0; i < string.length; i++) {\n count++;\n \n if (string[i] != string[i+1]) {\n output += string[i] + count;\n count = 0;\n }\n }\n console.log(output);\n}", "isAnagram(string1, string2) {\n string1=string1+\"\";\n string2=string2+\"\";\n if (string1.length != string2.length) {\n return false;\n }\n var arr = [];\n for (let index = 0; index < 36; index++) {\n arr[index] = 0;\n\n }\n for (let index = 0; index < string1.length; index++) {\n var ch = string1.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]++;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]++;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]++;\n }\n ch = string2.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]--;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]--;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]--;\n }\n\n\n }\n for (let index = 0; index < 36; index++) {\n if (arr[index] != 0) {\n return false;\n }\n }\n return true;\n}", "function pairElement(str) {\n let pairArray = str.split(\"\");\n let newArray = [];\n //console.log(pairArray);\n\n //encapsulate each individual item in its own array\n for (let i = 0; i < pairArray.length; i++) {\n newArray.push([pairArray[i]]);\n }\n\n for (let i = 0; i < newArray.length; i++) {\n //access first element of index i array and check its first letter, based on first\n //letter decide what character needs to be added to complete pair.\n if (newArray[i][0] === \"T\") {\n console.log(\"yes\");\n newArray[i].push(\"A\");\n } else if (newArray[i][0] === \"A\") {\n console.log(\"yes\");\n newArray[i].push(\"T\");\n } else if (newArray[i][0] === \"C\") {\n console.log(\"yes\");\n newArray[i].push(\"G\");\n } else if (newArray[i][0] === \"G\") {\n console.log(\"yes\");\n newArray[i].push(\"C\");\n }\n console.log(newArray[0][i]);\n }\n console.log(newArray);\n return newArray;\n}", "function repeatedString(s, n) {\n\n let string = '';\n let total = 0;\n\n while(string.length < n){\n string += s;\n }\n\n\n for(let char = 0; char < n; char++){\n if(string.charAt(char) === \"a\"){\n total ++\n }\n }\n return total;\n}", "function DNAStrand(dna){\n let arr = dna.split(\"\")\n console.log(arr)\n let newarr = []\n for(var i=0;i<arr.length;i++){\n if(arr[i] == \"A\"){\n newarr.push(\"T\")\n } else if (arr[i] == \"T\"){\n newarr.push(\"A\")\n } else if (arr[i] == \"C\"){\n newarr.push(\"G\")\n } else if (arr[i] == \"G\"){\n newarr.push(\"C\")\n }\n }\n console.log(newarr)\n return newarr.join(\"\")\n }", "function checkAB1(str) {\r\n\r\n for (let i = 0; i < str.length; i++) {\r\n if (str[i] === 'a' && str[i + 4] === 'b') {\r\n return true\r\n } else if (str[i] === 'b' && str[i + 4] === 'a') {\r\n return true\r\n }\r\n }\r\n return false\r\n}", "function stringAnalysis(string){\n\n var consecutives = {\"rot\": [], \"pos\": [], \"n\": []}\n var count = {\"rot\": 0, \"n\": 0}\n var temp = {\"rot\": [0], \"n\": [0]}\n\n var letter;\n for (let i = 0; i < string.length; i++){\n\n switch(string.charAt(i))\n {\n case \"[\":\n\n for (var key in temp)\n temp[key].push(count[key]);\n\n break;\n\n case \"]\":\n\n for (var key in temp)\n count[key] = temp[key].pop();\n\n break;\n\n case \"F\":\n\n consecutives[\"pos\"].push(i);\n consecutives[\"rot\"].push(count[\"rot\"]);\n consecutives[\"n\"].push(count[\"n\"]);\n\n count[\"n\"] += 1;\n\n break;\n\n\n case \"+\": count[\"rot\"] += 1; break;\n case \"-\": count[\"rot\"] -= 1; break;\n case \"G\": count[\"rot\"] -= 1/GminusRatio;\n }\n }\n\n return consecutives;\n}", "function combinations(str)\n{\nvar array1 = [];\n for (var x = 0, y=1; x < str1.length; x++,y++) \n {\n array1[x]=str1.substring(x, y);\n }\nvar combi = [];\nvar temp= \"\";\nvar slent = Math.pow(2, array1.length);\n\nfor (var i = 0; i < slent ; i++)\n{\n temp= \"\";\n for (var j=0;j<array1.length;j++) {\n if ((i & Math.pow(2,j))){ \n temp += array1[j];\n }\n }\n if (temp !== \"\")\n {\n combi.push(temp);\n }\n}\n return combi.join(\"\\n\");\n}", "function doubleSubstring(line) {\n var count = 0;\n var longest;\n for (var i = 0; i < line.length; i++) {\n for (var j = 1; j < line.length; j++ ) {\n\n }\n }\n}", "function permAlone(str) {\n function permute(str) {\n if (str.length < 2) {\n return str;\n }\n const permutations = [];\n for (let i = 0; i < str.length; i++) {\n const first = str[i];\n const remaining = str.slice(0, i) + str.slice(i + 1);\n const subPerms = permute(remaining);\n for (let subPerm of subPerms) {\n // don't add if 2 repeated consecutive letters\n if (first !== subPerm[0]) {\n permutations.push(first + subPerm);\n }\n }\n }\n return permutations;\n }\n const result = permute(str);\n return result.length;\n}", "function permutationsWithDups4(str) {\n return createPerms('', str.length, buildLetterMap(str));\n}", "function staggeredCase(input) {\n\n}", "function solution(S) {\n let lowerS = S.toLowerCase();\n var occurrences = new Array(26);\n //set every letter as array index, and occurrences as 0 to initialize\n for (var i = 0; i < occurrences.length; i++) {\n occurrences[i] = 0;\n }\n // for ( <var> in <string> ) {\n // returns index of each element of string;\n // for ( <var> of <string> ) {\n // returns each character of string\n \n //for (var id in lowerS) {\n for (let id = 0; id < lowerS.length; id++) {\n //id yields the index of the characters in lowerS\n //lowerS.charCodeAt(id) yields the character code at position id of lower\n // Code: 104 id: 0 lowerS[id]: h\n // code - 'a'.charCodeAt(0) = 104 - 97 = 7\n // Code: 101 id: 1 lowerS[id]: e\n // code - 'a'.charCodeAt(0) = 101 - 97 = 4\n // Code: 108 id: 2 lowerS[id]: l\n // code - 'a'.charCodeAt(0) = 108 - 97 = 11\n // Code: 108 id: 3 lowerS[id]: l\n // code - 'a'.charCodeAt(0) = 108 - 97 = 11\n // Code: 111 id: 4 lowerS[id]: o\n // code - 'a'.charCodeAt(0) = 111 - 97 = 14\n let code = lowerS.charCodeAt(id);\n console.log(\"Code: \", code, \" id: \", id, \" lowerS[id]: \", lowerS[id]);\n //Subtracting the character code of 'a' from code yields the character # of a-z (0-25)\n let index = code - 'a'.charCodeAt(0);\n console.log(`code - 'a'.charCodeAt(0) = ${code} - ${'a'.charCodeAt(0)} = ${index}`);\n occurrences[index]++;\n }\n console.log(\"New occurrences: \", occurrences);\n\n var best_char = 'a';\n var best_res = occurrences[0]; //replace 0 with the actual value of occurrences of 'a'\n\n //starting i at 1, because we've already set best_char = 'a' and 'a's occurrences.\n for (var i = 1; i < 26; i++) {\n if (occurrences[i] >= best_res) {\n //Now reverse this from an index (i) to a character code (fromCharCode) to a character (best_char)\n best_char = String.fromCharCode('a'.charCodeAt(0) + i);\n best_res = occurrences[i];\n }\n }\n\n return best_char;\n}", "function main() {\n var n = parseInt(readLine());\n var s = readLine();\n var k = parseInt(readLine());\n\n var resultCode = [];\n var resultString = '';\n k = k % 26;\n for(var i = 0; i < s.length; i++) {\n if(s.charAt(i).match(/[a-zA-Z]/) !== null) {\n\n var charCode = s.charCodeAt(i) + k;\n if(s.charCodeAt(i) < 91) {\n if(charCode > 90) {\n charCode = charCode - 90 + 64;\n resultCode.push(charCode);\n } else {\n resultCode.push(charCode);\n }\n }\n else if(s.charCodeAt(i) > 96 && s.charCodeAt(i) < 123){\n if(charCode > 122) {\n charCode = charCode - 122 + 96;\n resultCode.push(charCode);\n } else {\n resultCode.push(charCode);\n }\n }\n } else {\n resultCode.push(s.charCodeAt(i));\n }\n }\n for(var j = 0; j < resultCode.length; j++) {\n resultString += String.fromCharCode(resultCode[j]);\n }\n console.log(resultString);\n}", "function pairElement(str) {\n // Return each strand as an array of two elements, the original and the pair.\n var paired = [];\n\n // Function to check with strand to pair.\n var search = function(char) {\n switch (char) {\n case \"A\":\n paired.push([\"A\", \"T\"]);\n break;\n case \"T\":\n paired.push([\"T\", \"A\"]);\n break;\n case \"C\":\n paired.push([\"C\", \"G\"]);\n break;\n case \"G\":\n paired.push([\"G\", \"C\"]);\n break;\n }\n };\n\n // Loops through the input and pair.\n for (var i = 0; i < str.length; i++) {\n search(str[i]);\n }\n\n return paired;\n}", "function countLetters(string) {\n const stringArray = string.split(\"\").sort();\n let counter = 1;\n let newString = \"\";\n for (i = 0; i < stringArray.length; i++) {\n if (stringArray[i] == stringArray[i + 1]) {\n counter++;\n } else {\n newString = newString + stringArray[i] + \":\" + counter + \" \";\n counter = 1;\n }\n }\n return newString;\n}", "function swapChars(str, n = 3){\r\n\t\t\r\n\tlet arr = [];\r\n\r\n\tfor (let i = 0; i < str.length; i=i+n){\r\n\t\t\r\n\t\tarr.push(str.slice(i,i+n));\r\n\r\n\t}\r\n\t\r\n\tfor (let j = 0; j < arr.length; j++){\r\n\t\t\r\n\t\tif(arr[j].length==n){\r\n\t\t\r\n\t\t\tlet shrtStr = arr[j].split('')\r\n\t\t\tshrtStr.push(arr[j][0]);\r\n\t\t\tshrtStr.shift();\r\n\t\t\tarr[j]=shrtStr.join('');\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n\treturn arr.join('');\r\n\r\n}", "function duplicateStringWithCount(inpt,count)\r\n{\r\n\t finalOutput=\" \";\r\n\tvar len=inpt.length;\r\n\tvar i,j;\r\n\tfor(i=0;i<len;i++)\r\n\t{\r\n\t\tj=0;\r\n\t\twhile(j<=count)\r\n\t\t{\r\n\t\t\tfinalOutput=finalOutput.concat(inpt.charAt(i));\r\n\t\t\tj++;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\treturn finalOutput;\r\n}", "function pairElement(str) {\n let arr = str.split(\"\");\n let newArr = [];\n let len = arr.length;\n for (let i = 0; i < len; i++) {\n \tswitch(arr[i]) {\n \t\tcase 'A':\n \t\t newArr.push(['A', 'T']);\n \t\t break;\n \t\tcase 'T': \n \t\t newArr.push(['T', 'A']);\n \t\t break;\n \t\tcase 'C':\n \t\t newArr.push(['C', 'G']);\n \t\t break;\n \t\tcase 'G': \n \t\t newArr.push(['G','C']);\n \t\t break;\n \t}\n }\n return newArr;\n}", "function commonCharacterCount(s1, s2) {\n \n // find lesser of two lengths\n let len = Math.min(s1.length, s2.length)\n \n // set count to zero\n let count = 0\n \n let s1Dict = {}\n \n // create dictionary of letter counts in s1\n for (let i = 0; i < s1.length; i++){\n // if character is not in dictionary, add it\n let char = s1.charAt(i)\n if (!(char in s1Dict)){\n s1Dict[char] = 1\n } else {\n // add 1 to key since character is in dict already\n s1Dict[char] ++\n }\n }\n //console.log(s1Dict)\n \n // loop through s2\n for (let j = 0; j < s2.length; j++){\n let char2 = s2.charAt(j)\n // char2 in s1Dict?\n if (char2 in s1Dict){\n // are there remaining characters in s1Dict to pull from?\n if (s1Dict[char2] > 0){\n count ++\n s1Dict[char2] --\n }\n }\n }\n //console.log(s1Dict)\n \n return count\n}", "function mix(s1, s2) {\n\n console.log(s1, \"string2: \" + s2)\n\n var finalStr = \"\";\n // remove all unnecessary characters in the string..\n s1 = s1.replace(/[^a-z]/gi, '');\n s2 = s2.replace(/[^a-z]/gi, '');\n\n var letterOccurrenceInSentences = {};\n\n // moves all the occurrence of every letter into a object with two properties\n\n\n countLetterOccurrence(s1, letterOccurrenceInSentences, 'first');\n countLetterOccurrence(s2, letterOccurrenceInSentences, 'second');\n\n // now need to check each value length if greater than 1, if it isn't remove it from the object\n\n // i dont think we need to actually check if it is bigger than one...\n\n // when doing the final check i can just only count it if is bigger than one...\n\n // console.log(\"first string \" + s1, \"second string \" + s2)\n // for (var key in letterOccurrenceInSentences) {\n // if (letterOccurrenceInSentences.hasOwnProperty(key)) {\n // console.log(letterOccurrenceInSentences)\n // }\n // }\n\n // starting to insert the maxium of letters into a string..\n\n console.log(letterOccurrenceInSentences);\n\n for (var key in letterOccurrenceInSentences) {\n if (\n letterOccurrenceInSentences[key].first > letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].second == undefined) {\n if (trueString(letterOccurrenceInSentences[key].first)) {\n finalStr += \"1:\"\n for (var i = 0; i < letterOccurrenceInSentences[key].first; i++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first < letterOccurrenceInSentences[key].second ||\n letterOccurrenceInSentences[key].first == undefined) {\n if (trueString(letterOccurrenceInSentences[key].second)) {\n finalStr += \"2:\"\n for (var j = 0; j < letterOccurrenceInSentences[key].second; j++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } else if (letterOccurrenceInSentences[key].first == letterOccurrenceInSentences[key].second) {\n if (letterOccurrenceInSentences[key].first !== 1 && letterOccurrenceInSentences[key].second !== 1) {\n finalStr += \"=:\"\n for (var k = 0; k < letterOccurrenceInSentences[key].first; k++) {\n finalStr += key;\n }\n finalStr += \"/\"\n }\n } \n }\n\n finalStr = finalStr.split(\"/\").sort(function (a, b) {\n if (b.length === a.length) {\n return (a > b ? 1 : -1);\n } else {\n return b.length - a.length;\n }\n }).join(\"/\");\n\n // remove the last slash...\n finalStr = finalStr.slice(0, -1);\n console.log(finalStr);\n\n return console.log(finalStr);\n\n }", "function StringReduction(str) { \nvar res = str.length + 1;\n while(res>str.length){\n res = str.length;\n str = str.replace(/ab|ba/, 'c');\n str = str.replace(/ca|ac/, 'b');\n str = str.replace(/bc|cb/, 'a');\n } ;\n \n // code goes here \n return str.length; \n \n}", "function repeatedString(s,n) {\n //Check if there are any a's in the input string\n if (!s.includes('a')) {\n return 0;\n }\n //Find number of matches in original string\n const matches = s.match(/a/g).length;\n //Find number of full repeats needed\n const repeats = Math.floor(n / s.length);\n //Calculate initial result\n let initialResult = matches * repeats;\n //Find how many extra characters are needed\n const remainder = n % s.length;\n //If there is a remainder, add the number of 'a's from it\n if (remainder !== 0) {\n const extras = s.slice(0,remainder).match(/a/g);\n if (extras !== null) {\n return initialResult + extras.length;\n }\n } \n return initialResult;\n}", "function RunLength(str) {\n var letter = str.charAt(0);\n var count = 0;\n var result = '';\n str.split('').forEach(function(c) {\n if (c == letter)\n count++;\n else {\n result += count + letter;\n letter = c;\n count = 1;\n }\n });\n result += count + letter;\n return result;\n}", "function permAlone(str) {\n //, create and array of letters, and store the number of elements in teh array\n let letters = [...str],\n n = letters.length,\n // and a var to increment when strings without repeat letters are found\n count = 0;\n\n permutate(n, letters);\n\n return count;\n\n function permutate (n, array) {\n // if we've swapped the appropriate number of letters then we take teh permutation created\n if (n === 0) {\n console.log(array);\n // and if we can confirm the current permutation doesnt have and letters reapted in sequence\n if (! /(.)\\1/g.test(array.join('')) ) {\n // increase teh count of appropriate permutations\n count++;\n }\n\n return;\n }\n \n // \n for (let i = 0; i < n; i++) {\n // call permutate with n-1 so we can generate permutations of permutations\n permutate(n-1, array);\n // if n is odd we swap the first and last element && if n is even we swap the ith element\n n % 2 === 0 ? swap(i, n-1) : swap(0, n-1);\n }\n\n // simple swap function w/o using temp var\n function swap (a, b) {\n [array[a], array[b]] = [array[b], array[a]];\n }\n }\n\n}", "function consecutiveDuplicatesWithCount(inpt)\r\n{\r\n\t finalOutput=\"(\";\r\n\tvar count=1;\r\n\tfor(var i=0;i<inpt.length;i++)\r\n\t{\r\n\t\tvar temp=inpt.charAt(i);\r\n\t\tif(temp==inpt.charAt(i+1))\r\n\t\t{\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tfinalOutput=finalOutput.concat(count);\r\n\t\t\tfinalOutput=finalOutput.concat(\" \"+temp);\r\n\t\t\tfinalOutput=finalOutput.concat(\" ) (\");\r\n\t\t\tcount=1;\r\n\t\t}\r\n\t}\r\n\tvar len1=finalOutput.length;\r\n\tdocument.write(finalOutput.slice(0,len1-1));\r\n}", "permutationString(string) {\n var results = [];\n console.log(\"Now a String:\" + string)\n console.log(\"String length:\" + string.length)\n\n\n if (string.length === 1) {\n results.push(string);\n return results;\n }\n\n for (var i = 0; i < string.length; i++) {\n var firstChar = string[i];\n console.log(\"Now First char:\" + firstChar)\n var otherChar = string.substring(0, i) + string.substring(i + 1);\n console.log(\"now other char:\" + otherChar)\n var otherPermutations = this.permutationString(otherChar);\n\n for (var j = 0; j < otherPermutations.length; j++) {\n results.push(firstChar + otherPermutations[j]);\n console.log(\"char in array:\" + results)\n }\n }\n return results;\n\n\n\n\n }" ]
[ "0.70177794", "0.66724616", "0.65201974", "0.6498764", "0.64794505", "0.64699566", "0.644128", "0.6438721", "0.6433018", "0.6395357", "0.6370845", "0.62991196", "0.6210938", "0.6185349", "0.61805886", "0.61717916", "0.6162583", "0.61354834", "0.6131014", "0.60920846", "0.60782576", "0.605301", "0.60421956", "0.60278547", "0.60220814", "0.6018676", "0.5996806", "0.5988206", "0.5973578", "0.5971754", "0.59687144", "0.59593403", "0.594761", "0.5924769", "0.5923066", "0.5921909", "0.5913894", "0.59132105", "0.59110385", "0.58996975", "0.589731", "0.58813417", "0.58804923", "0.5874278", "0.58694524", "0.5858896", "0.5856447", "0.58359224", "0.58263737", "0.58263534", "0.5825701", "0.5819497", "0.5815986", "0.5776199", "0.5768022", "0.57634264", "0.5757692", "0.5757672", "0.5746535", "0.57447493", "0.5741549", "0.57320416", "0.5723255", "0.5721298", "0.5715441", "0.5694637", "0.5692315", "0.56789327", "0.56765026", "0.56757474", "0.5674746", "0.5673626", "0.5667585", "0.56616765", "0.5661382", "0.56602937", "0.5656473", "0.5655428", "0.5654674", "0.56518644", "0.5643021", "0.56415975", "0.5637229", "0.56358683", "0.56356746", "0.5634696", "0.5633763", "0.5631234", "0.56301403", "0.56287706", "0.5627988", "0.5614014", "0.56117386", "0.56101656", "0.56098515", "0.56088907", "0.5594661", "0.5591562", "0.55889016", "0.5586842" ]
0.5971561
30
SELECT: Devuelve todas las fincas por productor
obtenerProductor(id) { return axios.get(`${API_URL}/v1/productorpersonaReporte/${id}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function seleccionarOrden(productos){\n \n\n let rowProductos = document.querySelector(\".buzos__row\");\n\n rowProductos.innerHTML=\"\";\n\n let select = document.querySelector(\".selectOrdenProductos\");\n \n switch(select.value){\n\n case 'date':\n getPaginacion(ordenarProductosFecha(productos));\n break;\n \n case 'price-asc':\n getPaginacion(ordenarProductosPrecio(productos, \"asc\"));\n break;\n\n case 'price-des':\n getPaginacion(ordenarProductosPrecio(productos, \"des\"));\n break;\n\n }\n \n}", "getMateriasProgra(ru,gestion,periodo){\n return querys.select(\"select * from consola.generar_programacion_completa(\"+ru+\",\"+gestion+\",\"+periodo+\",0)\");\n }", "function datosVenta() {\n let total = 0;\n let iva = 0;\n for (let i = 0; i < listaProductos.length; i++) {\n total += listaProductos[i].precio * listaProductos[i].cantidad;\n iva += ((listaProductos[i].precio * listaProductos[i].cantidad) * 0.16);\n }\n puntoVenta.registrarVenta(iva, total, listaProductos);\n}", "campeao(res) {\n const sql = ` select ti.*, e.nome as estado, e.sigla, r.nome as regiao from times ti\n inner join estados e on (e.estado_id = ti.estado_id)\n inner join regioes r on (r.regiao_id = e.regiao_id)\n inner join partidas pa on (pa.time_id_vencedor = ti.time_id)\n order by pa.partida_id desc limit 1 `\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "function calculaValorTotalVenda(event) {\n let valorTotal = 0;\n let quantidade = document.querySelectorAll(\"#produtosVenda > div > div.div-3 > input\");\n let produtos = document.querySelectorAll(\"#produtosVenda > div > div.div-2 > select\");\n produtos.forEach((element, i) => {\n element = element.options[element.selectedIndex];\n valorTotal += parseFloat(element.getAttribute('preco')) * parseInt(quantidade[i].value)\n })\n document.querySelector(\"body > section > div > div > form > input\").value = `Valor Total: ${valorTotal.toFixed(2)}`\n}", "function showProductReserva(product) {\n var hora = document.getElementById(product.hora).nextElementSibling;\n var lugar = document.getElementById(product.lugar).innerHTML;\n switch (lugar){\n case \"Padel 1\": \n lugar = 0;\n break;\n case \"Padel 2\": \n lugar = 1;\n break;\n case \"Padel 3\": \n lugar = 2;\n break;\n case \"Tenis 1\": \n lugar = 3;\n break;\n case \"Tenis 2\": \n lugar = 4;\n break;\n case \"Trinquete\": \n lugar = 5;\n break;\n default: \n lugar = 6;\n break;\n }\n var ocupado = hora;\n for(var i = 0; i < lugar; i++) {\n ocupado = ocupado.nextElementSibling;\n }\n ocupado.innerHTML = \"Ocupado\"\n ocupado.className = \"ocupado\"\n }", "function mostrartodosproductos() {\n productosmodelo.find().then(resultado => {\n let cadenaDOM = \"\";\n resultado.forEach(producto => {\n cadenaDOM +=\n `<div>\n <table >\n <tr style=\"background-color:#567CE3 ;\">\n <th>Producto</th>\n <th>Nombre</th>\n <th>precio</th>\n <th>Cantidad</th>\n <th>Imagen</th>\n </tr>\n <tr>\n <td>${producto.idproducto}</td>\n <td>${producto.nombreproducto}</td>\n <td>${producto.precioproducto}</td>\n <td>${producto.cantidadproducto}</td>\n <td><a href=\"./images/${producto.imagen}\" target=\"_blank\" ><img src=\"./images/${producto.imagen}\" height=\"50\" width=\"50\"></td>\n \n </tr>\n </table>\n </div>`;\n });\n document.getElementById(\"wrapper\").innerHTML = cadenaDOM;\n }).catch(error => {\n console.log(\"ERROR en find\");\n });\n}", "function obtenerValoresOtras(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion,n_calificacion FROM puertas_valores_otras WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 55; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_otras\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_otras_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n $('#text_calificacion55').val(resultSet.rows.item(0).n_calificacion); //se coloca el cero porque 55 es el primer valor de la lista\n $('#cal_item_otras55').val(resultSet.rows.item(0).n_calificacion); //se coloca el cero porque 55 es el primer valor de la lista\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function leerDatosDeProducto(productoAgregado) {\n const idProductoSeleccionado = parseInt(\n productoAgregado.querySelector(\"a\").getAttribute(\"data-id\")\n );\n\n let datoProductos = {};\n\n productosEnStock.forEach((producto) => {\n if (producto.id === idProductoSeleccionado) {\n datoProductos = { ...producto };\n datoProductos.cantidad = 1;\n }\n });\n const existe = coleccionProductos.some(\n (producto) => producto.id === datoProductos.id\n );\n\n if (existe) {\n //actualizamos la cantidad\n const productosListaSinCopia = coleccionProductos.map((producto) => {\n if (producto.id === datoProductos.id) {\n producto.cantidad++;\n return producto;\n } else {\n return producto;\n }\n });\n } else {\n //agrega elemento al arreglo de carrito\n coleccionProductos = [...coleccionProductos, datoProductos];\n }\n\n carritoHTML();\n}", "function displayCaddie() {\n let list = \"\";\n\n for (let i = 0; i < productsList.length; i++) {\n // Récupère le produit à l'indice i\n const product = productsList[i];\n\n // si élément actuel ajouté au panier\n // alors on ajoute \"X code\" à la variable list\n\n if(product.total > 0 ){\n list = list + product.total + \" \";\n list = list + product.name + \", \";\n\n }\n\n }\n\n // Parcours tous les éléments du panier\n document.getElementById(\"resultat\").innerHTML = list;\n\n}", "function agregarProducto(producto) {\n const infoProducto = {\n imagen: producto.querySelector('.item').src,\n name: producto.querySelector('.name-producto').textContent,\n precio: producto.querySelector('.precio').getAttribute('value'),\n id: producto.querySelector('button').getAttribute('data-id'),\n cantidad: 1\n }\n\n //SUMANDO LA CANTIDAD TOTAL DE PRODUCTOS EN EL CARRITO\n\n cantidadTotal += infoProducto.cantidad;\n totalPagar += parseInt(infoProducto.precio); //Total a pagar bill\n totalaPagar();\n\n //revisar si ya existe un cursor: \n const existe = articulosCarrito.some(producto => producto.id === infoProducto.id);\n if (existe) {\n const producto = articulosCarrito.map(producto => {\n //Si el producto ya existe aumentar su cantidad en 1 en 1\n if (producto.id === infoProducto.id) {\n producto.cantidad++;\n producto.precio = parseInt(producto.precio);\n infoProducto.precio = parseInt(infoProducto.precio);\n precioInicial = infoProducto.precio;\n producto.precio += precioInicial;\n\n return producto;\n } else {\n return producto;\n }\n });\n articulosCarrito = [...producto];\n } else {\n articulosCarrito = [...articulosCarrito, infoProducto]\n }\n mostrarenHTML();\n actualizardisplay();\n carritoVacio();\n}", "static GetUtilidad(cadenaDeConexion, fI, fF, idSucursal, result) {\n\n var sucursal = '';\n if (idSucursal != 1) {\n sucursal = `AND info_ingresos.codSucursal=` + idSucursal;\n }\n console.log(\"sucursal \", sucursal);\n sqlNegocio(\n cadenaDeConexion,\n ` SELECT base.codMes, SUM(base.precioVenta) as totalVenta from (SELECT info_grupopartidas.nombreGrupo,info_ingresos.codMes,\n\n CASE info_grupopartidas.nombreGrupo\n WHEN 'EGRESOS' THEN -(SUM(info_ingresos.sumPrecioVenta))\n WHEN 'INGRESOS' THEN SUM(info_ingresos.sumPrecioVenta)\n END as precioVenta\n \n \n from info_ingresos LEFT JOIN\n info_partidas on info_ingresos.idPartida = info_partidas.idPartida LEFT JOIN \n info_grupopartidas on info_grupopartidas.idGrupoPartida = info_partidas.idGrupo \n where info_ingresos.fecEmision BETWEEN '`+ fI + `' AND '` + fF + `' AND info_ingresos.estado=1 ` + sucursal + ` AND ( info_grupopartidas.nombreGrupo = 'EGRESOS' or info_grupopartidas.nombreGrupo = 'INGRESOS')\n group by info_grupopartidas.nombreGrupo,info_ingresos.codMes)as base group by base.codMes\n order by base.codMes ASC`,\n [],\n function (err, res) {\n if (err) {\n console.log(\"error: \", err);\n result(null, err);\n }\n else {\n result(null, res);\n }\n });\n }", "function accionConsultarProducto(){\n listado1.actualizaDat();\n var numSelec = listado1.numSelecc();\n if ( numSelec < 1 ) {\n GestionarMensaje(\"PRE0025\", null, null, null); // Debe seleccionar un producto.\n } else {\n var codSeleccionados = listado1.codSeleccionados();\n var arrayDatos = obtieneLineasSeleccionadas(codSeleccionados, 'listado1'); \n var cadenaLista = serializaLineasDatos(arrayDatos);\n var obj = new Object();\n obj.hidCodSeleccionadosLE = \"[\" + codSeleccionados + \"]\";\n obj.hidListaEditable = cadenaLista;\n //set('frmContenido.conectorAction', 'LPModificarGrupo');\n mostrarModalSICC('LPModificarOferta','Consultar producto',obj,795,495);\n }\n}", "function obtenerValoresElectrica(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_electrica WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 38; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_electrica\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_electrica_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function conteoFilasArticulos(valor){\r\n\tvar total=0;\r\n\t\r\n\tif(valor == '1'){\r\n\t $(\".tablaVentaArticulos tbody tr\").each(function () {\r\n\t\t \r\n\t\tvar articuloId = $(this).find('td').eq(1).find(\".articuloId\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(1).find(\".articuloId\").attr('name',articuloId);\r\n\t\t \r\n\t\tvar z = $(this).find('td').eq(3).find(\".descripcion\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(3).find(\".descripcion\").attr('name',z);\r\n\t\t\r\n\t\tvar cantidad = $(this).find('td').eq(2).find(\".cantidad\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(2).find(\".cantidad\").attr('name',cantidad);\r\n\t\t\r\n\t\tvar precio = $(this).find('td').eq(4).find(\".precio\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t$(this).find('td').eq(4).find(\".precio\").attr('name',precio);\r\n\r\n\t\t$(this).find(\"td\").eq(0).find(\".consecutivo\").text(++total);\r\n\t });\r\n\t \r\n\t \r\n\t $('#totalArticulos').text(total);\r\n\t\r\n\t\r\n\t}else{\r\n\t\t$(\".tablaUpdateVentaArticulos tbody tr\").each(function () {\r\n\t\t\t// esta parte es para reoirganizar la numeracion del arreglo y evitar conflictos en el server\r\n\t\t\t\r\n\t\t\tvar articuloId = $(this).find('td').eq(1).find(\".articuloId\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(1).find(\".articuloId\").attr('name',articuloId);\r\n\t\t\t\r\n\t\t\tvar z = $(this).find('td').eq(3).find(\".descripcion\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(3).find(\".descripcion\").attr('name',z);\r\n\t\t\t\r\n\t\t\tvar cantidad = $(this).find('td').eq(2).find(\".cantidad\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(2).find(\".cantidad\").attr('name',cantidad);\r\n\t\t\t\r\n\t\t\tvar precio = $(this).find('td').eq(4).find(\".precio\").attr('name').replace(/[^a-zA-Z_\\W]+/g, total);\r\n\t\t\t$(this).find('td').eq(4).find(\".precio\").attr('name',precio);\r\n\r\n\t\t\t$(this).find(\"td\").eq(0).find(\".consecutivo\").text(++total);\r\n\t\t});\r\n\t $('#totalArticulosUpdate').text(total);\r\n\t}\r\n \r\n\t \r\n}", "ngOnInit() {\n var i = 0; // variable usada para hacer un ++ tantas veces como elementos en la base de datos haya y se inicializa a 0 cada vez quye salimos porque sino se repite y se añadirian otrea vez los mismos elementos x2 y con esto lo controlamos \n this.periferico = this.bda.list('Productos').valueChanges();\n this.periferico.forEach(element => {\n element.forEach(x => {\n if (x.tipo == \"periferico\") {\n i++;\n }\n if (this.listaPerifericos.length < i && x.tipo == \"periferico\") {\n this.listaPerifericos.push(x);\n }\n });\n });\n this.perifericoSelected = {\n nombre: \"\",\n imagen: \"\",\n descripcion: \"\",\n precio: 0,\n id: 0,\n tipo: \"periferico\"\n };\n this.identificador = this.servicioProductos.getIdentificador();\n this.listaPerifericos = this.servicioProductos.getListaPerifericos(); //lo dicho, llenamos el array que hemos creado aqui con los datos del service\n this.listaCarritoNombre = this.servicioProductos.getListaCarrito(); //igualamos lista carritos al del servicio porque sino no va xD\n //this.listaCarritoPrecioImagen = this.servicioProductos.getlistaCarritoPrecioImagen(); //lo mismo que lo anterior\n }", "function buscarLineaProducto(){\n\tvar datos= new Object();\n\tdatos.dto = \"es.indra.sicc.cmn.negocio.comun.DTOComunes.DTOGenBusquedaLineaProducto\";\n\tdatos.conector = \"ConectorGENBusquedaProducto\";\n\tvar salida = abrirBusquedaGenerica(datos, \"\",\"0075\");\n\tvar oid = \"\";\n\tvar descripcion = \"\";\n\tif(salida){\n\t\toid = salida[0][0];\n\t\tdescripcion = salida [0][2];\n\t}\n\tset('frmContenido.varCbLineaProducto',oid);\n\tset('frmContenido.cbLineaProducto',descripcion);\t\n }", "function mostrarCarritoRecuperado()\n{\n for (const precio of carritoRecuperado)\n {\n precioRecuperado = precio.precio + precioRecuperado;\n }\n $(\"#precioDelCarrito\").text(`Total: $${precioRecuperado}`);\n\n// SI HAY ITEMS EN EL CARRITO, MUESTRA PRODUCTOS\n for (const nombre of carritoRecuperado)\n {\n listaRecuperada.push(nombre.nombre+\"<br>\");\n }\n $(\"#productosEnCarrito\").append(listaRecuperada);\n\n// VUELVO A PUSHEAR LOS ITEMS EN EL CARRITO\n for (const item of carritoRecuperado)\n {\n carrito.push(item);\n }\n\n// ACTUALIZO EL CONTADOR DEL CARRITO\n contadorCarrito();\n\n}", "function obtenerProductos(req, res) {\n ProductoSucursal.find().populate('sucursal', 'nombreSucursal').exec((err, productosEncontrados) => {\n if (err) {\n return res.status(500).send({ ok: false, message: 'Hubo un error en la petición.' });\n }\n\n if (!productosEncontrados) {\n return res.status(404).send({ ok: false, message: 'Error en la consulta o no existen datos para mostrar.' });\n }\n\n return res.status(200).send({ ok: true, productosEncontrados });\n });\n}", "function selProduct(res) {\n res = res.toUpperCase();\n let rowCurr = $('#listProductsTable table tbody tr');\n let hearCnt = $('#listProductsTable table tbody tr th');\n\n if (res.length > 2) {\n let dstr = 0;\n let dend = 0;\n if (res.length == 5) {\n $('.toCharge').removeClass('hide-items'); //jjr\n if (glbSec != 4) { //IF agragado por jjr\n // console.log('Normal');\n getProducts(res.toUpperCase(), dstr, dend);\n } else {\n console.log('Subarrendo');\n getProductsSub(res.toUpperCase(), dstr, dend);\n }\n } else {\n rowCurr.css({ display: 'none' });\n rowCurr.each(function (index) {\n var cm = $(this)\n .data('element')\n .toUpperCase()\n .replace(/|/g, '');\n\n cm = omitirAcentos(cm);\n var cr = cm.indexOf(res);\n if (cr > -1) {\n $(this).show();\n }\n });\n }\n // rowCurr.show();\n } else {\n $(`#listProductsTable table tbody`).html('');\n rowCurr.addClass('oculto');\n }\n}", "function obtenerValoresPreliminar(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem_preli,v_calificacion,o_observacion FROM puertas_valores_preliminar WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=seleval\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $(\"#text_obser_item\"+i+\"_eval_prel\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function obtenerValoresObservacionFinal(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT o_observacion FROM puertas_valores_finales WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0; x < resultSet.rows.length; x++) {\n $(\"#text_observacion_final\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function mostrarDatosProveedor() {\n //tomar el idProveedor desde el value del select\n let idProvedor = document.getElementById(\"idProveedor\").value;\n //buscar el proveedor en la lista\n for (let i = 0; i < listaProveedores.length; i++) {\n let dato = listaProveedores[i].getData();\n if(dato['idProveedor'] === parseInt(idProvedor)){\n //desplegar los datos en el formulario\n vista.setDatosForm(dato);\n break;\n }\n }\n}", "function mostrarDatosCompra() {\n //Tomo los datos que pasé en la funcion navegar\n const unaCompra = this.data;\n if (unaCompra) {\n const idProd = unaCompra.idProducto;\n const productoComprado = obtenerProductoPorID(idProd);\n const subTotal = unaCompra.cantidad * productoComprado.precio;\n //Escribo el mensaje a mostrar\n const mensaje = `Producto <strong>${productoComprado.nombre}</strong>.\n <br> Cantidad comprada: <strong>${unaCompra.cantidad}</strong>.<br>\n Sub Total: <strong> $${subTotal}</strong>`;\n //Muestro el mensaje\n $(\"#pDetalleCompraMensaje\").html(mensaje);\n } else {\n ons.notification.alert(\"Ocurrió un error, por favor contacte al administrador\", { title: 'Oops!' });\n }\n}", "function ordenarMenorPrecio() {\n let rowProductos = $(\"#row-productos\");\n rowProductos.innerHTML = \"\";\n var ordenarMenorPrecio = indumentaria.sort((a, b) => a.precio - b.precio);\n productosFiltrados(ordenarMenorPrecio);\n sessionStorage.setItem(\"menorPrecio\", ordenarMenorPrecio);\n}", "function obtenerValoresProteccion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_sele_inspector,v_sele_empresa,o_observacion FROM puertas_valores_proteccion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_protec_person\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_inspector+\"']\").prop(\"checked\",true);\n $(\"input[name=sele_protec_person\"+i+\"_\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_empresa+\"']\").prop(\"checked\",true);\n $('#text_obser_protec_person'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function onClickBuscar() {\n var iProductoServicio = '';\n var sSituacion = '';\n\n if(get(FORMULARIO+'.cbProductoServicio')==get(FORMULARIO+'.MAE_TXT_PRODUCTO')){\n iProductoServicio = get(FORMULARIO+'.CMN_VAL_FALSE');\n } else if(get(FORMULARIO+'.cbProductoServicio')==get(FORMULARIO+'.MAE_TXT_SERVICIO')) {\n iProductoServicio = get(FORMULARIO+'.CMN_VAL_TRUE');\n }\n\n if(get(FORMULARIO+'.cbSituacion')==get(FORMULARIO+'.MAE_TXT_PRODUCTO_ACTIVO')){\n sSituacion = get(FORMULARIO+'.MAE_PRODUCTO_ACTIVO');\n } else if(get(FORMULARIO+'.cbSituacion')==get(FORMULARIO+'.MAE_TXT_PRODUCTO_INACTIVO')) {\n sSituacion = get(FORMULARIO+'.MAE_PRODUCTO_INACTIVO');\n }\n \n var pais = get(FORMULARIO+'.pais');\n var idioma = get(FORMULARIO+'.idioma');\n\n var codSAP = get(FORMULARIO+'.txtCodSAP');\n var codAntiguo = get(FORMULARIO+'.txtCodAntiguo');\n var descCorta = get(FORMULARIO+'.txtDescripcionCorta');\n var descSAP = get(FORMULARIO+'.txtDescripcionSAP');\n var marcaProducto = get(FORMULARIO+'.cbMarcaProducto');\n var unidadesNegocio = get(FORMULARIO+'.cbUnidadNegocio');\n var negocio = get(FORMULARIO+'.cbNegocio');\n var linea = get(FORMULARIO+'.cbLinea');\n var estatusProducto = get(FORMULARIO+'.cbEstatusProducto');\n var precioCatalogo = get(FORMULARIO+'.txtPrecioCatalogo');\n var precioContable = get(FORMULARIO+'.txtPrecioContable');\n\n configurarPaginado(mipgndo, 'CALBuscarInformacionProductos', \n 'ConectorBuscarInformacionProductos', 'es.indra.sicc.dtos.cal.DTOBuscarInformacionProductos', \n [['oidPais', pais], ['oidIdioma', idioma], \n ['codSAP', codSAP], \n ['codAntiguo', codAntiguo], \n ['descCorta', descCorta], \n ['descSAP', descSAP], \n ['productoServicio', iProductoServicio], \n ['marcaProducto', marcaProducto], \n ['unidadesNegocio', unidadesNegocio], \n ['negocio', negocio], \n ['linea', linea], \n ['situacion', sSituacion], \n ['estatusProducto', estatusProducto], \n ['precioCatalogo', precioCatalogo], \n ['precioContable', precioContable]]);\n \n}", "function obtenerValoresMotorizacion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_motorizacion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 43; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_motorizacion\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_motorizacion_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function calcularTotal(){\n //borrar el precio \n total=0;\n //recorrer el array de la cesta y obtener el precio de cada producto\n for(let item of arrayCesta){\n let itemcesta=productos.filter(function(objetoproductos){\n return objetoproductos['tag']==item;\n });\n //se suma el total\n total=total+itemcesta[0]['precio'];\n }\n //mostrar el precio\n $total.textContent=total.toFixed(2);\n}", "function ordenar() {\n let seleccion = $(\"#miSeleccion\").val().toUpperCase();\n popularListaCompleta();\n listaCompletaClases = listaCompletaClases.filter(Clase => Clase.dia ==\n seleccion);\n renderizarProductos();\n}", "function obtenerResultados(req, res) {\n var id = req.params.id;\n var peticionSql = leerSql(\"obtenerResultados.sql\") + id + `\n GROUP BY pelicula.id\n ORDER BY votos DESC\n LIMIT 0,3;`\n\n conexionBaseDeDatos.query(peticionSql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n // Si la competencia no ha recibido votos devolvemos el mensaje correspondiente\n if(!resultado || resultado.length == 0) {\n console.log('Esta competencia aun no ha recibido votos.');\n return res.status(422).send('Esta competencia aun no ha recibido votos');\n } else {\n var respuesta = {\n competencia: resultado[0].nombre,\n resultados: resultado,\n }\n res.status(200).send(JSON.stringify(respuesta));\n }\n })\n}", "async function parteEstoqueTelaDeProduto(tipo) {\r\n let codigoHTML = ``\r\n\r\n if (tipo) {\r\n\r\n let json = await requisicaoGET(`ingredients`, { headers: { Authorization: `Bearer ${buscarSessionUser().token}` } })\r\n\r\n VETORDEINGREDIENTESCLASSEPRODUTO = []\r\n\r\n codigoHTML += `<div class=\"form-group mx-auto\">\r\n <label for=\"quantidadeproduto\">Ingredientes/quantidade:</label>\r\n <div class=\"col-12\" style=\"position: relative; height: 30vh; z-index: 1; overflow: scroll; margin-right: 0px;\">\r\n <table class=\"table\">\r\n <tbody>`\r\n for (let item of json.data) {\r\n codigoHTML += `<tr class=\"table-info\">\r\n <td style=\"width:5vw\">\r\n <div class=\"custom-control custom-switch\">\r\n <input type=\"checkbox\" onclick=\"this.checked? adicionarouRemoverIngredienteProduto('adicionar','${item._id}') : adicionarouRemoverIngredienteProduto('remover','${item._id}')\" class=\"custom-control-input custom-switch\" id=\"select${item._id}\">\r\n <label class=\"custom-control-label\" for=\"select${item._id}\">Add</label>\r\n </div> \r\n </td>\r\n <td style=\"width:15vw\" title=\"${item.name}\"><span class=\"fas fa-box\"></span> ${corrigirTamanhoString(20, item.name)}</td>\r\n <td style=\"width:15vw\" title=\"Adicione a quantidade gasta na produção do produto!\">\r\n <div class=\"input-group input-group-sm\">\r\n <input type=\"Number\" class=\"form-control form-control-sm\" id=\"quanti${item._id}\">\r\n <div class=\"input-group-prepend\">`\r\n if (item.unit == 'u') {\r\n codigoHTML += `<span class=\"input-group-text input-group-text\">unid.</span>`\r\n } else {\r\n codigoHTML += `<span class=\"input-group-text input-group-text\">${item.unit}</span>`\r\n }\r\n codigoHTML += `</div>\r\n </div>\r\n </td>\r\n </tr>`\r\n }\r\n codigoHTML += `</tbody>\r\n </table>\r\n </div>\r\n </div>`\r\n } else {\r\n codigoHTML += `<div class=\"col-6\">\r\n <label>Quantidade: </label>\r\n <div class=\"input-group\">\r\n <input id=\"quantidadeproduto\" type=\"Number\" class=\"form-control mousetrap\" placeholder=\"Quantidade\">\r\n <div class=\"input-group-prepend\">\r\n <span class=\"input-group-text\">Unid.</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-6\">\r\n <label>Preço de custo (unid.): </label>\r\n <div class=\"input-group\">\r\n <div class=\"input-group-prepend\">\r\n <span class=\"input-group-text\">R$</span>\r\n </div>\r\n <input id=\"precocustoproduto\" type=\"Number\" class=\"form-control mousetrap\" placeholder=\"Preço de custo\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">%</button>\r\n <div class=\"dropdown-menu\">\r\n <div class=\"col-12 layer1\" style=\"position: relative; height: 50vh; z-index: 1; overflow: scroll; margin-right: 0px;\">`\r\n for (let i = 5; i <= 90; i += 5) {\r\n codigoHTML += `<a class=\"dropdown-item\" onclick=\"calcularValorDeCustoPorPorcentagem(${i});\" href=\"#\">${i}%</a>`\r\n }\r\n codigoHTML += `</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>`\r\n }\r\n\r\n document.getElementById('opcaoDeEstoqueTelaProduto').innerHTML = codigoHTML;\r\n}", "function dibujarListaDePedidos(pedidos) {\n tbody.innerHTML = \"\";\n pedidos.forEach((element) => {\n tbody.innerHTML += `\n <td><i class=\"fas fa-times-circle\"></i>${element.producto}</td>\n <td>$${element.precio}</td>\n `;\n });\n document.getElementById(\"mostrarTotal\").innerHTML = `$ ` + calculatTotal();\n}", "function cargarModal(){\n let total = 0;\n actualizarPrecioCarrito();\n $(\".modal-body_js\").empty();\n if(carrito.length > 0)\n {\n $(\".modal-title\").html(\"Detalle de carrito:\");\n $(\".botonProcesarCompra\").show();\n let tablaCarrito = \"<table class= tabla__modal >\";\n tablaCarrito =tablaCarrito+ `<thead><tr><th>Numero</th> <th>Producto</th><th> Precio </th><th> Cantidad</th><th> Precio final</th></tr></thead>`;\n for(item of carrito){\n tablaCarrito = tablaCarrito + `<tr> \n <td> ${item.numeroItem+1} </td> \n <td> ${item.producto.nombreProducto} </td> \n <td> $ ${item.producto.precioProducto},00 </td> \n <td> ${item.cantidad} </td> \n <td> $ ${item.precioItem},00</td>\n </tr>`;\n total = total + item.precioItem;\n }\n\n $(\".modal-body_js\").append(tablaCarrito);\n $(\".h3__total\").html(\"Total carrito: $ \"+total+\",00\");\n $(\".h3__total\").show();\n \n }\n else{\n $(\".modal-title\").html(\"No hay productos en el carrito.\");\n $(\".h3__total\").hide();\n $(\".botonProcesarCompra\").hide(); \n \n }\n}", "function precioTotal() {\n let total = 0;\n const precioTot = document.querySelector('.totpre');\n\n const todos = document.querySelectorAll('.agregado'); \n\n todos.forEach(tr => { \n const selectPrecio = tr.querySelector('.monto');\n const soloPrecio = Number(selectPrecio.textContent.replace('$',''));\n const cantidad = tr.querySelector('.input');\n const valorCantidad = Number(cantidad.value);\n\n total = total + soloPrecio * valorCantidad;\n });\n\n precioTot.innerHTML = `${total}`;\n}", "function displayProducts() {\n connection.query(`\n SELECT item_id, product_name, price \n FROM products \n WHERE stock_quantity > 0`, (err, response) => {\n if(err) console.log(chalk.bgRed(err));\n response.forEach(p => p.price = `$ ${p.price.toFixed(2)}`);\n console.table(response);\n // connection.end();\n start();\n });\n}", "function APIObtenerProcedimientos(TipOsId, OsId) {\n return new Promise((resolve, reject) => {\n setTimeout(()=>{\n var procedimientos = [];\n var query = `select true as Acreditado, 1.00 as Cantidad, ACTASISTID as Codigo, 1 as CodigoAutorizacion,\n false as CodigoEstadoTransaccion, ifnull(EMPRUC, 0) as CuitProfesionalResponsable, OSfChHOR as Fecha, OSfChHOR as FechaGestion,\n false as HabilitaAjusteCargos, R.ROLID as IdEspecialidadResponsable, 0.00 as MontoIVAFinan, 0.00 as MontoIVAPaciente,\n 0.00 as MontoNetoFinan, 0.00 as MontoNetoPaciente, 0.00 as MontoTarifa, 0.00 as MontoTotalFinan, 0.00 as MontoTotalPaciente,\n 0.00 as PorcentajeCobertura, 0.00 as PorcentajePaciente, false as RequiereAutorizacion, 'P' as Tipo, true as Vigencia\n from os o\n left join rrhh rh on o.osrrhhid = rh.rrhhid\n left join osindicact oi on o.tiposid = oi.tiposid and o.osid = oi.osid\n left join actasist a on a.actasistid = oi.osindicactactasistid\n left join plancom pc on o.osplancomid = pc.plancomid\n left join roles r on o.osrolid = r.rolid\n left join estos e on e.EstOSId = o.OSUltEstOsId\n left join empresas em on em.empid = rh.empid\n left join persplan pl on pl.persplanpersid = o.ospersid and pl.persplanplancomid = pc.plancomid\n left join prestadores p on pl.persplanprestid = p.prestid and o.ospersprestorigid = p.prestid\n left join tipcontrat tc on tc.tipcontratid = pl.persplantipcontratid\n left join sectores s on o.ossectid = s.sectid\n where PrestSistExtId != ''\n and o.tiposid = ${TipOsId} and o.osid = ${OsId};`;\n conectarTunel().then((conexion) => {\n conexion.query(query, (error, resultado) => {\n if(error) {\n reject(`Hubo un problema consultando los consumos: ${error}`);\n conexion.end();\n } else {\n var response = {\n 'resultadoProdecimientos': JSON.parse(JSON.stringify(resultado))\n }\n response.resultadoProdecimientos.forEach(procedimiento => {\n procedimientos.push(procedimiento);\n });\n resolve(procedimientos);\n conexion.end();\n }\n });\n }).catch((err) => {\n reject(`Hubo un error conectando la BD GEOSalud ${err}`);\n conexion.end();\n });\n \n }, 100);\n });\n}", "function tablaresultadosproducto(limite)\r\n{\r\n var controlador = \"\";\r\n var parametro = \"\";\r\n var categoriatext = \"\";\r\n var estadotext = \"\";\r\n var categoriaestado = \"\";\r\n var base_url = document.getElementById('base_url').value;\r\n //al inicar carga con los ultimos 50 productos\r\n if(limite == 1){\r\n controlador = base_url+'producto/buscarproductosexistmin/';\r\n // carga todos los productos de la BD \r\n }else{\r\n controlador = base_url+'producto/buscarproductosexistmin/';\r\n var categoria = document.getElementById('categoria_id').value;\r\n var estado = document.getElementById('estado_id').value;\r\n if(categoria == 0){\r\n categoriaestado = \"\";\r\n }else{\r\n categoriaestado = \" and p.categoria_id = cp.categoria_id and p.categoria_id = \"+categoria+\" \";\r\n categoriatext = $('select[name=\"categoria_id\"] option:selected').text();\r\n categoriatext = \"Categoria: \"+categoriatext;\r\n }\r\n if(estado == 0){\r\n categoriaestado += \"\";\r\n }else{\r\n categoriaestado += \" and p.estado_id = \"+estado+\" \";\r\n estadotext = $('select[name=\"estado_id\"] option:selected').text();\r\n estadotext = \"Estado: \"+estadotext;\r\n }\r\n \r\n $(\"#busquedacategoria\").html(categoriatext+\" \"+estadotext);\r\n \r\n parametro = document.getElementById('filtrar').value;\r\n }\r\n \r\n document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n \r\n\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro, categoriaestado:categoriaestado},\r\n success:function(respuesta){ \r\n \r\n \r\n $(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n var color = \"\";\r\n \r\n if (registros != null){\r\n var formaimagen = document.getElementById('formaimagen').value;\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#encontrados\").val(\"- \"+n+\" -\");\r\n html = \"\";\r\n for (var i = 0; i < n ; i++){\r\n \r\n \r\n if (Number(registros[i]['existencia'])>0){\r\n color = \"\"; \r\n }else{ \r\n color = \"style='background-color: #ffffff; '\";\r\n }\r\n\r\n \r\n html += \"<tr \"+color+\">\";\r\n \r\n html += \"<td style='padding:0;'>\"+(i+1)+\"</td>\";\r\n html += \"<td style='padding:0;'>\";\r\n html += registros[i]['producto_nombre'];\r\n \r\n html += \"</td>\";\r\n \r\n html += \"<td style='padding:0;'>\"+registros[i]['producto_codigo']+\"</td>\";\r\n html += \"<td style='text-align: center;'><font size='2'><b>\"+Number(registros[i]['existencia']).toFixed(2)+\"</b></font></td>\";\r\n html += \"<td style='padding:0;'>\"+Number(registros[i]['producto_ultimocosto']).toFixed(2)+\"</td>\";\r\n html += \"<td style='padding:0;'>\"+registros[i]['moneda_descripcion']+\"</td>\";\r\n html += \"<td style='padding:0;'>\"+registros[i]['categoria_nombre']+\"</td>\";\r\n html += \"<td style='padding:0;' class='no-print'><button class='btn btn-info btn-xs' onclick='mostrar_historial(\"+registros[i]['producto_id']+\")'><fa class='fa fa-users'></fa> proveedores</button> </td>\";\r\n \r\n \r\n html += \"</tr>\";\r\n\r\n }\r\n \r\n \r\n $(\"#tablaresultados\").html(html);\r\n document.getElementById('loader').style.display = 'none';\r\n }\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader\r\n },\r\n error:function(respuesta){\r\n // alert(\"Algo salio mal...!!!\");\r\n html = \"\";\r\n $(\"#tablaresultados\").html(html);\r\n },\r\n complete: function (jqXHR, textStatus) {\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader \r\n //tabla_inventario();\r\n }\r\n \r\n }); \r\n\r\n}", "function mostrarDatosProducto(producto){\n let transaccion = obtenerTransaccionInicial(producto.getCodigo());\n let datosProducto = [obtenerInputsIdsProducto(),producto.fieldsToArray()];\n let datosTransaccion = [obtenerInputsIdsTransaccion(),transaccion.fieldsToArray()];\n fillFields(datosProducto);\n fillFields(datosTransaccion);\n htmlValue('inputEditar', 'EDICION');\n htmlDisable('txtCodigo');\n htmlDisable('btnAgregarNuevo', false);\n}", "function cargarValorNetoYCalcularTotalProductoSeleccionadoAlCambiarProducto(idSelectProducto){\n\t$(idSelectProducto).change(function(){\n\t\tcargarValorNetoYCalcularTotalProductoSeleccionado(idSelectProducto);\n\t});\n}", "function obtenerValoresMecanicos(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_mecanicos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_mecanicos\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_lv_valor_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function mostrarPaqueteDeOpciones(cliente) {\n return autosDB.filter(auto => (clientePuedePagar(cliente, auto) && !auto.vendido))\n}", "obtenerFincasProductor(id) {\n return axios.get(`${API_URL}/v1/reportefincaproductor/${id}`);\n }", "function ordenarProductosPrecio(productos, orden){\n\n //creo una variable donde se van a cagar los productos por orden de precio\n\n //variable de menor a mayor\n let productosOrdenPrecioAsc = [];\n //variable de mayor a menor\n let productosOrdenPrecioDesc = [];\n\n //guardamos una copia del array de productos traidos del json\n\n let productosCopia = productos.slice();\n\n // creo una variable que va a ser un array con solo los precios de cada producto, la cargamos mediante un map\n \n let arrayProductosOrdenPrecio = productosCopia.map((producto) => {return producto.precio} );\n\n //ordeno el array con los precios\n \n let comparar = (a,b) => {return a - b};\n \n arrayProductosOrdenPrecio.sort(comparar);\n\n // recorro el array con los precios de los productos en orden\n\n for(precio of arrayProductosOrdenPrecio){\n \n //guardo el indice donde se encuentra el producto que coincide con el precio del array con precios ordenados\n\n let indice = productosCopia.findIndex( (productoCopia) => { if(productoCopia.precio==precio){ \n\n return productoCopia \n\n } } );\n\n //guardo en el array de productos por orden de precio que cree al principio de la funcion, el producto del array que coincida con el indice\n\n //mayor a menor\n productosOrdenPrecioDesc.unshift(productosCopia[indice]);\n //menor a mayor\n productosOrdenPrecioAsc.push(productosCopia[indice]);\n\n /*Luego de guardarlo, elimino ese producto del array copia ya que \n el metodo findIndex devuelve el indice del primer elemto que coincida y si hay productos con la misma fecha\n se va a guardar siempre el primero que encuentre (resumen: lo elimino para que no se guarden elementos repetidos)*/\n\n productosCopia.splice(indice,1);\n \n }\n\n //retornamos el nuevo array de productos ordenados por precio \n\n if(orden == \"asc\"){\n\n return productosOrdenPrecioAsc;\n\n }\n\n if(orden == \"des\"){\n\n return productosOrdenPrecioDesc;\n\n }\n\n if(orden != \"asc\" && orden != \"des\"){\n\n console.log(\"ingrese correctamente el parametro indicador del ordenamiento por precio\");\n\n }\n \n\n}", "function ResumenOrden()\r\n\t{\r\n\t var buffer = '';\r\n\t \r\n\t if (_orden.length == 0)\r\n\t {\r\n\t \t$(\"#search\").focus();\r\n\t }\r\n\t \r\n\t buffer += '<h1 class=\"titulo_resumen\">Resumen de la orden</h1>';\r\n\t \r\n\t \r\n\t buffer += '<table class=\"table\" id=\"seleccion_producto\">';\r\n\t var contadorMonto=0;\r\n\t var SimboloMoneda = $(\"#Moneda\").val();\r\n\t _total_adicionales=0;\r\n\t for (x in _orden)\r\n\t {\r\n\t \t\r\n\t var adicionales = '';\r\n\t if (_orden[x].adicionales.length > 0) {\r\n\t \t\r\n\t adicionales += '<b>Agregar:</b>';\r\n\t \r\n\t adicionales += '<ul>';\t \r\n\t for (y in _orden[x].adicionales) {\r\n\t \t\r\n\t \tadicionales += \"<li>\" + _orden[x].adicionales[y].item + \" \"+SimboloMoneda +\" \"+ _orden[x].adicionales[y].precio+\"</li>\";\r\n\t \t_total_adicionales += parseFloat(_orden[x].adicionales[y].precio);\r\n\t }\t \r\n\t adicionales += '</ul>';\r\n\r\n\t }\r\n\t \r\n\t var quitar = '';\t \r\n\t if (_orden[x].ingredientes.length > 0) {\r\n\t quitar += '<b>Quitar:</b>';\r\n\t quitar += '<ul>';\r\n\t \r\n\t for (y in _orden[x].ingredientes) {\r\n\t quitar += '<li>' + _orden[x].ingredientes[y].nombre_m + '</li>';\r\n\t }\t \r\n\t quitar += '</ul>';\t \r\n\t }\r\n\r\n\t var nota = '';\t \r\n\t if (_orden[x].llevar.abc==\"1\") {\t \t\r\n\t nota += '<b>Nota:</b>';\r\n\t nota += '<ul>';\r\n\t \r\n\t for (y in _orden[x].llevar) {\r\n\t nota += '<li>Para Llevar</li>';\r\n\t }\t \r\n\t nota += '</ul>';\t \r\n\t }\r\n\t \r\n\t contadorMonto += parseFloat(_orden[x].precio);\r\n\t buffer += '<tr ID_orden=\"' + x + '\">';\r\n\t buffer += '<td>' + (parseInt(x)+1) + '</td>';\r\n\t buffer += '<td><div style=\"color:blue;font-weight:bold;\">' + _orden[x].detalle + '</div><div>' + adicionales + '</div><div>' + quitar + nota+ '</div></td>';\r\n\t buffer += '<td>' +SimboloMoneda +' '+ _orden[x].precio + '</td>';\r\n\t buffer += '<td><button class=\"btn_eliminar_pedido\">Eliminar</button></td>';\r\n\t buffer += '</tr>';\r\n\t \r\n\t }\t \r\n\t buffer += '<tr><td>#</td><td></td><td>Total = '+ SimboloMoneda+' '+ (contadorMonto+_total_adicionales)+'</td><td></td></tr>';\r\n\t buffer += '</table>';\r\n\t \r\n\t \r\n\t //_orden[x].precio;\r\n\r\n\t if($(\"#resumen\").html() != \"\"){\r\n\t \t$(\"#scroller\").show();\r\n\t \t$(\"#resumen\").empty();\r\n\t }else{\r\n\t \t$(\"#resumen\").html(buffer);\r\n\t \t$(\"#scroller\").hide();\r\n\t }\t \r\n\t}", "function GetProducts (req,res){\n const query =`\nSELECT P.prodId,P.prodNombre,P.prodDescripcion,P.prodPrecio,P.prodFechaCreacion,P.prodCantidad,U.uniNombre,C.catNombre,PR.preNombre,M.marNombre,US.usuNombre,US.usuApellido,PO.proNombre FROM productos P\nINNER JOIN unidades U ON P.prodIdUnidad=U.uniId\nINNER JOIN categorias C ON P.prodIdCategoria=C.catId\nINNER JOIN presentaciones PR ON P.prodIdPresentacion=PR.preId\nINNER JOIN marcas M ON P.prodIdMarca=M.marId\nINNER JOIN usuarios US ON P.prodIdUsuario=US.usuId\nINNER JOIN proveedores PO ON M.marIdProv=PO.proId\n;\n `;\n mysqlConn.query(query, (err,rows,fields) =>{\n if(!err){\n if(rows.length > 0){\n var productos = rows;\n res.json(productos);\n }else{\n res.json({status:\"No se encontraron productos\"});\n }\n }else{\n console.log(err);\n };\n });\n}", "function busca(busca) {\n $.ajax({\n type: \"POST\",\n url: \"acoes/select.php\",\n dataType: \"json\",\n data: {//tipo de dado\n 'busca':\"busca\"//botão pra inicia a ação\n }\n\n }).done(function (resposta) { //receber a resposta do busca\n console.log('encontrei ' + resposta.quant + ' registros');\n console.log(resposta.busca[0,'0'].id, resposta.busca[0,'0'].descri);\n if(resposta.erros){\n\n //criação das variaves apos o receber a resposta da pagina select\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qntp = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var st = resposta.busca[i]['9']\n //criação da tabela para exebição do resultado\n $('.carro td.descri').append(\" <tr><td ><p class=' text-capitalize id='des' value='\"+desc+\"'>\"+desc +'</p></td></tr>')\n $('.carro td.marca').append(\" <tr><td ><p class=' text-capitalize id='mar' value='\"+mar+\"'>\"+mar +'</p></td></tr>')\n $('.carro td.modelo').append(\" <tr><td ><p class=' text-capitalize id='mod' value='\"+mod+\"'>\"+mod +'</p></td></tr>')\n $('.carro td.tipov').append(\" <tr><td ><p class=' text-capitalize id='tpv' value='\"+tpv+\"'>\"+tpv +'</p></td></tr>')\n $('.carro td.quantp').append(\" <tr><td ><p class=' text-capitalize id='qnt' value='\"+qntp+\"'>\"+qntp +'</p></td></tr>')\n $('.carro td.vlvenda').append(\" <tr><td ><p class=' text-capitalize id='vlv' value='\"+vlv+\"'>\"+vlv +'</p></td></tr>')\n $('.carro td.vlcompra').append(\" <tr><td ><p class=' text-capitalize id='vlc' value='\"+vlc+\"'>\"+vlc +'</p></td></tr>')\n $('.carro td.dtcompra').append(\" <tr><td ><p class=' text-capitalize id='dtc' value='\"+dtc+\"'>\"+dtc +'</p></td></tr>')\n $('.carro td.estato').append(\" <tr><td ><p class=' text-capitalize id='st' value='\"+st+\"'>\"+st +'</p></td></tr>')\n $('.carro td.id').append(\" <tr><td ><button class='r btn btn-sm btn-primary nav-link' id='idvalor' type='button' data-toggle='modal' data-target='#atualFormulario' value='\"+id+\"'>\"+\"Edit\"+'</button></td></tr>')\n $('.carro td.ider').append(\"<tr><td ><button class='del btn btn-sm btn-danger nav-link' type='button' name='idel' value='\"+id+\"'>\"+\"Del\"+'</button></td></tr>')\n\n\n }\n\n\n //função pra por valores da tabela no input do formulario de atualização\n //aqui insere os o ID no formulario de atualização\n $('.r').click('button',function() {\n var idvl = $(this).val();\n $('#i1'). val(idvl);\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qnt = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var sta = resposta.busca[i]['9']\n //aqui comparamos o valor que recuperamos o id da tabela e comparfamos com o id da função busca\n if (idvl==id) {\n $('#descri1'). val(desc);\n $('#marca1'). val(mar);\n $('#modelo1'). val(mod);\n $('#tipov1'). val(tpv);\n $('#quantp1'). val(qnt);\n $('#vlvenda1'). val(vlv);\n $('#vlcompra1'). val(vlc);\n $('#dtcompra1'). val(dtc);\n $('#estato1'). val(sta);\n console.log(idvl);\n\n }\n\n\n\n\n\n }\n })\n //aqui finda\n\n //deleta via ajax\n $('.del').click('button',function() {\n var idel = $(this).val();\n console.log(idel);\n $.ajax({\n url: \"acoes/del.php\",\n type: \"POST\",\n data : { 'idel': idel },\n success: function(data)\n {\n location.reload(\".carro\");//atualiza o contener apos a execução com sucesso\n }\n });\n }); // delete close\n\n\n }\n })\n }", "function obtenerValoresManiobras(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_maniobras WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 76; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_maniobras\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_maniobras_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function CarregaPrimeiroSelect () {\n let select = document.querySelector(\"#produtosVenda > div > div.div-2 > select\");\n let options = criaOptionSelectVenda(produtos)\n options.forEach(element => {\n select.appendChild(element)\n })\n}", "function somaProdutos(){\n\tvalores = jQuery(\".valorProduto\").text();\n\tarrayValores = valores.split(\"R$\");\n\tqtdValores = (arrayValores.length) - 1;\n\tsoma = 0;\t\n\tfor(i = 1; i <= qtdValores; i++){\n\t\tarrayValores[i] = parseFloat(arrayValores[i]);\n\t\tsoma += arrayValores[i];\n\t}\n\t\n\tif(jQuery(\"select[name='custeio']\").val() == \"50% Loja e 50% DMcard\")\n\t{\n\t\tsoma=soma/2;\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"\");\n\t\t\n\t}else if(jQuery(\"select[name='custeio']\").val() == \"100% Loja\")\n\t{\n\t\tsoma = 0;\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"Sem Forma de Pagamento\");\n\t\t\n\t}else if(jQuery(\"select[name='custeio']\").val() == \"100% DMcard\")\n\t{\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"\");\n\t}\n\t\n\tjQuery(\".valorTotal span\").text(\"R$\" + soma.toFixed(2));\n\tjQuery(\"input[name='valorTotal']\").val(soma.toFixed(2));\n}", "function tablaresultadosproducto(limite)\r\n{\r\n var controlador = \"\";\r\n var parametro = \"\";\r\n var categoriatext = \"\";\r\n var estadotext = \"\";\r\n var categoriaestado = \"\";\r\n var base_url = document.getElementById('base_url').value;\r\n var parametro_modulo = document.getElementById('parametro_modulorestaurante').value;\r\n var tipousuario_id = document.getElementById('tipousuario_id').value;\r\n //var lapresentacion = JSON.parse(document.getElementById('lapresentacion').value);\r\n //al inicar carga con los ultimos 50 productos\r\n if(limite == 1){\r\n controlador = base_url+'producto/buscarproductoslimit/';\r\n // carga todos los productos de la BD \r\n }else if(limite == 3){\r\n controlador = base_url+'producto/buscarproductosall/';\r\n // busca por categoria\r\n }else{\r\n controlador = base_url+'producto/buscarproductos/';\r\n var categoria = document.getElementById('categoria_id').value;\r\n var estado = document.getElementById('estado_id').value;\r\n if(categoria == 0){\r\n categoriaestado = \"\";\r\n }else{\r\n categoriaestado = \" and p.categoria_id = cp.categoria_id and p.categoria_id = \"+categoria+\" \";\r\n categoriatext = $('select[name=\"categoria_id\"] option:selected').text();\r\n categoriatext = \"Categoria: \"+categoriatext;\r\n }\r\n if(estado == 0){\r\n categoriaestado += \"\";\r\n }else{\r\n categoriaestado += \" and p.estado_id = \"+estado+\" \";\r\n estadotext = $('select[name=\"estado_id\"] option:selected').text();\r\n estadotext = \"Estado: \"+estadotext;\r\n }\r\n \r\n $(\"#busquedacategoria\").html(categoriatext+\" \"+estadotext);\r\n \r\n parametro = document.getElementById('filtrar').value;\r\n }\r\n \r\n document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n \r\n\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro, categoriaestado:categoriaestado},\r\n success:function(respuesta){ \r\n \r\n \r\n //$(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n \r\n if (registros != null){\r\n var formaimagen = document.getElementById('formaimagen').value;\r\n \r\n /*var cont = 0;\r\n var cant_total = 0;\r\n var total_detalle = 0; */\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#encontrados\").html(\"Registros Encontrados: \"+n+\" \");\r\n html = \"\";\r\n for (var i = 0; i < n ; i++){\r\n// html += \"<td>\";\r\n var caracteristica = \"\";\r\n if(registros[i][\"producto_caracteristicas\"] != null){\r\n caracteristica = \"<div style='word-wrap: break-word;'>\"+registros[i][\"producto_caracteristicas\"]+\"</div>\";\r\n }\r\n// html+= caracteristica+\"</td>\"; \r\n \r\n html += \"<tr>\";\r\n \r\n html += \"<td>\"+(i+1)+\"</td>\";\r\n html += \"<td>\";\r\n html += \"<div id='horizontal'>\";\r\n html += \"<div id='contieneimg'>\";\r\n var mimagen = \"\";\r\n if(registros[i][\"producto_foto\"] != null && registros[i][\"producto_foto\"] !=\"\"){\r\n mimagen += \"<a class='btn btn-xs' data-toggle='modal' data-target='#mostrarimagen\"+i+\"' style='padding: 0px;'>\";\r\n mimagen += \"<img src='\"+base_url+\"resources/images/productos/thumb_\"+registros[i][\"producto_foto\"]+\"' class='img img-\"+formaimagen+\"' width='50' height='50' />\";\r\n mimagen += \"</a>\";\r\n //mimagen = nomfoto.split(\".\").join(\"_thumb.\");77\r\n }else{\r\n mimagen = \"<img src='\"+base_url+\"resources/images/productos/thumb_image.png' class='img img-\"+formaimagen+\"' width='50' height='50' />\";\r\n }\r\n html += mimagen;\r\n html += \"</div>\";\r\n html += \"<div style='padding-left: 4px'>\";\r\n html += \"<b id='masgrande'><font size='3' face='Arial'><b>\"+registros[i][\"producto_nombre\"]+\"</b></font></b><br>\";\r\n html += \"\"+registros[i][\"producto_unidad\"]+\" | \"+registros[i][\"producto_marca\"]+\" | \"+registros[i][\"producto_industria\"]+\"\";\r\n if(registros[i][\"destino_id\"] > 0){\r\n html +=\"<br><b>DESTINO:</b> \"+registros[i]['destino_nombre'];\r\n }\r\n if(parametro_modulo == 2){\r\n html +=\"<br>Principio Activo: \"+registros[i]['producto_principioact'];\r\n html +=\"<br>Acción Terapeutica: \"+registros[i]['producto_accionterap'];\r\n }\r\n \r\n html += caracteristica;\r\n html += \"\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</td>\";\r\n var escategoria=\"\";\r\n if(registros[i][\"categoria_id\"] == null || registros[i][\"categoria_id\"] == 0 || registros[i][\"categoria_id\"] ==\"\"){\r\n escategoria = \"No definido\";\r\n }else{\r\n escategoria = registros[i][\"categoria_nombre\"];\r\n }\r\n var esmoneda=\"\";\r\n if(registros[i][\"moneda_id\"] == null || registros[i][\"moneda_id\"] == 0 || registros[i][\"moneda_id\"] == \"\"){ \r\n esmoneda = \"No definido\";\r\n }else{\r\n esmoneda = registros[i][\"moneda_descripcion\"];\r\n }\r\n html += \"<td><b>CATEGORIA: </b>\"+escategoria+\"<br><b>UNIDAD: </b>\"+registros[i][\"producto_unidad\"]+\"<br>\";\r\n html += \"<b>CANT. MIN.: </b>\";\r\n var cantmin= 0;\r\n if(registros[i][\"producto_cantidadminima\"] != null || registros[i][\"producto_cantidadminima\"] ==\"\"){\r\n cantmin = registros[i][\"producto_cantidadminima\"];\r\n }\r\n html += cantmin+\"</td>\";\r\n\r\n html += \"<td>\";\r\n var sinconenvase = \"\";\r\n var nombreenvase = \"\";\r\n var costoenvase = \"\";\r\n var precioenvase = \"\";\r\n if(registros[i][\"producto_envase\"] == 1){\r\n sinconenvase = \"Con Envase Retornable\"+\"<br>\";\r\n if(registros[i][\"producto_nombreenvase\"] != \"\" || registros[i][\"producto_nombreenvase\"] != null){\r\n nombreenvase = registros[i][\"producto_nombreenvase\"]+\"<br>\";\r\n costoenvase = \"Costo: \"+Number(registros[i][\"producto_costoenvase\"]).toFixed(2)+\"<br>\";\r\n precioenvase = \"Precio: \"+Number(registros[i][\"producto_precioenvase\"]).toFixed(2);\r\n }\r\n }else{\r\n sinconenvase = \"Sin Envase Retornable\";\r\n }\r\n html += sinconenvase;\r\n html += nombreenvase;\r\n html += costoenvase;\r\n html += precioenvase;\r\n html += \"</td>\";\r\n var codbarras = \"\";\r\n if(!(registros[i][\"producto_codigobarra\"] == null)){\r\n codbarras = registros[i][\"producto_codigobarra\"];\r\n }\r\n html += \"<td>\"+registros[i][\"producto_codigo\"]+\"<br>\"+ codbarras +\"</td>\";\r\n html += \"<td>\";\r\n if(tipousuario_id == 1){\r\n html += \"<b>COMPRA: </b>\"+registros[i][\"producto_costo\"]+\"<br>\";\r\n }\r\n html += \"<b>VENTA: </b>\"+registros[i][\"producto_precio\"]+\"<br>\";\r\n html += \"<b>COMISION (%): </b>\"+registros[i][\"producto_comision\"];\r\n html += \"</td>\";\r\n html += \"<td><b>MONEDA: </b>\"+esmoneda+\"<br>\";\r\n html += \"<b>T.C.: </b>\";\r\n var tipocambio= 0;\r\n if(registros[i][\"producto_tipocambio\"] != null){ tipocambio = registros[i][\"producto_tipocambio\"]; }\r\n html += tipocambio+\"</td>\";\r\n html += \"<td class='no-print' style='background-color: #\"+registros[i][\"estado_color\"]+\"'>\"+registros[i][\"estado_descripcion\"]+\"</td>\";\r\n\t\t html += \"<td class='no-print'>\";\r\n html += \"<a href='\"+base_url+\"producto/edit/\"+registros[i][\"miprod_id\"]+\"' target='_blank' class='btn btn-info btn-xs' title='Modificar Información'><span class='fa fa-pencil'></span></a>\";\r\n html += \"<a href='\"+base_url+\"imagen_producto/catalogoprod/\"+registros[i][\"miprod_id\"]+\"' class='btn btn-success btn-xs' title='Catálogo de Imagenes' ><span class='fa fa-image'></span></a>\";\r\n html += \"<a class='btn btn-danger btn-xs' data-toggle='modal' data-target='#myModal\"+i+\"' title='Eliminar'><span class='fa fa-trash'></span></a>\";\r\n html += \"<a href='\"+base_url+\"producto/productoasignado/\"+registros[i][\"miprod_id\"]+\"' class='btn btn-soundcloud btn-xs' title='Ver si esta asignado a subcategorias' target='_blank' ><span class='fa fa-list'></span></a>\";\r\n html += \"<!------------------------ INICIO modal para confirmar eliminación ------------------->\";\r\n html += \"<div class='modal fade' id='myModal\"+i+\"' tabindex='-1' role='dialog' aria-labelledby='myModalLabel\"+i+\"'>\";\r\n html += \"<div class='modal-dialog' role='document'>\";\r\n html += \"<br><br>\";\r\n html += \"<div class='modal-content'>\";\r\n html += \"<div class='modal-header'>\";\r\n html += \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>x</span></button>\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-body'>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"<h3><b> <span class='fa fa-trash'></span></b>\";\r\n html += \"¿Desea eliminar el Producto <b> \"+registros[i][\"producto_nombre\"]+\"</b> ?\";\r\n html += \"</h3>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-footer aligncenter'>\";\r\n html += \"<a href='\"+base_url+\"producto/remove/\"+registros[i][\"miprod_id\"]+\"' class='btn btn-success'><span class='fa fa-check'></span> Si </a>\";\r\n html += \"<a href='#' class='btn btn-danger' data-dismiss='modal'><span class='fa fa-times'></span> No </a>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<!------------------------ FIN modal para confirmar eliminación ------------------->\";\r\n html += \"<!------------------------ INICIO modal para MOSTRAR imagen REAL ------------------->\";\r\n html += \"<div class='modal fade' id='mostrarimagen\"+i+\"' tabindex='-1' role='dialog' aria-labelledby='mostrarimagenlabel\"+i+\"'>\";\r\n html += \"<div class='modal-dialog' role='document'>\";\r\n html += \"<br><br>\";\r\n html += \"<div class='modal-content'>\";\r\n html += \"<div class='modal-header'>\";\r\n html += \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>x</span></button>\";\r\n html += \"<font size='3'><b>\"+registros[i][\"producto_nombre\"]+\"</b></font>\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-body'>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"<img style='max-height: 100%; max-width: 100%' src='\"+base_url+\"resources/images/productos/\"+registros[i][\"producto_foto\"]+\"' />\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"</div>\";\r\n\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<!------------------------ FIN modal para MOSTRAR imagen REAL ------------------->\";\r\n html += \"</td>\";\r\n \r\n html += \"</tr>\";\r\n\r\n }\r\n \r\n \r\n $(\"#tablaresultados\").html(html);\r\n document.getElementById('loader').style.display = 'none';\r\n }\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader\r\n },\r\n error:function(respuesta){\r\n // alert(\"Algo salio mal...!!!\");\r\n html = \"\";\r\n $(\"#tablaresultados\").html(html);\r\n },\r\n complete: function (jqXHR, textStatus) {\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader \r\n //tabla_inventario();\r\n }\r\n \r\n }); \r\n\r\n}", "async parametroFormasPagamento(req, res) {\n\n const parametroFormaPagamento = await db.query(\"SELECT cod_parametro_forma_pagamento, descricao FROM parametro_forma_pagamento WHERE status = 0\");\n return res.json(parametroFormaPagamento.rows)\n\n }", "function botonCalcular(event) {\n event.preventDefault();\n\n let subtotalCamisa = camisaEvento.value * valorCamisa;\n let totalCamisa = subtotalCamisa - (subtotalCamisa * 0.07);\n\n let totalEtiqueta = etiquetaEvento.value * valorEtiquetas;\n let oculto = document.querySelector('#totalPagado');\n\n let paseTotalDia = campoDia.value * paseDia;\n let paseTotalCompleto = campoCompleto.value * paseCompleto;\n let paseTotalDos = campoDos.value * paseDos;\n\n\n if (regalo.value == \"\" || undefined ) {\n errorRegalo.innerHTML = 'Debes escoger un regalo!!!'\n errorRegalo.style.visibility = \"visible\"\n regalo.focus();\n } else {\n errorRegalo.style.visibility = \"hidden\"\n let totalReserva = paseTotalCompleto + paseTotalDia + paseTotalDos + totalCamisa + totalEtiqueta;\n\n sumaTotal.innerHTML = `$ ${totalReserva.toFixed(2)}`;\n oculto.value = totalReserva;\n }\n \n \n let resumenProductos = [];\n\n if (campoDia.value >= 1) {\n resumenProductos.push(`${campoDia.value} Boletos de un dia`)\n }\n if (campoDos.value >= 1) {\n resumenProductos.push(`${campoDos.value} Boletos de dos dias`)\n }\n if (campoCompleto.value >= 1) {\n resumenProductos.push(`${campoCompleto.value} Boletos de todos los dias`)\n }\n if (camisaEvento.value >= 1) {\n resumenProductos.push(`${camisaEvento.value} Camisas del evento`)\n }\n if (etiquetaEvento.value >= 1) {\n resumenProductos.push(`${etiquetaEvento.value} etiquetas del evento `)\n }\n\n if(regalo.value !== \"\"){\n resumenProductos.push(`${regalo.value} es el regalo`)\n }\n\n listaProductos.innerHTML = '';\n\n resumenProductos.forEach(element => {\n if (regalo.value !== \"\") {\n listaProductos.innerHTML += `${element} </br>`\n } else {\n errorRegalo.innerHTML = 'Debes escoger un regalo!!!'\n errorRegalo.style.visibility = \"visible\"\n regalo.focus();\n }\n })\n //si no le agregamos el += solo nos imprimira un solo elemento, ademas debemos inicializar listaProductos.innerHTML = ''; \n // vacio, ya que si no lo hacemos de esta manera, se sobre escribira el array\n\n botonRegistro.disabled = false;\n \n \n }", "function showRequisition (requisicion, table) {\n let productos = requisicion.productos;\n let numeroProductos = productos.length;\n let producto, tr;\n \n for (let i = 0; i < numeroProductos; i++) {\n producto = productos[i];\n\n tr = createRequisitionProduct (producto);\n table.appendChild(tr);\n }\n\n // crear la fila de las observaciones\n if (requisicion.observaciones != \"\") {\n producto = {\n product: requisicion.observaciones,\n cant: 1,\n unimed: \"p\",\n marcaSug: \"...\",\n enCamino: 0,\n entregado: 0,\n status: 0\n };\n \n let entregado = requisicion.observaciones.split(\"_\");\n entregado = entregado[entregado.length-1];\n if (entregado == \"entregado\") {\n producto.entregado = 1;\n producto.status = 1;\n }\n if (requisicion.comentarios != \"\") {\n producto.enCamino = 1;\n }\n \n tr = createRequisitionProduct (producto);\n table.appendChild(tr);\n }\n}", "function listar(ok,error){\n console.log(\"Funcionlistar DAO\")\n helper.query(sql,\"Maestro.SP_SEL_ENTIDAD_FINANCIERA\",[],ok,error)\n}", "function displayProductInfo(productData) {\n document.getElementById(\"product-section\").style.display='flex';\n //Titre de la page (Modèle + Nom du produit)\n document.getElementById(\"product__title\").textContent = \"Modèle \" + productData.name;\n //Référence du produit\n document.getElementById(\"product__id\").textContent = \"Réf. : \" + productData._id;\n //Adresse de l'image du produit\n document.getElementById(\"product__img\").src = productData.imageUrl;\n //Nom du produit\n document.getElementById(\"product__name\").textContent = productData.name; \n //Prix du produit \n document.getElementById(\"product__price\").textContent = productData.price/100 + \".00€\";\n //Description du produit\n document.getElementById(\"product__description\").textContent = productData.description;\n\n // ____________________ Affichage quantité, options et prix ____________________ \n \n // Choix quantité : création d'une liste déroulante de quantité à partir d'un tableau \n let selectQty = document.createElement(\"select\");\n selectQty.className = \"product__quantity--selector\";\n selectQty.id = \"product__quantity--selector\";\n document.getElementById(\"product__quantity\").appendChild(selectQty);\n let optionsQty = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"];\n\n for(let i = 0; i < optionsQty.length; i++) {\n let qty = optionsQty[i];\n let optionElement = document.createElement(\"option\");\n optionElement.textContent = qty;\n optionElement.value = qty;\n selectQty.appendChild(optionElement);\n }\n \n // Calcul et affichage du nouveau prix en fonction de la quantité sélectionnée \n let newPrice = document.createElement(\"p\");\n newPrice.className = \"qty__price\";\n newPrice.className = \"bold\";\n newPrice.textContent = \"Total : \" + productData.price / 100 + \".00€\";\n document.getElementById(\"new__price\").appendChild(newPrice);\n selectQty.addEventListener('change', updateNewPrice);\n\n // Fonction pour mettre à jour le prix affiché lorsque l'utilisateur modifie la quantité\n function updateNewPrice() {\n let qtyPrice = (parseInt(selectQty.value) * productData.price) / 100;\n newPrice.textContent = \"Total : \" + qtyPrice + \".00€\"; \n }\n\n // _______________________ AJOUT PRODUITS AU PANIER _______________________ \n\n // Event listener du bouton \"Ajouter au panier\"\n const btnAddToCart = document.getElementById(\"btn_addToCart\"); \n btnAddToCart.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Ne pas actualiser la page lors du clic \n\n // Création d'un objet contenant les infos du produit ajouté au panier\n let productToAdd = {\n product_img: productData.imageUrl,\n product_name: productData.name,\n product_id: productData._id,\n product_qty: parseInt(selectQty.value),\n product_price: productData.price / 100,\n product_newPrice: (parseInt(selectQty.value) * productData.price) / 100,\n }\n \n let cartProduct = JSON.parse(localStorage.getItem(\"cart\"));\n // Fonction pour ajouter (push) un productToAdd au localStorage (ajouter un produit au panier)\n const addToLocalStorage = () => {\n cartProduct.push(productToAdd);\n localStorage.setItem(\"cart\", JSON.stringify(cartProduct));\n }\n\n // Fonction pour afficher la popup \"produit ajouté au panier\" lorsque l'utilisateur a cliqué sur le bouton d'ajout au panier et que l'ajout a réussi \n const popUpProductAddedToCart = () => {\n document.getElementById(\"popupContainer\").style.display = \"flex\";\n document.getElementById(\"closePopup_icone\").addEventListener('click', () => {\n closePopupContainer();\n })\n }\n // Si panier vide \n if(cartProduct === null) {\n // Création d'un tableau (vide) et ajout (push) d'un nouvel objet productToAdd\n cartProduct = [];\n addToLocalStorage();\n // Affichage d'une popup \"produit ajouté au panier\"\n popUpProductAddedToCart();\n } else {\n let cartProduct2 = JSON.parse(localStorage.getItem(\"cart\"));\n for (let p in cartProduct2) {\n if(cartProduct2[p].product_id === productData._id){\n console.log(\"déjà présent\");\n // Calcul new qty \n console.log(cartProduct2[p].product_qty);\n // Ajouter nouveau produit avec quantité totale \n let productToAdd2 = {\n product_img: productData.imageUrl,\n product_name: productData.name,\n product_id: productData._id,\n product_qty: cartProduct2[p].product_qty + parseInt(selectQty.value),\n product_price: productData.price / 100,\n product_newPrice: ((cartProduct2[p].product_qty + parseInt(selectQty.value)) * productData.price) / 100,\n }\n console.log(productToAdd2);\n // Remove ancien produit du localStorage (celui qui était déjà présent dans le panier)\n cartProduct.splice([p], 1, productToAdd2);\n localStorage.setItem(\"cart\", JSON.stringify(cartProduct));\n productToPush = false;\n popUpProductAddedToCart();\n\n }else{\n productToPush = true;\n }\n }\n if(productToPush){\n addToLocalStorage();\n // Affichage d'une popup \"produit ajouté au panier\"\n popUpProductAddedToCart();\n }\n }\n })\n\n}", "function getProducto() {\n var codigo, cantidad, valor_unitario, descripcion;\n $(\"#tbBodyProducto tr\").each(function (index) {\n $(this).children(\"td\").each(function (index2) \n {\n switch (index2) \n {\n case 0: codigo = $(this).text();\n break;\n case 1: descripcion = $(this).text();\n break; \n case 2: cantidad = $(this).text();\n break; \n case 3: valor_unitario = $(this).text();\n break;\n }\n }); \n productos.push({codigo_producto: codigo, descripcion_producto: descripcion, cantidad: cantidad, valor_unitario: valor_unitario, compra_id: -1});\n });\n }", "function affichProduit(produit) {\n\tnomProduit.innerHTML = produit.name; //Affichage du nom du produit\n\tprixProduit.innerHTML = produit.price / 100 + \" €\"; //Affichage du prix du produit\n\timage.src = produit.imageUrl; //Affichage de l'image\n\tdescrProduit.innerHTML = produit.description; //Affichage de la description\n\n\t// Gestion des options (couleurs de vernis)\n\tfor(let option in produit.varnish) { // Pour chaque couleur de vernis, on crée une nouvelle option \n\t\tlet optionsVernis = document.createElement(\"option\");\n\t\tselectOptions.appendChild(optionsVernis);\n\t\toptionsVernis.innerHTML = produit.varnish[option];\n\t}\t\t\n}", "function CalcularTotal() {\n // Selecionar todas as linhas\n var produtos = document.querySelectorAll(\".Produ\");\n let total = 0;\n // Percorrer a lista de produtos\n for (var i = 0; i < produtos.length; i++) {\n\n // Recupera o produto no indice i da lista de produtos\n var produto = produtos[i];\n\n // pegando id\n var id = produto.querySelector(\".id\").textContent;\n\n // pegando quantidade\n var qtd = produto.querySelector(\".qtd\").textContent;\n\n total = total + parseFloat(produto.querySelector(\".valor\").textContent);\n }\n return total;\n }", "function obtenerValoresElementos(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_selecion FROM puertas_valores_elementos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_element_inspec\"+i+\"][value='\"+resultSet.rows.item(x).v_selecion+\"']\").prop(\"checked\",true);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "async function excuteSelectTotal() {\n try {\n const rows = await query('SELECT * FROM products');\n return rows;\n } catch (error) {\n console.log(error)\n }\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function ConsultaItemSelect(tx) { console.log(\"ConsultaItemSelect\");\n\t\t console.log('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado');\n\t\ttx.executeSql('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado', [], ConsultaLoadEstado,errorCB);\n\t\t console.log(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\");\n\t\ttx.executeSql(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\", [], ConsultaLineaCarga,errorCB);\n}", "function mostrarPeliculas(req, res) {\n // Guardamos los parametros enviados en la busqueda\n var pagina = req.query.pagina;\n var titulo = req.query.titulo;\n var genero = req.query.genero;\n var anio = req.query.anio;\n var cantidad = req.query.cantidad;\n var columna_orden = req.query.columna_orden;\n var tipo_orden = req.query.tipo_orden;\n\n // Modularizamos las queries\n var sqlInicial = `SELECT pelicula.id,\n pelicula.poster,\n pelicula.trama,\n pelicula.titulo\n FROM pelicula`;\n\n var sqlTitulo = 'titulo LIKE \"%' + titulo + '%\"';\n var sqlGenero = 'genero_id = \"' + genero + '\"';\n var sqlAnio = 'anio = ' + anio;\n\n // Verificamos los parametros enviados y armamos los filtros para la query\n var sqlFiltros = '';\n\n if(titulo || genero || anio) {\n sqlFiltros += ' WHERE ';\n if(titulo) {\n sqlFiltros += sqlTitulo;\n if(genero || anio) {\n sqlFiltros += ' AND ';\n }\n }\n if(genero) {\n sqlFiltros += sqlGenero;\n if(anio) {\n sqlFiltros += ' AND ';\n }\n }\n if(anio) {\n sqlFiltros += sqlAnio;\n }\n }\n\n // Definimos el objeto respuesta que se enviará al frontend\n var respuesta = {\n 'peliculas': null,\n 'total': null\n };\n\n // Creamos la query que calcula el total de peliculas encontradas aplicando los filtros\n var sqlTotalResultados = sqlInicial + sqlFiltros;\n\n conexion.query(sqlTotalResultados, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(404).send('Hubo un error en la consulta');\n }\n respuesta.total = resultado.length;\n });\n\n // Lógica para crear la paginacion segun los parametros enviados\n var paginacion = function(pagina, cantidad) {\n return ' LIMIT ' + ((pagina - 1) * 52) + ',' + cantidad;\n } \n\n // Creamos la query que devuelve las peliculas encontradas, ordenadas y paginadas\n var sql= sqlTotalResultados + ' ORDER BY ' + columna_orden + ' ' + tipo_orden + paginacion(pagina, cantidad);\n\n conexion.query(sql, function(error, resultado, campos) {\n console.log(sql);\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(404).send('Hubo un error en la consulta');\n } \n respuesta.peliculas = resultado;\n res.send(JSON.stringify(respuesta));\n });\n}", "cambio(){\n\n productos.forEach(producto => {\n if(producto.nombre === this.productoSeleccionado) this.productoActual = producto;\n });\n\n //Ver si el producto actual tiene varios precios\n if(this.productoActual.variosPrecios){\n //Verificar si sobrepasa algun precio extra\n\n //Si es menor al tope del primer precio\n if(this.cantidadActual < this.productoActual.precios.primerPrecio.hasta){\n this.precioActual = this.productoActual.precios.primerPrecio.precio;\n //Seteamos el precio tachado a 0 de nuevo\n this.precioPorUnidadTachado = 0;\n }\n //Si es mayor o igual al tope del primer precio pero menor al tope del segundo\n else if(this.cantidadActual >= this.productoActual.precios.primerPrecio.hasta && this.cantidadActual < this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.segundoPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n //Si es igual o mayor al tope del segundo precio\n else if(this.cantidadActual >= this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.tercerPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n }\n }", "function handlerFiltro(data) {\n let $selectFiltro = document.getElementById(\"filtro-animal\");\n let $promedioLabel = document.getElementById(\"promedio\");\n let $maximo = document.getElementById(\"maximo\");\n let $minimo = document.getElementById(\"minimo\");\n let $vacunados = document.getElementById(\"vacunados\");\n let aux = [];\n if ($selectFiltro.value == \"todos\") aux = data.articulos;\n else\n aux = data.articulos.filter(\n (articulo) => articulo.animal == $selectFiltro.value\n );\n $promedioLabel.innerText =\n aux.reduce(\n (promedio, articulo) => promedio + parseFloat(articulo.precio),\n 0\n ) / aux.length;\n $maximo.innerText = aux.reduce(\n (acc, value) => Math.max(acc, value.precio),\n aux[0].precio\n );\n $minimo.innerText = aux.reduce(\n (acc, value) => Math.min(acc, value.precio),\n aux[0].precio\n );\n $vacunados.innerText =\n (100 * aux.filter((articulo) => articulo.vacuna == \"si\").length) /\n aux.length;\n $vacunados.innerText += \"%\";\n}", "function recuperarLS_carrito_compra1() { // esta funcion tiene problemas de sincronizacion al mostrar la lista de productos comprados en adm_compras.php, al digitar la cantidad en los inputs se refleja en otras filas \n let productos, id_producto;\n productos = recuperarLS();\n funcion = 'buscar_id';\n productos.forEach(producto => {\n id_producto = producto.id;\n $.post('../controlador/ProductoController.php', {funcion, id_producto}, (response) => {\n let template_compra = '';\n let json = JSON.parse(response);\n template_compra = `\n <tr prodid=\"${producto.id}\" prodprecio=\"${json.precio}\">\n <td>${json.nombre}</td>\n <td>${json.stock}</td>\n <td class=\"precio\">${json.precio}</td>\n <td>${json.concentracion}</td>\n <td>${json.adicional}</td>\n <td>${json.laboratorio}</td>\n <td>${json.presentacion}</td>\n <td><input type=\"number\" min=\"1\" class=\"form-control cantidad_producto\" value=\"${producto.cantidad}\"></td>\n <td class=\"subtotales\"><h5>${(json.precio*producto.cantidad)}</h5></td>\n <td><button class=\"btn btn-danger borrar-producto\"><i class=\"fas fa-times-circle\"></i></button></td>\n </tr>\n `; \n $('#lista-compra').append(template_compra);\n });\n });\n }", "function APIObtenerConsumos(req, res) {\n const TipOsId = req.query.tiposid;\n const OsId = req.query.osid;\n var query = `select o.OSAmbito as Ambito, p.PrestCodInt as CoberturaID, ospersprestorigid, concat('LIQUIDACION;', now()) as CodigoOperacion,\n 1 as CodigoSede, ifnull (PrestNroTribut, 30546741253) as CuitEmpresa, ifnull (em.EMPRUC, o.OSRRHHDerivId) as CuitProfesionalSolicitante,\n OSfChHOR as FechaIndicacion, osrolid as IdEspecialidadSolicitante, o.osid as NumeroOrdenOriginal, '' as ObservacionesIndicacion,\n pp.PrestPlanPlanComSistExtId as PlanId, true as Acreditado, 1.00 as Cantidad, ACTASISTID as Codigo, a.ActAsistDesc as Practica, false as CodigoEstadoTransaccion,\n ifnull(em.EMPRUC, 0) as CuitProfesionalResponsable, OSfChHOR as Fecha, OSfChHOR as FechaGestion, false as HabilitaAjusteCargos, R.ROLID as IdEspecialidadResponsable,\n 0.00 as MontoIVAFinan, 0.00 as MontoIVAPaciente, 0.00 as MontoNetoFinan, 0.00 as MontoNetoPaciente, 0.00 as MontoTarifa, 0.00 as MontoTotalFinan,\n 0.00 as MontoTotalPaciente, 0.00 as PorcentajeCobertura, 0.00 as PorcentajePaciente, false as RequiereAutorizacion, 'P' as Tipo, true as Vigencia,\n pl.PERSPLANTIPCONTRATID as TipoContratacion, o.tipOSId as TipoOrdenOriginal, OSPersId as PacienteID\n from os o\n left join rrhh rh on o.osrrhhid = rh.rrhhid\n left join osindicact oi on o.tiposid = oi.tiposid and o.osid = oi.osid\n left join actasist a on a.actasistid = oi.osindicactactasistid\n left join plancom pc on o.osplancomid = pc.plancomid\n left join roles r on o.osrolid = r.rolid\n left join estos e on e.EstOSId = o.OSUltEstOsId\n left join empresas em on em.empid = rh.empid\n left join persplan pl on pl.persplanpersid = o.ospersid and pl.persplanplancomid = pc.plancomid\n left join prestadores p on pl.persplanprestid = p.prestid and o.ospersprestorigid = p.prestid\n left join prestplan pp on pc.PlanComId = pp.PlanComId and pp.PrestId = p.PrestId\n left join tipcontrat tc on tc.tipcontratid = pl.persplantipcontratid\n left join sectores s on o.ossectid = s.sectid\n where PrestSistExtId != ''\n and o.tiposid = ${TipOsId} and o.osid = ${OsId};`;\n conectarTunel().then((conexion) => {\n conexion.query(query, (error, resultado) => {\n if (error) {\n res.status(404).send(`Hubo un problema consultando los consumos: ${error}`);\n conexion.end();\n } else {\n const response = {\n 'consumos': JSON.parse(JSON.stringify(resultado))\n }\n res.send(response);\n conexion.end();\n }\n });\n }).catch((err) => {\n res.status(404).send('Hubo un error en la conexion de la BD GEOSalud', err);\n conexion.end();\n });\n}", "function renderizarCarrito() {\n let carritoHTML = '';\n let calcularTotal = 0;\n for (const [index, item] of carrito.entries()) {\n const precioProducto = item.cantidadCompra * item.precio;\n calcularTotal += precioProducto;\n carritoHTML += \n `<tr class=\"tabla-body\">\n <th scope=\"row\">${index+1}</th>\n <td>${item.nombre}</td>\n <td>\n <button class=\"button-incremento-decremento decrementoProducto\" id=\"decremento\" onclick=\"actualizarCantidad(${item.id}, 'resta')\" type=\"button\">-</button>\n <label class=\"labelCantidad\">${item.cantidadCompra}</label>\n <button class=\"button-incremento-decremento incremento-producto\" id=\"incremento\" onclick=\"actualizarCantidad(${item.id}, 'suma')\" type=\"button\">+</button>\n </td>\n <td>$${precioProducto}</td>\n <td><button class=\"deleteItem\" onclick=\"eliminarProducto(${index})\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" fill=\"currentColor\" class=\"bi bi-trash\" viewBox=\"0 0 16 16\">\n <path d=\"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z\"/>\n <path fill-rule=\"evenodd\" d=\"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z\"/>\n </svg>\n </button></td>\n </tr>`\n }\n return { carritoHTML: carritoHTML, totalCompra: calcularTotal };\n}", "function calcularTotal() {\n // Limpiamos precio anterior\n total = 0;\n // Recorremos el array del carrito\n carrito.forEach((item) => {\n // De cada elemento obtenemos su precio\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\n return itemBaseDatos.id === parseInt(item);\n });\n total = total + miItem[0].precio;\n });\n // Renderizamos el precio en el HTML\n DOMtotal.textContent = total.toFixed(2);\n}", "function afficherProduct(produit) { \n let html = `<div class=\"p-2 photo\">\n <img class=\"card-img-top\" src=\"${produit.imageUrl}\" alt=\"${produit.name}\">\n </div>\n <div class=\"m-2 p-2\">\n <h2>${produit.name}</h2>\n <p>${produit.description}</p>\n <p class=\"price\">${produit.price / 100} €</p>\n <div class=\"d-flex justify-content-around\">\n <div class=\"select w-50\">\n <label> Choissiez votre lentille :</label>\n <select id=\"lense\" name=\"lenses\"></select>\n </div>\n <div class=\"inputButton w-50\">\n <p>Quantité : <input id=\"${produit._id}\" type=\"number\" value=\"1\" min=\"1\" onchange=\"verifyInput()\"></p>\n </div>\n </div>\n <div class=\"d-flex justify-content-around\">\n <button button class=\"cart_button_checkout\" onclick=\"addToCart()\">Ajouter au panier</button>\n </div> \n </div>`;\n \n document.getElementById(\"produit\").innerHTML = html; // ajout au DOM\n\n let lenses = produit.lenses; // recuperation des personalisations\n let htmlLense = ''\n for(let i = 0; i < lenses.length; i++) {\n htmlLense = htmlLense + `<option value=\"${lenses[i]}\">${lenses[i]}</option>` // ajout des différentes personalisation au DOM\n }\n document.getElementById(\"lense\").innerHTML = htmlLense;\n }", "function mostrarProductos(productos){\n\n //capturamos la row donde se van a mostrar los productos\n\n let rowProductos = document.querySelector(\".buzos__row\");\n\n //recorremos con for each para ir generando la vista para cada elemento del array\n\n productos.forEach((producto) => {\n\n // card\n let col = document.createElement(\"div\");\n col.classList.add(\"col-lg-4\", \"col-sm-6\", \"col-12\");\n let card = document.createElement(\"div\");\n card.classList.add(\"card\");\n let img = document.createElement(\"img\");\n img.classList.add(\"card-img-top\", \"img-fluid\");\n img.src=producto.img[0];\n img.alt=producto.img[1];\n let cardBody = document.createElement(\"div\");\n cardBody.classList.add(\"card-body\");\n let tituloProducto= document.createElement(\"h5\");\n tituloProducto.classList.add(\"card-title\");\n tituloProducto.textContent=producto.nombre;\n let precioProducto = document.createElement(\"p\");\n precioProducto.classList.add(\"card-text\");\n precioProducto.textContent=`$${producto.precio}`;\n let fechaProducto = document.createElement(\"p\");\n fechaProducto.classList.add(\"card-text\")\n fechaProducto.textContent=`Fecha de ingreso: ${convertirFechaTexto(producto.fecha)}`;\n let hr = document.createElement(\"hr\");\n\n //SELECTOR DE TALLES\n let divSelect = document.createElement(\"div\");\n divSelect.classList.add(\"input-group\");\n let select = document.createElement(\"select\");\n select.classList.add(\"custom-select\", \"selectCardProductos\");\n let optionSelected = document.createElement(\"option\");\n optionSelected.selected = \"selected\";\n optionSelected.textContent = \"Talle\";\n select.appendChild(optionSelected);\n\n //OPCIONES DEL SELECTOR DE TALLE - RECORREMOS EL ARRAY DE TALLES PARA CREAR LAS OPCIONES SEGUN LOS TALLES QUE ESTEN DISPONIBLES\n\n producto.talle.forEach((talle) => {\n\n if(talle.stock > 0){\n\n const option = document.createElement('option');\n option.value = talle.talle;\n option.classList.add=`talle${talle.talle}`;\n option.textContent= talle.talle;\n select.appendChild(option)\n } \n })\n\n //div con el boton para añadir al carrito\n\n let divAniadir = document.createElement(\"div\");\n divAniadir.classList.add(\"input-group-append\");\n\n let botonAniadir = document.createElement(\"button\");\n botonAniadir.classList.add(\"btn\", \"btn-primary\", \"btn-aniadirCarrito\");\n botonAniadir.textContent = \"AÑADIR \";\n botonAniadir.addEventListener('click', () => {\n \n agregarAlCarrito(producto, select)\n \n generarModalCarrito();\n\n });\n \n let iconBotonAniadir = document.createElement(\"i\");\n iconBotonAniadir.classList.add(\"fas\", \"fa-cart-plus\");\n\n // append - visual\n \n rowProductos.appendChild(col);\n\n col.appendChild(card);\n\n card.appendChild(img);\n\n card.appendChild(cardBody);\n\n cardBody.appendChild(tituloProducto);\n\n cardBody.appendChild(precioProducto);\n\n cardBody.appendChild(fechaProducto);\n\n cardBody.appendChild(hr);\n\n cardBody.appendChild(divSelect);\n\n divSelect.appendChild(select);\n\n divSelect.appendChild(divAniadir);\n\n divAniadir.appendChild(botonAniadir);\n\n botonAniadir.appendChild(iconBotonAniadir);\n\n //</divAniadir>\n\n //</divSelect>\n\n //</cardBody>\n\n //</card>\n\n //</col>\n\n //</rowProductos>\n\n })\n\n}", "async getEstadoCarrera(req,res){\n console.log(req.body)\n // ESTA CONSULTA DEVUELVE LOS CURSOS QUE EL ALUMNO CURSO O ESTA CURSANDO\n const query1 = `\n SELECT c.nombre, ea.condicion, ea.nota, cc.nombre as carrera, cc.identificador as idcarrera\n FROM curso as c\n INNER JOIN estado_academico as ea ON ea.idcurso = c.identificador\n INNER JOIN alumno as a ON ea.idalumno = a.identificador\n INNER JOIN carrera cc ON c.idcarrera = cc.identificador\n WHERE ea.condicion IN ($2,$3,$4,$5) AND a.identificador = $1`; \n \n // ESTA CONSULTA DEVUELVE LA O LAS CARRERA EN QUE EL ALUMNO ESTA INSCRIPTO\n var query2 = ` \n SELECT DISTINCT carrera.identificador, carrera.nombre FROM carrera, inscripciones_carrera ic, alumno\n WHERE carrera.identificador = ic.idcarrera AND ic.idalumno = $1;`;\n\n var pool = new pg.Pool(config)\n pool.connect();\n const cursos = (await pool.query(query1, [req.body.identificador, req.body.opciones[0],req.body.opciones[1],req.body.opciones[2],req.body.opciones[3]])).rows \n const carrera = (await pool.query(query2, [req.body.identificador])).rows\n\n pool.end();\n var acumulador1 = 0;\n var contador1 = 0;\n var acumulador2 = 0;\n var contador2 = 0;\n for(var i = 0; i < cursos.length;i++){\n if (cursos[i].condicion == 'PROMOCIONADO'){\n if (cursos[i].idcarrera == 1){\n acumulador1 = acumulador1 + cursos[i].nota;\n contador1 = contador1 + 1; \n }else{\n acumulador2 = acumulador2 + cursos[i].nota;\n contador2 = contador2 + 1; \n } \n } \n }\n var promedio1 = acumulador1 / contador1;\n var promedio2 = acumulador2 / contador2;\n\n var carreras = [];\n console.log(carrera);\n for(var i = 0; i < carrera.length;i++){\n carreras.push(carrera[i].nombre);\n \n }\n console.log(carreras);\n informacion = {\n cursos:cursos,\n carrera: carreras,\n promedio1: promedio1,\n promedio2: promedio2\n }\n console.log(informacion);\n\n res.json(informacion);\n\n }", "static GetInfoReports(cadenaDeConexion, fI, fF, idSucursal, result) {\n var sucursal = '';\n if (idSucursal != 1) {\n sucursal = `AND info_ingresos.codSucursal=` + idSucursal;\n }\n console.log(\"sucursal \", sucursal);\n sqlNegocio(\n cadenaDeConexion,\n `SELECT info_grupopartidas.nombreGrupo,info_partidas.idPartida,info_partidas.nombrePartida,codMes,SUM(sumPrecioVenta) as PrecioVenta, (SUM(sumPrecioVenta) - SUM(aCuenta)) as pagar_cobrar,SUM(costVenta) as cost_venta\n FROM info_ingresos \n left join info_partidas\n on info_ingresos.idPartida=info_partidas.idPartida\n left join info_fuente \n on info_ingresos.codFuente=info_fuente.codFuente\n left join info_grupopartidas\n on info_partidas.idGrupo=info_grupopartidas.idGrupoPartida\n where info_ingresos.idPartida!=1 ` + sucursal + ` and tipoComprobante!=2 and tipoComprobante!=3 \n \t\t\t\t\t\t\t\t\t and fecEmision BETWEEN '`+ fI + `' AND '` + fF + `' AND estado=1\n group by nombreGrupo,idPartida,codMes\n order by idGrupoPartida ASC,idPartida ASC`,\n [],\n function (err, res) {\n if (err) {\n console.log(\"error: \", err);\n result(null, err);\n }\n else {\n result(null, res);\n }\n });\n }", "function datosCostoPA(producto_id) {\n tipo_movimiento = document.getElementById('tipo_movimiento').value;\n costo_abc = document.getElementById('costo_abc').value;\n if (tipo_movimiento != '0' && costo_abc != '0') {\n costo = '0';\n //contado\n if (tipo_movimiento == 'CONTADO') {\n if (costo_abc == 'A') {\n costo = precio_a[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c[producto_id];\n }\n }\n\n //FACTURA\n if (tipo_movimiento == 'FACTURA') {\n if (costo_abc == 'A') {\n costo = precio_a_factura[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_factura[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_factura[producto_id];\n }\n }\n\n //CONSIGNACION\n if (tipo_movimiento == 'CONSIGNACION') {\n if (costo_abc == 'A') {\n costo = precio_a_consignacion[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_consignacion[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_consignacion[producto_id];\n }\n }\n\n //planpago\n if (tipo_movimiento == 'PLANPAGO') {\n if (costo_abc == 'A') {\n costo = precio_a_pp[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_pp[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_pp[producto_id];\n }\n }\n\n //stock ids\n stock_ids = document.getElementById('stock_ids_' + producto_id).value;\n if (Trim(stock_ids) != '') {\n division = stock_ids.split(',');\n for (i = 0; i < division.length; i++) {\n costo_obj = document.getElementById('costo_' + division[i]);\n costo_obj.value = costo;\n }\n }\n\n }\n}", "async function getProductos() {\r\n //se realiza una consulta de todos los productos de la tabla\r\n try {\r\n let rows = await query(\"SELECT * from productos\");\r\n //rows : array de objetos\r\n return rows;\r\n } catch (error) {\r\n //bloque en caso de que exista un error\r\n console.log(error);\r\n }\r\n}", "function obtener_datos_todos_establecimiento() {\n var lista_datos = conexion_cuestionarios_resuelto();\n var contenido = \"\";\n var sucursal = \"\";\n var indice = 1;\n if (lista_datos.length > 0 ) {\n $.each(lista_datos, function (index, item) {\n if (index == 0) {\n contenido = \"<tr class='celda_tabla_res' style='background-color:#cbf1f5' ><th style='width:60px'>#</th><th style='width:30%'>\"+item.establecimiento+\"</th><th style='width:60px' >limpieza %</th><th style='width:60px'>Surtido %</th><th style='width:60px'>Imagen %</th><th style='width:60px'>Total %</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n sucursal=item.establecimiento;\n }//fin if\n if (sucursal == item.establecimiento) {\n contenido = \"<tr class='celda_tabla_res dato'><td style='width:60px'>\" + indice + \"</td><td class='nombre' style='width:30%'>\" + item.cuestionario + \"</td><td style='width:90px' >\" + item.limpieza + \"</td><td style='width:90px'>\" + item.surtido + \"</td><td style='width:90px'>\" + item.imagen + \"</td><td style='width:60px'>\" + item.total + \"</td></tr>\"\n $(\"#tabla_res\").append(contenido);\n indice++;\n }\n else {\n indice = 1;\n contenido = \"<tr class='celda_tabla_res' style='background-color:#cbf1f5' ><th style='width:60px'>#</th><th style='width:30%'>\" + item.establecimiento + \"</th><th style='width:60px' >limpieza %</th><th style='width:60px'>Surtido %</th><th style='width:60px'>Imagen %</th><th style='width:60px'>Total %</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n contenido = \"<tr class='celda_tabla_res dato'><td style='width:60px'>\" + indice + \"</td><td class='nombre' style='width:30%'>\" + item.cuestionario + \"</td><td style='width:90px' >\" + item.limpieza + \"</td><td style='width:90px'>\" + item.surtido + \"</td><td style='width:90px'>\" + item.imagen + \"</td><td style='width:60px'>\" + item.total + \"</td></tr>\"\n $(\"#tabla_res\").append(contenido);\n sucursal = item.establecimiento;\n indice++;\n }//fin if\n });\n }//fin\n else alert(\"No Hay Datos...\");\n}//fin", "function ordenarMayorPrecio() {\n let rowProductos = $(\"#row-productos\");\n rowProductos.innerHTML = \"\";\n let ordenarMayorPrecio = indumentaria.sort((a, b) => b.precio - a.precio);\n productosFiltrados(ordenarMayorPrecio);\n sessionStorage.setItem(\"mayorPrecio\", ordenarMayorPrecio);\n}", "function nota_promedio(){\n\t\tvar sum = 0;\n\t\tvar pro = 0;\n\t\tfor(num = 0; num < alumnos.length; num ++){\n\t\t\tsum += (alumnos[num].nota);\n\t\t}\n\t\tpro = sum / 10;\n\t\tdocument.getElementById(\"promedio\").innerHTML = \"El Promedio es: <b>\" + pro.toFixed(2) + \"</b>\";\n\t}", "function cambiodeprecios(idselect, produ) {\n console.log(idselect);\n var data = {id: document.getElementById(idselect).value};\n fetch('/buscar/propiedad/producto/id', {\n method: 'POST', // or 'PUT'\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(res => res.json())\n .catch(error => console.error('Error:', error))\n .then(response => {\n console.log(response);\n let precioparcial = parseInt(document.getElementById('preciounitario' + produ).value);\n let acumulado = 0;\n for (let x = 0; x < response.length; x++) {\n acumulado += parseInt(response[x]['precio']);\n }\n console.log(acumulado);\n let totalparcial = acumulado + precioparcial;\n\n document.getElementById('preciounitario' + produ).value = totalparcial;\n });\n\n}", "async function buscarProdutos(tipoBusca) {\r\n let codigoHTML = ``, json = null, json2 = null, produtosFilterCategorias = [];\r\n\r\n VETORDEPRODUTOSCLASSEPRODUTO = []\r\n\r\n if (tipoBusca == 'nome') {\r\n await aguardeCarregamento(true)\r\n json = await requisicaoGET(`itemsDesk/${$('#nome').val()}`, { headers: { Authorization: `Bearer ${buscarSessionUser().token}` } })\r\n json2 = await requisicaoGET(`categories`, { headers: { Authorization: `Bearer ${buscarSessionUser().token}` } });\r\n await aguardeCarregamento(false)\r\n for (let category of json2.data) {\r\n produtosFilterCategorias.push({ 'name': category.name, 'itens': json.data.filter((element) => category.products.findIndex((element1) => element1._id == element._id) > -1) })\r\n }\r\n } else if (tipoBusca == 'todos') {\r\n await aguardeCarregamento(true)\r\n json = await requisicaoGET(`itemsDesk`, { headers: { Authorization: `Bearer ${buscarSessionUser().token}` } })\r\n json2 = await requisicaoGET(`categories`, { headers: { Authorization: `Bearer ${buscarSessionUser().token}` } });\r\n await aguardeCarregamento(false)\r\n for (let category of json2.data) {\r\n produtosFilterCategorias.push({ 'name': category.name, 'itens': json.data.filter((element) => category.products.findIndex((element1) => element1._id == element._id) > -1) })\r\n }\r\n }\r\n\r\n codigoHTML += `<div class=\"shadow-lg p-3 mb-5 bg-white rounded\">\r\n <h4 class=\"text-center\" style=\"margin-top:40px;\">Lista de produtos</h4>\r\n <table style=\"margin-top:10px;\" class=\"table table-light table-sm\">\r\n <thead class=\"thead-dark\">\r\n <tr>\r\n <th scope=\"col\">Name</th>\r\n <th scope=\"col\">Descrição</th>\r\n <th scope=\"col\">Preço de custo</th>\r\n <th scope=\"col\">Preço de venda</th>\r\n <th scope=\"col\">Editar</th>\r\n <th scope=\"col\">Excluir</th>\r\n <th scope=\"col\">Disponível</th>\r\n </tr>\r\n </thead>\r\n <tbody>`\r\n\r\n for (let itemCategory of produtosFilterCategorias) {\r\n\r\n if (itemCategory.itens[0] != null) {\r\n codigoHTML += `<tr class=\"bg-warning\">\r\n <th colspan=\"7\" class=\"text-center\"> ${itemCategory.name}</th>\r\n </tr>`\r\n }\r\n\r\n for (let item of itemCategory.itens) {\r\n VETORDEPRODUTOSCLASSEPRODUTO.push(item)\r\n codigoHTML += `<tr>\r\n <th class=\"table-info\" title=\"${item.name}\">${item.drink ? '<span class=\"fas fa-wine-glass-alt\"></span>' : '<span class=\"fas fa-utensils\"></span>'} ${corrigirTamanhoString(20, item.name)}</th>\r\n <th class=\"table-info\" title=\"${item.description}\">${corrigirTamanhoString(40, item.description)}</th>\r\n <th class=\"table-warning\"><strong>R$${(item.cost).toFixed(2)}<strong></th>\r\n <th class=\"table-warning text-danger\"><strong>R$${(item.price).toFixed(2)}<strong></th>\r\n <td class=\"table-light\"><button class=\"btn btn-primary btn-sm\" onclick=\"carregarDadosProduto('${item._id}');\"><span class=\"fas fa-pencil-alt iconsTam\"></span> Editar</button></td>\r\n <td class=\"table-light\"><button class=\"btn btn-outline-danger btn-sm\" onclick=\"confirmarAcao('Excluir os dados do produto permanentemente!', 'deletarProduto(this.value)', '${item._id}');\" ><span class=\"fas fa-trash-alt iconsTam\"></span> Excluir</button></td>\r\n <td class=\"table-light\">\r\n <div class=\"custom-control custom-switch\">`\r\n if (item.available) {\r\n codigoHTML += `<input type=\"checkbox\" onclick=\"this.checked? disponibilizarIndisponibilizarProduto('${item._id}',true) : disponibilizarIndisponibilizarProduto('${item._id}',false) \" class=\"custom-control-input custom-switch\" id=\"botaoselectdisponivel${item._id}\" checked=true>`\r\n } else {\r\n codigoHTML += `<input type=\"checkbox\" onclick=\"this.checked? disponibilizarIndisponibilizarProduto('${item._id}',true) : disponibilizarIndisponibilizarProduto('${item._id}',false) \" class=\"custom-control-input custom-switch\" id=\"botaoselectdisponivel${item._id}\">`\r\n }\r\n codigoHTML += `<label class=\"custom-control-label\" for=\"botaoselectdisponivel${item._id}\">Disponível</label>\r\n </div>\r\n </td>\r\n </tr>`\r\n }\r\n }\r\n codigoHTML += `</tbody>\r\n </table>\r\n </div>`\r\n\r\n if (json.data[0] == null) {\r\n document.getElementById('resposta').innerHTML = `<h5 class=\"text-center\" style=\"margin-top:20vh;\"><span class=\"fas fa-exclamation-triangle\"></span> Nenhum produto encontrado!</h5>`;\r\n } else {\r\n document.getElementById('resposta').innerHTML = codigoHTML;\r\n }\r\n setTimeout(function () {\r\n animacaoSlideDown(['#resposta']);\r\n }, 300);\r\n\r\n}", "function GetProductosList() {\n\t\treturn $.ajax({\n\t\t\turl: '/api/productos/listar',\n\t\t\ttype: 'get',\n\t\t\tdataType: \"script\",\n\t\t\tdata: { authorization: localStorage.token },\n\t\t\tsuccess: function(response) {\n\t\t\t\tconst productos = JSON.parse(response);\n\t\t\t\t//console.log(usuarios); //<-aqui hago un console para ver lo que devuelve\n\t\t\t\tproductos.forEach(producto => {\n\t\t\t\t\ttablaProductos.row.add({\n\t\t\t\t\t\t\"codigoProducto\": producto.codigoProducto,\n\t\t\t\t\t\t\"nombreProducto\": producto.nombreProducto,\n\t\t\t\t\t\t\"precioCompra\": producto.precioCompra,\n\t\t\t\t\t\t\"precioVenta\": producto.precioVenta,\n\t\t\t\t\t\t\"ivaCompra\": producto.ivaCompra,\n\t\t\t\t\t\t\"nombreProveedor\": producto.proveedor.nombreProveedor,\n\t\t\t\t\t\t\"nitProveedor\": producto.proveedor.nitProveedor,\n\t\t\t\t\t}).draw();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function obtener_datos_curso_por_folio(){\n var consulta = conexion_ajax(\"/servicios/dh_cursos.asmx/obtener_datos_cursos_folio\", { folio: $(\"#folio_curso\").val() })\n $(\"#folio_curso\").val(consulta.id_curso)\n $(\"#Nombre_curso\").val(consulta.nombre_curso)\n $(\"#estatus_cusro\").val(consulta.estatus)\n $(\"#selector_puestos\").val(\n (function (valor) {\n var dato;\n $(\"#puestos option\").each(function (index, item) {\n if (valor == parseInt($(this).attr(\"name\")))\n dato = $(this).val();\n })\n return dato;\n }(consulta.puesto_pertenece))\n )\n obtener_imagen()\n}", "function buscar_produtos() {\n return fetch(`${urlBase}produto/find-all.php`,{\n headers: { \"content-type\": \"application/json\" }\n })\n .then(resp => resp.json())\n .then(dados => dados);\n}", "function agregarFilas(productos){\n for(var i=0 ; productos[i] ; i++){\n var producto = productos[i],\n nombre = producto.nombreProducto,\n codigo = producto.codigo,\n cantidad = producto.cantidadAlmacen,\n minimo = producto.minimo,\n idAlmacen = producto.idAlmacen,\n esBasico = producto.esBasico;\n\n getFilas(nombre, codigo, cantidad, minimo, idAlmacen, esBasico)\n }\n $('#dataTables-example').DataTable().draw();\n}", "async obtenerProductores(req, res) {\n const rowsProductorPersonas = await modeloProductor.obtenerProductores();\n return res.status(200).send(productorDto.multipleProductorPersona(rowsProductorPersonas));\n }", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "function leerDatosProductos(producto){\n const infoProducto = {\n img: producto.querySelector('.imagen').src,\n titulo: producto.querySelector('#title-product').textContent,\n cantidad: producto.querySelector('#cantidad').value,\n precio: producto.querySelector('#precio').textContent,\n id: producto.querySelector('#agregar-carrito').getAttribute('data-id')\n };\n agregarAlCarrito(infoProducto); \n}", "function MostrarContadores() {\n\tvar div = document.getElementById(\"mostrarcontador\");\n\tdiv.innerHTML = \"\";\n\n\tvar TitleTotalArticles = document.createElement(\"h4\");\n\tvar TitlePriceWithoutIVA = document.createElement(\"h4\");\n\tvar TitleTotalPrice = document.createElement(\"h4\");\n\n\tvar cont1 = 0;\n\tvar cont2 = 0;\n\tvar TotalArticulos = 0;\n\tvar Totalprecio = 0;\n\tvar PrecioSinIva = 0;\n\n\t//Con esto mostramos el total de articulos en nuestro carrito.\n\tfor (x of carritocompra.cantidades) {\n\t\tx = parseInt(x);\n\t\tTotalArticulos += x;\n\t}\n\n\tcarritocompra.items.forEach(element => {\n\t\telement.precio = parseInt(element.precio);\n\t\tTotalprecio += (element.precio * carritocompra.cantidades[cont2]);\n\t\tcont2++;\n\t});\n\n\t// Esta parte del codigo es para sacar los precios sin iva\n\tcarritocompra.items.forEach(element => {\n\t\telement.precio = parseInt(element.precio);\n\t\telement.iva = parseInt(element.iva);\n\t\tPrecioSinIva += (element.precio * carritocompra.cantidades[cont1]) - (((element.precio * element.iva) / 100) * carritocompra.cantidades[cont1]);\n\t\tcont1++;\n\t});\n\n\tTitleTotalArticles.appendChild(document.createTextNode(\"Artículos en tu carrito: \" + TotalArticulos));\n\tTitlePriceWithoutIVA.appendChild(document.createTextNode(\"Precio sin IVA: \" + PrecioSinIva + \"€\"));\n\tTitleTotalPrice.appendChild(document.createTextNode(\"Precio total a pagar: \" + Totalprecio + \"€\"));\n\n\tdiv.appendChild(TitleTotalArticles);\n\tdiv.appendChild(TitlePriceWithoutIVA);\n\tdiv.appendChild(TitleTotalPrice);\n}", "function convertirProductoEnPedido(buffer_de_orden, cantidad)\r\n\t{\t\r\n\t cantidad = cantidad || 1;\r\n\t for (var i=0; i < cantidad; i++) {\r\n\t _orden.push(buffer_de_orden);\r\n\t }\r\n\t miniResumenOrden();\r\n\t $(\"#search\").focus();\r\n\t}//end", "function produtosVendidos() {\n var produtos = document.querySelectorAll(\".Produ\");\n let prodVendidos = Array();\n // Percorrer a lista de produtos\n for (var i = 0; i < produtos.length; i++) {\n\n // Recupera o produto no indice i da lista de produtos\n var produto = produtos[i];\n\n // pegando id\n var id = produto.querySelector(\".id\").textContent;\n\n // pegando quantidade\n var qtd = produto.querySelector(\".qtd\").textContent;\n\n let prod = {\n cdg: id,\n QTDProd: qtd\n }\n\n prodVendidos.push(prod)\n }\n return prodVendidos;\n }", "function actualizarPantalla() {\n const respuesta = renderizarCarrito();\n if (respuesta && respuesta.carritoHTML === '') {\n return;\n }\n cartList = respuesta.carritoHTML;\n const mostrarCarrito = document.getElementById('tablaCarrito');\n mostrarCarrito.innerHTML = cartList;\n totalPedido = document.getElementById('totalPedido');\n totalPedido.innerHTML = `$${respuesta.totalCompra}`;\n}", "getEleccionPaquete(){\r\n\r\n if( eleccion == \"IGZ\" ){\r\n //Igz - descuento del 15\r\n console.log(\"Elegiste Iguazú y tiene el 15% de decuento\");\r\n return this.precio - (this.precio*0.15);\r\n }\r\n else if (eleccion == \"MDZ\"){\r\n //mdz - descuento del 10\r\n console.log(\"Elegiste Mendoza y tiene el 10% de descuento\");\r\n return this.precio - (this.precio*0.10);\r\n }\r\n else if (eleccion == \"FTE\"){\r\n //fte - no tiene descuento \r\n console.log(\"Elegiste El Calafate, lamentablemente no tiene descuento\");\r\n return \"\";\r\n }\r\n \r\n }", "function muestroTotalProductos() {\r\n var subTotalCompleto = 0;\r\n subTotalCompletoImporte = 0;\r\n if ($('.articuloDeLista').length > 0) {\r\n $('.articuloDeLista').each(function () {\r\n subTotalCompleto = parseFloat($(this).children('.productSubtotal').text());\r\n subTotalCompletoImporte += subTotalCompleto;\r\n document.getElementById(\"productCostText\").innerHTML = subTotalCompletoImporte;\r\n });\r\n }\r\n }", "async getDatosAcopio() {\n let query = `SELECT al.almacenamientoid, ca.centroacopioid, ca.centroacopionombre, \n concat('Centro de Acopio: ', ca.centroacopionombre, ' | Propietario: ', pe.pernombres, ' ', pe.perapellidos) \"detalles\"\n FROM almacenamiento al, centroacopio ca, responsableacopio ra, persona pe\n WHERE al.centroacopioid = ca.centroacopioid AND ca.responsableacopioid = ra.responsableacopioid AND ra.responsableacopioid = pe.personaid;`;\n let result = await pool.query(query);\n return result.rows; // Devuelve el array de json que contiene todos los controles de maleza realizados\n }", "function ReiniciarCalcularPrecioFinal() {\n var total = $(\"#total\").text();\n\n $(\"#mostrardescuento\").text(0);\n $(\"#descuentos\").val(1);\n $(\"#descuentos option:selected\").val(1);\n $('#descuentos').material_select();\n $('#calculoEfectivoBs').val(0);\n $('#calculoEfectivoSus').val(0);\n\n $('#efectivoBs').val(\"0.00\");\n $('#efectivoSus').val(\"0.00\");\n $('#dBancoBs').val(\"\");\n $('#dBancoSus').val(\"\");\n $('#chequeBs').val(\"\");\n $('#chequeSus').val(\"\");\n $('#tDebitoBs').val(\"\");\n $('#tDebitoSus').val(\"\");\n $('#tCreditoBs').val(\"\");\n $('#tCreditoSus').val(\"\");\n var idmoned = $(\"#idMoneda\").val();\n\n if (idmoned == 1) {//Bolivianos\n $(\"#money1\").text(\"Bs.\");\n $(\"#money2\").text(\"Bs.\");\n $(\"#money3\").text(\"Bs.\");\n $(\"#money4\").text(\"Bs.\");\n $(\"#money5\").text(\"Bs.\");\n $(\"#money6\").text(\"Bs.\");\n $(\"#money7\").text(\"Bs.\");\n totalConDescuento = $(\"#total\").text();\n document.getElementById('totalfijo').innerHTML = total;\n $(\"#datosfactura tr\").remove();\n var valor = LITERAL(total);\n var tabladatos = $('#datosfactura');\n $(\"#totalacobrarcondescuentoenlaventa\").text(total);\n $(\"#saldoCredito\").text(total);\n tabladatos.append(\"<tr><td id='totalcondescuentoventa'>\" + total + \"</td><td id='totalventaliteral'>\" + valor + \"</td><tr>\");\n var porcentaje = total * 0.3;\n porcentaje = porcentaje.toFixed(2);\n var saldo = total - porcentaje;\n $(\"#aCuenta\").val(0);\n $(\"#saldo\").val(total);\n\n calcular_Bs();\n calcular_Sus();\n calcular_Banco_Bs();\n calcular_Banco_Sus();\n calcular_Cheque_Bs();\n calcular_Cheque_Sus();\n calcular_tCredito_Bs();\n calcular_tCredito_Sus();\n calcular_tDebito_Bs();\n calcular_tDebito_Sus();\n\n } else {\n $(\"#money1\").text(\"Sus.\");\n $(\"#money2\").text(\"Sus.\");\n $(\"#money3\").text(\"Sus.\");\n $(\"#money4\").text(\"Sus.\");\n $(\"#money5\").text(\"Sus.\");\n $(\"#money6\").text(\"Sus.\");\n $(\"#money7\").text(\"Sus.\");\n totalConDescuento = $(\"#total\").text();\n document.getElementById('totalfijo').innerHTML = total;\n $(\"#datosfactura tr\").remove();\n\n var tipoCV = parseFloat($(\"#TCV\").text());\n var totalConversion = parseFloat(total);\n var totaltotal = totalConversion * tipoCV;\n var redondeo = totaltotal.toFixed(2);\n var valorConversion = LITERAL(redondeo);\n $(\"#totalventaliteralSus\").text(valorConversion);\n\n\n var valor = LITERALDOLAR(total);\n var tabladatos = $('#datosfactura');\n $(\"#totalacobrarcondescuentoenlaventa\").text(total);\n $(\"#saldoCredito\").text(total);\n tabladatos.append(\"<tr><td id='totalcondescuentoventa'>\" + total + \"</td><td id='totalventaliteral'>\" + valor + \"</td><tr>\");\n var porcentaje = total * 0.3;\n porcentaje = porcentaje.toFixed(2);\n var saldo = total - porcentaje;\n $(\"#aCuenta\").val(0);\n $(\"#saldo\").val(total);\n\n calcular_Bs();\n calcular_Sus();\n calcular_Banco_Bs();\n calcular_Banco_Sus();\n calcular_Cheque_Bs();\n calcular_Cheque_Sus();\n calcular_tCredito_Bs();\n calcular_tCredito_Sus();\n calcular_tDebito_Bs();\n calcular_tDebito_Sus();\n }\n\n\n\n}", "function mostrarArreglo() { //carga en la tabla html los elementos que ya se encuentran \"precargados\" en el arreglo\n for (const pedido of pedidos) {\n mostrarItem(pedido);\n }\n}", "transactionsPaymentPoints(cuenta, fecha, id_comercio){\n let sql = `SELECT a.id_transaccion, a.id_usuario, a.id_sucursal, a.cuenta, a.puntos, a.total, DATE_FORMAT(DATE(a.fecha), '%Y-%m-%d') as fecha\n FROM transaccion a INNER JOIN sucursal b USING(id_sucursal)\n WHERE a.cuenta = '${cuenta}'\n AND a.puntos < 0 \n AND DATE(a.fecha) <= ${(fecha === '') ? `CURDATE()` : `'${fecha}'` } \n AND b.id_comercio = ${id_comercio}\n AND a.id_transaccion NOT IN (SELECT id_transaccion FROM transaccion_del);`\n return mysql.query(sql)\n }", "function agregaProducto(saldo){\n\t\n\tvar importeTotal = parseFloat($('#txtImporteTotal').val()).toFixed(2);\n\t\n\truta= \"/producto/buscar/\" + $('#txtIdProducto').val()+\"/\"+descuentosolicitado;\n\tconsole.log(ruta);\n\t$.ajax({\n\t\turl:ruta,\n\t\ttype:'get',\n\t\tdataType:'json',\n\t\tsuccess:function(data){\n\t\t\tconsole.log(data);\n\t\t\n\t\tvar descuentosolicitadoid=descuentosolicitado;\n\t\tvar descuentosolicitadovalor=data.descuentosolicitado;\n\t\tvar descuentosolicitadotexto=data.descuentovalor;\n\t\tvar preciolistasoles=data.preciolista;\n\t\tif (lblmoneda==\"US $\") {\n\t\t\tvar preciolista=parseFloat(data.preciolistadolares).toFixed(2);\n\t\t}else{\n\t\t\tvar preciolista=parseFloat(data.preciolista).toFixed(2);\n\t\t};\t\n\t\t\n\t\tvar preciosolicitado=((1-descuentosolicitadovalor)*preciolista).toFixed(2);\n\t\tvar preciototal=parseFloat(preciosolicitado*cantidad).toFixed(2);\n\n\t\tdescuentototal=cantidad*(preciolista-preciosolicitado);\n\n\t\timporteTotal=parseFloat(importeTotal)+parseFloat(preciototal);\n\n\t\t$('#tblDetalleOrdenVenta tbody tr:last').before('<tr>'+\n\t\t\t'<td class=\"codigo\">' + \n\t\t\t\tdata.codigo +\n\t\t\t\t'<input type=\"hidden\" value=\"' + data.idproducto + '\" name=\"DetalleOrdenVenta[' + contador + '][idproducto]\" class=\"txtIdProducto\">'+\n\t\t\t\t'<input type=\"hidden\" value=\"' + descuentosolicitadoid + '\" name=\"DetalleOrdenVenta[' + contador + '][descuentosolicitado]\" >'+\n\t\t\t\t'<input type=\"hidden\" value=\"' + descuentosolicitadotexto + '\" name=\"DetalleOrdenVenta[' + contador + '][descuentosolicitadotexto]\" >'+\n\t\t\t\t'<input type=\"hidden\" value=\"' + descuentosolicitadovalor + '\" name=\"DetalleOrdenVenta[' + contador + '][descuentosolicitadovalor]\" class=\"porTxtDescuento text-50\">'+\n\t\t\t'</td>'+\n\t\t\t'<td>' + data.nompro + '</td>'+\n\t\t\t//'<td>' + data.codigoalmacen + '</td>'+\n\t\t\t'<td>' + preciolistasoles + '</td>'+\n\t\t\t'<td>'+\n\t\t\t\t'<input type=\"text\" value=\"' + cantidad + '\" name=\"DetalleOrdenVenta[' + contador + '][cantsolicitada]\" class=\"txtCantidad numeric text-50\" readonly>'+\n\t\t\t'</td>'+\n\t\t\t'<td>'+ lblmoneda +' <input type=\"text\" value=\"' + preciolista + '\" name=\"DetalleOrdenVenta[' + contador + '][preciolista]\" class=\"txtPrecio numeric text-50\" readonly></td>'+\n\t\t\t'<td> ( <b>'+descuentosolicitadotexto+' </b>)</td>'+\n\t\t\t'<td>'+ lblmoneda +' '+\n\t\t\t\t'<input type=\"text\" value=\"' + preciosolicitado + '\" name=\"DetalleOrdenVenta[' + contador + '][preciosolicitado]\" class=\"txtPrecioDescontado text-50\" readonly>'+\n\t\t\t'</td>'+\t\t\t\t\t\t\n\t\t\t'<input type=\"hidden\" value=\"' + descuentototal.toFixed(2) + '\" name=\"DetalleOrdenVenta[' + contador + '][tipodescuento]\" class=\"txtDescuento text-50\">'+ \n\t\t\t'<td class=\"center\"> '+ lblmoneda +' <input type=\"text\" value=\"' + preciototal + '\" class=\"txtTotal text-100 right\" readonly></td>'+\n\t\t\t'<td><a href=\"#\" class=\"btnEditarCantidad\"><img src=\"/imagenes/editar.gif\"></a></td>'+\n\t\t\t'<td><a href=\"#\" class=\"btnEliminarProducto\"><img src=\"/imagenes/eliminar.gif\"></a></td>'+\n\t\t'</tr>');\n\t\t\n\t\t$('#txtImporteTotal').val(importeTotal.toFixed(2));\n\t\tverificaSaldoDisponible();\n\t},\n\terror:function(error){\n\t\tconsole.log('error');\n\t}\n\t});\t\n\t\n}", "function ConsultaItems(tx) {\n\t\ttx.executeSql('select id_empresa,nom_empresa from publicempresa order by nom_empresa', [], ConsultaItemsCarga,errorCB);\n}", "function calculaPrecio(precio) {\n \n for (let i = 0; i < productoPrecio.length; i++) {\n \n \n if ( precio==productoPrecio[i] ) {\n \n \n console.log(productoPrecio.length + ' productos con precios iniciales:');\n console.log((productoPrecio[0]*1000) + ' pesos el Vainilla');\n console.log((productoPrecio[1]*1000) + ' pesos el Chocolate');\n console.log((productoPrecio[2]*1000) + ' pesos la Cacao');\n console.log((productoPrecio[3]*1000) + ' pesos las Trufas');\n\n console.log('El precio inicial del producto que se eligió era de ' + precio*1000 + ' pesos');\n\n \n precioFinal = precio * descuentoOperativo;\n\n\n\n alert('El precio se rebajó un ' + Math.round((1-descuentoOperativo)*100) + '% quedando en ' + Math.round(precioFinal*1000) + ' pesos por 100 grs')\n \n return console.log('El precio se rebajó un ' + Math.round((1-descuentoOperativo)*100) + '% quedando en ' + Math.round(precioFinal*1000) + ' pesos por 100 grs');\n \n }\n\n } \n}" ]
[ "0.68286014", "0.64546", "0.6318173", "0.6291525", "0.62708765", "0.6236279", "0.60995024", "0.6082517", "0.60818684", "0.60779124", "0.6076814", "0.6075047", "0.6060158", "0.6043463", "0.6034586", "0.60303754", "0.59963346", "0.5985551", "0.59731966", "0.59699976", "0.5964107", "0.5939688", "0.5929086", "0.5916224", "0.5906435", "0.589258", "0.58917135", "0.58904266", "0.5880599", "0.5875", "0.587476", "0.5861772", "0.58612436", "0.5858848", "0.5850088", "0.5849992", "0.5845834", "0.5845423", "0.5835692", "0.5833412", "0.5832333", "0.5829977", "0.58229524", "0.58226687", "0.5815386", "0.5787651", "0.5785109", "0.57850456", "0.577519", "0.5769836", "0.57687163", "0.5756166", "0.57535934", "0.5752148", "0.57461286", "0.57452226", "0.57410944", "0.573187", "0.57289404", "0.5716367", "0.5714485", "0.57142806", "0.57106215", "0.57058525", "0.57026446", "0.5701951", "0.5700102", "0.56978464", "0.56966937", "0.56947464", "0.5687903", "0.56850404", "0.56760657", "0.56731737", "0.5666737", "0.56648415", "0.5662724", "0.5662553", "0.56612515", "0.5661164", "0.5659972", "0.5656339", "0.5651059", "0.5645854", "0.5642998", "0.56425005", "0.5641769", "0.5636234", "0.5632924", "0.5627317", "0.56264883", "0.5625117", "0.5620191", "0.5616914", "0.56157047", "0.56134105", "0.56098574", "0.5608909", "0.5607335", "0.56070364", "0.5606102" ]
0.0
-1
SELECT: Devuelve todos los registros
obtenerTodosProductorPersona() { return axios.get(`${API_URL}/v1/productorpersonaReporte/`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTypesComplains(req, res) {\n var connection = dbConnection();\n connection.query(\"SELECT * FROM tipo_queja\", function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `No hay quejas guardadas` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n}", "campeao(res) {\n const sql = ` select ti.*, e.nome as estado, e.sigla, r.nome as regiao from times ti\n inner join estados e on (e.estado_id = ti.estado_id)\n inner join regioes r on (r.regiao_id = e.regiao_id)\n inner join partidas pa on (pa.time_id_vencedor = ti.time_id)\n order by pa.partida_id desc limit 1 `\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "function cargarGeneros(req, res) {\n var peticionsql = 'SELECT * FROM genero';\n \n conexionBaseDeDatos.query(peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "function listaModelos(){\n return new Promise((resolve,reject) => {\n let qry = `\n select \n usuarioCadastro, tbinfoveiculo.id, nomemodelo, tbmontadoras.nome, anofabricacao, cores, tipochassi, suspensaodianteira, suspensaotraseira, pneusdianteiro, pneutraseiro, freiodianteiro, freiotraseiro, tipodofreio,\n qtdcilindros, diametro, curso, cilindrada, potenciamaxima, torquemaximo, sistemadepartida, tipodealimentacao, combustivel, sistemadetransmissao, cambio, bateria, \n taxadecompessao, comprimento, largura, altura, distanciaentreeixos, distanciadosolo, alturadoassento, tanquedecombustivel, peso, arqFoto\n from tbInfoVeiculo inner join tbmontadoras on tbinfoveiculo.idmontadora = tbmontadoras.id\n `\n db.all(qry, (err,data) => {\n if(err) {\n reject(err);\n }\n resolve(data);\n })\n })\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "async getTodosLosSensores() {\n var textoSQL = \"select * from Sensor\";\n console.log(\"logica: getTodosLosSensores\")\n return new Promise((resolver, rechazar) => {\n this.laConexion.all(textoSQL, {},\n (err, res) => {\n (err ? rechazar(err) : resolver(res))\n })\n })\n }", "getMateriasProgra(ru,gestion,periodo){\n return querys.select(\"select * from consola.generar_programacion_completa(\"+ru+\",\"+gestion+\",\"+periodo+\",0)\");\n }", "function buscarAdministrativo(regex){\n return new Promise((resolve,reject)=>{\n Administrativo.find({}, 'identificacion nombres apellidos correo telefono programa cargo estado rol')\n .or([ {'identificacion':regex}, {'nombres':regex}, {'apellidos':regex}, {'telefono':regex}, {'correo':regex}, {'cargo': regex}])\n .populate('rol programa').exec((err,usuarios)=>{\n if(err){\n reject('Error al cargar los usuarios',err);\n }else{\n resolve(usuarios);\n }\n });\n });\n}", "static getAll() {\r\n return new Promise((next) => {\r\n db.query('SELECT id, nom FROM outil ORDER BY nom')\r\n .then((result) => next(result))\r\n .catch((err) => next(err))\r\n })\r\n }", "function listar(ok,error){\n console.log(\"Funcionlistar DAO\")\n helper.query(sql,\"Maestro.SP_SEL_ENTIDAD_FINANCIERA\",[],ok,error)\n}", "function getRutas(next) {\n RutaModel\n .query(`select r.idRuta, r.idVehiculo, r.noEconomico, r.idRemolque, r.salida, r.destino, r.idConductor, r.fechaSalida, r.fechaLlegada, r.tiempoEstimado,r.idEstado, r.idPrioridad,r.created_at, u.latitud, u.longitud, u.estadoGeoreferencia, u.municipioGeoreferencia, u.asentamientoGeoreferencia, u.direccionGeoreferencia, u.placa\n FROM rutas r, ubicaciones u where u.noEconomico=r.noEconomico`, (error, resultado, fields) => {\n\n next(error, resultado)\n })\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\" );\n}", "function consultarCitasUsuario(){\n\t\n\tvar idUsuario = $(\"#selectUsuario\").val();\n\t\n\t\n\tvar selectList = $(\"#otrosUsuarios\");\n\tselectList.find(\"option:gt(0)\").remove();\n\t\n\t//para mostrar nombre en spán de select usuarios\n\t$(\"#nombreUsuarioSeleccionado\").html( $(\"#selectUsuario option:selected\").text() );\n\t\n\t$(\"#selectUsuario option\").each(function(){\n // Add $(this).val() to your list\n \tif( ($(\"#selectUsuario\").val() != $(this).val()) && ($(\"#selectUsuario\").val() != \"\") && ($(\"#selectUsuario\").val() != null) && ($(this).val() != \"\") && ($(this).val() != null) ){\n \t\t\n \t\t$('#otrosUsuarios').append($('<option>', {\n\t\t \tvalue: $(this).val(),\n\t\t \ttext: $(this).text()\n\t\t\t}));\n \t\t\n \t}\n\t\t\n\t});\t\n\t\n \t $('#otrosUsuarios').material_select('destroy');\n \t $('#otrosUsuarios').material_select();\t\n \t \n \t //se recorre el select que se acabo de contruir para dar los ids a los checkbox de materialize\n \t $(\"#otrosUsuarios option\").each(function(){\n\t\t\n \t$(\"#nuevaCitaOtrosUsuariosMultiple\").find('span:contains(\"'+$(this).text()+'\")').parent('li').attr('id', 'multipleCreando'+$(this).val());\n \t$('#multipleCreando'+$(this).val()).attr(\"onClick\", 'comprobarSeleccionMultipleNuevaCita(this.id)');\n\t\t\n\t});\t\n \t \n\n\t$(\"#calendar\").fullCalendar( 'destroy' );\n\tcontruirCalendario();\t\n\t\n\t\n}", "function CargarColletIDs(){\n\n var sql = \"SELECT ID_Colecciones,Nombre FROM Colecciones\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n function querySuccess(tx, results) {\n var len = results.rows.length;\n for (var i=0; i<len; i++)\n $('#SelectorColecciones').append('<option value=\"' + results.rows.item(i).ID_Colecciones + '\">' + results.rows.item(i).Nombre + '</option>');\n\n }\n\n function errorCB(err) {\n alert(\"Error al rellenar selector de coleciones: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n\n}", "function ConsultaItems(tx) {\n\t\ttx.executeSql('select id_empresa,nom_empresa from publicempresa order by nom_empresa', [], ConsultaItemsCarga,errorCB);\n}", "function buscarHospitales(regExp) {\n\n return new Promise((resolve, reject) => {\n Hospital.find({ nombre: regExp }, (err, hospitales) => {\n if (err) {\n reject(\"Error al cargar hospitales\", err);\n } else {\n resolve(hospitales);\n }\n\n })\n });\n\n}", "static getAll(){\n // Retourne promise\n return new Promise((resolve, reject) => {\n // Requete Select \n db.query(\"SELECT * FROM salles\", (err, rows) => {\n if(err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n })\n }", "getPreguntas(callback) {\n this.pool.getConnection(function (err, conexion) {\n \n if (err)\n callback(err);\n else {\n \n const sql = \"SELECT p.id_pregunta, p.id_usuario, p.titulo, p.cuerpo,p.fecha,u.nombre,u.imagen FROM preguntas AS p JOIN usuario AS u ON p.id_usuario=u.id_usuario ORDER BY p.fecha DESC;\"; \n\n conexion.query(sql, function (err, resultado) {\n conexion.release();\n if (err)\n callback(err);\n else\n callback(null, resultado);\n }); \n }\n });\n }", "async parametroFormasPagamento(req, res) {\n\n const parametroFormaPagamento = await db.query(\"SELECT cod_parametro_forma_pagamento, descricao FROM parametro_forma_pagamento WHERE status = 0\");\n return res.json(parametroFormaPagamento.rows)\n\n }", "function cargarControles(){\n\tvar selector = document.getElementById('selectClasificacion');\n\tvar btn_jugar = document.getElementById('btn-jugar');\n\tvar btn_reiniciar = document.getElementById('btn-reiniciar');\n\tvar btn_calificar = document.getElementById('btn-calificar');\n\n\tselector.innerHTML = getItemsClasificar();\n\tbtn_jugar.addEventListener('click',crearEntornoDeJuego);\n\tbtn_reiniciar.addEventListener('click',reiniciarJuego);\n\tbtn_calificar.addEventListener('click',calificar);\n}", "function cargarDirectores(req, res) {\n var peticionsql = 'SELECT * FROM director';\n \n conexionBaseDeDatos.query( peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "static list_DiagnosticoTratameinto(req, res){ \n const { id_internacion } = req.params\n diagnostico_tratamientos.findAll({\n where: { id_internacion: id_internacion }\n }).then((data) => {\n res.status(200).json(data);\n }); \n }", "function traercontacto_empresa(req,res){\n\tCONN('contacto_empresa').select().then(registros =>{\n\t\tif (!registros){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de contacto_empresa', registros:registros});\n\t\t}\n\t}).catch(error =>{\n\t\tres.status(500).send({resp: 'error', error: `${error}` });\n\t});\n}", "function listaGeneros(req, res) {\n var sqlGen = \"select * from genero\"\n con.query(sqlGen, function(error, resultado, fields) {\n errores(error, res);\n var response = {\n 'generos': resultado\n };\n\n res.send(JSON.stringify(response));\n });\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\", \"option\" );\n}", "function _CarregaRacas() {\n var select_raca = Dom('raca');\n if (select_raca == null) {\n // Testes não tem o select.\n return;\n }\n for (var chave_raca in tabelas_raca) {\n select_raca.appendChild(CriaOption(Traduz(tabelas_raca[chave_raca].nome), chave_raca))\n }\n}", "function buscarModulos(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Modulo.find({}, 'nombre tipo estado usuario') // envamos un obj vacio y buscamos por nombre enail y role \n .or([{ 'nombre': regex }, { 'tipo': regex }]) // envio un array de condiciones , busco por dos tipos \n .populate('usuario', 'nombre email') // se pueden poner mas populate de otras colecciones\n .exec((err, modulos) => {\n\n if (err) {\n reject('error al cargar modulos', err)\n } else {\n // modulos ira comno respuesta en el array respuesta[0]\n resolve(modulos) // devuelve los modulos encontrados en el find\n }\n })\n });\n}", "function buscarUsuarios(termino, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find()\n // .or - para buscar en dos propiedades de la misma coleccion\n .or([ { 'nombre' : regex }, { 'email' : regex } ])\n .exec((error, usuariosEncontrados) => {\n\n if(error) {\n reject('Error al cargar los usuarios', error);\n } else {\n resolve(usuariosEncontrados);\n }\n\n });\n });\n }", "function cargarActores(req, res) {\n var peticionsql = 'SELECT * FROM actor';\n \n conexionBaseDeDatos.query(peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "function listarImpresoras(){\n\n $(\"#selectImpresora\").html(\"\");\n navigator.notification.activityStart(\"Buscando impresoras...\", \"Por favor espere\");\n\n ImpresoraBixolonSPPR300ySPPR310.buscar((devices)=>{\n\n var lista = devices.map((device)=>{\n\n var id = device.MAC + \"_\" + device.Nombre;\n var texto = device.Nombre + \"(\" + device.MAC + \")\";\n\n $('#selectImpresora').append($('<option>', {\n value: id,\n text : texto\n }));\n\n });\n\n navigator.notification.activityStop();\n $('#selectImpresora').selectmenu('enable');\n $('#selectImpresora').selectmenu('refresh');\n\n });\n\n }", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function ConsultaItemSelect(tx) { console.log(\"ConsultaItemSelect\");\n\t\t console.log('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado');\n\t\ttx.executeSql('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado', [], ConsultaLoadEstado,errorCB);\n\t\t console.log(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\");\n\t\ttx.executeSql(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\", [], ConsultaLineaCarga,errorCB);\n}", "static async getAllLaboratores(){\n const query = \n `\n SELECT \n u.firstname, u.lastname, u.mail, u.user_image, \n sc.social_class, sr.social_rank\n FROM user u\n JOIN social_class sc ON sc.id= u.social_class_id \n JOIN social_rank sr ON sr.id = u.social_rank_id\n WHERE sc.social_class = \"Laboratores\";\n `;\n const [result] = await connection.query(query)\n return result;\n }", "function alumnoRegistro(){\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n if(perfil === 2){\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML =\r\n `<label for=\"selListaDocentes\">Elija docente: </label><select id=\"selListaDocentes\"> \r\n </select>`;\r\n for (let i = 0; i < usuarios.length; i++) {\r\n const element = usuarios[i];\r\n if(element.perfil === \"docente\"){\r\n document.querySelector(\"#selListaDocentes\").innerHTML +=\r\n `<option value=\"${element.nombreUsuario}\">${element.nombre} (${element.nombreUsuario}) </option>`\r\n }\r\n }\r\n }else{\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML = \"\";//Esta funcion corre cada vez que hay alguien selecciona un perfil en el formulario de registro, si cambia para otro que no sea alumno (2) viene aca y elimina el <select> de docente\r\n }\r\n}", "function obtenerResultados(req, res) {\n var id = req.params.id;\n var peticionSql = leerSql(\"obtenerResultados.sql\") + id + `\n GROUP BY pelicula.id\n ORDER BY votos DESC\n LIMIT 0,3;`\n\n conexionBaseDeDatos.query(peticionSql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n // Si la competencia no ha recibido votos devolvemos el mensaje correspondiente\n if(!resultado || resultado.length == 0) {\n console.log('Esta competencia aun no ha recibido votos.');\n return res.status(422).send('Esta competencia aun no ha recibido votos');\n } else {\n var respuesta = {\n competencia: resultado[0].nombre,\n resultados: resultado,\n }\n res.status(200).send(JSON.stringify(respuesta));\n }\n })\n}", "function obtenerValoresManiobras(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_maniobras WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 76; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_maniobras\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_maniobras_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function seleccionarOrden(productos){\n \n\n let rowProductos = document.querySelector(\".buzos__row\");\n\n rowProductos.innerHTML=\"\";\n\n let select = document.querySelector(\".selectOrdenProductos\");\n \n switch(select.value){\n\n case 'date':\n getPaginacion(ordenarProductosFecha(productos));\n break;\n \n case 'price-asc':\n getPaginacion(ordenarProductosPrecio(productos, \"asc\"));\n break;\n\n case 'price-des':\n getPaginacion(ordenarProductosPrecio(productos, \"des\"));\n break;\n\n }\n \n}", "function obtenerClientes() {\n\t\tconst conexion = window.indexedDB.open('crm', 1);\n\n\t\tconexion.onerror = () => console.log('Hubo un error');\n\n\t\tconexion.onsuccess = () => {\n\t\t\tDB = conexion.result;\n\n\t\t\tconst objectStore = DB.transaction('crm').objectStore('crm');\n\n\t\t\tobjectStore.openCursor().onsuccess = (e) => {\n\t\t\t\tconst cursor = e.target.result;\n\n\t\t\t\tif (cursor) {\n\t\t\t\t\tconst { nombre, empresa, email, telefono, id } = cursor.value;\n\n\t\t\t\t\tconst listado = document.querySelector('#listado-clientes');\n\n\t\t\t\t\tlistado.innerHTML += `\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200\">\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-5 font-medium text-gray-700 text-lg font-bold\"> ${nombre} </p>\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-10 text-gray-700\"> ${email} </p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 \">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-700\">${telefono}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 leading-5 text-gray-700\">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-600\">${empresa}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5\">\n\t\t\t\t\t\t\t\t<a href=\"editar-cliente.html?id=${id}\" class=\"text-teal-600 hover:text-teal-900 mr-5\">Editar</a>\n\t\t\t\t\t\t\t\t<a href=\"#\" data-cliente=\"${id}\" class=\"text-red-600 hover:text-red-900 eliminar\">Eliminar</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t`;\n\t\t\t\t\tcursor.continue();\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('No hay más registros');\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t}", "function obtenerValoresPreliminar(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem_preli,v_calificacion,o_observacion FROM puertas_valores_preliminar WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=seleval\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $(\"#text_obser_item\"+i+\"_eval_prel\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function lireTousLesAdmins(){\n return connSql.then(function (sql) {\n let resultat = sql.query(\"SELECT * FROM administrateur\");\n return resultat\n });\n}", "function getTypesComplain(req, res) {\n /**Nota\n * mandar por la url el filtro para obtenerna; por id, por nombre.\n */\n var filtro = req.params.filtro;\n var dato = req.params.dato;\n var connection = dbConnection();\n switch (filtro) {\n case \"id\":\n connection.query(\"SELECT * FROM tipo_queja WHERE id_tipo_queja=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n case \"descripcion\":\n dato = \"'\" + dato + \"'\"\n connection.query(\"SELECT * FROM tipo_queja WHERE descripcion=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n\n }\n\n}", "async function selectRota(dado){\n const conn = await connect();\n const sql = 'SELECT rota, funcao FROM Jogabilidade WHERE idJog =?;';\n const value = [dado.idJog];\n const [rows] = await conn.query(sql,value);\n return rows\n}", "function obtenerValoresMotorizacion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_motorizacion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 43; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_motorizacion\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_motorizacion_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function mostraSelect(i){\n $tabelaRoubos.innerHTML = '';\n\n criaTabela($tabelaRoubos, `Estamina requerida:`, `${roubosGrupo[i].estaminaR}%`,null,null);\n criaTabela($tabelaRoubos, `Power de roubo:`, roubosGrupo[i].powerNecessario,null,null);\n criaTabela($tabelaRoubos, `Recompensa:`, roubosGrupo[i].recompensaTxt,null,null);\n \n $tabelaRoubos.classList.add('visivel');\n}", "function loadAll() {\n var cidades = eurecaECBrasil.filtrarCidadeTextoService();\n return cidades.split(/, +/g).map( function (cidade) {\n return {\n value: cidade.toLowerCase(),\n display: cidade\n }; \n });\n }", "getPreguntasSinResponder(callback) {\n this.pool.getConnection(function (err, conexion) {\n \n if (err)\n callback(err);\n else {\n \n const sql = \"SELECT p.id_pregunta, p.id_usuario, p.titulo, p.cuerpo,p.fecha,u.nombre,u.imagen FROM preguntas AS p JOIN usuario AS u ON p.id_usuario=u.id_usuario WHERE p.respuesta=FALSE ORDER BY p.fecha DESC;\"; \n\n conexion.query(sql, function (err, resultado) {\n conexion.release();\n if (err)\n callback(err);\n else\n callback(null, resultado);\n }); \n }\n });\n }", "function getAll() {\n return connSql.then(function(conn){\n let resultat = conn.query(\"SELECT * FROM chambre\");\n return resultat\n });\n}", "function traer_grupo(req,res){\n\tCONN('grupo').select().then(grupos =>{\n\t\tconsole.log(grupos);\n\t\tif (!grupos){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de grupo', grupos:grupos });\n\t\t}\n\n\t})\n}", "function consultargrupo(req,res){\n\tlet consulgrupo = new Grupoempresa(req.body.grupo)\n\n\tCONN('grupo').where('grupo',req.body.grupo).select().then(traergrupo =>{\n\t\tconsole.log(traergrupo);\n\t\tif (traergrupo == ''){\n\t\t\tCONN('grupo').insert(consulgrupo).then(insertargrupo =>{\n\t\t\t\tif (!insertargrupo){\n\t\t\t\t\tres.status(500).send({resp:'error', error: 'no se inserto grupo'});\n\t\t\t\t}else{\n\t\t\t\t\tres.status(200).send({resp: 'grupo guardado', insertargrupo:insertargrupo });\n\t\t\t\t}\n\t\t\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp:'error', error: `${error}` });\n\t\t\t});\n\t\t}else{\n\t\t\tres.status(200).send({resp: 'grupo', traergrupo:traergrupo });\n\t\t}\n\n\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp:'error', error: `${error}` });\n\t\t\t});\n}", "function listarMedicoseAuxiliares(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select crmv, nomeMedico, telefoneMedico, emailMedico from Medico, Responsavel where Medico.Estado = Responsavel.Estado and Medico.Cidade = Responsavel.Cidade and Responsavel.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "async function getFormularNames(req, res) {\n var formulars = await pool.query(\"select * from formular\");\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n return res.status(200).send(formulars.rows);\n}", "function buscarUsuario(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find({}, 'nombre email role') // para que solo se muestre esos campos\n .or([{ 'nombre': regex }, { 'email': regex }])\n .exec((err, usuarios) => {\n if (err) {\n reject('error al cargar usuarios');\n\n } else {\n resolve(usuarios);\n }\n });\n\n });\n\n}", "function fSelReg(aDato, iCol) {\n\t\n\tif(aDato[0]==\"1\"){\n\t\tfrm.iEjercicio.value=aDato[23];\n\t\tfrm.iNumSolicitud.value=aDato[24];\n\t\tfrm.iCveHist.value=\"\";\n\t\t\n\t}else{\n\t\tfrm.iEjercicio.value=-1;\n\t\tfrm.iNumSolicitud.value=-1;\n\t\tfrm.iCveHist.value=aDato[17];\n\t}\n\t\n\t if(iCol==16 && aDato[0]==\"1\"){\n\t\t fArchivosADV();\n\t }else if(iCol==16 && aDato[0]==\"0\"){\n\t\t fArchivosHist();\n\t }\n\t\n}", "function obtenerValoresMecanicos(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_mecanicos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_mecanicos\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_lv_valor_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function carregarListaSolicitantes(){\n\tdwr.util.useLoadingMessage();\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tFacadeAjax.getListaSolicitantes(unidade, function montaComboUnidadeTRE(listBeans){\n\t\tDWRUtil.removeAllOptions(\"comboUnidadesSolicitantes\");\n\t\tDWRUtil.addOptions(\"comboUnidadesSolicitantes\", listBeans, \"idUnidade\",\"nome\");\n\t});\n}", "function listarInstrutores () {\n instrutorService.listar().then(function (resposta) {\n //recebe e manipula uma promessa(resposta)\n $scope.instrutores = resposta.data;\n })\n instrutorService.listarAulas().then(function (resposta) {\n $scope.aulas = resposta.data;\n })\n }", "static async buscarTurmas(req, res) {\n /* Passa via objeto descontruido os campos que\n serão usados para consulta de registros através do\n endpoint, usando o req,query */\n const { data_inicial, data_final } = req.query;\n\n /*Criação do objeto que será usado \n como parâmetro na busca de registros */\n const where = {};\n\n /*Criação da condicional com operadores que será usada\n para a busca de registros\n \n Campo Chave 1 || Campo Chave 1, caso forem vazios, parametro é \n passado em branco\n\n Caso informado, usa a propriedade do OP: \n gte - gratter than or equal, maior ou igual\n lte, letter than or equal, menor ou igual\n */\n data_inicial || data_final ? (where.data_inicio = {}) : null;\n data_inicial ? (where.data_inicio[Op.gte] = data_inicial) : null;\n data_final ? (where.data_inicio[Op.lte] = data_final) : null;\n\n try {\n const consultaTurmas = await //Enquanto executa\n /* Método Sequelize para busca de registros, \n passando via parâmetro o objeto criado */\n database.Turmas.findAll({ where });\n\n /*Retorna a consulta do banco no formato JSON */\n return res.status(200).json(consultaTurmas);\n } catch (error) {\n /*Em caso de erro, retorna o cod. erro (500) e sua mensagem\n em formato JSON */\n return res.status(500).json(error.message);\n }\n }", "async getDatosAcopio() {\n let query = `SELECT al.almacenamientoid, ca.centroacopioid, ca.centroacopionombre, \n concat('Centro de Acopio: ', ca.centroacopionombre, ' | Propietario: ', pe.pernombres, ' ', pe.perapellidos) \"detalles\"\n FROM almacenamiento al, centroacopio ca, responsableacopio ra, persona pe\n WHERE al.centroacopioid = ca.centroacopioid AND ca.responsableacopioid = ra.responsableacopioid AND ra.responsableacopioid = pe.personaid;`;\n let result = await pool.query(query);\n return result.rows; // Devuelve el array de json que contiene todos los controles de maleza realizados\n }", "static async getAllOratores(){\n const query = \n `\n SELECT \n u.firstname, u.lastname, u.mail, u.user_image, \n sc.social_class, sr.social_rank\n FROM user u\n JOIN social_class sc ON sc.id= u.social_class_id \n JOIN social_rank sr ON sr.id = u.social_rank_id\n WHERE sc.social_class = \"Oratores\" \n AND sr.social_rank != \"King\" AND sr.social_rank != \"Queen\" AND sr.social_rank != \"Prince\" AND sr.social_rank != \"Princess\";\n `;\n const result = await connection.query(query)\n return result;\n }", "function limpiarSelect() {\n var select = document.getElementById('select-bd-postgres');\n while (select.firstChild) {\n select.removeChild(select.firstChild);\n }\n}", "function listaRecomendadas(req, res) {\n\n var sqlRecomienda = \"select pelicula.id,titulo,duracion,director,anio,fecha_lanzamiento,puntuacion,poster,trama,nombre from pelicula join genero on pelicula.genero_id = genero.id where pelicula.id = pelicula.id\";\n \n if (req.query.genero) {\n genero = req.query.genero;\n sqlRecomienda = sqlRecomienda + \" and genero.nombre =\" +\"'\"+genero+\"'\";\n }\n\n if (req.query.anio_inicio) {\n var anioInicio = req.query.anio_inicio;\n sqlRecomienda = sqlRecomienda + \" and pelicula.anio between \" +anioInicio;\n }\n\n if (req.query.anio_fin) {\n var anioFin = req.query.anio_fin;\n sqlRecomienda = sqlRecomienda + \" and \" +anioFin;\n }\n\n if (req.query.puntuacion) {\n var puntuacion = req.query.puntuacion;\n sqlRecomienda = sqlRecomienda + \" and puntuacion >=\" +puntuacion;\n }\n\n var response = {\n 'peliculas': \"\",\n }\n\n \n con.query(sqlRecomienda, function(error, resultado, fields) {\n errores(error, res);\n response.peliculas = resultado;\n res.send(JSON.stringify(response));\n });\n}", "function buscarPorColeccion(req, res) {\n\n // viene x los params de la url \n let busqueda = req.params.bus;\n let tabla = req.params.tabla;\n\n // busqueda es el parametro de la url \n // 'i' may y minus es insensible\n let regex = new RegExp(busqueda, 'i'); // aqui convertimos la busqueda con la ex regular\n\n let promesa;\n\n // busqueda contiene lo que busco \n // ej : coleccion/usuarios/manuel ===>>> colecccion/tabla/busqueda\n\n // pregunto por cada coleccion que viene en la tabla \n switch (tabla) {\n\n case 'usuarios':\n promesa = buscarUsuarios(busqueda, regex);\n break;\n\n case 'controles':\n promesa = buscarControles(busqueda, regex);\n break;\n\n case 'modulos':\n promesa = buscarModulos(busqueda, regex);\n break;\n\n case 'hospitales':\n promesa = buscarHospitales(busqueda, regex);\n break;\n\n case 'medicos':\n promesa = buscarMedicos(busqueda, regex);\n break; \n\n default:\n\n return res.status(400).json({\n ok: false,\n mensaje: 'los colecciones de busqueda solo son usuarios, modulos y controles',\n error: { message: 'tipo de coleccion/documento no valido' }\n })\n }\n\n // en ecma6 existe propiedades de obj computadas \n // ponemos tabla entre [] y nos da su valor , que puede ser usuarios medicos hospitales \n // si no lo ponemos entre [] imprime tabla \n\n promesa.then(data => {\n\n res.status(200).json({\n ok: true,\n [tabla]: data\n })\n })\n\n}", "static consultarClientes(callback) {\n //Armamos la consulta segn los parametros que necesitemos\n let query = 'SELECT * ';\n query += 'FROM '+table.name+';'; \n //Verificamos la conexion\n if(sql){\n sql.query(query, (err, result) => {\n if(err){\n throw err;\n }else{ \n let clientes = [];\n for(let entity of result){\n let cliente = Cliente.mapFactory(entity); \n clientes.push(cliente);\n } \n console.log(clientes); \n callback(null,clientes);\n }\n })\n }else{\n throw \"Problema conectado con Mysql\";\n } \n }", "function buscarGrupos(busqueda, regex) {\n return new Promise((resolve, reject) => {\n Grupo.find({ nombre: regex })\n .populate('usuario', 'nombre email')\n .exec((err, grupos) => {\n if (err) {\n reject('Error al cargar grupos', err);\n } else {\n resolve(grupos);\n }\n });\n });\n}", "function buscarUsuarios(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n // al poner 2do argumento , no traigo el pass\n Usuario.find({}, 'nombre imagen ') // enviamos un obj vacio y buscamos por nombre email etc : es lo que quiero traer , es lo que va a mostrar \n .or([{ 'nombre': regex }, { 'email': regex }]) // en cambio aqui envio un array de condiciones para buscar, busco por email y nombre\n .exec((err, usuarios) => {\n\n if (err) {\n reject('error al cargar usuarios', err)\n } else {\n // usuarios ira como respuesta en el array respuesta[2]\n resolve(usuarios) // devuelve los usuarios encontrados en el find\n }\n })\n });\n}", "static async buscarNiveis(req, res) {\n try {\n const consultaNiveis = await //Enquanto executa\n niveisServices.buscarRegistros() /* Método Sequelize para busca de registros */\n\n /*Retorna a consulta do banco no formato JSON */\n return res.status(200).json(consultaNiveis)\n\n } catch (error) {\n\n /*Em caso de erro, retorna o cod. erro (500) e sua mensagem\n em formato JSON */\n return res.status(500).json(error.message)\n }\n }", "function obtenerValoresElectrica(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_electrica WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 38; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_electrica\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_electrica_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function cadastrarTecnico(){\n\tvar matriculaTecnico = DWRUtil.getValue(\"comboTecnicoTRE\");\n\tvar login = DWRUtil.getValue(\"login\"); \n\tif((matriculaTecnico==null ||matriculaTecnico=='')){\n\t\talert(\"Selecione um tecnico do TRE.\");\n\t}else{\n\t\tFacadeAjax.integrarTecnico(matriculaTecnico,login);\n\t\tcarregaTecnicos();\t\n\t}\n\t\n}", "function recuperaSelect() {\n $.ajax({\n url: '../modelo/crud.php',\n method: 'post',\n data: {\n 'opcion': 10,\n 'idprofesor': idpersonasProfesor\n },\n success: function(data) {\n data = $.parseJSON(data);\n // mostramos los datos del alumnos\n let resulAlumno = '<option value=\"0\">Elige una opción</option>';\n data.alumno.forEach(function(element) {\n resulAlumno += '<option value=' + element.idpersonas + '>' + element.idpersonas + ' - ' + element.nombre + ' - ' + element.apellido + '</option>';\n });\n $('#lista_reproduccion').html(resulAlumno);\n\n // mostramos los datos de los cursos\n let resulCurso = '<option value=\"0\">Elige una opción</option>';\n data.curso.forEach(function(element) {\n resulCurso += '<option value=' + element.idcursos + '>' + element.idcursos + ' - ' + element.curso + '</option>';\n });\n $('#lista_cursos').html(resulCurso);\n\n },\n error: function(xhr, status) {\n alert('Disculpe, existio un problema');\n }\n });\n}", "function ordenar() {\n let seleccion = $(\"#miSeleccion\").val().toUpperCase();\n popularListaCompleta();\n listaCompletaClases = listaCompletaClases.filter(Clase => Clase.dia ==\n seleccion);\n renderizarProductos();\n}", "function buscarHospitales(regex){\n return new Promise((resolve,reject)=>{\n Hospital.find({ nombre: regex }).populate('usuario','nombre apellido').exec((err,hospitales)=>{\n if(err){\n reject('Error al cargar hospitales',err);\n }else{\n resolve(hospitales);\n }\n });\n });\n}", "function listar() {\n\n\t\ttabla=$('#resolucion_data').dataTable({\n\t\t\t\"aProcessing\":true,//Activamos procesamiento de datatable\n\t\t\t\"aServerSide\":true,//Paginacion y filtrado realizados por el servidor\n\t\t\tdom:'Bfrtip',//Definimos los elementos del control de table\n\t\t\tbuttons:[\n\t\t\t\t'copyHtml5',\n\t\t\t\t'excelHtml5',\n\t\t\t\t'pdf'//para los botones en el datatable\n\t\t\t\t],\n\t\t\t\"ajax\":\n\t\t\t{\n\t\t\t\turl:'../ajax/resolucion.php?op=buscar_resolucion',//enviamos el parametro \n\t\t\t\ttype:\"get\",//el tipo del parametro\n\t\t\t\tdataType:\"json\",//formato de la data\n\n\t\t\t\terror: function (e) {\n\t\t\t\t\tconsole.log(e.responseText);//para hacer la verificacion de errores\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"bDestroy\":true,\n\t\t\t\"responsive\":true,\n\t\t\t\"bInfo\":true,//informacion del los datatable\n\t\t\t\"iDisplayLength\":20,//Pora cada 10 registros hace una paginacion\n\t\t\t\"order\":[[0,\"desc\"]],//Ordenar (Columna,orden)\n \t\t\t\n \t\t\t\"language\": {\n \n\t\t\t \"sProcessing\": \"Procesando...\",\n\t\t\t \n\t\t\t \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t \n\t\t\t \"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t \n\t\t\t \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t \n\t\t\t \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\t\t\t \n\t\t\t \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\t\t\t \n\t\t\t \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t \n\t\t\t \"sInfoPostFix\": \"\",\n\t\t\t \n\t\t\t \"sSearch\": \"Buscar:\",\n\t\t\t \n\t\t\t \"sUrl\": \"\",\n\t\t\t \n\t\t\t \"sInfoThousands\": \",\",\n\t\t\t \n\t\t\t \"sLoadingRecords\": \"Cargando...\",\n\t\t\t \n\t\t\t \"oPaginate\": {\n\t\t\t \n\t\t\t \"sFirst\": \"Primero\",\n\t\t\t \n\t\t\t \"sLast\": \"Último\",\n\t\t\t \n\t\t\t \"sNext\": \"Siguiente\",\n\t\t\t \n\t\t\t \"sPrevious\": \"Anterior\"\n\t\t\t \n\t\t\t },\n\t\t\t \n\t\t\t \"oAria\": {\n\t\t\t \n\t\t\t \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t \n\t\t\t \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\n\t\t\t }\n\n\t\t\t }//cerrando language\n\t\t}).DataTable();\n\t}", "function fCargaListadoA(){\n frm.hdFiltro.value = \"ICVEMODULO = \" +frm.iCveModulo.value+ \" AND INUMREPORTE NOT IN (SELECT INUMREPORTE FROM GRLREPORTEXOPINION WHERE ICVEOPINIONENTIDAD = \"+frm.iCveOpinionEntidad.value+ \" AND ICVESISTEMA = 44 AND ICVEMODULO = \" +frm.iCveModulo.value+ \" )\";\n frm.hdOrden.value = \" CNOMREPORTE\";\n frm.hdNumReg.value = 100000;\n fEngSubmite(\"pgGRLReporteA.jsp\",\"GRLReporte\");\n }", "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "function cambiarMapas()\r\n{\r\n\t opcion = sel.value();\r\n}", "function guardarCursosAsociar() {\n\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]:checked');\n let cursosSeleccionados = [];\n let codigoCurso;\n\n //Este ciclo for debe empezar en 1, ya que en el cero \"0\" se encuentra el id unico del elemento al que se le desea agregar elementos\n for (let i = 0; i < listaCheckboxCursos.length; i++) {\n codigoCurso = listaCheckboxCursos[i].dataset.codigo;\n cursosSeleccionados.push(codigoCurso);\n }\n\n return cursosSeleccionados;\n\n\n}", "buscaPorIdEstado(id, res) {\n const sql = `select ti.*, e.nome as estado, e.sigla, r.nome as regiao from times ti\n inner join estados e on (e.estado_id = ti.estado_id)\n inner join regioes r on (r.regiao_id = e.regiao_id)\n where e.estado_id = ${id} `\n\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "function obtenerValoresProteccion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_sele_inspector,v_sele_empresa,o_observacion FROM puertas_valores_proteccion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_protec_person\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_inspector+\"']\").prop(\"checked\",true);\n $(\"input[name=sele_protec_person\"+i+\"_\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_empresa+\"']\").prop(\"checked\",true);\n $('#text_obser_protec_person'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function getLogAggiornamenti (req) {\n\n var queryText = 'SELECT ' +\n 'tabella, to_char(data_aggiornamento,' + '\\'' + 'DD-MM-YYYY' + '\\'' + ') data_aggiornamento ' +\n 'FROM pronolegaforum.log_aggiornamenti ' +\n 'ORDER BY tabella';\n\n return db.any(queryText);\n\n}", "static GetUtilidad(cadenaDeConexion, fI, fF, idSucursal, result) {\n\n var sucursal = '';\n if (idSucursal != 1) {\n sucursal = `AND info_ingresos.codSucursal=` + idSucursal;\n }\n console.log(\"sucursal \", sucursal);\n sqlNegocio(\n cadenaDeConexion,\n ` SELECT base.codMes, SUM(base.precioVenta) as totalVenta from (SELECT info_grupopartidas.nombreGrupo,info_ingresos.codMes,\n\n CASE info_grupopartidas.nombreGrupo\n WHEN 'EGRESOS' THEN -(SUM(info_ingresos.sumPrecioVenta))\n WHEN 'INGRESOS' THEN SUM(info_ingresos.sumPrecioVenta)\n END as precioVenta\n \n \n from info_ingresos LEFT JOIN\n info_partidas on info_ingresos.idPartida = info_partidas.idPartida LEFT JOIN \n info_grupopartidas on info_grupopartidas.idGrupoPartida = info_partidas.idGrupo \n where info_ingresos.fecEmision BETWEEN '`+ fI + `' AND '` + fF + `' AND info_ingresos.estado=1 ` + sucursal + ` AND ( info_grupopartidas.nombreGrupo = 'EGRESOS' or info_grupopartidas.nombreGrupo = 'INGRESOS')\n group by info_grupopartidas.nombreGrupo,info_ingresos.codMes)as base group by base.codMes\n order by base.codMes ASC`,\n [],\n function (err, res) {\n if (err) {\n console.log(\"error: \", err);\n result(null, err);\n }\n else {\n result(null, res);\n }\n });\n }", "function busca(busca) {\n $.ajax({\n type: \"POST\",\n url: \"acoes/select.php\",\n dataType: \"json\",\n data: {//tipo de dado\n 'busca':\"busca\"//botão pra inicia a ação\n }\n\n }).done(function (resposta) { //receber a resposta do busca\n console.log('encontrei ' + resposta.quant + ' registros');\n console.log(resposta.busca[0,'0'].id, resposta.busca[0,'0'].descri);\n if(resposta.erros){\n\n //criação das variaves apos o receber a resposta da pagina select\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qntp = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var st = resposta.busca[i]['9']\n //criação da tabela para exebição do resultado\n $('.carro td.descri').append(\" <tr><td ><p class=' text-capitalize id='des' value='\"+desc+\"'>\"+desc +'</p></td></tr>')\n $('.carro td.marca').append(\" <tr><td ><p class=' text-capitalize id='mar' value='\"+mar+\"'>\"+mar +'</p></td></tr>')\n $('.carro td.modelo').append(\" <tr><td ><p class=' text-capitalize id='mod' value='\"+mod+\"'>\"+mod +'</p></td></tr>')\n $('.carro td.tipov').append(\" <tr><td ><p class=' text-capitalize id='tpv' value='\"+tpv+\"'>\"+tpv +'</p></td></tr>')\n $('.carro td.quantp').append(\" <tr><td ><p class=' text-capitalize id='qnt' value='\"+qntp+\"'>\"+qntp +'</p></td></tr>')\n $('.carro td.vlvenda').append(\" <tr><td ><p class=' text-capitalize id='vlv' value='\"+vlv+\"'>\"+vlv +'</p></td></tr>')\n $('.carro td.vlcompra').append(\" <tr><td ><p class=' text-capitalize id='vlc' value='\"+vlc+\"'>\"+vlc +'</p></td></tr>')\n $('.carro td.dtcompra').append(\" <tr><td ><p class=' text-capitalize id='dtc' value='\"+dtc+\"'>\"+dtc +'</p></td></tr>')\n $('.carro td.estato').append(\" <tr><td ><p class=' text-capitalize id='st' value='\"+st+\"'>\"+st +'</p></td></tr>')\n $('.carro td.id').append(\" <tr><td ><button class='r btn btn-sm btn-primary nav-link' id='idvalor' type='button' data-toggle='modal' data-target='#atualFormulario' value='\"+id+\"'>\"+\"Edit\"+'</button></td></tr>')\n $('.carro td.ider').append(\"<tr><td ><button class='del btn btn-sm btn-danger nav-link' type='button' name='idel' value='\"+id+\"'>\"+\"Del\"+'</button></td></tr>')\n\n\n }\n\n\n //função pra por valores da tabela no input do formulario de atualização\n //aqui insere os o ID no formulario de atualização\n $('.r').click('button',function() {\n var idvl = $(this).val();\n $('#i1'). val(idvl);\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qnt = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var sta = resposta.busca[i]['9']\n //aqui comparamos o valor que recuperamos o id da tabela e comparfamos com o id da função busca\n if (idvl==id) {\n $('#descri1'). val(desc);\n $('#marca1'). val(mar);\n $('#modelo1'). val(mod);\n $('#tipov1'). val(tpv);\n $('#quantp1'). val(qnt);\n $('#vlvenda1'). val(vlv);\n $('#vlcompra1'). val(vlc);\n $('#dtcompra1'). val(dtc);\n $('#estato1'). val(sta);\n console.log(idvl);\n\n }\n\n\n\n\n\n }\n })\n //aqui finda\n\n //deleta via ajax\n $('.del').click('button',function() {\n var idel = $(this).val();\n console.log(idel);\n $.ajax({\n url: \"acoes/del.php\",\n type: \"POST\",\n data : { 'idel': idel },\n success: function(data)\n {\n location.reload(\".carro\");//atualiza o contener apos a execução com sucesso\n }\n });\n }); // delete close\n\n\n }\n })\n }", "function CargarListado(tx) {\n\tif(busqueda!=null){\t\n\t console.log(\"SELECT sub.id_linea, sub.id_sublinea, art.nom_articulo, art.referencia, art.serie, placa_nueva, placa_anterior, art.id_envio, marca, id_estado, art.id_articulo,art.fecha_fabricacion FROM publicarticulo art LEFT JOIN publicsublinea sub ON sub.id_sublinea = art.id_sublinea WHERE art.rowid ='\"+res[3]+\"'\");\n\t tx.executeSql(\"SELECT sub.id_linea, sub.id_sublinea, art.nom_articulo, art.referencia, art.serie, placa_nueva, placa_anterior, art.id_envio, marca, id_estado, art.id_articulo,art.fecha_fabricacion FROM publicarticulo art LEFT JOIN publicsublinea sub ON sub.id_sublinea = art.id_sublinea WHERE art.rowid ='\"+res[3]+\"'\", [], MuestraItems);\n\t}\n}", "function allCustomers(req, res){\n var getAllCustomersQuery = \"SELECT * FROM Customer\\n\"+\n \"WHERE active = 'Y'\\n\"+\n \"order by custName\"; \n connection().query(getAllCustomersQuery, function(error, result, fields){\n if(error){\n console.log(\"Hubo un error al obtener la lista de clientes\", error.message);\n return res.status(404).send(\"Hubo un error en la consulta allCustomers\");\n }\n\n if(result.length == 0){\n return res.status(404).json(\"No se encontraron clientes registrados\");\n }\n\n var response = {\n 'clientes': result\n };\n \n res.send(response);\n });\n}", "function cargaComplementos(){\n //Cargado del DataTables\n if($('table').length>0){\n $('table').DataTable();\n }\n \n //Cargado del DatePicker\n if($(\".date-picker\").toArray().length>0){\n $('.date-picker').datepicker({\n format : \"dd/mm/yyyy\"\n });\n }\n \n //Cargado del Input Mask con el formato \"dd/mm/yyyy\"\n if($('.input-date').toArray().length>0){\n $(\".input-date\").inputmask(\"dd/mm/yyyy\");\n }\n if($('.select2').toArray().length>0){\n $(\".select2\").select2({\n placeholder : \"Seleccione una opción\"\n });\n }\n}", "function criaSelectRoubos(){\n let i = 0\n $selectRoubos.innerHTML= '';\n roubosGrupo.forEach(function(rg){\n \n let option1 = document.createElement('option')\n option1.value = i;\n option1.text = `${rg.nome} - ${rg.powerNecessario}`;\n $selectRoubos.append(option1);\n i++;\n })\n}", "function buscarBarrios(consulta){\n $.ajax({\n url: uri+ '/Ruta/consultar_barrio',\n type:'POST',\n datatype:'HTML',\n data:{\n id:consulta,\n },\n })\n .done(function(datos){\n $('#ddlbarri').html(datos);\n })\n\n .fail(function(){\n console.log(\"error\");\n });\n}", "function al_seleccionar_canal(){\n\t\t$(form_publicidad.canal).on('change',function(e){\n\n\t\t\t//limpiarSelect(1);\n\t\t\tcargarSelectContenido(1);\n\n\t\t});\n\t}", "function _CarregaTemplates() {\n var select_template = Dom('template');\n if (select_template == null) {\n // Testes não tem o select.\n return;\n }\n select_template.appendChild(CriaOption('Nenhum', ''))\n for (var chave_template in tabelas_template) {\n select_template.appendChild(CriaOption(Traduz(tabelas_template[chave_template].nome), chave_template))\n }\n}", "async function obtenerTodosLasCiudadesXpais(pais_id) {\n var queryString = '';\n\n console.log('ENTRE');\n queryString = queryString + ' SELECT cd.id, cd.nombre as ciudad';\n queryString = queryString + ' from ciudades cd where pais_id = ? ';\n\n \n\n let ciudad = await sequelize.query(queryString,\n { type: sequelize.QueryTypes.SELECT,\n replacements:[pais_id]})\n return ciudad;\n }", "async function buscar_usuarios(){\n let resultado_buscar_usuario = await sequelize.query('SELECT * FROM usuarios',{\n type: sequelize.QueryTypes.SELECT\n })\n return resultado_buscar_usuario\n}", "function traerempresas(req,res){\n\n\tCONN('empresa')\n\t.join('contacto_empresa','empresa.id_contacto','=','contacto_empresa.id_contacto')\n\t.join('status','empresa.id_status','=','status.id_status')\n\t.join('direccion_empresa','empresa.id_direccion','=','direccion_empresa.id_direccion')\n\t.join('colonia','direccion_empresa.id_colonia', '=','colonia.id_colonia')\n\t.join('alcaldia','direccion_empresa.id_alcaldia', '=','alcaldia.id_alcaldia')\n\t.join('estado','direccion_empresa.id_estado', '=','estado.id_estado')\n\n\t\n\n\t.select().orderBy('empresa.id_empresa')\n\t.then(todas =>{\n\t\t\tconsole.log(todas);\n\t\tif (!todas){\n\t\t\t\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa', todas:todas });\n\t\t}\n\t}).catch(error =>{\n\t\tres.status(500).send({resp: 'error', error: `${error}` });\n\t});\n}", "function selectAll() {\n //query all info from burgers_db\n var queryString = \"SELECT * FROM burgers;\"\n connection.query(queryString, function(err, result) {\n if (err) throw err;\n console.log(result);\n res.json(result);\n });\n }", "function consultar_trj() {\n\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\ttry {\n\t\t\tdocument.getElementsByClassName('lista_vendedores')[1].removeAttribute('selected', '')\n\t\t} catch (error) {\n\t\t}\n\t}\n\tvar envio = { numero: valor('numero_consulta') }\n\tcargando()\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-tarjetas/consultar-numero\",\n\t\tdata: envio\n\t}).done((respuesta) => {\n\t\tif (respuesta == 'Nada') {\n\t\t\t$('#div-error').html('Esta tarjeta no existe, o no ha sido vendida, individualmente sólo pueden modificarse tarjetas vendidas')\n\t\t\tdocument.getElementById('div-error').style.display = 'block'\n\t\t\tno_cargando()\n\t\t\treturn\n\t\t}\n\t\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\t\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\t\tif (opciones_vend[i].value == respuesta[0].vendedor) {\n\t\t\t\topciones_vend[i].setAttribute('selected', '')\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('div-error').style.display = 'none'\n\t\tasignar('mod_tar_num', respuesta[0].numero)\n\t\tasignar('mod_tar_inic', ordenarFechas(respuesta[0].fechainicial))\n\t\tasignar('mod_tar_fin', ordenarFechas(respuesta[0].fechafinal))\n\t\tvar cadena = '';\n\t\tfor (var i = 0; i < respuesta[0].locales.length; i++) {\n\t\t\ttry {\n\t\t\t\tcadena += `<div class=\"row fondo-blanco este-es-local\" style=\" width:100%\" id=\"${respuesta[1][i].codigo}\">\n\t\t\t\t\t\t\t\t<div class=\"col-lg-3 col-md-4\">\n\t\t\t\t\t\t\t\t<label>Local</label>\n\t\t\t\t\t\t\t\t<img width=\"100%\" src=\"${respuesta[1][i].logotipo}\"/>\n\t\t\t\t\t\t\t\t<h5 class=\"centrado\">${respuesta[1][i].nombre}</h5>\n\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t<div class=\"col-lg-9 col-md-8\">\n\t\t\t\t\t\t\t\t<div class=\"table\">\n\t\t\t\t\t\t\t\t\t<table class=\"table table-bordered\"><tr> <th>Beneficio</th><th colspan=\"2\">Estado</th></tr>`\n\t\t\t\tfor (var j = 0; j < respuesta[0].locales[i].beneficio.length; j++) {\n\t\t\t\t\tvar estado_benef = verificar_benef(respuesta[0].locales[i].beneficio[j].activo)\n\t\t\t\t\tcadena += `<tr>\n\t\t\t\t\t\t\t\t<td><textarea class=\"area-beneficios\" readonly style=\"width:100%; height:140px; border: solid 0px white\" resizable=\"none\">${ascii_texto(respuesta[0].locales[i].beneficio[j].beneficio)}\n\t\t\t\t\t\t\t\t</textarea></td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label><input value=\"1\" onchange=\"conSeleccion(this)\" class=\"benef_escog\" name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" ${estado_benef[0]} type=\"radio\"/> Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<label><input value=\"0\" onchange=\"sinSeleccion(this)\" class=\"benef_escog\" ${estado_benef[1]} name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" type=\"radio\"/> No Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t\tcadena += `</table>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>`\n\t\t\t} catch (error) {\n\t\t\t\tcadena += ''\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('loc_mod_tar').innerHTML = cadena\n\t\tdocument.getElementById('edicion_individual').style.display = 'block'\n\t\tdocument.getElementById('consulta_edicion').style.display = 'none'\n\t\tasignar('numero_consulta', '')\n\t\tno_cargando()\n\t})\n}", "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "function all(req, res, next) {\n db.any('select * from cliente')\n .then(function (data) {\n res.status(200)\n .json(data);\n })\n .catch( err => {\n console.error(\"error \"+err);\n return next(err);\n });\n}", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "async function todosArticulosController (req, res){\r\n let query = `SELECT Articulo, Nombre, UnidadCompra, UnidadVenta FROM Articulos`;\r\n let resultado = await createRawQuery({suc: 'bo', query})\r\n res.json(resultado)\r\n}", "function obtenerPersonas(res){\n var personas = [];\n tb_persona.connection.query('SELECT * FROM persona', function(err, rows){\n if(err) throw err;\n rows.forEach(function(result){\n personas.push(result);\n });\n res.send(personas);\n });\n}", "function listarRecursos(callback){\n\tFarola.find({}, null, callback);\n}", "async getAll() {\n try {\n const db = await this.conexion.conectar();\n const collection = db.collection('Encargados');\n const findResult = await collection.find({}).toArray();\n await this.conexion.desconectar();\n return (findResult);\n }\n catch (e) {\n throw e;\n }\n }" ]
[ "0.62919205", "0.6157102", "0.6133443", "0.613185", "0.6087473", "0.6078431", "0.607074", "0.5997127", "0.59788364", "0.59719163", "0.5947582", "0.59245485", "0.5897373", "0.58938044", "0.58775395", "0.5802812", "0.5802678", "0.5802365", "0.57918733", "0.5773877", "0.5763097", "0.57512057", "0.57484883", "0.5744551", "0.5735023", "0.5730328", "0.57121706", "0.5705367", "0.56815034", "0.56657594", "0.5657822", "0.5652507", "0.56516343", "0.56312627", "0.56278205", "0.56247693", "0.5622066", "0.56212103", "0.5620921", "0.56152225", "0.5606704", "0.5601186", "0.56005764", "0.5591142", "0.55865985", "0.55795527", "0.55763465", "0.55740815", "0.5571869", "0.5562409", "0.55611753", "0.5561105", "0.5558619", "0.5558404", "0.555685", "0.5551253", "0.5543649", "0.554101", "0.55405116", "0.55397743", "0.553699", "0.5531751", "0.55161816", "0.55154973", "0.551185", "0.5511317", "0.54912525", "0.54864675", "0.54833555", "0.5478968", "0.5473764", "0.54671293", "0.5460577", "0.54600394", "0.5456218", "0.54555017", "0.5444125", "0.5442233", "0.5440585", "0.54365873", "0.5434201", "0.5433249", "0.5427849", "0.5427634", "0.54268336", "0.541986", "0.54145575", "0.5413488", "0.54116076", "0.5403645", "0.5396786", "0.5395139", "0.5390243", "0.5387738", "0.5383468", "0.5383152", "0.5374944", "0.5365937", "0.5361371", "0.53577846", "0.53516227" ]
0.0
-1
SELECT: Devuelve todos los registros
obtenerProductoresMasculino() { return axios.get(`${API_URL}/v1/productorpersonaReporteM/`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTypesComplains(req, res) {\n var connection = dbConnection();\n connection.query(\"SELECT * FROM tipo_queja\", function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `No hay quejas guardadas` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n}", "campeao(res) {\n const sql = ` select ti.*, e.nome as estado, e.sigla, r.nome as regiao from times ti\n inner join estados e on (e.estado_id = ti.estado_id)\n inner join regioes r on (r.regiao_id = e.regiao_id)\n inner join partidas pa on (pa.time_id_vencedor = ti.time_id)\n order by pa.partida_id desc limit 1 `\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "function cargarGeneros(req, res) {\n var peticionsql = 'SELECT * FROM genero';\n \n conexionBaseDeDatos.query(peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "function listaModelos(){\n return new Promise((resolve,reject) => {\n let qry = `\n select \n usuarioCadastro, tbinfoveiculo.id, nomemodelo, tbmontadoras.nome, anofabricacao, cores, tipochassi, suspensaodianteira, suspensaotraseira, pneusdianteiro, pneutraseiro, freiodianteiro, freiotraseiro, tipodofreio,\n qtdcilindros, diametro, curso, cilindrada, potenciamaxima, torquemaximo, sistemadepartida, tipodealimentacao, combustivel, sistemadetransmissao, cambio, bateria, \n taxadecompessao, comprimento, largura, altura, distanciaentreeixos, distanciadosolo, alturadoassento, tanquedecombustivel, peso, arqFoto\n from tbInfoVeiculo inner join tbmontadoras on tbinfoveiculo.idmontadora = tbmontadoras.id\n `\n db.all(qry, (err,data) => {\n if(err) {\n reject(err);\n }\n resolve(data);\n })\n })\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "async getTodosLosSensores() {\n var textoSQL = \"select * from Sensor\";\n console.log(\"logica: getTodosLosSensores\")\n return new Promise((resolver, rechazar) => {\n this.laConexion.all(textoSQL, {},\n (err, res) => {\n (err ? rechazar(err) : resolver(res))\n })\n })\n }", "getMateriasProgra(ru,gestion,periodo){\n return querys.select(\"select * from consola.generar_programacion_completa(\"+ru+\",\"+gestion+\",\"+periodo+\",0)\");\n }", "function buscarAdministrativo(regex){\n return new Promise((resolve,reject)=>{\n Administrativo.find({}, 'identificacion nombres apellidos correo telefono programa cargo estado rol')\n .or([ {'identificacion':regex}, {'nombres':regex}, {'apellidos':regex}, {'telefono':regex}, {'correo':regex}, {'cargo': regex}])\n .populate('rol programa').exec((err,usuarios)=>{\n if(err){\n reject('Error al cargar los usuarios',err);\n }else{\n resolve(usuarios);\n }\n });\n });\n}", "static getAll() {\r\n return new Promise((next) => {\r\n db.query('SELECT id, nom FROM outil ORDER BY nom')\r\n .then((result) => next(result))\r\n .catch((err) => next(err))\r\n })\r\n }", "function listar(ok,error){\n console.log(\"Funcionlistar DAO\")\n helper.query(sql,\"Maestro.SP_SEL_ENTIDAD_FINANCIERA\",[],ok,error)\n}", "function getRutas(next) {\n RutaModel\n .query(`select r.idRuta, r.idVehiculo, r.noEconomico, r.idRemolque, r.salida, r.destino, r.idConductor, r.fechaSalida, r.fechaLlegada, r.tiempoEstimado,r.idEstado, r.idPrioridad,r.created_at, u.latitud, u.longitud, u.estadoGeoreferencia, u.municipioGeoreferencia, u.asentamientoGeoreferencia, u.direccionGeoreferencia, u.placa\n FROM rutas r, ubicaciones u where u.noEconomico=r.noEconomico`, (error, resultado, fields) => {\n\n next(error, resultado)\n })\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\" );\n}", "function consultarCitasUsuario(){\n\t\n\tvar idUsuario = $(\"#selectUsuario\").val();\n\t\n\t\n\tvar selectList = $(\"#otrosUsuarios\");\n\tselectList.find(\"option:gt(0)\").remove();\n\t\n\t//para mostrar nombre en spán de select usuarios\n\t$(\"#nombreUsuarioSeleccionado\").html( $(\"#selectUsuario option:selected\").text() );\n\t\n\t$(\"#selectUsuario option\").each(function(){\n // Add $(this).val() to your list\n \tif( ($(\"#selectUsuario\").val() != $(this).val()) && ($(\"#selectUsuario\").val() != \"\") && ($(\"#selectUsuario\").val() != null) && ($(this).val() != \"\") && ($(this).val() != null) ){\n \t\t\n \t\t$('#otrosUsuarios').append($('<option>', {\n\t\t \tvalue: $(this).val(),\n\t\t \ttext: $(this).text()\n\t\t\t}));\n \t\t\n \t}\n\t\t\n\t});\t\n\t\n \t $('#otrosUsuarios').material_select('destroy');\n \t $('#otrosUsuarios').material_select();\t\n \t \n \t //se recorre el select que se acabo de contruir para dar los ids a los checkbox de materialize\n \t $(\"#otrosUsuarios option\").each(function(){\n\t\t\n \t$(\"#nuevaCitaOtrosUsuariosMultiple\").find('span:contains(\"'+$(this).text()+'\")').parent('li').attr('id', 'multipleCreando'+$(this).val());\n \t$('#multipleCreando'+$(this).val()).attr(\"onClick\", 'comprobarSeleccionMultipleNuevaCita(this.id)');\n\t\t\n\t});\t\n \t \n\n\t$(\"#calendar\").fullCalendar( 'destroy' );\n\tcontruirCalendario();\t\n\t\n\t\n}", "function CargarColletIDs(){\n\n var sql = \"SELECT ID_Colecciones,Nombre FROM Colecciones\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n function querySuccess(tx, results) {\n var len = results.rows.length;\n for (var i=0; i<len; i++)\n $('#SelectorColecciones').append('<option value=\"' + results.rows.item(i).ID_Colecciones + '\">' + results.rows.item(i).Nombre + '</option>');\n\n }\n\n function errorCB(err) {\n alert(\"Error al rellenar selector de coleciones: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n\n}", "function ConsultaItems(tx) {\n\t\ttx.executeSql('select id_empresa,nom_empresa from publicempresa order by nom_empresa', [], ConsultaItemsCarga,errorCB);\n}", "function buscarHospitales(regExp) {\n\n return new Promise((resolve, reject) => {\n Hospital.find({ nombre: regExp }, (err, hospitales) => {\n if (err) {\n reject(\"Error al cargar hospitales\", err);\n } else {\n resolve(hospitales);\n }\n\n })\n });\n\n}", "static getAll(){\n // Retourne promise\n return new Promise((resolve, reject) => {\n // Requete Select \n db.query(\"SELECT * FROM salles\", (err, rows) => {\n if(err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n })\n }", "getPreguntas(callback) {\n this.pool.getConnection(function (err, conexion) {\n \n if (err)\n callback(err);\n else {\n \n const sql = \"SELECT p.id_pregunta, p.id_usuario, p.titulo, p.cuerpo,p.fecha,u.nombre,u.imagen FROM preguntas AS p JOIN usuario AS u ON p.id_usuario=u.id_usuario ORDER BY p.fecha DESC;\"; \n\n conexion.query(sql, function (err, resultado) {\n conexion.release();\n if (err)\n callback(err);\n else\n callback(null, resultado);\n }); \n }\n });\n }", "async parametroFormasPagamento(req, res) {\n\n const parametroFormaPagamento = await db.query(\"SELECT cod_parametro_forma_pagamento, descricao FROM parametro_forma_pagamento WHERE status = 0\");\n return res.json(parametroFormaPagamento.rows)\n\n }", "function cargarControles(){\n\tvar selector = document.getElementById('selectClasificacion');\n\tvar btn_jugar = document.getElementById('btn-jugar');\n\tvar btn_reiniciar = document.getElementById('btn-reiniciar');\n\tvar btn_calificar = document.getElementById('btn-calificar');\n\n\tselector.innerHTML = getItemsClasificar();\n\tbtn_jugar.addEventListener('click',crearEntornoDeJuego);\n\tbtn_reiniciar.addEventListener('click',reiniciarJuego);\n\tbtn_calificar.addEventListener('click',calificar);\n}", "function cargarDirectores(req, res) {\n var peticionsql = 'SELECT * FROM director';\n \n conexionBaseDeDatos.query( peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "static list_DiagnosticoTratameinto(req, res){ \n const { id_internacion } = req.params\n diagnostico_tratamientos.findAll({\n where: { id_internacion: id_internacion }\n }).then((data) => {\n res.status(200).json(data);\n }); \n }", "function traercontacto_empresa(req,res){\n\tCONN('contacto_empresa').select().then(registros =>{\n\t\tif (!registros){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de contacto_empresa', registros:registros});\n\t\t}\n\t}).catch(error =>{\n\t\tres.status(500).send({resp: 'error', error: `${error}` });\n\t});\n}", "function listaGeneros(req, res) {\n var sqlGen = \"select * from genero\"\n con.query(sqlGen, function(error, resultado, fields) {\n errores(error, res);\n var response = {\n 'generos': resultado\n };\n\n res.send(JSON.stringify(response));\n });\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\", \"option\" );\n}", "function _CarregaRacas() {\n var select_raca = Dom('raca');\n if (select_raca == null) {\n // Testes não tem o select.\n return;\n }\n for (var chave_raca in tabelas_raca) {\n select_raca.appendChild(CriaOption(Traduz(tabelas_raca[chave_raca].nome), chave_raca))\n }\n}", "function buscarModulos(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Modulo.find({}, 'nombre tipo estado usuario') // envamos un obj vacio y buscamos por nombre enail y role \n .or([{ 'nombre': regex }, { 'tipo': regex }]) // envio un array de condiciones , busco por dos tipos \n .populate('usuario', 'nombre email') // se pueden poner mas populate de otras colecciones\n .exec((err, modulos) => {\n\n if (err) {\n reject('error al cargar modulos', err)\n } else {\n // modulos ira comno respuesta en el array respuesta[0]\n resolve(modulos) // devuelve los modulos encontrados en el find\n }\n })\n });\n}", "function buscarUsuarios(termino, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find()\n // .or - para buscar en dos propiedades de la misma coleccion\n .or([ { 'nombre' : regex }, { 'email' : regex } ])\n .exec((error, usuariosEncontrados) => {\n\n if(error) {\n reject('Error al cargar los usuarios', error);\n } else {\n resolve(usuariosEncontrados);\n }\n\n });\n });\n }", "function cargarActores(req, res) {\n var peticionsql = 'SELECT * FROM actor';\n \n conexionBaseDeDatos.query(peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "function listarImpresoras(){\n\n $(\"#selectImpresora\").html(\"\");\n navigator.notification.activityStart(\"Buscando impresoras...\", \"Por favor espere\");\n\n ImpresoraBixolonSPPR300ySPPR310.buscar((devices)=>{\n\n var lista = devices.map((device)=>{\n\n var id = device.MAC + \"_\" + device.Nombre;\n var texto = device.Nombre + \"(\" + device.MAC + \")\";\n\n $('#selectImpresora').append($('<option>', {\n value: id,\n text : texto\n }));\n\n });\n\n navigator.notification.activityStop();\n $('#selectImpresora').selectmenu('enable');\n $('#selectImpresora').selectmenu('refresh');\n\n });\n\n }", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function ConsultaItemSelect(tx) { console.log(\"ConsultaItemSelect\");\n\t\t console.log('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado');\n\t\ttx.executeSql('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado', [], ConsultaLoadEstado,errorCB);\n\t\t console.log(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\");\n\t\ttx.executeSql(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\", [], ConsultaLineaCarga,errorCB);\n}", "static async getAllLaboratores(){\n const query = \n `\n SELECT \n u.firstname, u.lastname, u.mail, u.user_image, \n sc.social_class, sr.social_rank\n FROM user u\n JOIN social_class sc ON sc.id= u.social_class_id \n JOIN social_rank sr ON sr.id = u.social_rank_id\n WHERE sc.social_class = \"Laboratores\";\n `;\n const [result] = await connection.query(query)\n return result;\n }", "function alumnoRegistro(){\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n if(perfil === 2){\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML =\r\n `<label for=\"selListaDocentes\">Elija docente: </label><select id=\"selListaDocentes\"> \r\n </select>`;\r\n for (let i = 0; i < usuarios.length; i++) {\r\n const element = usuarios[i];\r\n if(element.perfil === \"docente\"){\r\n document.querySelector(\"#selListaDocentes\").innerHTML +=\r\n `<option value=\"${element.nombreUsuario}\">${element.nombre} (${element.nombreUsuario}) </option>`\r\n }\r\n }\r\n }else{\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML = \"\";//Esta funcion corre cada vez que hay alguien selecciona un perfil en el formulario de registro, si cambia para otro que no sea alumno (2) viene aca y elimina el <select> de docente\r\n }\r\n}", "function obtenerResultados(req, res) {\n var id = req.params.id;\n var peticionSql = leerSql(\"obtenerResultados.sql\") + id + `\n GROUP BY pelicula.id\n ORDER BY votos DESC\n LIMIT 0,3;`\n\n conexionBaseDeDatos.query(peticionSql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n // Si la competencia no ha recibido votos devolvemos el mensaje correspondiente\n if(!resultado || resultado.length == 0) {\n console.log('Esta competencia aun no ha recibido votos.');\n return res.status(422).send('Esta competencia aun no ha recibido votos');\n } else {\n var respuesta = {\n competencia: resultado[0].nombre,\n resultados: resultado,\n }\n res.status(200).send(JSON.stringify(respuesta));\n }\n })\n}", "function obtenerValoresManiobras(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_maniobras WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 76; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_maniobras\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_maniobras_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function seleccionarOrden(productos){\n \n\n let rowProductos = document.querySelector(\".buzos__row\");\n\n rowProductos.innerHTML=\"\";\n\n let select = document.querySelector(\".selectOrdenProductos\");\n \n switch(select.value){\n\n case 'date':\n getPaginacion(ordenarProductosFecha(productos));\n break;\n \n case 'price-asc':\n getPaginacion(ordenarProductosPrecio(productos, \"asc\"));\n break;\n\n case 'price-des':\n getPaginacion(ordenarProductosPrecio(productos, \"des\"));\n break;\n\n }\n \n}", "function obtenerClientes() {\n\t\tconst conexion = window.indexedDB.open('crm', 1);\n\n\t\tconexion.onerror = () => console.log('Hubo un error');\n\n\t\tconexion.onsuccess = () => {\n\t\t\tDB = conexion.result;\n\n\t\t\tconst objectStore = DB.transaction('crm').objectStore('crm');\n\n\t\t\tobjectStore.openCursor().onsuccess = (e) => {\n\t\t\t\tconst cursor = e.target.result;\n\n\t\t\t\tif (cursor) {\n\t\t\t\t\tconst { nombre, empresa, email, telefono, id } = cursor.value;\n\n\t\t\t\t\tconst listado = document.querySelector('#listado-clientes');\n\n\t\t\t\t\tlistado.innerHTML += `\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200\">\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-5 font-medium text-gray-700 text-lg font-bold\"> ${nombre} </p>\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-10 text-gray-700\"> ${email} </p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 \">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-700\">${telefono}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 leading-5 text-gray-700\">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-600\">${empresa}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5\">\n\t\t\t\t\t\t\t\t<a href=\"editar-cliente.html?id=${id}\" class=\"text-teal-600 hover:text-teal-900 mr-5\">Editar</a>\n\t\t\t\t\t\t\t\t<a href=\"#\" data-cliente=\"${id}\" class=\"text-red-600 hover:text-red-900 eliminar\">Eliminar</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t`;\n\t\t\t\t\tcursor.continue();\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('No hay más registros');\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t}", "function obtenerValoresPreliminar(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem_preli,v_calificacion,o_observacion FROM puertas_valores_preliminar WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=seleval\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $(\"#text_obser_item\"+i+\"_eval_prel\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function lireTousLesAdmins(){\n return connSql.then(function (sql) {\n let resultat = sql.query(\"SELECT * FROM administrateur\");\n return resultat\n });\n}", "function getTypesComplain(req, res) {\n /**Nota\n * mandar por la url el filtro para obtenerna; por id, por nombre.\n */\n var filtro = req.params.filtro;\n var dato = req.params.dato;\n var connection = dbConnection();\n switch (filtro) {\n case \"id\":\n connection.query(\"SELECT * FROM tipo_queja WHERE id_tipo_queja=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n case \"descripcion\":\n dato = \"'\" + dato + \"'\"\n connection.query(\"SELECT * FROM tipo_queja WHERE descripcion=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n\n }\n\n}", "async function selectRota(dado){\n const conn = await connect();\n const sql = 'SELECT rota, funcao FROM Jogabilidade WHERE idJog =?;';\n const value = [dado.idJog];\n const [rows] = await conn.query(sql,value);\n return rows\n}", "function obtenerValoresMotorizacion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_motorizacion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 43; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_motorizacion\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_motorizacion_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function mostraSelect(i){\n $tabelaRoubos.innerHTML = '';\n\n criaTabela($tabelaRoubos, `Estamina requerida:`, `${roubosGrupo[i].estaminaR}%`,null,null);\n criaTabela($tabelaRoubos, `Power de roubo:`, roubosGrupo[i].powerNecessario,null,null);\n criaTabela($tabelaRoubos, `Recompensa:`, roubosGrupo[i].recompensaTxt,null,null);\n \n $tabelaRoubos.classList.add('visivel');\n}", "function loadAll() {\n var cidades = eurecaECBrasil.filtrarCidadeTextoService();\n return cidades.split(/, +/g).map( function (cidade) {\n return {\n value: cidade.toLowerCase(),\n display: cidade\n }; \n });\n }", "getPreguntasSinResponder(callback) {\n this.pool.getConnection(function (err, conexion) {\n \n if (err)\n callback(err);\n else {\n \n const sql = \"SELECT p.id_pregunta, p.id_usuario, p.titulo, p.cuerpo,p.fecha,u.nombre,u.imagen FROM preguntas AS p JOIN usuario AS u ON p.id_usuario=u.id_usuario WHERE p.respuesta=FALSE ORDER BY p.fecha DESC;\"; \n\n conexion.query(sql, function (err, resultado) {\n conexion.release();\n if (err)\n callback(err);\n else\n callback(null, resultado);\n }); \n }\n });\n }", "function getAll() {\n return connSql.then(function(conn){\n let resultat = conn.query(\"SELECT * FROM chambre\");\n return resultat\n });\n}", "function traer_grupo(req,res){\n\tCONN('grupo').select().then(grupos =>{\n\t\tconsole.log(grupos);\n\t\tif (!grupos){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de grupo', grupos:grupos });\n\t\t}\n\n\t})\n}", "function consultargrupo(req,res){\n\tlet consulgrupo = new Grupoempresa(req.body.grupo)\n\n\tCONN('grupo').where('grupo',req.body.grupo).select().then(traergrupo =>{\n\t\tconsole.log(traergrupo);\n\t\tif (traergrupo == ''){\n\t\t\tCONN('grupo').insert(consulgrupo).then(insertargrupo =>{\n\t\t\t\tif (!insertargrupo){\n\t\t\t\t\tres.status(500).send({resp:'error', error: 'no se inserto grupo'});\n\t\t\t\t}else{\n\t\t\t\t\tres.status(200).send({resp: 'grupo guardado', insertargrupo:insertargrupo });\n\t\t\t\t}\n\t\t\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp:'error', error: `${error}` });\n\t\t\t});\n\t\t}else{\n\t\t\tres.status(200).send({resp: 'grupo', traergrupo:traergrupo });\n\t\t}\n\n\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp:'error', error: `${error}` });\n\t\t\t});\n}", "function listarMedicoseAuxiliares(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select crmv, nomeMedico, telefoneMedico, emailMedico from Medico, Responsavel where Medico.Estado = Responsavel.Estado and Medico.Cidade = Responsavel.Cidade and Responsavel.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "async function getFormularNames(req, res) {\n var formulars = await pool.query(\"select * from formular\");\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n return res.status(200).send(formulars.rows);\n}", "function buscarUsuario(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find({}, 'nombre email role') // para que solo se muestre esos campos\n .or([{ 'nombre': regex }, { 'email': regex }])\n .exec((err, usuarios) => {\n if (err) {\n reject('error al cargar usuarios');\n\n } else {\n resolve(usuarios);\n }\n });\n\n });\n\n}", "function fSelReg(aDato, iCol) {\n\t\n\tif(aDato[0]==\"1\"){\n\t\tfrm.iEjercicio.value=aDato[23];\n\t\tfrm.iNumSolicitud.value=aDato[24];\n\t\tfrm.iCveHist.value=\"\";\n\t\t\n\t}else{\n\t\tfrm.iEjercicio.value=-1;\n\t\tfrm.iNumSolicitud.value=-1;\n\t\tfrm.iCveHist.value=aDato[17];\n\t}\n\t\n\t if(iCol==16 && aDato[0]==\"1\"){\n\t\t fArchivosADV();\n\t }else if(iCol==16 && aDato[0]==\"0\"){\n\t\t fArchivosHist();\n\t }\n\t\n}", "function obtenerValoresMecanicos(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_mecanicos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_mecanicos\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_lv_valor_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function carregarListaSolicitantes(){\n\tdwr.util.useLoadingMessage();\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tFacadeAjax.getListaSolicitantes(unidade, function montaComboUnidadeTRE(listBeans){\n\t\tDWRUtil.removeAllOptions(\"comboUnidadesSolicitantes\");\n\t\tDWRUtil.addOptions(\"comboUnidadesSolicitantes\", listBeans, \"idUnidade\",\"nome\");\n\t});\n}", "function listarInstrutores () {\n instrutorService.listar().then(function (resposta) {\n //recebe e manipula uma promessa(resposta)\n $scope.instrutores = resposta.data;\n })\n instrutorService.listarAulas().then(function (resposta) {\n $scope.aulas = resposta.data;\n })\n }", "static async buscarTurmas(req, res) {\n /* Passa via objeto descontruido os campos que\n serão usados para consulta de registros através do\n endpoint, usando o req,query */\n const { data_inicial, data_final } = req.query;\n\n /*Criação do objeto que será usado \n como parâmetro na busca de registros */\n const where = {};\n\n /*Criação da condicional com operadores que será usada\n para a busca de registros\n \n Campo Chave 1 || Campo Chave 1, caso forem vazios, parametro é \n passado em branco\n\n Caso informado, usa a propriedade do OP: \n gte - gratter than or equal, maior ou igual\n lte, letter than or equal, menor ou igual\n */\n data_inicial || data_final ? (where.data_inicio = {}) : null;\n data_inicial ? (where.data_inicio[Op.gte] = data_inicial) : null;\n data_final ? (where.data_inicio[Op.lte] = data_final) : null;\n\n try {\n const consultaTurmas = await //Enquanto executa\n /* Método Sequelize para busca de registros, \n passando via parâmetro o objeto criado */\n database.Turmas.findAll({ where });\n\n /*Retorna a consulta do banco no formato JSON */\n return res.status(200).json(consultaTurmas);\n } catch (error) {\n /*Em caso de erro, retorna o cod. erro (500) e sua mensagem\n em formato JSON */\n return res.status(500).json(error.message);\n }\n }", "async getDatosAcopio() {\n let query = `SELECT al.almacenamientoid, ca.centroacopioid, ca.centroacopionombre, \n concat('Centro de Acopio: ', ca.centroacopionombre, ' | Propietario: ', pe.pernombres, ' ', pe.perapellidos) \"detalles\"\n FROM almacenamiento al, centroacopio ca, responsableacopio ra, persona pe\n WHERE al.centroacopioid = ca.centroacopioid AND ca.responsableacopioid = ra.responsableacopioid AND ra.responsableacopioid = pe.personaid;`;\n let result = await pool.query(query);\n return result.rows; // Devuelve el array de json que contiene todos los controles de maleza realizados\n }", "static async getAllOratores(){\n const query = \n `\n SELECT \n u.firstname, u.lastname, u.mail, u.user_image, \n sc.social_class, sr.social_rank\n FROM user u\n JOIN social_class sc ON sc.id= u.social_class_id \n JOIN social_rank sr ON sr.id = u.social_rank_id\n WHERE sc.social_class = \"Oratores\" \n AND sr.social_rank != \"King\" AND sr.social_rank != \"Queen\" AND sr.social_rank != \"Prince\" AND sr.social_rank != \"Princess\";\n `;\n const result = await connection.query(query)\n return result;\n }", "function limpiarSelect() {\n var select = document.getElementById('select-bd-postgres');\n while (select.firstChild) {\n select.removeChild(select.firstChild);\n }\n}", "function listaRecomendadas(req, res) {\n\n var sqlRecomienda = \"select pelicula.id,titulo,duracion,director,anio,fecha_lanzamiento,puntuacion,poster,trama,nombre from pelicula join genero on pelicula.genero_id = genero.id where pelicula.id = pelicula.id\";\n \n if (req.query.genero) {\n genero = req.query.genero;\n sqlRecomienda = sqlRecomienda + \" and genero.nombre =\" +\"'\"+genero+\"'\";\n }\n\n if (req.query.anio_inicio) {\n var anioInicio = req.query.anio_inicio;\n sqlRecomienda = sqlRecomienda + \" and pelicula.anio between \" +anioInicio;\n }\n\n if (req.query.anio_fin) {\n var anioFin = req.query.anio_fin;\n sqlRecomienda = sqlRecomienda + \" and \" +anioFin;\n }\n\n if (req.query.puntuacion) {\n var puntuacion = req.query.puntuacion;\n sqlRecomienda = sqlRecomienda + \" and puntuacion >=\" +puntuacion;\n }\n\n var response = {\n 'peliculas': \"\",\n }\n\n \n con.query(sqlRecomienda, function(error, resultado, fields) {\n errores(error, res);\n response.peliculas = resultado;\n res.send(JSON.stringify(response));\n });\n}", "function buscarPorColeccion(req, res) {\n\n // viene x los params de la url \n let busqueda = req.params.bus;\n let tabla = req.params.tabla;\n\n // busqueda es el parametro de la url \n // 'i' may y minus es insensible\n let regex = new RegExp(busqueda, 'i'); // aqui convertimos la busqueda con la ex regular\n\n let promesa;\n\n // busqueda contiene lo que busco \n // ej : coleccion/usuarios/manuel ===>>> colecccion/tabla/busqueda\n\n // pregunto por cada coleccion que viene en la tabla \n switch (tabla) {\n\n case 'usuarios':\n promesa = buscarUsuarios(busqueda, regex);\n break;\n\n case 'controles':\n promesa = buscarControles(busqueda, regex);\n break;\n\n case 'modulos':\n promesa = buscarModulos(busqueda, regex);\n break;\n\n case 'hospitales':\n promesa = buscarHospitales(busqueda, regex);\n break;\n\n case 'medicos':\n promesa = buscarMedicos(busqueda, regex);\n break; \n\n default:\n\n return res.status(400).json({\n ok: false,\n mensaje: 'los colecciones de busqueda solo son usuarios, modulos y controles',\n error: { message: 'tipo de coleccion/documento no valido' }\n })\n }\n\n // en ecma6 existe propiedades de obj computadas \n // ponemos tabla entre [] y nos da su valor , que puede ser usuarios medicos hospitales \n // si no lo ponemos entre [] imprime tabla \n\n promesa.then(data => {\n\n res.status(200).json({\n ok: true,\n [tabla]: data\n })\n })\n\n}", "static consultarClientes(callback) {\n //Armamos la consulta segn los parametros que necesitemos\n let query = 'SELECT * ';\n query += 'FROM '+table.name+';'; \n //Verificamos la conexion\n if(sql){\n sql.query(query, (err, result) => {\n if(err){\n throw err;\n }else{ \n let clientes = [];\n for(let entity of result){\n let cliente = Cliente.mapFactory(entity); \n clientes.push(cliente);\n } \n console.log(clientes); \n callback(null,clientes);\n }\n })\n }else{\n throw \"Problema conectado con Mysql\";\n } \n }", "function buscarGrupos(busqueda, regex) {\n return new Promise((resolve, reject) => {\n Grupo.find({ nombre: regex })\n .populate('usuario', 'nombre email')\n .exec((err, grupos) => {\n if (err) {\n reject('Error al cargar grupos', err);\n } else {\n resolve(grupos);\n }\n });\n });\n}", "function buscarUsuarios(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n // al poner 2do argumento , no traigo el pass\n Usuario.find({}, 'nombre imagen ') // enviamos un obj vacio y buscamos por nombre email etc : es lo que quiero traer , es lo que va a mostrar \n .or([{ 'nombre': regex }, { 'email': regex }]) // en cambio aqui envio un array de condiciones para buscar, busco por email y nombre\n .exec((err, usuarios) => {\n\n if (err) {\n reject('error al cargar usuarios', err)\n } else {\n // usuarios ira como respuesta en el array respuesta[2]\n resolve(usuarios) // devuelve los usuarios encontrados en el find\n }\n })\n });\n}", "static async buscarNiveis(req, res) {\n try {\n const consultaNiveis = await //Enquanto executa\n niveisServices.buscarRegistros() /* Método Sequelize para busca de registros */\n\n /*Retorna a consulta do banco no formato JSON */\n return res.status(200).json(consultaNiveis)\n\n } catch (error) {\n\n /*Em caso de erro, retorna o cod. erro (500) e sua mensagem\n em formato JSON */\n return res.status(500).json(error.message)\n }\n }", "function obtenerValoresElectrica(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_electrica WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 38; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_electrica\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_electrica_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function cadastrarTecnico(){\n\tvar matriculaTecnico = DWRUtil.getValue(\"comboTecnicoTRE\");\n\tvar login = DWRUtil.getValue(\"login\"); \n\tif((matriculaTecnico==null ||matriculaTecnico=='')){\n\t\talert(\"Selecione um tecnico do TRE.\");\n\t}else{\n\t\tFacadeAjax.integrarTecnico(matriculaTecnico,login);\n\t\tcarregaTecnicos();\t\n\t}\n\t\n}", "function recuperaSelect() {\n $.ajax({\n url: '../modelo/crud.php',\n method: 'post',\n data: {\n 'opcion': 10,\n 'idprofesor': idpersonasProfesor\n },\n success: function(data) {\n data = $.parseJSON(data);\n // mostramos los datos del alumnos\n let resulAlumno = '<option value=\"0\">Elige una opción</option>';\n data.alumno.forEach(function(element) {\n resulAlumno += '<option value=' + element.idpersonas + '>' + element.idpersonas + ' - ' + element.nombre + ' - ' + element.apellido + '</option>';\n });\n $('#lista_reproduccion').html(resulAlumno);\n\n // mostramos los datos de los cursos\n let resulCurso = '<option value=\"0\">Elige una opción</option>';\n data.curso.forEach(function(element) {\n resulCurso += '<option value=' + element.idcursos + '>' + element.idcursos + ' - ' + element.curso + '</option>';\n });\n $('#lista_cursos').html(resulCurso);\n\n },\n error: function(xhr, status) {\n alert('Disculpe, existio un problema');\n }\n });\n}", "function ordenar() {\n let seleccion = $(\"#miSeleccion\").val().toUpperCase();\n popularListaCompleta();\n listaCompletaClases = listaCompletaClases.filter(Clase => Clase.dia ==\n seleccion);\n renderizarProductos();\n}", "function buscarHospitales(regex){\n return new Promise((resolve,reject)=>{\n Hospital.find({ nombre: regex }).populate('usuario','nombre apellido').exec((err,hospitales)=>{\n if(err){\n reject('Error al cargar hospitales',err);\n }else{\n resolve(hospitales);\n }\n });\n });\n}", "function listar() {\n\n\t\ttabla=$('#resolucion_data').dataTable({\n\t\t\t\"aProcessing\":true,//Activamos procesamiento de datatable\n\t\t\t\"aServerSide\":true,//Paginacion y filtrado realizados por el servidor\n\t\t\tdom:'Bfrtip',//Definimos los elementos del control de table\n\t\t\tbuttons:[\n\t\t\t\t'copyHtml5',\n\t\t\t\t'excelHtml5',\n\t\t\t\t'pdf'//para los botones en el datatable\n\t\t\t\t],\n\t\t\t\"ajax\":\n\t\t\t{\n\t\t\t\turl:'../ajax/resolucion.php?op=buscar_resolucion',//enviamos el parametro \n\t\t\t\ttype:\"get\",//el tipo del parametro\n\t\t\t\tdataType:\"json\",//formato de la data\n\n\t\t\t\terror: function (e) {\n\t\t\t\t\tconsole.log(e.responseText);//para hacer la verificacion de errores\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"bDestroy\":true,\n\t\t\t\"responsive\":true,\n\t\t\t\"bInfo\":true,//informacion del los datatable\n\t\t\t\"iDisplayLength\":20,//Pora cada 10 registros hace una paginacion\n\t\t\t\"order\":[[0,\"desc\"]],//Ordenar (Columna,orden)\n \t\t\t\n \t\t\t\"language\": {\n \n\t\t\t \"sProcessing\": \"Procesando...\",\n\t\t\t \n\t\t\t \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t \n\t\t\t \"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t \n\t\t\t \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t \n\t\t\t \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\t\t\t \n\t\t\t \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\t\t\t \n\t\t\t \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t \n\t\t\t \"sInfoPostFix\": \"\",\n\t\t\t \n\t\t\t \"sSearch\": \"Buscar:\",\n\t\t\t \n\t\t\t \"sUrl\": \"\",\n\t\t\t \n\t\t\t \"sInfoThousands\": \",\",\n\t\t\t \n\t\t\t \"sLoadingRecords\": \"Cargando...\",\n\t\t\t \n\t\t\t \"oPaginate\": {\n\t\t\t \n\t\t\t \"sFirst\": \"Primero\",\n\t\t\t \n\t\t\t \"sLast\": \"Último\",\n\t\t\t \n\t\t\t \"sNext\": \"Siguiente\",\n\t\t\t \n\t\t\t \"sPrevious\": \"Anterior\"\n\t\t\t \n\t\t\t },\n\t\t\t \n\t\t\t \"oAria\": {\n\t\t\t \n\t\t\t \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t \n\t\t\t \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\n\t\t\t }\n\n\t\t\t }//cerrando language\n\t\t}).DataTable();\n\t}", "function fCargaListadoA(){\n frm.hdFiltro.value = \"ICVEMODULO = \" +frm.iCveModulo.value+ \" AND INUMREPORTE NOT IN (SELECT INUMREPORTE FROM GRLREPORTEXOPINION WHERE ICVEOPINIONENTIDAD = \"+frm.iCveOpinionEntidad.value+ \" AND ICVESISTEMA = 44 AND ICVEMODULO = \" +frm.iCveModulo.value+ \" )\";\n frm.hdOrden.value = \" CNOMREPORTE\";\n frm.hdNumReg.value = 100000;\n fEngSubmite(\"pgGRLReporteA.jsp\",\"GRLReporte\");\n }", "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "function cambiarMapas()\r\n{\r\n\t opcion = sel.value();\r\n}", "function guardarCursosAsociar() {\n\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]:checked');\n let cursosSeleccionados = [];\n let codigoCurso;\n\n //Este ciclo for debe empezar en 1, ya que en el cero \"0\" se encuentra el id unico del elemento al que se le desea agregar elementos\n for (let i = 0; i < listaCheckboxCursos.length; i++) {\n codigoCurso = listaCheckboxCursos[i].dataset.codigo;\n cursosSeleccionados.push(codigoCurso);\n }\n\n return cursosSeleccionados;\n\n\n}", "buscaPorIdEstado(id, res) {\n const sql = `select ti.*, e.nome as estado, e.sigla, r.nome as regiao from times ti\n inner join estados e on (e.estado_id = ti.estado_id)\n inner join regioes r on (r.regiao_id = e.regiao_id)\n where e.estado_id = ${id} `\n\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "function obtenerValoresProteccion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_sele_inspector,v_sele_empresa,o_observacion FROM puertas_valores_proteccion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_protec_person\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_inspector+\"']\").prop(\"checked\",true);\n $(\"input[name=sele_protec_person\"+i+\"_\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_empresa+\"']\").prop(\"checked\",true);\n $('#text_obser_protec_person'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function getLogAggiornamenti (req) {\n\n var queryText = 'SELECT ' +\n 'tabella, to_char(data_aggiornamento,' + '\\'' + 'DD-MM-YYYY' + '\\'' + ') data_aggiornamento ' +\n 'FROM pronolegaforum.log_aggiornamenti ' +\n 'ORDER BY tabella';\n\n return db.any(queryText);\n\n}", "static GetUtilidad(cadenaDeConexion, fI, fF, idSucursal, result) {\n\n var sucursal = '';\n if (idSucursal != 1) {\n sucursal = `AND info_ingresos.codSucursal=` + idSucursal;\n }\n console.log(\"sucursal \", sucursal);\n sqlNegocio(\n cadenaDeConexion,\n ` SELECT base.codMes, SUM(base.precioVenta) as totalVenta from (SELECT info_grupopartidas.nombreGrupo,info_ingresos.codMes,\n\n CASE info_grupopartidas.nombreGrupo\n WHEN 'EGRESOS' THEN -(SUM(info_ingresos.sumPrecioVenta))\n WHEN 'INGRESOS' THEN SUM(info_ingresos.sumPrecioVenta)\n END as precioVenta\n \n \n from info_ingresos LEFT JOIN\n info_partidas on info_ingresos.idPartida = info_partidas.idPartida LEFT JOIN \n info_grupopartidas on info_grupopartidas.idGrupoPartida = info_partidas.idGrupo \n where info_ingresos.fecEmision BETWEEN '`+ fI + `' AND '` + fF + `' AND info_ingresos.estado=1 ` + sucursal + ` AND ( info_grupopartidas.nombreGrupo = 'EGRESOS' or info_grupopartidas.nombreGrupo = 'INGRESOS')\n group by info_grupopartidas.nombreGrupo,info_ingresos.codMes)as base group by base.codMes\n order by base.codMes ASC`,\n [],\n function (err, res) {\n if (err) {\n console.log(\"error: \", err);\n result(null, err);\n }\n else {\n result(null, res);\n }\n });\n }", "function busca(busca) {\n $.ajax({\n type: \"POST\",\n url: \"acoes/select.php\",\n dataType: \"json\",\n data: {//tipo de dado\n 'busca':\"busca\"//botão pra inicia a ação\n }\n\n }).done(function (resposta) { //receber a resposta do busca\n console.log('encontrei ' + resposta.quant + ' registros');\n console.log(resposta.busca[0,'0'].id, resposta.busca[0,'0'].descri);\n if(resposta.erros){\n\n //criação das variaves apos o receber a resposta da pagina select\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qntp = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var st = resposta.busca[i]['9']\n //criação da tabela para exebição do resultado\n $('.carro td.descri').append(\" <tr><td ><p class=' text-capitalize id='des' value='\"+desc+\"'>\"+desc +'</p></td></tr>')\n $('.carro td.marca').append(\" <tr><td ><p class=' text-capitalize id='mar' value='\"+mar+\"'>\"+mar +'</p></td></tr>')\n $('.carro td.modelo').append(\" <tr><td ><p class=' text-capitalize id='mod' value='\"+mod+\"'>\"+mod +'</p></td></tr>')\n $('.carro td.tipov').append(\" <tr><td ><p class=' text-capitalize id='tpv' value='\"+tpv+\"'>\"+tpv +'</p></td></tr>')\n $('.carro td.quantp').append(\" <tr><td ><p class=' text-capitalize id='qnt' value='\"+qntp+\"'>\"+qntp +'</p></td></tr>')\n $('.carro td.vlvenda').append(\" <tr><td ><p class=' text-capitalize id='vlv' value='\"+vlv+\"'>\"+vlv +'</p></td></tr>')\n $('.carro td.vlcompra').append(\" <tr><td ><p class=' text-capitalize id='vlc' value='\"+vlc+\"'>\"+vlc +'</p></td></tr>')\n $('.carro td.dtcompra').append(\" <tr><td ><p class=' text-capitalize id='dtc' value='\"+dtc+\"'>\"+dtc +'</p></td></tr>')\n $('.carro td.estato').append(\" <tr><td ><p class=' text-capitalize id='st' value='\"+st+\"'>\"+st +'</p></td></tr>')\n $('.carro td.id').append(\" <tr><td ><button class='r btn btn-sm btn-primary nav-link' id='idvalor' type='button' data-toggle='modal' data-target='#atualFormulario' value='\"+id+\"'>\"+\"Edit\"+'</button></td></tr>')\n $('.carro td.ider').append(\"<tr><td ><button class='del btn btn-sm btn-danger nav-link' type='button' name='idel' value='\"+id+\"'>\"+\"Del\"+'</button></td></tr>')\n\n\n }\n\n\n //função pra por valores da tabela no input do formulario de atualização\n //aqui insere os o ID no formulario de atualização\n $('.r').click('button',function() {\n var idvl = $(this).val();\n $('#i1'). val(idvl);\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qnt = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var sta = resposta.busca[i]['9']\n //aqui comparamos o valor que recuperamos o id da tabela e comparfamos com o id da função busca\n if (idvl==id) {\n $('#descri1'). val(desc);\n $('#marca1'). val(mar);\n $('#modelo1'). val(mod);\n $('#tipov1'). val(tpv);\n $('#quantp1'). val(qnt);\n $('#vlvenda1'). val(vlv);\n $('#vlcompra1'). val(vlc);\n $('#dtcompra1'). val(dtc);\n $('#estato1'). val(sta);\n console.log(idvl);\n\n }\n\n\n\n\n\n }\n })\n //aqui finda\n\n //deleta via ajax\n $('.del').click('button',function() {\n var idel = $(this).val();\n console.log(idel);\n $.ajax({\n url: \"acoes/del.php\",\n type: \"POST\",\n data : { 'idel': idel },\n success: function(data)\n {\n location.reload(\".carro\");//atualiza o contener apos a execução com sucesso\n }\n });\n }); // delete close\n\n\n }\n })\n }", "function CargarListado(tx) {\n\tif(busqueda!=null){\t\n\t console.log(\"SELECT sub.id_linea, sub.id_sublinea, art.nom_articulo, art.referencia, art.serie, placa_nueva, placa_anterior, art.id_envio, marca, id_estado, art.id_articulo,art.fecha_fabricacion FROM publicarticulo art LEFT JOIN publicsublinea sub ON sub.id_sublinea = art.id_sublinea WHERE art.rowid ='\"+res[3]+\"'\");\n\t tx.executeSql(\"SELECT sub.id_linea, sub.id_sublinea, art.nom_articulo, art.referencia, art.serie, placa_nueva, placa_anterior, art.id_envio, marca, id_estado, art.id_articulo,art.fecha_fabricacion FROM publicarticulo art LEFT JOIN publicsublinea sub ON sub.id_sublinea = art.id_sublinea WHERE art.rowid ='\"+res[3]+\"'\", [], MuestraItems);\n\t}\n}", "function allCustomers(req, res){\n var getAllCustomersQuery = \"SELECT * FROM Customer\\n\"+\n \"WHERE active = 'Y'\\n\"+\n \"order by custName\"; \n connection().query(getAllCustomersQuery, function(error, result, fields){\n if(error){\n console.log(\"Hubo un error al obtener la lista de clientes\", error.message);\n return res.status(404).send(\"Hubo un error en la consulta allCustomers\");\n }\n\n if(result.length == 0){\n return res.status(404).json(\"No se encontraron clientes registrados\");\n }\n\n var response = {\n 'clientes': result\n };\n \n res.send(response);\n });\n}", "function cargaComplementos(){\n //Cargado del DataTables\n if($('table').length>0){\n $('table').DataTable();\n }\n \n //Cargado del DatePicker\n if($(\".date-picker\").toArray().length>0){\n $('.date-picker').datepicker({\n format : \"dd/mm/yyyy\"\n });\n }\n \n //Cargado del Input Mask con el formato \"dd/mm/yyyy\"\n if($('.input-date').toArray().length>0){\n $(\".input-date\").inputmask(\"dd/mm/yyyy\");\n }\n if($('.select2').toArray().length>0){\n $(\".select2\").select2({\n placeholder : \"Seleccione una opción\"\n });\n }\n}", "function criaSelectRoubos(){\n let i = 0\n $selectRoubos.innerHTML= '';\n roubosGrupo.forEach(function(rg){\n \n let option1 = document.createElement('option')\n option1.value = i;\n option1.text = `${rg.nome} - ${rg.powerNecessario}`;\n $selectRoubos.append(option1);\n i++;\n })\n}", "function buscarBarrios(consulta){\n $.ajax({\n url: uri+ '/Ruta/consultar_barrio',\n type:'POST',\n datatype:'HTML',\n data:{\n id:consulta,\n },\n })\n .done(function(datos){\n $('#ddlbarri').html(datos);\n })\n\n .fail(function(){\n console.log(\"error\");\n });\n}", "function al_seleccionar_canal(){\n\t\t$(form_publicidad.canal).on('change',function(e){\n\n\t\t\t//limpiarSelect(1);\n\t\t\tcargarSelectContenido(1);\n\n\t\t});\n\t}", "function _CarregaTemplates() {\n var select_template = Dom('template');\n if (select_template == null) {\n // Testes não tem o select.\n return;\n }\n select_template.appendChild(CriaOption('Nenhum', ''))\n for (var chave_template in tabelas_template) {\n select_template.appendChild(CriaOption(Traduz(tabelas_template[chave_template].nome), chave_template))\n }\n}", "async function obtenerTodosLasCiudadesXpais(pais_id) {\n var queryString = '';\n\n console.log('ENTRE');\n queryString = queryString + ' SELECT cd.id, cd.nombre as ciudad';\n queryString = queryString + ' from ciudades cd where pais_id = ? ';\n\n \n\n let ciudad = await sequelize.query(queryString,\n { type: sequelize.QueryTypes.SELECT,\n replacements:[pais_id]})\n return ciudad;\n }", "async function buscar_usuarios(){\n let resultado_buscar_usuario = await sequelize.query('SELECT * FROM usuarios',{\n type: sequelize.QueryTypes.SELECT\n })\n return resultado_buscar_usuario\n}", "function traerempresas(req,res){\n\n\tCONN('empresa')\n\t.join('contacto_empresa','empresa.id_contacto','=','contacto_empresa.id_contacto')\n\t.join('status','empresa.id_status','=','status.id_status')\n\t.join('direccion_empresa','empresa.id_direccion','=','direccion_empresa.id_direccion')\n\t.join('colonia','direccion_empresa.id_colonia', '=','colonia.id_colonia')\n\t.join('alcaldia','direccion_empresa.id_alcaldia', '=','alcaldia.id_alcaldia')\n\t.join('estado','direccion_empresa.id_estado', '=','estado.id_estado')\n\n\t\n\n\t.select().orderBy('empresa.id_empresa')\n\t.then(todas =>{\n\t\t\tconsole.log(todas);\n\t\tif (!todas){\n\t\t\t\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa', todas:todas });\n\t\t}\n\t}).catch(error =>{\n\t\tres.status(500).send({resp: 'error', error: `${error}` });\n\t});\n}", "function selectAll() {\n //query all info from burgers_db\n var queryString = \"SELECT * FROM burgers;\"\n connection.query(queryString, function(err, result) {\n if (err) throw err;\n console.log(result);\n res.json(result);\n });\n }", "function consultar_trj() {\n\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\ttry {\n\t\t\tdocument.getElementsByClassName('lista_vendedores')[1].removeAttribute('selected', '')\n\t\t} catch (error) {\n\t\t}\n\t}\n\tvar envio = { numero: valor('numero_consulta') }\n\tcargando()\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-tarjetas/consultar-numero\",\n\t\tdata: envio\n\t}).done((respuesta) => {\n\t\tif (respuesta == 'Nada') {\n\t\t\t$('#div-error').html('Esta tarjeta no existe, o no ha sido vendida, individualmente sólo pueden modificarse tarjetas vendidas')\n\t\t\tdocument.getElementById('div-error').style.display = 'block'\n\t\t\tno_cargando()\n\t\t\treturn\n\t\t}\n\t\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\t\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\t\tif (opciones_vend[i].value == respuesta[0].vendedor) {\n\t\t\t\topciones_vend[i].setAttribute('selected', '')\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('div-error').style.display = 'none'\n\t\tasignar('mod_tar_num', respuesta[0].numero)\n\t\tasignar('mod_tar_inic', ordenarFechas(respuesta[0].fechainicial))\n\t\tasignar('mod_tar_fin', ordenarFechas(respuesta[0].fechafinal))\n\t\tvar cadena = '';\n\t\tfor (var i = 0; i < respuesta[0].locales.length; i++) {\n\t\t\ttry {\n\t\t\t\tcadena += `<div class=\"row fondo-blanco este-es-local\" style=\" width:100%\" id=\"${respuesta[1][i].codigo}\">\n\t\t\t\t\t\t\t\t<div class=\"col-lg-3 col-md-4\">\n\t\t\t\t\t\t\t\t<label>Local</label>\n\t\t\t\t\t\t\t\t<img width=\"100%\" src=\"${respuesta[1][i].logotipo}\"/>\n\t\t\t\t\t\t\t\t<h5 class=\"centrado\">${respuesta[1][i].nombre}</h5>\n\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t<div class=\"col-lg-9 col-md-8\">\n\t\t\t\t\t\t\t\t<div class=\"table\">\n\t\t\t\t\t\t\t\t\t<table class=\"table table-bordered\"><tr> <th>Beneficio</th><th colspan=\"2\">Estado</th></tr>`\n\t\t\t\tfor (var j = 0; j < respuesta[0].locales[i].beneficio.length; j++) {\n\t\t\t\t\tvar estado_benef = verificar_benef(respuesta[0].locales[i].beneficio[j].activo)\n\t\t\t\t\tcadena += `<tr>\n\t\t\t\t\t\t\t\t<td><textarea class=\"area-beneficios\" readonly style=\"width:100%; height:140px; border: solid 0px white\" resizable=\"none\">${ascii_texto(respuesta[0].locales[i].beneficio[j].beneficio)}\n\t\t\t\t\t\t\t\t</textarea></td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label><input value=\"1\" onchange=\"conSeleccion(this)\" class=\"benef_escog\" name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" ${estado_benef[0]} type=\"radio\"/> Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<label><input value=\"0\" onchange=\"sinSeleccion(this)\" class=\"benef_escog\" ${estado_benef[1]} name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" type=\"radio\"/> No Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t\tcadena += `</table>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>`\n\t\t\t} catch (error) {\n\t\t\t\tcadena += ''\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('loc_mod_tar').innerHTML = cadena\n\t\tdocument.getElementById('edicion_individual').style.display = 'block'\n\t\tdocument.getElementById('consulta_edicion').style.display = 'none'\n\t\tasignar('numero_consulta', '')\n\t\tno_cargando()\n\t})\n}", "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "function all(req, res, next) {\n db.any('select * from cliente')\n .then(function (data) {\n res.status(200)\n .json(data);\n })\n .catch( err => {\n console.error(\"error \"+err);\n return next(err);\n });\n}", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "async function todosArticulosController (req, res){\r\n let query = `SELECT Articulo, Nombre, UnidadCompra, UnidadVenta FROM Articulos`;\r\n let resultado = await createRawQuery({suc: 'bo', query})\r\n res.json(resultado)\r\n}", "function obtenerPersonas(res){\n var personas = [];\n tb_persona.connection.query('SELECT * FROM persona', function(err, rows){\n if(err) throw err;\n rows.forEach(function(result){\n personas.push(result);\n });\n res.send(personas);\n });\n}", "function listarRecursos(callback){\n\tFarola.find({}, null, callback);\n}", "async getAll() {\n try {\n const db = await this.conexion.conectar();\n const collection = db.collection('Encargados');\n const findResult = await collection.find({}).toArray();\n await this.conexion.desconectar();\n return (findResult);\n }\n catch (e) {\n throw e;\n }\n }" ]
[ "0.62919205", "0.6157102", "0.6133443", "0.613185", "0.6087473", "0.6078431", "0.607074", "0.5997127", "0.59788364", "0.59719163", "0.5947582", "0.59245485", "0.5897373", "0.58938044", "0.58775395", "0.5802812", "0.5802678", "0.5802365", "0.57918733", "0.5773877", "0.5763097", "0.57512057", "0.57484883", "0.5744551", "0.5735023", "0.5730328", "0.57121706", "0.5705367", "0.56815034", "0.56657594", "0.5657822", "0.5652507", "0.56516343", "0.56312627", "0.56278205", "0.56247693", "0.5622066", "0.56212103", "0.5620921", "0.56152225", "0.5606704", "0.5601186", "0.56005764", "0.5591142", "0.55865985", "0.55795527", "0.55763465", "0.55740815", "0.5571869", "0.5562409", "0.55611753", "0.5561105", "0.5558619", "0.5558404", "0.555685", "0.5551253", "0.5543649", "0.554101", "0.55405116", "0.55397743", "0.553699", "0.5531751", "0.55161816", "0.55154973", "0.551185", "0.5511317", "0.54912525", "0.54864675", "0.54833555", "0.5478968", "0.5473764", "0.54671293", "0.5460577", "0.54600394", "0.5456218", "0.54555017", "0.5444125", "0.5442233", "0.5440585", "0.54365873", "0.5434201", "0.5433249", "0.5427849", "0.5427634", "0.54268336", "0.541986", "0.54145575", "0.5413488", "0.54116076", "0.5403645", "0.5396786", "0.5395139", "0.5390243", "0.5387738", "0.5383468", "0.5383152", "0.5374944", "0.5365937", "0.5361371", "0.53577846", "0.53516227" ]
0.0
-1
SELECT: Devuelve todos los registros
obtenerProductoresFemenino() { return axios.get(`${API_URL}/v1/productorpersonaReporteF/`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTypesComplains(req, res) {\n var connection = dbConnection();\n connection.query(\"SELECT * FROM tipo_queja\", function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `No hay quejas guardadas` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n}", "campeao(res) {\n const sql = ` select ti.*, e.nome as estado, e.sigla, r.nome as regiao from times ti\n inner join estados e on (e.estado_id = ti.estado_id)\n inner join regioes r on (r.regiao_id = e.regiao_id)\n inner join partidas pa on (pa.time_id_vencedor = ti.time_id)\n order by pa.partida_id desc limit 1 `\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "function cargarGeneros(req, res) {\n var peticionsql = 'SELECT * FROM genero';\n \n conexionBaseDeDatos.query(peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "function listaModelos(){\n return new Promise((resolve,reject) => {\n let qry = `\n select \n usuarioCadastro, tbinfoveiculo.id, nomemodelo, tbmontadoras.nome, anofabricacao, cores, tipochassi, suspensaodianteira, suspensaotraseira, pneusdianteiro, pneutraseiro, freiodianteiro, freiotraseiro, tipodofreio,\n qtdcilindros, diametro, curso, cilindrada, potenciamaxima, torquemaximo, sistemadepartida, tipodealimentacao, combustivel, sistemadetransmissao, cambio, bateria, \n taxadecompessao, comprimento, largura, altura, distanciaentreeixos, distanciadosolo, alturadoassento, tanquedecombustivel, peso, arqFoto\n from tbInfoVeiculo inner join tbmontadoras on tbinfoveiculo.idmontadora = tbmontadoras.id\n `\n db.all(qry, (err,data) => {\n if(err) {\n reject(err);\n }\n resolve(data);\n })\n })\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "async getTodosLosSensores() {\n var textoSQL = \"select * from Sensor\";\n console.log(\"logica: getTodosLosSensores\")\n return new Promise((resolver, rechazar) => {\n this.laConexion.all(textoSQL, {},\n (err, res) => {\n (err ? rechazar(err) : resolver(res))\n })\n })\n }", "getMateriasProgra(ru,gestion,periodo){\n return querys.select(\"select * from consola.generar_programacion_completa(\"+ru+\",\"+gestion+\",\"+periodo+\",0)\");\n }", "function buscarAdministrativo(regex){\n return new Promise((resolve,reject)=>{\n Administrativo.find({}, 'identificacion nombres apellidos correo telefono programa cargo estado rol')\n .or([ {'identificacion':regex}, {'nombres':regex}, {'apellidos':regex}, {'telefono':regex}, {'correo':regex}, {'cargo': regex}])\n .populate('rol programa').exec((err,usuarios)=>{\n if(err){\n reject('Error al cargar los usuarios',err);\n }else{\n resolve(usuarios);\n }\n });\n });\n}", "static getAll() {\r\n return new Promise((next) => {\r\n db.query('SELECT id, nom FROM outil ORDER BY nom')\r\n .then((result) => next(result))\r\n .catch((err) => next(err))\r\n })\r\n }", "function listar(ok,error){\n console.log(\"Funcionlistar DAO\")\n helper.query(sql,\"Maestro.SP_SEL_ENTIDAD_FINANCIERA\",[],ok,error)\n}", "function getRutas(next) {\n RutaModel\n .query(`select r.idRuta, r.idVehiculo, r.noEconomico, r.idRemolque, r.salida, r.destino, r.idConductor, r.fechaSalida, r.fechaLlegada, r.tiempoEstimado,r.idEstado, r.idPrioridad,r.created_at, u.latitud, u.longitud, u.estadoGeoreferencia, u.municipioGeoreferencia, u.asentamientoGeoreferencia, u.direccionGeoreferencia, u.placa\n FROM rutas r, ubicaciones u where u.noEconomico=r.noEconomico`, (error, resultado, fields) => {\n\n next(error, resultado)\n })\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\" );\n}", "function consultarCitasUsuario(){\n\t\n\tvar idUsuario = $(\"#selectUsuario\").val();\n\t\n\t\n\tvar selectList = $(\"#otrosUsuarios\");\n\tselectList.find(\"option:gt(0)\").remove();\n\t\n\t//para mostrar nombre en spán de select usuarios\n\t$(\"#nombreUsuarioSeleccionado\").html( $(\"#selectUsuario option:selected\").text() );\n\t\n\t$(\"#selectUsuario option\").each(function(){\n // Add $(this).val() to your list\n \tif( ($(\"#selectUsuario\").val() != $(this).val()) && ($(\"#selectUsuario\").val() != \"\") && ($(\"#selectUsuario\").val() != null) && ($(this).val() != \"\") && ($(this).val() != null) ){\n \t\t\n \t\t$('#otrosUsuarios').append($('<option>', {\n\t\t \tvalue: $(this).val(),\n\t\t \ttext: $(this).text()\n\t\t\t}));\n \t\t\n \t}\n\t\t\n\t});\t\n\t\n \t $('#otrosUsuarios').material_select('destroy');\n \t $('#otrosUsuarios').material_select();\t\n \t \n \t //se recorre el select que se acabo de contruir para dar los ids a los checkbox de materialize\n \t $(\"#otrosUsuarios option\").each(function(){\n\t\t\n \t$(\"#nuevaCitaOtrosUsuariosMultiple\").find('span:contains(\"'+$(this).text()+'\")').parent('li').attr('id', 'multipleCreando'+$(this).val());\n \t$('#multipleCreando'+$(this).val()).attr(\"onClick\", 'comprobarSeleccionMultipleNuevaCita(this.id)');\n\t\t\n\t});\t\n \t \n\n\t$(\"#calendar\").fullCalendar( 'destroy' );\n\tcontruirCalendario();\t\n\t\n\t\n}", "function CargarColletIDs(){\n\n var sql = \"SELECT ID_Colecciones,Nombre FROM Colecciones\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n function querySuccess(tx, results) {\n var len = results.rows.length;\n for (var i=0; i<len; i++)\n $('#SelectorColecciones').append('<option value=\"' + results.rows.item(i).ID_Colecciones + '\">' + results.rows.item(i).Nombre + '</option>');\n\n }\n\n function errorCB(err) {\n alert(\"Error al rellenar selector de coleciones: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n\n}", "function ConsultaItems(tx) {\n\t\ttx.executeSql('select id_empresa,nom_empresa from publicempresa order by nom_empresa', [], ConsultaItemsCarga,errorCB);\n}", "function buscarHospitales(regExp) {\n\n return new Promise((resolve, reject) => {\n Hospital.find({ nombre: regExp }, (err, hospitales) => {\n if (err) {\n reject(\"Error al cargar hospitales\", err);\n } else {\n resolve(hospitales);\n }\n\n })\n });\n\n}", "static getAll(){\n // Retourne promise\n return new Promise((resolve, reject) => {\n // Requete Select \n db.query(\"SELECT * FROM salles\", (err, rows) => {\n if(err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n })\n }", "getPreguntas(callback) {\n this.pool.getConnection(function (err, conexion) {\n \n if (err)\n callback(err);\n else {\n \n const sql = \"SELECT p.id_pregunta, p.id_usuario, p.titulo, p.cuerpo,p.fecha,u.nombre,u.imagen FROM preguntas AS p JOIN usuario AS u ON p.id_usuario=u.id_usuario ORDER BY p.fecha DESC;\"; \n\n conexion.query(sql, function (err, resultado) {\n conexion.release();\n if (err)\n callback(err);\n else\n callback(null, resultado);\n }); \n }\n });\n }", "async parametroFormasPagamento(req, res) {\n\n const parametroFormaPagamento = await db.query(\"SELECT cod_parametro_forma_pagamento, descricao FROM parametro_forma_pagamento WHERE status = 0\");\n return res.json(parametroFormaPagamento.rows)\n\n }", "function cargarControles(){\n\tvar selector = document.getElementById('selectClasificacion');\n\tvar btn_jugar = document.getElementById('btn-jugar');\n\tvar btn_reiniciar = document.getElementById('btn-reiniciar');\n\tvar btn_calificar = document.getElementById('btn-calificar');\n\n\tselector.innerHTML = getItemsClasificar();\n\tbtn_jugar.addEventListener('click',crearEntornoDeJuego);\n\tbtn_reiniciar.addEventListener('click',reiniciarJuego);\n\tbtn_calificar.addEventListener('click',calificar);\n}", "function cargarDirectores(req, res) {\n var peticionsql = 'SELECT * FROM director';\n \n conexionBaseDeDatos.query( peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "static list_DiagnosticoTratameinto(req, res){ \n const { id_internacion } = req.params\n diagnostico_tratamientos.findAll({\n where: { id_internacion: id_internacion }\n }).then((data) => {\n res.status(200).json(data);\n }); \n }", "function traercontacto_empresa(req,res){\n\tCONN('contacto_empresa').select().then(registros =>{\n\t\tif (!registros){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de contacto_empresa', registros:registros});\n\t\t}\n\t}).catch(error =>{\n\t\tres.status(500).send({resp: 'error', error: `${error}` });\n\t});\n}", "function listaGeneros(req, res) {\n var sqlGen = \"select * from genero\"\n con.query(sqlGen, function(error, resultado, fields) {\n errores(error, res);\n var response = {\n 'generos': resultado\n };\n\n res.send(JSON.stringify(response));\n });\n}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\", \"option\" );\n}", "function _CarregaRacas() {\n var select_raca = Dom('raca');\n if (select_raca == null) {\n // Testes não tem o select.\n return;\n }\n for (var chave_raca in tabelas_raca) {\n select_raca.appendChild(CriaOption(Traduz(tabelas_raca[chave_raca].nome), chave_raca))\n }\n}", "function buscarModulos(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Modulo.find({}, 'nombre tipo estado usuario') // envamos un obj vacio y buscamos por nombre enail y role \n .or([{ 'nombre': regex }, { 'tipo': regex }]) // envio un array de condiciones , busco por dos tipos \n .populate('usuario', 'nombre email') // se pueden poner mas populate de otras colecciones\n .exec((err, modulos) => {\n\n if (err) {\n reject('error al cargar modulos', err)\n } else {\n // modulos ira comno respuesta en el array respuesta[0]\n resolve(modulos) // devuelve los modulos encontrados en el find\n }\n })\n });\n}", "function buscarUsuarios(termino, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find()\n // .or - para buscar en dos propiedades de la misma coleccion\n .or([ { 'nombre' : regex }, { 'email' : regex } ])\n .exec((error, usuariosEncontrados) => {\n\n if(error) {\n reject('Error al cargar los usuarios', error);\n } else {\n resolve(usuariosEncontrados);\n }\n\n });\n });\n }", "function cargarActores(req, res) {\n var peticionsql = 'SELECT * FROM actor';\n \n conexionBaseDeDatos.query(peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "function listarImpresoras(){\n\n $(\"#selectImpresora\").html(\"\");\n navigator.notification.activityStart(\"Buscando impresoras...\", \"Por favor espere\");\n\n ImpresoraBixolonSPPR300ySPPR310.buscar((devices)=>{\n\n var lista = devices.map((device)=>{\n\n var id = device.MAC + \"_\" + device.Nombre;\n var texto = device.Nombre + \"(\" + device.MAC + \")\";\n\n $('#selectImpresora').append($('<option>', {\n value: id,\n text : texto\n }));\n\n });\n\n navigator.notification.activityStop();\n $('#selectImpresora').selectmenu('enable');\n $('#selectImpresora').selectmenu('refresh');\n\n });\n\n }", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function ConsultaItemSelect(tx) { console.log(\"ConsultaItemSelect\");\n\t\t console.log('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado');\n\t\ttx.executeSql('select id_estado_art,nom_estado from publicestado_articulo order by nom_estado', [], ConsultaLoadEstado,errorCB);\n\t\t console.log(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\");\n\t\ttx.executeSql(\"select id_linea,nom_linea from publiclinea where id_empresa = '\"+localStorage.id_empresa+\"' order by nom_linea\", [], ConsultaLineaCarga,errorCB);\n}", "static async getAllLaboratores(){\n const query = \n `\n SELECT \n u.firstname, u.lastname, u.mail, u.user_image, \n sc.social_class, sr.social_rank\n FROM user u\n JOIN social_class sc ON sc.id= u.social_class_id \n JOIN social_rank sr ON sr.id = u.social_rank_id\n WHERE sc.social_class = \"Laboratores\";\n `;\n const [result] = await connection.query(query)\n return result;\n }", "function alumnoRegistro(){\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n if(perfil === 2){\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML =\r\n `<label for=\"selListaDocentes\">Elija docente: </label><select id=\"selListaDocentes\"> \r\n </select>`;\r\n for (let i = 0; i < usuarios.length; i++) {\r\n const element = usuarios[i];\r\n if(element.perfil === \"docente\"){\r\n document.querySelector(\"#selListaDocentes\").innerHTML +=\r\n `<option value=\"${element.nombreUsuario}\">${element.nombre} (${element.nombreUsuario}) </option>`\r\n }\r\n }\r\n }else{\r\n document.querySelector(\"#selDocentesRegistro\").innerHTML = \"\";//Esta funcion corre cada vez que hay alguien selecciona un perfil en el formulario de registro, si cambia para otro que no sea alumno (2) viene aca y elimina el <select> de docente\r\n }\r\n}", "function obtenerResultados(req, res) {\n var id = req.params.id;\n var peticionSql = leerSql(\"obtenerResultados.sql\") + id + `\n GROUP BY pelicula.id\n ORDER BY votos DESC\n LIMIT 0,3;`\n\n conexionBaseDeDatos.query(peticionSql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n // Si la competencia no ha recibido votos devolvemos el mensaje correspondiente\n if(!resultado || resultado.length == 0) {\n console.log('Esta competencia aun no ha recibido votos.');\n return res.status(422).send('Esta competencia aun no ha recibido votos');\n } else {\n var respuesta = {\n competencia: resultado[0].nombre,\n resultados: resultado,\n }\n res.status(200).send(JSON.stringify(respuesta));\n }\n })\n}", "function obtenerValoresManiobras(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_maniobras WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 76; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_maniobras\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_maniobras_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function seleccionarOrden(productos){\n \n\n let rowProductos = document.querySelector(\".buzos__row\");\n\n rowProductos.innerHTML=\"\";\n\n let select = document.querySelector(\".selectOrdenProductos\");\n \n switch(select.value){\n\n case 'date':\n getPaginacion(ordenarProductosFecha(productos));\n break;\n \n case 'price-asc':\n getPaginacion(ordenarProductosPrecio(productos, \"asc\"));\n break;\n\n case 'price-des':\n getPaginacion(ordenarProductosPrecio(productos, \"des\"));\n break;\n\n }\n \n}", "function obtenerClientes() {\n\t\tconst conexion = window.indexedDB.open('crm', 1);\n\n\t\tconexion.onerror = () => console.log('Hubo un error');\n\n\t\tconexion.onsuccess = () => {\n\t\t\tDB = conexion.result;\n\n\t\t\tconst objectStore = DB.transaction('crm').objectStore('crm');\n\n\t\t\tobjectStore.openCursor().onsuccess = (e) => {\n\t\t\t\tconst cursor = e.target.result;\n\n\t\t\t\tif (cursor) {\n\t\t\t\t\tconst { nombre, empresa, email, telefono, id } = cursor.value;\n\n\t\t\t\t\tconst listado = document.querySelector('#listado-clientes');\n\n\t\t\t\t\tlistado.innerHTML += `\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200\">\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-5 font-medium text-gray-700 text-lg font-bold\"> ${nombre} </p>\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-10 text-gray-700\"> ${email} </p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 \">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-700\">${telefono}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 leading-5 text-gray-700\">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-600\">${empresa}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5\">\n\t\t\t\t\t\t\t\t<a href=\"editar-cliente.html?id=${id}\" class=\"text-teal-600 hover:text-teal-900 mr-5\">Editar</a>\n\t\t\t\t\t\t\t\t<a href=\"#\" data-cliente=\"${id}\" class=\"text-red-600 hover:text-red-900 eliminar\">Eliminar</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t`;\n\t\t\t\t\tcursor.continue();\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('No hay más registros');\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t}", "function obtenerValoresPreliminar(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem_preli,v_calificacion,o_observacion FROM puertas_valores_preliminar WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=seleval\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $(\"#text_obser_item\"+i+\"_eval_prel\").val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function lireTousLesAdmins(){\n return connSql.then(function (sql) {\n let resultat = sql.query(\"SELECT * FROM administrateur\");\n return resultat\n });\n}", "function getTypesComplain(req, res) {\n /**Nota\n * mandar por la url el filtro para obtenerna; por id, por nombre.\n */\n var filtro = req.params.filtro;\n var dato = req.params.dato;\n var connection = dbConnection();\n switch (filtro) {\n case \"id\":\n connection.query(\"SELECT * FROM tipo_queja WHERE id_tipo_queja=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n case \"descripcion\":\n dato = \"'\" + dato + \"'\"\n connection.query(\"SELECT * FROM tipo_queja WHERE descripcion=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n\n }\n\n}", "async function selectRota(dado){\n const conn = await connect();\n const sql = 'SELECT rota, funcao FROM Jogabilidade WHERE idJog =?;';\n const value = [dado.idJog];\n const [rows] = await conn.query(sql,value);\n return rows\n}", "function obtenerValoresMotorizacion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_motorizacion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 43; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_motorizacion\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_motorizacion_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function mostraSelect(i){\n $tabelaRoubos.innerHTML = '';\n\n criaTabela($tabelaRoubos, `Estamina requerida:`, `${roubosGrupo[i].estaminaR}%`,null,null);\n criaTabela($tabelaRoubos, `Power de roubo:`, roubosGrupo[i].powerNecessario,null,null);\n criaTabela($tabelaRoubos, `Recompensa:`, roubosGrupo[i].recompensaTxt,null,null);\n \n $tabelaRoubos.classList.add('visivel');\n}", "function loadAll() {\n var cidades = eurecaECBrasil.filtrarCidadeTextoService();\n return cidades.split(/, +/g).map( function (cidade) {\n return {\n value: cidade.toLowerCase(),\n display: cidade\n }; \n });\n }", "getPreguntasSinResponder(callback) {\n this.pool.getConnection(function (err, conexion) {\n \n if (err)\n callback(err);\n else {\n \n const sql = \"SELECT p.id_pregunta, p.id_usuario, p.titulo, p.cuerpo,p.fecha,u.nombre,u.imagen FROM preguntas AS p JOIN usuario AS u ON p.id_usuario=u.id_usuario WHERE p.respuesta=FALSE ORDER BY p.fecha DESC;\"; \n\n conexion.query(sql, function (err, resultado) {\n conexion.release();\n if (err)\n callback(err);\n else\n callback(null, resultado);\n }); \n }\n });\n }", "function getAll() {\n return connSql.then(function(conn){\n let resultat = conn.query(\"SELECT * FROM chambre\");\n return resultat\n });\n}", "function traer_grupo(req,res){\n\tCONN('grupo').select().then(grupos =>{\n\t\tconsole.log(grupos);\n\t\tif (!grupos){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de grupo', grupos:grupos });\n\t\t}\n\n\t})\n}", "function consultargrupo(req,res){\n\tlet consulgrupo = new Grupoempresa(req.body.grupo)\n\n\tCONN('grupo').where('grupo',req.body.grupo).select().then(traergrupo =>{\n\t\tconsole.log(traergrupo);\n\t\tif (traergrupo == ''){\n\t\t\tCONN('grupo').insert(consulgrupo).then(insertargrupo =>{\n\t\t\t\tif (!insertargrupo){\n\t\t\t\t\tres.status(500).send({resp:'error', error: 'no se inserto grupo'});\n\t\t\t\t}else{\n\t\t\t\t\tres.status(200).send({resp: 'grupo guardado', insertargrupo:insertargrupo });\n\t\t\t\t}\n\t\t\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp:'error', error: `${error}` });\n\t\t\t});\n\t\t}else{\n\t\t\tres.status(200).send({resp: 'grupo', traergrupo:traergrupo });\n\t\t}\n\n\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp:'error', error: `${error}` });\n\t\t\t});\n}", "function listarMedicoseAuxiliares(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select crmv, nomeMedico, telefoneMedico, emailMedico from Medico, Responsavel where Medico.Estado = Responsavel.Estado and Medico.Cidade = Responsavel.Cidade and Responsavel.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "async function getFormularNames(req, res) {\n var formulars = await pool.query(\"select * from formular\");\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n return res.status(200).send(formulars.rows);\n}", "function buscarUsuario(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find({}, 'nombre email role') // para que solo se muestre esos campos\n .or([{ 'nombre': regex }, { 'email': regex }])\n .exec((err, usuarios) => {\n if (err) {\n reject('error al cargar usuarios');\n\n } else {\n resolve(usuarios);\n }\n });\n\n });\n\n}", "function fSelReg(aDato, iCol) {\n\t\n\tif(aDato[0]==\"1\"){\n\t\tfrm.iEjercicio.value=aDato[23];\n\t\tfrm.iNumSolicitud.value=aDato[24];\n\t\tfrm.iCveHist.value=\"\";\n\t\t\n\t}else{\n\t\tfrm.iEjercicio.value=-1;\n\t\tfrm.iNumSolicitud.value=-1;\n\t\tfrm.iCveHist.value=aDato[17];\n\t}\n\t\n\t if(iCol==16 && aDato[0]==\"1\"){\n\t\t fArchivosADV();\n\t }else if(iCol==16 && aDato[0]==\"0\"){\n\t\t fArchivosHist();\n\t }\n\t\n}", "function obtenerValoresMecanicos(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_mecanicos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_mecanicos\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_lv_valor_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function carregarListaSolicitantes(){\n\tdwr.util.useLoadingMessage();\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tFacadeAjax.getListaSolicitantes(unidade, function montaComboUnidadeTRE(listBeans){\n\t\tDWRUtil.removeAllOptions(\"comboUnidadesSolicitantes\");\n\t\tDWRUtil.addOptions(\"comboUnidadesSolicitantes\", listBeans, \"idUnidade\",\"nome\");\n\t});\n}", "function listarInstrutores () {\n instrutorService.listar().then(function (resposta) {\n //recebe e manipula uma promessa(resposta)\n $scope.instrutores = resposta.data;\n })\n instrutorService.listarAulas().then(function (resposta) {\n $scope.aulas = resposta.data;\n })\n }", "static async buscarTurmas(req, res) {\n /* Passa via objeto descontruido os campos que\n serão usados para consulta de registros através do\n endpoint, usando o req,query */\n const { data_inicial, data_final } = req.query;\n\n /*Criação do objeto que será usado \n como parâmetro na busca de registros */\n const where = {};\n\n /*Criação da condicional com operadores que será usada\n para a busca de registros\n \n Campo Chave 1 || Campo Chave 1, caso forem vazios, parametro é \n passado em branco\n\n Caso informado, usa a propriedade do OP: \n gte - gratter than or equal, maior ou igual\n lte, letter than or equal, menor ou igual\n */\n data_inicial || data_final ? (where.data_inicio = {}) : null;\n data_inicial ? (where.data_inicio[Op.gte] = data_inicial) : null;\n data_final ? (where.data_inicio[Op.lte] = data_final) : null;\n\n try {\n const consultaTurmas = await //Enquanto executa\n /* Método Sequelize para busca de registros, \n passando via parâmetro o objeto criado */\n database.Turmas.findAll({ where });\n\n /*Retorna a consulta do banco no formato JSON */\n return res.status(200).json(consultaTurmas);\n } catch (error) {\n /*Em caso de erro, retorna o cod. erro (500) e sua mensagem\n em formato JSON */\n return res.status(500).json(error.message);\n }\n }", "async getDatosAcopio() {\n let query = `SELECT al.almacenamientoid, ca.centroacopioid, ca.centroacopionombre, \n concat('Centro de Acopio: ', ca.centroacopionombre, ' | Propietario: ', pe.pernombres, ' ', pe.perapellidos) \"detalles\"\n FROM almacenamiento al, centroacopio ca, responsableacopio ra, persona pe\n WHERE al.centroacopioid = ca.centroacopioid AND ca.responsableacopioid = ra.responsableacopioid AND ra.responsableacopioid = pe.personaid;`;\n let result = await pool.query(query);\n return result.rows; // Devuelve el array de json que contiene todos los controles de maleza realizados\n }", "static async getAllOratores(){\n const query = \n `\n SELECT \n u.firstname, u.lastname, u.mail, u.user_image, \n sc.social_class, sr.social_rank\n FROM user u\n JOIN social_class sc ON sc.id= u.social_class_id \n JOIN social_rank sr ON sr.id = u.social_rank_id\n WHERE sc.social_class = \"Oratores\" \n AND sr.social_rank != \"King\" AND sr.social_rank != \"Queen\" AND sr.social_rank != \"Prince\" AND sr.social_rank != \"Princess\";\n `;\n const result = await connection.query(query)\n return result;\n }", "function limpiarSelect() {\n var select = document.getElementById('select-bd-postgres');\n while (select.firstChild) {\n select.removeChild(select.firstChild);\n }\n}", "function listaRecomendadas(req, res) {\n\n var sqlRecomienda = \"select pelicula.id,titulo,duracion,director,anio,fecha_lanzamiento,puntuacion,poster,trama,nombre from pelicula join genero on pelicula.genero_id = genero.id where pelicula.id = pelicula.id\";\n \n if (req.query.genero) {\n genero = req.query.genero;\n sqlRecomienda = sqlRecomienda + \" and genero.nombre =\" +\"'\"+genero+\"'\";\n }\n\n if (req.query.anio_inicio) {\n var anioInicio = req.query.anio_inicio;\n sqlRecomienda = sqlRecomienda + \" and pelicula.anio between \" +anioInicio;\n }\n\n if (req.query.anio_fin) {\n var anioFin = req.query.anio_fin;\n sqlRecomienda = sqlRecomienda + \" and \" +anioFin;\n }\n\n if (req.query.puntuacion) {\n var puntuacion = req.query.puntuacion;\n sqlRecomienda = sqlRecomienda + \" and puntuacion >=\" +puntuacion;\n }\n\n var response = {\n 'peliculas': \"\",\n }\n\n \n con.query(sqlRecomienda, function(error, resultado, fields) {\n errores(error, res);\n response.peliculas = resultado;\n res.send(JSON.stringify(response));\n });\n}", "function buscarPorColeccion(req, res) {\n\n // viene x los params de la url \n let busqueda = req.params.bus;\n let tabla = req.params.tabla;\n\n // busqueda es el parametro de la url \n // 'i' may y minus es insensible\n let regex = new RegExp(busqueda, 'i'); // aqui convertimos la busqueda con la ex regular\n\n let promesa;\n\n // busqueda contiene lo que busco \n // ej : coleccion/usuarios/manuel ===>>> colecccion/tabla/busqueda\n\n // pregunto por cada coleccion que viene en la tabla \n switch (tabla) {\n\n case 'usuarios':\n promesa = buscarUsuarios(busqueda, regex);\n break;\n\n case 'controles':\n promesa = buscarControles(busqueda, regex);\n break;\n\n case 'modulos':\n promesa = buscarModulos(busqueda, regex);\n break;\n\n case 'hospitales':\n promesa = buscarHospitales(busqueda, regex);\n break;\n\n case 'medicos':\n promesa = buscarMedicos(busqueda, regex);\n break; \n\n default:\n\n return res.status(400).json({\n ok: false,\n mensaje: 'los colecciones de busqueda solo son usuarios, modulos y controles',\n error: { message: 'tipo de coleccion/documento no valido' }\n })\n }\n\n // en ecma6 existe propiedades de obj computadas \n // ponemos tabla entre [] y nos da su valor , que puede ser usuarios medicos hospitales \n // si no lo ponemos entre [] imprime tabla \n\n promesa.then(data => {\n\n res.status(200).json({\n ok: true,\n [tabla]: data\n })\n })\n\n}", "static consultarClientes(callback) {\n //Armamos la consulta segn los parametros que necesitemos\n let query = 'SELECT * ';\n query += 'FROM '+table.name+';'; \n //Verificamos la conexion\n if(sql){\n sql.query(query, (err, result) => {\n if(err){\n throw err;\n }else{ \n let clientes = [];\n for(let entity of result){\n let cliente = Cliente.mapFactory(entity); \n clientes.push(cliente);\n } \n console.log(clientes); \n callback(null,clientes);\n }\n })\n }else{\n throw \"Problema conectado con Mysql\";\n } \n }", "function buscarGrupos(busqueda, regex) {\n return new Promise((resolve, reject) => {\n Grupo.find({ nombre: regex })\n .populate('usuario', 'nombre email')\n .exec((err, grupos) => {\n if (err) {\n reject('Error al cargar grupos', err);\n } else {\n resolve(grupos);\n }\n });\n });\n}", "function buscarUsuarios(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n // al poner 2do argumento , no traigo el pass\n Usuario.find({}, 'nombre imagen ') // enviamos un obj vacio y buscamos por nombre email etc : es lo que quiero traer , es lo que va a mostrar \n .or([{ 'nombre': regex }, { 'email': regex }]) // en cambio aqui envio un array de condiciones para buscar, busco por email y nombre\n .exec((err, usuarios) => {\n\n if (err) {\n reject('error al cargar usuarios', err)\n } else {\n // usuarios ira como respuesta en el array respuesta[2]\n resolve(usuarios) // devuelve los usuarios encontrados en el find\n }\n })\n });\n}", "static async buscarNiveis(req, res) {\n try {\n const consultaNiveis = await //Enquanto executa\n niveisServices.buscarRegistros() /* Método Sequelize para busca de registros */\n\n /*Retorna a consulta do banco no formato JSON */\n return res.status(200).json(consultaNiveis)\n\n } catch (error) {\n\n /*Em caso de erro, retorna o cod. erro (500) e sua mensagem\n em formato JSON */\n return res.status(500).json(error.message)\n }\n }", "function obtenerValoresElectrica(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_electrica WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 38; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_electrica\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_electrica_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function cadastrarTecnico(){\n\tvar matriculaTecnico = DWRUtil.getValue(\"comboTecnicoTRE\");\n\tvar login = DWRUtil.getValue(\"login\"); \n\tif((matriculaTecnico==null ||matriculaTecnico=='')){\n\t\talert(\"Selecione um tecnico do TRE.\");\n\t}else{\n\t\tFacadeAjax.integrarTecnico(matriculaTecnico,login);\n\t\tcarregaTecnicos();\t\n\t}\n\t\n}", "function recuperaSelect() {\n $.ajax({\n url: '../modelo/crud.php',\n method: 'post',\n data: {\n 'opcion': 10,\n 'idprofesor': idpersonasProfesor\n },\n success: function(data) {\n data = $.parseJSON(data);\n // mostramos los datos del alumnos\n let resulAlumno = '<option value=\"0\">Elige una opción</option>';\n data.alumno.forEach(function(element) {\n resulAlumno += '<option value=' + element.idpersonas + '>' + element.idpersonas + ' - ' + element.nombre + ' - ' + element.apellido + '</option>';\n });\n $('#lista_reproduccion').html(resulAlumno);\n\n // mostramos los datos de los cursos\n let resulCurso = '<option value=\"0\">Elige una opción</option>';\n data.curso.forEach(function(element) {\n resulCurso += '<option value=' + element.idcursos + '>' + element.idcursos + ' - ' + element.curso + '</option>';\n });\n $('#lista_cursos').html(resulCurso);\n\n },\n error: function(xhr, status) {\n alert('Disculpe, existio un problema');\n }\n });\n}", "function ordenar() {\n let seleccion = $(\"#miSeleccion\").val().toUpperCase();\n popularListaCompleta();\n listaCompletaClases = listaCompletaClases.filter(Clase => Clase.dia ==\n seleccion);\n renderizarProductos();\n}", "function buscarHospitales(regex){\n return new Promise((resolve,reject)=>{\n Hospital.find({ nombre: regex }).populate('usuario','nombre apellido').exec((err,hospitales)=>{\n if(err){\n reject('Error al cargar hospitales',err);\n }else{\n resolve(hospitales);\n }\n });\n });\n}", "function listar() {\n\n\t\ttabla=$('#resolucion_data').dataTable({\n\t\t\t\"aProcessing\":true,//Activamos procesamiento de datatable\n\t\t\t\"aServerSide\":true,//Paginacion y filtrado realizados por el servidor\n\t\t\tdom:'Bfrtip',//Definimos los elementos del control de table\n\t\t\tbuttons:[\n\t\t\t\t'copyHtml5',\n\t\t\t\t'excelHtml5',\n\t\t\t\t'pdf'//para los botones en el datatable\n\t\t\t\t],\n\t\t\t\"ajax\":\n\t\t\t{\n\t\t\t\turl:'../ajax/resolucion.php?op=buscar_resolucion',//enviamos el parametro \n\t\t\t\ttype:\"get\",//el tipo del parametro\n\t\t\t\tdataType:\"json\",//formato de la data\n\n\t\t\t\terror: function (e) {\n\t\t\t\t\tconsole.log(e.responseText);//para hacer la verificacion de errores\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"bDestroy\":true,\n\t\t\t\"responsive\":true,\n\t\t\t\"bInfo\":true,//informacion del los datatable\n\t\t\t\"iDisplayLength\":20,//Pora cada 10 registros hace una paginacion\n\t\t\t\"order\":[[0,\"desc\"]],//Ordenar (Columna,orden)\n \t\t\t\n \t\t\t\"language\": {\n \n\t\t\t \"sProcessing\": \"Procesando...\",\n\t\t\t \n\t\t\t \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t \n\t\t\t \"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t \n\t\t\t \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t \n\t\t\t \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\t\t\t \n\t\t\t \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\t\t\t \n\t\t\t \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t \n\t\t\t \"sInfoPostFix\": \"\",\n\t\t\t \n\t\t\t \"sSearch\": \"Buscar:\",\n\t\t\t \n\t\t\t \"sUrl\": \"\",\n\t\t\t \n\t\t\t \"sInfoThousands\": \",\",\n\t\t\t \n\t\t\t \"sLoadingRecords\": \"Cargando...\",\n\t\t\t \n\t\t\t \"oPaginate\": {\n\t\t\t \n\t\t\t \"sFirst\": \"Primero\",\n\t\t\t \n\t\t\t \"sLast\": \"Último\",\n\t\t\t \n\t\t\t \"sNext\": \"Siguiente\",\n\t\t\t \n\t\t\t \"sPrevious\": \"Anterior\"\n\t\t\t \n\t\t\t },\n\t\t\t \n\t\t\t \"oAria\": {\n\t\t\t \n\t\t\t \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t \n\t\t\t \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\n\t\t\t }\n\n\t\t\t }//cerrando language\n\t\t}).DataTable();\n\t}", "function fCargaListadoA(){\n frm.hdFiltro.value = \"ICVEMODULO = \" +frm.iCveModulo.value+ \" AND INUMREPORTE NOT IN (SELECT INUMREPORTE FROM GRLREPORTEXOPINION WHERE ICVEOPINIONENTIDAD = \"+frm.iCveOpinionEntidad.value+ \" AND ICVESISTEMA = 44 AND ICVEMODULO = \" +frm.iCveModulo.value+ \" )\";\n frm.hdOrden.value = \" CNOMREPORTE\";\n frm.hdNumReg.value = 100000;\n fEngSubmite(\"pgGRLReporteA.jsp\",\"GRLReporte\");\n }", "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "function cambiarMapas()\r\n{\r\n\t opcion = sel.value();\r\n}", "function guardarCursosAsociar() {\n\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]:checked');\n let cursosSeleccionados = [];\n let codigoCurso;\n\n //Este ciclo for debe empezar en 1, ya que en el cero \"0\" se encuentra el id unico del elemento al que se le desea agregar elementos\n for (let i = 0; i < listaCheckboxCursos.length; i++) {\n codigoCurso = listaCheckboxCursos[i].dataset.codigo;\n cursosSeleccionados.push(codigoCurso);\n }\n\n return cursosSeleccionados;\n\n\n}", "buscaPorIdEstado(id, res) {\n const sql = `select ti.*, e.nome as estado, e.sigla, r.nome as regiao from times ti\n inner join estados e on (e.estado_id = ti.estado_id)\n inner join regioes r on (r.regiao_id = e.regiao_id)\n where e.estado_id = ${id} `\n\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "function obtenerValoresProteccion(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_sele_inspector,v_sele_empresa,o_observacion FROM puertas_valores_proteccion WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_protec_person\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_inspector+\"']\").prop(\"checked\",true);\n $(\"input[name=sele_protec_person\"+i+\"_\"+i+\"][value='\"+resultSet.rows.item(x).v_sele_empresa+\"']\").prop(\"checked\",true);\n $('#text_obser_protec_person'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function getLogAggiornamenti (req) {\n\n var queryText = 'SELECT ' +\n 'tabella, to_char(data_aggiornamento,' + '\\'' + 'DD-MM-YYYY' + '\\'' + ') data_aggiornamento ' +\n 'FROM pronolegaforum.log_aggiornamenti ' +\n 'ORDER BY tabella';\n\n return db.any(queryText);\n\n}", "static GetUtilidad(cadenaDeConexion, fI, fF, idSucursal, result) {\n\n var sucursal = '';\n if (idSucursal != 1) {\n sucursal = `AND info_ingresos.codSucursal=` + idSucursal;\n }\n console.log(\"sucursal \", sucursal);\n sqlNegocio(\n cadenaDeConexion,\n ` SELECT base.codMes, SUM(base.precioVenta) as totalVenta from (SELECT info_grupopartidas.nombreGrupo,info_ingresos.codMes,\n\n CASE info_grupopartidas.nombreGrupo\n WHEN 'EGRESOS' THEN -(SUM(info_ingresos.sumPrecioVenta))\n WHEN 'INGRESOS' THEN SUM(info_ingresos.sumPrecioVenta)\n END as precioVenta\n \n \n from info_ingresos LEFT JOIN\n info_partidas on info_ingresos.idPartida = info_partidas.idPartida LEFT JOIN \n info_grupopartidas on info_grupopartidas.idGrupoPartida = info_partidas.idGrupo \n where info_ingresos.fecEmision BETWEEN '`+ fI + `' AND '` + fF + `' AND info_ingresos.estado=1 ` + sucursal + ` AND ( info_grupopartidas.nombreGrupo = 'EGRESOS' or info_grupopartidas.nombreGrupo = 'INGRESOS')\n group by info_grupopartidas.nombreGrupo,info_ingresos.codMes)as base group by base.codMes\n order by base.codMes ASC`,\n [],\n function (err, res) {\n if (err) {\n console.log(\"error: \", err);\n result(null, err);\n }\n else {\n result(null, res);\n }\n });\n }", "function busca(busca) {\n $.ajax({\n type: \"POST\",\n url: \"acoes/select.php\",\n dataType: \"json\",\n data: {//tipo de dado\n 'busca':\"busca\"//botão pra inicia a ação\n }\n\n }).done(function (resposta) { //receber a resposta do busca\n console.log('encontrei ' + resposta.quant + ' registros');\n console.log(resposta.busca[0,'0'].id, resposta.busca[0,'0'].descri);\n if(resposta.erros){\n\n //criação das variaves apos o receber a resposta da pagina select\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qntp = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var st = resposta.busca[i]['9']\n //criação da tabela para exebição do resultado\n $('.carro td.descri').append(\" <tr><td ><p class=' text-capitalize id='des' value='\"+desc+\"'>\"+desc +'</p></td></tr>')\n $('.carro td.marca').append(\" <tr><td ><p class=' text-capitalize id='mar' value='\"+mar+\"'>\"+mar +'</p></td></tr>')\n $('.carro td.modelo').append(\" <tr><td ><p class=' text-capitalize id='mod' value='\"+mod+\"'>\"+mod +'</p></td></tr>')\n $('.carro td.tipov').append(\" <tr><td ><p class=' text-capitalize id='tpv' value='\"+tpv+\"'>\"+tpv +'</p></td></tr>')\n $('.carro td.quantp').append(\" <tr><td ><p class=' text-capitalize id='qnt' value='\"+qntp+\"'>\"+qntp +'</p></td></tr>')\n $('.carro td.vlvenda').append(\" <tr><td ><p class=' text-capitalize id='vlv' value='\"+vlv+\"'>\"+vlv +'</p></td></tr>')\n $('.carro td.vlcompra').append(\" <tr><td ><p class=' text-capitalize id='vlc' value='\"+vlc+\"'>\"+vlc +'</p></td></tr>')\n $('.carro td.dtcompra').append(\" <tr><td ><p class=' text-capitalize id='dtc' value='\"+dtc+\"'>\"+dtc +'</p></td></tr>')\n $('.carro td.estato').append(\" <tr><td ><p class=' text-capitalize id='st' value='\"+st+\"'>\"+st +'</p></td></tr>')\n $('.carro td.id').append(\" <tr><td ><button class='r btn btn-sm btn-primary nav-link' id='idvalor' type='button' data-toggle='modal' data-target='#atualFormulario' value='\"+id+\"'>\"+\"Edit\"+'</button></td></tr>')\n $('.carro td.ider').append(\"<tr><td ><button class='del btn btn-sm btn-danger nav-link' type='button' name='idel' value='\"+id+\"'>\"+\"Del\"+'</button></td></tr>')\n\n\n }\n\n\n //função pra por valores da tabela no input do formulario de atualização\n //aqui insere os o ID no formulario de atualização\n $('.r').click('button',function() {\n var idvl = $(this).val();\n $('#i1'). val(idvl);\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qnt = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var sta = resposta.busca[i]['9']\n //aqui comparamos o valor que recuperamos o id da tabela e comparfamos com o id da função busca\n if (idvl==id) {\n $('#descri1'). val(desc);\n $('#marca1'). val(mar);\n $('#modelo1'). val(mod);\n $('#tipov1'). val(tpv);\n $('#quantp1'). val(qnt);\n $('#vlvenda1'). val(vlv);\n $('#vlcompra1'). val(vlc);\n $('#dtcompra1'). val(dtc);\n $('#estato1'). val(sta);\n console.log(idvl);\n\n }\n\n\n\n\n\n }\n })\n //aqui finda\n\n //deleta via ajax\n $('.del').click('button',function() {\n var idel = $(this).val();\n console.log(idel);\n $.ajax({\n url: \"acoes/del.php\",\n type: \"POST\",\n data : { 'idel': idel },\n success: function(data)\n {\n location.reload(\".carro\");//atualiza o contener apos a execução com sucesso\n }\n });\n }); // delete close\n\n\n }\n })\n }", "function CargarListado(tx) {\n\tif(busqueda!=null){\t\n\t console.log(\"SELECT sub.id_linea, sub.id_sublinea, art.nom_articulo, art.referencia, art.serie, placa_nueva, placa_anterior, art.id_envio, marca, id_estado, art.id_articulo,art.fecha_fabricacion FROM publicarticulo art LEFT JOIN publicsublinea sub ON sub.id_sublinea = art.id_sublinea WHERE art.rowid ='\"+res[3]+\"'\");\n\t tx.executeSql(\"SELECT sub.id_linea, sub.id_sublinea, art.nom_articulo, art.referencia, art.serie, placa_nueva, placa_anterior, art.id_envio, marca, id_estado, art.id_articulo,art.fecha_fabricacion FROM publicarticulo art LEFT JOIN publicsublinea sub ON sub.id_sublinea = art.id_sublinea WHERE art.rowid ='\"+res[3]+\"'\", [], MuestraItems);\n\t}\n}", "function allCustomers(req, res){\n var getAllCustomersQuery = \"SELECT * FROM Customer\\n\"+\n \"WHERE active = 'Y'\\n\"+\n \"order by custName\"; \n connection().query(getAllCustomersQuery, function(error, result, fields){\n if(error){\n console.log(\"Hubo un error al obtener la lista de clientes\", error.message);\n return res.status(404).send(\"Hubo un error en la consulta allCustomers\");\n }\n\n if(result.length == 0){\n return res.status(404).json(\"No se encontraron clientes registrados\");\n }\n\n var response = {\n 'clientes': result\n };\n \n res.send(response);\n });\n}", "function cargaComplementos(){\n //Cargado del DataTables\n if($('table').length>0){\n $('table').DataTable();\n }\n \n //Cargado del DatePicker\n if($(\".date-picker\").toArray().length>0){\n $('.date-picker').datepicker({\n format : \"dd/mm/yyyy\"\n });\n }\n \n //Cargado del Input Mask con el formato \"dd/mm/yyyy\"\n if($('.input-date').toArray().length>0){\n $(\".input-date\").inputmask(\"dd/mm/yyyy\");\n }\n if($('.select2').toArray().length>0){\n $(\".select2\").select2({\n placeholder : \"Seleccione una opción\"\n });\n }\n}", "function criaSelectRoubos(){\n let i = 0\n $selectRoubos.innerHTML= '';\n roubosGrupo.forEach(function(rg){\n \n let option1 = document.createElement('option')\n option1.value = i;\n option1.text = `${rg.nome} - ${rg.powerNecessario}`;\n $selectRoubos.append(option1);\n i++;\n })\n}", "function buscarBarrios(consulta){\n $.ajax({\n url: uri+ '/Ruta/consultar_barrio',\n type:'POST',\n datatype:'HTML',\n data:{\n id:consulta,\n },\n })\n .done(function(datos){\n $('#ddlbarri').html(datos);\n })\n\n .fail(function(){\n console.log(\"error\");\n });\n}", "function al_seleccionar_canal(){\n\t\t$(form_publicidad.canal).on('change',function(e){\n\n\t\t\t//limpiarSelect(1);\n\t\t\tcargarSelectContenido(1);\n\n\t\t});\n\t}", "function _CarregaTemplates() {\n var select_template = Dom('template');\n if (select_template == null) {\n // Testes não tem o select.\n return;\n }\n select_template.appendChild(CriaOption('Nenhum', ''))\n for (var chave_template in tabelas_template) {\n select_template.appendChild(CriaOption(Traduz(tabelas_template[chave_template].nome), chave_template))\n }\n}", "async function obtenerTodosLasCiudadesXpais(pais_id) {\n var queryString = '';\n\n console.log('ENTRE');\n queryString = queryString + ' SELECT cd.id, cd.nombre as ciudad';\n queryString = queryString + ' from ciudades cd where pais_id = ? ';\n\n \n\n let ciudad = await sequelize.query(queryString,\n { type: sequelize.QueryTypes.SELECT,\n replacements:[pais_id]})\n return ciudad;\n }", "async function buscar_usuarios(){\n let resultado_buscar_usuario = await sequelize.query('SELECT * FROM usuarios',{\n type: sequelize.QueryTypes.SELECT\n })\n return resultado_buscar_usuario\n}", "function traerempresas(req,res){\n\n\tCONN('empresa')\n\t.join('contacto_empresa','empresa.id_contacto','=','contacto_empresa.id_contacto')\n\t.join('status','empresa.id_status','=','status.id_status')\n\t.join('direccion_empresa','empresa.id_direccion','=','direccion_empresa.id_direccion')\n\t.join('colonia','direccion_empresa.id_colonia', '=','colonia.id_colonia')\n\t.join('alcaldia','direccion_empresa.id_alcaldia', '=','alcaldia.id_alcaldia')\n\t.join('estado','direccion_empresa.id_estado', '=','estado.id_estado')\n\n\t\n\n\t.select().orderBy('empresa.id_empresa')\n\t.then(todas =>{\n\t\t\tconsole.log(todas);\n\t\tif (!todas){\n\t\t\t\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa', todas:todas });\n\t\t}\n\t}).catch(error =>{\n\t\tres.status(500).send({resp: 'error', error: `${error}` });\n\t});\n}", "function selectAll() {\n //query all info from burgers_db\n var queryString = \"SELECT * FROM burgers;\"\n connection.query(queryString, function(err, result) {\n if (err) throw err;\n console.log(result);\n res.json(result);\n });\n }", "function consultar_trj() {\n\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\ttry {\n\t\t\tdocument.getElementsByClassName('lista_vendedores')[1].removeAttribute('selected', '')\n\t\t} catch (error) {\n\t\t}\n\t}\n\tvar envio = { numero: valor('numero_consulta') }\n\tcargando()\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-tarjetas/consultar-numero\",\n\t\tdata: envio\n\t}).done((respuesta) => {\n\t\tif (respuesta == 'Nada') {\n\t\t\t$('#div-error').html('Esta tarjeta no existe, o no ha sido vendida, individualmente sólo pueden modificarse tarjetas vendidas')\n\t\t\tdocument.getElementById('div-error').style.display = 'block'\n\t\t\tno_cargando()\n\t\t\treturn\n\t\t}\n\t\tvar opciones_vend = document.getElementsByClassName('lista_vendedores')\n\t\tfor (var i = 0; i < opciones_vend.length; i++) {\n\t\t\tif (opciones_vend[i].value == respuesta[0].vendedor) {\n\t\t\t\topciones_vend[i].setAttribute('selected', '')\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('div-error').style.display = 'none'\n\t\tasignar('mod_tar_num', respuesta[0].numero)\n\t\tasignar('mod_tar_inic', ordenarFechas(respuesta[0].fechainicial))\n\t\tasignar('mod_tar_fin', ordenarFechas(respuesta[0].fechafinal))\n\t\tvar cadena = '';\n\t\tfor (var i = 0; i < respuesta[0].locales.length; i++) {\n\t\t\ttry {\n\t\t\t\tcadena += `<div class=\"row fondo-blanco este-es-local\" style=\" width:100%\" id=\"${respuesta[1][i].codigo}\">\n\t\t\t\t\t\t\t\t<div class=\"col-lg-3 col-md-4\">\n\t\t\t\t\t\t\t\t<label>Local</label>\n\t\t\t\t\t\t\t\t<img width=\"100%\" src=\"${respuesta[1][i].logotipo}\"/>\n\t\t\t\t\t\t\t\t<h5 class=\"centrado\">${respuesta[1][i].nombre}</h5>\n\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t<div class=\"col-lg-9 col-md-8\">\n\t\t\t\t\t\t\t\t<div class=\"table\">\n\t\t\t\t\t\t\t\t\t<table class=\"table table-bordered\"><tr> <th>Beneficio</th><th colspan=\"2\">Estado</th></tr>`\n\t\t\t\tfor (var j = 0; j < respuesta[0].locales[i].beneficio.length; j++) {\n\t\t\t\t\tvar estado_benef = verificar_benef(respuesta[0].locales[i].beneficio[j].activo)\n\t\t\t\t\tcadena += `<tr>\n\t\t\t\t\t\t\t\t<td><textarea class=\"area-beneficios\" readonly style=\"width:100%; height:140px; border: solid 0px white\" resizable=\"none\">${ascii_texto(respuesta[0].locales[i].beneficio[j].beneficio)}\n\t\t\t\t\t\t\t\t</textarea></td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label><input value=\"1\" onchange=\"conSeleccion(this)\" class=\"benef_escog\" name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" ${estado_benef[0]} type=\"radio\"/> Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<label><input value=\"0\" onchange=\"sinSeleccion(this)\" class=\"benef_escog\" ${estado_benef[1]} name=\"${respuesta[0].locales[i].beneficio[j].codigo}\" type=\"radio\"/> No Disponible.</label>\n\t\t\t\t\t\t\t\t</td>\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t\tcadena += `</table>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>`\n\t\t\t} catch (error) {\n\t\t\t\tcadena += ''\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById('loc_mod_tar').innerHTML = cadena\n\t\tdocument.getElementById('edicion_individual').style.display = 'block'\n\t\tdocument.getElementById('consulta_edicion').style.display = 'none'\n\t\tasignar('numero_consulta', '')\n\t\tno_cargando()\n\t})\n}", "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "function all(req, res, next) {\n db.any('select * from cliente')\n .then(function (data) {\n res.status(200)\n .json(data);\n })\n .catch( err => {\n console.error(\"error \"+err);\n return next(err);\n });\n}", "function cadastrarSolicitante(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar notSolicitante = DWRUtil.getValue(\"comboUnidadesNaoSolicitantes\");\n\tif((notSolicitante==null ||notSolicitante=='')){\n\t\talert(\"Selecione uma unidade do TRE.\");\n\t}else{\n\t\tFacadeAjax.adicionaUnidadeSolicitante(unidade,notSolicitante);\n\t\tcarregaUnidadesSolicitantes()\t\n\t}\t\n}", "async function todosArticulosController (req, res){\r\n let query = `SELECT Articulo, Nombre, UnidadCompra, UnidadVenta FROM Articulos`;\r\n let resultado = await createRawQuery({suc: 'bo', query})\r\n res.json(resultado)\r\n}", "function obtenerPersonas(res){\n var personas = [];\n tb_persona.connection.query('SELECT * FROM persona', function(err, rows){\n if(err) throw err;\n rows.forEach(function(result){\n personas.push(result);\n });\n res.send(personas);\n });\n}", "function listarRecursos(callback){\n\tFarola.find({}, null, callback);\n}", "async getAll() {\n try {\n const db = await this.conexion.conectar();\n const collection = db.collection('Encargados');\n const findResult = await collection.find({}).toArray();\n await this.conexion.desconectar();\n return (findResult);\n }\n catch (e) {\n throw e;\n }\n }" ]
[ "0.62919205", "0.6157102", "0.6133443", "0.613185", "0.6087473", "0.6078431", "0.607074", "0.5997127", "0.59788364", "0.59719163", "0.5947582", "0.59245485", "0.5897373", "0.58938044", "0.58775395", "0.5802812", "0.5802678", "0.5802365", "0.57918733", "0.5773877", "0.5763097", "0.57512057", "0.57484883", "0.5744551", "0.5735023", "0.5730328", "0.57121706", "0.5705367", "0.56815034", "0.56657594", "0.5657822", "0.5652507", "0.56516343", "0.56312627", "0.56278205", "0.56247693", "0.5622066", "0.56212103", "0.5620921", "0.56152225", "0.5606704", "0.5601186", "0.56005764", "0.5591142", "0.55865985", "0.55795527", "0.55763465", "0.55740815", "0.5571869", "0.5562409", "0.55611753", "0.5561105", "0.5558619", "0.5558404", "0.555685", "0.5551253", "0.5543649", "0.554101", "0.55405116", "0.55397743", "0.553699", "0.5531751", "0.55161816", "0.55154973", "0.551185", "0.5511317", "0.54912525", "0.54864675", "0.54833555", "0.5478968", "0.5473764", "0.54671293", "0.5460577", "0.54600394", "0.5456218", "0.54555017", "0.5444125", "0.5442233", "0.5440585", "0.54365873", "0.5434201", "0.5433249", "0.5427849", "0.5427634", "0.54268336", "0.541986", "0.54145575", "0.5413488", "0.54116076", "0.5403645", "0.5396786", "0.5395139", "0.5390243", "0.5387738", "0.5383468", "0.5383152", "0.5374944", "0.5365937", "0.5361371", "0.53577846", "0.53516227" ]
0.0
-1
Enable async hooks Hooks are enabled by default.
enable () { this.hook.enable() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "registerHooks() {\n\n S.addHook(this._hookPre.bind(this), {\n action: 'functionRun',\n event: 'pre'\n });\n\n S.addHook(this._hookPost.bind(this), {\n action: 'functionRun',\n event: 'post'\n });\n\n return BbPromise.resolve();\n }", "async setup() {\n this.hooks = await this.github.genHooks();\n this.is_setup = true;\n }", "before (asyncId) {\n fs.writeSync(1, \"\\n\\tHook before \"+asyncId+\"\\n\")\n }", "enableAsyncRequest() {\n this._asyncRequest = true;\n }", "function addHook (name, fn) {\n throwIfAlreadyStarted('Cannot call \"addHook\" when fastify instance is already started!')\n\n if (name === 'onSend' || name === 'preSerialization' || name === 'onError' || name === 'preParsing') {\n if (fn.constructor.name === 'AsyncFunction' && fn.length === 4) {\n throw new Error('Async function has too many arguments. Async hooks should not use the \\'done\\' argument.')\n }\n } else if (name === 'onReady') {\n if (fn.constructor.name === 'AsyncFunction' && fn.length !== 0) {\n throw new Error('Async function has too many arguments. Async hooks should not use the \\'done\\' argument.')\n }\n } else {\n if (fn.constructor.name === 'AsyncFunction' && fn.length === 3) {\n throw new Error('Async function has too many arguments. Async hooks should not use the \\'done\\' argument.')\n }\n }\n\n if (name === 'onClose') {\n this.onClose(fn)\n } else if (name === 'onReady') {\n this[kHooks].add(name, fn)\n } else if (name === 'onRoute') {\n this[kHooks].validate(name, fn)\n this[kHooks].add(name, fn)\n } else {\n this.after((err, done) => {\n _addHook.call(this, name, fn)\n done(err)\n })\n }\n return this\n\n function _addHook (name, fn) {\n this[kHooks].add(name, fn)\n this[kChildren].forEach(child => _addHook.call(child, name, fn))\n }\n }", "setAsync(){\n this.async = true;\n }", "_initHooks() {\n for (let hook in this.opts.hooks) {\n this.bind(hook, this.opts.hooks[hook]);\n }\n }", "function hooks() {\n \"use strict\";\n}", "onEnable() {}", "init (asyncId, type, triggersAsyncId, resource) {\n fs.writeSync(1, \"\\n\\t>>>>>> Hook init <<<<<<<<\"+asyncId+\"\\n\")\n }", "attachHooks(hooks){\n if(!hooks){ return false}\n if([] instanceof Array){\n _hooks.concat(hooks)\n }else {\n _hooks.push(hooks)\n }\n return true;\n }", "function Async(fun, hook) {\n\tthis.fun = fun;\n\tthis.hook = hook;\n}", "async function initialize() {\n enableLogging = await isLoggingEnabled();\n}", "bindHooks() {\n //\n }", "enable() { }", "addHook (hook) {\n this.hooks.push(hook)\n }", "updateHook() {\n return true;\n }", "function setHookCallback(callback){hookCallback=callback;}", "function setHookCallback(callback){hookCallback=callback;}", "function setHookCallback(callback){hookCallback=callback;}", "function setHookCallback(callback){hookCallback=callback;}", "function hooks(){return hookCallback.apply(null,arguments)}", "function hooks(){return hookCallback.apply(null,arguments)}", "function setHookCallback(callback){hookCallback = callback;}", "function startAsync()/* : void*/\n {\n this.asyncTestHelper$oHM3.startAsync();\n }", "async registerWebhooks() {\n this.webhookSecret = \"chance_webhook_secret\";\n\n console.log('registering webhooks')\n await this.deleteHooks()\n await this.registerChannelUpdateWebhook();\n await this.registerFollowWebhook();\n }", "function enable() {\n $(document)\n .on('ajax:error', handleError)\n .on('ajax:success', handleSuccess);\n }", "function installAutoChangeDetectionStatusHandler(fixture) {\n if (!activeFixtures.size) {\n handleAutoChangeDetectionStatus(({ isDisabled, onDetectChangesNow }) => {\n disableAutoChangeDetection = isDisabled;\n if (onDetectChangesNow) {\n Promise.all(Array.from(activeFixtures).map(detectChanges)).then(onDetectChangesNow);\n }\n });\n }\n activeFixtures.add(fixture);\n}", "_initAddons() {\n //\tInvoke \"before\" hook.\n this.trigger('initAddons:before');\n for (let addon in Mmenu.addons) {\n Mmenu.addons[addon].call(this);\n }\n //\tInvoke \"after\" hook.\n this.trigger('initAddons:after');\n }", "function handleStartup() { //Read from local storage\r\n restoreOptions();\r\n enableGoogle();\r\n enableWikipedia();\r\n enableBing();\r\n enableDuckDuckGo();\r\n enableYahoo();\r\n enableBaidu();\r\n enableYoutube();\r\n enableWolframAlpha();\r\n enableYandex();\r\n enableReddit();\r\n enableImdb();\r\n enableDictionarydotcom();\r\n enableThesaurusdotcom();\r\n enableStackOverflow();\r\n enableGitHub();\r\n enableAmazon();\r\n enableEbay();\r\n enableTwitter();\r\n console.log('Twitter enabled on startup');\r\n enableFacebookPeopleSearch();\r\n}", "callLifeCycleHooks() {\n return this.callOnBeforeSaveHook();\n }", "registerHooks() {\n this.addLocalHook('click', () => this.onClick());\n this.addLocalHook('keyup', event => this.onKeyup(event));\n }", "_setHooks() {\n this.config.assign = (options, confirmed = false) => {\n return this._assign(options, confirmed);\n };\n this.config.remove = (options, confirmed = false) => {\n return this._remove(options, confirmed);\n };\n this.config.removeAllOptions = () => {\n return of(this.onRemoveAllOptions());\n };\n this.config.addAllOptions = () => {\n return of(this.onAssignAllOptions());\n };\n this.config.applyFilter = (type, filter) => {\n this.onApplyFilter(type, filter);\n };\n this.config.getAssigned = () => {\n return this.config.assigned.slice();\n };\n this.config.block = (bucket, ids) => {\n this._blockBucketOptions(bucket, ids);\n };\n this.config.unblock = (bucket, ids) => {\n this._unblockBucketOptions(bucket, ids);\n };\n }", "function setDomainAsyncContextStrategy() {\n setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });\n}", "function loadHook() {\n targetBlank();\n bindEnqueue();\n bindIndexButtons();\n}", "function setHookCallback(callback) {\n hookCallback = callback;\n}", "function setHookCallback(callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}", "function setHookCallback (callback) {\n hookCallback = callback;\n}" ]
[ "0.6162924", "0.6069756", "0.60573655", "0.6001707", "0.591311", "0.58630574", "0.57786167", "0.5667597", "0.56569", "0.5647904", "0.5635138", "0.56149524", "0.55609155", "0.55569375", "0.55372244", "0.55340433", "0.55156875", "0.5512929", "0.5512929", "0.5512929", "0.5512929", "0.5495652", "0.5495652", "0.53887963", "0.5375912", "0.5364669", "0.5353899", "0.5337273", "0.5325812", "0.532436", "0.5303847", "0.53024304", "0.52987236", "0.52885026", "0.52808326", "0.52297044", "0.52297044", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275", "0.5226275" ]
0.6836857
0
Disable async hooks Context will not be maintained in future event loop iterations.
disable () { this.hook.disable() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __onContextDisable() {\n return false;\n }", "disableAsyncRequest() {\n this._asyncRequest = false;\n }", "function disable() {\n ['complete', 'addNewTags', 'removeTags']\n .forEach(m => api[m] = () => Promise.resolve([]));\n }", "function disableSync() {\n detachSyncListeners();\n}", "disable() {\n this._getContextManager().disable();\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }", "disable() { }", "onDisable() {}", "function setDomainAsyncContextStrategy() {\n setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });\n}", "disable_() {\n const map = this.getMap();\n console.assert(map, 'Map should be set.');\n this.listenerKeys_.forEach(olEvents.unlistenByKey);\n this.listenerKeys_.length = 0;\n }", "enable () {\n this.hook.enable()\n }", "async stopAsync() {\n var ref;\n await Promise.allSettled([\n (ref = this.notifier) == null ? void 0 : ref.stopObserving(),\n // Stop all dev servers\n ...devServers.map((server)=>server.stopAsync()\n ),\n // Stop ADB\n AndroidDebugBridge.getServer().stopAsync(), \n ]);\n }", "disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n }", "disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }", "disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }", "function forceDisable( evt ) {\n\tevt.return = false;\n\tevt.stop();\n}", "function disableDebugTools() {\n delete context.ng;\n}", "function disableDebugTools() {\n delete context.ng;\n }", "function disableDebugTools() {\n delete context.ng;\n}", "disable() {\n tooling.unsubscribe( onChange );\n }", "disable() {\n\t // leave empty in Widget.js\n\t }", "disableBrowserContextmenu() {\n return false;\n }", "function disable() {\n $(document)\n .off('ajax:error', handleError)\n .off('ajax:success', handleSuccess);\n }", "disable() {\n if (!this.isEnabled) return\n this.isEnabled = false\n }", "function withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n if (( true) && !ctx) {\n warn(`withAsyncContext called without active current instance. ` +\n `This is likely a bug.`);\n }\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "function withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n if (( true) && !ctx) {\n warn(`withAsyncContext called without active current instance. ` +\n `This is likely a bug.`);\n }\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "set silenceEvents(status) {\n eventStates.silenceEvents = status? true : false;\n }", "function enable() {\n document.removeEventListener(\"click\", handler,true);\n function handler(e){\n e.stopPropagation();\n }\n}", "function disableTelemetry() {\n clearInterval(REPORTING_INTERVAL);\n}", "function _unhook() {\n\t// set the original loader\n\tModule._load = _load;\n\t// reset hooking time\n\t_hookedAt = undefined;\n}", "function _unhook() {\n\t// set the original loader\n\tModule._load = _load;\n\t// reset hooking time\n\t_hookedAt = undefined;\n}", "before (asyncId) {\n fs.writeSync(1, \"\\n\\tHook before \"+asyncId+\"\\n\")\n }", "static off() {\n this._debugMode = false;\n this._stack = [];\n console.warn(`${this.FILENAME} : Debug mode turned OFF.`);\n }", "static disable_notfication() {\n ApplicationState._disable_notification = true;\n }", "function disable() {\n\t\treset();\n\t\tif(window.removeEventListener) {\n\t\t\tdocument.removeEventListener('keydown', keydown, false);\n\t\t\tdocument.removeEventListener('keyup', keyup, false);\n\t\t\twindow.removeEventListener('blur', reset, false);\n\t\t\twindow.removeEventListener('webkitfullscreenchange', reset, false);\n\t\t\twindow.removeEventListener('mozfullscreenchange', reset, false);\n\t\t} else if(window.detachEvent) {\n\t\t\tdocument.detachEvent('onkeydown', keydown);\n\t\t\tdocument.detachEvent('onkeyup', keyup);\n\t\t\twindow.detachEvent('onblur', reset);\n\t\t}\n\t}", "function withAsyncContext(getAwaitable) {\n const ctx = runtime_core_esm_bundler_getCurrentInstance();\n if (false) {}\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if (isPromise(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "function withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n if (!ctx) warn(`withAsyncContext called without active current instance. ` + `This is likely a bug.`);\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if (_shared.isPromise(awaitable)) awaitable = awaitable.catch((e)=>{\n setCurrentInstance(ctx);\n throw e;\n });\n return [\n awaitable,\n ()=>setCurrentInstance(ctx)\n ];\n}", "destroy (asyncId) {\n fs.writeSync(1, \"\\n\\tHook destroy \"+asyncId+\"\\n\")\n }", "function disable() {\n enabled = false;\n }", "function disable()\n {\n browser.bookmarks.onRemoved.removeListener(update_in_active_tabs);\n browser.tabs.onActivated.removeListener(on_tab_activated);\n browser.tabs.onUpdated.removeListener(on_tab_updated);\n browser.tabs.onRemoved.removeListener(on_tab_removed);\n\n hide_in_all_tabs();\n }", "function onDisable(f) {\n const ix = window.oldTodoistShortcutsDisableActions.length;\n window.oldTodoistShortcutsDisableActions.push(f);\n return () => {\n window.oldTodoistShortcutsDisableActions[ix] = null;\n f();\n };\n }", "async #unblock() {\n // Enable Network domain, if it is enabled globally.\n // TODO: enable Network domain for OOPiF targets.\n if (this.#eventManager.isNetworkDomainEnabled) {\n await this.enableNetworkDomain();\n }\n await this.#cdpClient.sendCommand('Runtime.enable');\n await this.#cdpClient.sendCommand('Page.enable');\n await this.#cdpClient.sendCommand('Page.setLifecycleEventsEnabled', {\n enabled: true,\n });\n await this.#cdpClient.sendCommand('Target.setAutoAttach', {\n autoAttach: true,\n waitForDebuggerOnStart: true,\n flatten: true,\n });\n await this.#cdpClient.sendCommand('Runtime.runIfWaitingForDebugger');\n this.#targetUnblocked.resolve();\n }", "function withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n if (( true) && !ctx) {\n warn(`withAsyncContext called without active current instance. ` +\n `This is likely a bug.`);\n }\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if (isPromise(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "disable(event) {\n console.log(\"User disable\");\n return new Promise(function (resolve, reject) {\n updateUserEnabledStatus(event, false, function (err, result) {\n if (err)\n reject('Error disabling user');\n else\n resolve(result);\n });\n });\n }", "function disable(){\r\n\treturn;\r\n}", "userStopTracking() {\n log.info(logger, \"user clicked stop tracking\");\n stopTracking(() => {\n log.info(logger, \"stop tracking callback from core\");\n this.userTracking = false;\n });\n }", "function resetStateAfterCall() {\n Object(__WEBPACK_IMPORTED_MODULE_1__webgl_utils_track_context_state__[\"b\" /* popContextState */])(gl);\n }", "discordWebhookEnabled() {\n return false\n }", "disableHTTP() {\n this.enableHTTP = false;\n }", "function disabled() {}", "function disabled() {}", "static disableDevTools(options) {\n return devToolsCommandRunner(false, options);\n }", "function _teardownAJAXHooks() {\n // jQuery will not invoke `ajaxComplete` if\n // 1. `transport.send` throws synchronously and\n // 2. it has an `error` option which also throws synchronously\n // We can no longer handle any remaining requests\n requests = [];\n\n if (typeof jQuery === 'undefined') {\n return;\n }\n\n jQuery(document).off('ajaxSend', incrementAjaxPendingRequests);\n jQuery(document).off('ajaxComplete', decrementAjaxPendingRequests);\n }", "function disableEventListeners(){if(this.state.eventsEnabled){cancelAnimationFrame(this.scheduleUpdate);this.state = removeEventListeners(this.reference,this.state);}}", "noLoop() {\r\n\t\t\tthis.looping = false;\r\n\t\t}", "function withSuspenseConfig(scope, config) {\n var previousConfig = ReactCurrentBatchConfig.suspense;\n ReactCurrentBatchConfig.suspense = config === undefined ? null : config;\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.suspense = previousConfig;\n }\n}", "function withSuspenseConfig(scope, config) {\n var previousConfig = ReactCurrentBatchConfig.suspense;\n ReactCurrentBatchConfig.suspense = config === undefined ? null : config;\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.suspense = previousConfig;\n }\n}", "function withSuspenseConfig(scope, config) {\n var previousConfig = ReactCurrentBatchConfig.suspense;\n ReactCurrentBatchConfig.suspense = config === undefined ? null : config;\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.suspense = previousConfig;\n }\n}", "function withSuspenseConfig(scope, config) {\n var previousConfig = ReactCurrentBatchConfig.suspense;\n ReactCurrentBatchConfig.suspense = config === undefined ? null : config;\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.suspense = previousConfig;\n }\n}", "disable () {\n this.enabled= false;\n }", "function disableGoogleAnalytics() {\n delete window.ga;\n delete window.gtag;\n delete window.GoogleAnalyticsObject;\n delete window.dataLayer;\n window['ga-disable-' + measurementId] = true;\n }", "function y(t){if(null!=t&&null!=t._parent)for(const e in t._handlers)t._parent.removeListener(e,t._handlers[e])}", "function dontBindEnvironment(func, onException, _this) {\n if (!onException || typeof onException === 'string') {\n var description = onException || \"callback of async function\";\n\n onException = function (error) {\n Meteor._debug(\"Exception in \" + description + \":\", error && error.stack || error);\n };\n }\n\n return function () {\n try {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var ret = func.apply(_this, args);\n } catch (e) {\n onException(e);\n }\n\n return ret;\n };\n }", "function useKeyboardDetection() {\n var _a = useToggle_1.default(false), enabled = _a[0], enable = _a[1], disable = _a[2];\n react_1.useEffect(function () {\n if (enabled) {\n return;\n }\n window.addEventListener(\"keydown\", enable, true);\n return function () {\n window.removeEventListener(\"keydown\", enable, true);\n };\n }, [enabled, enable]);\n react_1.useEffect(function () {\n if (!enabled) {\n return;\n }\n window.addEventListener(\"mousedown\", disable, true);\n window.addEventListener(\"touchstart\", disable, true);\n return function () {\n window.removeEventListener(\"mousedown\", disable, true);\n window.removeEventListener(\"touchstart\", disable, true);\n };\n }, [enabled, disable]);\n return enabled;\n}", "function disable() {\n instance.state.isEnabled = false;\n }", "function hooks() {\n \"use strict\";\n}", "function disableContextMenu() {\n document.addEventListener('contextmenu', e => e.preventDefault());\n}", "function dontBindEnvironment(func, onException, _this) {\n if (!onException || typeof onException === \"string\") {\n var description = onException || \"callback of async function\";\n\n onException = function (error) {\n Meteor._debug(\"Exception in \" + description, error);\n };\n }\n\n return function () {\n try {\n for (\n var _len = arguments.length,\n args = new Array(_len),\n _key = 0;\n _key < _len;\n _key++\n ) {\n args[_key] = arguments[_key];\n }\n\n var ret = func.apply(_this, args);\n } catch (e) {\n onException(e);\n }\n\n return ret;\n };\n }", "function disable() {\n instance.state.isEnabled = false;\n }", "async cleanupWorkloadModule() {\n // NOOP by default\n Logger.debug('Cleaning up workload module: NOOP');\n }", "handleWebGLContextRestored() {\n }", "function clearRemainingListeners() {\n observerTestState.toBeEnabled.forEach(function(feature) {\n chrome.accessibilityFeatures[feature.name].onChange.removeListener(\n feature.listener);\n feature.listener = null;\n });\n observerTestState.toBeDisabled.forEach(function(feature) {\n chrome.accessibilityFeatures[feature.name].onChange.removeListener(\n feature.listener);\n feature.listener = null;\n });\n }", "function disableContextMenu(canvas) {\n canvas.addEventListener('contextmenu', (e) => {\n e.preventDefault();\n });\n}", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }", "disableActiveTool() {\n this.project.view.off('mousedown');\n this.project.view.off('mousemove');\n this.project.view.off('mouseup');\n this.project.view.off('click');\n this.project.view.off('mousedrag');\n }", "stop() { \r\n enabled = false;\r\n // TODO: hide PK block list\r\n }", "detachAllEvents() {\n this.handledEvents.forEach((value, key) => {\n this.offEvent(key, value.target, value.options);\n });\n }", "deInit () {\n const me = this;\n\n if (me.eventsInitialized) {\n me.events.forEach(event => process.removeListener(event, me.exec));\n\n me.eventsInitialized = false;\n }\n }", "function withSuspenseConfig(scope, config) {\n var previousConfig = ReactCurrentBatchConfig.suspense;\n ReactCurrentBatchConfig.suspense = config === undefined ? null : config;\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.suspense = previousConfig;\n }\n }", "function lol(){\r\n\tvar cancellationEvent = document.addEventListener('contextmenu', event => event.preventDefault());\r\n}", "function removeBeforeCommandHook() {\n wdioConf.beforeCommand = function beforeCommand(commandName, args) {\n };\n}", "onDetatch() {}", "function disableScriptTags() {\n window.removeEventListener('DOMContentLoaded', transformScriptTags);\n }", "function testLifecycleHookListenerIsolation(hook) {\n let myObj = {\n myListener() {}\n };\n spyOn(myObj, 'myListener');\n\n let hookEvents = [];\n\n // Attach the same listener to every hook\n hookCases.forEach(currCase => {\n let currHook = currCase.hook;\n let hookFnName = currHook.charAt(0).toUpperCase() + currHook.substring(1);\n\n // Always pass false to ensure consistent tests\n lifecycleApi[`add${hookFnName}Listener`](myObj.myListener, false);\n\n hookEvents.push({\n source: mockParent,\n origin: targetPcOrigin,\n data: Object.assign({}, basePayloadData, {\n purecloudEventType: 'appLifecycleHook',\n hook: currHook\n })\n });\n });\n\n // Fire an event for each hook\n hookEvents.forEach(currEvent => {\n fireEvent(currEvent);\n });\n\n // Each listener should be called\n expect(myObj.myListener).toHaveBeenCalledTimes(hookCases.length);\n\n // Remove the listener for the hook under test\n let hookFnName = hook.charAt(0).toUpperCase() + hook.substring(1);\n lifecycleApi[`remove${hookFnName}Listener`](myObj.myListener, false);\n\n // Fire an event for each hook\n hookEvents.forEach(currEvent => {\n fireEvent(currEvent);\n });\n\n // All but the removed hook should be called\n expect(myObj.myListener).toHaveBeenCalledTimes((hookCases.length * 2) - 1);\n }", "function destroyWorker() {\n asyncProxy = undefined;\n}", "function destroyWorker() {\n asyncProxy = undefined;\n}" ]
[ "0.71950406", "0.6153484", "0.6112214", "0.6021565", "0.60205686", "0.591711", "0.5854089", "0.5690456", "0.56767505", "0.5668639", "0.562131", "0.5610665", "0.55469155", "0.55469155", "0.5541081", "0.553704", "0.5526142", "0.55109835", "0.54716474", "0.5409741", "0.5400517", "0.5366161", "0.53551483", "0.5354418", "0.5354418", "0.52940404", "0.52629656", "0.5253095", "0.5244755", "0.5244755", "0.52355915", "0.5206184", "0.5202999", "0.51971495", "0.5192451", "0.51901543", "0.5187761", "0.5181604", "0.5181265", "0.5177469", "0.51494455", "0.5141881", "0.5135341", "0.50971955", "0.5096275", "0.50943005", "0.50797486", "0.50765914", "0.50755787", "0.50755787", "0.5066712", "0.5066682", "0.5052138", "0.5048892", "0.5047071", "0.5047071", "0.5047071", "0.5047071", "0.5043047", "0.503945", "0.5034281", "0.50328445", "0.50237703", "0.5023585", "0.50172967", "0.5008016", "0.50035673", "0.5002863", "0.49999723", "0.498868", "0.498472", "0.4982422", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.4981875", "0.49815735", "0.4979482", "0.49785167", "0.49750862", "0.49737015", "0.4972482", "0.49720713", "0.49657586", "0.49595663", "0.49589813", "0.495806", "0.495806" ]
0.6993661
1
converts the first letter of each word of the string in upper case.
function cap(str){ var arr=str.split(" "); var arr2=[]; // console.log(arr[0].charAt(0)); for(var i=0;i<arr.length;i++) { arr2.push(arr[i].charAt(0).toUpperCase()+arr[i].slice(1)); } // console.log(arr); x = arr2.join(" "); console.log(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upperFirst(str) {\n let splitStr = str.toLowerCase().split(' ');\n for (let i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n return splitStr.join(' '); \n }", "function upperCaseFirst(str) {\n return str.split(' ').map(function(word){\n return word[0].toUpperCase() + word.substr(1);\n })\n}", "function FirstUpper(str) {\n // will split the string delimited by space into an array of words\n str = str.toLowerCase().split(' '); \n\n// str.length holds the number of occurrences of the array...\n for(var i = 0; i < str.length; i++){ \n// splits the array occurrence into an array of letters \n str[i] = str[i].split(''); \n// converts the first occurrence of the array to uppercase \n str[i][0] = str[i][0].toUpperCase(); \n// converts the array of letters back into a word. \n str[i] = str[i].join(''); \n }\n// converts the array of words back to a sentence.\n return str.join(' '); \n}", "function firstLetterUpper(word){\n\treturn word.charAt(0).toUpperCase() + word.slice(1);\n}", "function ucFirstAllWords(str) {\n var word = str.split(\" \");\n for (var i = 0; i < word.length; i++) {\n var j = word[i].charAt(0).toUpperCase();\n word[i] = j + word[i].substr(1);\n }\n return word.join(\" \");\n}", "function firstLetter(firstWord) {\n let words = firstWord.split(\" \")\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].substr(1);\n }\n return words.join(\" \")\n}", "function capitaliseFirstLetters(str) {\r\n var splitStr = str.toLowerCase().split(' ');\r\n for (var i = 0; i < splitStr.length; i++) {\r\n // Assign it back to the array\r\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\r\n }\r\n // Directly return the joined string\r\n return splitStr.join(' ');\r\n}", "function applyCapitalLetter(str){\r\n \r\n var arr = str.split(\" \");\r\n for (var i=0; i < arr.length; i++){\r\n arr[i] = arr[i].replace(arr[i][0], arr[i][0].toUpperCase()); \r\n }\r\n return arr.join(\" \");\r\n}", "function toUpperEachWord(str){\n str = str.toLowerCase();\n var strArray = str.split(\" \");\n var newString = \"\";\n \n for(var i = 0; i < strArray.length; i++){\n newString += strArray[i].substring(0, 1).toUpperCase() + strArray[i].substring(1);\n \n if(i < strArray.length - 1){\n newString += \" \"; \n }\n }\n return newString\n}", "function LetterCapitalize(str) {\n\nlet words = str.split(' ')\n\nfor ( i = 0 ; i < words.length ; i++) {\n\n words[i] = words[i].substring(0,1).toUpperCase() + words[i].substring(1)\n\n}\n\nwords = words.join(' ')\nreturn words\n\n}", "function capitaliseFirstLetter(string) {\n var pieces = string.split(\"\");\n pieces[0] = pieces[0].toUpperCase();\n return pieces.join(\"\");\n}", "function LetterCapitalize(str) {\n var strArr = str.split(\" \");\n var newArr = [];\n\n for(var i = 0 ; i < strArr.length ; i++ ){\n\n var FirstLetter = strArr[i].charAt(0).toUpperCase();\n var restOfWord = strArr[i].slice(1);\n\n newArr[i] = FirstLetter + restOfWord;\n\n }\n\n return newArr.join(' ');\n\n}", "function Capitaliser(input) {\n const eachWord = input.split(\" \");\n for (let index = 0; index < eachWord.length; index++) {\n eachWord[index] = eachWord[index][0].toUpperCase() + eachWord[index].substr(1);\n }\n return eachWord.join(\" \");\n}", "function LetterCapitalize(str) { \n return str\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}", "function upperCaseFirst(s) {\r\n return s ? s.replace(/\\w\\S*/g, function (txt) {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n }) : '';\r\n}", "function firstLetterCapital (word) {\n var wordArray = word.split(' ');\n var newWordArray = [];\n for (var i = 0; i < wordArray.length; i++) {\n newWordArray.push(wordArray[i].charAt(0).toUpperCase() + wordArray[i].slice(1));\n }\n return newWordArray.join(' ');\n}", "function capitalizeWord(string) {\n //I-string of one word\n //O- return the word with first letter in caps\n //C-\n //E-\n let array = string.split(\"\")\n array[0] = array[0].toUpperCase()\n string = array.join(\"\")\n return string\n}", "function firstLetterCapital(str){\n str = str.toLowerCase().split(' ');\n\n for (var i = 0; i < str.length; i++) {\n\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n\n return str.join(' ');\n}", "function capitalizeEachWord(str) {\n return str.toUpperCase();\n}", "function capitalizeAllWords(string) {\n var splitStr = string.toLowerCase().split(' ');\n \nfor (var i = 0; i < splitStr.length; i++){\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n}\nreturn splitStr.join(' ');\n}", "function capitaliseFirstLetter(string){\n\t\t\tvar newstring = string.toLowerCase();\n\t\t\treturn newstring.charAt(0).toUpperCase() + newstring.slice(1);\n\t\t}", "function capitalizeLetters(str) {\r\n\r\n let strArr = str.toLowerCase().split(' '); //lowercase all the words and store it in an array.\r\n console.log(\"outside: \" + strArr); //Testing use for checking\r\n //iterate through the array\r\n //Add the first letter of each word from the array with the rest of the letter following each word\r\n //Ex) L + ove = Love;\r\n for(let i = 0; i < strArr.length; i++){\r\n strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\r\n }\r\n return strArr.join(\" \"); //put the string back together.\r\n\r\n // const upper = str.charAt(0).toUpperCase() + str.substring(1);\r\n // return upper;\r\n}", "function LetterCapitalize(str) { \n let words = str.split(' ');\n for (let i = 0; i < words.length; i++) {\n let word = words[i][0].toUpperCase() + words[i].slice(1);\n words[i] = word;\n }\n return words.join(' ');\n}", "function firstCharUpperCase(str){\n\tif(str == null){\n\t\treturn str;\n\t}\n\tstr = str.replace(/(^|\\s+)\\w/g,function(s){return s.toUpperCase();});\n\treturn str;\n}", "function capitalizeLetters(str) {\n// const strArr = str.toLowerCase().split(' ');\n\n// for(let i = 0; i< strArr.length; i++){\n// strArr[i] = strArr[i].substr(0,1).toUpperCase() + strArr[i].substr(1);\n// }\n\n// return strArr.join(' ');\n\n///////////////////////////////////////////////////////////\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "function capitalizeAllWords(string) {\n// will use .toLower case and .split to lowercase and put in an array\nvar myArr = string.toLowerCase().split(\" \")\n// will use for loop to itterate over array\nfor(var i = 0; i < myArr.length; i++){\n // Will use charAt to return the character in string\n // will use toUpperCase to uppercase the first characters\n //will use .slice to add remaing array\n myArr[i] = myArr[i].charAt(0).toUpperCase() + myArr[i].slice(1);\n}\n // use join() to turn array to string and return\n return myArr.join(\" \");\n}", "function titleCase(str) {\r\n var words = str.toLowerCase().split(' ');\r\n var charToCapitalize;\r\n\r\n for (var i = 0; i < words.length; i++) {\r\n charToCapitalize = words[i].charAt(0);\r\n // words[i] = words[i].replace(charToCapitalize, charToCapitalize.toUpperCase()); // works only if first letter is not present elsewhere in word\r\n words[i] = words[i].charAt(0).toUpperCase().concat(words[i].substr(1));\r\n }\r\n\r\n return words.join(' ');\r\n}", "function uppercase_word(str) {\n return str.replace(/\\w\\S*/g, \n function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n }\n );\n}", "function upperFirst(string) {\n \treturn string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstWord(str){\n words = [];\n\n for(let word of str.split(' ')){\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n return words.join(' ');\n}", "function LetterCapitalize(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function ucFirst(str) {\n\n }", "function ucWords(string) {\n var arrayWords;\n var returnString = \"\";\n var len;\n arrayWords = string.split(\" \");\n len = arrayWords.length;\n for (var i = 0; i < len; i++) {\n if (i != (len - 1)) {\n returnString = returnString + ucFirst(arrayWords[i]) + \" \";\n }\n else {\n returnString = returnString + ucFirst(arrayWords[i]);\n }\n }\n return returnString;\n}", "function capitalizeFirstLetter(string) {\n const words = string.split(' ');\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].slice(1);\n };\n\n return words.join(' ');\n}", "function capitalizeWord(string) {\n str1 = string.charAt(0);\n str1 = str1.toUpperCase();\n for (var i = 1; i < string.length; i++)\n {\n str1 += string[i];\n }\n return str1;\n}", "function upperCaseFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}", "function capitalizeAllWords(string){\n var splitString = string.split(' '); //splitting string at spaces into an array of strings\n //splitString is now an array containing each word of the string separately\n for(var i = 0; i < splitString.length; i++){\n var letters = splitString[i].split(''); //separating each word in array into an array of letters\n letters[0] = letters[0].toUpperCase(); //sets letter at index[0] to upper case\n splitString[i] = letters.join(''); //slaps em all back together\n }\n return splitString.join(' ');\n}", "function capital_letter(str) {\n str = str.split(\" \");\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n\n return str.join(\" \");\n}", "function LetterCapitalize(str) {\n var splitString = str.split(' ');\n // console.log(splitString)\n for (var i = 0; i < splitString.length; i++) {\n splitString[i] = splitString[i].charAt(0).toUpperCase() + splitString[i].substring(1);\n // console.log(splitString)\n } \n return splitString.join(' ');\n}", "function capitalizeWords(input) {\n\n let wordInput = input.split(' ');\n\n for (let i = 0; i < wordInput.length; i++) {\n var lettersUp = ((wordInput[i])[0]).toUpperCase();\n wordInput[i] = wordInput[i].replace((wordInput[i])[0], lettersUp);\n }\n return console.log(wordInput.join(\" \"));\n}", "function capitalizeAllWords(string) {\n //split string into array of string words\n var splitStr = string.split(\" \");\n //loop through array\n for(var i = 0; i < splitStr.length; i++){\n //if there is a value at element then do a thing\n if(splitStr[i]){\n //access word in word array,uppercase first char, then slice the rest back on\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n }\n string = splitStr.join(\" \");\n }\n return string;\n}", "function firstLetter(sentence) {\n let text = sentence.split(' ');\n for (let i = 0; i < text.length; i++) {\n text[i] = text[i].charAt(0).toUpperCase() + text[i].substr(1);\n //console.log(text[i].charAt(0));\n }\n return text.join(' ');\n}", "function capitalizeWord (string) {\n var firstLetter = string[0];\n var restOfWord = string.substring(1); \n return firstLetter.toUpperCase() + restOfWord;\n}", "function f(str) {\n const words = str.split(' ');\n let capitalizedWords = [];\n for (let i = 0; i < words.length; i++) {\n const capitalizedWord = words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase();\n capitalizedWords.push(capitalizedWord);\n }\n return capitalizedWords.join(' ');\n}", "function everyWordCapitalized(aPhrase) {\n var becomeAnArray = aPhrase.split(\" \");\n \n for (var i=0; i<becomeAnArray.length; i++){\n var firstChar = becomeAnArray[i].charAt(0);\n var rest = becomeAnArray[i].substring(1);\n \n \n \n firstChar = firstChar.toUpperCase();\n rest = rest.toLowerCase();\n becomeAnArray[i] = firstChar + rest;\n \n }\n \n return becomeAnArray.join(\" \");\n}", "function ucwords(str,force){\n str=force ? str.toLowerCase() : str;\n return str.replace(/(^([a-zA-Z\\p{M}]))|([ -][a-zA-Z\\p{M}])/g,\n function(firstLetter){\n return firstLetter.toUpperCase();\n });\n}", "function letterCapitalize(str) {\n str = str.split(\" \");\n\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n return str.join(\" \");\n}", "function uppercaseFirstLetter(str) {\n\treturn str[0].toUpperCase() + str.slice(1);\n\t// Prend la première lettre de la chaine de caractère reçu en param\n\t// La met en majuscule\n\t// concatène le reste de la chaine de caractère (toujours en minuscule) avec cette lettre en maj\n}", "static capitalize(string){\n let array = string.split(\"\")\n array[0] = string[0].toUpperCase()\n return array.join(\"\")\n }", "function capitalizeFirstLetter(str) {\n let strS=str.split(\" \");\n let strMap= strS.map((a)=>a.slice(0,1).toUpperCase()+a.slice(1));\n return strMap.join()\n}", "function sc_string_capitalize(s) {\n return s.replace(/\\w+/g, function (w) {\n\t return w.charAt(0).toUpperCase() + w.substr(1).toLowerCase();\n });\n}", "function capitalize_Words(str) {\n return str.replace(/\\w\\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function capitalizeLetters(str) {\n // const strArr = str\n // .toLowerCase() // makes everything lower case\n // .split(' '); // turn a string into an array, with space so we get the words\n // for(let i = 0; i < strArr.length; i++) {\n // strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\n // }\n // return strArr.join(' ');\n //////////////////\n //Second Option cleaned up edition\n // return str\n // .toLowerCase()\n // .split(' ')\n // .map((word) => word[0].toUpperCase() + word.substr(1))\n // .join(' ');\n ///////////////////\n //Regular Expressions\n /// omg what the heck is this\n // return str.replace(/\\b[a-z]/gi, function(char) {\n // return char.toUpperCase();\n // });\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.substring(1);\n}", "function firstLetterUpperCase(value){\n\tvar value = value.substr(0,1).toUpperCase() + value.substr(1,value.length);\n\treturn value;\n}", "function capitalizeWord(string) {\n return string.replace(string[0], string[0].toUpperCase()); //return string but replace the string[0] with a capital letter\n}", "function capitalizeAllWords(string){\nvar subStrings = string.split(\" \");\nvar upperString = \"\";\nvar finishedString = \"\";\n for(var i = 0; i < subStrings.length; i++){\n if(subStrings[i]) {\n upperString = subStrings[i][0].toUpperCase() + subStrings[i].slice(1) + \" \";\n finishedString += upperString;\n }\n } return finishedString.trim()\n}", "function capital(str) \r\n{\r\n str = str.split(\" \");\r\n\r\n for (var i = 0, x = str.length; i < x; i++) {\r\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\r\n }\r\n\r\n return str.join(\" \");\r\n}", "function capitalizeAllWords(string) {\n var split = string.split(\" \"); //splits string up\n for (var i = 0; i < split.length; i++) { //loops over array of strings\n split[i] = split[i][0].toUpperCase() + split[i].slice(1); //uppercases first chas on string and slices the extra letter\n }\n var finalStr = split.join(' '); // joins split string into one string\n return finalStr; //return final string\n}", "function Uncapitalize(string){\n return string[0].toLowerCase() + string.slice(1);\n}", "function LetterCapitalize(str) {\n \"use strict\";\n // code goes here \n var strArray = str.split(\" \"); //take my string and separate it into an array of strings (strArray) using the .split method.\n var newString = \"\";\n for (var i = 0; i < strArray.length; i++) {\n var newWord = strArray[i].substr(0, 1).toUpperCase() + strArray[i].substr(1, strArray.length);\n newString = newString + \" \" + newWord;\n //alert(newString);\n }\n\n return newString;\n\n}", "function capitalizeAllWords(string) {\n var arr = string.split(\" \");\n for (var i = 0;i < arr.length; i++){\n arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);\n }\n return arr.join(\" \");\n}", "function LetterCapitalize(str) {\n str = str.toLowerCase().split(' ');\n for (let i = 0; i < str.length; i++) {\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n return str.join(' ');\n}", "function capitalizeAllWords(string) {\n return string.replace(/\\b\\w/g, function(string){ \n return string.toUpperCase(); \n });\n}", "function firstLetterCapitalized (word){//function that capitalizes first letter of one word\n var letterOne = word.substring(0,1)//finds first letter\n var capitalizedLetter = letterOne.toUpperCase()//to upper case\n return capitalizedLetter + word.substring(1)//concatenates capitalized first letter and rest of word\n}", "function titleCase(str) {\n // Mutating str (oh no!) to an array of lowercase words using split() by a space \n str = str.toLowerCase().split(' ');\n // Iterating through str\n for (var i = 0; i < str.length; i++){\n // capitalLetter is first letter of current word -> made uppercase \n capitalLetter = str[i].charAt(0).toUpperCase();\n // replacing the first letter in current word with capitalLetter\n str[i] = str[i].replace(/[a-z]/, capitalLetter);\n }\n // str = str array joined into a single string\n str = str.join('');\n return str;\n }", "capitalizeFirstLetter(word) {\n return (word.charAt(0).toUpperCase() + word.substring(1));\n }", "function capitalizeWord(string){\n var firstLetter = string.charAt(0); // takes first letter\n var goodString = firstLetter.toUpperCase() + string.slice(1); //capitalize and reattach\n return goodString;\n}", "function capitalizeFirst(input) {\n return input\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}", "function toTitleCase(str)\n //Make string words start with caps. hello world = Hello World.\n{\n return str.replace(/\\w\\S*/g,\n function(txt){\n return txt.charAt(0).toUpperCase() +\n txt.substr(1).toLowerCase();\n });\n}", "function firstWordCapitalize(word){\n let firstCharcter = word[0].toUpperCase();\n return firstCharcter + word.slice(1);\n \n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function capitalizeFirstLetters(input) {\n array = input.split(' ');\n newArray = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i].length > 0) {\n newArray.push(array[i][0].toUpperCase() + array[i].slice(1));\n } else {\n newArray;\n }\n }\n return newArray.join(' ');\n}", "function Capitalize(str){\n\tvar arr = str.split(\"\");\n\n\tfor(var i= 0;i< arr.length; i++){\n\t\tif(i === 0 ){\n\t\t\tarr[i] = arr[i].toUpperCase();\n\t\t} \n\t}\n\treturn arr.join(\"\"); \n\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function titlecase(str) {\n return str.split(' ').map((word) => word[0].toUpperCase() + word.slice(1)).join(' ');\n}", "function capitaliseLetter(str) {\n return str[0].toUpperCase() + str.substring(1);\n}", "function capitalizeWords(str) {\n\tif (str.length === 0) {\n\t\treturn str;\n\t}\n\n\treturn str\n\t\t.split(\" \")\n\t\t.map((word) => capitalizeFirstLetter(word))\n\t\t.join(\" \");\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeEveryWordOfAStringLib (string) {\n let words = string.split(\" \");\n\n for (let i = 0; i < words.length; i++) {\n\n words[i] = words[i][0].toUpperCase() + words[i].substr(1);\n\n }\n\n return words.join(\" \");\n}", "function capitalize(str) {\n str = str.trim().toLowerCase(); // remove extra whitespace and change all letters to lower case\n var words = str.split(' ') // split string into array of individual words\n str = ''; // clear string variable since all the words are saved in an array\n // this loop takes each word in the array and capitalizes the first letter then adds each word to the new string with a space following \n for (i = 0; i < words.length; i++) {\n var foo = words[i];\n foo = foo.charAt(0).toUpperCase() + foo.slice(1);\n str += foo + \" \";\n }\n return str.trim(); // return the new string with the last space removed\n}", "function ucFirst(str) {\n return str[0].toUpperCase() + str.slice(1);\n}", "function LetterCapitalize(str) {\n // First, we use the split method to divide the input string into an array of individual words\n // Note that we pass a string consisting of a single space into the method to \"split\" the string at each space\n str = str.split(\" \");\n\n // Next, we loop through each item in our new array...\n for (i = 0; i < str.length; i++) {\n // ...and set each word in the array to be equal to the first letter of the word (str[i][0]) capitalized using the toUpperCase method.\n // along with a substring of the remainder of the word (passing only 1 arg into the substr method means that you start at that index and go until the end of the string)\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n // Finally, we join our array back together...\n str = str.join(\" \");\n\n // ...and return our answer.\n return str;\n}", "function firstLetterCaps(string){\n return string[0].toUpperCase() + string.slice(1);\n }", "function capitaliseFirstLetter(string) {\n return string\n .split(\"-\")\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n}", "function capitalizeWord(word){\n return word[0].toUpperCase() + word.substr(1);\n}" ]
[ "0.81128424", "0.7981668", "0.78997785", "0.78485256", "0.7814646", "0.7794532", "0.77765065", "0.776686", "0.7753133", "0.77279264", "0.77165186", "0.7686409", "0.7655411", "0.76429474", "0.76278174", "0.7620459", "0.7596566", "0.75921804", "0.7589396", "0.7587866", "0.7581721", "0.7581067", "0.75758797", "0.75560385", "0.7554812", "0.75360495", "0.7503649", "0.75022584", "0.74974275", "0.74964094", "0.74949586", "0.74948335", "0.7491415", "0.7471296", "0.7458471", "0.7452888", "0.74440485", "0.7442498", "0.74424803", "0.74382186", "0.74380547", "0.7435768", "0.7433279", "0.74255824", "0.7423871", "0.7405566", "0.7402482", "0.7401283", "0.73961306", "0.7395185", "0.73931974", "0.7375034", "0.736667", "0.73642933", "0.7361297", "0.7357371", "0.73568803", "0.7350666", "0.73478377", "0.73402303", "0.73398924", "0.73375726", "0.7334866", "0.7331366", "0.732838", "0.73142725", "0.73135084", "0.7312401", "0.7310548", "0.7304075", "0.73036665", "0.7302481", "0.7302481", "0.73014313", "0.7300972", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.72960854", "0.7295172", "0.72936267", "0.7291719", "0.72877246", "0.72877246", "0.72877246", "0.728443", "0.7284034", "0.7280219", "0.72801536", "0.7274742", "0.72687036", "0.72673875" ]
0.0
-1
! \fn parseUrl \see const result = parseUrl(" result.protocol; // => "http:" result.host; // => "example.com:3000" result.hostname; // => "example.com" result.port; // => "3000" result.pathname; // => "/pathname/" result.hash; // => "hash" result.search; // => "?search=test" result.origin; // => "
function parseUrl(url) { const a = document.createElement('a'); a.href = url; return a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseUrl(url){if(typeof url!=='string')return{};var match=url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);// coerce to undefined values to empty string so we don't get 'undefined'\nvar query=match[6]||'';var fragment=match[8]||'';return{protocol:match[2],host:match[4],path:match[5],relative:match[5]+query+fragment// everything minus origin\n};}", "function parseUrl(url)\n\n\t {\n\t if (!url) {\n\t return {};\n\t }\n\n\t const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n\t if (!match) {\n\t return {};\n\t }\n\n\t // coerce to undefined values to empty string so we don't get 'undefined'\n\t const query = match[6] || '';\n\t const fragment = match[8] || '';\n\t return {\n\t host: match[4],\n\t path: match[5],\n\t protocol: match[2],\n\t relative: match[5] + query + fragment, // everything minus origin\n\t };\n\t}", "function parseURL(request, response){\n \tvar parseQuery = true; \n var badHost = true; \n var urlObj = url.parse(request.url, parseQuery , badHost );\n console.log('path:');\n console.log(urlObj.path);\n console.log('query:');\n console.log(urlObj.query);\n \treturn urlObj;\n }", "function parseUrl(url) {\n var a = document.createElement('a');\n a.href = url;\n return {\n source: url,\n protocol: a.protocol.replace(':', ''),\n host: a.hostname,\n port: a.port,\n query: a.search,\n params: (function () {\n var ret = {},\n seg = a.search.replace(/^\\?/, '').split('&'),\n len = seg.length,\n i = 0,\n s;\n for (; i < len; i++) {\n if (!seg[i]) {\n continue;\n }\n s = seg[i].split('=');\n ret[s[0]] = s[1];\n }\n return ret;\n })(),\n file: (a.pathname.match(/\\/([^\\/?#]+)$/i) || [, ''])[1],\n hash: a.hash.replace('#', ''),\n path: a.pathname.replace(/^([^\\/])/, '/$1'),\n relative: (a.href.match(/tps?:\\/\\/[^\\/]+(.+)/) || [, ''])[1],\n segments: a.pathname.replace(/^\\//, '').split('/')\n };\n}", "function parseUrl(url)\n\n {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment, // everything minus origin\n };\n }", "function parseURL(url) {\n var parser = document.createElement('a'),\n searchObject = {},\n queries, split, i;\n // Let the browser do the work\n parser.href = url;\n // Convert query string to object\n queries = parser.search.replace(/^\\?/, '').split('&');\n for (i = 0; i < queries.length; i++) {\n split = queries[i].split('=');\n searchObject[split[0]] = split[1];\n }\n return parser.pathname;\n\n //return {\n //protocol: parser.protocol,\n //host: parser.host,\n //hostname: parser.hostname,\n //port: parser.port,\n //pathname: parser.pathname,\n //search: parser.search,\n //searchObject: searchObject,\n //hash: parser.hash\n //};\n}", "function parseProtocol(url) {\n const parsedURL = /^(\\w+)\\:\\/\\/([^\\/]+)\\/(.*)$/.exec(url);\n if (!parsedURL) {\n return false;\n }\n console.log(parsedURL);\n // [\"https://developer.mozilla.org/en-US/docs/Web/JavaScript\", \n // \"https\", \"developer.mozilla.org\", \"en-US/docs/Web/JavaScript\"]\n\n const [, protocol, fullhost, fullpath] = parsedURL;\n return protocol;\n}", "function parseURL(url) {\n var a = document.createElement('a');\n a.href = url;\n return {\n source: url,\n protocol: a.protocol.replace(':',''),\n host: a.hostname,\n port: a.port,\n query: a.search,\n params: (function(){\n var ret = {},\n seg = a.search.replace(/^\\?/,'').split('&'),\n len = seg.length, i = 0, s;\n for (;i<len;i++) {\n if (!seg[i]) { continue; }\n s = seg[i].split('=');\n ret[s[0]] = s[1];\n }\n return ret;\n })(),\n file: (a.pathname.match(/\\/([^\\/?#]+)$/i) || [,''])[1],\n hash: a.hash.replace('#',''),\n path: a.pathname.replace(/^([^\\/])/,'/$1'),\n relative: (a.href.match(/tps?:\\/\\/[^\\/]+(.+)/) || [,''])[1],\n segments: a.pathname.replace(/^\\//,'').split('/')\n };\n}", "function parseUrl(url) {\r\n if (!url) {\r\n return {};\r\n }\r\n var match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\r\n if (!match) {\r\n return {};\r\n }\r\n // coerce to undefined values to empty string so we don't get 'undefined'\r\n var query = match[6] || '';\r\n var fragment = match[8] || '';\r\n return {\r\n host: match[4],\r\n path: match[5],\r\n protocol: match[2],\r\n relative: match[5] + query + fragment\r\n };\r\n}", "function parseURL(url) {\n var a = document.createElement('a');\n a.href = url;\n return {\n source: url,\n protocol: a.protocol.replace(':',''),\n host: a.hostname,\n port: a.port,\n query: a.search,\n params: (function(){\n var ret = {},\n seg = a.search.replace(/^\\?/,'').split('&'),\n len = seg.length, i = 0, s;\n for (;i<len;i++) {\n if (!seg[i]) { continue; }\n s = seg[i].split('=');\n ret[s[0]] = s[1];\n }\n return ret;\n })(),\n file: (a.pathname.match(/\\/([^\\/?#]+)$/i) || [,''])[1],\n hash: a.hash.replace('#',''),\n path: a.pathname.replace(/^([^\\/])/,'/$1'),\n relative: (a.href.match(/tp:\\/\\/[^\\/]+(.+)/) || [,''])[1],\n segments: a.pathname.replace(/^\\//,'').split('/')\n };\n}", "function parseUrl(url)\n\n {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment, // everything minus origin\n };\n}", "function parseURL(url) {\n var a = document.createElement('a');\n a.href = url;\n return {\n source: url,\n protocol: a.protocol.replace(':',''),\n host: a.hostname,\n port: a.port,\n query: a.search,\n params: (function() {\n var ret = {},\n seg = a.search.replace(/^\\?/,'').split('&'),\n len = seg.length, i = 0, s;\n for (;i<len;i++) {\n if (!seg[i]) { continue; }\n s = seg[i].split('=');\n ret[s[0]] = s[1];\n }\n return ret;\n })(),\n file: (a.pathname.match(/\\/([^\\/?#]+)$/i) || [,''])[1],\n hash: a.hash.replace('#',''),\n path: a.pathname.replace(/^([^\\/])/,'/$1'),\n relative: (a.href.match(/tp:\\/\\/[^\\/]+(.+)/) || [,''])[1],\n segments: a.pathname.replace(/^\\//,'').split('/')\n };\n}", "function parseUrl(url) {\n if (!url) {\n return {};\n }\n var match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n if (!match) {\n return {};\n }\n // coerce to undefined values to empty string so we don't get 'undefined'\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment,\n };\n}", "function parseUrl(url) {\n if (!url) {\n return {};\n }\n var match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n if (!match) {\n return {};\n }\n // coerce to undefined values to empty string so we don't get 'undefined'\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment,\n };\n}", "function parseURL(url) {\n var a = document.createElement('a');\n a.href = url;\n var domsplits = a.hostname.split(\".\");\n var dom = domsplits[domsplits.length-2]+\".\"+domsplits[domsplits.length-1];\n return ret = {\n source: url,\n protocol: a.protocol.replace(':',''),\n hostdomain: dom\n };\n}", "function parseUrl(url) {\n if (!url) {\n return {};\n }\n var match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n if (!match) {\n return {};\n }\n // coerce to undefined values to empty string so we don't get 'undefined'\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment,\n };\n}", "function parseUrl(url) {\n if (!url) {\n return {};\n }\n var match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n if (!match) {\n return {};\n }\n // coerce to undefined values to empty string so we don't get 'undefined'\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment,\n };\n}", "function parseURL(url) {\n var link = document.createElement('a');\n link.href = url;\n let path = link.pathname;\n if (/\\.[a-z0-9_-]+$/i.test(path)) {\n path = path.split('/').slice(0, -1).join('/') + '/';\n }\n return {\n protocol: link.protocol,\n host: link.host,\n hostname: link.hostname,\n pathname: link.pathname,\n path,\n search: link.search,\n hash: link.hash\n };\n}", "function urlParse ( url, parseQueryString ) {\n\tvar urlReg = /^((\\w+:)\\/)?\\/?((.*?)@)?(([^:\\/\\s]+)(:(\\d+))?)(([^?#]*)(\\?([^#]*))?)(#.*)?/\n\tvar m = urlReg.exec( url );\n\n\tvar ret = {};\n\n\tret.protocol \t= m[2] || '';\n\tret.slashes\t\t= true;\n\tret.auth\t\t= m[4] || null;\n\tret.host \t\t= m[5] || '';\n\tret.port\t\t= m[8] || null;\n\tret.hostname\t= m[6];\n\tret.hash \t\t= m[13] || null;\n\tret.search\t\t= m[11];\n\n\tif ( parseQueryString && m[12] ) {\n\t\tvar q \t\t= m[12].split('&');\n\n\t\tret.query \t= {};\n\t\tfor ( var i = 0; i < q.length; i ++ ) {\n\t\t\tvar p \t= q[i].split('=');\n\t\t\tret.query[p[0]]\t= p[1] || '';\n\t\t}\n\t\t\n\t}\n\n\tret.pathname\t= m[10];\n\tret.path\t\t= m[9];\n\tret.href \t\t= url;\n\n\treturn ret;\n}", "function parseUrl(url) {\n\t const firstChar = url.charAt(0);\n\t if (firstChar === '~') {\n\t const secondChar = url.charAt(1);\n\t url = url.slice(secondChar === '/' ? 2 : 1);\n\t }\n\t return parseUriParts(url);\n\t}", "parseHost(url) {\n\t\tvar ret;\n\n\t\t// In case the url has a protocol, remove it.\n\t\tvar protocolSplit = url.split(\"://\");\n\t\tvar withoutProtocol;\n\t\tif (protocolSplit.length > 1) {\n\t\t\twithoutProtocol = protocolSplit[1];\n\t\t} else {\n\t\t\twithoutProtocol = protocolSplit[0];\n\t\t}\n\n\t\tvar host = withoutProtocol.split(\"?\")[0];\n\t\tvar pathIndex = host.indexOf(\"/\");\n\n\t\tif (pathIndex !== -1) {\n\t\t\tret = host.substring(0, pathIndex);\n\t\t} else {\n\t\t\tret = host;\n\t\t}\n\n\t\treturn ret;\n\t}", "function parseURL( url ) {\n var a = document.createElement('a');\n a.href = url;\n\n return {\n element: a,\n href: a.href,\n host: a.host,\n port: '0' === a.port || '' === a.port ? '' : a.port,\n hash: a.hash,\n hostname: a.hostname,\n pathname: a.pathname.charAt(0) !== '/' ? '/' + a.pathname : a.pathname,\n protocol: !a.protocol || ':' === a.protocol ? 'https:' : a.protocol,\n search: a.search,\n query: a.search.slice(1) // Nice utility for pre-stripping out the `?`\n };\n}", "function parse_url(url) {\n\tvar parser = document.createElement('a'),\n\t\tsearchObject = {},\n\t\tqueries, split, i;\n\t// Let the browser do the work\n\tparser.href = url;\n\t// Convert query string to object\n\tqueries = parser.search.replace(/\\?/, '').split('&');\n\tfor( i = 0; i < queries.length; i++ ) {\n\t\tsplit = queries[i].split('=');\n\t\tif (split.length > 1) {\n\t\t\tsearchObject[split[0]] = split[1];\n\t\t} else {\n\t\t\tsearchObject[split[0]] = \"\";\n\t\t}\n\t}\n\t//return {\"host\":host, \"path\":path, \"gparamstr\":param, \"gparams\":gparams};\n\treturn {\"host\":parser.protocol + \"//\" + parser.host, \"path\":parser.pathname, \"gparamstr\":parser.search, \"gparams\":searchObject};\n}", "function parseUrl (url) {\n var a = document.createElement('a')\n a.href = url\n\n return {\n href: a.href,\n pathname: a.pathname,\n search: (a.search) ? qs(a.search) : {},\n hash: a.hash\n }\n }", "function parseUrl(url)\n{\n c(url, 'yellow');\n var defaultFormat = 'json';\n var parsedUrl = ur.parse(url);\n var format = parsedUrl.pathname.match(/.*\\.(.*)?(\\?.*)?/);\n var pathname = parsedUrl.pathname.replace(/\\..*/, '').replace(/^\\/|\\/$/, '').replace(/^resources\\//, '').split('/');\n var queries = qs.parse(parsedUrl.query);\n var parsed = {\n path: parsedUrl.path,\n format: (format) ? format[1] : defaultFormat,\n pathname: pathname,\n queries: queries,\n resource_name: (pathname) ? pathname[0] : null,\n account_id: (pathname && pathname[1]) ? pathname[1] : null,\n resource_id: (pathname && pathname[2]) ? pathname[2] : null,\n token: (queries && queries.access_token) ? queries.access_token : null\n }\n c(parsed, 'red');\n return parsed;\n}", "function parseURL(str) {\n let fullObject;\n if (typeof FastBoot === 'undefined') {\n const element = document.createElement('a');\n element.href = str;\n fullObject = element;\n } else {\n fullObject = FastBoot.require('url').parse(str);\n }\n const desiredProps = {\n href: fullObject.href,\n protocol: fullObject.protocol,\n hostname: fullObject.hostname,\n port: fullObject.port,\n pathname: fullObject.pathname,\n search: fullObject.search,\n hash: fullObject.hash\n };\n return desiredProps;\n }", "function utilParseUrl(url) {\n\t\tconst el = document.createElement('a');\n\t\tconst queryObj = Object.create(null);\n\n\t\t// Let the `<a>` element parse the URL.\n\t\tel.href = url;\n\n\t\t// Populate the `queryObj` object with the query string attributes.\n\t\tif (el.search) {\n\t\t\tel.search\n\t\t\t\t.replace(/^\\?/, '')\n\t\t\t\t.splitOrEmpty(/(?:&(?:amp;)?|;)/)\n\t\t\t\t.forEach(query => {\n\t\t\t\t\tconst [key, value] = query.split('=');\n\t\t\t\t\tqueryObj[key] = value;\n\t\t\t\t});\n\t\t}\n\n\t\t/*\n\t\t\tCaveats by browser:\n\t\t\t\tEdge and Internet Explorer (≥8) do not support authentication\n\t\t\t\tinformation within a URL at all and will throw a security exception\n\t\t\t\ton *any* property access if it's included.\n\n\t\t\t\tInternet Explorer does not include the leading forward slash on\n\t\t\t\t`pathname` when required.\n\n\t\t\t\tOpera (Presto) strips the authentication information from `href`\n\t\t\t\tand does not supply `username` or `password`.\n\n\t\t\t\tSafari (ca. v5.1.x) does not supply `username` or `password` and\n\t\t\t\tpeforms URI decoding on `pathname`.\n\t\t*/\n\n\t\t// Patch for IE not including the leading slash on `pathname` when required.\n\t\tconst pathname = el.host && el.pathname[0] !== '/' ? `/${el.pathname}` : el.pathname;\n\n\t\treturn {\n\t\t\t// The full URL that was originally parsed.\n\t\t\thref : el.href,\n\n\t\t\t// The request protocol, lowercased.\n\t\t\tprotocol : el.protocol,\n\n\t\t\t// // The full authentication information.\n\t\t\t// auth : el.username || el.password // eslint-disable-line no-nested-ternary\n\t\t\t// \t? `${el.username}:${el.password}`\n\t\t\t// \t: typeof el.username === 'string' ? '' : undefined,\n\t\t\t//\n\t\t\t// // The username portion of the auth info.\n\t\t\t// username : el.username,\n\t\t\t//\n\t\t\t// // The password portion of the auth info.\n\t\t\t// password : el.password,\n\n\t\t\t// The full host information, including port number, lowercased.\n\t\t\thost : el.host,\n\n\t\t\t// The hostname portion of the host info, lowercased.\n\t\t\thostname : el.hostname,\n\n\t\t\t// The port number portion of the host info.\n\t\t\tport : el.port,\n\n\t\t\t// The full path information, including query info.\n\t\t\tpath : `${pathname}${el.search}`,\n\n\t\t\t// The pathname portion of the path info.\n\t\t\tpathname,\n\n\t\t\t// The query string portion of the path info, including the leading question mark.\n\t\t\tquery : el.search,\n\t\t\tsearch : el.search,\n\n\t\t\t// The attributes portion of the query string, parsed into an object.\n\t\t\tqueries : queryObj,\n\t\t\tsearches : queryObj,\n\n\t\t\t// The fragment string, including the leading hash/pound sign.\n\t\t\thash : el.hash\n\t\t};\n\t}", "function parseURL(url) {\n\n var parser = document.createElement('a'),\n searchObject = {},\n queries, split, i;\n\n // Let the browser do the work\n parser.href = url;\n\n // Convert query string to object\n queries = parser.search.replace(/^\\?/, '').split('&');\n for( i = 0; i < queries.length; i++ ) {\n split = queries[i].split('=');\n searchObject[split[0]] = split[1];\n }\n\n return {\n protocol: parser.protocol,\n host: parser.host,\n hostname: parser.hostname,\n port: parser.port,\n pathname: parser.pathname,\n search: parser.search,\n searchObject: searchObject,\n hash: parser.hash\n };\n\n}", "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\"The url string provided does not contain a scheme. \" +\n \"Supported schemes are: \" +\n (\"\" + ModelStoreManagerRegistry.getSchemes().join(',')));\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(`The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(`The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "function linkparser(link) {\r\n const start = link.indexOf('net/');\r\n const end = link.indexOf('?');\r\n const res = link.slice(Number(start) + 4, end);\r\n return res;\r\n}", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n // Index is starting from 1\n if ( index < 1 ) {\n index = 1;\n }\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrlOrigin (url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash\n // if such is given\n //\n // can ignore everything after that\n\n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n var urlHostMatch = URL_HOST_PATTERN.exec(url) || []\n\n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n }\n}", "function parseUrl() {\r\n var hash = window.location.hash.substr(1),\r\n rez = hash.split(\"-\"),\r\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\r\n gallery = rez.join(\"-\");\r\n\r\n return {\r\n hash: hash,\r\n /* Index is starting from 1 */\r\n index: index < 1 ? 1 : index,\r\n gallery: gallery\r\n };\r\n }", "function parseUrl() {\r\n var hash = window.location.hash.substr(1),\r\n rez = hash.split(\"-\"),\r\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\r\n gallery = rez.join(\"-\");\r\n\r\n return {\r\n hash: hash,\r\n /* Index is starting from 1 */\r\n index: index < 1 ? 1 : index,\r\n gallery: gallery\r\n };\r\n }", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "function parseURI(url) {\n var m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@\\/?#]*(?::[^:@\\/?#]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n // authority = '//' + user + ':' + pass '@' + hostname + ':' port\n return (m ? {\n href : m[0] || '',\n protocol : m[1] || '',\n authority: m[2] || '',\n host : m[3] || '',\n hostname : m[4] || '',\n port : m[5] || '',\n pathname : m[6] || '',\n search : m[7] || '',\n hash : m[8] || ''\n } : null);\n }", "function parseURI(url) {\n var m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@\\/?#]*(?::[^:@\\/?#]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n // authority = '//' + user + ':' + pass '@' + hostname + ':' port\n return (m ? {\n href : m[0] || '',\n protocol : m[1] || '',\n authority: m[2] || '',\n host : m[3] || '',\n hostname : m[4] || '',\n port : m[5] || '',\n pathname : m[6] || '',\n search : m[7] || '',\n hash : m[8] || ''\n } : null);\n }", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseURI(url) {\n\t\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\t\treturn (m ? {\n\t\t\thref : m[0] || '',\n\t\t\tprotocol : m[1] || '',\n\t\t\tauthority: m[2] || '',\n\t\t\thost : m[3] || '',\n\t\t\thostname : m[4] || '',\n\t\t\tport : m[5] || '',\n\t\t\tpathname : m[6] || '',\n\t\t\tsearch : m[7] || '',\n\t\t\thash : m[8] || ''\n\t\t} : null);\n\t}", "parsePath(url) {\n\t\tvar ret = \"\";\n\n\t\t// In case the url has a protocol, remove it.\n\t\tvar protocolSplit = url.split(\"://\");\n\t\tvar withoutProtocol;\n\t\tif (protocolSplit.length > 1) {\n\t\t\twithoutProtocol = protocolSplit[1];\n\t\t} else {\n\t\t\twithoutProtocol = protocolSplit[0];\n\t\t}\n\n\t\tvar host = withoutProtocol.split(\"?\")[0];\n\t\tvar pathIndex = host.indexOf(\"/\");\n\t\tif (pathIndex !== -1) {\n\t\t\tret = host.substring(pathIndex, host.length);\n\t\t} else {\n\t\t\tret = \"/\";\n\t\t}\n\n\t\treturn ret;\n\t}", "function parseURI(url) {\n var m = String(url).match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n // authority = '//' + user + ':' + pass '@' + hostname + ':' port\n return (m ? {\n href : m[0] || '',\n protocol : m[1] || '',\n authority: m[2] || '',\n host : m[3] || '',\n hostname : m[4] || '',\n port : m[5] || '',\n pathname : m[6] || '',\n search : m[7] || '',\n hash : m[8] || ''\n } : null);\n}", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "parseDomain(url) {\n if(url) {\n if (url.indexOf(\"://\") > -1) {\n url = url.split('/')[2];\n } else {\n url = url.split('/')[0];\n }\n }\n\n return url;\n }", "function parseUrl() {\r\n var hash = window.location.hash.substr( 1 );\r\n var rez = hash.split( '-' );\r\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\r\n var gallery = rez.join( '-' );\r\n\r\n\t\t// Index is starting from 1\r\n\t\tif ( index < 1 ) {\r\n\t\t\tindex = 1;\r\n\t\t}\r\n\r\n return {\r\n hash : hash,\r\n index : index,\r\n gallery : gallery\r\n };\r\n }", "function parse(url) {\n if (typeof document !== 'undefined') {\n var a = document.createElement('a');\n a.href = url;\n return a;\n }\n return urlparse(url);\n }", "function parseUrl (url) {\n\turl = url || location.href\n\n\tconst splitUrl = url.split('?')\n\tconst [link, params] = splitUrl\n\n\tif(params) {\n\t\tconst result = {url: link}\n\t\tconst _params = params.split('&')\n\t\t_params.forEach(item => {\n\t\t\tconst [name, key] = item.split('=')\n\t\t\tresult[name] = decodeURIComponent(key)\n\t\t})\n\t\treturn result\n\t}else {\n\t\treturn null\n\t}\n}", "function parseUrl(url){\n\tif (!typeof(url) == 'string'){\n\t\tthrow Error(`Unexpected input type, expected string but got ${typeof(url)}`)\n\t}\n\tlet re = /^(https:\\/\\/www\\.amazon\\.co\\.jp\\/).*(dp|gp\\/)(.*\\/)/g;\n\tconst resultArray = [...url.matchAll(re)];\n\tlet urlStr;\n\ttry{\n\t\turlStr = resultArray[0][1]+resultArray[0][2]+resultArray[0][3];\n\t\treturn urlStr;\n\t}catch(error){\n\t\tthrow Error('Invalid url parsing error');\n\t}\n}", "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "function parseProtocol(url) {\n const parsedUrl = /^(\\w+)\\:\\/\\/([^\\/]+)\\/(.*)$/.exec(url);\n if(!parsedUrl) {\n return false;\n }\n\n const [, protocol, fullhost, fullpath] = parsedUrl;\n return fullhost\n}", "function process_url(url) {\n\tconsole.log(\" @@@ DEPRICATED process_url() \");\n\t// split up the url to host, path and get parameters\n\tvar re = /^(https?:\\/\\/[^\\/]+)([^?&]*)(.*)$/;\n\tvar matches = re.exec(url);\n\tvar param = \"\";\n\tvar host = \"\";\n\tvar path = \"\";\n\tif (matches[1]) {\n\t\thost = matches[1];\n\t}\n\tif (matches[2]) {\n\t\tpath = matches[2];\n\t}\n\t// the get parameter string\n\tif (matches[3] && typeof matches[3] == \"string\") {\n\t\tparam = matches[3].substr(1);\n\t}\n\n\t// pull out the get parameters and decode them\n\tgparams = {};\n\tif (matches.length > 2) {\n\t\tgparams = get_url_params(matches[3]);\n\t}\n\n\treturn {\"host\":host, \"path\":path, \"gparamstr\":param, \"gparams\":gparams};\n}", "function parseUrl() {\n var url = location.href;\n var k = url.indexOf('?');\n if(k == -1){\n return;\n }\n var querystr = url.substr(k+1);\n var arr1 = querystr.split('&');\n var arr2 = new Object();\n for (k in arr1){\n var ta = arr1[k].split('=');\n arr2[ta[0]] = ta[1];\n }\n return arr2;\n}", "function parseURL(url) {\n var parser = document.createElement('a'),\n searchObject = {},\n queries, split, i;\n \n // Let the browser do the work\n parser.href = url;\n \n // Convert query string to object\n queries = parser.search.replace(/^\\?/, '').split('&');\n \n for( i = 0; i < queries.length; i++ ) {\n split = queries[i].split('=');\n searchObject[split[0]] = split[1];\n }\n \n return {\n params: parser.search,\n paramsObj: searchObject,\n hash: parser.hash\n };\n }", "parseUrl(url) {\n let urlTree;\n\n try {\n urlTree = this.urlSerializer.parse(url);\n } catch (e) {\n urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);\n }\n\n return urlTree;\n }", "function parseUrl({ url }) {\n const { host, pathname } = new URL(url);\n const { 1: bucket, 2: region } = host.match(\n /^([^\\/]*)\\.cos\\.([^\\/]*)\\.myqcloud\\.com$/\n );\n return {\n bucket,\n region,\n key: decodeURIComponent(pathname.slice(1)),\n };\n}", "function parseUri(url) {\r\n\t\tvar match = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\r\n\t\treturn (match ? { href: match[0] || '', protocol: match[1] || '', authority: match[2] || '', host: match[3] || '', hostname: match[4] || '',\r\n\t\t port: match[5] || '', pathname: match[6] || '', search: match[7] || '', hash: match[8] || '' } : null);\r\n\t}", "function parseUrl (ast) {\n let [firstAgument] = ast.arguments;\n let rawUrl = firstAgument.raw;\n let url = rawUrl.replace(/^\\//, '').replace(/\\/$/, '').replace(/\\\\/g,'');\n assert(url);\n return url;\n }", "function tryParse(url) {\n if (!url) {\n return null;\n }\n\n var parsed = urlParse(url);\n\n return {\n protocol: parsed.protocol,\n host: parsed.hostname,\n port: parseInt(parsed.port, 10),\n proxyAuth: parsed.auth\n };\n}", "function parseUrl(url) {\n const { host, pathname } = new URL(url);\n const { 1: bucket, 2: region } = host.match(/^([^.]*)\\.cos\\.([^.]*)\\.myqcloud\\.com$/);\n let key = decodeURIComponent(pathname.slice(1));\n if (key.includes('?')) {\n key = key.replace(/\\?[\\s\\S]*$/, '');\n }\n return {\n bucket,\n region,\n key,\n };\n}", "function parseURL(parseQuery, location, currentLocation = '/') {\n let path, query = {}, searchString = '', hash = '';\n // Could use URL and URLSearchParams but IE 11 doesn't support it\n const searchPos = location.indexOf('?');\n const hashPos = location.indexOf('#', searchPos > -1 ? searchPos : 0);\n if (searchPos > -1) {\n path = location.slice(0, searchPos);\n searchString = location.slice(searchPos + 1, hashPos > -1 ? hashPos : location.length);\n query = parseQuery(searchString);\n }\n if (hashPos > -1) {\n path = path || location.slice(0, hashPos);\n // keep the # character\n hash = location.slice(hashPos, location.length);\n }\n // no search and no query\n path = resolveRelativePath(path != null ? path : location, currentLocation);\n // empty path means a relative query or hash `?foo=f`, `#thing`\n return {\n fullPath: path + (searchString && '?') + searchString + hash,\n path,\n query,\n hash,\n };\n}", "function Main_ParseUrlParameters()\n{\n\t//create an url object\n\tvar url = {};\n\n\t//get the url string\n\tvar strURL = location.href;\n\t//search for first query\n\tvar nAmp = strURL.indexOf(\"?\");\n\tif (nAmp != -1)\n\t{\n\t\t//correct url\n\t\tstrURL = strURL.substr(nAmp + 1);\n\t\t//split into pairs\n\t\tstrURL = strURL.split(\"&\");\n\t\t//loop through them\n\t\tfor (var i = 0, c = strURL.length; i < c; i++)\n\t\t{\n\t\t\t//split this into the name/value pair\n\t\t\tvar pair = strURL[i].split(\"=\");\n\t\t\tif (pair.length == 2)\n\t\t\t{\n\t\t\t\t//add this\n\t\t\t\turl[pair[0].toLowerCase()] = pair[1];\n\t\t\t}\n\t\t}\n\t\t//we have a root?\n\t\tif (url.startid)\n\t\t{\n\t\t\t//add root\n\t\t\turl.StartStateId = url.startid;\n\t\t\t//has extension?\n\t\t\tif (url.StartStateId.indexOf(__NEMESIS_EXTENSION) != -1)\n\t\t\t{\n\t\t\t\t//remove it\n\t\t\t\turl.StartStateId.replace(__NEMESIS_EXTENSION, \"\");\n\t\t\t}\n\t\t}\n\t}\n\t//return it\n\treturn url;\n}", "function parseURL(url) {\n var a = document.createElement('a')\n a.href = url\n return a\n }", "function parseURL(parseQuery, location, currentLocation = '/') {\r\n let path, query = {}, searchString = '', hash = '';\r\n // Could use URL and URLSearchParams but IE 11 doesn't support it\r\n const searchPos = location.indexOf('?');\r\n const hashPos = location.indexOf('#', searchPos > -1 ? searchPos : 0);\r\n if (searchPos > -1) {\r\n path = location.slice(0, searchPos);\r\n searchString = location.slice(searchPos + 1, hashPos > -1 ? hashPos : location.length);\r\n query = parseQuery(searchString);\r\n }\r\n if (hashPos > -1) {\r\n path = path || location.slice(0, hashPos);\r\n // keep the # character\r\n hash = location.slice(hashPos, location.length);\r\n }\r\n // no search and no query\r\n path = resolveRelativePath(path != null ? path : location, currentLocation);\r\n // empty path means a relative query or hash `?foo=f`, `#thing`\r\n return {\r\n fullPath: path + (searchString && '?') + searchString + hash,\r\n path,\r\n query,\r\n hash,\r\n };\r\n}", "function parseURL(parseQuery, location, currentLocation = '/') {\r\n let path, query = {}, searchString = '', hash = '';\r\n // Could use URL and URLSearchParams but IE 11 doesn't support it\r\n const searchPos = location.indexOf('?');\r\n const hashPos = location.indexOf('#', searchPos > -1 ? searchPos : 0);\r\n if (searchPos > -1) {\r\n path = location.slice(0, searchPos);\r\n searchString = location.slice(searchPos + 1, hashPos > -1 ? hashPos : location.length);\r\n query = parseQuery(searchString);\r\n }\r\n if (hashPos > -1) {\r\n path = path || location.slice(0, hashPos);\r\n // keep the # character\r\n hash = location.slice(hashPos, location.length);\r\n }\r\n // no search and no query\r\n path = resolveRelativePath(path != null ? path : location, currentLocation);\r\n // empty path means a relative query or hash `?foo=f`, `#thing`\r\n return {\r\n fullPath: path + (searchString && '?') + searchString + hash,\r\n path,\r\n query,\r\n hash,\r\n };\r\n}", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "function parseURL(url) {\n const a = window.document.createElement(\"a\");\n a.href = url;\n return a;\n}", "function rawUrlParse(strurl)\n{\n\tvar\tep = url.parse(strurl);\n\tif(rawIsSafeEntity(ep) && (null === ep.port || !rawIsSafeEntity(ep.port) || isNaN(ep.port))){\n\t\t// set default port\n\t\tif(rawIsSafeString(ep.protocol) && 'https:' === ep.protocol){\n\t\t\tep.port\t= 443;\n\t\t}else{\n\t\t\tep.port\t= 80;\n\t\t}\n\t}\n\treturn ep;\n}", "function parseURL(url) {\n\n /** URL pattern in GitHub\n * new:\t<SERVER>/<user>/<repo>/new/<branch>/<fpath>\n * edit:\t<SERVER>/<user>/<repo>/edit/<branch>/<fpath>\n * delete:\t<SERVER>/<user>/<repo>/delete/<branch>/<fpath>\n * upload:\t<SERVER>/<user>/<repo>/upload/<branch>/<fpath>\n * merge:\t<SERVER>/<user>/<repo>/pull/<pr#>\n **/\n\n /** URL pattern in GitLab\n * new:\t<SERVER>/<user>/<repo>/-/new/<branch>/<fpath>\n * edit:\t<SERVER>/<user>/<repo>/-/edit/<branch>/<fpath>\n * delete:\t<SERVER>/<user>/<repo>/-/blob/<branch>/<fpath>\n * upload:\t<SERVER>/<user>/<repo>/-/tree/<branch>/<fpath>\n * merge:\t<SERVER>/<user>/<repo>/-/merge_requests/<pr#>\n **/\n\n let info = url.replace(`${SERVER}`, \"\").split(\"/\");\n\n // The extension does not work on the main page of repo\n if (info.length < 4) {\n deactivate({\n rule: UNKNOWN_REQUEST\n });\n return UNKNOWN_REQUEST;\n }\n\n // Remove an extra element (i.e. \"-\") from the GitLab url\n if (SERVER == SERVER_GL) info.splice(3,1);\n\n let commitType = info[3];\n let baseBranch = null;\n let oldPath = null;\n let prId = null;\n let request = REQ_MERGE;\n\n if ((commitType == MERGE_GH) || (commitType == MERGE_GL)) {\n commitType = REQ_MERGE;\n prId = info[4];\n } else {\n // RULE: requests on non-commit pages are ignored\n request = checkRequest(commitType, url);\n if (request == UNKNOWN_REQUEST) {\n return request;\n }\n baseBranch = info[4];\n oldPath = getFilePath(url, commitType, baseBranch);\n\n // Unify D/U requests for GiHub and GitLab\n if (commitType == TYPE_BLOB) commitType = REQ_DELETE;\n if (commitType == TYPE_TREE) commitType = REQ_UPLOAD;\n }\n\n return {\n user: info[1],\n repo: info[2],\n baseBranch,\n commitType,\n request,\n oldPath,\n prId,\n url\n }\n}", "static splitURI(uri) {\nvar matches, pattern;\n// lggr.trace? \"Splitting #{uri}\"\npattern = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\nmatches = uri.match(pattern);\nreturn {\nscheme: matches[2],\nauthority: matches[4],\npath: matches[5],\nquery: matches[7],\nfragment: matches[9]\n};\n}", "function parseURL(url, p) {\n\tvar result = \"\";\n\tvar items = url.split('/');\n\tvar i;\n\n\tfor (i = 1; i < items.length; i++) {\n\t\tvar item = items[i];\n\n\t\tif (item.indexOf(':') == 0) {\n\t\t\tvar keyname = item.substring(1);\n\t\t\tvar val = p[keyname];\n\n\t\t\tif (!! val) {\n\t\t\t\tresult = result + '/' + val;\n\t\t\t}else {\n\t\t\t\tlog.error('Invalid params:' + JSON.stringify(p) + ' for url: ' + url);\n\t\t\t\tresult = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}else {\n\t\t\tresult = result + '/' + item;\n\t\t}\n\t}\n\n\treturn result;\n}", "static getContextStringForUrl(url) {\n let initialUrl = url;\n if (url.startsWith(\"http://\")) {\n url = url.substr(7)\n } else if (url.startsWith(\"https://\")) {\n url = url.substr(8)\n }\n\n let host = url.substr(0, url.indexOf(\"/\"));\n\n console.log(\"picking host=\" + host + \" for url \" + initialUrl);\n return host\n }", "function parseURL(url) {\n var a = document.createElement('a');\n a.href = url;\n return a;\n }", "parseUrl(url) {\n let urlTree;\n try {\n urlTree = this.urlSerializer.parse(url);\n }\n catch (e) {\n urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);\n }\n return urlTree;\n }" ]
[ "0.74793124", "0.71562207", "0.71445256", "0.713249", "0.7127991", "0.7104554", "0.7090583", "0.70892334", "0.7068689", "0.70530134", "0.7051278", "0.7045394", "0.7027864", "0.7027864", "0.70218605", "0.701811", "0.701811", "0.69899344", "0.691187", "0.6857873", "0.6824891", "0.6812172", "0.68105716", "0.6766502", "0.67250025", "0.6704366", "0.6673597", "0.66554517", "0.66521996", "0.66031027", "0.6581678", "0.6581678", "0.6578014", "0.65698075", "0.65565795", "0.6555031", "0.6555031", "0.6551504", "0.65512115", "0.65512115", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6548444", "0.6545919", "0.6545919", "0.6545919", "0.65380156", "0.6537889", "0.6531501", "0.6529793", "0.6529793", "0.6529793", "0.6529793", "0.65296763", "0.6527019", "0.6526145", "0.650975", "0.6496417", "0.64854693", "0.64854693", "0.64854693", "0.64854693", "0.64779264", "0.6471386", "0.6433451", "0.63960207", "0.6394411", "0.6390738", "0.63886464", "0.6379661", "0.63553125", "0.63177806", "0.6305805", "0.63017327", "0.6293263", "0.6282885", "0.6282885", "0.62804204", "0.62804204", "0.62804204", "0.62804204", "0.62804204", "0.62802345", "0.62782925", "0.6269078", "0.6262244", "0.62592727", "0.6258004", "0.6256844", "0.6253437" ]
0.648221
72
Modal dynamic centering ===================================================
function modalCentering() { $('.modal').each(function(){ if($(this).hasClass('in') === false){ $(this).show(); } var contentHeight = $(window.parent, window.parent.document).height() - 60; var headerHeight = $(this).find('.modal-header').outerHeight() || 2; var footerHeight = $(this).find('.modal-footer').outerHeight() || 2; var modalHeight = $(this).find('.modal-content').outerHeight(); var modalYPosition = $(this).find('.modal-dialog').offset().top; var windowPageYOffset = window.top.pageYOffset; var windowHeight = $(window).height(); $(this).find('.modal-dialog').addClass('modal-dialog-center').css({ 'margin-top': function () { if ( (((contentHeight - modalHeight) / 2) + windowPageYOffset - 230) < 0) { return 0; } else if((((contentHeight - modalHeight) / 2) + windowPageYOffset - 230) < $(window).height() - modalHeight ) { return (( (contentHeight - modalHeight) / 2) + windowPageYOffset - 230); } }, 'top': '', 'left': '' }); if($(this).hasClass('in') === false){ $(this).hide(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function centerModals(){\r\n $('.modal').each(function(i){\r\n var $clone = $(this).clone().css('display', 'block').appendTo('body');\r\n var top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\r\n top = top > 0 ? top : 0;\r\n $clone.remove();\r\n $(this).find('.modal-content').css(\"margin-top\", top);\r\n });\r\n }", "function centerModals(){\r\n\t $('.modal').each(function(i){\r\n\t\tvar $clone = $(this).clone().css('display', 'block').appendTo('body');\r\n\t\tvar top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\r\n\t\ttop = top > 0 ? top : 0;\r\n\t\t$clone.remove();\r\n\t\t$(this).find('.modal-content').css(\"margin-top\", top);\r\n\t });\r\n\t}", "function centerModals(){\n\t $('.modal').each(function(i){\n\t\tvar $clone = $(this).clone().css('display', 'block').appendTo('body');\n\t\tvar top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\n\t\ttop = top > 0 ? top : 0;\n\t\t$clone.remove();\n\t\t$(this).find('.modal-content').css(\"margin-top\", top);\n\t });\n\t}", "function centerModals() {\r\n\t$('.modal').each(function(i) {\r\n\t\tvar $clone = $(this).clone().css('display', 'block').appendTo('body');\r\n\t\tvar top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);\r\n\t\ttop = top > 0 ? top : 0;\r\n\t\t$clone.remove();\r\n\t\t$(this).find('.modal-content').css('margin-top', top);\r\n\t});\r\n}", "function reposition() {\n var modal = $(this),\n dialog = modal.find('.modal-dialog');\n modal.css('display', 'block');\n \n // Dividing by two centers the modal exactly, but dividing by three \n // or four works better for larger screens.\n dialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n}", "function alignModal() {\n var modalDialog = $(this).find(\".modal-dialog\");\n modalDialog.css(\"margin-top\", Math.max(0,\n ($(window).height() - modalDialog.height()) / 2));\n }", "function reposition() {\r\n\tvar modal = jQuery(this),\r\n\tdialog = modal.find('.modal-dialog');\r\n\tmodal.css('display', 'block');\r\n\t\r\n\t/* Dividing by two centers the modal exactly, but dividing by three \r\n\t or four works better for larger screens. */\r\n\tdialog.css(\"margin-top\", Math.max(0, (jQuery(window).height() - dialog.height()) / 2));\r\n}", "function positionmodal() {\n\n // Half the width of the modal\n var left = modalwidth / 2;\n\n // Half the width of the mask\n var halfmaskwidth = windowwidth / 2;\n\n // Location of the left side of the popup\n var popupleft = halfmaskwidth - left;\n\n // Top stays static\n popup.css('top', 30);\n\n // Set the left\n popup.css('left', popupleft);\n\n }", "function reposition() {\n\t\tvar modal = $(this),\n\t\t\tdialog = modal.find('.modal-dialog');\n\t\t\tmodal.css('display', 'block');\n\t\t\tdialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n\t\t\t$(\".modal .actions\").css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n\t}", "function SetModalPos(obj) {\n if ($($(obj).data('target')).is(':visible')) {\n var width_0 = $(obj).parent().parent().parent().parent().parent().outerWidth() - $(obj).parent().parent().parent().parent().outerWidth();\n var width = 2 * ($(obj).parent().parent().parent().parent().parent().outerWidth() - (width_0 - 3) / 2);\n $($(obj).data('target')).css({\n 'width': width + 'px'\n });\n $($(obj).data('target')).children().css({\n 'width': width + 'px'\n });\n $($(obj).data('target')).css({\n 'height': $($(obj).data('target')).children().outerHeight() + 'px'\n });\n $('#main').css('min-height', ($(obj).parent().parent().parent().parent().offset().top - 2 + $($(obj).data('target')).children().outerHeight() + 20) + 'px');\n var left = $(obj).parent().parent().parent().parent().offset().left - 1;\n if (left + width > $(window).innerWidth()) left = left - (width + width_0 - 2) / 2;\n $($(obj).data('target')).offset({\n top: $(obj).parent().parent().parent().parent().offset().top - 2,\n left: left\n });\n $($(obj).data('target')).children().offset({\n top: $(obj).parent().parent().parent().parent().offset().top - 2,\n left: left\n });\n }\n}", "function MyVerticallyCenteredModal(props) {\n return (\n <Modal\n {...props}\n size=\"lg\"\n aria-labelledby=\"contained-modal-title-vcenter\"\n centered\n >\n <Modal.Header closeButton>\n <Modal.Title id=\"contained-modal-title-vcenter\">\n <strong>Apa Itu SmartQ?</strong> \n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <p>\n SmartQ merupakan sebuah aplikasi booking dan atau antrian yang dilakukan secara online \n dengan tujuan memberikan konsumen kemudahan, efisiensi, dan efektivitas waktu yang lebih \n baik. Selain itu SmartQ juga memberikan profitabilitas lebih bagi UMKM yang sampai hari \n ini masih memiliki kendala mengenai system antrian. Dengan adanya perbaikan system antrian \n yang ada di Indonesia diharapkan mampu menciptakan, menumbuhkan dan menerapkan kembali \n budaya antri yang sudah mulai menghilang di lingkungan masyarakat saat ini. Selain itu \n budaya antri merupakan sebuah kegiatan yang seharusnya diterapkan oleh setiap orang pada \n tempat dan waktu tertentu. Usaha layanan ini juga dapat mengintegrasikan UMKM yang \n membutuhkan solusi mengenai system antrian yang masih belum berjalan dengan baik sehingga \n dapat meningkatkan pelayanannya terhadap konsumen yang ada pada suatu tempat tersebut, \n sehingga mampu meningkatkan pelayanan yang jauh lebih baik dibandingkan dengan sebelumnya.\n </p>\n </Modal.Body>\n <Modal.Footer>\n <Button variant=\"primary\" onClick={props.onHide}>Close</Button>\n </Modal.Footer>\n </Modal>\n );\n}", "recenterModalAndHideBtnSurface(){\n this.closeModalAndShowBtnSurface()\n const cameraQuat = r360.getCameraQuaternion()\n infoPanel.recenter(cameraQuat, 'all')\n this.hideSurfacesInPanelArea()\n }", "function showModalLayout() {\n modal.className = \"fixed z-20 h-full w-full bg-white rounded-lg transform translate-y-0 transition duration-300\";\n}", "function openModal(modalToOpen) {\n //$(\".modal\").css(\"marginTop\", \"0\");\n $(modalToOpen).css(\"marginLeft\", ($(window).width() - $(modalToOpen).width())/2);\n $(modalToOpen+\"-bg\").fadeIn();\n $(modalToOpen).fadeIn();\n}", "function showModal(ev){\n clickTarget=ev.target.id-1;\n\n contentBox=document.getElementsByClassName('modal')[clickTarget];\n ev.stopPropagation();\n contentBox.style.display = 'flex';\n contentBox.style.flexDirection='column';\n contentBox.style.justifyContent='center';\n contentBox.style.alignItems='center';\n\n}", "function display_ws_modal() {\n var id = '#dialog';\n //transition effect \n $('#mask').fadeIn(500); \n $('#mask').fadeTo(\"slow\",0.8); \n \n //Get the window height and width\n var winH = $(window).height();\n var winW = $(window).width();\n \n //Set the popup window to center\n $(id).css('top', winH/2-$(id).height()/2);\n $(id).css('left', winW/2-$(id).width()/2);\n \n //transition effect\n $(id).fadeIn(1000); \n }", "function _center() {\n\t\tif (data.isMobile) {\n\t\t\tvar newLeft = 0,\n\t\t\t\tnewTop = 0;\n\t\t} else {\n\t\t\tvar newLeft = ($(window).width() - data.$boxer.width() - data.padding) / 2,\n\t\t\t\tnewTop = (data.options.top <= 0) ? (($(window).height() - data.$boxer.height() - data.padding) / 2) : data.options.top;\n\t\t\t\n\t\t\tif (data.options.fixed !== true) {\n\t\t\t\tnewTop += $(window).scrollTop();\n\t\t\t}\n\t\t}\n\t\t\n\t\tdata.$boxer.css({ \n\t\t\tleft: newLeft, \n\t\t\ttop: newTop \n\t\t});\n\t}", "function adjustAndShow(modal) {\r\n\t$(\"#modal-background\").css(\"height\", document.body.scrollHeight > document.body.offsetHeight ? (document.body.scrollHeight>$(window).height()? document.body.scrollHeight :$(window).height()) : (document.body.offsetHeight>$(window).height()? document.body.offsetHeight:$(window).height()));\r\n\t$(\"#modal-background, \" + modal).show();\r\n\t$(\"#new-modal-window\").css(\"margin-left\", - $(\"#new-modal-window\").width() / 2 + \"px\").css(\"margin-top\", - $(\"#new-modal-window\").height() / 2 + \"px\");\r\n\tvar height = 0;\r\n\t$(modal + \" .outLay .modalBody .modalContent li\").each(function(){\r\n\t\theight += $(this).height();\r\n\t});\r\n\tif(!$(modal+ \" .outLay .modalBody .modalContent\").hasClass(\"multiple\")){\r\n\t\t$(modal+ \" .outLay .modalBody .modalContent li:first\").css(\"padding-top\", ($(\".outLay .modalBody .modalContent\").height() - height) / 2 + \"px\");\r\n\t}\r\n\r\n if (jQuery.browser.msie && jQuery.browser.version == '9.0') {\r\n $(modal + \" .modalBody\").css(\"margin-top\", \"-2px\");\r\n }\r\n}", "function adjustAndShow(modal) {\n $(\"#modal-background\").css(\"height\", document.body.scrollHeight > document.body.offsetHeight ? (document.body.scrollHeight>$(window).height()? document.body.scrollHeight :$(window).height()) : (document.body.offsetHeight>$(window).height()? document.body.offsetHeight:$(window).height()));\n $(\"#modal-background, \" + modal).show();\n $(\"#new-modal-window\").css(\"margin-left\", - $(\"#new-modal-window\").width() / 2 + \"px\").css(\"margin-top\", - $(\"#new-modal-window\").height() / 2 + \"px\");\n var height = 0;\n $(modal + \".outLay .modalBody .modalContent li\").each(function(){\n height += $(this).height();\n });\n if(!$(modal+ \".outLay .modalBody .modalContent\").hasClass(\"multiple\")){\n $(modal+ \".outLay .modalBody .modalContent li:first\").css(\"padding-top\", ($(\".outLay .modalBody .modalContent\").height() - height) / 2 + \"px\");\n }\n if (jQuery.browser.msie && jQuery.browser.version == '9.0') {\n $(modal + \" .modalBody\").css(\"margin-top\", \"-2px\");\n }\n}", "function displayModal(modalId)\n\t{\n\t\tvar modal = document.getElementById(modalId)\n\t\tvar background = document.getElementById(\"overlay\");\n\t\tbackground.className = \"overlay\"\n\t\tmodal.className = \"displayModal\";\n\t\tvar width = modal.clientWidth; \n\t\tvar height = modal.clientHeight; \n\t\tvar displacementX = '-'+ (width/2) + 'px';\n\t\tvar displacementY = '-' + (height/2) + 'px'; \n\t\tmodal.style.marginLeft = displacementX;\n\t\tmodal.style.marginTop = displacementY; \n\t}", "alignCenter() {\n this.setAnchor(0.5);\n this.setStyle({ align: 'center' });\n }", "function centerDiv(divId) {\t\r\n\tjQuery(function($){\r\n\t\t//request data for centering\r\n\t\tvar popupHeight = $(\"#\" + divId).height();\r\n\t\tvar popupWidth = $(\"#\" + divId).width();\r\n\t\t//centering\r\n\t\t$(\"#\" + divId).css({\r\n\t\t\t//\"top\": windowHeight/2-popupHeight/2,\r\n\t\t\t//\"left\": windowWidth/2-popupWidth/2\r\n\t\t\t\"top\": document.documentElement.clientHeight/2-popupHeight/2,\r\n\t\t\t\"left\": document.documentElement.clientWidth/2-popupWidth/2\r\n\t\t});\r\n\t});\t\r\n}", "function modalMaker(argument) {\n \treturn m(\".\" + argument.class, {\n \t\tid: argument.id\n \t}, [\n \t\tm(\"div\", {\n \t\t\tclass: \"center\"\n \t\t}, [\n \t\t\tm(argument.body)\n \t\t])\n \t])\n }", "function displayBox() \n{\t\n\tjQuery.fn.center = function (absolute) {\n\t\treturn this.each(function () {\n\t\t\tvar t = jQuery(this);\n\t\t\n\t\t\tt.css({\n\t\t\t\tposition: absolute ? 'absolute' : 'fixed', \n\t\t\t\tleft: '50%', \n\t\t\t\ttop: '50%', \n\t\t\t\tzIndex: '200000'\n\t\t\t}).css({\n\t\t\t\tmarginLeft: '-' + (t.outerWidth() / 2) + 'px', \n\t\t\t\tmarginTop: '-' + (t.outerHeight() / 2) + 'px'\n\t\t\t});\n\t\t\n\t\t\tif (absolute) {\n\t\t\t\tt.css({\n\t\t\t\t\tmarginTop: parseInt(t.css('marginTop'), 10) + jQuery(window).scrollTop(), \n\t\t\t\t\tmarginLeft: parseInt(t.css('marginLeft'), 10) + jQuery(window).scrollLeft()\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n\tjQuery('#garden_fence_modal').center();\n}", "function screen_center_pos(PopUpWidth, PopUpHeight)\n{\n\tvar Width = $(window).width()\n\n\tvar Height = $(window).height()\n\n\treturn({\n\t\tx : (Width/2 - PopUpWidth/2) , \n\t\ty : (Height/2 - PopUpHeight/2)\n\t})\n}", "function center()\n\t{\n\t\tfw.dock(wid, {\n\t\t\twid: that,\n\t\t\tmy: 'center left',\n\t\t\tat: 'center left'\n\t\t});\n\t}", "function makeItCenter(el)\n {\n if($(\"#Stage\").width() < 1200){\n el.css(\"marginLeft\",\"0px\");\n el.css(\"left\",\"76px\");\n }else{\n el.css(\"marginLeft\",(el.width()/2)*-1);\n el.css(\"left\",\"50%\");\n }\n\n }", "function modal_message(title, body){\n\t\n\t $('#myModal .modal-title').html(title); \n\t $('#myModal .modal-body').html(body); \n\t $('#myModal .modal-body').css(\"text-align\", \"center\");\n\t $('#myModal').modal(\"show\");\n\n}", "function show() {\n // Add background overlay when a modal is appeared\n bg = document.createElement(\"div\");\n bg.setAttribute(\"id\", \"overLay\");\n document.body.append(bg);\n // Add style for modal\n modal.style.display = \"block\";\n // Remove background overlay when a background is clicked\n bg.addEventListener(\"click\", hide);\n // Make the modal center\n center(modal);\n}", "function popupCenter(url, width, height, name) {\n var left = (screen.width/2)-(width/2);\n var top = (screen.height/2)-(height/2);\n return window.open(url, name, \"menubar=no,toolbar=no,status=no,width=\"+width+\",height=\"+height+\",toolbar=no,left=\"+left+\",top=\"+top);\n}", "function centerPopup(popup){\n var windowWidth = document.documentElement.clientWidth;\n var windowHeight = document.documentElement.clientHeight;\n var popupHeight = jQuery(\"#\" + popup).height();\n var popupWidth = jQuery(\"#\" + popup).width();\n \n jQuery(\"#\" + popup).css({ //Look at adjusting popup positioning\n \"position\" : \"absolute\",\n \"bottom\" : windowHeight / 2 - popupHeight /2,\n \"right\" : windowWidth /2 - popupWidth /2,\n //\t\"top\" : \"0%\",\n//\t\"left\" : \"10%\"\n });\n}", "set TopCenter(value) {}", "function centerFancybox()\n {\n \tif (settings.centerFancybox && typeof $.fancybox === 'function' && typeof $.fancybox.center === 'function' && $('#fancybox-wrap').length && $('#fancybox-wrap').is(':visible')) {\n $.fancybox.center(settings.centerFancyboxSpeed);\n \t}\n }", "set Center(value) {}", "function displayModal() {\n\tmodalBox.style.display = 'block';\n\tmodalTrigger.style.display = 'none';\n\tif (modalContainer.offsetWidth >= 802) {\n\t\tconsole.log('hello this me offsetvalue');\n\t\tformSubmitBtn.style.display = 'none';\n\t\tcommentTab.style.display = 'none';\n\t\tquestionTab.style.display = 'none';\n\t}\n}", "function centralizar() {\r\n $(\".popup\").css(\"position\",\"absolute\");\r\n $(\".popup\").css(\"top\", Math.max(0, (($(window).height() - $(\".popup\").outerHeight()) / 2) + $(window).scrollTop()) + \"px\");\r\n $(\".popup\").css(\"left\", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + \"px\");\r\n\r\n}", "function centerVertically() {\n\t\tjQuery('.formOverlay').css({\n\t\t\t'top' : '50%',\n\t\t\t'margin-top' : -jQuery('.formOverlay').height()/2\n\t\t});\n\t}", "set center(value) {}", "function moveEditModal(){\n if($(\".edit\").length != 0){\n var top_of_window = $(window).scrollTop();\n var bottom_of_edit = $(\".edit\").offset().top + $(\".edit\").outerHeight() - 0;\n if($( window ).width() < 990){\n var left_of_edit = $(\".edit\").offset().left - 260;\n }\n else{\n var left_of_edit = $(\".edit\").offset().left - 150;\n }\n\n $(\"#edit-carpeta .modal-body\").css('top', bottom_of_edit - top_of_window);\n $(\"#edit-carpeta .modal-body\").css('left', left_of_edit);\n }\n }", "alignCenter() {\n this.setAnchor(0.5);\n this.setStyle({ textAlign: 'center' });\n }", "function centerSlideWhenZoomedIn() {\n $('.active').css({\n \"top\": ($(window).height() - $('.active').outerHeight()) / 2,\n \"left\": calculateEdgeWidth()\n });\n }", "function centerVertically() {\n\n\tjQuery('.formOverlay').css({\n\t\t'top' : '50%',\n\t\t'margin-top' : -jQuery('.formOverlay').height()/2\n\t});\n}", "function modal_resize() {\n\n $('.modal').each(function(index, value) {\n\n if($(this).hasClass('fade') && !$(this).hasClass('in')) {\n\n $(this).css({\n\n display: 'block'\n\n });\n\n }\n\n var modal_content = $(this).find('.modal-content');\n var modal_content_inner = $(this).find('.modal-content-inner');\n\n var window_height = $(window).height();\n var modal_content_height = modal_content.height();\n var modal_content_inner_height = modal_content_inner.outerHeight();\n var modal_horizontal_offset = $(this).css('left');\n var modal_margins = 12;\n\n if (modal_horizontal_offset > 0) {\n\n var modal_margins = modal_horizontal_offset;\n\n }\n\n if ((modal_content_inner_height + (2 * modal_margins)) > window_height) {\n\n modal_content.css({\n\n 'height' : window_height - (2 * modal_margins)\n\n });\n\n } else {\n\n modal_content.css({\n\n 'height' : modal_content_inner_height\n\n });\n\n }\n\n $(this).css({\n\n 'margin-top' : -1 * ($(this).outerHeight() / 2)\n\n });\n\n // Remove display:block for resizing calculations to avoid element covering screen\n\n if($(this).hasClass('fade') && !$(this).hasClass('in')) {\n\n $(this).css({\n\n display: 'none'\n\n });\n\n }\n\n });\n\n }", "function getModalStyle() {\n\tconst top = 50;\n\tconst left = 50;\n \n\treturn {\n\t top: `${top}%`,\n\t left: `${left}%`,\n\t transform: `translate(-${top}%, -${left}%)`,\n\t};\n }", "centerScreen() {\n self.moveCenter(0,0);\n }", "setCenter() {\n this.cx = this.x + this.width / 2;\n this.cy = this.y + this.height / 2;\n }", "function posCenterInCenter(d) { d.classList.add('centerCentered'); }", "function resetCenter()\n\t{\n\t\tvar script = [];\n\n\t\t// center to default position\n\t\tscript.push(_scriptGen.defaultCenter());\n\n\t\t// convert array to a single string\n\t\tscript = script.join(\" \");\n\n\t\t// send script string to the app\n\t\t_3dApp.script(script);\n\t}", "function openModal() {\n document.getElementById(\"myModal\").style.display = \"inline-grid\";\n document.getElementById(\"return-to-top\").style.display = \"none\"\n document.getElementById(\"return-to-top\").style.property=\"value\"\n }", "function editor_tools_handle_center() {\n editor_tools_add_tags('[center]', '[/center]');\n editor_tools_focus_textarea();\n}", "function showModal(selector) {\r\n\t\tvar modal = $(selector);\r\n\t\t$('#bgModal').show();\r\n\t\tmodal.show();\r\n\t\tcenterModal();\r\n\t}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n }", "function centerView() {\n ggbApplet.evalCommand('CenterView((0, 0))');\n }", "function openModal() {\r\n modalOverlay.style.display = \"flex\";\r\n}", "function modalAnimation() {}", "function getModalStyle() {\n\tconst top = 50;\n\tconst left = 50;\n\n\treturn {\n\t\ttop: `${top}%`,\n\t\tleft: `${left}%`,\n\t\ttransform: `translate(-${top}%, -${left}%)`\n\t};\n}", "set BottomCenter(value) {}", "function moveToCenter() {\n $._resetToCenter();\n}", "function setModal() {\n $('.overlay').fadeIn('slow');\n $('.modal').slideDown('slow');\n }", "function fixVerticalPosition() {\n var modal = getModal();\n\n modal.style.marginTop = getTopMargin(getModal());\n }", "function PSC_Layout_Center_CustomResize() {}", "function ui_popupCenter(str_url,str_winname,str_winparms){\n\tvar _screen_ht = screen.availHeight;\n\tvar _screen_wd = screen.availWidth;\n\tvar _win_ht = 480;\n\tvar _win_wd = 600;\n\tw_top = Math.round((_screen_ht - _win_ht)*0.5);\n\tw_left= Math.round((_screen_wd - _win_wd)*0.5);\n\tstr_winparms = ( ui_trim(str_winparms).length==0)?\"scrollbars=yes,resizable=yes,status=yes,location=no,menubar=no,toolbar=no,width=\" +_win_wd+ \",height=\" +_win_ht+ \",\":\"scrollbars=yes,resizable=yes,status=yes,location=no,menubar=no,toolbar=no,width=\" +_win_wd+ \",height=\" +_win_ht+ \",\" + str_winparms;\n\tstr_winparms += \"left=\" + w_left + \",top=\" + w_top;\n\t_win=window.open(str_url, str_winname, str_winparms);\n\t_win.focus();\n}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n position: 'relative',\n };\n}", "function setFullPosit(titulo, cuerpo) {\n var textoTitulo = document.getElementById(\"texto-titulo\");\n var textoCuerpo = document.getElementById(\"texto-cuerpo\");\n textoTitulo.innerText = titulo;\n textoCuerpo.innerText = cuerpo;\n //Mostramos el modal\n document.getElementById(\"modal-postit\").style.display = \"block\";\n}", "function shown_bs_modal( /*event*/ ) {\n //Focus on focus-element\n var $focusElement = $(this).find('.init_focus').last();\n if ($focusElement.length){\n document.activeElement.blur();\n $focusElement.focus();\n }\n }", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n}", "function getModalStyle() {\n const top = 50;\n const left = 50;\n\n return {\n top: `${top}%`,\n left: `${left}%`,\n transform: `translate(-${top}%, -${left}%)`,\n };\n}", "setCenteredMargin() {\n const firstWidth = this.firstPaneButtonsArea.current ? this.firstPaneButtonsArea.current.offsetWidth + 10 : 0;\n const lastWidth = this.lastPaneButtonsArea.current ? this.lastPaneButtonsArea.current.offsetWidth + 10 : 0;\n\n if (firstWidth || lastWidth) {\n this.setState({\n centerMargin: `0px ${firstWidth >= lastWidth ? firstWidth : lastWidth}px`,\n });\n }\n }", "center() {\n this.move(this.getWorkspaceCenter().neg());\n }", "function showModal () {\n $modal = $('<div class=\"modal-test\"><h1>Your result:</h1></div>');\n $overlay = $('<div class=\"modal-overlay\" title=\"Close results!\"></div>');\n $body.append($overlay);\n $body.append($modal);\n $modal.animate({ top: \"50%\" }, 800);\n }", "function openModal()\n{\n // console.log (\"123\");\n Modal.style.display = \"flex\";\n}", "_resizeCallback() {\n this.resizePreserveCenter()\n }", "function openModalImg(src, alt) {\n\n //Setando o tamanho da modal de acordo com os valores passados como parâmetros\n $('.modal').css(\"width\",'auto');\n $('.modal').css(\"height\",'auto');\n $('body').css(\"overflow\",\"hidden\");\n $('body').css(\"width\",\"100%\");\n $('body').css(\"height\",\"100vh\");\n $('body').css(\"position\",\"fixed\");\n\n $( \".container_modal\" ).fadeIn( 1000 );\n\n var img = '<img class=\"img-full-modal\" src = \"'+ src +'\" alt= \"'+ alt +'\">',\n btn ='<div class=\"btn-fechar-img-full-modal\" onclick=\"closeModal();\">&times;</div>';\n\n $( '.modal' ).html('<div>'+ btn + img +'</div>');\n\n\n}", "_resizeCallback () {\n this.resizePreserveCenter()\n }", "set Centered(value) {\n this._centered = value;\n }", "function popupCenter(url, title, w, h) {\n // Fixes dual-screen position Most browsers Firefox\n const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screen.left;\n const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screen.top;\n\n /* eslint-disable max-len, no-nested-ternary */\n const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : window.screen.width;\n const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : window.screen.height;\n /* eslint-enable max-len, no-nested-ternary */\n\n const left = ((width / 2) - (w / 2)) + dualScreenLeft;\n const top = ((height / 3) - (h / 3)) + dualScreenTop;\n\n return window.open(url, title, `scrollbars=yes, location=no, width=${w}, height=${h}, top=${top}, left=${left}`);\n}", "function center_window ( window ) {\n var screen = window.screen(),\n sFrame = window.screen().flippedFrame(),\n wFrame = window.frame ();\n\n window.setFrame ({\n x: sFrame.x + ( sFrame.width / 2 ) - ( wFrame.width / 2 ),\n y: ( sFrame.height / 2 ) - ( wFrame.height / 2 ),\n width: wFrame.width,\n height: wFrame.height\n });\n}", "function centralize(param){\n \t\t\tvar elementWidth, elementHeight;\n \t\t\tif(param == 'email'){\n\t \t\t\tvar elementHeight = 447;\n\t \t\t\tvar div = document.getElementById(\"writePop\");\n \t\t\t} else if(param == 'call'){\n \t\t\t\tvar elementHeight = 318;\n\t \t\t\tvar div = document.getElementById(\"callPop\");\n \t\t\t}\n \t\t\tvar totalWidth = window.innerWidth;\n\t \t\tvar totalHeight = window.innerHeight;\n\t\t \tvar elementWidth = 540;\n\t\t\tdiv.style.top = (totalHeight - elementHeight)/2 + \"px\";\n\t\t\tdiv.style.left = (totalWidth - elementWidth)/2 + \"px\";\n\t\t}", "function modalWindow() {\n $(\"#modal\").css('display', 'block');\n }", "function modalShown(o){\n\t\t/*\n\t\tif(o.template){\n\t\t\t//show spinner dialogue\n\t\t\t//render o.template into o.target here\n\t\t}\n\t\t*/\n\t\tsaveTabindex();\n\t\ttdc.Grd.Modal.isVisible=true;\n\t}", "function showModal() {\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t \tshowContractEndDateSelect();\n\t\t \tshowHidePassword();\n\t\t \tshowHideConfirmPassword();\n\t\t }", "function showModal() {\n\t\ttimer.className = 'modalTimer' ;\n\t\tmodal.className = 'modal-visible' ;\n\t}", "showModal(){\n if(document.getElementById('modal')){\n // console.log('found modal');\n document.getElementById('modal').style.display = 'block';\n document.getElementById('caption').style.display = 'block';\n document.getElementById('modal').style.zIndex = 10;\n }\n \n }", "function asignarCentroC() {\n $('#a_centrocmodal').modal({ backdrop: 'static', keyboard: false });\n $('#a_empleadosCentro').prop(\"disabled\", true);\n $('#a_todosEmpleados').prop(\"disabled\", true);\n listasDeCentro();\n}", "function btnSwitchModal(){\n if(containterDogs.children.length>0){\n btn_open_modal_header.style.display=\"block\";\n btn_open_modal_main.style.display=\"none\"; \n }else{\n btn_open_modal_header.style.display=\"none\";\n btn_open_modal_main.style.display=\"block\";\n btn_open_modal_main.style.margin= \"100px auto\";\n }\n}", "function CreatePost() {\n const [modalShow, setModalShow] = React.useState(false);\n\n return (\n <div>\n <div>\n <button className=\"write-button\" onClick={() => setModalShow(true)}>Write a post</button>\n <MyVerticallyCenteredModal\n show={modalShow}\n onHide={() => setModalShow(false)}\n />\n </div>\n </div>\n );\n}", "function PopupCenter(url, title, w, h) {\n // Fixes dual-screen position Most browsers Firefox\n var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;\n var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;\n\n var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;\n var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;\n\n var left = ((width / 2) - (w / 2)) + dualScreenLeft;\n var top = ((height / 2) - (h / 2)) + dualScreenTop;\n var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\n\n // Puts focus on the newWindow\n if (window.focus) {\n newWindow.focus();\n }\n}", "function centralize () {\n $(\"#main\").position({\n of: \"body\"\n });\n }", "function showModal() {\n props.setGlobalState({\n modal:\n {\n show: true,\n contents:\n <Box variant='tutorialModal' width=\"100%\" className=\"modal-content\">\n <Text variant='modalText'>{props.tutorialText}</Text>\n </Box>\n }\n })\n }", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "centerHandler(center) {\n this.setState({\n center: center\n });\n }", "function centerElement(element) {\n \n var windowW = $(window).width();\n var windowH = $(window).height();\n \n var elementW = $(element).width();\n var elementH = $(element).height();\n \n var centerW = $(window).width()/2 - $(element).width()/2;\n var centerH = $(window).height()/2 - $(element).height()/2;\n \n $(element).css(\"top\",centerH + \"px\");\n $(element).css(\"left\",centerW + \"px\");\n}", "showEditLinksModal(){\n $(\"#editLinksModal\").addClass(\"showModal\");\n $('body').css('position','fixed');\n $('body').css('overflow-y','scroll');\n }", "function closeModal33_openModal4()\n{\n modal3.style.display = \"none\";\n modal4.style.display = \"flex\";\n \n}", "function SuccessMC(props) {\n return (\n <>\n\n <Modal\n {...props}\n size=\"lg\"\n aria-labelledby=\"contained-modal-title-vcenter\"\n centered\n >\n <Modal.Header closeButton>\n\n <Modal.Title id=\"contained-modal-title-vcenter\">\n\n Subscribed!\n\n </Modal.Title>\n\n </Modal.Header>\n\n <Modal.Body className=\"sModal\">\n\n <h3> <i className=\"fas fa-thumbs-up fa-2x\"></i> </h3>\n\n <br/>\n \n <h3>\n\n You are now signed up for our dope monthly newsletter!\n\n </h3>\n\n </Modal.Body>\n\n <Modal.Footer>\n\n <Button onClick={props.onHide}>Close</Button>\n\n </Modal.Footer>\n\n </Modal>\n\n\n\n\n </>\n )\n}" ]
[ "0.7634573", "0.75718945", "0.75614905", "0.7467109", "0.72934854", "0.7237434", "0.72195196", "0.71343297", "0.6906135", "0.6774058", "0.6645346", "0.6619515", "0.6583715", "0.6579641", "0.65769255", "0.65513873", "0.6471437", "0.64542484", "0.6451589", "0.6449236", "0.64283484", "0.642428", "0.64003074", "0.63920903", "0.6350064", "0.6318161", "0.6299136", "0.62867486", "0.62789756", "0.6278783", "0.6235792", "0.6209091", "0.6203844", "0.6200624", "0.6194765", "0.61783206", "0.61495817", "0.6122371", "0.6116887", "0.6116272", "0.61024475", "0.6099953", "0.6095841", "0.6090484", "0.60848856", "0.6053972", "0.6039526", "0.60271376", "0.6005272", "0.5994309", "0.59926814", "0.59754777", "0.597344", "0.5968874", "0.59603393", "0.5950396", "0.59470457", "0.5938816", "0.59286106", "0.5897803", "0.58967286", "0.589551", "0.5885864", "0.5884304", "0.5875397", "0.58749944", "0.58749944", "0.58749944", "0.58749944", "0.58749944", "0.58749944", "0.58749944", "0.5874308", "0.5869563", "0.5867588", "0.5847371", "0.5845234", "0.5836665", "0.58344394", "0.5803937", "0.58016443", "0.5784203", "0.5771705", "0.5767835", "0.5766056", "0.57629484", "0.57586837", "0.5755447", "0.5753115", "0.5748211", "0.574486", "0.5742445", "0.574185", "0.5740851", "0.57333636", "0.5722627", "0.57130283", "0.571246", "0.5711526", "0.5698405" ]
0.80270875
0
Draw a transition between lastText and thisText. 'n' is the amount 0..1
function drawTime() { buf.clear(); buf.setColor(1); var d = new Date(); var da = d.toString().split(" "); var time = da[4]; buf.setFont("Vector",50); buf.setFontAlign(0,-1); buf.drawString(time,buf.getWidth()/2,0); buf.setFont("Vector",18); buf.setFontAlign(0,-1); var date = d.toString().substr(0,15); buf.drawString(date, buf.getWidth()/2, 70); flip(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuTextAnimation(number) {\n const tl = gsap.timeline();\n tl.to(\".the-food\", { opacity: 0, y: -15, duration: .3 })\n .to(\".the-food\", { y: 20 })\n .to(\".the-food\", { opacity: 1, y: 0, duration: .7 });\n\n setTimeout(() => generateMenuTxt(number), 500);\n\n return tl;\n}", "function StartTextAnimation(i) {\n typeWriterDelete(tagLine.html().length, function () {\n typeWriter(dataText[i], 0, function () {\n // after callback (and whole text has been animated), start next text\n StartTextAnimation((i + 1) % dataText.length);\n })\n });\n }", "function secondText() {\n firstText.style.transition = \"opacity 1.5s linear 0s\"\n let opacity = firstText.style.opacity = \"0\";\n setTimeout(replacingText, 1500)\n}", "function changeText(textContent)\n{\n textBox.style(\"opacity\", 0);\n textBox.text(textContent)\n .transition()\n .style(\"opacity\", 1)\n .duration(TRANSITION_DURATION);\n textBox.transition()\n .style(\"opacity\", 0)\n .duration(TRANSITION_DURATION)\n .delay(3000) // show text for 3 seconds\n .text(\"\");\n}", "function showNewText(text) {\n firstText.innerHTML = `${text}`;\n gsap.to(\".m402-text-relative\", {\n duration: 0.3,\n opacity: 1\n });\n}", "function showNewText(text) {\n firstText.innerHTML = `${text}`;\n gsap.to(\".m402-text-relative\", {\n duration: 0.3,\n opacity: 1\n });\n}", "function TextAnimation(pos, color, text) {\n this.pos = pos;\n this.color = color;\n this.text = text;\n this.value = 0;\n this.is_done = false;\n}", "function changeBottomText (newText, loc, delayDisappear, delayAppear) {\n\tmiddleTextBottom\n\t\t/*Current text disappear*/\n\t\t.transition().delay(700 * delayDisappear).duration(700)\n\t\t.attr('opacity', 0)\n\t\t/*New text appear*/\n\t\t.call(endall, function() {\n\t\t\tmiddleTextBottom.text(newText)\n\t\t\t.attr(\"y\", 24*loc + \"px\")\n\t\t\t.call(wrap, 350);\t\n\t\t})\n\t\t.transition().delay(700 * delayAppear).duration(700)\n\t\t.attr('opacity', 1);\n;}", "function changeBottomText (newText, loc, delayDisappear, delayAppear) {\n\tmiddleTextBottom\n\t\t/*Current text disappear*/\n\t\t.transition().delay(700 * delayDisappear).duration(700)\n\t\t.attr('opacity', 0)\n\t\t/*New text appear*/\n\t\t.call(endall, function() {\n\t\t\tmiddleTextBottom.text(newText)\n\t\t\t.attr(\"y\", 24*loc + \"px\")\n\t\t\t.call(wrap, 350);\t\n\t\t})\n\t\t.transition().delay(700 * delayAppear).duration(700)\n\t\t.attr('opacity', 1);\n;}", "function removeLastTspan()\r\n{\r\n\r\n TspanCnt--;\r\n var tspans = activeText.childNodes\r\n var tspanCnt = tspans.length\r\n var lastTspan = tspans.item(tspanCnt-2) //---last tspan before blinker---\r\n var currentTspan = tspans.item(tspanCnt-3)\r\n activeText.removeChild(lastTspan)\r\n\r\n currentTspan.setAttribute(\"id\", \"activeTspan\")\r\n\r\n ActiveTspan = d3.select(\"#activeTspan\")\r\n activeTspan = document.getElementById(\"activeTspan\")\r\n WriteText = activeTspan.textContent;\r\n addElemTextCw.drawTextWriteTextValue.value = WriteText\r\n\r\n}", "function UpdateText(ref, newText){\n // Default vals\n noStroke(0); fill(255); textSize(20); textAlign(LEFT);\n \n switch(ref){\n case (0): { text(newText, 500, 25); break;}\n case (2): { text(newText, 200, 25); break;}\n case (3): {textAlign(CENTER); text(newText, width/2, 640); break;}\n }\n\n }", "function finalOpacity() {\n firstText.style.transition = \"opacity 1.5s linear 0s\"\n let opacity = firstText.style.opacity = \"0\";\n setTimeout(finalText, 1500)\n}", "function animate_time (n, text, colon) {\n\t\tvar i = parseInt(text[0].textContent.split(\":\")[0]) - 1;\n\t\tvar inc = 500 / n;\n\n\t\tvar step = function () {\n\t\t\tif (i == n) return;\n\n\t\t\tvar ni = i + 1;\n\t\t\tif (ni <= 9) si = \"0\" + ni;\n\t\t\telse si = ni;\n\t\t\t\n\t\t\ttext[0].textContent = si;\n\t\t\tif (colon) text[0].textContent += \":\";\n\n\t\t\ti ++;\n\t\t\tsetTimeout(step, inc);\n\t\t};\n\n\t\tsetTimeout(step, 1);\n\t}", "function nextText() {\n document.getElementById(currOrder).remove();\n currOrder++;\n putText(curr.text, currOrder);\n currentRoom.removeEventListener(\"click\", nextText);\n }", "function drawLines(n){\n\t\t/** Traverses the text's length */\n\t\tfor (var i = 0; i < n.length; i++){\n\t\t\t/** Creates a space for each letter in the argument */\n\t\t\tlines.push(\"_\");\n\t\t}\n\t\t/** This is the product */\n\t\t\n\t\treturn lines.join(\"\");\n\t}", "function animatingText(){\t\n\t\tthis.isAnimating;\n\t\tthis.dom;\n\t}", "function onCreateText() {\n let elText = document.querySelector('.currText').value\n if (elText === '') return;\n createText()\n resetValues()\n draw()\n}", "function animateText(textArea, text, duaration){\n $(\"#next\").hide();\n textArea.value = \"\";\n var length = text.length;\n var index = 0;\n intervalId = window.setInterval(function(){\n if ( index >= length ){\n window.clearInterval(intervalId);\n $(\"#next\").show(); \n }\n textArea.value += text.charAt(index);\n index++;\n }, duaration);\n \n}", "function _text_anim( container ) {\n\t if ( $( \".text-fx\", container ).length) {\n\t $( \".text-fx\", container ).each( function() {\n\t if (! $( this ).hasClass( \"finished\" ) ) {\n\t $( this ).addClass( \"finished\" );\n\t var c = $( this ).html().replace( \"<br />\", \"~\" );\n\t var c = c.replace( \"<br>\", \"~\" );\n\t var e = c.split( \"\" );\n\t var b = \"\";\n\t var a;\n\t for (var d = 0; d < e.length; d++) {\n\t if (e[d] == \" \") {\n\t b += \" \";\n\t } else {\n\t if (e[d] == \"~\") {\n\t b += \"<br />\";\n\t } else {\n\t b += '<p><span class=\"trans-10\" style=\"-webkit-transition-delay: ' + (d / 32) + \"s; transition-delay: \" + (d / 32) + 's;\">' + e[d] + \"</span></p>\";\n\t }\n\t }\n\t }\n\t $( this ).html(b);\n\t }\n\t });\n\t }\n\t if ( $( \".text-fx-word\",container ).length) {\n\t $( \".text-fx-word\", container ).each( function() {\n\t if ( ! $( this ).hasClass( \"finished\" ) ) {\n\t $( this ).addClass( \"finished\" );\n\t var d = $( this ).html().split(\" \");\n\t var b = \"\";\n\t var a;\n\t for (var c = 0; c < d.length; c++) {\n\t if (d[c] == \" \") {\n\t b += \" \";\n\t } else {\n\t if (d[c] == \"<br>\" || d[c] == \"<br />\") {\n\t b += \"<br />\";\n\t } else {\n\t b += '<p><span class=\"trans-15\" style=\"-webkit-transition-delay: ' + (c / 14) + \"s; transition-delay: \" + (c / 14) + 's;\">' + d[c] + \"</span></p>\";\n\t }\n\t }\n\t }\n\t $( this ).html( b );\n\t }\n\t });\n\t }\n\t if ( $( \".text-fx-btn\", container ).length) {\n\t $( \".text-fx-btn .text-fx-btn-x\", container ).each( function() {\n\t if ( ! $( this ).hasClass( \"finished\" ) ) {\n\t $( this ).addClass( \"finished\" );\n\t var c = $( this ).html().replace(\"<br />\", \"~\");\n\t var c = c.replace(\"<br>\", \"~\");\n\t var e = c.split(\"\");\n\t var b = \"\";\n\t var a;\n\t for (var d = 0; d < e.length; d++) {\n\t if (e[d] == \" \") {\n\t b += \" \";\n\t } else {\n\t if (e[d] == \"~\") {\n\t b += \"<br />\";\n\t } else {\n\t b += '<p><span class=\"trans-12\" style=\"-webkit-transition-delay: ' + (d / 45) + \"s; transition-delay: \" + (d / 45) + 's;\">' + e[d] + \"</span></p>\";\n\t }\n\t }\n\t }\n\t $( this ).html( b );\n\t }\n\t });\n\t }\n\t}", "function createText() {\n gTxtCount++;\n gMeme.txts.push(\n {\n id: gTxtCount,\n text: '',\n size: 40,\n align: 'left',\n color: '#ffffff',\n stroke: '#000000',\n strokeSize: 1,\n x: 10,\n y: 50\n }\n );\n}", "_setTextNatively(callbackType, num) {\n return () => {\n this._updateAnimation(this.anchors[num].position);\n this._callbackText.setNativeProps({ \"text\": \"Callback: \" + \"index\" + num + \"| \" + this.anchors[num].position[0] + \",\" + this.anchors[num].position[1] + \",\" + this.anchors[num].position[2] })\n }\n }", "function changeTopText (newText, loc, delayDisappear, delayAppear, finalText, xloc, w) {\n\n\t/*If finalText is not provided, it is not the last text of the Draw step*/\n\tif(typeof(finalText)==='undefined') finalText = false;\n\t\n\tif(typeof(xloc)==='undefined') xloc = 0;\n\tif(typeof(w)==='undefined') w = 350;\n\t\n\tmiddleTextTop\t\n\t\t/*Current text disappear*/\n\t\t.transition().delay(700 * delayDisappear).duration(700)\n\t\t.attr('opacity', 0)\t\n\t\t/*New text appear*/\n\t\t.call(endall, function() {\n\t\t\tmiddleTextTop.text(newText)\n\t\t\t.attr(\"y\", -24*loc + \"px\")\n\t\t\t.attr(\"x\", xloc + \"px\")\n\t\t\t.call(wrap, w);\t\n\t\t})\n\t\t.transition().delay(700 * delayAppear).duration(700)\n\t\t.attr('opacity', 1)\n\t\t.call(endall, function() {\n\t\t\tif (finalText == true) {\n\t\t\t\td3.select(\"#clicker\")\n\t\t\t\t\t.text(buttonTexts[counter-2])\n\t\t\t\t\t.style(\"pointer-events\", \"auto\")\n\t\t\t\t\t.transition().duration(400)\n\t\t\t\t\t.style(\"border-color\", \"#363636\")\n\t\t\t\t\t.style(\"color\", \"#363636\");\n\t\t\t\t};\n\t\t});\n}", "function changeTopText (newText, loc, delayDisappear, delayAppear, finalText, xloc, w) {\n\n\t/*If finalText is not provided, it is not the last text of the Draw step*/\n\tif(typeof(finalText)==='undefined') finalText = false;\n\t\n\tif(typeof(xloc)==='undefined') xloc = 0;\n\tif(typeof(w)==='undefined') w = 350;\n\t\n\tmiddleTextTop\t\n\t\t/*Current text disappear*/\n\t\t.transition().delay(700 * delayDisappear).duration(700)\n\t\t.attr('opacity', 0)\t\n\t\t/*New text appear*/\n\t\t.call(endall, function() {\n\t\t\tmiddleTextTop.text(newText)\n\t\t\t.attr(\"y\", -24*loc + \"px\")\n\t\t\t.attr(\"x\", xloc + \"px\")\n\t\t\t.call(wrap, w);\t\n\t\t})\n\t\t.transition().delay(700 * delayAppear).duration(700)\n\t\t.attr('opacity', 1)\n\t\t.call(endall, function() {\n\t\t\tif (finalText == true) {\n\t\t\t\td3.select(\"#clicker\")\n\t\t\t\t\t.text(buttonTexts[counter-2])\n\t\t\t\t\t.style(\"pointer-events\", \"auto\")\n\t\t\t\t\t.transition().duration(400)\n\t\t\t\t\t.style(\"border-color\", \"#363636\")\n\t\t\t\t\t.style(\"color\", \"#363636\");\n\t\t\t\t};\n\t\t});\n}", "function goToNextText(slideOutText, slideInText) {\n\n var tl = new TimelineLite();\n\n if (slideInText.length !== 0) {\n\n tl\n .set(slideInText, { y: '50px', autoAlpha: 0, className: '+=active' })\n .set(slideOutText, { className: '-=active' })\n .to(slideInText, 1, { y: '-=50px', autoAlpha: 1 }, 1)\n .to(slideOutText, 1, { y: '-50px', autoAlpha: 0 }, 0.5);\n };\n }", "function type_writer_effect_name(text, n) {\n\tif (n < (text.length)) {\n\t\t$('#name_area').html(text.substring(0, n+1));\n\t\tn++;\n\t\tsetTimeout(function() {type_writer_effect_name(text, n)}, 50);\n\t}\n}", "function stateAnimation(delta) {\n [koiText, endText].forEach(el => {\n if (el.visible === true && !textRunFinished) {\n if (el.x < 120) {\n el.x += el.speed * delta;\n } else {\n el.speed = 0;\n el.x = 120;\n textRunFinished = true;\n }\n }\n });\n}", "function animateText() {\n finish.play();\n var x = Math.floor(Math.random() * 11 + 1);\n var supportText = [\n \"Wunderbar\",\n `Go, ${currPlayer}`,\n \"Super\",\n \"Great\",\n \"Amazing\",\n \"You rock\",\n \"Crazy\",\n \"Insane\",\n `Wow, ${currPlayer}`,\n \"Outstanding\",\n \"Unbelievable\",\n `wtf, ${currPlayer}`\n ];\n $(\".gogoText\")\n .html(supportText[x])\n .addClass(\"animate\");\n setTimeout(() => {\n $(\".gogoText\").removeClass(\"animate\");\n }, 1000);\n }", "showNext () {\n this.currentStepIndex++\n\n const currentStep = this.dialogSteps[this.currentStepIndex]\n\n const stepText = currentStep.text\n\n // initial text to create array of strings\n const initialText = this.game.make.text(this.x + 55, this.dialogHeight, stepText, {\n font: '18px Arial',\n fill: '#16bee7',\n wordWrap: true,\n wordWrapWidth: 325\n })\n\n // making the array to print\n const strings = initialText.precalculateWordWrap(stepText)\n const parsedStrings = Parser.parse(stepText, strings.map(s => s.trim()), currentStep.highlight)\n\n // adding strings one by one\n parsedStrings.forEach((string, index) => {\n let dx = 0\n if (string.left) {\n const textColor = '#16bee7'\n const leftText = this.game.make.text(this.x + 55, this.dialogHeight, string.left, {\n font: '18px Arial',\n fill: textColor\n })\n this.scroller.addChild(leftText)\n dx = leftText.getBounds().width\n }\n\n // highlighed part of the string\n if (string.middle) {\n const highlightedText = this.game.make.text(this.x + 55 + dx, this.dialogHeight, string.middle, {\n font: '18px Arial',\n fill: '#16bee7',\n backgroundColor: '#185965'\n })\n highlightedText.inputEnabled = true\n highlightedText.stepNumber = this.currentStepIndex\n\n highlightedText.events.onInputUp.add(() => {\n if (!this.isDragReleased[highlightedText.stepNumber]) {\n this.createDragText(highlightedText)\n }\n })\n highlightedText.events.onInputDown.add(() => {\n console.log('Input Down Detected')\n })\n highlightedText.events.onInputOver.add(() => {\n console.log('Input Over Detected')\n })\n highlightedText.events.onInputOut.add(() => {\n console.log('Input Out Detected')\n })\n this.scroller.addChild(highlightedText)\n dx += highlightedText.getBounds().width\n }\n\n // the rest of the string\n if (string.right) {\n const rightText = this.game.make.text(this.x + 55 + dx, this.dialogHeight, string.right, {\n font: '18px Arial',\n fill: '#16bee7'\n })\n this.scroller.addChild(rightText)\n }\n\n // adding string height to current dialog height\n // less space leads to highlight overlaps and double event firing\n this.dialogHeight += 26\n })\n\n // adding space after the phrase\n this.dialogHeight += 20\n\n // scrolling down to the bottom\n if (this.dialogHeight > 280) {\n this.scroller.scrollTo(0, this.y - this.dialogHeight + 318, 350)\n setTimeout(() => {\n this.recalculateScrollTick()\n }, 395) // a little timeout, because tick should be positioned when scroll completes\n }\n }", "function yTextRefresh() {\r\n\tyText.attr(\r\n\t\"transform\",\r\n\t\"translate(\" + leftTextX + \", \" + leftTextY + \")rotate(-90)\"\r\n\t);\r\n}", "createWords(counter) {\n var a = ['Your', 'health', 'will', 'one', 'day', 'disappear', 'and', 'you', 'will', 'die', 'without', 'meaning'];\n var b = ['There', 'are', 'many', 'men', 'and', 'women', 'who', 'dream', 'of', 'making', 'love', 'to', 'you', 'but', 'you', 'will', 'never', 'get', 'to', 'know', 'them'];\n noStroke();\n textSize (16);\n// below lines modified by code master Finn\n for (var i = 0; i < a.length; i++) {\n fill('rgba(255,255,255,1)');\n text(a[counter], this.x + mouseX/30, this.y);\n fill('rgba(255,255,255,0.1)');\n text(b[counter], this.x + mouseX/70 + 50, this.y+50);\n }\n }", "function tick() {\n if (index < 0 || index >= words.length) return;\n var item = words[index++];\n var x = 5 + Math.random() * 900;\n var y = 110 + Math.random() * 640;\n var brush = canvas.getContext(\"2d\");\n brush.fillText(item, x, y);\n if (index >= words.length) clearInterval(timer);\n }", "function texting() {\n push();\n fill(21, 200, 0);\n textFont(\"IMPACT\");\n textStyle(ITALIC);\n stroke(182, 56, 204);\n strokeWeight(35);\n textSize(70);\n text(openingText, 25, 180);\n pop();\n\n fill(182, 56, 204);\n stroke(random(80), random(80), random(80));\n strokeWeight(10);\n rect(240, 430, 200, 80);\n\n push();\n fill(21, 200, 0);\n textFont(\"IMPACT\");\n textStyle(ITALIC);\n stroke(182, 56, 204);\n textSize(35);\n strokeWeight(5);\n text(start, 248, 485);\n pop();\n \n\n\n\n\n\n}", "function showNewWords(vis, i) {\n //i = i || 0;\n\n //vis.update(getWords(i ++ % words.length))\n\tvis.update(getWords());\n //setTimeout(function() { showNewWords(vis, i + 1)}, 2000)\n}", "function changeText(l) {\n var animateTxt = 0;\n var progressUpdates = [\n \"Checking your login details\",\n \"Loading your account information\",\n \"Fetching investment valuations\"\n ];\n var progressUpdatesLen = progressUpdates.length;\n var findProgressTxt = $(\".js-progresstext--string\");\n\n function frame() {\n animateTxt++\n\n findProgressTxt.text( progressUpdates[animateTxt-1] );\n if (animateTxt == progressUpdatesLen) {\n clearInterval(id);\n\n }\n };\n var id = setInterval(frame, l/progressUpdatesLen );\n}", "updateScreen() {\n var textList = [\"Congratulations!\",\n \"You have successfully completed: SPACESHIP PILOT EXAM: LEVEL 2.\",\n \"This earns you the rank of SPACESHIP NEWBIE and authorizes you to apply for the following positions: SPACE GARBAGE COLLECTOR.\",\n \"You may now attempt SPACESHIP PILOT EXAM: LEVEL 3.\",\n \"The next administration of this exam will take place in PLANET GGJ TESTING CENTER on JANUARY 25 2255.\",\n \"This test will consist of: MANUAL ENGINE FAILURE DIAGNOSIS with a time limit of 10 MINUTES and NO MANUAL OR SUPPLEMENTARY MATERIAL.\",\n \"Good luck!\"]\n var currentNumber = this.state.currentNumber;\n\n if(currentNumber < textList.length-1){\n currentNumber++;\n this.setState({\n text : textList[currentNumber],\n currentNumber : currentNumber\n });\n }\n }", "displayText(combatStage, index) {\n let paragraph = this.state.paragraph; \n let lines = this.state.lines;\n lines++;\n this.howManylines++;\n let key = \"line\"+this.howManylines;\n let string = \"\";\n let verbAgreement = \"\";\n\n if (lines > 5) {\n // scrollText() or\n paragraph.shift();\n lines--;\n }\n paragraph.push(<p></p>)\n \n switch(combatStage) {\n case \"start\": \n let subject = this.state.playerPhase ? \"You\" : \"The bandit\";\n verbAgreement = this.state.playerPhase ? \"\" : \"s\";\n string = `${subject} attack${verbAgreement}!`;\n break;\n case \"damage\":\n let verb = this.state.playerPhase ? \"inflicted\" : \"received\";\n let damage = this.state.playerPhase ? \n (this.state.player.attack - map[this.state.bandits[index].map[0]-1][this.state.bandits[index].map[1]-1].defense) : \n (this.state.bandits[index].attack - map[this.state.playerMap[0]-1][this.state.playerMap[1]-1].defense);\n string = `You ${verb} ${damage} damage!`;\n if (this.targetVillager) { string = `She receives ${damage} damage!`}\n break;\n case \"dead\":\n let target = this.state.playerPhase ? \"The bandit\" : \"You\";\n verbAgreement = this.state.playerPhase ? \"has\" : \"have\";\n let gameOver = this.state.playerPhase ? \"\" : \" Game over.\"\n string = `${target} ${verbAgreement} been defeated.${gameOver}`;\n if (this.targetVillager) { string = \"The villager has been killed.\" }\n break;\n case \"exp\":\n string = \"You have gained 10 experience.\";\n break;\n case \"next\":\n let toNext = this.expForLevel.find((element) => element >= this.state.player.exp) - this.state.player.exp;\n if (toNext === 0) {\n string = \"You have advanced to the next level.\"\n } else {\n string = `You need ${toNext} experience to advance.`;\n }\n break;\n case \"heal\":\n string = \"Your HP are restored to maximum.\"\n break;\n default:\n string = \"Something went wrong.\"\n break;\n };\n\n let t = 0;\n let framesPerTick = 2;\n const letterRoll = (timestamp) => {\n if (t <= string.length * framesPerTick) {\n if (t % framesPerTick === 0) {\n paragraph[lines-1] = <p key={key}>{string.substring(0, t/framesPerTick)}</p>;\n this.setState({ lines: lines, paragraph: paragraph });\n }\n t++;\n requestAnimationFrame(letterRoll);\n } else {\n if (combatStage === \"start\") {\n this.displayText(\"damage\", index);\n } else if (combatStage === \"dead\" && this.state.playerPhase) {\n this.displayText(\"exp\", index);\n } else if (combatStage === \"exp\") {\n this.displayText(\"next\");\n }\n }\n };\n\n requestAnimationFrame(letterRoll);\n }", "autowriterText() {\n // clear the interval of alternating text\n clearInterval(this.interval);\n this.counter = 0;\n this._interval = setInterval(() => {\n this.displayText += this.text.charAt(this.counter);\n this.counter++;\n // to display alternating text\n if (this.counter === this.text.length) {\n this.alternatingWriterText();\n }\n }, this.speed);\n }", "function putText(className, idName, text_x, text_y, rotation, num){\n\t\t\tsvg.append(\"text\")\n\t\t\t\t.attr(\"id\", idName)\n\t\t\t\t.attr(\"class\", className)\n\t\t\t\t.attr(\"x\", text_x)\n\t\t\t\t.attr(\"y\", text_y)\n\t\t\t\t.text(num)\n\t\t\t\t.attr(\"transform\", \"rotate(\" + rotation + \" \" + text_x + \",\" + text_y + \")\")\n\t\t\t\t.attr(\"opacity\", 0)\n\t\t\t\t.transition()\n\t\t\t\t.duration(inTransLength)\n\t\t\t\t.attr(\"opacity\", 1);\n\t}", "alternatingWriterText() {\n // clear the interval of autowriter text\n clearInterval(this._interval);\n let counter2 = this.text.length;\n this.interval = setInterval(() => {\n counter2--;\n this._count = counter2;\n this.displayText = this.displayText.substring(0, this._count);\n if (this._count === -1) {\n this.assignPlaceholderText();\n }\n }, this.speed);\n }", "function() { game.time.events.add(Phaser.Timer.SECOND, createText, this); }", "function StartTextAnimation(i) {\r\n if (typeof dataText[i] == 'undefined'){\r\n setTimeout(function() {\r\n StartTextAnimation(0);\r\n }, 20000);\r\n }\r\n // check if dataText[i] exists\r\n if (i < dataText[i].length) {\r\n // text exists! start typewriter animation\r\n typeWriter(dataText[i], 0, function(){\r\n // after callback (and whole text has been animated), start next text\r\n StartTextAnimation(i + 1);\r\n });\r\n }\r\n }", "function animate_string(id) \n{\n var element = document.getElementById(\"#target\");\n var textNode = element.childNodes[0]; // assuming no other children\n var text = textNode.data;\n\nsetInterval(function () \n{\n text = text[text.length - 1] + text.substring(0, text.length - 1);\n textNode.data = text;\n}, 100);\n}", "function StartTextAnimation(i) {\n if (typeof dataText[i] == 'undefined'){\n setTimeout(function() {\n StartTextAnimation(0);\n }, 20000);\n }\n // check if dataText[i] exists\n if (i < dataText.length) {\n // text exists! start typewriter animation\n typeWriter(dataText[i], 0, function(){\n // after callback (and whole text has been animated), start next text\n StartTextAnimation(i + 1);\n });\n }\n }", "function stepAndDraw(n, stepTimeMs) {\n var wordHistory = [];\n\n var steps = 0;\n function step(time) {\n for (var i = 0; i < plants.length; i++) {\n plants[i].step();\n }\n\n wordHistory.push(plants.map(function(p) { return p.getWord(); }));\n\n if (++steps < n) {\n setTimeout(step, 0.0);\n }\n }\n\n var start;\n function draw(time) {\n // If we have words to draw, and either\n // this is the first frame or enough time\n // has elapsed since the last frame, DRAW\n if (wordHistory.length && (!start || (time - start) >= stepTimeMs)) {\n var words = wordHistory.shift();\n for (var i = 0; i < plants.length; i++) {\n plants[i].draw(words[i]);\n }\n\n start = time;\n }\n\n requestAnimationFrame(draw)\n }\n\n setTimeout(step, 0.0);\n requestAnimationFrame(draw);\n}", "function PBWindowAnimationDisplayText() {\n this.initialize.apply(this, arguments);\n}", "function StartTextAnimation(i) {\n if (typeof dataText[i] === 'undefined'){\n setTimeout(function() {\n StartTextAnimation(0);\n }, 20000);\n }\n // check if dataText[i] exists\n if (i <= dataText[i].length) {\n // text exists! start typewriter animation\n typeWriter(dataText[i], 0, function(){\n // after callback (and whole text has been animated), start next text\n StartTextAnimation(i + 1);\n });\n }\n }", "function draw() {\n drawText();\n}", "CreateTextDeath() {\n this.text = this.scene.add.text(this.x, this.y - this.height, 'Oh...Una lectura nueva?!').setFont('32px Arial Black').setFill('#ffffff').setShadow(2, 2, \"#333333\", 2).setDepth(20);\n this.text.setAlpha(0);\n\n this.text.on('pointerover', () => { this.text.setFill('#cb2821'); });\n this.text.on('pointerout', () => { this.text.setFill('#ffffff'); });\n this.text.on('pointerdown', () => { this.scene.scene.start(this.scene.scene.key); });\n}", "function drawText(text, x, y) {\n context.fillStyle = '#000';\n context.fillText(text, x-1, y-1);\n context.fillText(text, x+1, y+1);\n context.fillText(text, x+1, y-1);\n context.fillText(text, x-1, y+1);\n context.fillStyle = '#fff';\n context.fillText(text, x, y);\n}", "function onTextUp(txt) {\n textUp(txt)\n draw()\n}", "function placeText() {\n const name = type.value();\n placeText.html('hello ' + name + '!');\n this.c = color(random(255), random(255), random(255));\n type.value('');\n//number of text\n for (let i = 0; i < 150; i++) {\n push();\n fill(this.c);\n translate(random(1800), random(1500));\n text(name, 0, 0);\n pop();\n }\n}", "function updateCurrentText() {\n curEl.innerText = `${curActCd + 1}/${cardsEl.length}` \n}", "function text(x,y) {\n if(x>y) {arrowHelper(); return;}\n var speed = 750 + 7.5*($('#' + x).html().length);\n $('#' + x).fadeIn(speed, function() {text(++x,y);}).removeClass('hid');\n }", "function setText(t, x, y ){\n push();\n textSize(30);\n fill(200, 220, 60);\n stroke(100,110,213);\n strokeWeight(5);\n text(t, x, y);\n pop();\n}", "draw() {\n for (let i = 0; i < this.sentence.length; i++) {\n let current = this.sentence.charAt(i);\n\n if (current === \"F\" || current === \"f\") {\n if (p.random() < 0.9) {\n // All the designing happens here!\n let lineColor = p.lerpColor(\n p.color(this.colors[0]),\n p.color(this.colors[1]),\n i / this.sentence.length\n );\n lineColor.setAlpha(150);\n p.stroke(lineColor);\n //strokeWeight(3 + abs((sin((i+timer)/this.sentence.length*PI) * 15)))\n p.strokeWeight(this.branchValue + 1);\n p.line(0, 0, 0, -this.len);\n p.translate(0, -this.len);\n if (i / this.sentence.length > 0.95) {\n if (p.random() > 0.92) {\n flower();\n }\n } else if (this.branchValue < 3) {\n if (p.random() > 0.97) {\n flower();\n } else if (p.random() > 0.9) {\n spot();\n } else if (p.random() > 0.8) {\n p.circle(0, 0, 6, 6);\n }\n }\n }\n } else if (current === \"+\") {\n p.rotate(this.angle * parseInt(this.sentence.charAt(i + 1)));\n i++;\n } else if (current === \"-\") {\n p.rotate(-this.angle * parseInt(this.sentence.charAt(i + 1)));\n i++;\n } else if (current === \"[\") {\n this.branchValue -= 1;\n p.push();\n } else if (current === \"]\") {\n this.branchValue += 1;\n p.pop();\n }\n }\n }", "function StartTextAnimation(i) {\n if (typeof dataText[i] == 'undefined'){\n setTimeout(function() {\n StartTextAnimation(0);\n }, 50);\n }\n // Check if dataText[i] exists\n if (i < dataText[i].length) {\n // Text exists! start typewriter animation\n typeWriter(dataText[i], 0, function(){\n // After callback (and whole text has been animated), start next text\n StartTextAnimation(i + 1);\n });\n }\n }", "function StartTextAnimation(i) {\n if (typeof dataText[i] == \"undefined\") {\n setTimeout(function () {\n StartTextAnimation(0);\n }, 20000);\n }\n // check if dataText[i] exists\n if (i < dataText[i].length) {\n // text exists! start typewriter animation\n typeWriter(dataText[i], 0, function () {\n // after callback (and whole text has been animated), start next text\n StartTextAnimation(i + 1);\n });\n }\n }", "function animateText() {\n const coolText = document.querySelector(\"#cooltext\");\n let letterByLetter = Array.from(coolText.textContent);\n console.log(letterByLetter);\n coolText.innerHTML = \"\";\n letterByLetter.forEach((letter, index) => {\n const animateLetter = document.createElement(\"span\");\n animateLetter.classList.add(\"letter\", \"fade-in-bottom\");\n animateLetter.style.setProperty(\"--letter\", index);\n if (letter === \" \") {\n animateLetter.innerHTML = \"&nbsp;\";\n } else {\n animateLetter.textContent = letter;\n }\n coolText.append(animateLetter);\n });\n}", "function StartTextAnimation(i) {\n if (typeof dataText[i] == \"undefined\") {\n setTimeout(function () {\n StartTextAnimation(0);\n }, 20000);\n }\n if (dataText[i] == \"\") {\n showPhoto();\n }\n // check if dataText[i] exists\n if (i < dataText[i].length) {\n // text exists! start typewriter animation\n typeWriter(dataText[i], 0, function () {\n // after callback (and whole text has been animated), start next text\n StartTextAnimation(i + 1);\n });\n }\n }", "function startNewAnimation(v_el, v_text)\n{\n v_el.style.display = \"none\";\n setTimeout(()=>\n {\n if (v_text.length != 0)\n {\n v_el.textContent = v_text;\n }\n v_el.style.display = \"block\";\n }, 50);\n}", "function createText(theText, i) {\n textGeo = new THREE.TextGeometry( theText, {\n font: font,\n size: 80,\n height: 10,\n curveSegments:20,\n weight: \"normal\",\n bevelThickness:.2,\n bevelSize:1.5,\n bevelSegments:20,\n bevelEnabled:true\n });\n textGeo.computeBoundingBox();\n // textGeo.computeVertexNormals();\n var text = new THREE.Mesh(textGeo, textMaterial)\n\n text.position.x = (i *100);\n text.position.x -= window.innerWidth/7;\n\n text.position.x += Math.random(0, 100);\n HelloScene.add(text);\n textArray.push(text);\n }", "function instructionDisplay() {\r\n\t// update time\r\n\tlet d = new Date();\r\n\tlet timeElapsed = d.getTime() - n;\r\n\t\r\n\tif (timeElapsed < instructionDisplayTime) {\r\n\t\tinstructionText.alpha = 100;\r\n\t} else {\r\n\t\tinstructionText.alpha = 0;\r\n\t};\r\n}", "function showNewWords(vis, i) {\n i = i || 0;\n\n vis.update(getWords(i ++ % words.length))\n setTimeout(function() { showNewWords(vis, i + 1)}, 5000)\n}", "function StartTextAnimation(i) {\n if (typeof dataText[i] == 'undefined') {\n setTimeout(function () {\n StartTextAnimation(0);\n }, 20000);\n }\n // check if dataText[i] exists\n if (i < dataText[i].length) {\n // text exists! start typewriter animation\n typeWriter(dataText[i], 0, function () {\n // after callback (and whole text has been animated), start next text\n StartTextAnimation(i + 1);\n });\n }\n }", "function animateText() {\n\nlet animOutput = \"\";\nlet counterA = 0;\nlet counterB = 0;\n\nfunction animate () {\n \n let text = \"enigmemulator/\";\n counterA++;\n \n if (counterA < 65){\n animOutput+= text;\n graphicElement.innerText = animOutput;\n }\n else return;\n}\n \n\n\nfunction mess () {\n counterB++;\n if (counterB < 50 && animOutput.length > 500 ){\n animOutput = showCiphertext(animOutput);\n graphicElement.innerText = animOutput;\n }\nelse return;\n} \n\nsetInterval(animate, 25);\nsetInterval(mess, 50);\n}", "function explanationText(varText, delay, delayStep) {\n\td3.select(\"#explanation\")\n\t\t.transition().duration(1000).delay(delay*delayStep)\n\t\t.style(\"opacity\",0)\n\t\t.call(endall, function() {\n\t\t\t\td3.select(\"#explanation\")\n\t\t\t\t\t.html(varText);\t\n\t\t})\n\t\t.transition().duration(1000)\n\t\t.style(\"opacity\",1);\t\n}", "function renderEndGameText() {\n gameBackground.zIndex = 45;\n sortZindex(gameScreen);\n longBoard.visible = true;\n endText.visible = true;\n endText.speed = END_TEXT_SPEED;\n endGameSelected = true;\n}", "function handleText() {\n if (index < text.length) {\n id(\"output\").innerText = \"\";\n let curWord = text[index];\n id(\"output\").innerText = curWord;\n index++;\n } else {\n endGame();\n }\n }", "function draw() {\n\n noStroke();\n fill(255);\n var extraSpace = 0;//The words have its own length , so it needs to be offset to the right \n // i MEANS THE FIRST LETTER OF THE sentence \n\n for (let i = 0; i < words.length; i++) {\n // appearing over time...\n //note that canvas Is loading 60 times per second which means if the first letter is 1 then when francount reaches and goes beyond 1*100 the first word get pirnted \n\n if (frameCount > i * 100) {\n var wordMarginLeft = 30 * i; //The distance of each word is 30 // letters got print with the distance of 30 \n \n if (i > 0) {\n extraSpace = extraSpace + words[i - 1].length * 13; //we need to add extra space in letters and it's caculated by the length of the letters\n }\n fill(255);\n text(words[i], wordMarginLeft + extraSpace, 20);\n }\n }\n \n \n}", "function turnOnNodeText(nodeNumber){\r\n\tcount = 0;\r\n\tvar col = 'blue';\r\n\tvar termCol = 'red';\r\n\tvar rad = 10;\r\n\tvar x,y;\r\n\tvar name;\r\n\tvar dispName;\r\n\t\r\n\tvar nodes = new Array();\r\n\tfor(var j = 0; j < nodeId.length; j++) {\r\n\t\tnodes[j] = nodeId[j];\r\n\t}\r\n\t\r\n\tdispName = nodeId[nodeNumber];\r\n\t\r\n\treset();\r\n\t\r\n\tfor(var z = 0; z < myJSONObject.bindings.length; z++) {\r\n\t\tif(nodes.indexOf(myJSONObject.bindings[z]._wId)!=-1) {\r\n\t\t\tx = (myJSONObject.bindings[z]._x*XSCALAR)+XSHIFT;\r\n\t\t\ty = (myJSONObject.bindings[z]._y*YSCALAR)+YSHIFT;\r\n\t\t\t\r\n\t\t\tif(myJSONObject.bindings[z]._wId == dispName) {\r\n\t\t\t\tname = myJSONObject.bindings[z]._title;\r\n\t\t\t} else {\r\n\t\t\t\tname = \"\";\r\n\t\t\t}\r\n\t\t\tif(myJSONObject.bindings[z]._type == \"TERMINAL\") {\r\n\t\t\t\taddNode(x,y,rad,termCol,name);\r\n\t\t\t} else {\r\n\t\t\t\taddNode(x,y,rad,col,name);\r\n\t\t\t}\r\n\t\t\taddNodeInformation(count,z);\r\n\t\t\tcount++;\r\n\t\t}\r\n\t}\r\n\tdraw();\r\n}", "function StartTextAnimation(i) {\n\t if (typeof dataText[i] == 'undefined'){\n\t\t setTimeout(function() {\n\t\t\tStartTextAnimation(0);\n\t\t }, 1000); //delay for re-typing\n\t }\n\t // check if dataText[i] exists\n\t if (i < dataText[i].length) {\n\t\t// text exists! start typewriter animation\n\t typeWriter(dataText[i], 0, function(){\n\t\t // after callback (and whole text has been animated), start next text\n\t\t StartTextAnimation(i + 1);\n\t });\n\t }\n\t}", "function onTextDown(txt) {\n textDown(txt)\n draw()\n}", "function appendTextNode(layer, prefix, trainIndex, stopIndex, x, y, dy, align, text, colorType) {\n var textObj = d3.select(\"#\" + prefix + '_' + trainIndex + '_' + stopIndex+'_node');\n if (textObj[0][0] == null)\n layer.append(\"text\")\n .attr(\"id\", prefix + '_' + trainIndex + '_' + stopIndex+'_node')\n .text(text)\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"x-backup\", x)\n .attr(\"fill\", 'red')\n .style(\"opacity\", 1)\n .style(\"font-family\", \"Segoe UI\")\n .style(\"font-size\", 10)\n .style(\"font-weight\", 500)\n .attr(\"font-size\",10)\n // .style('font-color','red')\n .style(\"text-anchor\", align);\n // .style(\"alignment-baseline\", dy > 0 ? \"text-before-edge\" : \"text-after-edge\");\n else\n textObj\n .attr(\"id\", prefix + '_' + trainIndex + '_' + stopIndex+'_node')\n .text(text)\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"x-backup\", x)\n .attr(\"fill\", 'red')\n .attr(\"font-size\",10)\n .style(\"opacity\", 1)\n .style(\"font-family\", \"Segoe UI\")\n .style(\"font-size\", 10)\n .style(\"font-weight\", 500)\n .style(\"text-anchor\", align)\n .style(\"alignment-baseline\", dy > 0 ? \"text-before-edge\" : \"text-after-edge\");\n}", "function insertWords(){\n for(var i = 1; i <= fiveWords.length; i++){\n document.getElementById(\"myAnimation\" + i).innerHTML = fiveWords[i - 1];\n //fiveWords[i-1] = fiveWords[i-1].toUpperCase();\n }\n \n \n}", "function switchText(){\n\tif(Text_Index >= text.length){\n\t\tredirectPage();\n\t}\n\tif(Time_Index % 2 == 1) Time_Index = 11;\n\telse Time_Index = 10;\n document.getElementById(\"speechtext\").textContent = text[Text_Index];\n Text_Index += 1;\n document.getElementById(\"clicktocontinue\").style.visibility = \"hidden\";\n}", "function xTextRefresh() {\r\n\txText.attr(\r\n\t\t\"transform\",\r\n\t\t\"translate(\" +\r\n\t\t((width - labelArea) / 2 + labelArea) +\r\n\t\t\", \" +\r\n\t\t(height - margin - tPadBot) +\r\n\t\t\")\"\r\n\t);\r\n}", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "function StartTextAnimation(text,i, item) {\r\n if (typeof text[i] == 'undefined'){\r\n setTimeout(function() {\r\n StartTextAnimation(text,0, item);\r\n }, 20000);\r\n }\r\n // check if dataText[i] exists\r\n if (i < text.length) {\r\n // text exists! start typewriter animation\r\n typeWriter(text, 0, function(){\r\n // after callback (and whole text has been animated), start next text\r\n 1+1\r\n }, item);\r\n }\r\n }", "function startAnimation2() {\n\nconst text = document.querySelector(\".hero-text-two\");\nconst strText = text.textContent;\nconst splitText = strText.split(\"\");\ntext.textContent = \"\";\n\nfor (let i=0; i < splitText.length; i++) {\n text.innerHTML += \"<span>\" + splitText[i] + \"</span>\";\n}\n\nlet char = 0;\nlet timer = setInterval(onTick2, 150);\n\nfunction onTick2() {\n const span = text.querySelectorAll('span')[char];\n span.classList.add('fade');\n char++\n if (char === splitText.length) {\n complete();\n return;\n }\n}\n\nfunction complete() {\n clearInterval(timer);\n timer = null;\n }\n}", "function overNText(x) {\n x.style.backgroundColor = \"Red\";\n x.style.color = \"black\"; \n x.style.fontSize = \"30px\"\n}", "function showText(i) {\n Shiny.onInputChange('text_contents', el.data[i-1].longtext);\n }", "function startTextLine() {\n\tclearInterval(blankDelayTimer);\n\tif (currentLine < textLines.length - 1) {\n\t\tcurrentLine++;\n\t\tconsole.log(\"1 currentLine: \" + currentLine);\n\t\tconsole.log(\"1 textLines.length: \" + textLines.length);\n\t}\n\telse {\n\t\tconsole.log(\"2 currentLine: \" + currentLine);\n\t\tconsole.log(\"2 textLines.length: \" + textLines.length);\n\t\tcurrentLine = 0;\n\t}\n\n\tletterArray = splitLine(textLines[currentLine]);\n\tbuildLine = setInterval(function(){buildLineChar(); }, letterDelay);\n}", "function draw() {\n background(28, 22, 70);\n\n posX = 80;\n posY = 300;\n randomSeed(actRandomSeed);\n\n // iterate through all characters in the text and draw them\n for (var i = 0; i < joinedText.length; i++) {\n // find the index of the current letter in the character set\n var upperCaseChar = joinedText.charAt(i).toUpperCase();\n var index = charSet.indexOf(upperCaseChar);\n if (index < 0) continue;\n\n // calculate parameters for text image\n var charOpacity = 100;\n if (drawOpacity) {\n charOpacity = counters[index];\n }\n\n var my = map(mouseY, 50, height - 50, 0, 1);\n my = constrain(my, 0, 1);\n var charSize = counters[index] * my * 3;\n\n var mx = map(mouseX, 50, width - 50, 0, 1);\n mx = constrain(mx, 0, 1);\n var lineLength = charSize;\n var lineAngle = random(-PI, PI) * mx - HALF_PI;\n var newPosX = lineLength * cos(lineAngle);\n var newPosY = lineLength * sin(lineAngle);\n\n // draw elements\n push();\n translate(posX, posY);\n stroke(0, 137, 160, charOpacity);\n if (drawLines) {\n line(0, 0, newPosX, newPosY);\n }\n\n // draw elipse and text\n noStroke();\n fill(111, 90, 254, charOpacity * 4);\n if (drawEllipses) {\n ellipse(0, 0, charSize / 10, charSize / 10);\n }\n if (drawText) {\n fill(255, 255, 255, charOpacity * 5);\n text(joinedText.charAt(i), newPosX, newPosY);\n }\n pop();\n\n posX += textWidth(joinedText.charAt(i));\n if (posX >= width - 200 && upperCaseChar == \" \") {\n posY += int(tracking * my + 30);\n posX = 80;\n }\n }\n}", "function arcTweenText(a, i) {\r\n var oi = d3.interpolate({ x0: (a.x0s ? a.x0s : 0), x1: (a.x1s ? a.x1s : 0), y0: (a.y0s ? a.y0s : 0), y1: (a.y1s ? a.y1s : 0) }, a)\r\n\r\n function tween(t) {\r\n var b = oi(t)\r\n var ang = ((x((b.x0 + b.x1) / 2) - Math.PI / 2) / Math.PI * 180)\r\n\r\n b.textAngle = (ang > 90) ? 180 + ang : ang\r\n a.centroid = arc.centroid(b)\r\n\r\n return 'translate(' + arc.centroid(b) + ')rotate(' + b.textAngle + ')'\r\n }\r\n return tween\r\n}", "function enterGreet() {\n const enterGreet = new TimelineMax();\n\n enterGreet\n .fromTo(textLine1, 1, {y:'-=50', autoAlpha:0 },\n {y:0, autoAlpha:1, onComplete: startLoops})\n .fromTo(textLine2, 1, {y:'-=25', autoAlpha:0 },\n {y:0, autoAlpha:1}) \n .staggerFromTo(textGreeting, 0.5, {scale:2, autoAlpha:0, transformOrigin:'center center'},\n {scale:1, autoAlpha:1, transformOrigin:'center center'},0.1)\n\n function startLoops() {\n //start bg color loop\n const colors= ['#edcc93', '#f7e3ae', '#f3ebcc', '#edcc93'];\n const bgTimeline = new TimelineMax({repeat: -1, repeatDelay:2});\n\n bgTimeline\n .to(body, 3, {backgroundColor: colors[0]})\n .to(body, 3, {backgroundColor: colors[1]}, '+=2')\n .to(body, 3, {backgroundColor: colors[2]}, '+=2')\n .to(body, 3, {backgroundColor: colors[3]}, '+=2')\n\n ;\n\n\n //start falling leaves loop\n TweenMax.set(backFallingLeaves, {y:-100, autoAlpha:0.2});\n TweenMax.to(\"#brownLeaf\", 10+Math.random()*10, {y:'+=1200', autoAlpha:1, ease: Linear.easeNone, onComplete: repeatFall, onCompleteParams:['#brownLeaf']});\n TweenMax.to(\"#redLeaf\", 10+Math.random()*10, {y:'+=1200', autoAlpha:1, ease: Linear.easeNone, onComplete: repeatFall, onCompleteParams:['#redLeaf']});\n TweenMax.to(\"#orangeLeaf\", 10+Math.random()*10, {y:'+=1200', autoAlpha:1, ease: Linear.easeNone, onComplete: repeatFall, onCompleteParams:['#orangeLeaf']});\n\n function repeatFall(leafId) {\n let range = Math.random()*800,\n offset= 400,\n newX = range - offset; \n \n TweenMax.set(leafId, {x:newX, y:-100, autoAlpha:0.2, rotation: Math.random()*360});\n TweenMax.to(leafId, 10+Math.random()*10, {y:'+=1200', autoAlpha:1, ease: Linear.easeNone, onComplete: repeatFall, onCompleteParams:[leafId]});\n } \n } \n return enterGreet;\n }", "function textTween(d, i) {\n var a;\n if(oldPieData[i]){\n a = (oldPieData[i].startAngle + oldPieData[i].endAngle - Math.PI)/2;\n } else if (!(oldPieData[i]) && oldPieData[i-1]) {\n a = (oldPieData[i-1].startAngle + oldPieData[i-1].endAngle - Math.PI)/2;\n } else if(!(oldPieData[i-1]) && oldPieData.length > 0) {\n a = (oldPieData[oldPieData.length-1].startAngle + oldPieData[oldPieData.length-1].endAngle - Math.PI)/2;\n } else {\n a = 0;\n }\n var b = (d.startAngle + d.endAngle - Math.PI)/2;\n\n var fn = d3.interpolateNumber(a, b);\n return function(t) {\n var val = fn(t);\n return \"translate(\" + Math.cos(val) * (radius+textOffset) + \",\" + Math.sin(val) * (radius+textOffset) + \")\";\n };\n}", "function showText() {\n $(\"#textDisplay\").empty();\n $(\"#instructions\").empty();\n randomWords = [];\n for (var i = 0; i < wordCount; i++) {\n var ranWord = wordList[Math.floor(Math.random() * wordList.length)];\n if (wordList[wordList.length - 1] !== ranWord || wordList[wordList.length - 1] === undefined) {\n randomWords.push(ranWord);\n }\n }\n randomWords.forEach(function(word){\n $(\"#textDisplay\").append($(\"<span>\",{\"text\": word + \" \",\"class\":\"word\"}));\n });\n textDisplay.firstChild.classList.add(\"highlightedWord\")\n }", "function deathAnimation(ran, v2) {\n if (ran == 0) {\n v2.text = '💢'\n setTimeout(() => {\n v2.text = '🤬'\n setTimeout(() => {\n v2.text = '💢'\n setTimeout(() => {\n v2.text = '🤬'\n setTimeout(() => {\n v2.text = '💢'\n }, 100);\n }, 100);\n }, 100);\n }, 100);\n } else if (ran == 1) {\n v2.text = '🔅'\n setTimeout(() => {\n v2.text = '🔆'\n setTimeout(() => {\n v2.text = '🔅'\n setTimeout(() => {\n v2.text = '🔆'\n setTimeout(() => {\n v2.text = '🔅'\n }, 100);\n }, 100);\n }, 100);\n }, 100);\n } else if (ran == 2) {\n v2.text = '🔴'\n setTimeout(() => {\n v2.text = '🔶'\n setTimeout(() => {\n v2.text = '🔴'\n setTimeout(() => {\n v2.text = '🔶'\n setTimeout(() => {\n v2.text = '🔴'\n }, 100);\n }, 100);\n }, 100);\n }, 100);\n } else if (ran == 3) {\n v2.text = '⭕'\n setTimeout(() => {\n v2.text = '⛔'\n setTimeout(() => {\n v2.text = '⭕'\n setTimeout(() => {\n v2.text = '⛔'\n setTimeout(() => {\n v2.text = '⭕'\n }, 100);\n }, 100);\n }, 100);\n }, 100);\n } else {\n v2.text = '🖤'\n setTimeout(() => {\n v2.text = '💔'\n setTimeout(() => {\n v2.text = '🖤'\n setTimeout(() => {\n v2.text = '💔'\n setTimeout(() => {\n v2.text = '🖤'\n }, 100);\n }, 100);\n }, 100);\n }, 100);\n }\n}", "function reposText(x,y,num){\n x*=100; // Skalierung auf ganze Zahlen\n y*=100; // Skalierung auf ganze Zahlen\n if(num==1)t1left = (x+7.1)*2 // Position des oberen Textes anpassen (für Serverside Generierung)\n if(num==2)t3left = (x+7.1)*2 // Position des unteren Textes anpassen (für Serverside Generierung)\n //console.log(\"t1left:\"+t1left+\", t3left\"+t3left);\n if(num==1){ // tatsächliche Neupositionierung des oberen Textes auf dem Bild\n x -= 42;\n y -= 86;\n //console.log(x+\", \"+y)\n document.getElementsByClassName(\"MemeTextTop\")[0].style.left=(x*3.6)+100+\"px\";\n document.getElementsByClassName(\"MemeTextTop\")[0].style.top=-y-20+\"px\";\n }\n if(num==2){ // tatsächliche Neupositionierung des unteren Textes auf dem Bild\n x -=50;\n y -=22;\n //console.log(x+\", \"+y+\", 2\")\n document.getElementsByClassName(\"MemeTextBottom\")[0].style.left=(x*3.6)+100+\"px\";\n document.getElementsByClassName(\"MemeTextBottom\")[0].style.top=-(y*1.4)+235+\"px\";\n }\n}", "function updateText(text) {\n myTransition(text)\n .attr('fill', d => {\n const barColor = colorScale(d.colorIndex);\n return getTextColor(barColor);\n })\n .text(d => d.score)\n .attr('x', barWidth / 2) // center horizontally in bar\n .attr('y', d => TOP_PADDING + yScale(d.score) + 20); // just below top\n}", "finish() {\r\n let finish = this.FINISH_TEXT[Math.floor((Math.random() * this.FINISH_TEXT.length))];\r\n this.isActive = false;\r\n return '```' + finish + '```';\r\n }", "function countDown(parent, callback) {\n // These are all the text we want to display\n var texts = ['3', '2', '1', 'Fight!'];\n // This will store the paragraph we are currently displaying\n // Initiate an interval, but store it in a variable so we can remove it later.\n var interval = setInterval(count, 1000);\n\n // This is the function we will call every 1000 ms using setInterval\n function count() {\n if (paragraph) {\n // Remove the paragraph if there is one\n paragraph.remove();\n }\n if (texts.length === 0) {\n // If we ran out of text, use the callback to get started\n // Also, remove the interval\n // Also, return since we dont want this function to run anymore.\n clearInterval(interval);\n callback();\n return;\n }\n // Get the first item of the array out of the array.\n // Your array is now one item shorter.\n var text = texts.shift();\n\n // Create a paragraph to add to the DOM\n // This new paragraph will trigger an animation\n paragraph = document.createElement(\"p\");\n paragraph.textContent = text;\n paragraph.className = text + \" nums\";\n\n parent.appendChild(paragraph);\n }\n}", "function calltxt(callback) {\n var node = document.getElementById('text_animate'),\n textContent = node.textContent;\n // debugger;\n var i = 0;\n var txt = textContent;\n var speed = 150;\n // debugger;\n textanimate();\n\n function textanimate() {\n // debugger;\n if (i < txt.length) {\n // debugger;\n document.getElementById(\"display_txtct\").innerHTML += txt.charAt(i);\n i++;\n // debugger;\n setTimeout(textanimate, speed);\n\n if (i == txt.length) {\n if (callback() === 'function') // kiểm tra callback là function hay kh\n {\n return true;\n }\n }\n }\n\n }\n\n }", "function startAnimation1() {\n\nconst text = document.querySelector(\".hero-text\");\nconst strText = text.textContent;\nconst splitText = strText.split(\"\");\ntext.textContent = \"\";\n\nfor (let i=0; i < splitText.length; i++) {\n text.innerHTML += \"<span>\" + splitText[i] + \"</span>\";\n}\n\nlet char = 0;\nlet timer = setInterval(onTick, 150);\n\nfunction onTick() {\n const span = text.querySelectorAll('span')[char];\n span.classList.add('fade');\n char++\n if (char === splitText.length) {\n complete();\n return;\n }\n}\n\nfunction complete() {\n clearInterval(timer);\n timer = null;\n }\n}", "function textBuilding() {\n if (i < textFull.length) {\n i = i + 1;\n //Building the text on each itteration\n textBuild += (textFull.charAt(i));\n //Posting the current build into the page\n postMessage(textBuild);\n } else {\n w.terminate();\n w = undefined;\n }\n setTimeout(\"textBuilding()\", 250);\n}", "function slowSay(text, index) {\n if (index < text.length) {\n document.getElementById(\"serveranswer\").innerHTML += text[index++];\n setTimeout(function () { slowSay(text, index); }, 50);\n }\n else {\n listenerAttach();\n document.getElementsByClassName(\"blinking-cursor\")[0].innerHTML = \">\";\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"animated-text\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function update_text_display(){\n svg_element = document.getElementById('svg_container')\n var new_text = document.getElementById('animation_text_input').value;\n\n svg_text_element = document.getElementById('animation_text');\n document.getElementById('text_group').innerHTML = \"\"; //clear the text\n num_colours = colours.length //fixing this number to recreate the example on codepen\n\n var selected_font = document.getElementById('font_select').value;\n console.log('here');\n\n for (var colour_num = 0; colour_num < num_colours; colour_num++){\n var svg_text_element = document.createElementNS(svgns, \"text\"); //create an svg text element that the user's text will be put into\n document.getElementById('text_group').append(svg_text_element); \n svg_text_element.innerHTML = new_text;\n svg_text_element.setAttribute(\"class\", \"text--line text-copy \" + selected_font); //add css class \n }\n}", "function moves() {\n moveCount++;\n moveText.innerHTML = moveCount; \n}", "function printText(c, _a, t1, t2, mx, my, cb){\n var process = false;\n loopdis(0, _a);\n \n function loopdis(i, a) {\n if (i == a.length) { cb(); return; }\n var chars = a[i].split('');\n if(!process){\n drawText(0, chars, [mx, my + (i * 30)], \"\");\n i=i+1;\n }\n setTimeout(function () {\n loopdis(i, a);\n }, t1);\n }\n \n function drawText(i, a, p, _p) {\n process=true;\n c.font = \"16px Share Tech Mono\";\n if (i == a.length) {\n process=false;\n return;\n }\n c.fillText(a[i], p[0]+c.measureText(_p).width, p[1]);\n _p=_p+a[i];\n setTimeout(function () {\n drawText(i + 1, a, p, _p);\n }, t2);\n }\n}", "draw_txt(txt, x, y) {\n return () => {\n fill(255);\n textAlign(CENTER);\n text(txt, x, y);\n };\n }" ]
[ "0.6230856", "0.61950415", "0.6169872", "0.6046981", "0.5994182", "0.5994182", "0.5964189", "0.59541124", "0.59541124", "0.5947511", "0.5933266", "0.5924589", "0.5892589", "0.5891912", "0.5876727", "0.58725095", "0.58426225", "0.5838413", "0.58214813", "0.5814726", "0.5813893", "0.5809983", "0.5809983", "0.5797388", "0.57865405", "0.5752289", "0.5748631", "0.57360715", "0.5729254", "0.5722161", "0.5713773", "0.571364", "0.571161", "0.5710352", "0.56901604", "0.56818646", "0.56669444", "0.56636214", "0.56534904", "0.56365985", "0.56340855", "0.56216824", "0.5618223", "0.56134427", "0.5608274", "0.56081885", "0.56072336", "0.56004643", "0.5585921", "0.55844784", "0.55727196", "0.55646497", "0.55627555", "0.5562702", "0.5556902", "0.55494046", "0.5548815", "0.554838", "0.554481", "0.55421084", "0.5529963", "0.5526329", "0.55239445", "0.55200124", "0.5517202", "0.5514995", "0.5511966", "0.55051035", "0.5502563", "0.5495625", "0.5495276", "0.54895717", "0.54799527", "0.5473842", "0.5472327", "0.54709715", "0.54623204", "0.5459545", "0.54574585", "0.54540336", "0.54511625", "0.5439223", "0.5437593", "0.54303074", "0.5420905", "0.54200447", "0.5413409", "0.5405705", "0.5400579", "0.53954744", "0.5387879", "0.53719544", "0.5371187", "0.53688306", "0.5364638", "0.5360602", "0.5355446", "0.535378", "0.53482896", "0.53463495", "0.5328344" ]
0.0
-1
Clean up internal state so that the ModelGraftManipulator can be properly garbage collected.
dispose() { this[$port].removeEventListener('message', this[$messageEventHandler]); this[$port].close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_cleanUp() {\n this.removeChildren();\n\n // Remove references to the old shapes to ensure that they're rerendered\n this._q2Box = null;\n this._q3Box = null;\n this._medianLine = null;\n this._outerBorderShape = null;\n this._innerBorderShape = null;\n }", "finalizeState() {\n for (const model of this.getModels()) {\n model.delete();\n }\n const attributeManager = this.getAttributeManager();\n if (attributeManager) {\n attributeManager.finalize();\n }\n this.context.resourceManager.unsubscribe({consumerId: this.id});\n this.internalState.uniformTransitions.clear();\n this.internalState.finalize();\n }", "cleanup() {\n this.physicsEngine.cleanup(this.toClean);\n const gameInstance = this;\n this.toClean.forEach(function (name) {\n if (typeof gameInstance.objects[name] !== 'undefined') {\n delete gameInstance.objects[name];\n }\n });\n this.physicsEngine.cleanup(this.toClean);\n }", "function cleanUp() {\n if (grid) {\n grid.wazObservableGrid(\"destroy\");\n grid = null;\n }\n }", "__cleanUp() {\n // Data cursor cleanup\n if (this._dataCursor) {\n this.removeChild(this._dataCursor);\n this._dataCursor = null;\n }\n\n if (this.EventManager) {\n // Tooltip cleanup\n this.EventManager.hideHoverFeedback();\n\n // Event handler cleanup\n this.EventManager.setPanZoomHandler(null);\n this.EventManager.setMarqueeZoomHandler(null);\n this.EventManager.setMarqueeSelectHandler(null);\n\n // Drag button cleanup\n this.EventManager.panButton = null;\n this.EventManager.zoomButton = null;\n this.EventManager.selectButton = null;\n }\n\n // Remove pie center content\n if (this.pieCenterDiv) {\n this.getCtx().getContainer().removeChild(this.pieCenterDiv);\n this.pieCenterDiv = null;\n }\n\n // Clear the list of registered peers\n this.Peers = [];\n\n // Clear scrollbars, buttons\n this.xScrollbar = null;\n this.yScrollbar = null;\n\n if (this.dragButtons) {\n this.removeChild(this.dragButtons);\n this.dragButtons.destroy();\n this.dragButtons = null;\n }\n\n this._plotArea = null;\n this._areaContainer = null;\n this._dataLabels = null;\n\n // Reset cache\n this.getCache().clearCache();\n }", "function cleanUp() {\n setStore();\n historyStorage.init();\n }", "function cleanUp() {\n delete $scope.searchResultBundle;\n delete $scope.message;\n delete $scope.vs;\n delete $scope.queryUrl;\n delete $scope.queryError;\n }", "destroy () {\n\t\tthis.disposables.dispose()\n\t\tthis.classRanges.clear()\n\t\tthis.methodRanges.clear()\n\t\tthis.classMapping.clear()\n\t\tthis.methodMapping.clear()\n\t}", "destroy() {\n if (!this.initialised) {\n return;\n }\n\n // Remove all event listeners\n this._removeEventListeners();\n this.passedElement.reveal();\n this.containerOuter.revert(this.passedElement.element);\n\n // Clear data store\n this.clearStore();\n\n // Nullify instance-specific data\n this.config.templates = null;\n\n // Uninitialise\n this.initialised = false;\n }", "destroy() {\n removeAddedEvents();\n if (mc) {\n mc.destroy();\n }\n mc = null;\n instance = null;\n settings = null;\n }", "destroy() {\n this.personalInfoCollection = null;\n this.leucineAllowance = null;\n this.calorieGoal = null;\n }", "free() {\n libvosk.vosk_model_free(this.handle);\n }", "static cleanup() {\n Utils.clearSomeControlValueChanged(false);\n if (typeof Kiss !== 'undefined' && typeof Kiss.RadioButtons !== 'undefined')\n Kiss.RadioButtons.resetGroups();\n if (typeof AGGrid !== 'undefined') {\n AGGrid.popAllGridContexts();\n AGGrid.newGridContext(); // for the new screen we are loading\n }\n Utils.clearAllEnterContexts();\n Utils.newEnterContext();\n Utils.globalEnterHandler(null);\n Utils.popup_context = [];\n const ctl = $(':focus'); // remove any focus\n if (ctl)\n ctl.blur();\n }", "destroy() {\n this.impl.destroy();\n this.impl = null;\n this.format = null;\n this.defaultUniformBuffer = null;\n }", "cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "resetObjects()\n {\n //remove rectangles for collidable bodies\n this.buttons.forEach(this.deleteBody, this, true);\n this.spikes.forEach(this.deleteBody, this, true);\n\n this.startdoors.destroy();\n this.enddoors.destroy();\n this.buttons.destroy();\n this.spikes.destroy();\n this.checkpoints.destroy();\n this.doors.destroy();\n }", "shutdown() {\n\t\tthis.keyboard.destroyKeyboard();\n\n\t\tthis.categories = null;\n\t\tthis.sizes = null;\n\t\tthis.handed = null;\n\n\t\tthis.character = null;\n\t\tthis.characterPieces = null;\n\t\tthis.openColorWheel = null;\n\t\tthis.panelPosition = null;\n\t\tthis.textButtons = null;\n\t\tthis.customObject = null;\n\t\tthis.pieceSide = null;\n\t\tthis.objectAnimations = null;\n\t\tthis.stringObject = null;\n\t\tthis.loadedPieces = null;\n\t\tthis.types = null;\n\t\tthis.optionArrows = null;\n\t\tthis.lHand.destroy();\n\t\tthis.rHand.destroy();\n\t}", "function cleanup() {\n importedEntityIDs.forEach(function(id) {\n Entities.deleteEntity(id);\n });\n Camera.mode = \"first person\";\n Controller.disableMapping(\"Handheld-Cam-Space-Bar\");\n MyAvatar.skeletonModelURL = originalAvatar;\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "destroy() {\n for (var tileId in this._tiles) {\n if (this._tiles.hasOwnProperty(tileId)) {\n const tile = this._tiles[tileId];\n for (var i = 0, leni = tile.nodes.length; i < len; i++) {\n const node = tile.nodes[i];\n node._destroy();\n }\n putBatchingBuffer(tile.buffer);\n }\n }\n this.scene.camera.off(this._onCameraViewMatrix);\n for (var i = 0, len = this._layers.length; i < len; i++) {\n this._layers[i].destroy();\n }\n for (var i = 0, len = this._nodes.length; i < len; i++) {\n this._nodes[i]._destroy();\n }\n this.scene._aabbDirty = true;\n if (this._isModel) {\n this.scene._deregisterModel(this);\n }\n super.destroy();\n }", "_cleanup() {\n this.readable = false;\n delete this._current;\n delete this._waiting;\n this._openQueue.die();\n\n this._queue.forEach((data) => {\n data.cleanup();\n });\n this._queue = [];\n }", "cleanUp() {\n // clear activeEnemies\n this.activeEnemies.forEach(function(enemy) {\n enemy.cleanUp();\n });\n // clear active players\n this.activeObjects.forEach(function(object) {\n object.cleanUp();\n });\n // stop game loop\n this.animation.forEach(function(frame,index) {\n cancelAnimationFrame(frame);\n });\n }", "destroy()\n {\n this.removeAllListeners();\n if (this.parent)\n {\n this.parent.removeChild(this);\n }\n this.transform = null;\n\n this.parent = null;\n\n this._bounds = null;\n this._currentBounds = null;\n this._mask = null;\n\n this.filterArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n }", "clear() {\n this.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach(subDestroy => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n }", "destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n }", "destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n }", "_destroy() {\n\t this._source = null;\n\t this._offset = null;\n\t this._length = null;\n\t}", "destroy() {\n this._destroyed = true;\n\n if (typeof this.freeFromPool === 'function') {\n this.freeFromPool();\n }\n\n if (this.currentMap) {\n this.currentMap.removeObject(this);\n } else if (this.currentScene) {\n this.currentScene.removeObject(this);\n }\n\n this.children.forEach((child) => {\n child.destroy();\n });\n\n // triggers the wave end\n if (this.wave) {\n this.wave.remove(this);\n }\n }", "cleanUp() {\n this.log_.info('Clean up ...');\n this.events_.clear();\n }", "destroy() {\n this.removeAll();\n this.items = null;\n this._name = null;\n }", "destructor() {\n super.destructor()\n this.inputs.destroy()\n this.output.destroy()\n this.inputs = null\n this.output = null\n }", "__destroy() {\n this.__removeChildren();\n this.__remove();\n }", "clean() {\n this.removeItem(this.scene);\n }", "destroy() {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n }", "destroy() {\n this._output = null;\n this._number = null;\n this._octaveOffset = 0;\n this.removeListener();\n }", "destroy() {\n super.destroy();\n this.stencilMaskStack = null;\n }", "destroy() {\n this.viewer = undefined;\n this.value = undefined;\n this.allowLayout = undefined;\n this.isInitialLoad = undefined;\n this.fieldBegin = undefined;\n this.maxTextHeight = undefined;\n this.maxBaseline = undefined;\n this.maxTextBaseline = undefined;\n this.isFieldCode = undefined;\n }", "dispose() {\n\n if (this.popover) {\n this.popover.dispose()\n }\n\n this.$viewport.get(0).remove()\n\n // Null out all properties -- this should not be neccessary, but just in case there is a\n // reference to self somewhere we want to free memory.\n for (let key of Object.keys(this)) {\n this[key] = undefined\n }\n }", "wipe() {\n\t\tfor (node of this.nodes) {\n\t\t\tfor (let box of node.boxes) {\n\t\t\t\tbox.destruct()\n\t\t\t}\n\t\t}\n\t\tthis.nodes = new Set()\n\t}", "function destroy() {\n var keys = Object.keys(state);\n for (var i = 0; i < keys.length; i++) {\n state[keys[i]] = undefined;\n }\n for (var _i4 = 0; _i4 < listeners.length; _i4++) {\n listeners[_i4] = undefined;\n }\n }", "cleanup() {\n debug(\"cleanup\");\n const subsLength = this.subs.length;\n for (let i = 0; i < subsLength; i++) {\n const sub = this.subs.shift();\n sub.destroy();\n }\n this.decoder.destroy();\n }", "__$destroy() {\n if (this.isResFree()) {\n //console.log(\"MeshBase::__$destroy()... this.m_attachCount: \"+this.m_attachCount);\n this.m_ivs = null;\n this.m_bufDataList = null;\n this.m_bufDataStepList = null;\n this.m_bufStatusList = null;\n this.trisNumber = 0;\n this.m_transMatrix = null;\n }\n }", "destroy() {\n this._output = null;\n this._number = null;\n this._octaveOffset = 0;\n this.removeListener();\n }", "destroy () {\n this._cache = undefined;\n }", "destroy() {\n this.texture = null;\n this.matrix = null;\n }", "destroyInternal() {\n if (this.searchText) {\n this.searchText = undefined;\n }\n if (this.resultsText) {\n this.resultsText = undefined;\n }\n if (this.messageDivText) {\n this.messageDivText = undefined;\n }\n if (this.replaceButtonText) {\n this.replaceButtonText = undefined;\n }\n if (this.replaceAllButtonText) {\n this.replaceAllButtonText = undefined;\n }\n }", "destroy() {\n this.meshes.forEach(mesh => {\n mesh.destroy();\n });\n this.meshes.clear();\n this.lights.clear();\n this.__deleted = true;\n }", "function gravestone_cleanup() {\n for (var i = 0; i < env.b.children.length; i++) {\n if ((env.b.children[i].tagName == 'DIV') && (env.b.children[i]._type == \"gravestone\")) {\n env.b.removeChild(env.b.children[i]);\n// b.children[i].destroy()\n i--;\n }\n }\n}", "clear() {\n var models = this._models;\n this._models = [];\n\n for (var i = 0; i < models.length; i++) {\n var model = models[i];\n model.unloadRecord();\n }\n\n this._metadata = null;\n }", "function reset() {\n projectStage = null;\n separator = null;\n eventQueue = [];\n errorQueue = [];\n Implementation.requestQueue = null;\n }", "destroy() {\n super.destroy();\n this.destroyDependentModules();\n if (!isNullOrUndefined(this.viewer)) {\n this.viewer.destroy();\n }\n this.viewer = undefined;\n if (!isNullOrUndefined(this.element)) {\n this.element.classList.remove('e-documenteditor');\n this.element.innerHTML = '';\n }\n this.element = undefined;\n this.findResultsList = [];\n this.findResultsList = undefined;\n }", "destroy() {\n this._pipe && this._pipe.destroy();\n this._inbound && this._inbound.destroy();\n this._outbound && this._outbound.destroy();\n this._pipe = null;\n this._inbound = null;\n this._outbound = null;\n this._presets = null;\n this._context = null;\n this._proxyRequest = null;\n }", "gc() {\n // clear all arrays\n this.animation=null;\n this.keys=null;\n // clear variables\n this.generate=null;\n this.move=null;\n }", "destroy()\n {\n super.destroy();\n\n this.tileScale = null;\n this._tileScaleOffset = null;\n this.tilePosition = null;\n\n this._uvs = null;\n }", "destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n }", "clean() {\n this.clear();\n }", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n }", "free() {\n libvosk.vosk_spk_model_free(this.handle);\n }", "_clear() {\n\t\t\tthis._style = null;\n\t\t\tthis._color = null;\n\t\t\tthis._rgb = null;\n\t\t\tthis._hsl = null;\n\t\t\tthis._gradType = null;\n\t\t\tthis._gradParams = null;\n\t\t\tthis._gradColors = [];\n\t\t\tthis._gradBsCache = null;\n\t\t}", "function resetState(){\n Oclasses = {}; // known classes\n arrayOfClassVals = null; // cached array of class values\n arrayOfClassKeys = null; // cached array of class keys\n objectProperties = {}; // known object properties\n arrayOfObjectPropVals = null; // array of object property values\n arrayOfObjectPropKeys = null; // array of object property keys\n dataTypeProperties = {}; // known data properties\n arrayOfDataPropsVals = null; // array of data properties values\n\n classColorGetter = kiv.colorHelper();\n svg = null;\n zoomer = null;\n renderParams = null;\n mainRoot = null;\n panel = null;\n }", "cleanUp()\n {\n // Remove the contact listener\n this.physicsWorld.world.off( 'begin-contact', this.beginContact.bind(this) );\n this.physicsWorld.world.off( 'end-contact', this.endContact.bind(this) );\n this.physicsWorld.world.off( 'remove-fixture', this.removeFixture.bind(this) );\n \n unload();\n }", "_reset() {\n this.instance = null;\n }", "destroy() {\n this._input = null;\n this._number = null;\n this._octaveOffset = 0;\n this._nrpnBuffer = [];\n this.notesState = new Array(128).fill(false);\n this.parameterNumberEventsEnabled = false;\n this.removeListener();\n }", "teardown () {\n if (this.active) {\n // remove self from gm's watcher list\n // this is a somewhat expensive operation so we skip it\n // if the gm is being destroyed.\n if (!this.gm._isBeingDestroyed) {\n remove(this.gm._watchers, this)\n }\n let i = this.deps.length\n while (i--) {\n this.deps[i].removeSub(this)\n }\n this.active = false\n }\n }", "destroy() {\n this.rowsMapper.destroy();\n this.columnStatesManager.destroy();\n\n super.destroy();\n }", "destroy() {\n\t\tthis.runFinalReadReport()\n\t\tthis.stopObservation()\n\t\tthis.currentlyObservedElements = new Set()\n\t\tthis.visibleElements = new Set()\n\t}", "_clear() {\n\t\tthis._localPrimitivePropertiesAndTemplates = new Collection();\n\t\tthis._localVersionedTemplates = new Collection();\n\t\tthis._remoteScopedAndVersionedTemplates = new Collection();\n\t\tthis._inheritanceCache = {};\n\t\tthis._typedPropertyConstructorCache = {};\n\n\t\tthis._init();\n\t}", "dispose() {\n this._model = null;\n super.dispose();\n }", "function garbageCollect() {\n\t\t\t\t\t// Find correct modal\n\t\t\t\t\tvar modalIndex = findIndex(openModals, 'index', index);\n\n\t\t\t\t\t// Remove body class when modal is open\n\t\t\t\t\tif (openModals.length < 2) {\n\t\t\t\t\t\thtml.removeClass('modal-service--open');\n\t\t\t\t\t\thtml.removeClass('modal-service--next');\n\t\t\t\t\t}\n\n\t\t\t\t\t// Destroy scope\n\t\t\t\t\topenModals[modalIndex].scope.$destroy();\n\n\t\t\t\t\t// Remove event listener for window ESC key\n\t\t\t\t\tangular\n\t\t\t\t\t\t.element($window)\n\t\t\t\t\t\t.off('keydown', closeByEscape);\n\n\t\t\t\t\t$timeout(function() {\n\t\t\t\t\t\t//window.enableScrolling(true);\n\n\t\t\t\t\t\t// Cleanup element\n\t\t\t\t\t\topenModals[modalIndex].modalDomEl.remove();\n\n\t\t\t\t\t\t// Remove this modal from store\n\t\t\t\t\t\topenModals.splice(modalIndex, 1);\n\t\t\t\t\t}, 250);\n\t\t\t\t}", "function didCleanupTree(env, morph, destroySelf) {}", "destroy() {\n if (this.ticking) {\n Ticker_1.Ticker.system.remove(this.tick, this);\n }\n this.ticking = false;\n this.addHooks = null;\n this.uploadHooks = null;\n this.renderer = null;\n this.completes = null;\n this.queue = null;\n this.limiter = null;\n this.uploadHookHelper = null;\n }", "destroy()\n {\n this.div = null;\n\n for (let i = 0; i < this.children.length; i++)\n {\n this.children[i].div = null;\n }\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n }", "destroy() {\n window.removeEventListener('resize', this.handleWindowResize);\n this.freeAreaCollection.removeAllListeners();\n this.keepoutAreaCollection.removeAllListeners();\n this.canvasElement.removeEventListener('wheel', this.handleZoom);\n this.scope.project.remove();\n }", "function cleanUp() {\n $(\"audio\").remove();\n $(\"img\").remove();\n $(\"h2\").remove();\n audioTags = [];\n h2s = [];\n imgs = [];\n var curRow = 0;\n var curCol = 0;\n }", "onDestroy() {\n this.rotAnimations.forEach((anim) => {\n anim.complete();\n });\n if (this.timeouts[0]) clearTimeout(this.timeouts[0]);\n if (this.timeouts[1]) clearTimeout(this.timeouts[1]);\n this.rotatable1.destroy();\n this.rotatable2.destroy();\n if (this.followers[0]) this.followers[0].forEach((f) => f.destroy());\n if (this.followers[1]) this.followers[1].forEach((f) => f.destroy());\n this.followers = [];\n if ( this.paths[0]) this.paths[0].destroy();\n if ( this.paths[1]) this.paths[1].destroy();\n this.paths = [];\n this.toprg.destroy();\n this.botrg.destroy();\n if (this.emitters) {\n this.emitters.forEach((emitter) => {\n emitter.killAll();\n emitter.stop();\n });\n }\n\n }", "cleanup() {\n //TODO: Clear Until EOT effects\n this.endOfTurnEffects.forEach(effect => effect(this));\n this.endOfTurnEffects = [];\n\n //Cleanup all effects\n this.permanents.forEach(permanent => permanent.cleanup(true, false));\n }", "destroy() {\n this.destroyTouchHook();\n this.div = null;\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].div = null;\n }\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown);\n this.pool = null;\n this.children = null;\n this.renderer = null;\n }", "destroy() {\n super.destroy(); // xeokit.Object\n this._putDrawRenderers();\n this._putPickRenderers();\n this._putOcclusionRenderer();\n this.scene._renderer.putPickID(this._state.pickID); // TODO: somehow puch this down into xeokit framework?\n if (this._isObject) {\n this.scene._deregisterObject(this);\n if (this._visible) {\n this.scene._objectVisibilityUpdated(this, false);\n }\n if (this._xrayed) {\n this.scene._objectXRayedUpdated(this, false);\n }\n if (this._selected) {\n this.scene._objectSelectedUpdated(this, false);\n }\n if (this._highlighted) {\n this.scene._objectHighlightedUpdated(this, false);\n }\n }\n if (this._isModel) {\n this.scene._deregisterModel(this);\n }\n this.glRedraw();\n }", "destroy() {\n this.modalPanel.destroy();\n this.fields = null;\n this.classes = null;\n }", "destroy() {\n this._clearListeners();\n this._pending = [];\n this._target = undefined;\n }", "onremove() {\n // Slider and binder\n if(this.binder)\n this.binder.destroy();\n if(this.slider)\n this.slider.destroy();\n\n // Destroy classes & objects\n this.binder = this.slider = this.publication = this.series = this.ui = this.config = null;\n }", "async _impl_afterInit() {\n // Any cached snapshots are no longer valid.\n this._snapshots.clear();\n }", "async _impl_afterInit() {\n // Any cached snapshots are no longer valid.\n this._snapshots.clear();\n }", "destroy() {\n this.leftIndentIn = undefined;\n this.backgroundIn = undefined;\n this.leftIndentIn = undefined;\n this.leftMarginIn = undefined;\n this.rightMarginIn = undefined;\n this.topMarginIn = undefined;\n this.bottomMarginIn = undefined;\n this.cellSpacingIn = undefined;\n this.tableAlignmentIn = undefined;\n this.tableIn = undefined;\n this.selection = undefined;\n this.bidi = undefined;\n }", "reset() {\n\t\tvar objects = this._vptGData.vptBundle.objects;\n\t\twhile (objects.length !== 0) {\n\t\t\tvar object = objects.pop();\n\t\t\tobject.switchRenderModes(false);\n\t\t\tvar tex = object.material.maps[0];\n\t\t\tthis._glManager._textureManager.clearTexture(tex);\n\t\t\tif (object._volumeTexture)\n\t\t\t\tthis._gl.deleteTexture(object._volumeTexture);\n\t\t\tif (object._environmentTexture)\n\t\t\t\tthis._gl.deleteTexture(object._environmentTexture);\n\t\t}\n\t\tthis._vptGData.vptBundle.mccStatus = false;\n\t\tthis._vptGData.vptBundle.resetBuffers = true;\n\t\t//this._vptGData._updateUIsidebar();\n\t}", "function reset() {\n attachSource(null);\n attachView(null);\n protectionData = null;\n protectionController = null;\n }", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n }", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n }", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n }", "function reset() {\n setMediaElement(null);\n\n keySystem = undefined; //TODO-Refactor look at why undefined is needed for this. refactor\n\n if (protectionModel) {\n protectionModel.reset();\n protectionModel = null;\n }\n }", "destroy() {\n this._emiter.removeAllListeners();\n this._emiter = null;\n mEmitter.instance = null;\n }", "function reset() {\n let da = new VMN.DAPI();\n da.db.cleanDB();\n da.cleanLog();\n VMN.DashCore.cleanStack();\n}", "destroy() {\n this.leftIndentIn = undefined;\n this.rightIndentIn = undefined;\n this.beforeSpacingIn = undefined;\n this.afterSpacingIn = undefined;\n this.firstLineIndentIn = undefined;\n this.lineSpacingIn = undefined;\n this.textAlignmentIn = undefined;\n this.lineSpacingTypeIn = undefined;\n this.listId = undefined;\n this.listLevelNumberIn = undefined;\n this.viewer = undefined;\n this.selection = undefined;\n this.styleName = undefined;\n this.bidi = undefined;\n this.contextualSpacing = undefined;\n }", "static clearState() {\n delete state.marchingOrder;\n MarchingOrder.State.getState();\n }", "static clearState() {\n delete state.marchingOrder;\n MarchingOrder.State.getState();\n }", "function destroyStructure(){\n //reseting the `top` or `translate` properties to 0\n silentScroll(0);\n\n //loading all the lazy load content\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function(item){\n setSrc(item, 'src');\n });\n\n $('img[data-srcset]').forEach(function(item){\n setSrc(item, 'srcset');\n });\n\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL));\n\n //removing inline styles\n css($(SECTION_SEL), {\n 'height': '',\n 'background-color' : '',\n 'padding': ''\n });\n\n css($(SLIDE_SEL), {\n 'width': ''\n });\n\n css(container, {\n 'height': '',\n 'position': '',\n '-ms-touch-action': '',\n 'touch-action': ''\n });\n\n css($htmlBody, {\n 'overflow': '',\n 'height': ''\n });\n\n // remove .fp-enabled class\n removeClass($html, ENABLED);\n\n // remove .fp-responsive class\n removeClass($body, RESPONSIVE);\n\n // remove all of the .fp-viewing- classes\n $body.className.split(/\\s+/).forEach(function (className) {\n if (className.indexOf(VIEWING_PREFIX) === 0) {\n removeClass($body, className);\n }\n });\n\n //removing added classes\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function(item){\n if(options.scrollOverflowHandler && options.scrollOverflow){\n options.scrollOverflowHandler.remove(item);\n }\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\n var previousStyles = item.getAttribute('data-fp-styles');\n if(previousStyles){\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\n }\n\n //removing anchors if they were not set using the HTML markup\n if(hasClass(item, SECTION) && !g_initialAnchorsInDom){\n item.removeAttribute('data-anchor');\n }\n });\n\n //removing the applied transition from the fullpage wrapper\n removeAnimation(container);\n\n //Unwrapping content\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL,SLIDES_WRAPPER_SEL].forEach(function(selector){\n $(selector, container).forEach(function(item){\n //unwrap not being use in case there's no child element inside and its just text\n unwrap(item);\n });\n });\n\n //removing the applied transition from the fullpage wrapper\n css(container, {\n '-webkit-transition': 'none',\n 'transition': 'none'\n });\n\n //scrolling the page to the top with no animation\n window.scrollTo(0, 0);\n\n //removing selectors\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\n usedSelectors.forEach(function(item){\n removeClass($('.' + item), item);\n });\n }" ]
[ "0.7618479", "0.72212046", "0.7067358", "0.70518506", "0.6909618", "0.6836918", "0.6806037", "0.67846394", "0.6692608", "0.66730094", "0.6573591", "0.6553594", "0.65451866", "0.6543136", "0.65250385", "0.6522061", "0.65094006", "0.6503723", "0.6464137", "0.6464137", "0.6463448", "0.6437639", "0.6435219", "0.64329714", "0.6413181", "0.63815624", "0.6380036", "0.63741", "0.63741", "0.63741", "0.63649076", "0.6347382", "0.6343996", "0.6338744", "0.633358", "0.63287246", "0.6325194", "0.63212526", "0.63203365", "0.6313615", "0.63106334", "0.63057315", "0.6299885", "0.6298321", "0.6297519", "0.6295472", "0.6284537", "0.6269271", "0.6266866", "0.6260509", "0.6258936", "0.62312806", "0.623032", "0.62207526", "0.6216725", "0.6209191", "0.61985713", "0.61925626", "0.61907935", "0.6188736", "0.6177242", "0.61771935", "0.6173823", "0.61734295", "0.61708117", "0.61681354", "0.61654866", "0.61609304", "0.61597586", "0.6158024", "0.6151507", "0.6151497", "0.61454344", "0.61415267", "0.612876", "0.6127453", "0.61207795", "0.61191887", "0.6118313", "0.6103152", "0.61001337", "0.60962945", "0.60920036", "0.60890937", "0.6079164", "0.60774124", "0.607229", "0.607229", "0.6069123", "0.6064739", "0.6064283", "0.604198", "0.604198", "0.604198", "0.6036348", "0.6030164", "0.60295475", "0.6026041", "0.60207856", "0.60207856", "0.6020148" ]
0.0
-1
Evaluate an arbitrary chunk of script in the scene graph execution context. The script is guaranteed to be evaluated after the scene graph execution context is fully initialized. It is not guaranteed to be evaluated before or after a Model is made available in the scene graph execution context. Note that web browsers do not universally support module scripts ("ESM") in Workers, so for now all scripts must be valid nonmodule scripts.
async eval(scriptSource) { const port = await this[$workerInitializes]; const url = URL.createObjectURL(new Blob([scriptSource], { type: 'text/javascript' })); port.postMessage({ type: ThreeDOMMessageType.IMPORT_SCRIPT, url }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_eval() {\n if (this._alreadyStarted) {\n return;\n }\n\n // TODO: this text check doesn't seem completely the same as the spec, which e.g. will try to execute scripts with\n // child element nodes. Spec bug? https://github.com/whatwg/html/issues/3419\n if (!this.hasAttributeNS(null, \"src\") && this.text.length === 0) {\n return;\n }\n\n if (!this._attached) {\n return;\n }\n\n const scriptBlocksTypeString = this._getTypeString();\n const type = getType(scriptBlocksTypeString);\n\n if (type !== \"classic\") {\n // TODO: implement modules, and then change the check to `type === null`.\n return;\n }\n\n this._alreadyStarted = true;\n\n // TODO: implement nomodule here, **but only after we support modules**.\n\n // At this point we completely depart from the spec.\n\n if (this.hasAttributeNS(null, \"src\")) {\n this._fetchExternalScript();\n } else {\n this._fetchInternalScript();\n }\n }", "async evaluate(scripts) {\n scripts &&= [].concat(scripts);\n if (!scripts?.length) return;\n\n this.log.debug('Evaluate JavaScript', { ...this.meta, scripts });\n\n for (let script of scripts) {\n if (typeof script === 'string') {\n script = `async eval({ waitFor }) {\\n${script}\\n}`;\n }\n\n await this.eval(script);\n }\n }", "function runScripts(sceneNode)\n{\n var scripts = sceneNode.userData.scripts;\n if (scripts === undefined) return;\n\n for (var j=0; j<scripts.length; j++) {\n var s = scripts[j];\n var f = window[s]; // look up function by name\n if (f !== undefined) f(sceneNode);\n }\n}", "function evalScript(script) {\n var module = { exports: {} };\n var require = function require(path) {\n // eslint-disable-line no-unused-vars\n return modules.get(path);\n };\n // don't use Function() here since it changes source locations\n eval(script); // eslint-disable-line no-eval\n return module.exports;\n}", "function evalScript (content) {\n var script = document.createElement('script');\n\n document.head.appendChild(script);\n script.appendChild(document.createTextNode(content));\n\n return script;\n}", "function evalmJs(src) { eval(src); }", "function globalEval(js) {\n const node = document.createElement('script')\n const root = document.documentElement\n\n // make the source available in the \"(no domain)\" tab\n // of Chrome DevTools, with a .js extension\n node.text = js\n\n root.appendChild(node)\n root.removeChild(node)\n}", "Evaluate() {}", "function evaluate(script, obj, options) {\n var compiled = interpol(script, options);\n return compiled(obj, options);\n}", "evalJs(js) {\n // console.log('-----------------------evalJs');\n // console.log(js);\n this.go(`javascript: ${js};` + Math.random());\n }", "globalEval(code, nonce) {\n var _a, _b, _c;\n const head = (_b = (_a = document.getElementsByTagName(\"head\")) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : (_c = document.documentElement.getElementsByTagName(\"head\")) === null || _c === void 0 ? void 0 : _c[0];\n const script = document.createElement(\"script\");\n if (nonce) {\n if ('undefined' != typeof (script === null || script === void 0 ? void 0 : script.nonce)) {\n script.nonce = nonce;\n }\n else {\n script.setAttribute(\"nonce\", nonce);\n }\n }\n script.type = \"text/javascript\";\n script.innerHTML = code;\n let newScriptElement = head.appendChild(script);\n head.removeChild(newScriptElement);\n return this;\n }", "globalEval(code, nonce) {\n var _a, _b, _c;\n const head = (_b = (_a = document.getElementsByTagName(\"head\")) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : (_c = document.documentElement.getElementsByTagName(\"head\")) === null || _c === void 0 ? void 0 : _c[0];\n const script = document.createElement(\"script\");\n if (nonce) {\n if ('undefined' != typeof (script === null || script === void 0 ? void 0 : script.nonce)) {\n script.nonce = nonce;\n }\n else {\n script.setAttribute(\"nonce\", nonce);\n }\n }\n script.type = \"text/javascript\";\n script.innerHTML = code;\n let newScriptElement = head.appendChild(script);\n head.removeChild(newScriptElement);\n return this;\n }", "function Script() {}", "async function execute() {\n let init_content;\n if (initfile !== null) {\n init_content = await load_init_file(initfile);\n } else {\n init_content = \"\";\n }\n\n let editor_code = await editor.getValue();\n let script = start_script + init_content + editor_code + end_script;\n let resp = await run_code(script);\n\n fillOutput(resp);\n displayOrHideOutputs(resp);\n\n }", "function runUserJsAndGetRaw(data, code, ctx) {\n return __awaiter(this, void 0, void 0, function () {\n var sandbox, curLoop, context, result, temp, wrapper, script, err_1, e, nerr;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n sandbox = (0, timm_1.merge)(ctx.jsSandbox || {}, {\n __code__: code,\n __result__: undefined,\n }, data, ctx.options.additionalJsContext);\n curLoop = (0, reportUtils_1.getCurLoop)(ctx);\n if (curLoop)\n sandbox.$idx = curLoop.idx;\n Object.keys(ctx.vars).forEach(function (varName) {\n sandbox[\"$\".concat(varName)] = ctx.vars[varName];\n });\n _a.label = 1;\n case 1:\n _a.trys.push([1, 8, , 12]);\n if (!ctx.options.runJs) return [3 /*break*/, 3];\n temp = ctx.options.runJs({ sandbox: sandbox, ctx: ctx });\n context = temp.modifiedSandbox;\n return [4 /*yield*/, temp.result];\n case 2:\n result = _a.sent();\n return [3 /*break*/, 7];\n case 3:\n if (!ctx.options.noSandbox) return [3 /*break*/, 5];\n context = sandbox;\n wrapper = new Function('with(this) { return eval(__code__); }');\n return [4 /*yield*/, wrapper.call(context)];\n case 4:\n result = _a.sent();\n return [3 /*break*/, 7];\n case 5:\n script = new vm_1.default.Script(\"\\n __result__ = eval(__code__);\\n \", {});\n context = vm_1.default.createContext(sandbox);\n script.runInContext(context);\n return [4 /*yield*/, context.__result__];\n case 6:\n result = _a.sent();\n _a.label = 7;\n case 7: return [3 /*break*/, 12];\n case 8:\n err_1 = _a.sent();\n e = err_1 instanceof Error ? err_1 : new Error(\"\".concat(err_1));\n if (!(ctx.options.errorHandler != null)) return [3 /*break*/, 10];\n context = sandbox;\n return [4 /*yield*/, ctx.options.errorHandler(e, code)];\n case 9:\n result = _a.sent();\n return [3 /*break*/, 11];\n case 10: throw new errors_1.CommandExecutionError(e, code);\n case 11: return [3 /*break*/, 12];\n case 12:\n if (!(ctx.options.rejectNullish && result == null)) return [3 /*break*/, 15];\n nerr = new errors_1.NullishCommandResultError(code);\n if (!(ctx.options.errorHandler != null)) return [3 /*break*/, 14];\n return [4 /*yield*/, ctx.options.errorHandler(nerr, code)];\n case 13:\n result = _a.sent();\n return [3 /*break*/, 15];\n case 14: throw nerr;\n case 15:\n // Save the sandbox for later use\n ctx.jsSandbox = (0, timm_1.omit)(context, ['__code__', '__result__']);\n debug_1.logger.debug('JS result', { attach: result });\n return [2 /*return*/, result];\n }\n });\n });\n}", "function contentEval(source) {\n // Check for function input.\n if ('function' == typeof source) {\n // Execute this function with no arguments, by adding parentheses.\n // One set around the function, required for valid syntax, and a\n // second empty set calls the surrounded function.\n source = '(' + source + ')();'\n }\n\n // Create a script node holding this source code.\n var script = document.createElement('script');\n script.setAttribute(\"type\", \"application/javascript\");\n script.textContent = source;\n\n // Insert the script node into the page, so it will run, and immediately\n // remove it to clean up.\n document.body.appendChild(script);\n document.body.removeChild(script);\n}", "function include(scriptURL) {\n let xhr = new XMLHttpRequest();\n xhr.open('GET', scriptURL);\n xhr.onreadystatechange = () => {\n if ((xhr.status === 200) && (xhr.readyState === 4)) eval(xhr.responseText);\n };\n xhr.send();\n}", "script({ content: scriptContent, attributes }) {\n const ext = getScriptExtensionByAttrs(attributes);\n if (![ '.ts', '.tsx', '.coffee', '.jsx' ].includes(ext)) return null;\n // TODO: check if sourcemaps can be usefull for inline scripts\n return compileJS({\n ...ctx,\n path: `${ctx.path}-${scriptIndex++}${ext}`,\n stats: {\n ...ctx.stats,\n ext,\n },\n }, scriptContent, false, { skipHQTrans: true, skipSM: true });\n }", "function contentEval(source) {\r\n\t// Check for function input.\r\n\tif ('function' == typeof source) {\r\n\t\t// Execute this function with no arguments, by adding parentheses.\r\n\t\t// One set around the function, required for valid syntax, and a second empty set calls the surrounded function.\r\n\t\tsource = '(' + source + ')();'\r\n\t}\r\n\r\n\t// Create a script node holding this source code.\r\n\tvar script = document.createElement('script');\r\n\tscript.setAttribute(\"type\", \"application/javascript\");\r\n\tscript.textContent = source;\r\n\r\n\t// Insert the script node into the page, so it will run, and immediately remove it to clean up.\r\n\tdocument.body.appendChild(script);\r\n\tdocument.body.removeChild(script);\r\n}", "function contentEval(source) {\r\n // Check for function input.\r\n if ('function' == typeof source) {\r\n // Execute this function with no arguments, by adding parentheses.\r\n // One set around the function, required for valid syntax, and a\r\n // second empty set calls the surrounded function.\r\n source = '(' + source + ')();'\r\n }\r\n // Create a script node holding this source code.\r\n var script = document.createElement('script');\r\n script.setAttribute(\"type\", \"application/javascript\");\r\n script.textContent = source;\r\n // Insert the script node into the page, so it will run, and immediately\r\n // remove it to clean up.\r\n document.body.appendChild(script);\r\n document.body.removeChild(script);\r\n}", "function contentEval(source) {\r\n // Check for function input.\r\n if ('function' == typeof source) {\r\n // Execute this function with no arguments, by adding parentheses.\r\n // One set around the function, required for valid syntax, and a\r\n // second empty set calls the surrounded function.\r\n source = '(' + source + ')();'\r\n }\r\n // Create a script node holding this source code.\r\n var script = document.createElement('script');\r\n script.setAttribute(\"type\", \"application/javascript\");\r\n script.textContent = source;\r\n\r\n // Insert the script node into the page, so it will run, and immediately\r\n // remove it to clean up.\r\n document.body.appendChild(script);\r\n document.body.removeChild(script);\r\n}", "globalEval() {\n // phase one, if we have head inserts, we build up those before going into the script eval phase\n let insertHeadElems = new ExtDomQuery_1.ExtDomQuery(...this.internalContext.getIf(Const_1.DEFERRED_HEAD_INSERTS).value);\n insertHeadElems.runHeadInserts(true);\n // phase 2 we run a script eval on all updated elements in the body\n let updateElems = new ExtDomQuery_1.ExtDomQuery(...this.internalContext.getIf(Const_1.UPDATE_ELEMS).value);\n updateElems.runCss();\n // phase 3, we do the same for the css\n updateElems.runScripts();\n }", "function scripts(ob) {\n\t\tvar v = ob.getElementsByTagName('script');\n\t\tfor (var i=0;i<v.length;i++) {\n\t\t\tdebJ('eval js: '+v[i].textContent);\n\t\t\twith (document) {\n\t\t\t\teval(v[i].textContent);\n\t\t\t}\n\t\t}\n\t}", "function runScript() {\n\tconsole.time(\"index\");\n var job = tabs.activeTab.attach({\n \tcontentScriptFile: [self.data.url(\"models_50_wif/benign/CompositeBenignCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignCountsAB.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignTotal.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousTotal.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsAB.js\"),\n self.data.url(\"CompositeWordTransform.js\"),\n \t\t\t\t\t\tself.data.url(\"DetectComposite.js\")]\n \n \n });\n \n job.port.on(\"script-response\", function(response) {\n\t\n\tconsole.log(response);\n });\n}", "function run(transformFn, script) {\n const scriptEl = document.createElement(\"script\");\n scriptEl.text = transformCode(transformFn, script);\n headEl.appendChild(scriptEl);\n}", "async script (func, args) {\n debug('scripting page', func)\n if (!Array.isArray(args)) {\n args = [args]\n }\n\n return new Promise(resolve => {\n this.pageContext.evaluate((stringyFunc, args) => {\n var invoke = new Function(\n 'return ' + stringyFunc\n )()\n return invoke.apply(null, args)\n },\n func.toString(),\n args,\n (err, result) => {\n if (err) {\n console.error(err)\n }\n resolve(result)\n })\n })\n }", "function runCode() {\n\tPromise.all(preLoad()).then((neverland) => {\n\t\tif (neverland)\n\t\t\tneverland.forEach((p) => {usr_res[p[0]] = p[1];});\n\t\t//console.log(usr_res);\n\n\t\tstopCode();\n\n\t\tconst code = Blockly.JavaScript.workspaceToCode(workspace);\n\t\ttry {\n\t\t\teval(code);\n\t\t}\n\t\tcatch (e) {\n\t\t\tstopCode();\n\t\t\talert(e);\n\t\t}\n\t}).catch((err) => {\n\t\tconsole.log(err);\n\t});\n}", "function executeScript(dataIn) {\r\n var script = dataIn.script;\r\n nlapiLogExecution('DEBUG', 'final script = ', script);\r\n var result = eval(script);\r\n\r\n return result;\r\n}", "function localEval(_script, _scopes, _localScope){\n\t\tif (isDebug) console.log(\"localEval:\"+_script);\n\n\t\ttry {\n\t\t\tvar _res;\n\t\t\tif (_scopes == null || _scopes.length == 0) {\n\t\t\t\twith (_localScope) {\n\t\t\t\t\t_res = eval(_script);\n\t\t\t\t}\n\t\t\t} else if (_scopes.length == 1) {\n\t\t\t\twith (_scopes[0]) {\twith (_localScope) {\n\t\t\t\t\t_res = eval(_script);\n\t\t\t\t}}\n\t\t\t} else {\n\t\t\t\t_res = eval(wrapScopes(_script, _scopes, _localScope));\n\t\t\t}\n\t\t\tif (isDebug) console.log(\"localEval=\" + _res);\n\t\t\treturn _res;\n\t\t} catch (e) {\n\t\t\te.message = \"eval: \"+_script+\"\\n\\n\"+e.message;\n\t\t\t//throw e;\n\t\t\tif (isDebug) alert(e.message+\"\\n\"+e.stack);\n\t\t\tconsole.error(e.message+\"\\n\"+e.stack);\n\t\t\treturn undefined;\n\t\t}\n\t}", "function run(transformFn, script) {\n\t var scriptEl = document.createElement('script');\n\t scriptEl.text = transformCode(transformFn, script);\n\t headEl.appendChild(scriptEl);\n\t}", "function run(transformFn, script) {\n\t var scriptEl = document.createElement('script');\n\t scriptEl.text = transformCode(transformFn, script);\n\t headEl.appendChild(scriptEl);\n\t}", "function run(transformFn, script) {\n var scriptEl = document.createElement('script');\n scriptEl.text = transformCode(transformFn, script);\n headEl.appendChild(scriptEl);\n }", "function EPA_runScript( arr, env, redirects )\n { const { window, document, location,localStorage, sessionStorage, parent, frames } = env;\n const currentScript = arr.shift();\n const createEv = (x,type)=>(x=document.createEvent(x),x.initEvent(type, false, false),x);\n if( !currentScript )\n {\n try { window.dispatchEvent ( createEv('Event','DOMContentLoaded') );}\n catch(ex)\n { console.error(ex); }\n\n env.epc._setReadyState('complete');\n window.dispatchEvent ( createEv('Event','load') );\n env.epc.dispatchEvent( createEv('Event','load') );\n return;\n }\n currentScript.getRootNode = x => document.getRootNode();\n document.scripts.push && document.scripts.push( currentScript );\n\n ( currentScript.src\n ? ( ajax( urlRedirectMap( currentScript.src, redirects ) )\n .then( txt => runScriptAs( currentScript, txt, env.epc ) )\n )\n : runScriptAs( currentScript, currentScript.text, env.epc ) // todo src map\n ).finally( x => EPA_runScript( arr, env, redirects ) );\n }", "function evaluate(ast, environment){\n return ast;\n}", "function evaluate(ast, environment){\n return ast;\n}", "runCodeChunk(id) {\n if (!this.config.enableScriptExecution) {\n return;\n }\n const codeChunk = document.querySelector(`.code-chunk[data-id=\"${id}\"]`);\n const running = codeChunk.classList.contains(\"running\");\n if (running) {\n return;\n }\n codeChunk.classList.add(\"running\");\n if (codeChunk.getAttribute(\"data-cmd\") === \"javascript\") {\n // javascript code chunk\n const code = codeChunk.getAttribute(\"data-code\");\n try {\n eval(`((function(){${code}$})())`);\n codeChunk.classList.remove(\"running\"); // done running javascript code\n const CryptoJS = window[\"CryptoJS\"];\n const result = CryptoJS.AES.encrypt(codeChunk.getElementsByClassName(\"output-div\")[0].outerHTML, \"mume\").toString();\n this.postMessage(\"cacheCodeChunkResult\", [\n this.sourceUri,\n id,\n result,\n ]);\n }\n catch (e) {\n const outputDiv = codeChunk.getElementsByClassName(\"output-div\")[0];\n outputDiv.innerHTML = `<pre>${e.toString()}</pre>`;\n }\n }\n else {\n this.postMessage(\"runCodeChunk\", [this.sourceUri, id]);\n }\n }", "evalCode() {\n throw new errors_1.QuickJSNotImplemented(\"QuickJSWASMModuleAsyncify.evalCode: use evalCodeAsync instead\");\n }", "function SweetDevRia_Zone_evalJS(zone){\n\tvar scripts = zone.getElementsByTagName(\"script\");\n\tvar strExec;\n\tvar bSaf = (navigator.userAgent.indexOf('Safari') != -1);\n\tvar bOpera = (navigator.userAgent.indexOf('Opera') != -1);\n\tvar bMoz = (navigator.appName == 'Netscape');\n\tfor(var i=0; i<scripts.length; i++){\n\t if (bSaf) {\n\t strExec = scripts[i].innerHTML;\n\t }\n\t else if (bOpera) {\n\t strExec = scripts[i].text;\n\t }\n\t else if (bMoz) {\n\t strExec = scripts[i].textContent;\n\t }\n\t else {\n\t strExec = scripts[i].text;\n\t }\n\t try {\n\t window.eval(strExec);\n\t } catch(e) {\n\t throw \"Script evaluation failed :\\n\"+strExec;\n\t }\n\t}\n}", "function runJS() {\n Blockly.JavaScript.INFINITE_LOOP_TRAP = ' checkTimeout();\\n';\n var timeouts = 0;\n var checkTimeout = function() {\n if (timeouts++ > 1000000) {\n throw BlocklyApps.getMsg('timeout');\n }\n };\n var code = Blockly.Generator.workspaceToCode('JavaScript');\n Blockly.JavaScript.INFINITE_LOOP_TRAP = null;\n try {\n eval(code);\n } catch (e) {\n alert(BlocklyApps.getMsg('badCode').replace('%1', e));\n }\n}", "_eval() {\n if (!this._attached || this._startedEval) {\n return;\n }\n\n if (this.src) {\n this._startedEval = true;\n resourceLoader.load(\n this,\n this.src,\n { defaultEncoding: whatwgEncoding.labelToName(this.getAttribute(\"charset\")) || this._ownerDocument._encoding },\n this._innerEval\n );\n } else if (this.text.trim().length > 0) {\n this._startedEval = true;\n resourceLoader.enqueue(this, this._ownerDocument.URL, this._innerEval)(null, this.text);\n }\n }", "function scriptOnLoad() { \n if (script.readyState && script.readyState !== \"loaded\" && \n script.readyState !== \"complete\") { return; }\n script.onreadystatechange = script.onload = null;\n // next iteration\n if (thisObj.scriptConcatenatorURL) {\n loadNext();\n } else {\n thisObj.loadScript(srcSetObj, iteration);\n }\n }", "function do_script(chain_opts, script_obj, chain_group, preload_this_script) {\n var registry_item,\n registry_items,\n ready_cb = function () {\n script_obj.ready_cb(script_obj, function () {\n execute_preloaded_script(chain_opts, script_obj, registry_item);\n });\n },\n finished_cb = function () {\n script_obj.finished_cb(script_obj, chain_group);\n }\n ;\n script_obj.src = canonical_uri(script_obj.src, chain_opts[_BasePath]);\n script_obj.real_src = script_obj.src +\n // append cache-bust param to URL?\n (chain_opts[_CacheBust] ? ((/\\?.*$/.test(script_obj.src) ? \"&_\" : \"?_\") + ~~(Math.random() * 1E9) + \"=\") : \"\")\n ;\n if (!registry[script_obj.src]) registry[script_obj.src] = {items:[], finished:false};\n registry_items = registry[script_obj.src].items;\n // allowing duplicates, or is this the first recorded load of this script?\n if (chain_opts[_AllowDuplicates] || registry_items.length == 0) {\n registry_item = registry_items[registry_items.length] = {\n ready:false,\n finished:false,\n ready_listeners:[ready_cb],\n finished_listeners:[finished_cb]\n };\n request_script(chain_opts, script_obj, registry_item,\n // which callback type to pass?\n (\n (preload_this_script) ? // depends on script-preloading\n function () {\n registry_item.ready = true;\n for (var i = 0; i < registry_item.ready_listeners.length; i++) {\n registry_item.ready_listeners[i]();\n }\n registry_item.ready_listeners = [];\n } :\n function () {\n script_executed(registry_item);\n }\n ),\n // signal if script-preloading should be used or not\n preload_this_script\n );\n }\n else {\n registry_item = registry_items[0];\n if (registry_item.finished) {\n finished_cb();\n }\n else {\n registry_item.finished_listeners.push(finished_cb);\n }\n }\n }", "function evalExpression(){\n\tvar codeElement = document.getElementsByTagName('code')[0];\n\tvar encodedJavascriptCode = codeElement.innerHTML;\n\tvar decodedJavascriptCode = decode(encodedJavascriptCode);\n\tvar answer = eval(decodedJavascriptCode);\n\treturn answer;\n}", "function run(program) {\n return evaluate(parse(program), Object.create(topScope));\n}", "function executeScript(scriptName, context) {\n\n const requestID = ServiceManager.getRequestID(scriptName, context);\n\n return (dispatch) => {\n dispatch(didStartRequest(requestID));\n\n return ServiceManager.executeScript(scriptName, context)\n .then(\n (results) => {\n dispatch(didReceiveResponse(requestID, results));\n return Promise.resolve(results);\n },\n (error) => {\n dispatch(didReceiveError(requestID, error));\n return Promise.resolve();\n });\n }\n}", "function load (moduleName) {\n if (!moduleName) {\n throw new Error('No module name!');\n }\n\n moduleSrc = getItem(LOCAL_STORAGE_PREFIX + moduleName) || '';\n\n if (moduleSrc) {\n return evalScript(moduleSrc);\n }\n\n return false;\n}", "function execScript(script, turntable,material, arg0, arg1, arg2, arg3, arg4, arg5){\n\t\t\t\tupdateStatus(\"Loading..\")\n\n\t\t\t\t//remove loaded model if it alredy exists\n\t\t\t\tgroup.remove( loadedmodel );\n\t\t\t\t//create group for assesories.\n\t\t\t\tloadedmodel = new THREE.Mesh();\n\t\t\t\t//this fucnction send a jsnop request to server. \n\t\t\t\t//The adressse to generate the 3D model.\n\t\t\t\tvar serversdresse = server+\"modelGEN.php?timtest=\"+Math.floor((Math.random()*100)+1)+\"&TOKEN=\"+ACCESSTOKEN+\"&script=\"+script+\"&material=\"+material+\"&turntable=\"+turntable+\"&arg0=\"+arg0+\"&arg1=\"+arg1+\"&arg2=\"+arg2+\"&arg3=\"+arg3+\"&arg4=\"+arg4+\"&arg5=\"+arg5;\n\t\t\t\tconsole.log(serversdresse);\n\t\t\t\t//abort any previous ajax.\n\t\t\t\t if(xhr && xhr.readystate != 4){\n\t\t\t\t\t xhr.abort();\n\t\t\t\t }\n\t\t\t\t ///////////////////////////Call CLoud 3D///////////////////////\n\t\t\t\t\t//send request to create text.\n\t\t\t\t\tconsole.log(\"Creating Jewelry..\");\n\t\t\t\t\t xhr = $.ajax({\n\t\t\t\t\t url: serversdresse,\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t timeout:50000,\n\t\t\t\t\t async: true,\n\t\t\t\t\t cache: false,\n\t\t\t\t\t dataType: \"jsonp\",\n\t\t\t\t\t contentType: \"text/javascript\",\n\t\t\t\t\t crossDomain: true,\n\t\t\t\t\t \n\t\t\t\t });\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "async evaluate(){\n if(this._instanceDestroyed) return;\n return await tryWithPageAwareness(async () => {\n const evalResult = await this._page.evaluate(...arguments);\n await this._reflectContents();\n return evalResult;\n });\n }", "function execute_preloaded_script(chain_opts,script_obj,registry_item) {\n\t\t\tvar script;\n\t\t\t\n\t\t\tfunction preload_execute_finished() {\n\t\t\t\tif (script != null) { // make sure this only ever fires once\n\t\t\t\t\tscript = null;\n\t\t\t\t\tscript_executed(registry_item);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (registry[script_obj.src].finished) return;\n\t\t\tif (!chain_opts[_AllowDuplicates]) registry[script_obj.src].finished = true;\n\t\t\t\n\t\t\tscript = registry_item.elem || document.createElement(\"script\");\n\t\t\tif (script_obj.type) script.type = script_obj.type;\n\t\t\tif (script_obj.charset) script.charset = script_obj.charset;\n\t\t\tcreate_script_load_listener(script,registry_item,\"finished\",preload_execute_finished);\n\t\t\t\n\t\t\t// script elem was real-preloaded\n\t\t\tif (registry_item.elem) {\n\t\t\t\tregistry_item.elem = null;\n\t\t\t}\n\t\t\t// script was XHR preloaded\n\t\t\telse if (registry_item.text) {\n\t\t\t\tscript.onload = script.onreadystatechange = null;\t// script injection doesn't fire these events\n\t\t\t\tscript.text = registry_item.text;\n\t\t\t}\n\t\t\t// script was cache-preloaded\n\t\t\telse {\n\t\t\t\tscript.src = script_obj.real_src;\n\t\t\t}\n\t\t\tappend_to.insertBefore(script,append_to.firstChild);\n\n\t\t\t// manually fire execution callback for injected scripts, since events don't fire\n\t\t\tif (registry_item.text) {\n\t\t\t\tpreload_execute_finished();\n\t\t\t}\n\t\t}", "function runJS() {\n Blockly.JavaScript.INFINITE_LOOP_TRAP = ' checkTimeout();\\n';\n var timeouts = 0;\n var checkTimeout = function() {\n if (timeouts++ > 1000000) {\n throw MSG.timeout;\n }\n };\n var code = Blockly.Generator.workspaceToCode('JavaScript');\n Blockly.JavaScript.INFINITE_LOOP_TRAP = null;\n try {\n eval(code);\n } catch (e) {\n alert(MSG.badCode.replace('%1', e));\n }\n}", "function loadJavaScript(url) {\n syncRequest({\n // prevent caching\n url: url + \"?rand=\" + Math.random(),\n success: function(response) {\n var code = response.responseText;\n // evaluate file in the context of global object\n \n // IE will evaluate window.eval() in current scope.\n // Therefore we use IE specific window.execScript()\n if (window.execScript) {\n window.execScript(code);\n }\n else {\n window.eval(code);\n }\n },\n \n // Make a lot of noise on error.\n // Failed MRequires() usually results in serious crash\n // when concatenating JS files for deployment.\n failure: function(response) {\n alert(\n \"MRequires: Loading file '\" + url + \"'\\n\" +\n \"Got: \" + response.status + \" \" + response.statusText\n );\n }\n });\n }", "function execute_preloaded_script(chain_opts, script_obj, registry_item) {\n var script;\n\n function preload_execute_finished() {\n if (script != null) { // make sure this only ever fires once\n script = null;\n script_executed(registry_item);\n }\n }\n\n if (registry[script_obj.src].finished) return;\n if (!chain_opts[_AllowDuplicates]) registry[script_obj.src].finished = true;\n script = registry_item.elem || document.createElement(\"script\");\n if (script_obj.type) script.type = script_obj.type;\n if (script_obj.charset) script.charset = script_obj.charset;\n create_script_load_listener(script, registry_item, \"finished\", preload_execute_finished);\n // script elem was real-preloaded\n if (registry_item.elem) {\n registry_item.elem = null;\n }\n // script was XHR preloaded\n else if (registry_item.text) {\n script.onload = script.onreadystatechange = null;\t// script injection doesn't fire these events\n script.text = registry_item.text;\n }\n // script was cache-preloaded\n else {\n script.src = script_obj.real_src;\n }\n append_to.insertBefore(script, append_to.firstChild);\n // manually fire execution callback for injected scripts, since events don't fire\n if (registry_item.text) {\n preload_execute_finished();\n }\n }", "_loadScriptEval(sticky, src, delay = 0, nonce) {\n let srcNode = this.createSourceNode(src, nonce);\n let nonceCheck = this.createSourceNode(null, nonce);\n let marker = `nonce_${Date.now()}_${Math.random()}`;\n nonceCheck.innerHTML = `document.head[\"${marker}\"] = true`; // noop\n let head = document.head;\n // upfront nonce check, needed mostly for testing\n // but cannot hurt to block src calls which have invalid nonce on localhost\n // the reason for doing this up until now we have a similar construct automatically\n // by loading the scripts via xhr and then embedding them.\n // this is not needed anymore but the nonce is more relaxed with script src\n // we now enforce it the old way\n head.appendChild(nonceCheck);\n head.removeChild(nonceCheck);\n if (!head[marker]) {\n return;\n }\n try {\n if (!delay) {\n head.appendChild(srcNode);\n if (!sticky) {\n head.removeChild(srcNode);\n }\n }\n else {\n setTimeout(() => {\n head.appendChild(srcNode);\n if (!sticky) {\n head.removeChild(srcNode);\n }\n }, delay);\n }\n }\n finally {\n delete head[marker];\n }\n return this;\n }", "_loadScriptEval(sticky, src, delay = 0, nonce) {\n let srcNode = this.createSourceNode(src, nonce);\n let nonceCheck = this.createSourceNode(null, nonce);\n let marker = `nonce_${Date.now()}_${Math.random()}`;\n nonceCheck.innerHTML = `document.head[\"${marker}\"] = true`; // noop\n let head = document.head;\n // upfront nonce check, needed mostly for testing\n // but cannot hurt to block src calls which have invalid nonce on localhost\n // the reason for doing this up until now we have a similar construct automatically\n // by loading the scripts via xhr and then embedding them.\n // this is not needed anymore but the nonce is more relaxed with script src\n // we now enforce it the old way\n head.appendChild(nonceCheck);\n head.removeChild(nonceCheck);\n if (!head[marker]) {\n return;\n }\n try {\n if (!delay) {\n head.appendChild(srcNode);\n if (!sticky) {\n head.removeChild(srcNode);\n }\n }\n else {\n setTimeout(() => {\n head.appendChild(srcNode);\n if (!sticky) {\n head.removeChild(srcNode);\n }\n }, delay);\n }\n }\n finally {\n delete head[marker];\n }\n return this;\n }", "function request_script(chain_opts, script_obj, registry_item, onload, preload_this_script) {\n // setTimeout() \"yielding\" prevents some weird race/crash conditions in older browsers\n setTimeout(function () {\n var script, src = script_obj.real_src, xhr;\n // don't proceed until `append_to` is ready to append to\n if (\"item\" in append_to) { // check if `append_to` ref is still a live node list\n if (!append_to[0]) { // `append_to` node not yet ready\n // try again in a little bit -- note: will re-call the anonymous function in the outer setTimeout, not the parent `request_script()`\n setTimeout(arguments.callee, 25);\n return;\n }\n // reassign from live node list ref to pure node ref -- avoids nasty IE bug where changes to DOM invalidate live node lists\n append_to = append_to[0];\n }\n script = document.createElement(\"script\");\n if (script_obj.type) script.type = script_obj.type;\n if (script_obj.charset) script.charset = script_obj.charset;\n // should preloading be used for this script?\n if (preload_this_script) {\n // real script preloading?\n if (real_preloading) {\n /*!START_DEBUG*/\n if (chain_opts[_Debug]) log_msg(\"start script preload: \" + src);\n /*!END_DEBUG*/\n registry_item.elem = script;\n if (explicit_preloading) { // explicit preloading (aka, Zakas' proposal)\n script.preload = true;\n script.onpreload = onload;\n }\n else {\n script.onreadystatechange = function () {\n if (script.readyState == \"loaded\") onload();\n };\n }\n script.src = src;\n // NOTE: no append to DOM yet, appending will happen when ready to execute\n }\n // same-domain and XHR allowed? use XHR preloading\n else if (preload_this_script && src.indexOf(root_domain) == 0 && chain_opts[_UseLocalXHR]) {\n xhr = new XMLHttpRequest(); // note: IE never uses XHR (it supports true preloading), so no more need for ActiveXObject fallback for IE <= 7\n /*!START_DEBUG*/\n if (chain_opts[_Debug]) log_msg(\"start script preload (xhr): \" + src);\n /*!END_DEBUG*/\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n xhr.onreadystatechange = function () {\n }; // fix a memory leak in IE\n registry_item.text = xhr.responseText + \"\\n//@ sourceURL=\" + src; // http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/\n onload();\n }\n };\n xhr.open(\"GET\", src);\n xhr.send();\n }\n // as a last resort, use cache-preloading\n else {\n /*!START_DEBUG*/\n if (chain_opts[_Debug]) log_msg(\"start script preload (cache): \" + src);\n /*!END_DEBUG*/\n script.type = \"text/cache-script\";\n create_script_load_listener(script, registry_item, \"ready\", function () {\n append_to.removeChild(script);\n onload();\n });\n script.src = src;\n append_to.insertBefore(script, append_to.firstChild);\n }\n }\n // use async=false for ordered async? parallel-load-serial-execute http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order\n else if (script_ordered_async) {\n /*!START_DEBUG*/\n if (chain_opts[_Debug]) log_msg(\"start script load (ordered async): \" + src);\n /*!END_DEBUG*/\n script.async = false;\n create_script_load_listener(script, registry_item, \"finished\", onload);\n script.src = src;\n append_to.insertBefore(script, append_to.firstChild);\n }\n // otherwise, just a normal script element\n else {\n /*!START_DEBUG*/\n if (chain_opts[_Debug]) log_msg(\"start script load: \" + src);\n /*!END_DEBUG*/\n create_script_load_listener(script, registry_item, \"finished\", onload);\n script.src = src;\n append_to.insertBefore(script, append_to.firstChild);\n }\n }, 0);\n }", "_inlineNonModuleScript(scriptTag) {\n return __awaiter(this, void 0, void 0, function* () {\n const scriptHref = dom5.getAttribute(scriptTag, 'src');\n const resolvedImportUrl = this.bundler.analyzer.urlResolver.resolve(this.document.parsedDocument.baseUrl, scriptHref);\n if (resolvedImportUrl === undefined) {\n return;\n }\n if (this.bundler.excludes.some((e) => resolvedImportUrl === e ||\n resolvedImportUrl.startsWith(url_utils_1.ensureTrailingSlash(e)))) {\n return;\n }\n const scriptImport = utils_1.find(this.document.getFeatures({ kind: 'html-script', imported: true, externalPackages: true }), (i) => i.document !== undefined && i.document.url === resolvedImportUrl);\n if (scriptImport === undefined || scriptImport.document === undefined) {\n this.assignedBundle.bundle.missingImports.add(resolvedImportUrl);\n return;\n }\n let scriptContent = scriptImport.document.parsedDocument.contents;\n if (this.bundler.sourcemaps) {\n // it's easier to calculate offsets if the external script contents\n // don't start on the same line as the script tag. Offset the map\n // appropriately.\n scriptContent = yield source_map_1.addOrUpdateSourcemapComment(this.bundler.analyzer, resolvedImportUrl, '\\n' + scriptContent, -1, 0, 1, 0);\n }\n dom5.removeAttribute(scriptTag, 'src');\n // Second argument 'true' tells encodeString to escape the <script> content.\n dom5.setTextContent(scriptTag, encode_string_1.default(scriptContent, true));\n // Record that the inlining took place.\n this.assignedBundle.bundle.inlinedScripts.add(resolvedImportUrl);\n return scriptContent;\n });\n }", "function EnsureEvaluated(mod, seen, loaderData) {\n //> 1. Append mod as the last element of seen.\n callFunction(std_Set_add, seen, mod);\n\n //> 2. Let deps be mod.[[Dependencies]].\n let deps = $GetDependencies(mod);\n if (deps === undefined)\n return; // An optimization. See the comment below.\n\n //> 3. For each pair in deps, in List order,\n for (let i = 0; i < deps.length; i++) {\n //> 1. Let dep be pair.[[value]].\n let dep = deps[i];\n\n //> 2. If dep is not an element of seen, then\n if (!callFunction(std_Set_has, seen, dep)) {\n //> 1. Call EnsureEvaluated with the arguments dep, seen,\n //> and loader.\n EnsureEvaluated(dep, seen, loaderData);\n }\n }\n\n //> 4. If mod.[[Body]] is not undefined and mod.[[Evaluated]] is false,\n if (!$HasBeenEvaluated(mod)) {\n //> 1. Set mod.[[Evaluated]] to true.\n //> 2. Let initContext be a new ECMAScript code execution context.\n //> 3. Set initContext's Realm to loader.[[Realm]].\n //> 4. Set initContext's VariableEnvironment to mod.[[Environment]].\n //> 5. Set initContext's LexicalEnvironment to mod.[[Environment]].\n //> 6. If there is a currently running execution context, suspend it.\n //> 7. Push initContext on to the execution context stack; initContext is\n //> now the running execution context.\n //> 8. Let r be the result of evaluating mod.[[Body]].\n //> 9. Suspend initContext and remove it from the execution context stack.\n //> 10. Resume the context, if any, that is now on the top of the execution\n //> context stack as the running execution context.\n //> 11. ReturnIfAbrupt(r).\n $EvaluateModuleBody(loaderData.realm, mod);\n }\n}", "function runScript() {\n\t\t\t// Update script to edited version\n\t\t\tvar code = editor.getValue();\n\t\t\tscript.setText(code);\n\t\t\tvar scope = new paper.PaperScope(script.$);\n\t\t\t// Override the console object with one that logs to our new\n\t\t\t// console\n\n\t\t\tfunction print(className, args) {\n\t\t\t\tconsole.injectBottom('div', {\n\t\t\t\t\tclassName: className,\n\t\t\t\t\ttext: Base.each(args, function(arg) {\n\t\t\t\t\t\tthis.push(arg + '');\n\t\t\t\t\t}, []).join(' ')\n\t\t\t\t});\n\t\t\t\tconsole.setScrollOffset(0,\n\t\t\t\t\tconsole.getScrollSize().height);\n\t\t\t}\n\n\t\t\tscope.console = {\n\t\t\t\tlog: function() {\n\t\t\t\t\tprint('line', arguments);\n\t\t\t\t},\n\n\t\t\t\terror: function() {\n\t\t\t\t\tprint('line error', arguments);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Install an error handler to log the errors in our log too:\n\t\t\twindow.onerror = function(error, url, lineNumber) {\n\t\t\t\tscope.console.error('Line ' + lineNumber + ': ' + error);\n\t\t\t\tpaper.view.draw();\n\t\t\t}\n\n\t\t\tscope.setup(paper.PaperScript.getAttribute(script.$, 'canvas'));\n\t\t\tscope.evaluate(code);\n\t\t\tcreateInspector();\n\t\t}", "function exec(fn) {\r\n var script = document.createElement('script');\r\n script.setAttribute(\"type\", \"application/javascript\");\r\n script.textContent = '(' + fn + ')();';\r\n document.body.appendChild(script); // run the script\r\n document.body.removeChild(script); // clean up\r\n}", "function evaluate({ typeChecker, node, environment: { preset = EnvironmentPresetKind.NODE, extra = {} } = {}, typescript = TSModule, logLevel = 0 /* SILENT */, policy: { deterministic = false, network = false, console = false, maxOps = Infinity, maxOpDuration = Infinity, io = {\n read: true,\n write: false\n}, process = {\n exit: false,\n spawnChild: false\n} } = {}, reporting: reportingInput = {} }) {\n // Take the simple path first. This may be far more performant than building up an environment\n const simpleLiteralResult = evaluateSimpleLiteral(node, typescript);\n if (simpleLiteralResult.success)\n return simpleLiteralResult;\n // Otherwise, build an environment and get to work\n // Sanitize the evaluation policy based on the input options\n const policy = {\n deterministic,\n maxOps,\n maxOpDuration,\n network,\n console,\n io: {\n read: typeof io === \"boolean\" ? io : io.read,\n write: typeof io === \"boolean\" ? io : io.write\n },\n process: {\n exit: typeof process === \"boolean\" ? process : process.exit,\n spawnChild: typeof process === \"boolean\" ? process : process.spawnChild\n }\n };\n // Sanitize the Reporting options based on the input options\n const reporting = Object.assign(Object.assign({}, reportingInput), { reportedErrorSet: createReportedErrorSet() });\n // Prepare a reference to the Node that is currently being evaluated\n let currentNode = node;\n // Prepare a logger\n const logger = new Logger(logLevel);\n // Prepare the initial environment\n const initialEnvironment = createLexicalEnvironment({\n inputEnvironment: {\n preset,\n extra\n },\n policy,\n getCurrentNode: () => currentNode\n });\n // Prepare a Stack\n const stack = createStack();\n // Prepare a NodeEvaluator\n const nodeEvaluator = createNodeEvaluator({\n policy,\n typeChecker,\n typescript,\n logger,\n stack,\n reporting: reporting,\n nextNode: nextNode => (currentNode = nextNode)\n });\n try {\n let value;\n if (isExpression(node, typescript)) {\n value = nodeEvaluator.expression(node, initialEnvironment, createStatementTraversalStack());\n }\n else if (isStatement(node, typescript)) {\n nodeEvaluator.statement(node, initialEnvironment);\n value = stack.pop();\n }\n else if (isDeclaration(node, typescript)) {\n nodeEvaluator.declaration(node, initialEnvironment, createStatementTraversalStack());\n value = stack.pop();\n }\n // Otherwise, throw an UnexpectedNodeError\n else {\n // noinspection ExceptionCaughtLocallyJS\n throw new UnexpectedNodeError({ node, typescript });\n }\n // Log the value before returning\n logger.logResult(value);\n return {\n success: true,\n value\n };\n }\n catch (reason) {\n // Report the Error\n reportError(reporting, reason, node);\n return {\n success: false,\n reason\n };\n }\n}", "function loopbackAwareEval(code, context, file, cb) {\n var err, result, script;\n // first, create the Script object to check the syntax\n try {\n script = vm.createScript(code, {\n filename: file,\n displayErrors: false\n });\n } catch (e) {\n if (isRecoverableError(e)) {\n err = new Recoverable(e);\n } else {\n err = e;\n }\n }\n\n if (!err) {\n try {\n result = script.runInThisContext({ displayErrors: false });\n if (typeof Promise !== 'undefined' && result instanceof Promise) {\n result.then(function (r) {\n _.each(context, function (v, k) {\n if (context[k] === result) {\n context[k] = r;\n }\n });\n cb(null, r);\n }).catch(cb);\n return;\n }\n } catch (e) {\n err = e;\n if (err && process.domain) {\n process.domain.emit('error', err);\n process.domain.exit();\n return;\n }\n }\n }\n\n cb(err, result);\n}", "function execModule(sModuleName) {\n\t\t\t\n\t\t\tvar oModule = mModules[sModuleName],\n\t\t\t\tsOldPrefix, oUri, sAbsoluteUrl;\n\t\t\t\n\t\t\tif ( oModule && oModule.state === LOADED && typeof oModule.data !== \"undefined\" ) {\n\t\t\t\ttry {\n\t\n\t\t\t\t\tif ( log.isLoggable() ) {\n\t\t\t\t\t\tlog.debug(sLogPrefix + \"executing '\" + sModuleName + \"'\");\n\t\t\t\t\t\tsOldPrefix = sLogPrefix;\n\t\t\t\t\t\tsLogPrefix = sLogPrefix + \": \";\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// execute the script in the window context\n\t\t\t\t\toModule.state = EXECUTING;\n\t\t\t\t\t_execStack.push(sModuleName);\n\t\t\t\t\tif ( typeof oModule.data === \"function\" ) {\n\t\t\t\t\t\toModule.data.apply(window);\n\t\t\t\t\t} else if (_window.execScript && (!oModule.data || oModule.data.length < MAX_EXEC_SCRIPT_LENGTH) ) { \n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\toModule.data && _window.execScript(oModule.data); // execScript fails if data is empty\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t_execStack.pop();\n\t\t\t\t\t\t\t// eval again with different approach - should fail with a more informative exception\n\t\t\t\t\t\t\tjQuery.sap.globalEval(oModule.data);\n\t\t\t\t\t\t\tthrow e; // rethrow err in case globalEval succeeded unexpectedly\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// make URL absolute so Chrome displays the file tree correctly\n\t\t\t\t\t\toUri = URI(oModule.url);\n\t\t\t\t\t\tsAbsoluteUrl = oUri.absoluteTo(sDocumentLocation);\n\t\t\t\t\t\t_window.eval(oModule.data + \"\\r\\n//# sourceURL=\" + sAbsoluteUrl); // Firebug, Chrome and Safari debugging help, appending the string seems to cost ZERO performance\n\t\t\t\t\t}\n\t\t\t\t\t_execStack.pop();\n\t\t\t\t\toModule.state = READY;\n\t\t\t\t\toModule.data = undefined;\n\t\t\t\t\t// best guess for legacy modules that don't use sap.ui.define\n\t\t\t\t\t// TODO implement fallback for raw modules\n\t\t\t\t\toModule.content = oModule.content || jQuery.sap.getObject(urnToUI5(sModuleName)); \n\t\n\t\t\t\t\tif ( log.isLoggable() ) {\n\t\t\t\t\t\tsLogPrefix = sOldPrefix;\n\t\t\t\t\t\tlog.debug(sLogPrefix + \"finished executing '\" + sModuleName + \"'\");\n\t\t\t\t\t}\n\t\n\t\t\t\t} catch (err) {\n\t\t\t\t\toModule.state = FAILED;\n\t\t\t\t\toModule.error = ((err.toString && err.toString()) || err.message) + (err.line ? \"(line \" + err.line + \")\" : \"\" );\n\t\t\t\t\toModule.data = undefined;\n\t\t\t\t\tif ( window[\"sap-ui-debug\"] && (/sap-ui-xx-show(L|-l)oad(E|-e)rrors=(true|x|X)/.test(location.search) || oCfgData[\"xx-showloaderrors\"]) ) {\n\t\t\t\t\t\tlog.error(\"error while evaluating \" + sModuleName + \", embedding again via script tag to enforce a stack trace (see below)\");\n\t\t\t\t\t\tjQuery.sap.includeScript(oModule.url);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function foo() {\n return eval(\"1 + 1\");\n}", "function execModule(sModuleName) {\n\n\t\t\tvar oModule = mModules[sModuleName],\n\t\t\t\toShim = mAMDShim[sModuleName],\n\t\t\t\tsOldPrefix, sScript, vAMD;\n\n\t\t\tif ( oModule && oModule.state === LOADED && typeof oModule.data !== \"undefined\" ) {\n\n\t\t\t\t// check whether the module is known to use an existing AMD loader, remember the AMD flag\n\t\t\t\tvAMD = (oShim === true || (oShim && oShim.amd)) && typeof window.define === \"function\" && window.define.amd;\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif ( vAMD ) {\n\t\t\t\t\t\t// temp. remove the AMD Flag from the loader\n\t\t\t\t\t\tdelete window.define.amd;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( log.isLoggable() ) {\n\t\t\t\t\t\tlog.debug(sLogPrefix + \"executing '\" + sModuleName + \"'\");\n\t\t\t\t\t\tsOldPrefix = sLogPrefix;\n\t\t\t\t\t\tsLogPrefix = sLogPrefix + \": \";\n\t\t\t\t\t}\n\n\t\t\t\t\t// execute the script in the window context\n\t\t\t\t\toModule.state = EXECUTING;\n\t\t\t\t\t_execStack.push(sModuleName);\n\t\t\t\t\tif ( typeof oModule.data === \"function\" ) {\n\t\t\t\t\t\toModule.data.call(window);\n\t\t\t\t\t} else if ( jQuery.isArray(oModule.data) ) {\n\t\t\t\t\t\tsap.ui.define.apply(sap.ui, oModule.data);\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tsScript = oModule.data;\n\n\t\t\t\t\t\t// sourceURL: Firebug, Chrome, Safari and IE11 debugging help, appending the string seems to cost ZERO performance\n\t\t\t\t\t\t// Note: IE11 supports sourceURL even when running in IE9 or IE10 mode\n\t\t\t\t\t\t// Note: make URL absolute so Chrome displays the file tree correctly\n\t\t\t\t\t\t// Note: do not append if there is already a sourceURL / sourceMappingURL\n\t\t\t\t\t\tif (sScript && !sScript.match(/\\/\\/[#@] source(Mapping)?URL=.*$/)) {\n\t\t\t\t\t\t\tsScript += \"\\n//# sourceURL=\" + URI(oModule.url).absoluteTo(sDocumentLocation);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// framework internal hook to intercept the loaded script and modify\n\t\t\t\t\t\t// it before executing the script - e.g. useful for client side coverage\n\t\t\t\t\t\tif (typeof jQuery.sap.require._hook === \"function\") {\n\t\t\t\t\t\t\tsScript = jQuery.sap.require._hook(sScript, sModuleName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (_window.execScript && (!oModule.data || oModule.data.length < MAX_EXEC_SCRIPT_LENGTH) ) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\toModule.data && _window.execScript(sScript); // execScript fails if data is empty\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t_execStack.pop();\n\t\t\t\t\t\t\t\t// eval again with different approach - should fail with a more informative exception\n\t\t\t\t\t\t\t\tjQuery.sap.globalEval(oModule.data);\n\t\t\t\t\t\t\t\tthrow e; // rethrow err in case globalEval succeeded unexpectedly\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_window.eval(sScript);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t_execStack.pop();\n\t\t\t\t\toModule.state = READY;\n\t\t\t\t\toModule.data = undefined;\n\t\t\t\t\t// best guess for raw and legacy modules that don't use sap.ui.define\n\t\t\t\t\toModule.content = oModule.content || jQuery.sap.getObject((oShim && oShim.exports) || urnToUI5(sModuleName));\n\n\t\t\t\t\tif ( log.isLoggable() ) {\n\t\t\t\t\t\tsLogPrefix = sOldPrefix;\n\t\t\t\t\t\tlog.debug(sLogPrefix + \"finished executing '\" + sModuleName + \"'\");\n\t\t\t\t\t}\n\n\t\t\t\t} catch (err) {\n\t\t\t\t\toModule.state = FAILED;\n\t\t\t\t\toModule.error = ((err.toString && err.toString()) || err.message) + (err.line ? \"(line \" + err.line + \")\" : \"\" );\n\t\t\t\t\toModule.data = undefined;\n\t\t\t\t\tif ( window[\"sap-ui-debug\"] && (/sap-ui-xx-show(L|-l)oad(E|-e)rrors=(true|x|X)/.test(location.search) || oCfgData[\"xx-showloaderrors\"]) ) {\n\t\t\t\t\t\tlog.error(\"error while evaluating \" + sModuleName + \", embedding again via script tag to enforce a stack trace (see below)\");\n\t\t\t\t\t\tjQuery.sap.includeScript(oModule.url);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\n\t\t\t\t\t// restore AMD flag\n\t\t\t\t\tif ( vAMD ) {\n\t\t\t\t\t\twindow.define.amd = vAMD;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "__eval__(__source__, __boundValues__) { return eval(__source__) }", "function quickEval(element, code) {\n\tif (!window.Mavo) {\n\t\treturn;\n\t}\n\n\tvar node = Mavo.Node.getClosest(element);\n\tnode = node.collection? node : node.group;\n\tvar data = node.getLiveData();\n\tvar expression = new Mavo.Expression(code);\n\tvar value = expression.eval(data, {actions: true});\n\n\tif (value instanceof Error) {\n\t\treturn {\n\t\t\tisException: true,\n\t\t\tvalue: value.message\n\t\t};\n\t}\n\n\tvar serialized = Mavo.safeToJSON(value);\n\tvar reserialized = serialized === undefined? undefined : JSON.parse(serialized);\n\tconsole.log(code, \"=\", reserialized);\n\treturn reserialized;\n}", "function runNodeScript (script, node, nodeParams, io) {\n\tvar sandbox = {\n\t\tcontext: { node: node, noderequest: nodeParams},\n\t\tout: { say: function (ch, msg) {\n\t\t\t\tio.sockets.emit(ch, msg);\n\t\t\t}\n\t\t}\n\t}\n\trunNodeScriptInContext(script, node, sandbox, io);\n}", "function XLoader() {\r\n return __loadScript(\"YLoader\", 2);\r\n}", "function script(command, callback)\n\t{\n\t\tif (_targetWindow)\n\t\t{\n\t\t\t_idCounter = (_idCounter + 1) % 1000000;\n\n\t\t\tvar data = {type: \"script\",\n\t\t\t\tcontent: command,\n\t\t\t\tscriptId: \"script_\" + (_idCounter)};\n\n\t\t\t// queue the command, this prevents simultaneous JSmol script calls\n\t\t\tqueue(data, callback);\n\t\t}\n\t}", "function request_script(chain_opts,script_obj,registry_item,onload,preload_this_script) {\n\t\t// setTimeout() \"yielding\" prevents some weird race/crash conditions in older browsers\n\t\tsetTimeout(function(){\n\t\t\tvar script, src = script_obj.real_src, xhr;\n\t\t\t\n\t\t\t// don't proceed until `append_to` is ready to append to\n\t\t\tif (\"item\" in append_to) { // check if `append_to` ref is still a live node list\n\t\t\t\tif (!append_to[0]) { // `append_to` node not yet ready\n\t\t\t\t\t// try again in a little bit -- note: will re-call the anonymous function in the outer setTimeout, not the parent `request_script()`\n\t\t\t\t\tsetTimeout(arguments.callee,25);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// reassign from live node list ref to pure node ref -- avoids nasty IE bug where changes to DOM invalidate live node lists\n\t\t\t\tappend_to = append_to[0];\n\t\t\t}\n\t\t\tscript = document.createElement(\"script\");\n\t\t\tif (script_obj.type) script.type = script_obj.type;\n\t\t\tif (script_obj.charset) script.charset = script_obj.charset;\n\t\t\t\n\t\t\t// should preloading be used for this script?\n\t\t\tif (preload_this_script) {\n\t\t\t\t// real script preloading?\n\t\t\t\tif (real_preloading) {\n\t\t\t\t\t/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg(\"start script preload: \"+src);/*!END_DEBUG*/\n\t\t\t\t\tregistry_item.elem = script;\n\t\t\t\t\tif (explicit_preloading) { // explicit preloading (aka, Zakas' proposal)\n\t\t\t\t\t\tscript.preload = true;\n\t\t\t\t\t\tscript.onpreload = onload;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tscript.onreadystatechange = function(){\n\t\t\t\t\t\t\tif (script.readyState == \"loaded\") onload();\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tscript.src = src;\n\t\t\t\t\t// NOTE: no append to DOM yet, appending will happen when ready to execute\n\t\t\t\t}\n\t\t\t\t// same-domain and XHR allowed? use XHR preloading\n\t\t\t\telse if (preload_this_script && src.indexOf(root_domain) == 0 && chain_opts[_UseLocalXHR]) {\n\t\t\t\t\txhr = new XMLHttpRequest(); // note: IE never uses XHR (it supports true preloading), so no more need for ActiveXObject fallback for IE <= 7\n\t\t\t\t\t/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg(\"start script preload (xhr): \"+src);/*!END_DEBUG*/\n\t\t\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t\t\tif (xhr.readyState == 4) {\n\t\t\t\t\t\t\txhr.onreadystatechange = function(){}; // fix a memory leak in IE\n\t\t\t\t\t\t\tregistry_item.text = xhr.responseText + \"\\n//@ sourceURL=\" + src; // http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/\n\t\t\t\t\t\t\tonload();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\txhr.open(\"GET\",src);\n\t\t\t\t\txhr.send();\n\t\t\t\t}\n\t\t\t\t// as a last resort, use cache-preloading\n\t\t\t\telse {\n\t\t\t\t\t/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg(\"start script preload (cache): \"+src);/*!END_DEBUG*/\n\t\t\t\t\tscript.type = \"text/cache-script\";\n\t\t\t\t\tcreate_script_load_listener(script,registry_item,\"ready\",function() {\n\t\t\t\t\t\tappend_to.removeChild(script);\n\t\t\t\t\t\tonload();\n\t\t\t\t\t});\n\t\t\t\t\tscript.src = src;\n\t\t\t\t\tappend_to.insertBefore(script,append_to.firstChild);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// use async=false for ordered async? parallel-load-serial-execute http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order\n\t\t\telse if (script_ordered_async) {\n\t\t\t\t/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg(\"start script load (ordered async): \"+src);/*!END_DEBUG*/\n\t\t\t\tscript.async = false;\n\t\t\t\tcreate_script_load_listener(script,registry_item,\"finished\",onload);\n\t\t\t\tscript.src = src;\n\t\t\t\tappend_to.insertBefore(script,append_to.firstChild);\n\t\t\t}\n\t\t\t// otherwise, just a normal script element\n\t\t\telse {\n\t\t\t\t/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg(\"start script load: \"+src);/*!END_DEBUG*/\n\t\t\t\tcreate_script_load_listener(script,registry_item,\"finished\",onload);\n\t\t\t\tscript.src = src;\n\t\t\t\tappend_to.insertBefore(script,append_to.firstChild);\n\t\t\t}\n\t\t},0);\n\t}", "function startScript() {\n if (!assertScriptIsRunnable()) {\n return;\n }\n\n captureStartState();\n\n // Start the work!\n doWork();\n }", "function trustedScriptFromString(script) {\n var _a;\n\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function processScript()\n\t{\n\t\tif (!runningScript)\n\t\t\treturn;\n\t\t\n\t\t// Step through the script\n\t\twhile ((scriptIndex < runningScript.length) && !isBlocked)\n\t\t\tdoOpcode();\n\t}", "function handleScriptEnd() {\n // XXX:\n // This is just a stub implementation right now and doesn't run scripts.\n // Getting this method right involves the event loop, URL resolution\n // script fetching etc. For now I just want to be able to parse\n // documents and test the parser.\n\n //var script = stack.top;\n stack.pop();\n parser = originalInsertionMode;\n //script._prepare();\n return;\n\n // XXX: here is what this method is supposed to do\n\n // Provide a stable state.\n\n // Let script be the current node (which will be a script\n // element).\n\n // Pop the current node off the stack of open elements.\n\n // Switch the insertion mode to the original insertion mode.\n\n // Let the old insertion point have the same value as the current\n // insertion point. Let the insertion point be just before the\n // next input character.\n\n // Increment the parser's script nesting level by one.\n\n // Prepare the script. This might cause some script to execute,\n // which might cause new characters to be inserted into the\n // tokenizer, and might cause the tokenizer to output more tokens,\n // resulting in a reentrant invocation of the parser.\n\n // Decrement the parser's script nesting level by one. If the\n // parser's script nesting level is zero, then set the parser\n // pause flag to false.\n\n // Let the insertion point have the value of the old insertion\n // point. (In other words, restore the insertion point to its\n // previous value. This value might be the \"undefined\" value.)\n\n // At this stage, if there is a pending parsing-blocking script,\n // then:\n\n // If the script nesting level is not zero:\n\n // Set the parser pause flag to true, and abort the processing\n // of any nested invocations of the tokenizer, yielding\n // control back to the caller. (Tokenization will resume when\n // the caller returns to the \"outer\" tree construction stage.)\n\n // The tree construction stage of this particular parser is\n // being called reentrantly, say from a call to\n // document.write().\n\n // Otherwise:\n\n // Run these steps:\n\n // Let the script be the pending parsing-blocking\n // script. There is no longer a pending\n // parsing-blocking script.\n\n // Block the tokenizer for this instance of the HTML\n // parser, such that the event loop will not run tasks\n // that invoke the tokenizer.\n\n // If the parser's Document has a style sheet that is\n // blocking scripts or the script's \"ready to be\n // parser-executed\" flag is not set: spin the event\n // loop until the parser's Document has no style sheet\n // that is blocking scripts and the script's \"ready to\n // be parser-executed\" flag is set.\n\n // Unblock the tokenizer for this instance of the HTML\n // parser, such that tasks that invoke the tokenizer\n // can again be run.\n\n // Let the insertion point be just before the next\n // input character.\n\n // Increment the parser's script nesting level by one\n // (it should be zero before this step, so this sets\n // it to one).\n\n // Execute the script.\n\n // Decrement the parser's script nesting level by\n // one. If the parser's script nesting level is zero\n // (which it always should be at this point), then set\n // the parser pause flag to false.\n\n // Let the insertion point be undefined again.\n\n // If there is once again a pending parsing-blocking\n // script, then repeat these steps from step 1.\n\n\n }", "function visit(script) {\n script = resolveScriptInfo(script);\n var currentState = state(script);\n if (currentState < loading && !getComposite(script)) {\n // unloaded script, eligible for composite selection\n scriptSet[script.name] = script;\n foundAny = true;\n foreach(script[\"dependencies\"], visit);\n }\n if (currentState < loaded) {\n // this scripts executionDependencies may not be loaded,\n // also check them for composite candidates\n foreach(script[\"executionDependencies\"], visit);\n }\n }", "function trustedScriptFromString(script) {\n var _a;\n\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n }", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "function run_script (code) {\n var script = document.createElement('script');\n script.appendChild(document.createTextNode(code));\n document.getElementsByTagName('head')[0].appendChild(script);\n}", "function baz() {\n return eval();\n}", "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "static run( jsenCode ) {\n const threadContext = {\n code: jsenCode,\n pc: 0,\n labelList: {\n blockBegin: 0,\n blockEnd: jsenCode.length,\n },\n };\n JZENVM._runContext( threadContext );\n }", "function do_script(chain_opts,script_obj,chain_group,preload_this_script) {\n\t\t\tvar registry_item,\n\t\t\t\tregistry_items,\n\t\t\t\tready_cb = function(){ script_obj.ready_cb(script_obj,function(){ execute_preloaded_script(chain_opts,script_obj,registry_item); }); },\n\t\t\t\tfinished_cb = function(){ script_obj.finished_cb(script_obj,chain_group); }\n\t\t\t;\n\t\t\t\n\t\t\tscript_obj.src = canonical_uri(script_obj.src,chain_opts[_BasePath]);\n\t\t\tscript_obj.real_src = script_obj.src + \n\t\t\t\t// append cache-bust param to URL?\n\t\t\t\t(chain_opts[_CacheBust] ? ((/\\?.*$/.test(script_obj.src) ? \"&_\" : \"?_\") + ~~(Math.random()*1E9) + \"=\") : \"\")\n\t\t\t;\n\t\t\t\n\t\t\tif (!registry[script_obj.src]) registry[script_obj.src] = {items:[],finished:false};\n\t\t\tregistry_items = registry[script_obj.src].items;\n\n\t\t\t// allowing duplicates, or is this the first recorded load of this script?\n\t\t\tif (chain_opts[_AllowDuplicates] || registry_items.length == 0) {\n\t\t\t\tregistry_item = registry_items[registry_items.length] = {\n\t\t\t\t\tready:false,\n\t\t\t\t\tfinished:false,\n\t\t\t\t\tready_listeners:[ready_cb],\n\t\t\t\t\tfinished_listeners:[finished_cb]\n\t\t\t\t};\n\n\t\t\t\trequest_script(chain_opts,script_obj,registry_item,\n\t\t\t\t\t// which callback type to pass?\n\t\t\t\t\t(\n\t\t\t\t\t \t(preload_this_script) ? // depends on script-preloading\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tregistry_item.ready = true;\n\t\t\t\t\t\t\tfor (var i=0; i<registry_item.ready_listeners.length; i++) {\n\t\t\t\t\t\t\t\tregistry_item.ready_listeners[i]();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tregistry_item.ready_listeners = [];\n\t\t\t\t\t\t} :\n\t\t\t\t\t\tfunction(){ script_executed(registry_item); }\n\t\t\t\t\t),\n\t\t\t\t\t// signal if script-preloading should be used or not\n\t\t\t\t\tpreload_this_script\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tregistry_item = registry_items[0];\n\t\t\t\tif (registry_item.finished) {\n\t\t\t\t\tfinished_cb();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tregistry_item.finished_listeners.push(finished_cb);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "processLiveCodeJavascript(script) {\n if (!script)\n return '';\n const jsID = randomJavaScriptId();\n // Replace document.querySelector.* et al with section.querySelector.*\n script = script.replace(/([^a-zA-Z0-9_-]?)document\\s*\\.\\s*querySelector\\s*\\(/g, '$1container' + jsID + '.querySelector(');\n script = script.replace(/([^a-zA-Z0-9_-]?)document\\s*\\.\\s*querySelectorAll\\s*\\(/g, '$1container' + jsID + '.querySelectorAll(');\n script = script.replace(/([^a-zA-Z0-9_-]?)document\\s*\\.\\s*getElementById\\s*\\(/g, '$1container' + jsID + \".querySelector('#' + \");\n // Replace console.* with pseudoConsole.*\n script = script.replace(/([^a-zA-Z0-9_-])?console\\s*\\.\\s*/g, '$1shadowRoot' + jsID + '.host.pseudoConsole().');\n // Extract import (can't be inside a try...catch block)\n const imports = [];\n script = script.replace(/([^a-zA-Z0-9_-]?import.*)('.*'|\".*\");/g, (match, p1, p2) => {\n imports.push([match, p1, p2.slice(1, p2.length - 1)]);\n return '';\n });\n // Important: keep the ${script} on a separate line. The content could\n // be \"// a comment\" which would result in the script failing to parse\n return (imports\n .map((x) => {\n if (this.moduleMap[x[2]]) {\n return x[1] + '\"' + this.moduleMap[x[2]] + '\";';\n }\n return x[0];\n })\n .join('\\n') +\n `const shadowRoot${jsID} = document.querySelector(\"#${this.id}\").shadowRoot;` +\n `const container${jsID} = shadowRoot${jsID}.querySelector(\"#${this.containerId} div.output\");` +\n 'try{\\n' +\n script +\n `\\n} catch(err) { shadowRoot${jsID}.host.pseudoConsole().catch(err) }`);\n }", "function addModelToScript(dataHash){\n var modelType = dataHash.getItem('model');\n var modelParam = \"model_parameters_option_\" + modelType + \"_\";\n var content = \"\";\n\n // models\n if(modelType == \"WilsonCowan\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"c_ee=\" + dataHash.getItem(modelParam + \"c_ee\") + \", \" + \n \"c_ei=\" + dataHash.getItem(modelParam + \"c_ei\") + \", \" +\n \"c_ie=\" + dataHash.getItem(modelParam + \"c_ie\") + \", \" +\n \"c_ii=\" + dataHash.getItem(modelParam + \"c_ii\") + \", \" +\n \"tau_e=\" + dataHash.getItem(modelParam + \"tau_e\") + \", \" +\n \"tau_i=\" + dataHash.getItem(modelParam + \"tau_i\") + \", \" +\n \"a_e=\" + dataHash.getItem(modelParam + \"a_e\") + \", \" +\n \"b_e=\" + dataHash.getItem(modelParam + \"b_e\") + \", \" +\n \"c_e=\" + dataHash.getItem(modelParam + \"c_e\") + \", \" +\n \"theta_e=\" + dataHash.getItem(modelParam + \"theta_e\") + \", \" +\n \"a_i=\" + dataHash.getItem(modelParam + \"a_i\") + \", \" +\n \"b_i=\" + dataHash.getItem(modelParam + \"b_i\") + \", \" +\n \"c_i=\" + dataHash.getItem(modelParam + \"c_i\") + \", \" +\n \"r_e=\" + dataHash.getItem(modelParam + \"r_e\") + \", \" +\n \"r_i=\" + dataHash.getItem(modelParam + \"r_i\") + \", \" +\n \"k_e=\" + dataHash.getItem(modelParam + \"k_e\") + \", \" +\n \"k_i=\" + dataHash.getItem(modelParam + \"k_i\") + \", \" +\n \"P=\" + dataHash.getItem(modelParam + \"P\") + \", \" +\n \"Q=\" + dataHash.getItem(modelParam + \"Q\") + \", \" + \n \"alpha_e=\" + dataHash.getItem(modelParam + \"alpha_e\") + \", \" + \n \"alpha_i=\" + dataHash.getItem(modelParam + \"alpha_i\") + \", \" +\n \"state_variable_range_parameters_I=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_I\") + \", \" + \n \"state_variable_range_parameters_E=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_E\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") + // TODO\n \")\\n\";\n }\n\n else if(modelType == \"ReducedSetFitzHughNagumo\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"tau=\" + dataHash.getItem(modelParam + \"tau\") + \", \" + \n \"a=\" + dataHash.getItem(modelParam + \"a\") + \", \" +\n \"b=\" + dataHash.getItem(modelParam + \"b\") + \", \" +\n \"K11=\" + dataHash.getItem(modelParam + \"K11\") + \", \" +\n \"K12=\" + dataHash.getItem(modelParam + \"K12\") + \", \" +\n \"K21=\" + dataHash.getItem(modelParam + \"K21\") + \", \" +\n \"sigma=\" + dataHash.getItem(modelParam + \"sigma\") + \", \" +\n \"state_variable_range_parameters_alpha=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_alpha\") + \", \" +\n \"state_variable_range_parameters_beta=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_beta\") + \", \" +\n \"state_variable_range_parameters_xi=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_xi\") + \", \" +\n \"state_variable_range_parameters_eta=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_eta\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"ReducedSetHindmarshRose\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"r=\" + dataHash.getItem(modelParam + \"r\") + \", \" + \n \"a=\" + dataHash.getItem(modelParam + \"a\") + \", \" +\n \"b=\" + dataHash.getItem(modelParam + \"b\") + \", \" +\n \"c=\" + dataHash.getItem(modelParam + \"c\") + \", \" +\n \"d=\" + dataHash.getItem(modelParam + \"d\") + \", \" +\n \"s=\" + dataHash.getItem(modelParam + \"s\") + \", \" +\n \"xo=\" + dataHash.getItem(modelParam + \"xo\") + \", \" +\n \"K11=\" + dataHash.getItem(modelParam + \"K11\") + \", \" +\n \"K12=\" + dataHash.getItem(modelParam + \"K12\") + \", \" +\n \"K21=\" + dataHash.getItem(modelParam + \"K21\") + \", \" +\n \"sigma=\" + dataHash.getItem(modelParam + \"sigma\") + \", \" +\n \"mu=\" + dataHash.getItem(modelParam + \"mu\") + \", \" +\n \"state_variable_range_parameters_tau=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_tau\") + \", \" +\n \"state_variable_range_parameters_xi=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_xi\") + \", \" +\n \"state_variable_range_parameters_beta=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_beta\") + \", \" +\n \"state_variable_range_parameters_eta=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_eta\") + \", \" +\n \"state_variable_range_parameters_alpha=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_alpha\") + \", \" +\n \"state_variable_range_parameters_gamma=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_gamma\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"JansenRit\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"A=\" + dataHash.getItem(modelParam + \"A\") + \", \" + \n \"B=\" + dataHash.getItem(modelParam + \"B\") + \", \" +\n \"a=\" + dataHash.getItem(modelParam + \"a\") + \", \" +\n \"b=\" + dataHash.getItem(modelParam + \"b\") + \", \" +\n \"v0=\" + dataHash.getItem(modelParam + \"v0\") + \", \" +\n \"nu_max=\" + dataHash.getItem(modelParam + \"nu_max\") + \", \" +\n \"r=\" + dataHash.getItem(modelParam + \"r\") + \", \" +\n \"J=\" + dataHash.getItem(modelParam + \"J\") + \", \" +\n \"a_1=\" + dataHash.getItem(modelParam + \"a_1\") + \", \" +\n \"a_2=\" + dataHash.getItem(modelParam + \"a_2\") + \", \" +\n \"a_3=\" + dataHash.getItem(modelParam + \"a_3\") + \", \" +\n \"a_4=\" + dataHash.getItem(modelParam + \"a_4\") + \", \" +\n \"p_min=\" + dataHash.getItem(modelParam + \"p_min\") + \", \" +\n \"p_max=\" + dataHash.getItem(modelParam + \"p_max\") + \", \" +\n \"mu=\" + dataHash.getItem(modelParam + \"mu\") + \", \" +\n \"state_variable_range_parameters_y1=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y1\") + \", \" +\n \"state_variable_range_parameters_y0=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y0\") + \", \" +\n \"state_variable_range_parameters_y3=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y3\") + \", \" +\n \"state_variable_range_parameters_y2=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y2\") + \", \" +\n \"state_variable_range_parameters_y5=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y5\") + \", \" +\n \"state_variable_range_parameters_y4=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y4\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"ZetterbergJansen\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"He=\" + dataHash.getItem(modelParam + \"He\") + \", \" + \n \"Hi=\" + dataHash.getItem(modelParam + \"Hi\") + \", \" +\n \"ke=\" + dataHash.getItem(modelParam + \"ke\") + \", \" +\n \"ki=\" + dataHash.getItem(modelParam + \"ki\") + \", \" +\n \"rho_2=\" + dataHash.getItem(modelParam + \"rho_2\") + \", \" +\n \"e0=\" + dataHash.getItem(modelParam + \"e0\") + \", \" +\n \"rho_1=\" + dataHash.getItem(modelParam + \"rho_1\") + \", \" +\n \"gamma_1=\" + dataHash.getItem(modelParam + \"gamma_1\") + \", \" +\n \"gamma_2=\" + dataHash.getItem(modelParam + \"gamma_2\") + \", \" +\n \"gamma_3=\" + dataHash.getItem(modelParam + \"gamma_3\") + \", \" +\n \"gamma_4=\" + dataHash.getItem(modelParam + \"gamma_4\") + \", \" +\n \"gamma_5=\" + dataHash.getItem(modelParam + \"gamma_5\") + \", \" +\n \"state_variable_range_parameters_v1=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_v1\") + \", \" +\n \"state_variable_range_parameters_v2=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_v2\") + \", \" +\n \"state_variable_range_parameters_v3=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_v3\") + \", \" +\n \"state_variable_range_parameters_v4=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_v4\") + \", \" +\n \"state_variable_range_parameters_v5=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_v5\") + \", \" +\n \"state_variable_range_parameters_v6=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_v6\") + \", \" +\n \"state_variable_range_parameters_v7=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_v7\") + \", \" +\n \"state_variable_range_parameters_y1=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y1\") + \", \" +\n \"state_variable_range_parameters_y3=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y3\") + \", \" +\n \"state_variable_range_parameters_y2=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y2\") + \", \" +\n \"state_variable_range_parameters_y5=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y5\") + \", \" +\n \"state_variable_range_parameters_y4=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_y4\") + \", \" +\n \"gamma_1T=\" + dataHash.getItem(modelParam + \"gamma_1T\") + \", \" +\n \"gamma_3T=\" + dataHash.getItem(modelParam + \"gamma_3T\") + \", \" +\n \"gamma_2T=\" + dataHash.getItem(modelParam + \"gamma_2T\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"Generic2dOscillator\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"tau=\" + dataHash.getItem(modelParam + \"tau\") + \", \" + \n \"Iext=\" + dataHash.getItem(modelParam + \"Iext\") + \", \" +\n \"a=\" + dataHash.getItem(modelParam + \"a\") + \", \" +\n \"b=\" + dataHash.getItem(modelParam + \"b\") + \", \" +\n \"c=\" + dataHash.getItem(modelParam + \"c\") + \", \" +\n \"e=\" + dataHash.getItem(modelParam + \"e\") + \", \" +\n \"f=\" + dataHash.getItem(modelParam + \"f\") + \", \" +\n \"g=\" + dataHash.getItem(modelParam + \"g\") + \", \" +\n \"alpha=\" + dataHash.getItem(modelParam + \"alpha\") + \", \" +\n \"beta=\" + dataHash.getItem(modelParam + \"beta\") + \", \" +\n \"state_variable_range_parameters_W=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_W\") + \", \" +\n \"state_variable_range_parameters_V=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_V\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"d=\" + dataHash.getItem(modelParam + \"d\") + \", \" +\n \"gamma=\" + dataHash.getItem(modelParam + \"gamma\") + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"LarterBreakspear\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"a_ne=\" + dataHash.getItem(modelParam + \"a_ne\") + \", \" + \n \"tau_K=\" + dataHash.getItem(modelParam + \"tau_K\") + \", \" +\n \"VNa=\" + dataHash.getItem(modelParam + \"VNa\") + \", \" +\n \"ani=\" + dataHash.getItem(modelParam + \"ani\") + \", \" +\n \"gNa=\" + dataHash.getItem(modelParam + \"gNa\") + \", \" +\n \"QZ_max=\" + dataHash.getItem(modelParam + \"QZ_max\") + \", \" +\n \"TCa=\" + dataHash.getItem(modelParam + \"TCa\") + \", \" +\n \"d_Na=\" + dataHash.getItem(modelParam + \"d_Na\") + \", \" +\n \"state_variable_range_parameters_Z=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_Z\") + \", \" +\n \"state_variable_range_parameters_W=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_W\") + \", \" +\n \"state_variable_range_parameters_V=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_V\") + \", \" +\n \"gCa=\" + dataHash.getItem(modelParam + \"gCa\") + \", \" +\n \"phi=\" + dataHash.getItem(modelParam + \"phi\") + \", \" +\n \"TK=\" + dataHash.getItem(modelParam + \"TK\") + \", \" +\n \"TNa=\" + dataHash.getItem(modelParam + \"TNa\") + \", \" +\n \"gL=\" + dataHash.getItem(modelParam + \"gL\") + \", \" +\n \"gK=\" + dataHash.getItem(modelParam + \"gK\") + \", \" +\n \"d_Z=\" + dataHash.getItem(modelParam + \"d_Z\") + \", \" +\n \"aie=\" + dataHash.getItem(modelParam + \"aie\") + \", \" +\n \"C=\" + dataHash.getItem(modelParam + \"C\") + \", \" +\n \"d_V=\" + dataHash.getItem(modelParam + \"d_V\") + \", \" +\n \"VK=\" + dataHash.getItem(modelParam + \"VK\") + \", \" +\n \"VL=\" + dataHash.getItem(modelParam + \"VL\") + \", \" +\n \"d_K=\" + dataHash.getItem(modelParam + \"d_K\") + \", \" +\n \"VT=\" + dataHash.getItem(modelParam + \"VT\") + \", \" +\n \"ZT=\" + dataHash.getItem(modelParam + \"ZT\") + \", \" +\n \"VCa=\" + dataHash.getItem(modelParam + \"VCa\") + \", \" +\n \"b=\" + dataHash.getItem(modelParam + \"b\") + \", \" +\n \"d_Ca=\" + dataHash.getItem(modelParam + \"d_Ca\") + \", \" +\n \"aee=\" + dataHash.getItem(modelParam + \"aee\") + \", \" +\n \"Iext=\" + dataHash.getItem(modelParam + \"Iext\") + \", \" +\n \"aei=\" + dataHash.getItem(modelParam + \"aei\") + \", \" +\n \"QV_max=\" + dataHash.getItem(modelParam + \"QV_max\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"ReducedWongWang\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"a=\" + dataHash.getItem(modelParam + \"a\") + \", \" + \n \"b=\" + dataHash.getItem(modelParam + \"b\") + \", \" +\n \"d=\" + dataHash.getItem(modelParam + \"d\") + \", \" +\n \"gamma=\" + dataHash.getItem(modelParam + \"gamma\") + \", \" +\n \"tau_s=\" + dataHash.getItem(modelParam + \"tau_s\") + \", \" +\n \"w=\" + dataHash.getItem(modelParam + \"w\") + \", \" +\n \"J_N=\" + dataHash.getItem(modelParam + \"J_N\") + \", \" +\n \"I_o=\" + dataHash.getItem(modelParam + \"I_o\") + \", \" +\n \"state_variable_range_parameters_S=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_S\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"Kuramoto\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"omega=\" + dataHash.getItem(modelParam + \"omega\") + \", \" +\n \"theta=\" + dataHash.getItem(modelParam + \"theta\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"Hopfield\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"taux=\" + dataHash.getItem(modelParam + \"taux\") + \", \" + \n \"tauT=\" + dataHash.getItem(modelParam + \"tauT\") + \", \" +\n \"dynamic=\" + dataHash.getItem(modelParam + \"dynamic\") + \", \" +\n \"state_variable_range_parameters_x=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_x\") + \", \" +\n \"state_variable_range_parameters_theta=\" + dataHash.getItem(modelParam + \"state_variable_range_parameters_theta\") + \", \" +\n \"variables_of_interest=\" + variables_of_interest_string + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"Epileptor\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"Iext=\" + dataHash.getItem(modelParam + \"Iext\") + \", \" + \n \"Iext2=\" + dataHash.getItem(modelParam + \"Iext2\") + \", \" +\n \"x0=\" + dataHash.getItem(modelParam + \"x0\") + \", \" +\n \"r=\" + dataHash.getItem(modelParam + \"r\") + \", \" +\n \"slope=\" + dataHash.getItem(modelParam + \"slope\") + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") +\n \")\\n\";\n }\n\n else if(modelType == \"EpileptorPermittivityCoupling\"){\n \n var str_varOfInterest = \"\" + dataHash.getItem(modelParam + \"variables_of_interest\");\n var variables_of_interest_array = str_varOfInterest.split(',');\n var variables_of_interest_string = \"[\";\n \n for(var i = 0; i< variables_of_interest_array.length; i++){\n variables_of_interest_string += \"\\\"\" + variables_of_interest_array[i] + \"\\\",\"; \n }\n // delete last comma sign\n variables_of_interest_string = variables_of_interest_string.substring(0, variables_of_interest_string.length - 1);\n variables_of_interest_string += \"]\";\n \n content = \"oscilator = models.\" + modelType + \"(\" +\n \"Iext=\" + dataHash.getItem(modelParam + \"Iext\") + \", \" + \n \"Iext2=\" + dataHash.getItem(modelParam + \"Iext2\") + \", \" +\n \"x0=\" + dataHash.getItem(modelParam + \"x0\") + \", \" +\n \"r=\" + dataHash.getItem(modelParam + \"r\") + \", \" +\n \"slope=\" + dataHash.getItem(modelParam + \"slope\") + \", \" +\n \"tt=\" + dataHash.getItem(modelParam + \"tt\") + \", \" +\n \"noise=\" + dataHash.getItem(modelParam + \"noise\") + \", \" +\n \"noise_parameters_option_Noise_ntau=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_ntau\") + \", \" +\n \"noise_parameters_option_Noise_random_stream=\" + dataHash.getItem(modelParam + \"noise_parameters_option_Noise_random_stream\") + \", \" +\n \"noise_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(modelParam + \"noise_parameters_option_RandomStream_init_seed\") + // TOOD\n \")\\n\";\n }\n\n content += \"\\noscilator.configure()\\n\\n\";\n\n // INTEGRATORS\n var integratorType = dataHash.getItem('integrator');\n var integratorParam = \"integrator_parameters_option_\" + integratorType + \"_\";\n \n if(integratorType == \"HeunDeterministic\"){ //data_integratorHeunDeterministic\n //integrator_parameters_option_HeunDeterministic_dt\n content += \"dt=\" + dataHash.getItem(integratorParam + \"dt\") + \", \";\n }\n\n else if(integratorType == \"HeunStochastic\"){ //data_integratorHeunStochastic\n //integrator_parameters_option_HeunStochastic_noise\n //integrator_parameters_option_HeunStochastic_noise_parameters_option_Additive_ntau\n //integrator_parameters_option_HeunStochastic_noise_parameters_option_Additive_random_stream_RandomStream\n //integrator_parameters_option_HeunStochastic_noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed\n //integrator_parameters_option_HeunStochastic_noise_parameters_option_Additive_nsig\n content += \"noise=\" + dataHash.getItem(integratorParam + \"noise\");\n\n if(integratorType == \"Additive\"){\n content += \"ntau=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_ntau\") + \", \" +\n \"noise_parameters_option_Additive_random_stream_RandomStream=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_random_stream_RandomStream\") + \", \" +\n \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed\") +\n \"noise_parameters_option_Additive_nsig=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_nsig\");\n }\n else if(integratorType == \"Multiplicative\"){\n content += \"noise_parameters_option_Multiplicative_ntau=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_ntau\") + \", \" +\n \"noise_parameters_option_Multiplicative_b=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_b\") + \", \" +\n \"noise_parameters_option_Multiplicative_a=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_a\") + \", \" +\n \"noise_parameters_option_Multiplicative_b=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_b\") + \", \" +\n // ...weitere b aus select box...\n \"noise_parameters_option_Multiplicative_random_stream_RandomStream=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_random_stream_RandomStream\") + \", \" +\n \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed\") + \", \" +\n \"noise_parameters_option_Additive_nsig=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_nsig\");\n }\n }\n\n else if(integratorType == \"EulerDeterministic\"){ //data_integratorEulerDeterministic\n content += \"dt=\" + dataHash.getItem(integratorParam + \"dt\");\n }\n\n else if(integratorType == \"EulerStochastic\"){ //data_integratorEulerStochastic\n content += \"noise=\" + dataHash.getItem(integratorParam + \"noise\");\n\n if(integratorType == \"Additive\"){\n content += \"noise_parameters_option_Additive_ntau=\" +dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_ntau\") + \", \" +\n \"noise_parameters_option_Additive_random_stream_RandomStream=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_random_stream_RandomStream\") + \", \" +\n \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed\") + \", \" +\n \"noise_parameters_option_Additive_nsig=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_nsig\");\n }\n else if(integratorType == \"Multiplicative\"){\n content += \"noise_parameters_option_Multiplicative_ntau=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_ntau\") + \", \" +\n \"noise_parameters_option_Multiplicative_b=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_b\") + \", \" +\n \"noise_parameters_option_Multiplicative_a=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_a\") + \", \" +\n \"noise_parameters_option_Multiplicative_b=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_b\") + \", \" +\n // ...weitere b aus select box...\n \"noise_parameters_option_Multiplicative_random_stream_RandomStream=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Multiplicative_random_stream_RandomStream\") + \", \" +\n \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_random_stream_parameters_option_RandomStream_init_seed\") + \", \" +\n \"noise_parameters_option_Additive_nsig=\" + dataHash.getItem(integratorParam + \"noise_parameters_option_Additive_nsig\");\n }\n } // integratorType\n\n // MONITORS\n var monitorType = dataHash.getItem('monitors');\n var monitorParam = \"monitors_parameters_option_\";\n \n monitors_parameters_option = new Array('SubSample_period', 'SpatialAverage_spatial_mask', 'SpatialAverage_period', 'GlobalAverage_period', 'TemporalAverage_period', 'EEG_projection_matrix_data', 'EEG_period', 'SphericalEEG_sensors', 'SphericalEEG_sigma', 'SphericalEEG_period', 'data_monitorsSphericalMEG', 'SphericalMEG_sensors', 'SphericalMEG_period');\n content += batch(dataHash, monitorParam, monitors_parameters_option);\n\n //monitors_parameters_option_SubSample_period\n //monitors_parameters_option_SpatialAverage_spatial_mask\n //monitors_parameters_option_SpatialAverage_period\n //monitors_parameters_option_GlobalAverage_period\n //monitors_parameters_option_TemporalAverage_period\n //monitors_parameters_option_EEG_projection_matrix_data\n //monitors_parameters_option_EEG_period\n //monitors_parameters_option_SphericalEEG_sensors\n //monitors_parameters_option_SphericalEEG_sigma\n //monitors_parameters_option_SphericalEEG_period\n //data_monitorsSphericalMEG\n //monitors_parameters_option_SphericalMEG_sensors\n //monitors_parameters_option_SphericalMEG_period\n \n monitorParam = \"monitors_parameters_option_\" + monitorType + \"_\";\n\n if(monitorType == \"Bold_hrf_kernel\"){\n monitors_parameters_option_monitorType = new Array('Gamma_equation', 'Gamma_parameters', 'Gamma_parameters_parameters_factorial', 'Gamma_parameters_parameters_tau', 'Gamma_parameters_parameters_a', 'Gamma_parameters_parameters_n', 'data_monitors_parameters_option_Bold_hrf_kernelDoubleExponential', 'DoubleExponential_equation', 'dict_DoubleExponential_parameters', 'DoubleExponential_parameters_parameters_a', 'DoubleExponential_parameters_parameters_amp_2', 'DoubleExponential_parameters_parameters_amp_1', 'DoubleExponential_parameters_parameters_f_1', 'DoubleExponential_parameters_parameters_f_1', 'DoubleExponential_parameters_parameters_f_2', 'DoubleExponential_parameters_parameters_pi', 'DoubleExponential_parameters_parameters_tau_2', 'DoubleExponential_parameters_parameters_tau_1', 'data_monitors_parameters_option_Bold_hrf_kernelFirstOrderVolterra', 'FirstOrderVolterra_equation', 'FirstOrderVolterra_parameters', 'FirstOrderVolterra_parameters_parameters_tau_f', 'FirstOrderVolterra_parameters_parameters_k_1', 'FirstOrderVolterra_parameters_parameters_V_0', 'FirstOrderVolterra_parameters_parameters_tau_s', 'data_monitors_parameters_option_Bold_hrf_kernelMixtureOfGammas', 'MixtureOfGammas_equation', 'MixtureOfGammas_parameters', 'MixtureOfGammas_parameters_parameters_gamma_a_2', 'MixtureOfGammas_parameters_parameters_gamma_a_1', 'MixtureOfGammas_parameters_parameters_a_2', 'MixtureOfGammas_parameters_parameters_a_1', 'MixtureOfGammas_parameters_parameters_c', 'MixtureOfGammas_parameters_parameters_l');\n content += batch(dataHash, monitorParam, monitors_parameters_option_monitorType);\n content += \"monitors_parameters_option_Bold_period=\" + monitors_parameters_option_Bold_period + \", \";\n\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_Gamma_equation\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_Gamma_parameters\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_Gamma_parameters_parameters_factorial\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_Gamma_parameters_parameters_tau\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_Gamma_parameters_parameters_a\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_Gamma_parameters_parameters_n\n //data_monitors_parameters_option_Bold_hrf_kernelDoubleExponential\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_equation\n //dict_monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_a\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_amp_2\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_amp_1\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_f_1\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_f_1\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_f_2\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_pi\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_tau_2\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_tau_1\n //data_monitors_parameters_option_Bold_hrf_kernelFirstOrderVolterra\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_FirstOrderVolterra_equation\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_FirstOrderVolterra_parameters\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_tau_f\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_k_1\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_V_0\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_tau_s\n //data_monitors_parameters_option_Bold_hrf_kernelMixtureOfGammas\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_equation\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_parameters\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_gamma_a_2\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_gamma_a_1\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_a_2\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_a_1\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_c\n //monitors_parameters_option_Bold_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_l\n //monitors_parameters_option_Bold_period\n }\n \n else if(monitorType == \"BoldRegionROI\"){\n monitors_parameters_option_monitorType = new Array('hrf_kernel', 'hrf_kernel_DoubleExponential', 'hrf_kernel_FirstOrderVolterra', 'hrf_kernel', 'hrf_kernel_MixtureOfGammas');\n content += batch(dataHash, monitorParam, monitors_parameters_option_monitorType);\n\n monitors_parameters_option_monitorType = new Array('Gamma_equation', 'Gamma_parameters', 'Gamma_parameters_parameters_factorial', 'Gamma_parameters_parameters_tau', 'Gamma_parameters_parameters_a', 'Gamma_parameters_parameters_n', 'data_hrf_kernelDoubleExponential', 'DoubleExponential_equation', 'DoubleExponential_parameters', 'DoubleExponential_parameters_parameters_a', 'DoubleExponential_parameters_parameters_amp_2', 'DoubleExponential_parameters_parameters_amp_1', 'DoubleExponential_parameters_parameters_f_1', 'DoubleExponential_parameters_parameters_f_2', 'DoubleExponential_parameters_parameters_pi', 'DoubleExponential_parameters_parameters_tau_2', 'DoubleExponential_parameters_parameters_tau_1', 'data_hrf_kernelFirstOrderVolterra', 'FirstOrderVolterra_equation', 'FirstOrderVolterra_parameters', 'dict_FirstOrderVolterra_parameters', 'FirstOrderVolterra_parameters_parameters_tau_f', 'FirstOrderVolterra_parameters_parameters_k_1', 'FirstOrderVolterra_parameters_parameters_V_0', 'FirstOrderVolterra_parameters_parameters_tau_s', 'data_hrf_kernelMixtureOfGammas', 'MixtureOfGammas_equation', 'MixtureOfGammas_parameters', 'MixtureOfGammas_parameters_parameters_gamma_a_2', 'MixtureOfGammas_parameters_parameters_gamma_a_1', 'MixtureOfGammas_parameters_parameters_c', 'MixtureOfGammas_parameters_parameters_l');\n content += batch(monitorParam + \"kernel_parameters_option\", monitors_parameters_option_monitorType);\n\n //monitors_parameters_option_BoldRegionROI_hrf_kernel\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_DoubleExponential\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_FirstOrderVolterra\n //monitors_parameters_option_BoldRegionROI_hrf_kernel\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_MixtureOfGammas\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_Gamma_equation\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_Gamma_parameters\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_Gamma_parameters_parameters_factorial\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_Gamma_parameters_parameters_tau\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_Gamma_parameters_parameters_a\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_Gamma_parameters_parameters_n\n //data_monitors_parameters_option_BoldRegionROI_hrf_kernelDoubleExponential\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_equation\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_a\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_amp_2\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_amp_1\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_f_1\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_f_2\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_pi\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_tau_2\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_DoubleExponential_parameters_parameters_tau_1\n //data_monitors_parameters_option_BoldRegionROI_hrf_kernelFirstOrderVolterra\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_FirstOrderVolterra_equation\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_FirstOrderVolterra_parameters\n //dict_monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_FirstOrderVolterra_parameters\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_tau_f\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_k_1\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_V_0\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_FirstOrderVolterra_parameters_parameters_tau_s\n //data_monitors_parameters_option_BoldRegionROI_hrf_kernelMixtureOfGammas\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_MixtureOfGammas_equation\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_MixtureOfGammas_parameters\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_gamma_a_2\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_gamma_a_1\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_c\n //monitors_parameters_option_BoldRegionROI_hrf_kernel_parameters_option_MixtureOfGammas_parameters_parameters_l\n //monitors_parameters_option_BoldRegionROI_period\n }\n \n else if(monitorType == \"SEEG_sensors\"){\n monitors_parameters_option_monitorType = new Array('SEEG_sensors', 'SEEG_sensorsdata_select', 'SEEG_sigma', 'SEEG_period');\n content += batch(dataHash, monitorParam, monitors_parameters_option_monitorType);\n //monitors_parameters_option_SEEG_sensors\n //monitors_parameters_option_SEEG_sensorsdata_select\n //monitors_parameters_option_SEEG_sigma\n //monitors_parameters_option_SEEG_period\n }\n\n content += \"\\n\\nLOG.info(\\\"Starting simulation...\\\")\\n\\n\" +\n \"raw_data = []\\n\" +\n \"raw_time = []\\n\" +\n \"tavg_data = []\\n\" +\n \"tavg_time = []\\n\\n\"\n \n content += \"for raw, tavg in sim(simulation_length=\" + dataHash.getItem(simulation_length) + \"):\\n\" +\n \" if not raw is None:\\n\" +\n \" raw_time.append(raw[0])\\n\" +\n \" raw_data.append(raw[1])\\n\\n\" +\n \" if not tavg is None:\\n\" +\n \" tavg_time.append(tavg[0])\\n\" +\n \" tavg_data.append(tavg[1])\\n\\n\" +\n \"LOG.info(\\\"Finished simulation.\\\")\\n\\n\"\n\n content +=\"print 'It run for %d sec.' % (datetime.datetime.now() - START_TIME).seconds\"\n\n return content;\n}", "function scriptLoad( inc ) {\n if ( typeof inc === 'number' ) {\n scriptsLoading += inc;\n\n if ( scriptsLoading === 0 && scriptsLoadFun ) {\n scriptsLoadFun();\n scriptsLoadFun = null;\n }\n\n // store the fun to call it later\n } else if ( inc instanceof Function ) {\n scriptsLoadFuns.push( inc );\n\n } else {\n console.log( inc );\n\n throw new Error( \"unknown parameter given \" + inc );\n }\n}", "function globalEval (js, url) {\n if (typeof js === T_STRING) {\n var\n node = mkEl('script'),\n root = document.documentElement;\n\n // make the source available in the \"(no domain)\" tab\n // of Chrome DevTools, with a .js extension\n if (url) { js += '\\n//# sourceURL=' + url + '.js'; }\n\n node.text = js;\n root.appendChild(node);\n root.removeChild(node);\n }\n}", "function runScripts() {\n var scripts = document.getElementsByTagName('script');\n\n // Array.prototype.slice cannot be used on NodeList on IE8\n var jsxScripts = [];\n for (var i = 0; i < scripts.length; i++) {\n if (scripts.item(i).type.indexOf('text/jsx') !== -1) {\n jsxScripts.push(scripts.item(i));\n }\n }\n\n console.warn(\n 'You are using the in-browser JSX transformer. Be sure to precompile ' +\n 'your JSX for production - ' +\n 'http://facebook.github.io/react/docs/tooling-integration.html#jsx'\n );\n\n loadScripts(jsxScripts);\n}", "function executeScript(script) {\n Reporter_1.Reporter.debug(`Executing script: ${script}`);\n tryBlock(() => browser.execute(script), `Failed to execute script: ${script}`);\n }", "async function run_code(script) {\n let output = null;\n let python_error = null;\n let worker_error = null;\n\n try {\n const { results, error } = await asyncRun(script, \"\");\n if (results) {\n output = results;\n } else if (error) {\n python_error = error;\n }\n } catch (e) {\n worker_error = `pyodide worker error at ${e.filename}, Line: ${e.lineno}, ${e.message}`\n }\n\n return {\n \"output\": output,\n \"python_error\": python_error,\n \"worker_error\": worker_error,\n }\n }", "async _executeScript(script, ...var_args) {\n return this.element()\n .getDriver()\n .executeScript(script, ...var_args);\n }", "async addScriptTag(options) {\n const { url = null, path = null, content = null, type = '' } = options;\n if (url !== null) {\n try {\n const context = await this.executionContext();\n return (await context.evaluateHandle(addScriptUrl, url, type)).asElement();\n }\n catch (error) {\n throw new Error(`Loading script from ${url} failed`);\n }\n }\n if (path !== null) {\n if (!environment_js_1.isNode) {\n throw new Error('Cannot pass a filepath to addScriptTag in the browser environment.');\n }\n const fs = await helper_js_1.helper.importFSModule();\n let contents = await fs.promises.readFile(path, 'utf8');\n contents += '//# sourceURL=' + path.replace(/\\n/g, '');\n const context = await this.executionContext();\n return (await context.evaluateHandle(addScriptContent, contents, type)).asElement();\n }\n if (content !== null) {\n const context = await this.executionContext();\n return (await context.evaluateHandle(addScriptContent, content, type)).asElement();\n }\n throw new Error('Provide an object with a `url`, `path` or `content` property');\n async function addScriptUrl(url, type) {\n const script = document.createElement('script');\n script.src = url;\n if (type)\n script.type = type;\n const promise = new Promise((res, rej) => {\n script.onload = res;\n script.onerror = rej;\n });\n document.head.appendChild(script);\n await promise;\n return script;\n }\n function addScriptContent(content, type = 'text/javascript') {\n const script = document.createElement('script');\n script.type = type;\n script.text = content;\n let error = null;\n script.onerror = (e) => (error = e);\n document.head.appendChild(script);\n if (error)\n throw error;\n return script;\n }\n }", "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input', myGM.$('#container'), 'alreadyExecutedScript');\r\n\talreadyExecuted.type\t= 'hidden';\r\n\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "runScripts(sticky = false, whitelisted = DEFAULT_WHITELIST) {\n const evalCollectedScripts = (scriptsToProcess) => {\n if (scriptsToProcess.length) {\n // script source means we have to eval the existing\n // scripts before we run the 'include' command\n // this.globalEval(finalScripts.join(\"\\n\"));\n let joinedScripts = [];\n new Es2019Array_1.Es2019Array(...scriptsToProcess).forEach(item => {\n if (!item.nonce) {\n joinedScripts.push(item.evalText);\n }\n else {\n if (joinedScripts.length) {\n this.globalEval(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n (!sticky) ?\n this.globalEval(item.evalText, item.nonce) :\n this.globalEvalSticky(item.evalText, item.nonce);\n }\n });\n if (joinedScripts.length) {\n (!sticky) ? this.globalEval(joinedScripts.join(\"\\n\")) :\n this.globalEvalSticky(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n scriptsToProcess = [];\n }\n return scriptsToProcess;\n };\n let finalScripts = [], allowedItemTypes = [\"\", \"script\", \"text/javascript\", \"text/ecmascript\", \"ecmascript\"], execScript = (item) => {\n var _a, _b, _c, _d;\n let tagName = item.tagName;\n let itemType = ((_a = item === null || item === void 0 ? void 0 : item.type) !== null && _a !== void 0 ? _a : '').toLowerCase();\n if (tagName &&\n eqi(tagName, \"script\") &&\n allowedItemTypes.indexOf(itemType) != -1) {\n let src = item.getAttribute('src');\n if ('undefined' != typeof src\n && null != src\n && src.length > 0) {\n let nonce = (_b = item === null || item === void 0 ? void 0 : item.nonce) !== null && _b !== void 0 ? _b : item.getAttribute('nonce').value;\n // we have to move this into an inner if because chrome otherwise chokes\n // due to changing the and order instead of relying on left to right\n // if jsf.js is already registered we do not replace it anymore\n if (whitelisted(src)) {\n // we run the collected scripts, before we run the 'include' command\n finalScripts = evalCollectedScripts(finalScripts);\n if (!sticky) {\n (!!nonce) ? this.loadScriptEval(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEval(src, 0);\n }\n else {\n (!!nonce) ? this.loadScriptEvalSticky(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEvalSticky(src, 0);\n }\n }\n }\n else {\n // embedded script auto eval\n // probably not needed anymore\n let evalText = trim(item.text || item.innerText || item.innerHTML);\n let go = true;\n while (go) {\n go = false;\n if (evalText.substring(0, 4) == \"<!--\") {\n evalText = evalText.substring(4);\n go = true;\n }\n if (evalText.substring(0, 4) == \"//<!--\") {\n evalText = evalText.substring(6);\n go = true;\n }\n if (evalText.substring(0, 11) == \"//<![CDATA[\") {\n evalText = evalText.substring(11);\n go = true;\n }\n }\n let nonce = (_d = (_c = item === null || item === void 0 ? void 0 : item.nonce) !== null && _c !== void 0 ? _c : item.getAttribute('nonce').value) !== null && _d !== void 0 ? _d : '';\n // we have to run the script under a global context\n // we store the script for fewer calls to eval\n finalScripts.push({\n nonce,\n evalText\n });\n }\n }\n };\n try {\n let scriptElements = new DomQuery(this.filterSelector(\"script\"), this.querySelectorAll(\"script\"));\n // script execution order by relative pos in their dom tree\n scriptElements.asArray\n .flatMap(item => [...item.values])\n .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3) // preceding 2, following == 4)\n .forEach(item => execScript(item));\n evalCollectedScripts(finalScripts);\n }\n catch (e) {\n if (console && console.error) {\n // not sure if we\n // should use our standard\n // error mechanisms here\n // because in the head appendix\n // method only a console\n // error would be raised as well\n console.error(e.message || e.description);\n }\n }\n finally {\n // the usual ie6 fix code\n // the IE6 garbage collector is broken\n // nulling closures helps somewhat to reduce\n // mem leaks, which are impossible to avoid\n // at this browser\n execScript = null;\n }\n return this;\n }", "function loadScripts(transformFn, scripts) {\n const result = [];\n const count = scripts.length;\n\n function check() {\n let script, i;\n\n for (i = 0; i < count; i++) {\n script = result[i];\n\n if (script.loaded && !script.executed) {\n script.executed = true;\n run(transformFn, script);\n } else if (!script.loaded && !script.error && !script.async) {\n break;\n }\n }\n }\n\n scripts.forEach((script, i) => {\n const scriptData = {\n // script.async is always true for non-JavaScript script tags\n async: script.hasAttribute(\"async\"),\n error: false,\n executed: false,\n plugins: getPluginsOrPresetsFromScript(script, \"data-plugins\"),\n presets: getPluginsOrPresetsFromScript(script, \"data-presets\"),\n };\n\n if (script.src) {\n result[i] = {\n ...scriptData,\n content: null,\n loaded: false,\n url: script.src,\n };\n\n load(\n script.src,\n content => {\n result[i].loaded = true;\n result[i].content = content;\n check();\n },\n () => {\n result[i].error = true;\n check();\n },\n );\n } else {\n result[i] = {\n ...scriptData,\n content: script.innerHTML,\n loaded: true,\n url: script.getAttribute(\"data-module\") || null,\n };\n }\n });\n\n check();\n}" ]
[ "0.61933666", "0.59797895", "0.5734536", "0.5630442", "0.5562425", "0.5440175", "0.5411526", "0.53185433", "0.5271838", "0.52667075", "0.52625674", "0.52625674", "0.5241362", "0.5230076", "0.5201438", "0.51871127", "0.517867", "0.516801", "0.5165879", "0.51389235", "0.51377875", "0.50995314", "0.5096614", "0.50834274", "0.507482", "0.5069575", "0.50545114", "0.5050907", "0.50430655", "0.5022922", "0.5022922", "0.5002073", "0.49979302", "0.49905333", "0.49905333", "0.49860618", "0.49348885", "0.49191418", "0.49188355", "0.49137357", "0.4903684", "0.49034354", "0.49012315", "0.48935765", "0.48797435", "0.48532477", "0.48529348", "0.4851923", "0.485144", "0.48309413", "0.48295608", "0.48293117", "0.48275656", "0.48275656", "0.48020914", "0.47998926", "0.47974548", "0.47824764", "0.47762397", "0.4774144", "0.47598135", "0.47468644", "0.472691", "0.4722558", "0.47214898", "0.47214392", "0.4717394", "0.47142336", "0.47132486", "0.47066852", "0.46906072", "0.46905437", "0.46836784", "0.46795923", "0.46704265", "0.4663254", "0.46602854", "0.46602854", "0.46602854", "0.46602854", "0.46602854", "0.46602854", "0.46602854", "0.46587163", "0.4652384", "0.4650893", "0.46323025", "0.4626116", "0.46103457", "0.45892292", "0.45811057", "0.4580545", "0.45649007", "0.45597085", "0.45438376", "0.45431733", "0.45227802", "0.45120576", "0.45094287", "0.44990584" ]
0.6708901
0
Terminates the scene graph execution context, closes the designated messaging port and generally cleans up the ThreeDOMExecutionContext so that it can be properly garbage collected.
async terminate() { this[$worker].terminate(); const modelGraftManipulator = this[$modelGraftManipulator]; if (modelGraftManipulator != null) { modelGraftManipulator.dispose(); this[$modelGraftManipulator] = null; } const port = await this[$workerInitializes]; port.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "end() {\n this.medals();\n this.endMessage();\n this.cleanUp();\n this.gc();\n }", "exitFrame() {\n if (this.contexts && this.contexts.length > 1) {\n this.contexts = this.contexts.slice();\n this.contexts.splice(-1);\n this.currentContextIds.shift();\n }\n else {\n throw new Error('Cannot exit frame, the context is empty');\n }\n }", "exitFrame() {\n if (this.contexts && this.contexts.length > 1) {\n this.contexts = this.contexts.slice();\n this.contexts.splice(-1);\n this.currentContextIds.shift();\n }\n else {\n throw new Error('Cannot exit frame, the context is empty');\n }\n }", "destroy() {\n if (this.engineWorker != null) {\n engineLoader.returnEngineWorker(this.engineWorker);\n }\n this.eventEmitter.removeAllListeners();\n }", "finish() {\n this._ctx.restore();\n }", "destroy() {\n this.disposables.dispose();\n this.controlView.destroy();\n this.extensionView.destroy();\n this.fileView.destroy();\n this.contentView.destroy();\n this.element.remove();\n // Do not stop external process.\n this.serverProcess = null;\n }", "exit() {\n this.emitter.emit('exit');\n if (this.browser) this.browser.close();\n }", "close() {\n this._observers = undefined;\n if (this.notificationQueue != null) {\n // Cancel the notification iterator\n this.notificationQueue.return(undefined).catch(err => {\n this.handleNotificationError(err);\n });\n this.notificationQueue = undefined;\n }\n if (this.context.parent && this._parentContextEventListener) {\n this.context.parent.removeListener('bind', this._parentContextEventListener);\n this.context.parent.removeListener('unbind', this._parentContextEventListener);\n this._parentContextEventListener = undefined;\n }\n }", "function exitCtx() {\n ctxStack.pop();\n }", "_exitContext() {\n this._stack.pop();\n }", "destroy() {\n console.log('[Pipeline] Destroying Pipeline');\n this.abortController_.abort();\n if (this.source_) this.source_.destroy();\n if (this.frameTransform_) this.frameTransform_.destroy();\n if (this.sink_) this.sink_.destroy();\n }", "destroy() {\n this._end();\n }", "terminate() {\n this._child.send({\n cmd: 'terminate',\n data: null\n });\n this._child.kill();\n this._child.disconnect();\n }", "quit() {\n if (this.process) {\n this.process.kill('SIGTERM');\n this.process = null;\n }\n }", "function terminate() {\n\tt.murder(eventHandlers.cb);\n}", "exit() {\n this.exit();\n }", "destroy() {\n this.wt.destroy();\n this.eventManager.destroy();\n }", "function close() {\n\n ipcRenderer.send('close', 'close')\n\n }", "close() {\n this.next = () => {};\n if (this.worker) {\n this.worker.next(true);\n }\n delete this.next;\n delete this.ctx;\n }", "dispose() {\n this.workers.forEach(t => t.dispose());\n if (this.own) {\n this.terminal.dispose();\n }\n }", "end() {\n\t\tif (this.process)\n\t\t\tthis.process.kill()\n\t}", "destroy() {\n if (this.$toDestroy) {\n this.$toDestroy.forEach(function(el) {\n el.destroy();\n });\n this.$toDestroy = null;\n }\n if (this.$mouseHandler)\n this.$mouseHandler.destroy();\n this.renderer.destroy();\n this._signal(\"destroy\", this);\n if (this.session)\n this.session.destroy();\n if (this._$emitInputEvent)\n this._$emitInputEvent.cancel();\n this.removeAllListeners();\n }", "destroy() {\n this._pipe && this._pipe.destroy();\n this._inbound && this._inbound.destroy();\n this._outbound && this._outbound.destroy();\n this._pipe = null;\n this._inbound = null;\n this._outbound = null;\n this._presets = null;\n this._context = null;\n this._proxyRequest = null;\n }", "destroy() {\n this._destroyed = true;\n\n if (typeof this.freeFromPool === 'function') {\n this.freeFromPool();\n }\n\n if (this.currentMap) {\n this.currentMap.removeObject(this);\n } else if (this.currentScene) {\n this.currentScene.removeObject(this);\n }\n\n this.children.forEach((child) => {\n child.destroy();\n });\n\n // triggers the wave end\n if (this.wave) {\n this.wave.remove(this);\n }\n }", "destroy () {\n this._socket.close()\n this._rtc.close()\n this._removeEventListeners()\n }", "endCallingContext() {\n var composer = exports.$composer;\n if ($isNothing(composer)) return;\n var context = composer.resolve(Context);\n\n if (context && context !== this.context) {\n context.End();\n }\n }", "function appEnding() {\n cleanUpEntities();\n if (coinSpawnTimeout){\n Script.clearTimeout(coinSpawnTimeout);\n coinSpawnTimeout = false;\n }\n if (octreeInterval){\n Script.clearInterval(octreeInterval);\n octreeInterval = false;\n }\n Messages.unsubscribe(MONEY_TREE_CHANNEL);\n Messages.unsubscribe(OPERATOR_CHANNEL);\n Messages.unsubscribe(GIVER_CHANNEL);\n Messages.unsubscribe(RECIPIENT_CHANNEL);\n Messages.messageReceived.disconnect(messageHandler);\n Messages.messageReceived.disconnect(messageHandlerOperator);\n Messages.messageReceived.disconnect(messageHandlerRecipient);\n Messages.messageReceived.disconnect(messageHandlerGiver);\n}", "endSession() {\r\n this.endScript();\r\n this.cycler.endSession();\r\n }", "destroy() {\n this.stop();\n\n // Remove listeners\n this.off('controlsMoveEnd', this._onControlsMoveEnd);\n\n var i;\n\n // Remove all controls\n var controls;\n for (i = this._controls.length - 1; i >= 0; i--) {\n controls = this._controls[0];\n this.removeControls(controls);\n controls.destroy();\n };\n\n // Remove all layers\n var layer;\n for (i = this._layers.length - 1; i >= 0; i--) {\n layer = this._layers[0];\n this.removeLayer(layer);\n layer.destroy();\n };\n\n // Environment layer is removed with the other layers\n this._environment = null;\n\n this._engine.destroy();\n this._engine = null;\n\n // Clean the container / remove the canvas\n while (this._container.firstChild) {\n this._container.removeChild(this._container.firstChild);\n }\n\n this._container = null;\n }", "dispose() {\n this[$port].removeEventListener('message', this[$messageEventHandler]);\n this[$port].close();\n }", "async destroy() {\n\t\tthis.log('debug', 'destroy')\n\t\tif (this.socket) \n\t\t\t{this.socket.destroy()\n\t\t}\n\t}", "destroy() {\n // destroy everything related to WebGL and the slider\n this.destroyWebGL();\n this.destroySlider();\n }", "dispose() {\n window.removeEventListener('resize', this.calculateViewport_, false);\n\n this.buttonEl_.removeEventListener('click', this.onClickRun_, false);\n this.el_.removeEventListener('click', this.onClickScene_, false);\n this.underlayEl_.removeEventListener('click', this.onClickUnderlay_, false);\n }", "function destroy() {\n\t\tif ( error ) {\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tself.emit( 'close' );\n\t}", "destroy() {\r\n this.native.destroy();\r\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "end() {\n this.killCurrentTranscoder();\n }", "end() {\n this.killCurrentTranscoder();\n }", "function translator_terminate()\n{\n this.parser.terminate();\n}", "destroy() {\n Object(_environment__WEBPACK_IMPORTED_MODULE_2__[\"inTransaction\"])(this.env, () => {\n Object(_lifetime__WEBPACK_IMPORTED_MODULE_3__[\"legacySyncDestroy\"])(this, this.env);\n Object(_lifetime__WEBPACK_IMPORTED_MODULE_3__[\"asyncDestroy\"])(this, this.env);\n });\n }", "destroy() {\n Object(_environment__WEBPACK_IMPORTED_MODULE_2__[\"inTransaction\"])(this.env, () => {\n Object(_lifetime__WEBPACK_IMPORTED_MODULE_3__[\"legacySyncDestroy\"])(this, this.env);\n Object(_lifetime__WEBPACK_IMPORTED_MODULE_3__[\"asyncDestroy\"])(this, this.env);\n });\n }", "dispose() {\n const { _context, _shaders, _textures, _renderTargets, _events } = this;\n\n this._stopAnimation();\n _context.clear(_context.COLOR_BUFFER_BIT);\n\n for (const shader of _shaders.keys()) {\n this.unregisterShader(shader);\n }\n for (const texture of _textures.keys()) {\n this.unregisterTexture(texture);\n }\n for (const renderTarget of _renderTargets.keys()) {\n this.unregisterRenderTarget(renderTarget);\n }\n\n _events.dispose();\n\n this._extensions = null;\n this._lastTimestamp = null;\n this._canvas = null;\n this._context = null;\n this._shaders = null;\n this._textures = null;\n this._renderTargets = null;\n this._renderTargetsStack = null;\n this._events = null;\n this._activeShader = null;\n this._activeRenderTarget = null;\n this._activeViewportSize = null;\n this._clearColor = null;\n this._projectionMatrix = null;\n this._viewMatrix = null;\n this._modelMatrix = null;\n this._blendingConstants = null;\n this._stats = null;\n this._shaderApplierOut = null;\n this._shaderApplierGetValue = null;\n this.__onFrame = null;\n }", "destroy() {\n if (this.frameBuffer.stencil) {\n this.gl.deleteRenderbuffer(this.frameBuffer.stencil);\n }\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n }", "destroy() {\n \tthis._unload();\n \tsuper.destroy();\n \tthis.unregisterCallback();\n \tdelete this._element;\n \tthis._elementURL = undefined;\n \tthis._state = STATE.waiting;\n \tthis._currentTime = 0;\n \tthis._startTime = NaN;\n \tthis._stopTime = Infinity;\n \tthis._ready = false;\n \tthis._loadCalled = false;\n \tthis._gl.deleteTexture(this._texture);\n \tthis._texture = undefined;\n }", "destroy() {\n\t\tthis._stopErrorHandling();\n\n\t\tthis._listeners = {};\n\t}", "stop() { this.#runtime_.stop(); }", "destroy() {\n\n if (this._navCubeCanvas) {\n\n this.viewer.camera.off(this._onCameraMatrix);\n this.viewer.camera.off(this._onCameraWorldAxis);\n this.viewer.camera.perspective.off(this._onCameraFOV);\n this.viewer.camera.off(this._onCameraProjection);\n\n this._navCubeCanvas.removeEventListener(\"mouseenter\", this._onMouseEnter);\n this._navCubeCanvas.removeEventListener(\"mouseleave\", this._onMouseLeave);\n this._navCubeCanvas.removeEventListener(\"mousedown\", this._onMouseDown);\n\n document.removeEventListener(\"mousemove\", this._onMouseMove);\n document.removeEventListener(\"mouseup\", this._onMouseUp);\n\n this._navCubeCanvas = null;\n this._cubeTextureCanvas.destroy();\n this._cubeTextureCanvas = null;\n\n this._onMouseEnter = null;\n this._onMouseLeave = null;\n this._onMouseDown = null;\n this._onMouseMove = null;\n this._onMouseUp = null;\n }\n\n this._navCubeScene.destroy();\n this._navCubeScene = null;\n this._cubeMesh = null;\n this._shadow = null;\n\n super.destroy();\n }", "close() {\n /* Disconnect Trueno session */\n process.exit();\n }", "exitWrappedGraph(ctx) {\n\t}", "function terminate() {\n this.quit = true;\n}", "function terminate() {\n this.quit = true;\n}", "destroy() {\n this._worker.destroy();\n }", "async dispose() {\r\n const tasks = [];\r\n if (this._engine) {\r\n tasks.push(this._engine.quitAsync());\r\n }\r\n if (this._engineSub) {\r\n tasks.push(this._engineSub.quitAsync());\r\n this._engineSub = null;\r\n }\r\n await Promise.all(tasks);\r\n this._engine = this._localCache = this._cacheExps = null;\r\n }", "destroy() {\n this._executeOnSandbox(['destroy']);\n }", "destroy () {\n debug('🗑️ #' + this.id + ' %c[' + this.type + ']', 'color:grey')\n this.rootElement.parentNode.removeChild(this.rootElement)\n this.destroyEvents()\n\n // Do not remove name class on body if destroyed page is the same as current one.\n if (this.getService('PageBuilder').page !== null && this.getService('PageBuilder').page.name !== this.name) {\n document.body.classList.remove(this.name)\n }\n\n // Do not remove type class on body if destroyed page is the same as current one.\n if (this.getService('PageBuilder').page !== null && this.getService('PageBuilder').page.type !== this.type) {\n document.body.classList.remove(this.type)\n }\n\n // Blocks\n if (this.blocks !== null) {\n for (let blockIndex in this.blocks) {\n if (this.blocks.hasOwnProperty(blockIndex)) {\n this.blocks[blockIndex].destroy()\n }\n }\n }\n }", "_destroy() {\n\t\tif (this.workspaces_names_changed) {\n\t\t\tthis.workspaces_settings.disconnect(this.workspaces_names_changed);\n\t\t}\n\t\tif (this._ws_number_changed) {\n\t\t\tWM.disconnect(this._ws_number_changed);\n\t\t}\n\t\tif (this._restacked) {\n\t\t\tglobal.display.disconnect(this._restacked);\n\t\t}\n\t\tif (this._window_left_monitor) {\n\t\t\tglobal.display.disconnect(this._window_left_monitor);\n\t\t}\n\t\tif (this.hide_tooltip_timeout) {\n\t\t\tGLib.source_remove(this.hide_tooltip_timeout);\n\t\t}\n\t\tthis.ws_bar.destroy();\n\t\tsuper.destroy();\n\t}", "shutDown() {\n if (this._isShutDown) return;\n document.body.removeChild(this._canvas);\n this._isShutDown = true;\n }", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "function stop() {\n\t\t\t/* Stop the engine. */\n\t\t\tengine.stop();\n\t\t\tdisplay.canvas.removeEventListener(\"touchstart\", touchStartDisplay);\n\t\t\twindow.removeEventListener(\"resize\", resizeWindow);\n\t\t}", "end() {\n this.session.close();\n }", "function destroy () {\n\t\t// TODO\n\t}", "unload() {\n renderer.dispose();\n }", "unload() {\n renderer.dispose();\n }", "function doneClosing()\n\t{\n\t\tthat.terminate();\n\t}", "endTease() {\r\n this.endScript();\r\n this.cycler.end();\r\n }", "destroy()\n {\n this.removeListeners();\n\n if(typeof this.args.callbacks.close !== 'undefined') {\n this.args.callbacks.close();\n }\n\n this.element.parentElement.removeChild(this.element);\n }", "destroy() {\n this._emiter.removeAllListeners();\n this._emiter = null;\n mEmitter.instance = null;\n }", "function destroy(){\n\t\t// TODO\n\t}", "destroy()\n {\n this._textCtx = null;\n this.canvas = null;\n\n this.style = null;\n }", "releaseGL() {\n\t\tthis.gl.deleteProgram(this.shaderProgram);\n\t\tthis.gl.deleteVertexArray(this.squareVertexArray);\n\t\tthis.gl.deleteBuffer(this.squareVertexBuffer);\n\t\tthis.gl.deleteBuffer(this.translationsBuffer);\n\t\tthis.gl.deleteBuffer(this.backgroundColorsBuffer);\n\t}", "unload () {\n renderer.dispose();\n }", "destroy() {\n this.end();\n for (const container of this._dispatchers.values()) {\n for (const dispatcher of container.values()) {\n dispatcher.destroy('end', 'broadcast ended');\n }\n }\n }", "destroy() {\n this.end();\n for (const container of this._dispatchers.values()) {\n for (const dispatcher of container.values()) {\n dispatcher.destroy('end', 'broadcast ended');\n }\n }\n }", "destroy() {\n // Ran on TimelineChannel.destroy\n // (polymorphism with SonificationInstrument).\n // Currently all we need to do is cancel.\n this.cancel();\n }", "dispose() {\n window.removeEventListener('mousedown', this.handleMouseDown);\n window.removeEventListener('resize', this.handleWindowResize);\n //window.cancelAnimationFrame(this.requestID);\n \n this.raycaster = null;\n this.el = null;\n\n this.controls.dispose();\n }", "function contextDisposedListener() {\n goog.log.warning(logger, 'Connection to the server app was shut down');\n context = null;\n stopWork();\n}", "async releaseContext() {\n // Disconnect from all persisted user gateways\n for (const userName of this.userGateways.keys()) {\n const gateway = this.userGateways.get(userName);\n logger.info(`disconnecting gateway for user ${userName}`);\n gateway.disconnect();\n }\n\n // Clear peer cache\n this.peerCache.clear();\n this.context = undefined;\n }", "destroy() {\n\t\tthis._listener.stopListening();\n\t}", "onDestroy() {\n this.rotAnimations.forEach((anim) => {\n anim.complete();\n });\n if (this.timeouts[0]) clearTimeout(this.timeouts[0]);\n if (this.timeouts[1]) clearTimeout(this.timeouts[1]);\n this.rotatable1.destroy();\n this.rotatable2.destroy();\n if (this.followers[0]) this.followers[0].forEach((f) => f.destroy());\n if (this.followers[1]) this.followers[1].forEach((f) => f.destroy());\n this.followers = [];\n if ( this.paths[0]) this.paths[0].destroy();\n if ( this.paths[1]) this.paths[1].destroy();\n this.paths = [];\n this.toprg.destroy();\n this.botrg.destroy();\n if (this.emitters) {\n this.emitters.forEach((emitter) => {\n emitter.killAll();\n emitter.stop();\n });\n }\n\n }", "disconnect() {\n window.removeEventListener('message', this.onConnectionMessageHandler);\n this.closePort();\n }", "function exit() {\n const {target} = this\n resize.remove(this.handleResize)\n animate.remove(this.handleAnimate)\n dragstart.remove(this.handleDragStart)\n drag.remove(this.handleDrag)\n dragend.remove(this.handleDragEnd)\n this.canvas&&this.canvas.removeEventListener('click',this.handleClick)\n while (target.children.length) target.firstChild.remove()\n}", "destroy() {\n this.removeListeners();\n window.removeEventListener(GoogEventType.BEFOREUNLOAD, this.onClose.bind(this), true);\n this.scope = null;\n }", "function cleanup(args, ctx) {\n}", "function cleanup(args, ctx) {\n}", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n\n if (this._socket) {\n this.readyState = WebSocket.CLOSING;\n this._socket.end();\n // Add a timeout to ensure that the connection is completely cleaned up\n // within 30 seconds, even if the other peer does not send a FIN packet.\n clearTimeout(this._closeTimer);\n this._closeTimer = setTimeout(this._finalize, closeTimeout, true);\n } else if (this.readyState === WebSocket.CONNECTING) {\n this.finalize(true);\n }\n }", "destroy() {\n this.impl.destroy();\n this.impl = null;\n this.format = null;\n this.defaultUniformBuffer = null;\n }", "dispose() {\r\n if (this._agent) {\r\n this._agent.destroy();\r\n }\r\n this._disposed = true;\r\n }", "close() {\n if (phantom_instance != null) {\n phantom_instance.exit();\n phantom_instance = null;\n }\n }", "destroy() {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.plugins = [];\n this.inputState.destroy();\n this.dom.remove();\n this.observer.destroy();\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n this.destroyed = true;\n }", "dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }", "dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }", "dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }", "dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }" ]
[ "0.61951625", "0.6139838", "0.6139838", "0.60261166", "0.6016587", "0.60042286", "0.5998117", "0.5997658", "0.5953353", "0.594772", "0.5934514", "0.5889676", "0.5885655", "0.5883969", "0.58755493", "0.5869661", "0.5844082", "0.58144414", "0.58104604", "0.5806847", "0.5805008", "0.5780849", "0.5771893", "0.5767981", "0.57568806", "0.57536715", "0.5751319", "0.5723759", "0.5716239", "0.5715063", "0.57110864", "0.5699822", "0.5699723", "0.5694758", "0.5677539", "0.56179315", "0.56179315", "0.56179315", "0.5608399", "0.5608399", "0.56061965", "0.55878603", "0.55878603", "0.5587699", "0.55766284", "0.55446976", "0.5537063", "0.55366", "0.5533721", "0.5526505", "0.5524105", "0.55216026", "0.55216026", "0.55116993", "0.5509413", "0.55011743", "0.5491823", "0.54838425", "0.5483834", "0.5471503", "0.54692966", "0.5469042", "0.54689366", "0.54589075", "0.54589075", "0.54534316", "0.54486483", "0.5446554", "0.544328", "0.54377925", "0.5431321", "0.5429757", "0.5429433", "0.54257447", "0.54257447", "0.5423657", "0.5416745", "0.5411461", "0.540516", "0.5404401", "0.5401232", "0.54012215", "0.5400326", "0.5395019", "0.539456", "0.539456", "0.5390092", "0.5390092", "0.5390092", "0.5390092", "0.5390092", "0.5386022", "0.5382542", "0.5372718", "0.53703064", "0.53665954", "0.53594303", "0.53594303", "0.53594303", "0.53594303" ]
0.6300904
0
query search for treatments [autocomplete]
function treatmentQuerySearch() { var tracker = $q.defer(); var results = (editMsVm.treatment.details ? editMsVm.treatments.filter(createFilterForTreatments(editMsVm.treatment.details)) : editMsVm.treatments); return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCategories.forEach(function(categoryObj) {\n allCategoryNames.push(categoryObj.name);\n checkEmergencyTerms(categoryObj.name);\n });\n search.search({ category: allCategoryNames.join(',') });\n }", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "get materialSearch() {}", "searchSuggest(query) {\r\n let finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { querytext: query };\r\n }\r\n else {\r\n finalQuery = query;\r\n }\r\n return this.create(SearchSuggest).execute(finalQuery);\r\n }", "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function deptSearch() {\n connection.query(\n \"SELECT * FROM department\",\n function (err, res) {\n if (err) throw err\n console.table(res)\n beginTracker()\n }\n )\n}", "function search() {\n console.log(\"search \", search);\n const ingredientsList = ingredients.join(\",\");\n const url = `http://localhost:8888/api?i=${ingredientsList}&q=${inputValue}&p=1`;\n axios\n .get(url)\n .then((res) => {\n console.log(\"res \", res);\n setResults(res.data.results);\n })\n .catch((err) => {\n console.log(\"err \", err);\n });\n }", "function searchTerm(){\n \n }", "function searchKeywords() {\n if(searchString.toLowerCase().includes('unit')) {\n if(searchString.toLowerCase().includes('1')) {\n searchBox.value = 'Javascript DOM JQuery CSS function html flexbox arrays';\n } if(searchString.toLowerCase().includes('2')) {\n searchBox.value = 'middleware node express authorization authentication psql ejs fetch api cookies';\n } if(searchString.toLowerCase().includes('3')) {\n searchBox.value = 'react authorization authentication psql git fetch tokens'\n } if(searchString.toLowerCase().includes('4')) {\n searchBox.value = 'ruby rails psql'\n }\n }\n}", "function search(trm) {\n\n \tterm = trm;\n //re-extend the search results holder, to show the results to the user\n $('#search_results_holder').height(300);\n //use the httpget function to grab the custom google search\n //JSON DATA\n //var json_dta = httpGet('https://www.googleapis.com/customsearch/v1?key=AIzaSyDM8_gZ-5DQVcBUt1y7qq_wAjUDbr4YSTA&cx=009521426283403904660:drg6vvs6o2a&q=' + trm);\n add_results('https://www.googleapis.com/customsearch/v1?key=AIzaSyDM8_gZ-5DQVcBUt1y7qq_wAjUDbr4YSTA&cx=009521426283403904660:drg6vvs6o2a&q=' + trm);\n }", "search() {\n return db.many(`\n SELECT *\n FROM parks p\n WHERE p.borough LIKE '%ook%'\n `);\n }", "function querySearch(query) {\n var results = query ? self.lookups.Ingredients.filter(createFilterFor(query)) : self.lookups.Ingredients;\n return results;\n }", "function createFilterByTreatment (query) {\n\n return function filterFn(personal) {\n if(personal)\n {\n var result = false;\n angular.forEach(personal.treatments, function(value, key){\n if (value.description.indexOf(query) === 0)\n {\n result = true;\n }\n }); \n return result; \n }\n };\n }", "function manualSearch(e) {\n let term = document.querySelector(\"#searchTerm\").value;\n term = term.trim();\n if (term.length < 1) return;\n manualSearchData(term.toLowerCase());\n}", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "function querySearch(query) {\n return $scope.foods.filter(createFilterFor(query));\n }", "function search() {\n\t\n}", "function searchProduct(){\r\n \r\n var go = \"Thing(?i)\";\r\n \r\n submitProduct(go); \r\n \r\n }", "function init_query () {\n window.search_terms = ['pancake']\n if ('q' in query_parameters) {\n if (!$('#q').val()) {\n $('#q').val(query_parameters['q'])\n }\n }\n var terms = $('#q').val().match(/\\w+|\"(?:\\\\\"|[^\"])+\"/g)\n if (terms && terms.length && terms[0].length) {\n window.search_terms = terms\n }\n}", "search() {\n this.recipeService.filterRecipes(this.searchQuery, 'name')\n .then(res => this.hydrate = res)\n .catch(console.error);\n }", "function search() {\n let input = getSearchCastInput();\n filterCast(input);\n}", "function searchRecom() {\n\t// store keyword in localSession\n\twindow.localStorage.setItem('kw', keyWord);\n\t// Fuse options\t\t\t\t\n\tvar options = {\n\t\tshouldSort: true,\n\t\ttokenize: true,\n\t\tthreshold: 0.2,\n\t\tlocation: 0,\n\t\tdistance: 100,\n\t\tincludeScore: true,\n\t\tmaxPatternLength: 32,\n\t\tminMatchCharLength: 2,\n\t\tkeys: [\"title.recommendation_en\",\n\t\t\t \"title.title_recommendation_en\",\n\t\t\t \"topic.topic_en\"]\n\t};\n\t//Fuse search\n\tvar fuse = new Fuse(recommends, options); //https://fusejs.io/\n\tconst results = fuse.search(keyWord);\n\treturn results;\n}", "function searchDriver() {\n const queries = [\n\t['bre'],\n\t['bread'],\n\t['break'],\n\t['piz'],\n\t['nach'],\n\t['garbage'],\n\n\t['bre', 'piz'],\n\t['bre', 'flour'],\n ];\n for( const q of queries ) {\n\tconsole.log( \"query=[%s]\", q.join(\", \") );\n\tsearchElements( q, recipeIndex );\n }\n}", "function getResults() {\n var searchText = document.getElementById('search').value;\n \n odkData.query('pediatria', 'regdate = ?', [searchText], null, null, \n \t\tnull, null, null, null, true, cbSRSuccess, cbSRFailure);\n}", "suggest(query){\n const that = this;\n let maxNumber = this.maxSuggestResults;\n const promises = [];\n promises.push(that.suggestTextQuery(query, maxNumber));\n Object.keys(that.suggestionIndexes).forEach(function(indexKey){\n const set = that.suggestionIndexes[indexKey];\n const intent = set.search(query, maxNumber);\n promises.push(intent);\n });\n const adapters = that.adapters;\n return Promise.all(promises).then(function(dataSets){\n let items = [];\n dataSets.forEach(function(dataSet){\n if (!dataSet || !dataSet.length)\n return ;\n items = items.concat(dataSet.items);\n })\n return new SearchCriteriaDataSet({\n adapters,\n items\n });\n });\n }", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function search(term, force_search){\n var source = jQuery.extend(true, [], gon.source); // deep copy - we don't change the gon.source array\n force_search = force_search || false;\n\n // Search for booking id (actually tx id)\n if (term.indexOf(\"BID=\") === 0){\n searchTermOld = term;\n var booking_id = term.substr(4);\n search_for_id_update_gantt(booking_id, source);\n }\n else{\n search_booking_id = 0;\n\n // Show all devices again\n if (term.length < 3){\n term = \"\";\n if (searchTermOld !== term || force_search){\n searchTermOld = term;\n $('#poolTool_search').css(\"background-color\", \"white\");\n $('#poolTool_search').css(\"color\", \"black\");\n updateGanttChart(source);\n gon.search_source = source;\n search_update_booking_dialog();\n $('.home-fluid-thumbnail-grid-item').show();\n }\n }\n\n if (searchTermOld !== term || force_search){\n searchTermOld = term;\n\n search_update_gantt(term, source);\n search_update_booking_dialog();\n }\n }\n }", "onSearch(value) {\n this.model.query = value;\n }", "onSearch(value) {\n this.model.query = value;\n }", "function deptSearch() {\n db.query(\n `SELECT * FROM departments`,\n (err, res) => {\n if (err) throw err\n console.table(res)\n deptOptions()\n }\n )\n}", "function searchSurveysByText(searchText) {\n\n var searchValue = searchText.toUpperCase();\n dataLayer.clear();\n map.infoWindow.hide();\n\n csvStore.fetch({\n onComplete: function(items, request) {\n dojo.forEach(items, function(item, index) {\n var foundIt = false;\n var year = csvStore.getValue(item, \"Year\");\n var cruise = csvStore.getValue(item, \"Cruise\");\n var latitude = csvStore.getValue(item, \"Latitude\");\n var longitude = csvStore.getValue(item, \"Longitude\");\n var summary = csvStore.getValue(item, \"Summary\");\n var id = csvStore.getIdentity(item);\n if (latitude != undefined && longitude != undefined) {\n if (summary != undefined) {\n var summaryText = summary.toUpperCase();\n if (summaryText.indexOf(searchValue) != -1) {\n foundIt = true;\n }\n }\n if (cruise != undefined) {\n var cruiseText = cruise.toUpperCase();\n if (cruiseText.indexOf(searchValue) != -1) {\n foundIt = true;\n }\n }\n if (foundIt) {\n createMarker(id, year, cruise, latitude, longitude);\n }\n }\n });\n initializeCruiseListing();\n dojo.connect(dataLayer, \"onClick\", onFeatureClick);\n var cruiseTotals = dijit.byId(\"yearCounter\");\n cruiseTotals.attr(\"value\", dataLayer.graphics.length + \" Cruises Displayed\");\n },\n onError: function(error) {\n dojo.byId(\"itemsList\").innerHTML = \"Unable to search the data.\";\n }\n });\n\n map.setExtent(startExtent);\n }", "function searchForText() {\n // get the keywords to search\n var query = $('form#search input#mapsearch').val();\n\n // extract the fields to search, from the selected 'search category' options\n let category = $('select#search-category').val();\n\n // filter the object for the term in the included fields\n DATA.filtered = searchObject(DATA.tracker_data, query, CONFIG.search_categories[category]);\n\n // suggestions: if the search category is \"company\", include a list of suggestions below \n var suggestions = $('div#suggestions').empty();\n if (category == 'parent') {\n suggestions.show();\n var companies = searchArray(DATA.companies, query).sort();\n companies.forEach(function(company) {\n var entry = $('<div>', {'class': 'suggestion', text: company}).appendTo(suggestions);\n entry.mark(query);\n });\n }\n\n // add the results to map, table, legend\n drawMap(DATA.filtered); // update the map (and legend)\n updateResultsPanel(DATA.filtered, query) // update the results-panel\n drawTable(DATA.filtered, query); // populate the table\n $('form#nav-table-search input').val(query); // sync the table search input with the query\n CONFIG.selected_country.layer.clearLayers(); // clear any selected country\n CONFIG.selected_country.name = ''; // ... and reset the name\n $('div#country-results').show(); // show the results panel, in case hidden\n $('a.clear-search').show(); // show the clear search links\n\n return false;\n}", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "function manufacturersQuerySearch() {\n var tracker = $q.defer();\n var results = (vm.vehicle.manuf ? vm.manufacturers.filter(createFilterForManufacturers(vm.vehicle.manuf)) : vm.manufacturers);\n\n if (results.length > 0) {\n return results;\n }\n\n amCustomers.getManufacturers().then(allotManufacturers).catch(noManufacturers);\n return tracker.promise;\n\n function allotManufacturers(res) {\n vm.manufacturers = res;\n results = (vm.vehicle.manuf ? vm.manufacturers.filter(createFilterForManufacturers(vm.vehicle.manuf)) : vm.manufacturers);\n tracker.resolve(results);\n }\n\n function noManufacturers(error) {\n results = [];\n tracker.resolve(results);\n }\n }", "function search() {\n __globspace._gly_searchadvanced.removeAll();\n _gly_ubigeo.removeAll();\n let sql = '1=1', \n idtable='#tbl_searchadvanced', \n isexportable=true, \n nquery=__query.length;\n\n // formación del sql \n for (let i = 0; i < nquery; i++){\n let item = __query[i],\n filter = item.filter.toUpperCase(),\n typedata=item.typedata,\n auxsql='';\n\n switch (typedata) {\n case 'double': case 'small-integer': case 'integer': case 'single':\n auxsql = ` ${item.fieldname} ${item.condition} \"${filter}\"`;\n break;\n case 'date':\n console.log(filter);\n let fi = moment(filter).add(5, 'hours').format('YYYY-MM-DD HH:mm:ss'); //consulta al servicio en hora utc (+5);\n let ff = moment(filter).add(29, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n \n if(item.condition == '=' || item.condition == 'contiene'){\n auxsql = `(${ item.fieldname } BETWEEN timestamp '${ fi }' AND timestamp '${ ff }')`;\n }else{\n if(item.condition == '<='){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`; \n }else if(item.condition == '>='){\n fi = moment(filter).add(5, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }else if(item.condition == '>'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`;\n }else if(item.condition == '<'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }\n }\n break;\n default:\n auxsql = `Upper(${item.fieldname}) ${item.condition} '${filter}'`;\n break;\n }\n\n if (item.option == '--') {\n if(typedata == 'date'){\n sql = auxsql;\n }else{\n item.condition == 'contiene' ? sql += ` and Upper(${item.fieldname}) like '%${filter}%'` : sql = auxsql;\n }\n } else {\n if(typedata == 'date'){\n sql += ` ${item.option} ${auxsql}`;\n }else{\n item .condition == 'contiene' ? sql += ` ${item.option} Upper(${item.fieldname}) like '%${filter}%'` : sql += ` ${item.option} ${auxsql}`;\n }\n }\n }\n \n __globspace.currentview.graphics.remove(_gra_ubigeo);\n\n // si se a selecionado un item de ubigeo primero obtengo la geometria del ubigeo y luego la consulta propia\n if(__url_ubigeo!=''){\n let _queryt = new QueryTask({url:__url_ubigeo}),\n _qparams = new Query(); \n _qparams.returnGeometry = true;\n _qparams.where = __sql_ubigeo;\n\n _queryt.execute(_qparams).then(function(response){\n \n __ubigeogeometry=response.features[0].geometry;\n\n let _queryt2 = new QueryTask({url:__url_query}),\n _qparams2 = new Query(); \n\n _qparams2.where = sql;\n _qparams2.outFields = [\"*\"];\n _qparams2.geometry = __ubigeogeometry;\n _qparams2.spatialRelationship = \"intersects\";\n _qparams2.returnGeometry = true;\n\n _queryt2.execute(_qparams2).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\",'', true)\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n // Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n Helper.renderGraphic(response, __globspace._gly_searchadvanced);\n\n\n if(Object.keys(_gra_ubigeo).length ==0){\n _gra_ubigeo = new Graphic({\n geometry: __ubigeogeometry, \n symbol:_symbol,\n });\n }\n _gra_ubigeo.geometry=__ubigeogeometry;\n __globspace.currentview.graphics.add(_gra_ubigeo);\n __globspace.currentview.when(function () {\n __globspace.currentview.goTo({\n target: __ubigeogeometry\n });\n });\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }else{\n let _queryt = new QueryTask({url:__url_query}),\n _qparams = new Query();\n\n _qparams.where = sql;\n _qparams.outFields = [\"*\"];\n _qparams.returnGeometry = true;\n\n _queryt.execute(_qparams).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\", '', true);\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\");\n console.log(error);\n })\n }\n }", "function search() {\n $.var.currentSupplier = $.var.search;\n $.var.currentID = 0;\n $.var.search.query = $(\"#searchable\").val();\n if ($.var.search.query.trim().length === 0) { // if either no string, or string of only spaces\n $.var.search.query = \" \"; // set query to standard query used on loadpage\n }\n $.var.search.updateWebgroupRoot();\n}", "searchQuery(value) {\n let result = this.tableData;\n if (value !== '') {\n result = this.fuseSearch.search(this.searchQuery);\n }\n this.searchedData = result;\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 search() {\r\n\t\tlet food = document.getElementById(\"searchFood\").value;\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\r\n\t\t\t\tif(json.meals == null) {\r\n\t\t\t\t\terrorName = document.getElementById(\"searchFood\").value;\r\n\t\t\t\t\tclear();\r\n\t\t\t\t\terror();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tshowResult(json);\r\n\t\t\t\t}\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});\r\n\t}", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "afterSearch(searchText, result) {\n }", "async search(query, options = {}) {\n return await this.fetch(\"/search/byterm\", {\n q: query,\n max: options.max ?? 25,\n clean: Boolean(options.clean),\n fulltext: Boolean(options.fulltext),\n });\n }", "_getQuerySuggest(data, params) {\n return {\n text: data,\n outFields: params.outFields || '*',\n maxSuggestions: params.maxSuggestions || 10,\n };\n }", "function search(table,column,identifier,search,searchtemp,id,action,exact,searchtype){\n\texact = typeof(exact) != 'undefined' ? exact : 0;\n\tsearchtype = typeof(searchtype) != 'undefined' ? searchtype : 0;\n searchrequest=\"../asearch.php?table=\"+table+\"&column=\"+column+\"&identifier=\"+identifier+\"&search=\"+search+\"&searchtemp=\"+searchtemp+\"&div=\"+id+\"&exact=\"+exact+\"&searchtype=\"+searchtype;\n eventfetch(searchrequest,id,action);\n}", "function search() {\n\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"Choose what you would like to do:\",\n choices: options\n })\n\n .then(function (answer) {\n switch (answer.action) {\n case options[0]:\n viewDepartment();\n break;\n\n case options[1]:\n viewRole();\n break;\n\n case options[2]:\n viewEmp();\n break;\n\n case options[3]:\n updEmp();\n\n case options[4]:\n addDepartment();\n break\n\n case options[5]:\n addRole();\n break\n\n case options[6]:\n addEmp();\n break\n\n case options[7]:\n connection.end();\n break\n }\n })\n}", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function setQuery() {\n getSearch(search.value);\n}", "set materialSearch(value) {}", "function querySearch(query) {\n var results = query ? $scope.regions.filter(function (item) {\n var smallDesc = angular.lowercase(item.Description);\n return (smallDesc.indexOf(angular.lowercase(query)) !== -1);\n }) : $scope.regions,\n deferred;\n if ($scope.simulateQuery) {\n deferred = $q.defer();\n $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);\n return deferred.promise;\n } else {\n return results;\n }\n }", "function matchDiplom(params, data) {\n params.term = params.term || '';\n // If there are no search terms, return all of the data\n if (params.term.replace(/\\s+/g, '') === '') {\n return data;\n }\n // Do not display the item if there is no 'text' property\n if (typeof data.text === 'undefined') {\n return null;\n }\n if (data.text.toUpperCase().replace(/\\s+/g, '').indexOf(params.term.toUpperCase().replace(/\\s+/g, '')) > -1) {\n return data;\n }\n return null;\n}", "searchWardrobe(query) {\n this.props.searchWardrobe(query.target.value);\n }", "function queryPrsnlSearchBy (query) {\n var results = query ? prsnl.personalsAll.filter( createFilterByTreatment(query) ) : prsnl.personalsAll;\n var deferred = $q.defer();\n $timeout(function () { deferred.resolve( results ); }, Math.random() * 1000, false);\n return deferred.promise;\n }", "search(database, quary) {\n return database\n .filter((elementSearched) => {\n return elementSearched.name.toLowerCase()\n .includes(quary.toLowerCase());\n })\n .map((protester) => protester.name);\n }", "function foodTypeHandler(e) {\n\tsearchInput = e.target.value\n\tconst foodType = restaurants.filter((r) => {\n\t\treturn r.Tags.join('|')\n\t\t\t.toLowerCase()\n\t\t\t.split('|')\n\t\t\t.includes(searchInput.toLowerCase())\n\t})\n\tconsole.log(foodType)\n\tfilteredRestaurants(foodType)\n}", "function basicsearch() {\n searchString = document.basicForm.basicText.value;\n searchTerms = searchString.split(/\\s/);\n\n putHeader();\n\n findResults();\n putResults();\n\n putFooter();\n\n writeResultsPage();\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 run_search() {\n var q = $(elem).val();\n if (!/\\S/.test(q)) {\n // Empty / all whitespace.\n show_results({ result_groups: [] });\n } else {\n // Run AJAX query.\n closure[\"working\"] = true;\n $.ajax({\n url: \"/search/_autocomplete\",\n data: {\n q: q\n },\n success: function(res) {\n closure[\"working\"] = false;\n show_results(res);\n }, error: function() {\n closure[\"working\"] = false;\n }\n })\n }\n }", "function searchTerms(d){\n\t\n\tpayload = implode_form(d);\n\n\td.getElementById('demo_results').style.display = \"block\";\n\trdiv = d.getElementById('results_status'); // locate the output div \n\trdiv.innerHTML = ''; // clear out the block, prepare for data!\n\n\tlaunchEngines(rdiv,apibase+'/terms.',payload);\n\t//console.log('APIBASE: ' + apibase);\n\n}", "lookup(query) {\n if (query) {\n\n // strip out non-alpha characters and spaces and force to\n // lower case in order to search on the special 'search'\n // property present on all the models\n const sanitized = query.replace(/[\\s\\W_]+/g, '').toLowerCase();\n if (sanitized.length) {\n\n // filters the models in the collection\n const results = this.filter(_matcher(sanitized));\n \n // sort filtered results by relevance score\n const sorted = results.sort((a, b) => {\n if (a.score < b.score) return 1;\n if (a.score > b.score) return -1;\n return 0;\n });\n \n // only return the top 10 results\n return sorted.slice(0, MAX_RESULTS);\n }\n }\n return []; // return empty result set if no query\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 employeesSearch() {\n connection.query(\"SELECT * FROM employeeTracker_db.employee\",\n function(err, res) {\n if (err) throw err\n console.table(res)\n runSearch()\n })\n}", "function employeeSearch() {\n let query = `\n SELECT employee.id, first_name, last_name, title, salary, dep_name, manager_id\n FROM employee\n JOIN roles\n ON role_id = roles.id\n JOIN department\n ON dep_id = department.id;`;\n return connection.query(query, (err, res) => {\n if (err) throw err;\n console.table(res);\n startSearch();\n });\n}", "function handleSearch(e) {\n const value = e.target.value;\n const filtered = tasks.filter(item => item.tarefa.toLowerCase().includes(value.toLowerCase()));\n setRendTasks(filtered);\n setSearch(value);\n }", "function search() {\n // get the value of the search input field\n var searchString = $('#search').val().toLowerCase();\n\n markerLayer1.setFilter(showType);\n\n // here we're simply comparing the 'name' property of each marker\n // to the search string, seeing whether the former contains the latter.\n function showType(feature) {\n return feature.properties.name\n .toLowerCase()\n .indexOf(searchString) !== -1;\n }\n}", "function search(text){\n searchString = text.toLowerCase();\n readerControl.fullTextSearch(searchString);\n }", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "function handleSearch(inputElt) {\n\t\tvar query = encodeURIComponent($(inputElt).val());\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl : \"http://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/\"+query+\".json\",\n\t\t\tdata : {\n\t\t\t\taccess_token: \"pk.eyJ1IjoibWFwcHktZGV2IiwiYSI6InhBOWRUVHcifQ.YK4jDqt9EXb-Q79QX3O_Mw\"\n\t\t\t},\n\t\t\tsuccess : function(result){\n\t\t\t\tvar best = result.features[0];\n\t\t\t\tmap.setView([best.center[1], best.center[0]], 15);\n\t\t\t},\n\t\t\terror : function(error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t});\n\t}", "function searchMSDS() {\r\n var input, filter, msds, chemical, td, i, txtValue;\r\n input = document.getElementById(\"msds\");\r\n filter = input.value.toUpperCase();\r\n msds = document.getElementById(\"msdsTable\");\r\n chemical = msds.getElementsByTagName(\"tr\");\r\n for (i = 0; i < chemical.length; i++) {\r\n td = chemical[i].getElementsByTagName(\"td\")[0];\r\n if (td) {\r\n txtValue = td.textContent || td.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n chemical[i].style.display = \"\";\r\n } else {\r\n chemical[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "function lookUp() {\n var text = d3.select(this).text();\n var category = d3.select(this).attr('class');\n console.log(text, category);\n var results = getSearchResults(category, text);\n generateTable(results);\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}", "function searchSingleFarm(e) {\n setInput(e.target.textContent.toLowerCase());\n }", "function search(e) {\n e.preventDefault();\n\n // documentation: https://dictionaryapi.dev/\n const apiUrl = `https://api.dictionaryapi.dev/api/v2/entries/en_US/${keyword}`;\n axios.get(apiUrl).then(handleDictionaryResponse);\n\n // pexels API call\n const pexelsApiKey = process.env.REACT_APP_PEXELS_API_KEY;\n const pexelsApiUrl = `https://api.pexels.com/v1/search?query=${keyword}&per_page=12`;\n const headers = { Authorization: `Bearer ${pexelsApiKey}` };\n axios.get(pexelsApiUrl, { headers: headers }).then(handlePexelsResponse);\n }", "function searchPlaces(query)\n{\n\n service = new google.maps.places.PlacesService(map);\n service.textSearch(query, processPlaces);\n \n}", "executeSearch(term) {\n var results;\n try {\n results = this.search.fuse.search(term); // the actual query being run using fuse.js\n } catch (err) {\n if (err instanceof TypeError) {\n console.log(\"hugo-fuse-search: search failed because Fuse.js was not instantiated properly.\")\n } else {\n console.log(\"hugo-fuse-search: search failed: \" + err)\n }\n return;\n }\n let searchitems = '';\n\n if (results.length === 0) { // no results based on what was typed into the input box\n this.resultsAvailable = false;\n searchitems = '';\n } else { // we got results, show 5\n for (let item in results.slice(0,5)) {\n let result = results[item];\n if ('item' in result) {\n let item = result.item;\n searchitems += this.itemHtml(item);\n }\n }\n this.resultsAvailable = true;\n }\n\n this.element_results.innerHTML = searchitems;\n if (results.length > 0) {\n this.top_result = this.element_results.firstChild;\n this.bottom_result = this.element_results.lastChild;\n }\n }", "function search(query) {\n var aMatches = aLastResults =_search(query)\n .filter(function(o) {\n return o.sIdMatch !== null || o.sNameMatch !== null;\n });\n console.log(aLastResults.length + ' search results');\n _populateSearchTargetVariables(ui$, aMatches);\n return _toControl(aMatches);\n }", "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "getSuggest(search) {\n this.api.getData()\n .then(data => {\n // Obtener los resultados\n const results = data.responseJSON.results;\n\n // Enviar el JSON y la busqueda al Filtro\n this.filterSuggest(results, search);\n })\n }", "function employeeSearch() {\n\n connection.query(\"SELECT employee.id, employee.last_name, employee.first_name, role.title, name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;\",\n\n function (err, res) {\n if (err) throw err\n console.table(res)\n beginTracker()\n }\n )\n}", "function suggest(id, engine, title, terms) {\n var $suggest = $(\"#\" + id).find(\".result:not(.default):not(.suggest)\").first();\n\n $suggest.addClass(\"suggest\").\n attr({\"title\" : _convertTitle(title)}).\n data({ \"type\" : \"suggest\", \"terms\" : title }).\n append(\n $(\"<span class='search'/>\").text(\"search\"),\n $(\"<span class='terms'/>\").html(highlight(title, terms))\n );\n}", "function searchRecipes() {\n showAllRecipes();\n let searchedRecipes = domUpdates.recipeData.filter(recipe => {\n return recipe.name.toLowerCase().includes(searchInput.value.toLowerCase());\n });\n filterNonSearched(createRecipeObject(searchedRecipes));\n}", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n try {\n SongsService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "function handleSubmit(event) {\n event.preventDefault();\n setSearchTerm(event.target.value);\n const results = OG.filter((a) =>\n a.Strain.toLowerCase().includes(searchTerm.toLowerCase())\n );\n setOgstrain(results);\n }", "search(query) {\n if (query) {\n this._algoliaHelper.setQuery(query)\n }\n this._algoliaHelper.search()\n }", "function setQuery(e) {\n if (e.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function entitySearch(entity, query) {\n //get plural of entity\n var plural = entityTypes[entity.toLowerCase()].plural\n //get search results\n return $http({method: 'GET', url: BASE.URL + '/api/' + plural + '/search?txt=' + '\"' + query + '\"' })\n .then(function(response){\n return response.data;\n })\n }", "function filterBySearchText(data,query) {\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn $filter('filter')(data, query,false);\n\t\t\t\t\t\t}", "function searchModels() {\n let modelName = document.getElementById(\"modelName\").value.trim();\n if (modelName.length === 0) {\n return;\n }\n\n showLoadingAnimation();\n hideSearchResult();\n\n let url = 'searchModel';\n let params = 'modelName=' + modelName;\n\n startSearching(url + '?' + params);\n}", "search(response) {\n return new Promise((resolve, reject) => {\n if ('search_query' in response.entities) {\n response.context.items = response.entities.search_query[0].value;\n delete response.context.missing_keywords;\n } else {\n response.context.missing_keywords = true;\n delete response.context.items;\n }\n return resolve(response.context);\n });\n }", "function modelQuerySearch() {\n var tracker = $q.defer();\n var results = (vm.vehicle.model ? vm.models.filter(createFilterForModel(vm.vehicle.model)) : vm.models);\n\n if (results.length > 0)\n return results;\n\n amCustomers.getModels(vm.vehicle.manuf).then(allotModels).catch(noModels);\n return tracker.promise;\n\n function allotModels(res) {\n vm.models = res;\n results = (vm.vehicle.model ? vm.models.filter(createFilterForModel(vm.vehicle.model)) : vm.models);\n tracker.resolve(results);\n }\n\n function noModels(err) {\n results = [];\n tracker.resolve(results);\n }\n }", "function searchQuery(search)\n{\n matching = '';\n if(search)\n {\n matching += \"WHERE (title LIKE '%\" + search + \"%')\" + \n \"OR (description LIKE '%\" + search + \"%')\";\n }\n return matching;\n}", "function fetchResults(txt) {\n\tconsole.log(searchStr);\n}", "searchKeyword() {\n if (this.state.searchInput.length > 0) {\n const query = this.state.searchInput.toLowerCase().split(' ');\n const result = [];\n \n query.forEach(q => result.push(...this.state.lookupData.filter(data => data.keywords.includes(q))));\n\n return result;\n } else {\n return [];\n }\n }", "queryChanged(newValue){\n let searchedItems = _.filter(this.items, i => {\n return i.text.toLowerCase().indexOf(newValue.toLowerCase()) != -1 ||\n i.fullText.toLowerCase().indexOf(newValue.toLowerCase()) != -1;\n });\n\n console.log(searchedItems);\n this.fetchMarkers(searchedItems, self.map);\n }", "function search(query, cb) {\n\n return fetch(`https://trackapi.nutritionix.com/v2/natural/nutrients`, {\n method: \"post\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'x-app-id': '6f812326',\n 'x-app-key': '5e4d76d60110068b62760cfba5754e99',\n 'x-remote-user-id': '1'\n },\n body: JSON.stringify({\n 'query': `${query}`,\n 'num_servings': 1,\n 'use_raw_foods': true, \n })\n })\n .then(checkStatus)\n .then(parseJSON)\n .then(checkSearch)\n .then(cb);\n}" ]
[ "0.6473379", "0.6268314", "0.61744547", "0.6118348", "0.6066907", "0.6066789", "0.60286826", "0.5998705", "0.597417", "0.5948177", "0.59417623", "0.59346545", "0.5902784", "0.5893795", "0.58632654", "0.5860122", "0.5858314", "0.5842589", "0.58420855", "0.5838895", "0.5833866", "0.5833397", "0.58305436", "0.5828265", "0.5801992", "0.579846", "0.57854164", "0.57668835", "0.5745441", "0.5744828", "0.5744828", "0.574309", "0.5730569", "0.5720872", "0.5712019", "0.57065547", "0.5699618", "0.569803", "0.56442356", "0.56405425", "0.56399995", "0.5629569", "0.56191206", "0.5617122", "0.5616398", "0.56032807", "0.5594317", "0.557786", "0.55665714", "0.5561611", "0.5559351", "0.55581695", "0.55579656", "0.555283", "0.5551876", "0.55484957", "0.5546504", "0.55410737", "0.55403435", "0.5539674", "0.5528849", "0.55240333", "0.5521389", "0.55184364", "0.55172193", "0.5515791", "0.55108917", "0.5504087", "0.55002517", "0.5496557", "0.549363", "0.54914874", "0.548936", "0.5488505", "0.5486992", "0.54859614", "0.5484171", "0.54791796", "0.54753923", "0.5464102", "0.5454835", "0.54511285", "0.5449721", "0.5449721", "0.5449428", "0.5444645", "0.54413044", "0.5435014", "0.5433904", "0.5433904", "0.5430505", "0.5427156", "0.54269785", "0.5423397", "0.54202414", "0.54130536", "0.5409623", "0.5407324", "0.53990054", "0.5394574" ]
0.7134493
0
create filter for users' query list
function createFilterForTreatments(query) { var lcQuery = angular.lowercase(query); return function filterFn(item) { return (angular.lowercase(item.name).indexOf(lcQuery) === 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFilterForADUsers(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n var index = item.value.indexOf(lowercaseQuery)\n if (index >= 0)\n return true;\n // return (item.value.indexOf(lowercaseQuery) === 0);\n };\n }", "users(parent, args, { db }, info) {\n\n // no query: return all users\n if (!args.query) {\n return db.users;\n }\n\n // query: search for matches of query string with the user name and return filtered array\n return db.users.filter(user => user.name.toLowerCase().includes(args.query.toLowerCase()));\n\n }", "function querySearch (query) {\n var results = query ? self.mspUserList.filter( createFilterFor(query) ) : self.mspUserList;\n return results;\n }", "function filterUsers()\n { \n if(currentState === \"online\" || currentState === \"offline\")\n {\n var mustBeOnline = currentState === \"online\" ? true : false;\n\n users = users.filter(function(item){\n return (item.streamInfo.stream !== null) === mustBeOnline;\n });\n }\n\n fillResultBox();\n }", "function filterUsers({ username, name }) {\n return username.toLowerCase().startsWith(query.toLowerCase()) || name.toLowerCase().startsWith(query.toLowerCase());\n }", "function filterUser(value) {\n switch (value) {\n case Constants.UserManagementDDLOptions[1]:\n GetAllUsersFromDB();\n break;\n case Constants.UserManagementDDLOptions[2]:\n GetActivatedUserList();\n break;\n case Constants.UserManagementDDLOptions[3]:\n GetDeactivatedUserList();\n break;\n case Constants.UserManagementDDLOptions[4]:\n GetRegisterdUserList();\n break;\n }\n //Keeping record of the filtered data from the first dropdown to use it in second dropdown(BPUs dropdown)\n $scope.Users = $scope.UserList;\n filterByBPU($scope.Users);\n }", "function userList(req, res) {\n const obj = {};\n\n if (req.body.filterData && req.body.filterData.favourites && req.body.filterData.favourites === true) {\n obj.is_favourite = req.body.filterData.favourites;\n }\n if (req.body.filterData && req.body.filterData.divisions && req.body.filterData.divisions !== \"ALL\" && req.body.filterData.divisions !== \"\") {\n obj.division_id = req.body.filterData.divisions;\n }\n if (req.body.filterData && req.body.filterData.groups && req.body.filterData.groups !== \"ALL\" && req.body.filterData.groups !== \"\") {\n obj.group = req.body.filterData.groups;\n }\n if (req.body.filterData && req.body.filterData.groups && req.body.filterData.startswith !== \"ALL\" && req.body.filterData.startswith !== \"\") {\n obj.name = new RegExp(`^${req.body.filterData.startswith}`, \"i\");\n }\n let skipdata = 0;\n let limitdata = 0;\n if (req.body.filterData.skip && req.body.filterData.skip !== null && parseInt(req.body.filterData.skip) > 0) {\n skipdata = req.body.filterData.skip;\n }\n if (req.body.filterData.limit && req.body.filterData.limit !== null && parseInt(req.body.filterData.limit) > 0) {\n limitdata = req.body.filterData.limit;\n }\n\n const select = \"placeofSupply status_inward status_outward name normalized_name mobile_no is_favourite email_id\";\n\n CustomerModel.find(obj, select).sort({normalized_name: \"asc\"}).skip(skipdata).limit(limitdata)\n .exec((err, data) => {\n if (err) {\n res.status(499).send({message: errorhelper.getErrorMessage(err)});\n } else {\n res.json(data);\n }\n });\n}", "filterUsers() {\n const search = this.state.search.toLowerCase();\n \n return this.state.users.filter(user => {\n return (\n user.firstName.toLowerCase().includes(search) ||\n user.lastName.toLowerCase().includes(search)\n )\n })\n }", "function filterUsers(req, res, next) {\n if (filters.indexOf(req.params.filter)<0) {\n next();\n } else {\n switch (req.params.filter) {\n case \"tweets\":\n getMoreTweets(req, res, next);\n break;\n case \"last\":\n getLastUsers(req, res, next);\n break;\n }\n }\n }", "function createFilterFor(query) {\n\t\t\t\t\t\t var lowercaseQuery = query.toLowerCase();\n\n\t\t\t\t\t\t return function filterFn(client) {\n\t\t\t\t\t\t \t var lowercaseClient = client.whoName.toLowerCase();\n\t\t\t\t\t\t return (lowercaseClient.indexOf(lowercaseQuery) !== -1);\n\t\t\t\t\t\t };\n\n\t\t\t\t\t\t }", "users(parent, args, {prisma}, info) {\n const opArgs = {\n skip: args.skip,\n first: args.first,\n orderBy: args.orderBy,\n after: args.after, \n };\n if(args.query){\n opArgs.where={\n OR:[\n {\n name_contains: args.query\n },\n {\n id: args.query\n },\n {\n email: args.query\n }\n ]\n }\n } \n return prisma.query.users(opArgs, info);\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 listUser(filter, query, select) {\n filter = JSON.stringify(filter)\n query = JSON.stringify(query)\n let url = `${BASE_URL}/user?filter=${filter}&query=${query}&select=${select}`\n let opts = {\n method: 'GET',\n headers: {\n 'Accept': 'application/json'\n }\n }\n return fetch(url, opts)\n .then( res => {\n if(res.ok) {\n return res.json()\n }\n throw new Error('Error al listar')\n })\n}", "function filterUsers(searchString) {\n vm.users = [];\n vm.allUsers.forEach((user) => {\n if(user.username.indexOf(searchString) !== -1){\n vm.users.push(user);\n }\n });\n }", "function createFilterFor(query) {\n\t var lowercaseQuery = angular.lowercase(query);\n\t return function filterFn(emailsList) {\n\t \tconsole.log(emailsList.indexOf(lowercaseQuery) === 0);\n\t return (emailsList.indexOf(lowercaseQuery) === 0);\n\t };\n\t }", "function _filter(users, predi) {\n var new_list = [];\n for (let i = 0; i < users.length; i++){\n if (predi(users[i])){\n new_list.push(users[i])\n }\n }\n return new_list\n}", "function querySearch (query) {\n var results = query ? filterForUsers(query) : vm.states;\n\n return results;\n }", "function querySearch(query) {\n var results = query ? $scope.user.friends.filter(createFilterFor(query)) : [];\n return results;\n }", "function listUsers(req, res) {\n if (req == null || req.query == null) {\n return utils.res(res, 400, 'Bad Request');\n }\n\n if (req.user_id == null) {\n return utils.res(res, 401, 'Invalid Token');\n }\n\n try {\n // Pagination\n const range = JSON.parse(req.query.range);\n const r0 = range[0], r1 = range[1] + 1;\n\n // Sort\n const sorting = JSON.parse(req.query.sort);\n const sortPara = sorting[0];\n const sortOrder = sorting[1];\n\n // Filter\n const filter = JSON.parse(req.query.filter);\n } catch (err) {\n return utils.res(res, 400, 'Please provide appropriate range, sort & filter arguments');\n }\n\n\n let qFilter = JSON.parse(req.query.filter);\n let filter = {};\n if (!(qFilter.user_id == null) && typeof (qFilter.user_id) === 'string') filter['user_id'] = { $regex: qFilter.user_id, $options: 'i' };\n\n // Fetch User lists\n models.User.find(filter, 'user_id name email age university total_coins cyber_IQ role')\n .lean()\n .exec(function (err, users) {\n if (err) {\n return utils.res(res, 500, 'Internal Server Error');\n }\n\n if (users == null) {\n return utils.res(res, 404, 'Users do not Exist');\n }\n users.map(u => {\n u['id'] = u['user_id'];\n delete u['user_id'];\n delete u['_id'];\n if (!u['university']) {\n u['university'] = 'NA';\n }\n return u;\n });\n\n // Pagination\n const range = JSON.parse(req.query.range);\n const len = users.length;\n const response = users.slice(range[0], range[1] + 1);\n const contentRange = 'users ' + range[0] + '-' + range[1] + '/' + len;\n\n // Sort\n const sorting = JSON.parse(req.query.sort);\n let sortPara = sorting[0] || 'name';\n let sortOrder = sorting[1] || 'ASC';\n if (sortOrder !== 'ASC' && sortOrder != 'DESC') sortOrder = 'ASC';\n\n res.set({\n 'Access-Control-Expose-Headers': 'Content-Range',\n 'Content-Range': contentRange\n });\n return utils.res(res, 200, 'Retrieval Successful', utils.sortObjects(response, sortPara, sortOrder));\n })\n}", "async filterUsers(event, filterBy='') {\n event.preventDefault();\n if(filterBy === 'role') {\n await this.setState({ filterRole: event.target.value });\n }\n const { search, filterRole } = this.state;\n await this.props.list(1, search, filterRole);\n }", "function searchUsers(input){\n var finalArray = [];\n userAdded = [];\n for(var i = 0; i < orignal.length; i++){\n if(((((users[i].name.first).indexOf(input) > -1) || ((users[i].name.last).indexOf(input) > -1) || ((users[i].login.username).indexOf(input) > -1)) && userAdded.indexOf(i) < 0)) {\n finalArray.push(users[i]);\n userAdded.push(i);\n }\n }\n $('.container-fluid > div').remove();\n $('#lightbox').remove();\n numberOfUsers = finalArray.length;\n renderPage(finalArray);\n}", "getByUsername(username) {\n return this.list({\n filter: {\n username,\n },\n });\n }", "function createFilterFor(query) {\n\n // var lowercaseQuery = angular.lowercase(query); //for english only\n return function filterFn(student) {\n return (student.name.indexOf(query) != -1) ||\n (student.schoolid.indexOf(query) != -1);\n };\n\n }", "filterList(queryString) {\n this.doFilter(queryString);\n }", "filterList(queryString) {\n this.doFilter(queryString);\n }", "function filter_data(req, data)\n{\n var ret = [];\n var tmp;\n var matched;\n\n if(req.session.user.role == \"user\")\n return ret;\n\n else if(req.session.user.role == \"realm_admin\") {\n for(var item in data) {\n tmp = data[item];\n\n for(var user in data[item].users) {\n matched = false; // not matched by default\n\n for(var realm in req.session.user.administered_realms)\n if(data[item].users[user].replace(/^.*@/, \"\") == req.session.user.administered_realms[realm]) { // one of the admin's realms matches\n matched = true;\n break;\n }\n\n if(!matched) // filter out\n tmp.users[user] = tmp.users[user].replace(/^.*@/, \"*filtered*@\");\n }\n\n\n if(ret.indexOf(tmp) == -1) // add new item\n ret.push(tmp);\n }\n }\n\n else if(req.session.user.role == \"admin\") // no filtration\n return data;\n\n return ret;\n}", "_refreshList(query) {\n this.props.userFilterApplySpinner(true);\n let filterSubsData={}\n if (query.username) {\n let name_query=query.username.split(\" \")\n name_query=name_query.filter(function (word) {\n return !!word\n })\n filterSubsData[\"username\"]=name_query.length > 1 ? name_query : name_query.join(\"\").trim();\n }\n if (query.status) {\n query.status=query.status.constructor=== Array ? query.status : [query.status]\n if (query.status.length !== 2) {\n filterSubsData[\"logged_in\"]=['is',query.status[0]=== 'online' ?'true' : 'false']\n }\n\n }\n if (query.role) {\n query.role=query.role.constructor===Array?query.role:[query.role]\n filterSubsData[\"role\"]=['in', query.role.constructor===Array?query.role:[query.role]]\n }\n if (query.mode) {\n let pps_list=[]\n query.mode=query.mode.constructor===Array?query.mode:[query.mode]\n query.mode.forEach(function (mode) {\n pps_list.push(mode.split(\"__\").length > 1 ? {\n pps_mode: mode.split(\"__\")[0],\n seat_type: mode.split(\"__\")[1]\n } : {pps_mode: mode.split(\"__\")[0]})\n })\n filterSubsData[\"pps\"]=['in', pps_list]\n }\n if (Object.keys(query).filter(function(el){return el!=='page'}).length !== 0) {\n this.props.toggleUserFilter(true);\n this.props.filterApplied(true);\n } else {\n this.props.toggleUserFilter(false);\n this.props.filterApplied(false);\n }\n let updatedWsSubscription=this.props.wsSubscriptionData;\n updatedWsSubscription[\"users\"].data[0].details[\"filter_params\"]=filterSubsData;\n this.props.initDataSentCall(updatedWsSubscription[\"users\"])\n this.props.updateSubscriptionPacket(updatedWsSubscription);\n this.props.userfilterState({\n tokenSelected: {\n \"STATUS\": query.status||[\"all\"],\n \"ROLE\": query.role||['all'],\n \"WORK MODE\": query.mode||['all'],\n \"LOCATION\": [\"all\"]\n }, searchQuery: {\"USER NAME\": query.username || null},\n defaultToken: {\"STATUS\": [\"all\"], \"ROLE\": [\"all\"], \"WORK MODE\": [\"all\"], \"LOCATION\": [\"all\"]}\n });\n }", "function filter(req, res, next){\n db.collection('datingapp').find({\n // This is where we find the userId and the gender & sexuality they want to filter on and we filter the rest of the people with the .find\n $and: [ \n {firstName:{$ne: req.session.userId.firstName}},\n {gender: req.session.userId.filter['gender']}, \n {sexuality: req.session.userId.filter['sexuality']}\n ]}).toArray(done)\n function done(err, data){\n if (err){\n next(err)\n } else {\n // \n res.render('index.ejs', {data: data})\n }\n }\n}", "function findUsers(input){\n var users = getUsers();\n var preList = [];\n\n $.each(users, function(index, user){\n if( user.name.includes(input) )\n preList.push(user);\n });\n renderUsers(preList);\n}", "searchUser() {\n const { searchUser, allUsers } = this.state;\n var allResults = allUsers.filter(oneUser => {\n return oneUser.username.indexOf(searchUser) > -1;\n });\n return allResults;\n }", "function listUsers(req,res,next){\n\n let query = {};\n if(req.params.id) {\n query.where = {\n id:req.params.id\n }\n \n }\n else if(req.query){\n console.log(\"search name: \"+req.query);\n query.where = {\n nom : req.query.nom ? {$ilike:\"%\"+req.query.nom+\"%\"} : undefined\n }\n console.log(query);\n\n }\n users.findAll(query).then(res=>{\n req._users = res;\n next();\n }).catch(err=>{\n next(err);\n });\n}", "async allUsers({ sortField, sortOrder = 'asc', page, perPage = 25, filter = {} }, info) {\n let items = [...mockData['users']];\n\n return this.filter(items, { sortField, sortOrder, page, perPage, filter });\n }", "function filterContacts(){\n\n var searchBox = document.getElementById(\"searchBox\");\n\n if(searchBox.value.length>1){\n\n var subSetContacts = USER_ARRAY.filter(function(contact){\n return contact.getFullName().toLowerCase().indexOf(searchBox.value.toLowerCase()) > -1;\n });\n\n console.log(\"result of filter\",subSetContacts);\n generateList(subSetContacts);\n\n }else if(searchBox.value.length==0){\n generateList(USER_ARRAY);\n }\n\n}", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(lkmOccupationList) {\n return (lkmOccupationList.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "function filterUsers(usertype, userrank, unconfirmed, gmaillogin, mentor, multipleprojects, selectedusertype, selecteduserrank, SelectedProject, userproject) {\n //alert(\"gg\");\n vm.filteredusers = vm.allusers;\n\n // n^2\n if (SelectedProject && userproject) {\n //alert(\"not null SelectedProject\");\n studentsArray = [];\n\n vm.filteredusers.forEach(function (obj) {\n SelectedProject.members.forEach(function (obj2) {\n //alert(obj.email);\n //alert(obj2);\n\n // user is in project we selected\n if (obj.email == obj2) {\n studentsArray.push(obj);\n //alert(obj.email);\n }\n\n });\n });\n\n vm.filteredusers = studentsArray;\n }\n\n if (usertype && selectedusertype) {\n usertype = selectedusertype.name;\n var tempArray = [];\n vm.filteredusers.forEach(function (obj) {\n if (obj.userType == usertype) {\n tempArray.push(obj);\n }\n });\n vm.filteredusers = tempArray;\n }\n if (userrank && selecteduserrank) {\n userrank = selecteduserrank;\n var tempArray = [];\n vm.filteredusers.forEach(function (obj) {\n if (obj.userRank == userrank) {\n tempArray.push(obj);\n }\n });\n vm.filteredusers = tempArray;\n }\n if (unconfirmed) {\n var tempArray = [];\n vm.filteredusers.forEach(function (obj) {\n if (obj.piApproval == false) {\n tempArray.push(obj);\n }\n });\n vm.filteredusers = tempArray;\n }\n if (gmaillogin) {\n var tempArray = [];\n vm.filteredusers.forEach(function (obj) {\n if (obj.google) {\n tempArray.push(obj);\n }\n });\n vm.filteredusers = tempArray;\n }\n if (mentor) // O(n^3) Very slow.\n {\n var tempArray = [];\n vm.filteredusers.forEach(function (obj) {\n vm.projects.forEach(function (proj) {\n var full = obj.firstName + \" \" + obj.lastName;\n if (proj.owner_name == full && tempArray) {\n var contains;\n tempArray.forEach(function (temp) {\n var full2 = temp.firstName + \" \" + temp.lastName;\n if (full2 == full) {\n contains = true;\n }\n });\n if (!contains) {\n tempArray.push(obj);\n }\n }\n else if (proj.owner_name == full) {\n tempArray.push(obj);\n }\n });\n });\n vm.filteredusers = tempArray;\n }\n if (multipleprojects) // O(n^3) Very slow.\n {\n var tempArray = [];\n\n vm.filteredusers.forEach(function (obj) {\n var counter = 0;\n if (obj.joined_project == true) {\n vm.projects.forEach(function (proj) {\n proj.members.forEach(function (email) {\n if (email == obj.email) {\n counter++;\n if (counter > 1) {\n if (tempArray) {\n var contains;\n tempArray.forEach(function (temp) {\n var full = obj.firstName + \" \" + obj.lastName;\n var full2 = temp.firstName + \" \" + temp.lastName;\n if (full2 == full) {\n contains = true;\n }\n });\n if (!contains) {\n tempArray.push(obj);\n }\n }\n else {\n tempArray.push(obj);\n }\n }\n }\n });\n });\n }\n });\n vm.filteredusers = tempArray;\n }\n }", "function searchBox () {\n\t// Declare variables\n\tvar input, filter, users, user, picture, i;\n\tinput = document.getElementById('search');\n\tfilter = input.value.toUpperCase();\n\tusers = $(\".users ul\");\n\tuser = $(\".user-box\");\n\n\t// Loop through all user(s) and hide those who dont match the search query\n\tfor (i = 0; i < user.length; i++) {\n\t\tboxText = user[i].getElementsByTagName(\"p\")[0];\n\t\tif (boxText) {\n\t\t\tif (boxText.innerHTML.toUpperCase().indexOf(filter) > -1) {\n\t\t\t\tuser[i].style.display = \"\";\n\t\t\t} else {\n\t\t\t\tuser[i].style.display = \"none\";\n\t\t\t}\n\t\t}\n\t}\n}", "function createFilterFor(query) {\n \tconst lowercaseQuery = angular.lowercase(query);\n\n \treturn function filterFn(item) {\n \t\treturn (angular.lowercase(item.display).indexOf(lowercaseQuery) > -1);\n \t};\n }", "function filterInput(){\n AllUsers = document.getElementById(\"users\").getElementsByTagName(\"option\");\n filterValue=filter.value.toUpperCase();\n for(i=0;i < AllUsers.length; i++){\n if(AllUsers[i].innerHTML.toUpperCase().indexOf(filterValue) > -1 ){\n AllUsers[i].style.display=\"\";\n }\n else{\n AllUsers[i].style.display=\"none\";\n }\n } \n}", "function applyFilters(queryString) {\n let url = location.origin + location.pathname;\n url = queryString ? url + \"?\" + queryString : url;\n window.history.pushState(\"filtered users\", \"کاربران فیلتر شده\", url);\n $.get(window.location.origin+window.location.pathname+\"/json?\" + queryString, function(res, status) {\n if (status) {\n showTranslators(res.translators);\n showUsers(res.customers);\n showPagination(parseInt(res.translators_count),parseInt(res.translator_current_page),10,window.location.origin+window.location.pathname, window.location.search,3,\".translator-pagination\",\"t_\");\n showPagination(parseInt(res.customerss_count),parseInt(res.customer_current_page),10,window.location.origin+window.location.pathname, window.location.search,3,\".customer-pagination\",\"c_\");\n }\n });\n}", "function filteredUserFields({id, provider, provider_id, username, display_name, family_name, given_name, middle_name, gender, profile_url, email}) {\n const filteredResult = {\n id,\n provider,\n provider_id,\n username,\n display_name,\n family_name,\n given_name,\n middle_name,\n gender,\n profile_url,\n email\n };\n return filteredResult;\n}", "function filterUsers() {\n var usersIds = getUsersId();\n return allUsers.map(function(el) {\n if (!el.universal && usersIds.indexOf(el.id) < 0) {\n return el;\n }\n });\n }", "findUsers ({commit}, payload) {\n let nameResults = []\n let roleResults = []\n let results = []\n // Check if filterSet has searchCriteria, based on it filters allUsers\n // match displayName or email with the searchCriteria\n if (payload.searchCriteria.length < 1 && !payload.admin && !payload.translator && !payload.editor && !payload.designer) {\n commit('clearFilteredUsers')\n return\n }\n if (payload.searchCriteria.length) {\n nameResults = state.allUsers.filter(user => {\n return user.email.match(payload.searchCriteria) || user.displayName.toLowerCase().match(payload.searchCriteria)\n })\n console.log('nameRes', nameResults)\n }\n // Check if filterSet contains one or more roles marked, filters allUsers\n if (payload.admin) {\n let result = state.allUsers.filter(user => user.roles.admin)\n roleResults = [...roleResults, ...result]\n }\n if (payload.editor) {\n let result = state.allUsers.filter(user => user.roles.editor)\n roleResults = [...roleResults, ...result]\n }\n if (payload.translator) {\n console.log(payload.translator)\n let result = state.allUsers.filter(user => user.roles.translator)\n roleResults = [...roleResults, ...result]\n }\n if (payload.designer) {\n let result = state.allUsers.filter(user => user.roles.designer)\n roleResults = [...roleResults, ...result]\n }\n // Based on results of filtering by searchCriteria and roles, in case they both not empty\n // combines results\n if (roleResults.length && nameResults.length) {\n results = nameResults.filter(element => roleResults.includes(element))\n } else if (roleResults.length && !nameResults.length) {\n results = roleResults\n } else if (nameResults.length && !roleResults.length) {\n results = nameResults\n } else {\n results = null\n }\n commit('findUsers', results)\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(personal) {\n return (angular.lowercase(personal.fName).indexOf(lowercaseQuery) === 0);\n };\n }", "async getUsers(filter) {\n return await User.find({}, null, filter).\n select('-password -__v').\n populate('posts')\n }", "function buildFilters(userQueryOptions) {\n if (!_.has(userQueryOptions, 'filter')) {\n return '';\n }\n var filters = _.keys(userQueryOptions.filter).map(function (filterKey) {\n var value = userQueryOptions.filter[filterKey];\n return filterKey + \":\" + value;\n }).join(' AND ');\n return \"&filter=\" + filters;\n}", "function querySearch (query) {\n\t \t$scope.getPrincipals(query);\n\n\t var results = query ? $scope.emailsList.filter( createFilterFor(query) ) : $scope.emailsList,\n\t deferred;\n\t if ($scope.simulateQuery) {\n\t deferred = $q.defer();\n\t $timeout(function () { deferred.resolve( results ); }, Math.random() * 1000, false);\n\t return deferred.promise;\n\t } else {\n\t \tvar emailListVar = [];\n\n\t \tangular.forEach(results, function(email) {\n\t \t \temailListVar.push({\"email\" : email})\n\t \t});\n\t \tconsole.log('emailListVar',emailListVar);\n\t return emailListVar;\n\t }\n\t }", "function createFilterFor(query) {\n console.log(query);\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\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}", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.name.toLowerCase().indexOf(lowercaseQuery)===0 || item.policyNo.indexOf(lowercaseQuery) ===0);\n };\n\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(prodcutos) {\n return (prodcutos.value.indexOf(lowercaseQuery) === 0);\n };\n }", "function filterTullkontor () {\n \t\tjq('#tullkontorList').DataTable().search(\n \t\tjq('#tullkontorList_filter').val()\n \t\t).draw();\n }", "listUsers(args) {\n let filters = !isEmpty(args.filters) ? JSON.parse(args.filters) : {}\n let options = !isEmpty(args.options) ? JSON.parse(args.options) : {}\n let results = {}\n\n return this.userStore.countUsers(filters)\n .then(count => {\n results.total = count\n return this.userStore.listUsers(filters, options)\n })\n .then(function(users) {\n results.records = users\n return results\n })\n }", "\"filter:database\"(queryPayload) {\n return queryDatabase(queryPayload, (data, attrs) => _.filter(data.results, attrs));\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n\n\n\n\t }", "function getUsers(query) {\n if ($scope.data.ACL.users.length) {\n var args = {\n options: {\n classUid: 'built_io_application_user',\n query: query\n }\n }\n return builtDataService.Objects.getAll(args)\n } else\n return $q.reject({});\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(food) {\n return !$scope.pantryItems.includes(food) && (!query || food.indexOf(lowercaseQuery) !== -1);\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(res) {\n console.log(\"sj::\"+lowercaseQuery);\n return (res.indexOf(query) == 0);\n };\n\n }", "function filterByUserId(userId) {\n\t// Remove all hide classes to undo any current filtering\n\t$(\".list-card\").removeClass(\"hide\");\n\n\tif(!$.isEmptyObject(userId)) {\n\t\t// Filter all cards that are not assigned to the current user\n\t\t$(\".list-card:not(:has('.js-member-on-card-menu[data-idmem=\" + userId + \"]'))\").addClass(\"hide\");\n\t}\n}", "function createFilterFor(query) {\n\t\t var lowercaseQuery = angular.lowercase(query);\n\t\t return function filterFn(item) {\n\t\t\treturn (item.value.indexOf(lowercaseQuery) === 0);\n\t\t };\n\t\t}", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);;\n };\n\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(vegetable) {\n return (vegetable._lowername.indexOf(lowercaseQuery) === 0) ||\n (vegetable._lowertype.indexOf(lowercaseQuery) === 0);\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) != -1);\n };\n }", "searchUser(e) {\n this.loadUsers(e.target.value);\n this.setState({\n users: this.state.dataset.filter(\n x => x.name.indexOf(e.target.value) !== -1 // filtering users by name using search value\n )\n });\n }", "function getMultiple(filter = {}) {\n return db('users')\n .where(filter);\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 createFilterFor(query) {\n\n return function filterFn(fondeo) {\n return (fondeo.titulo.indexOf(query) === 0);\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(airport) {\n return ((airport.airport_code.toLowerCase()).search(lowercaseQuery) > -1) || ((airport.name.toLowerCase()).search(lowercaseQuery) > -1);\n };\n }", "function getAllRegUser(){\n var filter = {};\n $scope.regUsers = [];\n userSvc.getUsers(filter).then(function(data){\n data.forEach(function(item){\n if(item.email)\n $scope.regUsers[$scope.regUsers.length] = item;\n });\n })\n .catch(function(err){\n Modal.alert(\"Error in geting user\");\n })\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(vegetable) {\n return (vegetable._lowername.indexOf(lowercaseQuery) === 0) ||\n (vegetable._lowertype.indexOf(lowercaseQuery) === 0);\n };\n\n }", "function createFilterForModel(query) {\n var lcQuery = angular.lowercase(query);\n return function filterFn(item) {\n item = angular.lowercase(item);\n return (item.indexOf(lcQuery) === 0);\n }\n }", "function createFilterFor(query) {\n var lowercaseQuery = query.toLowerCase();\n\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) !== -1);\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(vegetable) {\n return (vegetable._lowername.indexOf(lowercaseQuery) === 0) ||\n (vegetable._lowertype.indexOf(lowercaseQuery) === 0);\n };\n\n }", "getUsers(filters) {\n this.helper.publish(JSON.stringify(filters), Constants.USERS, Constants.GET_USERS,(err, users) => {\n this.sockets.forEach((socket) => {\n if (err) socket.emit(Constants.ERROR);\n else socket.emit(Constants.USERS_RETURNED, users);\n });\n });\n }", "function createFilterFor(query) {\n var lowercaseQuery = query.toLowerCase();\n\n return function filterFn(item) {\n return (item.value.includes(lowercaseQuery));\n };\n\n }", "filterArray(rawSearchArray) {\n searchDisplayArray = []\n rawSearchArray.forEach(result => {\n //Check to make sure result is not user//\n if (result.id != sessionStorage.activeUser) {\n //Check for current friends//\n let friendNow = false\n friendsArray.forEach(friend => {\n if(result.id === friend.friendId) {\n friendNow = true\n }\n }\n )\n if (friendNow === false) {\n searchDisplayArray.push(result)\n }\n }\n \n })\n friendsDOM.insertSearchResult(searchDisplayArray)\n }", "getAllForUser(req, res) {\n let user_id = req.params.user_id \n let filters = {\n fromDate: req.query.fromDate || 0,\n toDate: req.query.toDate || new Date(32503680000000),\n minAmount: req.query.minAmount || 0,\n maxAmount: req.query.maxAmount || Infinity,\n }\n\n User.findOne({ '_id': user_id }, (err, user) => {\n if (err) throw err\n\n if (!user) {\n res.status(404).send({error: 'Invalid user.'})\n } else {\n Expense.find({ user_id: user._id })\n .where('date').gte(filters.fromDate).lte(filters.toDate)\n .where('amount').gte(filters.minAmount).lte(filters.maxAmount)\n .sort('-date')\n .exec((err, expenses) => {\n if (err) throw err\n res.send({ expenses: expenses })\n })\n }\n })\n .catch((err) => {\n res.status(500).send({error: err.message})\n })\n }", "function filterUsername(name) {\n refresh(streams.users[name]);\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(associate) {\n return (associate._lowername.indexOf(lowercaseQuery) === 0) || (associate._lowertype.indexOf(lowercaseQuery) === 0);\n };\n }", "function filterByUser(param) {\n self.selectionModel.allMatter = param;\n if (param == 1) {\n self.viewModel.filters.for = \"mymatter\";\n } else {\n self.viewModel.filters.for = \"allmatter\";\n }\n self.viewModel.filters\n getMatterList(undefined, 'calDays');\n }", "function searchUser() {\n var WINDOW_LOCATION_SEARCH = \"?search={search}\"\n var term = $('#search').val().trim();\n if (term.length > 3) {\n var bySearchTermUrl = GET_USERS + WINDOW_LOCATION_SEARCH.replace('{search}', term)\n fetchUsers(bySearchTermUrl)\n }\n}", "getFilteredItems(query){\r\n return this.source.filter((item) =>item[this.getOptionLabel].toLowerCase().startsWith(query.toLowerCase(), 0) && !item.invisible);\r\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n return (item.value.indexOf(lowercaseQuery) === 0);\n };\n\n }", "function filterByQuery(query) {\n\tlet matchedBets = [];\n \tconsole.log(query);\n\t//loop through the bet\n\tfor (let bet in bets) {\n\t\tlet obj = bets[bet];\n\t\tlet lowerCaseQuery = query.toLowerCase();\n\t\t//if title, question, id or creators name includes query, or if id or uid is equal to query, push bet to mathchedBets\n\t\tif (obj.title.toLowerCase().includes(lowerCaseQuery) || obj.question.toLowerCase().includes(lowerCaseQuery) || obj.creator.name.toLowerCase().includes(lowerCaseQuery) || obj.id == query || obj.creator.uid == query) {\n\t\t\tmatchedBets.push(obj);\n\t\t};\n\t};\n \tshowBets(matchedBets);\n\tremoveActiveClassFromBtns();\n}", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);\n };\n\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);\n };\n\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);\n };\n\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.searchField.indexOf(lowercaseQuery) > -1);\n };\n }", "function createFilterFor(query) {\n var lowercaseQuery = query.toLowerCase();\n // console.log('lowercaseQuery', lowercaseQuery);\n\n return function filterFn(attribute) {\n // console.log('attribute (filterFn)', attribute);\n var label = attribute.attributes.admin_label.toLowerCase();\n var found = label.indexOf(lowercaseQuery) === 0;\n\n return found;\n };\n\n }", "query(db, user_input = {}, options = {}) {\n const langcode = options.langcode;\n const query = this.queryBuilder(db, options);\n\n let values = { ...this.__options.defaultFilters, ...user_input };\n\n if (options.limit > 0) {\n query.limit(options.limit);\n } else {\n query.limit(FALLBACK_LIMIT);\n }\n\n if (options.skip > 0) {\n query.offset(options.skip);\n }\n\n for (let [field, value] of this.baseFilters) {\n if (Array.isArray(value)) {\n query.whereIn(field, value);\n } else {\n query.where(field, value);\n }\n }\n\n for (let name in values) {\n if (!this.filters.has(name)) {\n continue;\n }\n\n const rule = this.filters.get(name);\n const value = values[name];\n\n switch (rule.filter) {\n case 'prefix':\n if (typeof value == 'string' && !value.length) {\n break;\n }\n prefixFilter(query, rule.field, value);\n break;\n\n case 'substring':\n if (typeof value == 'string' && !value.length) {\n break;\n }\n partialMatchFilter(query, rule.field, value);\n break;\n\n case 'terms':\n if (typeof value == 'string' && !value.length) {\n break;\n }\n termsFilter(query, rule.field, stringToTerms(value));\n break;\n\n case 'callback':\n rule.callback(query, value, values, options);\n break;\n\n default:\n console.error('FAIL', rule)\n throw new Error(`Invalid filter specification for '${name}'`);\n }\n\n if (rule.join) {\n for (let join of rule.join) {\n query.innerJoin(join.table, ...join.with);\n }\n }\n\n if (rule.multilang && langcode) {\n query.andWhere(`${rule.table}.langcode`, langcode);\n }\n }\n\n const sorting = (options.sort && options.sort.length)\n ? options.sort\n : this.__options.defaultSorting\n ;\n\n if (sorting) {\n this.sort(query, sorting, langcode);\n }\n\n let filters = new FilterChain;\n\n const context = {\n query: query,\n transform: (callback, ...args) => {\n filters.transform(callback, ...args);\n return context;\n },\n clone: () => query.clone(),\n then: async (callback) => {\n const result = filters.context(await query);\n await this.events.emit('result', {db, result, values, options});\n return callback(result);\n }\n };\n\n return context;\n }", "async getResults(query, data) { // * Updated this function to run asynchronously\n if (!query) return [];\n if(this.options.endpoint !== undefined) { // ! Added this conditional to run the logic supplied on component construction\n data = await this.options.getUserData(query, this.options.endpoint, this.options.numOfResults);\n }\n // Filter for matching strings\n return data.filter((item) => {\n return item.text.toLowerCase().includes(query.toLowerCase());\n });\n }", "populateUserFilter()\n {\n let params = { type : ProcessRequest.GetAllMembers };\n let successFunc = function(response)\n {\n let select = $(\"#filterTo\");\n response.forEach(function(user)\n {\n select.appendChild(buildNode(\"option\", { value : user.id }, user.username));\n });\n\n select.value = this.get().user;\n }.bind(this);\n\n let failureFunc = function()\n {\n Animation.queue({ backgroundColor : \"rgb(100, 66, 69)\" }, $(\"#filterTo\"), 500);\n Animation.queueDelayed({ backgroundColor : \"rgb(63, 66, 69)\" }, $(\"#filterTo\"), 1000, 500, true);\n };\n\n sendHtmlJsonRequest(\"process_request.php\", params, successFunc, failureFunc);\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(position) {\n return (position.value.indexOf(lowercaseQuery) > -1)\n\n //return (name.value.indexOf(lowercaseQuery) === 0);\n };\n }", "function search(e){\n e.preventDefault();\n searchCriteria.value == 'user' ? fetchUsersByName() : fetchReposByName()\n userList.innerHTML = ''\n form.reset();\n}", "findUsers (state, payload) {\n state.filteredUsers = payload\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(contact) {\n return (contact._lowername.indexOf(lowercaseQuery) != -1);\n };\n }", "function searchDirectory() {\n const filterValue = document.getElementById('filter-value').value\n const filterType = document.querySelector('input[name=filter-key]:checked').value\n // intially it was written \"document.querySelector('input[name=filter-type]:checked').value\"\n\n client.user.search({\n [filterType]: filterValue\n })\n}" ]
[ "0.7044038", "0.6887411", "0.6870493", "0.6801758", "0.6764492", "0.67115617", "0.6669595", "0.66500115", "0.6626996", "0.65408206", "0.651918", "0.64960456", "0.64897066", "0.64788693", "0.6456786", "0.64268714", "0.6424848", "0.64139855", "0.6363141", "0.6321525", "0.63037544", "0.6261821", "0.6248108", "0.6230418", "0.6230418", "0.6216843", "0.6210393", "0.6198795", "0.6177286", "0.61721575", "0.61675304", "0.6147317", "0.61275303", "0.6120997", "0.6112286", "0.6097639", "0.6088625", "0.60651237", "0.6045364", "0.60355777", "0.6012742", "0.60109717", "0.6010879", "0.6009556", "0.5998329", "0.59964854", "0.59956956", "0.59954447", "0.5994887", "0.5990656", "0.5964079", "0.59600675", "0.5943651", "0.59256065", "0.59240204", "0.59200066", "0.59081304", "0.5896337", "0.5895948", "0.5894589", "0.5890133", "0.58896846", "0.58895046", "0.5884668", "0.5884595", "0.5883195", "0.58795035", "0.5851403", "0.5841062", "0.5838723", "0.58207846", "0.58168113", "0.58129126", "0.58108944", "0.5803764", "0.57967436", "0.57961893", "0.57855374", "0.5782164", "0.57804626", "0.57747805", "0.57729846", "0.577108", "0.57706535", "0.57697964", "0.5769781", "0.5769753", "0.5767524", "0.57643014", "0.5763542", "0.5763542", "0.57601655", "0.57592607", "0.5751273", "0.57492775", "0.5737595", "0.57350147", "0.573283", "0.57312614", "0.57286423", "0.5728384" ]
0.0
-1
responsable for the html displayed in the browser it is the view Component are just javascript Functional Component are just javascript functions They can optionally receive an object of properties props and return HTML (know as JSX) which describes the UI
function App() { return ( <div className="App"> <Greet /> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(){return html``}", "render(){\n //Every render method always return HTML\n return <h1>Welcome to Myclass</h1>;\n }", "render() { // it is a function ==> render: function() {}\n return (<h1>Hello World!!!!!!!</h1>);\n }", "render(){\n\n //retorna el template usando el html del tag del template, crea los elementos en el dom\n return html`\n <div>Hello Word!!</div>\n `;\n }", "render() {\n\t\treturn <div>{this.renderContent()}</div>;\n\t}", "render() {\n return html ``;\n }", "render(){\n //esto es lo que te devuelve esta funcion\n return <div></div>;\n }", "render(){}", "render(){}", "render() {\n\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n \n }", "function SomePreactComponent(props) {\n return html`<h1 style=\"color: red\">Hello, World!</h1>`;\n}", "render() {\n//todo add component view\n return (\n <div>\n PageTest\n </div>\n );\n }", "function HTML(props) {\n const {\n htmlAttributes,\n headerElements,\n bodyElements,\n appBodyString,\n } = props;\n\n return (\n <html {...htmlAttributes} className=\"no-js\">\n <head>\n {headerElements}\n </head>\n\n <body>\n <div id=\"app\" dangerouslySetInnerHTML={{ __html: appBodyString }} />\n {bodyElements}\n </body>\n </html>\n );\n}", "render() {}", "render() {}", "render() {}", "render() { //render method that returns the DOM representation our component\n return ( // jeśli wyrzucimy nawias i w tej samej linii damy kod z kolejnej (tutaj <div>), będzie OK\n <div>\n <h1>Hello Series</h1>\n <b>Bold</b>\n </div>\n )\n // return React.createElement('h1', null, 'Hello Eggheads'); //\n }", "render() {\n// A render method must contain a return statement. Usually, this return statement returns a JSX expression\n return <h1>Hello world</h1>;\n }", "function SampleComponent() {\n return <h1>Hello World</h1>;\n}", "render() {\n return <div>{this.toRender()}</div>;\n }", "render() {\n return(<div />);\n }", "render() {\n return this.renderContent()\n }", "renderHTML() {\n \n }", "render() {\n return html([`\n <h2>Hello ${this.prop1}!</h2>\n <p><slot></slot></p>\n `]);\n }", "render() {\n return(<h1>Hello World!!!</h1>);\n }", "getContents() {\n const {\n sessionView,\n } = this.props;\n\n switch (sessionView) {\n case PICK_SESSION_VIEW:\n return this.renderSessions();\n case PICK_PEER_TO_REVIEW_VIEW:\n return this.renderReviewablePeers();\n case EDITABLE_QS_VIEW:\n return this.renderEditableQs();\n case READ_ONLY_QS_VIEW:\n return this.renderReadableQs();\n case PICK_PEER_TO_READ_VIEW:\n return this.renderReviewablePeers();\n case READ_PEERS_REVIEWS_VIEW:\n return this.renderReviewablePeers();\n default:\n return <div/>;\n }\n\n }", "render() {\r\n return <div />\r\n }", "render() {\n return <h1>{this.props.content}</h1>\n }", "html()\n{\n console.log(\"Rendering\");\n const html = ` <h2>${this.name}</h2>\n <div class=\"image\"><img src=\"${this.imgSrc}\" alt=\"${this.imgAlt}\"></div>\n <div>\n <div>\n <h3>Distance</h3>\n <p>${this.distance}</p>\n </div>\n <div>\n <h3>Difficulty</h3>\n <p>${this.difficulty}</p>\n </div>\n </div>`;\n\n return html;\n}", "render() {\n return this.renderContent();\n }", "render() {\r\n return <h1> I am a Heading Component</h1>\r\n }", "render(){return renderNotImplemented;}", "render() {\n return html`Web Components are <span>${this.mood}</span>!`;\n }", "render () {\n\n return (\n <div>\n { this.renderBodyContent() }\n </div>\n )\n\n }", "render() {\n return <div></div>;\n }", "renderAsHtml() {\n return this.clone(View, \"renderashtml\")();\n }", "render() {\n const { name, code } = this.props\n return (\n <div>\n <h1>This is a Class Components</h1>\n <p>I am {name}, and I love {code}</p>\n </div>\n )\n }", "_render()\n {\n if (this.isDisabled())\n return;\n\n this._setContentSizeCss();\n this._setDirection();\n const paragraph = html`<p>${this.text}</p>`;\n let anchor = \"\";\n let action = \"\";\n if (this.link && this.linkText)\n anchor = html`<a href=\"${this.link}\" target=\"_blank\">${this.linkText}</a>`;\n if (this.action && this.actionText)\n action = html`${anchor ? \" | \" : \"\"}<a href=\"javascript:void(0)\" @click=${this.action}>${this.actionText}</a>`;\n let heading = \"\";\n if (this.heading)\n heading = html`<h4>${this.heading}</h4>`;\n\n render(html`${heading}${paragraph}<div id=\"links\">${anchor}${action}</div>`, this.tooltipElem);\n }", "function FunComponent()\n{\n return <h1>This is my Functional Component</h1>;\n \n}", "function Person() {\n // P should be capital\n return <div>Name : Manpreet</div>; // function to return the view\n}", "render() {\n\t\t// make sure you wrap the entire thing using () \n\t\t// for the html content you need to put a tag like div\n\t\t// to wrap the whole content\n\t\treturn (\n\n\t\t\t// use tachyons here, use classNmae \n\t\t\t// search the className you can use on their website\n\t\t\t <div className=\"vh-100 dt w-100 tc bg-dark-gray white cover\" style={{backgroundImage: `url(http://mrmrs.github.io/photos/u/009.jpg`}} >\n\t\t\t \t<div className=\"dtc v-mid\">\n\t\t\t\t\t<h1 className='f3 f-headline-l fw1 i tc'>Hello World</h1>\n\t\t\t\t\t<h2 className=\"f3 f-headline-l fw1 i white-90\">Ha it works!!! Welcome to React</h2>\n\t\t\t\t\t<h2>Is tachyons working???</h2>\n\t\t\t\t\t<h2>Now it's working</h2>\n\t\t\t\t\t<h2>this is from the props : {this.props.greetings}</h2>\n\t\t\t\t\t<div className=\"aspect-ratio aspect-ratio--1x1\">\n\t\t\t\t\t\t<p>What does this look like?</p>\n\t \t\t\t</div>\n \t\t\t</div>\n\t\t\t</div>\n\t\t\t)\n\t}", "function render () {\n return (this[_DOM] || (this[_DOM] = _template(this))).view\n}", "render() {\n return <div />\n }", "render (props) {\n if (this.state.error) return this.renderDefaultError(props)\n return this.renderContent(props)\n }", "render(props) {\n return (\n <div>{props.hello}</div>\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div data-react-name={this.state.reactName}>{this.renderContent()}</div>\n\t\t);\n\t}", "function hi () {\n return <div> hi </div>\n \n}", "render() { }", "function renderComponent(ComponentClass,props,state){\n const componentInstance=TestUtils.renderIntoDocument(\n <Provider store={createStore(reducers,state)}>\n <ComponentClass {...props}/>\n </Provider>\n );\n return $(ReactDOM.findDOMNode(componentInstance));//produces HTML\n}", "render() {\n // -- Mark 1 -- continued\n // lecture 20: Class Components \n // the render method returns any html we want and let's return the html we had before\n // inside our function and we see that the webpage looks exactly the same as before when\n // we were using a function to return html\n\n // by using a class component we get access to this thing called state and state is a js\n // object with properties that we can access at anytime inside our class and the way we\n // would do this is by calling the constructor keyword and inside constructor we want to\n // call super() and super calls the constructor method on the Component class and this\n // gives us access to this.state and we can set it to something ( see above ) and now we\n // can render that string down below by typing \" { this.state.string } \" and jsx tells html\n // that anything between the curly braces will be JavaScript and we use \n // \" { this.state.string } \" in multiple places which is great\n\n // if we wanted to change the state, Component gives us a method called setState and\n // setState let's us modify our state object and we also have access to a property called\n // onClick that takes a function that gets called whenever the corresponding element gets\n // clicked or in our case whenever the button is clicked and will use the setState method\n // below to change the state and that is great because it gives us a lot of control over\n // what our components will display\n // End of -- Mark 1 --\n\n // -- Mark 2 -- continued\n // lecture 22: Dynamic Content\n // remove all the jsx between the div with the className of App and replace it as follows:\n\n // -- Mark 4 --\n // lecture 28: Card List Component\n // place the CardList component below and the props parameter in CardList will be equal to\n // an object that contains the key value pairs that we pass into CardList so if we say\n // \" name = James \" inside our CardList component below, we will see the following in \n // console ( remember in CardList we consoled out props or did console.log( props ); ):\n /*\n {name: \"James\"}\n {name: \"James\"}\n */\n\n // and one of the main properties that exist on the props object is called children and\n // children are what you pass in between a component or in between\n // <CardList></CardList> so if we say <CardList>Mike</CardList> then the children prop\n // will be \" Mike \" so try this below and the go to -- card-list.component.jsx -- and change\n // \" return <div>Hello</div> \" to \" return <div>{ props.children }</div> \" and the result\n // will be shown on the webpage as:\n /*\n Mike\n */\n\n // and we also have access to props in our App component and now let's focus on our css\n // file and go to -- card-list.styles.css -- and now were back from\n // -- card-list.styles.css -- and let's move </CardList> down so that it now includes the\n // monsters array and take out \" Mike \" so now props.children in the CardList component\n // will include all the monsters and they will be laid out in an equal grid per our style\n // sheet or card-list.styles.css\n\n // so this is a fundalmental principal of react, we are building components that only care\n // about one thing and our CardList component only cares about displaying cards and in the\n // next lesson we will take this ideas a step further and apply it to an individual card\n // component\n // End of -- Mark 4 --\n\n // -- Mark 5 --\n // lecture 29: Card Component\n // first, delete \" name = 'James' \" in <CardList> and then pass in a prop we can use in the\n // CardList component and that prop along with the corresponding value will be\n // \" monsters={ this.state.monsters } \" and we move\n // \" this.state.monsters.map( ( monster ) => <h1 key={ monster.id }>{ monster.name }</h1> ) \"\n // into the CardList component and go to the CardList component -- Mark 1 --\n // End of -- Mark 5 --\n\n // -- Mark 6 --\n // lecture 32: SearchField State\n // add an input element below and make the type equal to \" search \" and then give the\n // element a placeholder attribute equal to \" search monsters \" so now what we need to do\n // is be able to take the typed input string and store the string into our state object and\n // by storing the string in state we are able to use it to filter out our monsters so first\n // we need to figure out how to store the string in our state object and let's add a key\n // value pair to our state object and call the key \" searchField \" and leave the value\n // equal to an empty string for now and let's add an onChange event handler to our input\n // element and then use setState to change our searchField value within our state object \n // to equal whatever value the user types into the input element\n\n // asynchrosnous versus synchronous is a big thing in JavaScript development right now and\n // a big thing in reach as well and sychronous action is something we can expect to happen\n // almost immediately and with sychronous events JavaScript will wait until that action has\n // completed before moving to the rest of the code but with an asynchronous action or event\n // is something that takes an indefinite amount of time and JavaScript does not know how\n // long it will take to complete the asynchronous action or event so what happens is\n // that JavaScript will continue running the rest of the code and then when the ayschronous\n // event finishes then JavaScript will run that asynchronous event so the main takeaway\n // here is that setState is not happening immediately or when we would expect it to and\n // therefore setState is always one character behind where it should be in this particular\n // instance so the solution to this predicament is to use a second argument to setState\n // which will be an arrow function and this function will run after setState has updated\n // the searchField state\n\n // remember, if we want to see or do something with our state right after we set it then\n // we have to do it inside the second argument to the setState() call and this second\n // argument function will get called right after the first argument function has completed\n // in setState and now onChange looks like the following:\n /*\n onChange =\n { \n ( e ) => {\n this.setState( \n { searchField : e.target.value },\n () => console.log( this.state ) \n )\n } \n }\n */\n\n // now that we have our searchField being stored let's filter out our monsters but first\n // let's remove our second argument to setState or \" () => console.log( this.state ) \"\n // and onto the next video\n // End of -- Mark 6 --\n\n // -- Mark 7 --\n // lecture 34: Filtering State\n // remember, we don't want to modify our state's monster array in case we need it later\n // or somewhere else in this component so what we'll do is make a new array using the\n // filter method but first let's destructure the state object and what destructuring allows\n // us to do is pull properties off an object and set these properties equal to constants\n // and we put these properties inside the curly braces and set it equal to the object we\n // want to destructure from and when use the following syntax:\n // \" const { monsters, searchField } = this.state; \" we are saying that we want to pull\n // the monsters and searchField values off of the state object and setting them as\n // constants called monsters and searchField and this is equal to:\n // const monsters = this.state.monsters; and\n // const searchField = this.state.searchField;\n\n // now let's set a new const called filteredMonster and set it equal to\n // \" monsters.filter( ( monster ) => monster.name.toLowerCase().includes(\n // searchField.toLowerCase() ) ); \" and the\n // includes method checks to see whether the string value we pass to includes is found\n // in monster.name.toLowerCase() and if that is true then that monster will be added to the\n // new filters array and if false then that monster will not be added to the new filters\n // array and instead of using \" { this.state.monsters } \" in our CardList component we will\n // use filteredMonsters instead or \"<CardList monsters={ filteredMonsters } />\" and\n // filteredMonsters is just a new monsters array that has been filtered and remember that\n // whenever setState is called because our searchField property has changed then react will\n // rerender our component and when the component rerenders then filteredMonsters is called\n // again creating a new array and this new array is feed into the CardList component which\n // will then rerender our CardList component which will then rerender our Card component\n // and this is what is great about react because react is able to take control over what\n // to render and rerender in our application without us having to do a bunch of extensive\n // calls to show elements, hide elements, etc.\n\n const { monsters, searchField } = this.state;\n const filteredMonsters = monsters.filter( ( monster ) => {\n\n return monster.name.toLowerCase().includes( searchField.toLowerCase() )\n\n } );\n // End of -- Mark 7 --\n\n // -- Mark 8 --\n // lecture 36: Search Box Component\n // change the input element below into <SearchBox ... />\n // now go the website and test it and we see that our funtionality is working fine but\n // now we have a reuseable component ( i.e. SearchBox ) that we can use in multiple places\n // and this is what is great about react is this component style of writing code so our\n // SearchBox component is a presentational component that styles an input field within our\n // app and it takes in any funtionality it might need by using the handleChange property\n // that is being passed down to the SeachBox component from App.js or the App component\n // so again one of the huge advantages to using react is this idea of writing these smaller\n // and smaller reusable components\n // End of -- Mark 8 --\n\n // -- Mark 10 --\n // lecture 43: Deploying Our App\n // let's add am h1 tag above the SearchBox component and we need to import the Google font\n // for \" Monsters Rolodex \" and go to Google fonts and search for Bigelow Rules and copy\n // the link for the font into the <head></head> of our index.html file and then go to\n // App.css and add a new rule for our h1 tag and then go to index.css and add a new\n // background color to the body element and remember that index.css is a file that gets\n // generated by create react app and now our project is finished\n\n // so we've built a project that has filtering and we understand how components are created\n // End of -- Mark 10 --\n\n return (\n <div className=\"App\">\n <h1>Monsters Rolodex</h1>\n <SearchBox \n placeholder='seach monsters'\n handleChange={ this.handleChange }\n />\n <CardList monsters={ filteredMonsters } />\n </div>\n );\n }", "render() {\n return (<h1>Hello World!!!!!!!!!!!!!!!!!!?????</h1>);\n }", "render() {\n return (\n <div>\n <h1>{this.props.title}</h1>\n <p>{this.props.description}</p>\n </div>\n )\n }", "function Hello() {\n return <p>Hello World</p>;\n}", "render() //we must define the render method\n {\n return (\n //wrap our conditional content in static stuff that needs to be there all the time\n <div>\n {this.renderContent()}\n </div>\n )\n }", "function MyComponent() {\r\n return <div>Hello</div>;\r\n}", "render() {\n // in class components as in function component we can access props\n //const { name } = this.props;\n return <p> This is a class component</p>\n }", "render () {\n\n // Make sure to return some UI.\n return (\n <div>\n <h1>Hello World!</h1>\n <h3>Its time for Tea!</h3>\n </div>\n )\n }", "static rendered () {}", "static rendered () {}", "render() {\n const {\n id, className, style,\n title, content, html, children,\n appearance, variation, size,\n } = this.props;\n\n const elements = new ElementBuffer({\n props : {\n ...this.getUnknownProps(),\n id,\n style,\n className: [className, \"ui\", appearance, variation, size, \"popup\"]\n }\n });\n\n if (title) elements.appendWrapped(\"div\", \"header\", title);\n if (content) elements.append(content);\n if (html) elements.append(html);\n if (children) elements.append(children);\n\n return elements.render();\n }", "displayHTML() {\n return `<p>Name: ${this.name}</p>\n <p>Email: ${this.email}</p>\n <p>Phone: ${this.phone}</p>\n <p>Relation: ${this.relation}</p>`;\n }", "render(){\n return(\n <div style={styles.wrapper}>\n {this.content()}\n </div>\n )\n }", "render() {\n return (\n <div>React JS and JSX in action!</div>\n )\n }", "render() {\n return renderNotImplemented;\n }", "render() {\n return renderNotImplemented;\n }", "render() {\n\t\treturn (\n\t\t\tnull\n\t\t)\n\t}", "render() {\n\t\tconst howManyLegsADragonHas = 4;\n\n\t\treturn (\n\n\t\t\t{/* inside a render method, everything must be contained in one root element... */}\n\t\t\t<div>\n\n\t\t\t{/* in which you can put things that you want to render... (yes, really) */}\n\t\t\t\t<span>Hi mom</span>\n\n\t\t\t\t{/* ... and where you can nest other components that you import, which become 'children' of this one. */}\n\t\t\t\t<StatelessFunctionalComponent\n\t\t\t\t\tsayUnicornsAreCool = {this.sayUnicornsAreCool}\n\t\t\t\t\tchangeState = {this.changeState}\n\t\t\t\t\thowManyLegsADragonHas = {howManyLegsADragonHas}\n\t\t\t\t/>\n\n\t\t\t</div>\n\t\t);\n\t}", "render( ) {\n return null;\n }", "render () {\n\t\t// se retorna la vista \n\t\treturn (\n\t\t\t// div about\n\t\t\t<div className=\"About\">\n\t\t\t\t// se coloca el titulo \n\t\t\t\t<h1>Acerca de.</h1>\n\t\t\t</div>\n\t\t);\n\t}", "function component(html) {\n return `\n class MyComponent extends Component {\n __html__ = \\`${html}\\`\n }\n `\n}", "render() {\n\n\t}", "render() {\n\n\t}", "render () {\n return (\n <p>\n My academic work was completed at the University of Utah in the Atmospheric Sciences. <br /> \n <br />\n As a Research Associate at MesoWest, I endeavored on large-scale validation of instrumentation for NASA, the GSLO<sub>3</sub>S research campaign, and deployed and maintained a network of surface weather stations.\n {/* TODO! Modal of research posters for all projects!!! */}\n <br /> <br />\n I also undertook a research project with Professor Emeritus Dave Whiteman where we quantified the pollutants transported by fog in Persistant Cold Air Pool events. <br /> \n </p>\n )\n }", "render() { // permite vc escrever o que vai ser renderizado.\n\t\t// OBS sempre que o JSX for mais de uma linha tem que ser envolvido por parentese\n\t\treturn <PlacarContainer {...dados} />; //ES6 - Repassa as propriedades dados dentro Plcarcontainer\n\t}", "_render() {}", "render() {\n return <div>Hello {this.props.firstName} {this.props.lastName}!</div>;\n }", "createMarkup() {\n // get a list of all the observables\n // and then say render according to the current component\n const state = this.appState.get();\n const { formId } = state;\n\n return `<div id=${formId} class='column'>\n <div> </div>\n <div class=' row section'>\n <button class='rowOffer ' id=\"switchComponent\" type=\"button\"> Switch Component </button>\n </div> \n </div>`;\n }", "custom(...props) {\n console.log(props)\n return renderToString(\n <div>\n <h2>test</h2>\n </div>,\n )\n }", "render() {\n\n }", "render() {\n return (\n <h1>{ this.props.value }</h1>\n )\n }", "render() {\n }", "render() { return <></> }", "render() {\n const { title, body } = this.state;\n return (\n <div>\n <h1>{ title }</h1>\n <p>{ body }</p>\n </div>\n )\n }", "render() {\n return (\n // create a div with text in h1 tags\n <div>\n <h1>This is the header component</h1>\n </div>\n );\n }", "render() {\n return (\n\n\n\n\n\n )\n }", "render() {\n return (\n <h1>HelloWorld</h1>\n );\n }", "function Routerdom() {\n return <div></div>;\n}", "render() {\n }", "render() {\n }", "render() {\n return \"\";\n }", "render() {\n\n }", "render() {\n\n }", "render() {\n\n }", "render() {\n // JSX JavaScript and XML \n return (\n <div>\n <Header />\n <Greet fullName = 'Mary' age = '34' />\n <Greet fullName = 'John' age = '56' />\n <Footer />\n </div>\n\n )\n }", "function Header(){\n return(<h1></h1>)\n\n\n}", "function Hello() {\n return <div><p>Hello React!</p> <p>Aarav is my name.</p></div>;\n}", "render() {\n // Subclasses should override\n }", "function makeTemplate() {\n return html`\n\n <div class=\"display-div\"> </div>\n\n `;\n}", "function reactRender(res, componentClass, props) {\n var component = new componentClass(props);\n res.render('index', { \n reactOutput: React.renderToString(component),\n initialProps: JSON.stringify(props)\n });\n}", "showHTML() { \n return `\n <div class='showRecipes'>\n <div>\n <h3>${this.recipeTitle}</h3> \n </div> \n <div>\n ${'Time: ' + this.recipeTime}\n </div>\n <div>\n ${this.recipeIngredients}\n </div>\n <div>\n ${this.recipeAllergies}</li>\n </div>\n </div>`\n }", "render() {\n\t\t//you can use a javascript variable and state to update the view.\n\t\t//when state changes, render() is reexecuted, and so display is reassigned\n\t\t//Home and Login components are imported components, they would contain more HTML and styling\n\t\tlet display;\n\t\tif (this.state.loggedIn) {\n\t\t\tdisplay = (\n\t\t\t\t<Home\n\t\t\t\t\tshowLogin={this.showLogin}\n\t\t\t\t\tverify={this.checkForLogin}\n\t\t\t\t\talert={this.showAlert}\n\t\t\t\t/>\n\t\t\t)\n\t\t} else {\n\t\t\tdisplay = (\n\t\t\t\t<Login\n\t\t\t\t\tshowHome={this.showHome}\n\t\t\t\t\talert={this.showAlert}\n\t\t\t\t/>\n\t\t\t)\n\t\t}\n\n\t\t//render() MUST have a return function! What gets returned must be contained in a single node\n\t\t//If you have multiple elements to return, wrap them all in one tag, like I did with the <div>.\n\t\t//everything returned is what you see in the view.\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{/*\n\t\t\t\t\tIf you're inside a tag, everything inside {} is javascript.\n\t\t\t\t\tYou can't use <!-- --> to comment inside a tag with React.\n\t\t\t\t\tInstead, you need to intitate javascript and then use block or line comments.\n\t\t\t\t\tIf you want to add a JS function as a child to a tag, use {}.\n\t\t\t\t*/}\n\n\t\t\t\t{ display }\n\n\t\t\t\t<p>\n\t\t\t\t\tThis is a paragraph. Yes, EXACTLY like an HTML paragraph. You can write straigh HTML\n\t\t\t\t\there and it will all be compiled down into JavaScript for you! This is what makes\n\t\t\t\t\tReact syntax so amazing and easy to write/read.\n\t\t\t\t</p>\n\t\t\t\t<br /> {/* All tags that have no closing tag MUST end in /> or ERRORS!! */}\n\n\t\t\t\t{/*\n\t\t\t\t\tThe stuff inside the AlertComponent brackets < /> is props.\n\t\t\t\t\tThe keyword arguments open, message, etc are put into the props object\n\t\t\t\t\twhich is passed to the AlertComponent object.\n\t\t\t\t\tTo access the values of 'open' inside of the AlertComponent class for example,\n\t\t\t\t\tyou would simply use: this.props.open\n\t\t\t\t\tNOTE: props are camelCase by convention\n\t\t\t\t*/}\n\t\t\t\t<AlertComponent\n\t\t\t\t\topen={this.state.alert}\n\t\t\t\t\tmessage={this.state.msg}\n\t\t\t\t\tautoHideDuration={4000}\n\t\t\t\t\tonRequestClose={this.hideAlert}\n\t\t\t\t/> {/* onRequestClose's value is a callback, a function passed as a parameter. */}\n\t\t\t</div>\n\t\t);\n\t}" ]
[ "0.7532792", "0.7192444", "0.7124302", "0.7074442", "0.70150864", "0.70011836", "0.6924521", "0.68841183", "0.68841183", "0.6861373", "0.6804007", "0.6787508", "0.6774082", "0.6747525", "0.6747525", "0.6747525", "0.6735545", "0.6698004", "0.6694672", "0.6625695", "0.6621987", "0.6613513", "0.6613339", "0.6606344", "0.6605327", "0.6602344", "0.6593777", "0.658152", "0.65632147", "0.65593517", "0.6522417", "0.6521848", "0.64850295", "0.64826596", "0.6481386", "0.64580685", "0.64469206", "0.6427022", "0.64227474", "0.6367472", "0.63562095", "0.6353426", "0.63345903", "0.63247764", "0.63243204", "0.6316417", "0.63158953", "0.63032556", "0.63017535", "0.62972635", "0.62849677", "0.62816924", "0.62797904", "0.62742466", "0.62710714", "0.6259065", "0.62513644", "0.6242742", "0.6242742", "0.6214935", "0.6205072", "0.6199212", "0.6192647", "0.6186693", "0.6186693", "0.6182955", "0.6175233", "0.6161028", "0.6158046", "0.6153272", "0.61448884", "0.61448884", "0.6144023", "0.61368763", "0.61332095", "0.6129329", "0.6123372", "0.6104395", "0.60904497", "0.60895616", "0.60862005", "0.6082334", "0.60804343", "0.6079216", "0.6061894", "0.6057471", "0.60482466", "0.60408", "0.60408", "0.60385", "0.6034325", "0.6034325", "0.6034325", "0.6033994", "0.6029298", "0.60274696", "0.60252804", "0.6023531", "0.6022893", "0.60201764", "0.6019815" ]
0.0
-1
repeats the given string string exactly n times.
function repeatStr (n, s) { //input is a string // output string n times let repeat = s.repeat(n) return repeat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repeatStringNTimes(string, repCount) {\n let result = string.repeat(repCount);\n console.log(result);\n}", "function repeatStr(n, s) {\n let newString = \"\";\n for (i = 0; i < n; i++) {\n newString += s;\n }\n return newString;\n}", "function repeatedString(string, n) {\n const numberOfAsInString = countFrom(string,string.length)\n const remainder = n % string.length\n const timesStringIsRepeated = Math.floor(n/string.length) \n const numberOfAsInStringRemainder = countFrom(string,remainder)\n return numberOfAsInString * timesStringIsRepeated + numberOfAsInStringRemainder;\n}", "function repeat(str, n) {\r\n var strlen = str.length;\r\n var result = \"\";\r\n for (var i = 0; i < n; i++) {\r\n result += str[i % strlen];\r\n }\r\n return result;\r\n}", "function repeatStr (n, s) {\n return s.repeat(n);\n}", "function repeatStr (n, s) {\n return s.repeat(n);\n}", "function repeatStr (n, s) {\n return s.repeat(n);\n}", "static repeatString(string, n) {\n if (n === 0) { return ''; }\n\n let repeatedString = string;\n\n while (n && n > 0) {\n --n && (repeatedString += string);\n }\n\n return repeatedString;\n }", "function repeatStr (n, s) {\n return s.repeat(n);\n}", "function repeatNtimes(str, num) {\n\t//code here\n\tlet strg = \"\";\n\tlet i = 0;\n\twhile (i < num) {\n\t\tstrg += str;\n\t\ti++;\n\t}\n\treturn strg;\n}", "function repeatedString(s, n) {\n let count = 0\n let newStr = ''\n const totalNumLoops = Math.floor(n/s.length);\n const remainder = n % s.length;\n let i;\n\n while(i < totalNumLoops) {\n newStr.concat(s);\n i++;\n }\n\n newStr.concat(s.slice[0, remainder + 1]);\n return newStr;\n}", "function repeat(s, n) {\n\t\tvar res = '';\n\t\tfor(var i = 0; i < n; i++) {\n\t\t\tres += s;\n\t\t}\n\t\treturn res;\n\t}", "function repeatStr (n, s) {\n\n return s.repeat(n);\n }", "function repeatedString(s, n) {\n const repeats = n % s.length;\n const repeatMath = (n - repeats)/ s.length;\n let count = 0;\n\n for(let i = 0; i < s.length; i++) {\n if(s[i] === \"a\") {\n count += repeatMath + (i < repeats);\n }\n }\n return count;\n}", "function repeatedString(s, n) {\n const repeats = n % s.length;\n const repeatMath = (n - repeats)/ s.length;\n let count = 0;\n\n for(let i = 0; i < s.length; i++) {\n if(s[i] === \"a\") {\n count += repeatMath + (i < repeats);\n }\n }\n return count;\n}", "function repeat(s, n) {var a = []; while(a.length < n) {a.push(s);} return a.join('');}", "function repeat(str, n){\n\t str = toString(str);\n\t return (new Array(n + 1)).join(str);\n }", "function repeatedString(s, n) {\n //RangeError: Invalid string length if use .repeat() and input 1000000000000\n // s = s.repeat((n / s.length )) + subStr;\n // let subStr = s.slice(0, n % s.length);\n // s = s.repeat((n / s.length )) + subStr;\n // return (s.match(/a/g) || []).length;\n\n let aCount = (s.match(/a/g) || []).length * Math.floor(n / s.length),\n remainder = n % s.length,\n remainderACount = (s.slice(0, remainder).match(/a/g) || []).length;\n\n return aCount + remainderACount;\n}", "function repeatStr (n, s) \n{\n\tvar str = \"\";\n\tfor(var i = 0; i<n; i++)\n\t{\n\t\tstr += s;\n\t}\n\n\treturn str;\n}", "function repeatedString(s, n) {\n // Write your code here\n let fix = Math.floor(n / s.length);\n let count = countA(s) * fix;\n \n let leftOut = n % s.length;\n count = count + countA(s.substring(0,leftOut));\n return count;\n \n}", "function repeatedString(s, n) {\n const sLength = s.length;\n const remainder = n % sLength;\n const times = (n - remainder) / sLength;\n let aCount = 0;\n let theRest = 0;\n for (let i = 0, j = 0; i < sLength; i += 1, j += 1) {\n const char = s.charAt(i);\n if (char === 'a') {\n aCount += 1;\n if (j < remainder) {\n theRest += 1;\n }\n }\n }\n return aCount * times + theRest;\n}", "function repeatedString(s, n){\r\n var countA=s=>s.split('a').length-1;\r\n \r\n let len= s.length \r\n let fl=Math.floor(n/len);\r\n let remainder=s.slice(0,n%len);\r\n \r\n return fl*countA(s)+countA(remainder);\r\n }", "function string_times(string, n){\n var newString = \"\";\n for(var i = 0; i < n; i++){\n newString += string;\n }\n return newString;\n}", "function repeat(string, numberOfTimes) {\n var result = '';\n for (var i = 0; i < numberOfTimes; i++)\n result += string;\n return result;\n}", "function repeatedString(s, n) {\n let counter = 0;\n for (let i = 0; i < s.length; i++) {\n if (s[i] === \"a\") {\n counter += 1;\n }\n }\n if (n % s.length === 0) {\n let multiplier = n / s.length;\n return counter * multiplier;\n } else {\n let remainder = n % s.length;\n let multiplier = Math.floor(n / s.length);\n let extra = 0;\n for (let j = 0; j < remainder; j++) {\n if (s[j] === \"a\") {\n extra += 1;\n }\n }\n return counter * multiplier + extra;\n }\n}", "function repeatedString(s, n) {\n const length = s.length\n const times = Math.floor(n/length)\n const remain = n - times * length\n\n let as = 0\n for (let j = 0; j < s.length; j++) {\n if (s[j] === \"a\") {\n as++\n }\n }\n\n as *= times\n\n for (let i = 0; i < remain; i++) {\n if (s[i] === \"a\") {\n as++\n }\n }\n\n return as\n\n\n\n}", "function strRepeat(n, str) {\n var ret = '';\n for (var i = 0; i < n; i++) {\n ret += str;\n }\n return ret;\n }", "function stringRepeat (string, n) {\n\tvar result = '';\n\t\tfor(var i=0; i<n; i++) {\n\t\t\tresult += string;\n\t\t}\n\treturn result;\n}", "function repeatedString(s, n) {\n if (s === 'a') { return n }\n const getAs = chars => chars.split('').filter(char => char === 'a').length;\n \n const completeS = Math.trunc(n / s.length);\n let totalA = getAs(s) * completeS;\n\n const partialS = n % s.length;\n totalA += getAs(s.slice(0, partialS));\n\n return totalA;\n}", "function repeat(str, n){\n var result = '';\n str = toString(str);\n n = toInt(n);\n \n if (n < 1) {\n return '';\n }\n\n while (n > 0) {\n if (n % 2) {\n result += str;\n }\n n = Math.floor(n / 2);\n str += str;\n }\n return result;\n}", "function repeatStringNumTimes(string, times) {\r\n\t\tvar repeatedString = \"\";\r\n\t\twhile (times > 0) {\r\n\t\t\trepeatedString += string;\r\n\t\t\ttimes--;\r\n\t\t}\r\n\t\treturn repeatedString;\r\n\t}", "function repeat(str, n){\n\t var result = '';\n\t str = toString(str);\n\t n = toInt(n);\n\t if (n < 1) {\n\t return '';\n\t }\n\t while (n > 0) {\n\t if (n % 2) {\n\t result += str;\n\t }\n\t n = Math.floor(n / 2);\n\t str += str;\n\t }\n\t return result;\n\t }", "function repeatStr(n, s) {\n\t// create a newStr variable and assign to an empty string to concat elements\n\tlet newStr = '';\n\t// iterate through starting at 0 and ending at number\n\tfor (let i = 0; i < n; i++) {\n\t\t// join together the strings\n\t\tnewStr += s;\n\t}\n\t// return the new str\n\treturn newStr;\n}", "function repeater(string, n) {\n return Array(n+1).join(string);\n}", "function repeat(str, n){\n var result = '';\n str = toString(str);\n n = toInt(n);\n if (n < 1) {\n return '';\n }\n while (n > 0) {\n if (n % 2) {\n result += str;\n }\n n = Math.floor(n / 2);\n str += str;\n }\n return result;\n }", "function repeatStr (n, a) {\r\n return a.repeat(n);\r\n }", "function stringTimes(str, n) {\n newStr = '';\n for (i = 0; i < n; i++) {\n newStr += str;\n }\n return newStr;\n}", "function repeat(str, n) {\n if (n === 1 || n === 0) return str;\n return (n % 2 !== 0) ?\n str + repeat(str + str, Math.trunc(n/2)) :\n repeat(str + str, n/2);\n}", "function repeatedString(s,n) {\n //Check if there are any a's in the input string\n if (!s.includes('a')) {\n return 0;\n }\n //Find number of matches in original string\n const matches = s.match(/a/g).length;\n //Find number of full repeats needed\n const repeats = Math.floor(n / s.length);\n //Calculate initial result\n let initialResult = matches * repeats;\n //Find how many extra characters are needed\n const remainder = n % s.length;\n //If there is a remainder, add the number of 'a's from it\n if (remainder !== 0) {\n const extras = s.slice(0,remainder).match(/a/g);\n if (extras !== null) {\n return initialResult + extras.length;\n }\n } \n return initialResult;\n}", "function strRepeat(str, n){\n var a = [];\n while(a.length < n){\n a.push(str);\n }\n return a.join('');\n}", "function repeatStr (n, s) {\n\t\tvar count=0;\n\t\tvar str=\"\"\n\t\twhile(count<s){\n\n\t\t\tstr+=n\n\t\t\tcount++\n\n\n\t\t}\n\t\treturn string\n\t}", "function repeatedString(s, n){\n\n if (!(s === 'a')){\n let repetition = [];\n for(let i=0; i < n; i++){\n repetition.push(s);\n }\n \n let repeated = repetition.toString().replace(/,/ig, \"\").slice(0, n);\n let aOcurrences = repeated.match(/a/ig);\n \n return aOcurrences.length;\n }\n\n return n;\n}", "function repeat(str, n, separator) {\n var result = str;\n for (var i = 1; i < n; i++) {\n result += (separator || '') + str;\n }\n return result;\n}", "function repeat(str, n) {\n var result = \"\";\n while (n > 0) {\n if (n & 1) {\n result += str;\n }\n n >>= 1;\n str += str;\n }\n return result;\n }", "function repeatStringNumTimes(str, num) {\n // repeat after me\n var resultStr = \"\";\n for(var i = 0; i < num; i++){\n resultStr += str;\n }\n return resultStr;\n}", "function repeatStringNumTimes(str, num) {\n \n let newStr = \"\";\n let i = 0; \n while(i<num){\n newStr += str;\n i++\n }\n return newStr;\n}", "function repeat(str, times) {\n var s = '';\n\n for (var i = 0; i < times; i++) {\n s += str;\n }\n\n return s;\n}", "function repeat(count, str) {\n count = Math.floor(count);\n let rpt = '';\n for (let i = 0; i < count; i++) {\n rpt += str;\n }\n return rpt;\n}", "function string_times(str, n){\n var nString = \"\";\n for(var i = 0; i < n; i++){\n nString += str;\n\n }\n return nString;\n}", "function repeat(string, times) {\n var result = \"\";\n for (var i = 0; i < times; i++)\n result += string;\n return result;\n}", "function repeatStringNumTimes(str, num) {\n let repStr = \"\";\n for (var i=0; i< num; i++) {\n repStr += str;\n }\n return repStr;\n}", "function repeatString(string, times) {\n let repeatedString = \"\";\n while (times > 0) {\n repeatedString += string;\n times--;\n }\n return repeatedString;\n}", "function repeat(string, times) {\n if (typeof(times) !== 'number' || times < 0) return undefined;\n\n let repeatedString = '';\n\n for (let counter = 1; counter <= times; counter += 1) {\n repeatedString += string;\n }\n\n return repeatedString;\n}", "function repeat(string, times) {\n var result = \"\";\n for(var i = 0; i < times; i++)\n result += string;\n return result;\n}", "function repeatStringNumTimes(str, num) {\n var repeadedStr = num > 0 ? str.repeat(num) : \"\";\n\n return repeadedStr;\n}", "function repeatedString(s, n) {\n\n let string = '';\n let total = 0;\n\n while(string.length < n){\n string += s;\n }\n\n\n for(let char = 0; char < n; char++){\n if(string.charAt(char) === \"a\"){\n total ++\n }\n }\n return total;\n}", "function stringTimes(str,n){\n let outputStr = \"\";\n for (let i = n; i > 0; i--){\n outputStr += str;\n }\n return outputStr;\n}", "function repeatStringNumTimesV2(str, num) {\n let newStr = \"\";\n\n while (num > 0) {\n newStr += str;\n num--;\n }\n\n return newStr;\n}", "function repeatStringNumTimes(str, num) {\n var repeatedString = \"\";\n //If num > 0, then we can proceed with for statement. \n if (num > 0) {\n //Iterate through until i < num, adding str to repeatedString each loop.\n for (var i = 0; i < num; i++) {\n repeatedString += str;\n }\n }\n return repeatedString;\n}", "function repeatStringNumTimes(str, num) {\n let repStr = '';\n for (let i = 0; i < num; i++) {\n repStr += str;\n }\n\n return repStr;\n}", "function repeatStr (n, s) {\n\t\tvar str=\"\"\n\t\tfor (var i =0 ;i<s; i++) {\n\t\t\tstr+=n\n\t\t}\n\t\treturn str\n\t}", "function front_times(string, n){\n var str = string.substring(0, 3);\n var newString = \"\";\n for (var i = 0; i < n; i++){\n newString += str;\n }\n return newString;\n}", "function repeatStringNumTimes(str, num) {\n \n let newStr = \"\";\n let i = 0;\n do{ \n if ( num > 0 ) newStr += str ;\n i++;\n } \n while(i<num)\n return newStr;\n}", "function repeatStringNumTimes(str, num) {\n var answer = \"\";\n for(var i = 0; i< num; i++) {\n answer += str;\n }\n return answer;\n}", "function repeatStr (n, s) {\n\t\t//your code is here\n\t\tvar result = \"\"\n\t\tfor(var i = 0; i < s; i++){\n\t\t\tresult+= n;\n\t\t}\n\t\treturn result;\n\t}", "function repeatedString1(str, num) {\r\n return str.repeat(num);\r\n}", "function repeatStringNumTimes(str, num) {\n \n let newStr = \"\";\n for(let i = 0; i<num; i++){\n newStr += str;\n }\n return newStr;\n}", "function repeatStringNumTimes (str, num) {\n let newStr = ''\n\n for (let i = 0; i < num; i++) {\n newStr = newStr + str\n }\n return newStr\n}", "function repeatString (multiString) {\n let multiString2 = '';\n const n = 5;\n for (let i = 1; i<=n; i++) {\n multiString2 += multiString;\n console.log(multiString2);\n }\n }", "function repeatStringNumTimes(str, num) {\n var answer = \"\";\n\n for (var i = 0; i < num; i++) {\n answer += str;\n }\n\n return answer;\n}", "function repeatStringNumTimes(str, num) \n{\n var accumulatedStr = \"\";\n\n while (num > 0) {\n accumulatedStr += str;\n num--;\n }\n\n return accumulatedStr;\n}", "function repeatStringNumTimes(str, num) {\n // Initialize variables\n var i = num;\n var repStr = '';\n \n // Add str to repStr for ever WHILE loop as long as i is greater than 0\n while (i > 0) {\n repStr += str;\n i--;\n }\n return repStr; // Returns 'abcabcabc'\n}", "function repeatStringNumTimes(str, num) {\n // Initialize variables\n var i = num;\n var repStr = '';\n \n // Add str to repStr for ever WHILE loop as long as i is greater than 0\n while (i > 0) {\n repStr += str;\n i--;\n }\n return repStr; // Returns 'abcabcabc'\n}", "function repeatStringNumTimes(str, num) {\n var i,\n newStr = str;\n if (num <= 0) {\n return \"\";\n }\n for (i = 0; i < num - 1; i += 1) {\n newStr += str;\n }\n return newStr;\n}", "function num_repeats(string) {\n\n}", "function repeatStringNumTimes(str, num) {\n // repeat after me\n //if(num < 0) return \"\";\n //return str.repeat(num);\n var final =\"\";\n if(num < 0) return \"\";\n\n for(var i=0; i<num; i++){\n final += str;\n }\n return final;\n\n}", "function repeatStringNumTimes(str, num) {\r\n\tif (num <= 0)\r\n\t\treturn \"\";\r\n\tvar retArr = [];\r\n\tfor (var i = 0; i < num; i++) {\r\n\t\tretArr.push(str);\r\n\t}\r\n\treturn retArr.join('');\r\n}", "function repeatStringNumTimes(str, num) {\n // repeat after me\n var newArray = [];\n\n if (num < 0) {\n return \"\";\n } else {\n for (var i = 0; i < num; i++){\n newArray.push(str);\n }\n var finalString = newArray.join('');\n return finalString;\n }\n\n}", "function repeat(char, n) {\n var str = '';\n for (var i=0; i<n; i++) str += char;\n return str;\n}", "function repeatStringNumTimes(str, num) {\n\tlet result = '';\n\tif (num < 0) {\n\t\treturn result;\n\t} else {\n\t\tfor (let i = 0; i < num; i++) {\n\t\t\tresult += str;\n\t\t}\n\t}\n\treturn result;\n}", "function repeatStringNumTimesMe(str, num) {\n if (num <= 0) return \"\";\n let result = str;\n for (let i = 1; i < num; i++) {\n result += str;\n }\n return result;\n}", "function repeatStringNumTimes(str, num) {\n let result = \"\"\n if (num > 0) {\n for (let i = 0; i < num; i++) {\n result += str;\n }\n }\n return result\n }", "function repeatTxt (txt,n) {\n \"use strict\";\n var res = \"\", i;\n for (i=0;i<n;i++) {\n\tres += txt;\n }\n return res;\n}", "function repeatStringNumTimes(str, num) {\n\tlet string = '';\n\t// repeat after me\n\tif (num === 0) {\n\t\treturn '';\n\t} else {\n\t\tfor (let i = 1; i <= num; i++) {\n\t\t\tstring += str;\n\t\t}\n\t}\n\n\treturn string;\n}", "function repeatedString(s, n) {\n x = s.length\n a = []\n j = 0;\n for (i = 0; i < n; i) {\n if (j < x) {\n a.push(s[j])\n j++;\n i++;\n } else {\n j = 0;\n }\n\n }\n count = 0;\n for (let j = 0; j < n; j++) {\n if (a[j] === 'a') {\n count++;\n }\n }\n // let lenS = s.length;\n // let i = 0;\n // let charArr = [];\n // for (let j = 0; j < lenS; j) {\n // if (i < lenS) {\n // charArr.push(s[i]);\n // i++;\n // j++;\n // } else {\n // i = 0;\n // }\n // }\n // let count = 0;\n // for (let j = 0; j < n; j++) {\n // if (charArr[j] === 'a') {\n // count++;\n // }\n // }\n return count\n}", "function str_repeat(strText, intRepeat)\n{\n var strReturn = '';\n for (var intCount = 0; intCount < intRepeat; ++intCount)\n strReturn += strText;\n return strReturn;\n}", "function repeatify(string, repetitions) {\n if (repetitions < 0 || repetitions === Infinity) {\n throw new RangeError('Invalid repetitions number');\n }\n \n const cache = new Map();\n \n function repeat(string, repetitions) {\n if (repetitions === 0) {\n return '';\n }\n \n const log = Math.floor(Math.log2(repetitions));\n let result;\n \n if (cache.has(log)) {\n result = cache.get(log);\n } else {\n result = string;\n \n for (let i = 1; i <= log; i++) {\n result += result;\n cache.set(i, result);\n }\n }\n \n const repetitionsProcessed = Math.pow(2, log);\n const repetitionsLeft = repetitions - repetitionsProcessed;\n \n return result + repeat(string, repetitionsLeft);\n }\n \n return repeat(string, repetitions);\n }", "function repeatStringNumTimes(str, num) {\n if (num < 1) return \"\";\n return str.repeat(num);\n}", "function repeatString(txtStr,numCount){\r\n \r\n var newString = \"\";\r\n if(numCount < 0){\r\n return \"\";\r\n }else{\r\n for(i=1; i<=numCount; i++){\r\n \r\n newString = txtStr + newString;\r\n }\r\n}\r\n return newString;\r\n }", "function repeatStringNumTimes(str, num) {\n let fullStr = \"\";\n if(num < 0)\n return \"\";\n if(num === 1)\n return str;\n else\n for(var i = 0; i < num; i++){\n fullStr += str;\n }\n return fullStr;\n}", "function repeat(string, times) {\n//start with an empty string\n var result = \"\";\n//loop until one less the number of times\n for (var i = 0; i < times; i++)\n//each time loop runs, add string to empty string \n result += string;\n return result;\n}", "function repeatStringNumTimes(str, num) {\n // repeat after me\n let newStringArr = [];\n for (let i = 1 ; i <= num ; i++) {\n newStringArr.push(str)\n }\n return newStringArr.join('');\n}", "function repeatStringNumTimes(str, num) {\n let newStr = [];\n for(let i=0; i<num;i++){\n newStr.push(str);\n }\n str =newStr.join('');\n return str;\n}", "function string_copies (str, n) \n{\n if (n < 0)\n return false;\n else\n return str.repeat(n);\n}", "function repeatStringNumTimes(str, num) {\n if(num>0){\n var result = \"\";\n for(var i=1; i<=num; i++){\n result+=str;\n }\n } else{\n result=\"\";\n }\n return result;\n}", "function repeatStringNumTimes(str, num) {\n // initialize result as empty string\n let result = ''\n\n // if num argument greater than zero, repeat \n if (num>0) {\n for (let i=0; i<num; i++) {\n result += str\n }\n }\n \n return result;\n}", "function repeatString(str, num) {\n out = '';\n for (var i = 0; i < num; i++) {\n out += str; \n }\n return out;\n}", "function repeatString(str, num) {\n out = '';\n for (var i = 0; i < num; i++) {\n out += str;\n }\n return out;\n}", "function repeatStr (n, s) {\n\t\tif(s===0)\n\t\t{\n\t\t\treturn \"\"\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn n + repeatStr(n,s-1);\n\t\t}\n\t}", "function repeatStringNumTimes(str, num) {\n // repeat after me\n let userInput = \"\";\n\n while (num > 0) {\n userInput += str\n num--\n }\n\n return userInput\n}" ]
[ "0.85007757", "0.8225302", "0.8168625", "0.8129868", "0.81127983", "0.81127983", "0.81127983", "0.810197", "0.80864567", "0.8082709", "0.8057919", "0.80425656", "0.7984281", "0.7947498", "0.7947498", "0.79459924", "0.79293984", "0.791726", "0.79057306", "0.7879492", "0.78628856", "0.78470284", "0.78297013", "0.7822442", "0.7802626", "0.77922887", "0.7777218", "0.7770706", "0.7760095", "0.77534163", "0.77410406", "0.7740131", "0.77377933", "0.7735011", "0.7734813", "0.7703217", "0.7662426", "0.7622652", "0.76174587", "0.76166075", "0.7606895", "0.75858086", "0.7560227", "0.75206256", "0.75158614", "0.7511709", "0.75108844", "0.75086975", "0.7502963", "0.7497759", "0.7491031", "0.7472017", "0.7466397", "0.7466239", "0.7454481", "0.74331766", "0.74296576", "0.7425319", "0.74184155", "0.74034053", "0.73979676", "0.7375657", "0.73743325", "0.7366756", "0.73609143", "0.7358769", "0.7343164", "0.7331679", "0.73228604", "0.7317795", "0.73165786", "0.7310565", "0.7310565", "0.7308434", "0.7297974", "0.7268853", "0.72600037", "0.72476953", "0.7237756", "0.7234055", "0.7225809", "0.72191393", "0.7211656", "0.71991575", "0.7198925", "0.71962696", "0.7186786", "0.7185815", "0.7181972", "0.7177955", "0.717761", "0.71750665", "0.717453", "0.7170296", "0.7160536", "0.71576804", "0.71505344", "0.714367", "0.71374595", "0.7134489" ]
0.8264229
1
Display data sex distribution per category
function sex_per_category(data) { console.log(data); const indexes = []; const categories = []; const males = []; const females = []; data.forEach(item => { indexes.push(parseInt(item.index)); categories.push(item.category); males.push(parseInt(item.sum_male)); females.push(parseInt(item.sum_female)); }); // X scales let x_scale_sex_cat_band = d3.scaleBand() .domain(categories) .rangeRound([0, width_sex_cat]) .padding(0); let x_scale_sex_cat_linear = d3.scaleLinear() .domain([0, d3.max(data, d => d.index)]) .range([0, width_sex_cat]); // Y scale let y_scale_sex_cat = d3.scaleLinear() .domain([0, Math.max(d3.max(males), d3.max(females))]) .range([height_sex_cat, 0]); // Generate lines let line_male_sex_cat = d3.line() .x((d, i) => { return x_scale_sex_cat_linear(i); }) .y(d => { return y_scale_sex_cat(d.sum_male); }) .curve(d3.curveMonotoneX); let line_female_sex_cat = d3.line() .x((d, i) => { return x_scale_sex_cat_linear(i); }) .y(d => { return y_scale_sex_cat(d.sum_female); }) .curve(d3.curveMonotoneX); // Append svg to the page let svg_sex_cat = d3.select('#sex-per-category') .append('svg') .attr('width', width_sex_cat + margin_sex_cat.top + margin_sex_cat.bottom) .attr('height', height_sex_cat + margin_sex_cat.left + margin_sex_cat.right) .append('g') .attr('class', 'sex-per-category--group'); // Call x axis svg_sex_cat.append('g') .attr('class', 'axis axis-x axis-categories') .attr('transform', 'translate(' + (width_sex_cat/14 * -1) + ',' + height_sex_cat + ')') .call(d3.axisBottom(x_scale_sex_cat_band)); // svg_sex_cat.append('g') // .attr('class', 'axis axis-x') // .attr('transform', 'translate(0,' + height_sex_cat + ')') // .call(d3.axisBottom(x_scale_sex_cat_linear)); // Append path, bind data and call line generator for Males svg_sex_cat.append('path') .datum(data) .attr('class', 'line line-male') .attr('d', line_male_sex_cat); svg_sex_cat.append('path') .datum(data) .attr('class', 'line line-female') .attr('d', line_female_sex_cat); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewSexTrade() {\n var color = d3.scale.linear()\n .range([\"#fee5d9\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#99000d\"]);\n\n var val1 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.sexTotal, b.value.sexTotal); })\n // take the first option\n [0];\n\n var val2 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.sexTotal, b.value.sexTotal); })\n // take the first option\n [5];\n\n var val3 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.sexTotal, b.value.sexTotal); })\n // take the first option\n [22];\n\n var val4 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.sexTotal, b.value.sexTotal); })\n // take the first option\n [37];\n\n var val5 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.sexTotal, b.value.sexTotal); })\n // take the first option\n [48];\n\n var val6 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.sexTotal, b.value.sexTotal); })\n // take the first option\n [50];\n\n color.domain([\n val1.value.sexTotal,\n val2.value.sexTotal,\n val3.value.sexTotal,\n val4.value.sexTotal,\n val5.value.sexTotal,\n val6.value.sexTotal\n ]);\n\n var keys = Object.keys(data);\n /* Interpolate color according to the numbers of tracking crime reported*/\n keys.forEach(function(d){\n data[d].color = color(data[d].sexTotal);\n /*data[d].color = d3.interpolate(\"#fee5d9\", \"#99000d\")((data[d].sexTotal)/30);\n console.log(data[d].color);*/\n });\n /* draw states on id #statesvg */\n var svg = uStates.draw(\"#statesvg\", data, tooltipHtmlSex, \"sexTotal\");\n}", "function gender_selector(ndx) {\n var genderDim = ndx.dimension(dc.pluck('sex'));\n var genderGroup = genderDim.group();\n\n dc.selectMenu('#genderPercent')\n .dimension(genderDim)\n .group(genderGroup);\n}", "function showCategoryTitles() {\n\t\tvar categoryData = d3.keys(categoryTitleX);\n\t\tvar categories = svg.selectAll(\".category\")\n\t\t.data(categoryData);\n\n\t\tcategories.enter()\n\t\t.append(\"text\")\n\t\t.attr(\"class\", \"category\")\n\t\t.attr(\"x\", function(d) { return categoryTitleX[d]; })\n .attr(\"y\", 40)\n\t\t.attr(\"text-anchor\", \"middle\")\n\t\t.text(function(d) { return d; });\n\t}", "function viewSexTradeF() {\n var color = d3.scale.linear()\n .range([\"#fee5d9\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#99000d\"]);\n\n var val1 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesSex, b.value.femalesSex); })\n // take the first option\n [0];\n\n var val2 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesSex, b.value.femalesSex); })\n // take the first option\n [5];\n\n var val3 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesSex, b.value.femalesSex); })\n // take the first option\n [22];\n\n var val4 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesSex, b.value.femalesSex); })\n // take the first option\n [37];\n\n var val5 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesSex, b.value.femalesSex); })\n // take the first option\n [48];\n\n var val6 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesSex, b.value.femalesSex); })\n // take the first option\n [50];\n\n color.domain([\n val1.value.femalesSex,\n val2.value.femalesSex,\n val3.value.femalesSex,\n val4.value.femalesSex,\n val5.value.femalesSex,\n val6.value.femalesSex\n ]);\n\n var keys = Object.keys(data);\n /* Interpolate color according to the numbers of tracking crime reported*/\n keys.forEach(function(d){\n data[d].color = color(data[d].femalesSex);\n /*data[d].color = d3.interpolate(\"#fee5d9\", \"#99000d\")((data[d].femalesSex)/30);\n console.log(data[d].color);*/\n });\n /* draw states on id #statesvg */\n var svg = uStates.draw(\"#statesvg\", data, tooltipHtmlSex, \"femalesSex\");\n}", "function viewSexTradeM() {\n var color = d3.scale.linear()\n .range([\"#fee5d9\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#99000d\"]);\n\n var val1 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesSex, b.value.malesSex); })\n // take the first option\n [0];\n\n var val2 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesSex, b.value.malesSex); })\n // take the first option\n [5];\n\n var val3 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesSex, b.value.malesSex); })\n // take the first option\n [22];\n\n var val4 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesSex, b.value.malesSex); })\n // take the first option\n [37];\n\n var val5 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesSex, b.value.malesSex); })\n // take the first option\n [48];\n\n var val6 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesSex, b.value.malesSex); })\n // take the first option\n [50];\n\n color.domain([\n val1.value.malesSex,\n val2.value.malesSex,\n val3.value.malesSex,\n val4.value.malesSex,\n val5.value.malesSex,\n val6.value.malesSex\n ]);\n\n var keys = Object.keys(data);\n /* Interpolate color according to the numbers of tracking crime reported*/\n keys.forEach(function(d){\n data[d].color = color(data[d].malesSex);\n /*data[d].color = d3.interpolate(\"#fee5d9\", \"#99000d\")((data[d].malesSex)/30);\n console.log(data[d].color);*/\n });\n /* draw states on id #statesvg */\n var svg = uStates.draw(\"#statesvg\", data, tooltipHtmlSex, \"malesSex\");\n}", "function showMale() {\n let bigList = document.getElementById(\"bigList\");\n for (var i = 0; i < data.length; i++) {\n \n if (data[i].constructor.name == \"Male\") {\n bigList.innerHTML += data[i].render();\n }\n }\n}", "function showFemale() {\n let bigList = document.getElementById(\"bigList\");\n for (var i = 0; i < data.length; i++) {\n \n if (data[i].constructor.name == \"Female\") {\n bigList.innerHTML += data[i].render();\n } \n }\n}", "function categorify(cat) {\n var ret;\n if(typeof cat == \"string\")\n ret = cat\n ;\n else ret = d3.entries(cat) // Overview pseudo-phase\n .filter(function(e) { return e.value === \"Yes\"; })\n .map(function(k) { return k.key.trim(); })\n [0]\n ;\n return ret || \"Not Applicable\";\n } // categorify()", "function sexValues(sex) {\n fetch(`/api/sex-graph/${sex}`, {\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" },\n })\n .then(function (sexInput) {\n return sexInput.json();\n })\n .then(function (sexInput) {\n let yModerna = Object.values(sexInput[0]);\n yModerna.pop();\n yModerna = yModerna.map(Number);\n let yPfizer = Object.values(sexInput[1]);\n yPfizer.pop();\n yPfizer = yPfizer.map(Number);\n let yjandj = Object.values(sexInput[2]);\n yjandj.pop();\n yjandj = yjandj.map(Number);\n drawGraph(yModerna, yPfizer, yjandj);\n });\n }", "function show_rank_distribution(ndx) {\n\n var dim = ndx.dimension(dc.pluck('sex'));\n\n // step 5-3 the group is the place when the things are getting tricky\n //what percentage of men are professors, assistant professor and asociate professor\n\n // custom reducer written specifically for professors:\n var profByGender = dim.group().reduce(\n function (p, v) {\n p.total++;\n if (v.rank == \"Prof\") {\n p.match++;\n }\n return p;\n },\n function (p, v) {\n p.total--;\n if (v.rank == \"Prof\") {\n p.match--;\n }\n return p;\n },\n function () {\n return { total: 0, match: 0 };\n }\n );\n\n\n // 5-5 let's create the function rank_by_gender:\n function rankByGender(dimension, rank) {\n //as return we copy profByGender from 5-3 and replace Prof with rank variable\n // and dim is dimension:\n return dimension.group().reduce(\n function (p, v) {\n p.total++;\n if (v.rank == rank) {\n p.match++;\n }\n return p;\n },\n function (p, v) {\n p.total--;\n if (v.rank == rank) {\n p.match--;\n }\n return p;\n },\n function () {\n return { total: 0, match: 0 };\n }\n );\n }\n\n // 5-4 we can do the same as above IN 5-3 for assistant professor and we'll have basically the same code\n //but the code is so similar that it's a better way to deal with it.\n // instead of duplicating all the data, let's create a function rank_by_gender see above 5-5:\n\n var professor = rankByGender(dim, \"Prof\");\n var asstProfByGender = rankByGender(dim, \"AsstProf\");\n var assocProfByGender = rankByGender(dim, \"AssocProf\");\n\n //console.log(profByGender.all());\n\n dc.barChart(\"#rank-distribution\")\n .width(350)\n .height(250)\n // var dim is set in a normal way\n .dimension(dim)\n // main group prof group and we stack assitant and associate prof on it:\n .group(profByGender, \"Prof\")\n .stack(asstProfByGender, \"Asst Prof\")\n .stack(assocProfByGender, \"Assoc Prof\")\n\n // because we use reduce function we have to use valueAccessor and indicate\n //which value we want to see\n .valueAccessor(function (d) {\n if (d.value.total > 0) {\n return (d.value.match / d.value.total) * 100;\n }\n else {\n return 0;\n }\n })\n // animation\n .transitionDuration(500)\n // ordinal scale because we don't have numbers only male or female;\n .x(d3.scale.ordinal())\n .xUnits(dc.units.ordinal)\n .legend(dc.legend().x(320).y(20).itemHeight(15).gap(5))\n .margins({ top: 10, right: 100, bottom: 30, left: 50 })\n\n .xAxisLabel(\"Gender\")\n .yAxis().ticks(4);\n}", "function dessinerGrapheSexAndAge (arr) {\n \n sexAndAgeChart = c3.generate({\n bindto: '#saddBarchart',\n size: {height: chartsHeight},\n padding: {top: 10},\n title: {\n text: 'Sex-disaggregated data along the COVID-19 clinical pathway',\n position: titlePosition\n },\n data: {\n x: 'x',\n columns: [xAxis, sexAndAgeDataArrMen, sexAndAgeDataArrWomen],\n type: 'bar'\n },\n color: {\n pattern: [colorMen, colorWomen]\n },\n axis: {\n x: {\n type: 'category',\n tick: {\n outer: false\n }\n },\n y:{\n max: 90,\n tick: {\n format: d3.format('d'),\n count: 5,\n outer: false\n }\n }\n },\n grid: {\n y: {\n show: true\n }\n },\n bar: {\n width: {\n ratio: 0.5 // this makes bar width 50% of length between ticks\n }\n },\n tooltip:{\n format: {\n value: function(value){\n return value + \" %\";\n }\n }\n }\n });\n\n }//dessinerGrapheSexAndAge", "function chooseCategory(){\n var cat = document.getElementById(\"mySelect-viz3\").value;\n if (cat==\"age\"&&!by_1000) {\n plot_viz3(str_age);\n svg.selectAll(\"*\").remove();\n }else if (cat==\"sex\"&&!by_1000) {\n plot_viz3(str_gender);\n svg.selectAll(\"*\").remove();\n }\n else if (cat==\"continent\"&&!by_1000){\n plot_viz3(str_cont);\n svg.selectAll(\"*\").remove();\n } else if (cat==\"age\"&&by_1000) {\n plot_viz3(str_age_1000);\n svg.selectAll(\"*\").remove();\n }else if (cat==\"sex\"&&by_1000) {\n plot_viz3(str_gender_1000);\n svg.selectAll(\"*\").remove();\n }\n else if (cat==\"continent\"&&by_1000){\n plot_viz3(str_cont_1000);\n svg.selectAll(\"*\").remove();\n }\n}", "function showYearTitles() {\n // Another way to do this would be to create\n // the year texts once and then just hide them.\n var yearsData = d3.keys(yearsTitleX);\n var years = svg.selectAll('.year')\n .data(yearsData);\n\n years.enter().append('text')\n .attr('class', 'year')\n .attr('x', function(d) {\n return yearsTitleX[d];\n })\n\n .attr('y', 140)\n .attr('text-anchor', 'middle')\n .text(function(d) {\n return d;\n });\n\n var category = svg.selectAll('.safetynum')\n .data(safetynumdata);\n\n category.enter().append('text')\n .attr('class', 'safetynum')\n .attr('x', function(d) {\n return d.x;\n })\n .attr('y', function(d) {\n return d.y;\n })\n .attr('text-anchor', 'middle')\n\n .each(function(d) {\n var arr = d.label.split(\" \");\n for (i = 0; i < arr.length; i++) {\n d3.select(this).append(\"tspan\")\n .text(arr[i])\n .attr(\"dy\", i ? \"1.2em\" : 0)\n .attr(\"x\", d.x)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"class\", \"tspan\" + i);\n }\n\n });\n }", "function showDtypes() {\n // Another way to do this would be to create\n // the year texts once and then just hide them.\n var dtypesData = d3.keys(dtypesTitleX);\n var dtypes = svg.selectAll('.dtype')\n .data(dtypesData);\n\n dtypes.enter().append('text')\n .attr('class', 'dtype')\n .attr('x', function (d) { return dtypesTitleX[d]; })\n .attr('y', 40)\n .attr('text-anchor', 'middle')\n .text(function (d) { return d; });\n }", "function chartGender(deathDetails) {\n\n var margin = {\n left: 10\n };\n\n sexChart.attr('transform', 'translate(' + 750 + ',' + 400 + ')');\n\n var maleCount = 0;\n var femaleCount = 0;\n for (var a = 0; a < deathDetails.length; a++) {\n if (deathDetails[a].gender === \"1\") {\n maleCount++;\n } else if (deathDetails[a].gender === \"0\") {\n femaleCount++;\n }\n }\n\n var maxCount = 290;\n maxCount = d3.max([maleCount, femaleCount]);\n var barxScale = d3.scale.ordinal();\n var baryScale = d3.scale.linear();\n\n barxScale.domain([\"Male\", \"Female\"]).range([0, 50]);\n baryScale.domain([0, maxCount]).range([200, 0]);\n\n\n var barxAxis = d3.svg.axis()\n .scale(barxScale)\n .orient('bottom');\n\n var baryAxis = d3.svg.axis()\n .scale(baryScale)\n .orient('left');\n\n sexChart.append('g')\n .attr('class', 'axis')\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + (200) + \")\")\n .call(barxAxis);\n\n sexChart.append('g')\n .attr('class', 'axis')\n .call(baryAxis);\n\n sexChart.selectAll(\"rect\")\n .data([maleCount, femaleCount])\n .enter()\n .append(\"rect\")\n .attr(\"x\", function (d, i) {\n return barxScale(i);\n })\n .attr(\"y\", function (d) {\n return baryScale(d);\n })\n .attr(\"width\", 20)\n .attr(\"fill\", function (d, i) {\n if (i === 0) {\n return \"purple\";\n } else if (i === 1) {\n return \"coral\";\n }\n })\n .attr(\"height\", function (d, i) {\n return (baryScale(0) - baryScale(d));\n })\n .attr(\"stroke\", \"black\")\n .attr(\"class\", \"bar\");\n\n\n sexChart.append('text')\n .text(\"Deaths\")\n .style('font-size', '11px')\n .style('font-weight', 'bold')\n .attr('transform', 'translate(' + \"-35\" + ',' + 120 + ') rotate(' + 270 + ')');\n\n}", "function show_phd_to_salary_correlation(ndx) {\n\n var genderColors = d3.scale.ordinal()\n .domain([\"Female\", \"Male\"])\n .range([\"pink\", \"blue\"]);\n\n var pDim = ndx.dimension(dc.pluck(\"yrs_since_phd\"));\n var phdDim = ndx.dimension(function (d) {\n return [d.yrs_since_phd, d.salary, d.rank, d.sex];\n });\n\n var phdSalaryGroup = phdDim.group();\n\n var minPhd = pDim.bottom(1)[0].yrs_since_phd;\n var maxPhd = pDim.top(1)[0].yrs_since_phd;\n\n dc.scatterPlot(\"#phd-salary\")\n .width(800)\n .height(400)\n .x(d3.scale.linear().domain([minPhd, maxPhd]))\n .brushOn(false)\n .symbolSize(8)\n .clipPadding(10)\n .yAxisLabel(\"Salary\")\n .xAxisLabel(\"Years Since PhD\")\n .title(function (d) {\n return d.key[2] + \" earned\" + d.key[1];\n })\n .colorAccessor(function (d) {\n return d.key[3];\n })\n .colors(genderColors)\n .dimension(phdDim)\n .group(phdSalaryGroup)\n .margins({ top: 10, right: 50, bottom: 75, left: 75 });\n}", "function show_service_to_salary_correlation(ndx) {\n\n // 7-4-1 colors: we need to pick one of the attributes in our data\n //set and map the values in that attribute to the colors that we want\n // we choose gender: \n var genderColors = d3.scale.ordinal()\n .domain([\"Female\", \"Male\"])\n .range([\"pink\", \"blue\"]);\n\n // 7-2 we have to create 2 dimensions\n //first years of service x- axis(min and max years of service)\n var eDim = ndx.dimension(dc.pluck(\"yrs_service\"));\n // second dim function containg 2 pieces of information to plot the dots\n // yrs.service x-coordinate, salary y-coordinate\n var experienceDim = ndx.dimension(function (d) {\n //7-4-2 we have to add the value to pick the color\n // we are adding two here rank and sex\n //but we need only sex - see video explanation\n return [d.yrs_service, d.salary, d.rank, d.sex];\n });\n //creating a group:\n var experienceSalaryGroup = experienceDim.group();\n\n //creating dots on a scatter plot:\n var minExperience = eDim.bottom(1)[0].yrs_service;\n var maxExperience = eDim.top(1)[0].yrs_service;\n\n //create scatter plot:\n dc.scatterPlot(\"#service-salary\")\n .width(800)\n .height(400)\n .x(d3.scale.linear().domain([minExperience, maxExperience]))\n //play with brushOn false/true to see what happens with the graph:\n .brushOn(false)\n //size of the dots:\n .symbolSize(8)\n //leaves room at the top\n .clipPadding(10)\n .yAxisLabel(\"Salary\")\n .xAxisLabel(\"Years Of Service\")\n //what will appear if you hover the mouse over the dot:\n .title(function (d) {\n //d.key[1] see varexpericneDim = d.salary\n //7-4-4 we allso modify titel and adding rank\n return d.key[2] + \" earned\" + d.key[1];\n })\n //7-4-4 we need to add color accessor from var experienceDim\n // sex is array 3\n .colorAccessor(function (d) {\n return d.key[3];\n })\n //7-4-2 adding colors from 7-4-1 to our graph:\n .colors(genderColors)\n .dimension(experienceDim)\n .group(experienceSalaryGroup)\n .margins({ top: 10, right: 50, bottom: 75, left: 75 });\n}", "function demographics(selector) {\n var filter1 = data.metadata.filter(value => value.id == selector);\n var div = d3.select(\".panel-body\")\n div.html(\"\");\n div.append(\"p\").text(`ID: ${filter1[0].id}`)\n div.append(\"p\").text(`ETHNICITY: ${filter1[0].ethnicity}`)\n div.append(\"p\").text(`GENDER: ${filter1[0].gender}`)\n div.append(\"p\").text(`AGE: ${filter1[0].age}`)\n div.append(\"p\").text(`LOCATION: ${filter1[0].location}`)\n div.append(\"p\").text(`BELLY BUTTON TYPE: ${filter1[0].bbtype}`)\n div.append(\"p\").text(`WASHING FREQUENCY: ${filter1[0].wfreq}`)\n \n}", "function statistic() {\n let statistic = {\n female: 0,\n male: 0,\n wood: 0,\n woodFem: 0,\n woodMale: 0,\n steel: 0,\n steelFem: 0,\n steelMale: 0,\n spirit: 0,\n spiritFem: 0,\n spiritMale: 0,\n water: 0,\n waterFem: 0,\n waterMale: 0,\n waterIce: 0,\n waterIceFem: 0,\n waterIceMale: 0,\n waterLiquid: 0,\n waterLiquidFem: 0,\n waterLiquidMale: 0,\n waterSream: 0,\n waterSreamFem: 0,\n waterSreamMale: 0,\n };\n {\n allCreatures.forEach((allCreat) => {\n // go through all the creatures of the main array of creatures\n if (allCreat.gender == \"женщина\") { //\"female\"\n statistic.female++; // counter female\n } else {\n statistic.male++; // counter male\n }\n switch (allCreat.CreaturesType) {\n case \"Дерево\" :// \"wood\"\n {\n statistic.wood++; // counter type of Wood (& female, & male)\n if (allCreat.gender == \"женщина\") { // \"female\"\n statistic.woodFem++;\n } else {\n statistic.woodMale++;\n }\n }\n break;\n case \"Сталь\": // steel\n {\n statistic.steel++; // counter type of Steel (& female, & male)\n if (allCreat.gender == \"женщина\") { // \"female\"\n statistic.steelFem++;\n } else {\n statistic.steelMale++;\n }\n }\n break;\n case \"Дух\": // spirit\n {\n statistic.spirit++; // counter type of spirit (& female, & male)\n if (allCreat.gender == \"женщина\") { // \"female\"\n statistic.spiritFem++;\n } else {\n statistic.spiritMale++;\n }\n }\n break;\n case \"Вода\": // water\n {\n statistic.water++; // counter type of Water (& female, & male)\n if (allCreat.gender == \"женщина\") { // \"female\"\n statistic.waterFem++;\n } else {\n statistic.waterMale++;\n }\n switch (allCreat.subType) {\n case \"Лед\": // ice\n {\n statistic.waterIce++; // counter subType of waterIce (& female, & male)\n if (allCreat.gender == \"женщина\") { // \"female\"\n statistic.waterIceFem++;\n } else {\n statistic.waterIceMale++;\n }\n }\n break;\n case \"Жидкость\": // liquid\n {\n statistic.waterLiquid++; // counter subType of liquid (& female, & male)\n if (allCreat.gender == \"женщина\") { // \"female\"\n statistic.waterLiquidFem++;\n } else {\n statistic.waterLiquidMale++;\n }\n }\n break;\n case \"Пар\": // sream\n {\n statistic.waterSream++; // counter subType of waterSream (& female, & male)\n if (allCreat.gender == \"женщина\") { // \"female\"\n statistic.waterSreamFem++;\n } else {\n statistic.waterSreamMale++;\n }\n }\n break;\n }\n }\n break;\n }\n });\n let doStat = 0; // Label for nullified array of statistic =0\n if (labelZeroingType.wood == 1 && statistic.wood == 0) {\n // track the moment of zeroing the number of some kind of creatures for an extraordinary output of statistical data\n labelZeroingType.wood = 0; // for Wood-type Label for nullified\n doStat = 1; // label for ivent\n }\n if (labelZeroingType.steel == 1 && statistic.steel == 0) {\n labelZeroingType.steel = 0; // for Steel-type Label for nullified\n doStat = 1;\n }\n if (labelZeroingType.spirit == 1 && statistic.spirit == 0) {\n // for Spitit-type Label for nullified\n labelZeroingType.spirit = 0;\n doStat = 1;\n }\n if (labelZeroingType.water == 1 && statistic.water == 0) {\n // for Water-type Label for nullified\n labelZeroingType.water = 0;\n doStat = 1;\n }\n\n if (LogSwitch.StatEvery5genOrZeroing != false) {\n // --> Write statistic every 5-th generation & statistic when zeroing amount of any type of creatures\n if (generation % 5 == 0 || doStat == 1) logstat(statistic);\n } else {\n // otherwise --> Write all statistics every time.\n logstat(statistic);\n }\n // todo> Result print to console --> Look 6.logstat(s)\n }\n}", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n // loop through categories\n for (category in categories) {\n // call categories render method\n memory.categories[category].render();\n //console.log(memory);\n }\n }", "function ready(error, data, cats) {\n // Logs any error to the console\n if (error) {\n return console.warn(error);\n }\n\n v.DEATH_CATS = cats;\n v.DATA = data;\n console.log('Main Data Object:');\n console.log(data);\n\n // get an array of all the age groups\n v.AGE_GRPS = d3.nest()\n .key(function(d) { return d.death_age; })\n .entries(data)\n .map(function(d) { return d.key; });\n\n var chartData = v.stackData(data, 'h_cat');\n console.log(chartData);\n\n\n // calculate age grp death totals\n // for normalising functions (All, Males, Females)\n v.DEATH_TOTALS.None = sumStackedData(chartData);\n v.DEATH_TOTALS.M = sumStackedData(v.stackData(v.filterData(v.DATA, 'gender', 'M'), 'h_cat'));\n v.DEATH_TOTALS.F = sumStackedData(v.stackData(v.filterData(v.DATA, 'gender', 'F'), 'h_cat'));\n\n\n\n chartData = v.normaliseStackedData(chartData);\n v.initViz(chartData);\n }", "function addScatterPlotDetailed(fetch_data_array){\r\n\t\r\nvar margin = {top: 20, right: 20, bottom: 30, left: 80},\r\n width = 1200 - margin.left - margin.right,\r\n height = 1800 - margin.top - margin.bottom;\r\n\r\n/* \r\n * value accessor - returns the value to encode for a given data object.\r\n * scale - maps value to a visual display encoding, such as a pixel position.\r\n * map function - maps from data value to display value\r\n * axis - sets up axis\r\n */\r\n\r\n\r\n\r\n// setup x \r\nvar xValue = function(d) { return d.male;}, // data -> value\r\n xScale = d3.scale.linear().range([0, width]), // value -> display\r\n xMap = function(d) { return xScale(xValue(d));}, // data -> display\r\n xAxis = d3.svg.axis().scale(xScale).orient(\"bottom\");\r\n\t\r\n// setup y\r\nvar yValue = function(d) { return d.female;}, // data -> value\r\n yScale = d3.scale.linear().range([height, 0]), // value -> display\r\n yMap = function(d) { return yScale(yValue(d));}, // data -> display\r\n yAxis = d3.svg.axis().scale(yScale).orient(\"left\");\r\n\t\r\n\t// setup fill color\r\nvar cValue = function(d) { return d.cancertypedetailed;},\r\n color = d3.scale.category10();\r\n\t\r\n// add the graph canvas to the body of the webpage\r\n\r\nvar svg = d3.select(\"body\").append(\"svg\")\r\n .attr(\"width\", width + margin.left + margin.right)\r\n .attr(\"height\", height + margin.top + margin.bottom)\r\n .append(\"g\")\r\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\t\r\n\r\n\t// add the tooltip area to the webpage\r\nvar tooltip = d3.select(\"body\").append(\"div\")\r\n .attr(\"class\", \"tooltip\")\r\n .style(\"opacity\", 0);\r\n\r\n fetch_data_array.forEach(function(d) {\r\n\td.male = +d.male;\r\n d.female = +d.female;\r\n\t\r\n});\r\n\r\n\r\n // don't want dots overlapping axis, so add in buffer to data domain\r\n xScale.domain([d3.min(fetch_data_array, xValue)-1, d3.max(fetch_data_array, xValue)+1]);\r\n yScale.domain([d3.min(fetch_data_array, yValue)-1, d3.max(fetch_data_array, yValue)+1]); \r\n\r\n // x-axis\r\n svg.append(\"g\")\r\n .attr(\"class\", \"x axis\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(xAxis)\r\n .append(\"text\")\r\n .attr(\"class\", \"label\")\r\n .attr(\"x\", width)\r\n .attr(\"y\", -6)\r\n .style(\"text-anchor\", \"end\")\r\n .text(\"Male Count\");\r\n\t \r\n\t // y-axis\r\n svg.append(\"g\")\r\n .attr(\"class\", \"y axis\")\r\n .call(yAxis)\r\n .append(\"text\")\r\n .attr(\"class\", \"label\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 66)\r\n .attr(\"dy\", \".71em\")\r\n .style(\"text-anchor\", \"end\")\r\n .text(\"Female Count\");\r\n \r\n// draw dots\r\n svg.selectAll(\".dot\")\r\n .data(fetch_data_array)\r\n .enter().append(\"circle\")\r\n .attr(\"class\", \"dot\")\r\n .attr(\"r\", 6.5)\r\n .attr(\"cx\", xMap)\r\n .attr(\"cy\", yMap)\r\n .style(\"fill\", function(d) { return color(cValue(d));}) \r\n .on(\"mouseover\", function(d) {\r\n tooltip.transition()\r\n .duration(200)\r\n .style(\"opacity\", .9);\r\n tooltip.html(d[\"cancertypedetailed\"] + \"<br/> (\" + xValue(d) \r\n\t + \", \" + yValue(d) + \")\")\r\n .style(\"left\", (d3.event.pageX + 5) + \"px\")\r\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\r\n })\r\n .on(\"mouseout\", function(d) {\r\n tooltip.transition()\r\n .duration(500)\r\n .style(\"opacity\", 0);\r\n });\r\n\r\n// draw legend\r\n var legend = svg.selectAll(\".legend\")\r\n .data(color.domain())\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"legend\")\r\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; }); \r\n\r\n // draw legend colored rectangles\r\n legend.append(\"rect\")\r\n .attr(\"x\", width - 18)\r\n .attr(\"width\", 18)\r\n .attr(\"height\", 18)\r\n .style(\"fill\", color); \r\n\t \r\n\t \r\n\r\n // draw legend text\r\n legend.append(\"text\")\r\n .attr(\"x\", width - 24)\r\n .attr(\"y\", 9)\r\n .attr(\"dy\", \".35em\")\r\n .style(\"text-anchor\", \"end\")\r\n .text(function(d) { return d;}) \r\n\t \r\n\t//d3.select(\"svg\").remove();\r\n\r\n}", "function getCasualitiesByGender(data, gender) {\n\treturn data.filter(p => p.fields.sex === gender && p.fields.survived === 'No').length\n}", "showSevCatStats() {\n const stats = this.sevcatStats;\n const systems = {};\n for (let severity in stats) {\n for (let category in stats[severity]) {\n for (let system in stats[severity][category]) {\n if (!systems[system]) systems[system] = 0;\n systems[system] += stats[severity][category][system];\n }\n }\n }\n const systemsList = Object.keys(systems);\n const colspan = systemsList.length || 1;\n const th = document.getElementById('marot-sevcat-stats-th');\n th.colSpan = colspan;\n\n systemsList.sort((sys1, sys2) => systems[sys2] - systems[sys1]);\n\n let rowHTML = '<tr><td></td><td></td><td></td>';\n for (const system of systemsList) {\n rowHTML += `<td><b>${system == this.TOTAL ? 'Total' : system}</b></td>`;\n }\n rowHTML += '</tr>\\n';\n this.sevcatStatsTable.insertAdjacentHTML('beforeend', rowHTML);\n\n const sevKeys = Object.keys(stats);\n sevKeys.sort();\n for (const severity of sevKeys) {\n this.sevcatStatsTable.insertAdjacentHTML(\n 'beforeend', `<tr><td colspan=\"${3 + colspan}\"><hr></td></tr>`);\n const sevStats = stats[severity];\n const catKeys = Object.keys(sevStats);\n catKeys.sort(\n (k1, k2) => sevStats[k2][this.TOTAL] - sevStats[k1][this.TOTAL]);\n for (const category of catKeys) {\n const row = sevStats[category];\n let rowHTML = `<tr><td>${severity}</td><td>${category}</td><td></td>`;\n for (const system of systemsList) {\n const val = row.hasOwnProperty(system) ? row[system] : '';\n rowHTML += `<td>${val ? val : ''}</td>`;\n }\n rowHTML += '</tr>\\n';\n this.sevcatStatsTable.insertAdjacentHTML('beforeend', rowHTML);\n }\n }\n }", "function fillDataArraysFemaleMale(input, group, d) {\r\n dataFemale[input] = roundToTenth(d.female[group]);\r\n dataMale[input] = roundToTenth(d.male[group]);\r\n}", "function show_average_salary(ndx) {\n var dim = ndx.dimension(dc.pluck('sex'));\n\n function add_item(p, v) {\n p.count++;\n p.total += v.salary;\n p.average = p.total / p.count;\n return p;\n }\n\n function remove_item(p, v) {\n p.count--;\n if (p.count == 0) {\n p.total = 0;\n p.average = 0;\n } else {\n p.total -= v.salary;\n p.average = p.total / p.count;\n }\n return p;\n }\n\n function initialise() {\n return { count: 0, total: 0, average: 0 };\n }\n\n var averageSalaryByGender = dim.group().reduce(add_item, remove_item, initialise);\n\n // step 4 plot barchart:\n\n dc.barChart(\"#average-salary\")\n .width(350)\n .height(250)\n .margins({ top: 10, right: 50, bottom: 30, left: 50 })\n // var dim\n .dimension(dim)\n // var averageSalaryByGender is our group\n .group(averageSalaryByGender)\n\n // because we use reduce function we have to use valueAccessor and indicate\n //which value we want to see, in this case average (function initialise)\n //add toFixed(2) to reduce number of decimals:\n .valueAccessor(function (d) {\n return d.value.average.toFixed(2);\n })\n // animation\n .transitionDuration(500)\n // ordinal scale because we don't have numbers only male or female;\n .x(d3.scale.ordinal())\n .xUnits(dc.units.ordinal)\n\n .elasticY(true)\n\n .xAxisLabel(\"Gender\")\n .yAxis().ticks(4);\n\n}", "function addScatterPlot(fetch_data_array){\r\n\t\r\nvar margin = {top: 20, right: 20, bottom: 30, left: 80},\r\n width = 1200 - margin.left - margin.right,\r\n height = 800 - margin.top - margin.bottom;\r\n\r\n/* \r\n * value accessor - returns the value to encode for a given data object.\r\n * scale - maps value to a visual display encoding, such as a pixel position.\r\n * map function - maps from data value to display value\r\n * axis - sets up axis\r\n */\r\n\r\n\r\n// setup x \r\nvar xValue = function(d) { return d.male;}, // data -> value\r\n xScale = d3.scale.linear().range([0, width]), // value -> display\r\n xMap = function(d) { return xScale(xValue(d));}, // data -> display\r\n xAxis = d3.svg.axis().scale(xScale).orient(\"bottom\");\r\n\t\r\n// setup y\r\nvar yValue = function(d) { return d.female;}, // data -> value\r\n yScale = d3.scale.linear().range([height, 0]), // value -> display\r\n yMap = function(d) { return yScale(yValue(d));}, // data -> display\r\n yAxis = d3.svg.axis().scale(yScale).orient(\"left\");\r\n\t\r\n\t// setup fill color\r\nvar cValue = function(d) { return d.cancertype;},\r\n color = d3.scale.category10();\r\n\t\r\n// add the graph canvas to the body of the webpage\r\nvar svg = d3.select(\"body\").append(\"svg\")\r\n .attr(\"width\", width + margin.left + margin.right)\r\n .attr(\"height\", height + margin.top + margin.bottom)\r\n .append(\"g\")\r\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\r\n\t// add the tooltip area to the webpage\r\nvar tooltip = d3.select(\"body\").append(\"div\")\r\n .attr(\"class\", \"tooltip\")\r\n .style(\"opacity\", 0);\r\n\r\n\t//Fetch the data \r\n fetch_data_array.forEach(function(d) {\r\n\td.male = +d.male;\r\n d.female = +d.female;\r\n\t\r\n});\r\n\r\n // don't want dots overlapping axis, so add in buffer to data domain\r\n xScale.domain([d3.min(fetch_data_array, xValue)-1, d3.max(fetch_data_array, xValue)+1]);\r\n yScale.domain([d3.min(fetch_data_array, yValue)-1, d3.max(fetch_data_array, yValue)+1]); \r\n\r\n // x-axis\r\n svg.append(\"g\")\r\n .attr(\"class\", \"x axis\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(xAxis)\r\n .append(\"text\")\r\n .attr(\"class\", \"label\")\r\n .attr(\"x\", width)\r\n .attr(\"y\", -6)\r\n .style(\"text-anchor\", \"end\")\r\n .text(\"Male Count\");\r\n\t \r\n\t // y-axis\r\n svg.append(\"g\")\r\n .attr(\"class\", \"y axis\")\r\n .call(yAxis)\r\n .append(\"text\")\r\n .attr(\"class\", \"label\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 6)\r\n .attr(\"dy\", \".71em\")\r\n .style(\"text-anchor\", \"end\")\r\n .text(\"Female Count\");\r\n \r\n// draw dots\r\n svg.selectAll(\".dot\")\r\n .data(fetch_data_array)\r\n .enter().append(\"circle\")\r\n .attr(\"class\", \"dot\")\r\n .attr(\"r\", 6.5)\r\n .attr(\"cx\", xMap)\r\n .attr(\"cy\", yMap)\r\n .style(\"fill\", function(d) { return color(cValue(d));}) \r\n .on(\"mouseover\", function(d) {\r\n tooltip.transition()\r\n .duration(200)\r\n .style(\"opacity\", .9);\r\n tooltip.html(d[\"cancertype\"] + \"<br/> (\" + xValue(d) \r\n\t + \", \" + yValue(d) + \")\")\r\n .style(\"left\", (d3.event.pageX + 5) + \"px\")\r\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\r\n })\r\n .on(\"mouseout\", function(d) {\r\n tooltip.transition()\r\n .duration(500)\r\n .style(\"opacity\", 0);\r\n });\r\n\r\n// draw legend\r\n var legend = svg.selectAll(\".legend\")\r\n .data(color.domain())\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"legend\")\r\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\r\n\r\n // draw legend colored rectangles\r\n legend.append(\"rect\")\r\n .attr(\"x\", width - 18)\r\n .attr(\"width\", 18)\r\n .attr(\"height\", 18)\r\n .style(\"fill\", color);\r\n\r\n // draw legend text\r\n legend.append(\"text\")\r\n .attr(\"x\", width - 24)\r\n .attr(\"y\", 9)\r\n .attr(\"dy\", \".35em\")\r\n .style(\"text-anchor\", \"end\")\r\n .text(function(d) { return d;})\r\n\r\n}", "function sexualRatio(selected){\n\t\n\t// JSON result array\n\tvar female_population = [];\n\tvar request = new XMLHttpRequest();\n\n\tvar path = selectedCountries(selected);\n\t\n\tif(!selected.length || selected == \"WLD\"){\n\t\turl = `http://api.worldbank.org/v2/countries/WLD/indicators/SP.POP.TOTL.FE.ZS?date=2017&format=json`;\n\t\t\n\t}else{\n\t\tvar url = `http://api.worldbank.org/v2/countries/${path}/indicators/SP.POP.TOTL.FE.ZS?date=2017&format=json`;\n\t}\n\trequest.open('GET', url, true);\n\trequest.onload = function () {\n\t\t//Begin accessing JSON data here\n\t\tvar requestArray = JSON.parse(this.response);\n\t\trequestArray[1].forEach(element => {\n\t\t\tfemale_population.push({country:`${element.country.id}`,year:`${element.date}`,value:`${element.value}`});\n\t })\n\t //console.log(female_population);\n\n var width=(innerWidth*5/12 - 20)/2;\n\tvar margin = ({top: 30, right: 0, bottom: 10, left: 30});\n\tvar height = female_population.length * 25 + margin.top + margin.bottom;\n\n\n\t//initialize the graphe\n\tsvgRatio.selectAll(\"path\").remove();\n\tsvgRatio.selectAll(\"#male\").remove();\n\tsvgRatio.selectAll(\"#female\").remove();\n\tsvgRatio.selectAll(\"text\").remove();\n\tsvgRatio.selectAll(\"#yAxis\").remove();\n\n\n\tvar x = d3.scaleLinear()\n\t\t.domain([0, 100])\n\t\t.range([margin.left, width - margin.right]);\n\n\tvar y = d3.scaleBand()\n\t\t.domain(female_population.map(d => d.country))\n\t\t.range([margin.top, height - margin.bottom])\n\t\t.padding(0.3);\n\n\n\tvar yAxis = g => g\n\t\t.attr(\"transform\", `translate(${margin.left},0)`)\n\t\t.call(d3.axisLeft(y).tickSizeOuter(0));\n\t\t\n\t\t\n\n\t//male bar\n\tvar bar=svgRatio.append(\"g\")\n\t\t.selectAll(\"rect\")\n\t\t.data(female_population)\n\t\t.enter();\n\tbar.append(\"rect\")\n\t\t.attr(\"fill\", \"#384cff\")\n\t\t.attr(\"height\", y.bandwidth())\n\t\t.attr(\"x\", d => x(0))\n\t\t.attr(\"y\", d => y(d.country))\n\t\t.attr(\"width\", 0)\n\t\t.transition()\n\t\t.duration(2000)\n\t\t.delay(function (d, i) {return i*100;})\n\t\t.attr(\"width\", 200)\n\t\t.attr(\"id\",\"male\");\n\n\t\n\t//female chart \n\t/*var barfemale=svgRatio.append(\"g\")\t \n\t\t.selectAll(\"rect\")\n\t\t.data(female_population)\n\t\t.enter();*/\n\tbar.append(\"rect\")\n\t\t.attr(\"fill\", \"#ff2c29\")\n\t\t.attr(\"height\", y.bandwidth())\n\t\t.attr(\"x\", x(0))\n\t\t.attr(\"y\", d => y(d.country))\n\t\t.attr(\"width\", 0)\n\t\t.transition()\n\t\t.duration(2000)\n\t\t.delay(function (d, i) {return i*100;})\n\t\t.attr(\"width\", d => d.value*2) \n\t\t.attr(\"id\",\"female\");\n\n\t//Y axis\n\tsvgRatio.append(\"g\")\n\t\t\t.attr(\"id\",\"yAxis\")\n\t\t .call(yAxis);\n\t\t\n\tbar.append(\"text\")\n\t\t.data(female_population)\n\t\t.attr(\"height\", y.bandwidth())\n\t\t.attr(\"x\", x(0))\n\t\t.attr(\"y\", d => y(d.country)+10)\n\t\t.attr(\"dy\", \".2em\")\n\t\t.attr(\"fill\",\"white\")\n\t\t.text(function(d) { return parseFloat(d.value).toFixed(2); });\n\n\tsvgRatio.node();\n\t};\n\t//Send request\n\trequest.send();\n\t\n}", "function hideCategoryTitles() {\n\t\tsvg.selectAll(\".category\").remove()\n\t}", "function displayStatistics(countyName, race) {\n\tcsvName = getCSVName(countyName.toLowerCase());\n\td3.csv(csvName, function(error, data) {\n\t\tvar groupByOffice = d3.nest()\n\t\t\t.key(function(d) {return d.office})\n\t\t\t.entries(data);\n\t\traceVotes = getVotesByOffice(groupByOffice, race);\n\t\tdisplayPieGraph(raceVotes);\n\n\t\t// pass raceVotes data to piechart so that we can display the pie graph\n\t\tvar voteSummaryString = ''\n\t\tfor (var i = 0; i < raceVotes.length; i++) {\n\t\t\tcandidate = raceVotes[i].candidate;\n\t\t\tcandidateVotes = raceVotes[i].votes;\n\t\t\tvoteSummaryString += candidate + ': ' + candidateVotes + '<br>';\n\t\t}\n map[countyName.toLowerCase()] = voteSummaryString;\n\t\treturn voteSummaryString;\n\t});\n}", "function IndicadorSexo () {}", "function createMale2(data, color, flag, menucondition) {\n var maleChart = container.createChild(am4charts.XYChart);\n maleChart.width = am4core.percent(30);\n if (flag == false)\n maleChart.height = 110;\n else\n maleChart.height = 70;\n\n maleChart.data = data;\n maleChart.padding(20, 5, 2, 5);\n\n var maleCategoryAxis = maleChart.yAxes.push(new am4charts.CategoryAxis());\n maleCategoryAxis.dataFields.category = \"type\";\n maleCategoryAxis.renderer.grid.template.location = 0;\n maleCategoryAxis.renderer.labels.template.hide();\n maleCategoryAxis.renderer.labels.template.fontSize = 0;\n maleCategoryAxis.renderer.minGridDistance = 15;\n\n var maleValueAxis = maleChart.xAxes.push(new am4charts.ValueAxis());\n maleValueAxis.renderer.inversed = true;\n maleValueAxis.min = 0;\n maleValueAxis.max = 150;\n maleValueAxis.strictMinMax = true;\n\n maleCategoryAxis.renderer.grid.template.disabled = true;\n maleCategoryAxis.renderer.axisFills.template.disabled = true;\n maleCategoryAxis.renderer.ticks.template.disabled = true;\n\n maleValueAxis.renderer.axisFills.template.disabled = true;\n maleValueAxis.renderer.grid.template.disabled = true;\n maleValueAxis.renderer.ticks.template.disabled = true;\n maleValueAxis.renderer.labels.template.disabled = flag;\n\n var maleSeries = maleChart.series.push(new am4charts.ColumnSeries());\n maleSeries.dataFields.valueX = \"male\";\n maleSeries.fill = color;\n maleSeries.stroke = color;\n maleSeries.strokeWidth = 3;\n maleSeries.dataFields.categoryY = \"type\";\n maleSeries.interpolationDuration = 1000;\n maleSeries.columns.template.tooltipText = \"{type}의 남자는 {male}명입니다.\";\n maleSeries.sequencedInterpolation = true;\n\n var maleSerieslabel = maleSeries.bullets.push(new am4charts.LabelBullet());\n maleSerieslabel.label.text = \"{valueX} \";\n maleSerieslabel.label.truncate = false;\n maleSerieslabel.label.fill = menucondition;\n if (menucondition == \"#ff0000\") {\n maleSerieslabel.label.fontSize = 20;\n maleSerieslabel.label.fontWeight = \"bold\";\n }\n maleSerieslabel.label.dx = -25;\n return chart2;\n }", "marsExpectancy() {\n if (this.sex === \"male\") {\n this.marsExpect = Math.round(this.male / this.marsNum);\n }\n if(this.sex === \"female\"){\n this.marsExpect = Math.round(this.female / this.marsNum);\n }\n }", "function addAllScatterPlot(fetch_data_array){\r\n\t\r\nvar margin = {top: 20, right: 20, bottom: 30, left: 80},\r\n width = 1200 - margin.left - margin.right,\r\n height = 800 - margin.top - margin.bottom;\r\n\r\n/* \r\n * value accessor - returns the value to encode for a given data object.\r\n * scale - maps value to a visual display encoding, such as a pixel position.\r\n * map function - maps from data value to display value\r\n * axis - sets up axis\r\n */\r\n\r\n\r\n\r\n// setup x \r\nvar xValue = function(d) { return d.male;}, // data -> value\r\n xScale = d3.scale.linear().range([0, width]), // value -> display\r\n xMap = function(d) { return xScale(xValue(d));}, // data -> display\r\n xAxis = d3.svg.axis().scale(xScale).orient(\"bottom\");\r\n\t\r\n// setup y\r\nvar yValue = function(d) { return d.female;}, // data -> value\r\n yScale = d3.scale.linear().range([height, 0]), // value -> display\r\n yMap = function(d) { return yScale(yValue(d));}, // data -> display\r\n yAxis = d3.svg.axis().scale(yScale).orient(\"left\");\r\n\t\r\n\t// setup fill color\r\nvar cValue = function(d) { return d.cancertype;},\r\n color = d3.scale.category10();\r\n\t\r\n// add the graph canvas to the body of the webpage\r\nvar svg = d3.select(\"body\").append(\"svg\")\r\n .attr(\"width\", width + margin.left + margin.right)\r\n .attr(\"height\", height + margin.top + margin.bottom)\r\n .append(\"g\")\r\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\r\n\t// add the tooltip area to the webpage\r\nvar tooltip = d3.select(\"body\").append(\"div\")\r\n .attr(\"class\", \"tooltip\")\r\n .style(\"opacity\", 0);\r\n\r\n fetch_data_array.forEach(function(d) {\r\n\td.male = +d.male;\r\n d.female = +d.female;\r\n\t\r\n});\r\n\r\n // don't want dots overlapping axis, so add in buffer to data domain\r\n xScale.domain([d3.min(fetch_data_array, xValue)-1, d3.max(fetch_data_array, xValue)+1]);\r\n yScale.domain([d3.min(fetch_data_array, yValue)-1, d3.max(fetch_data_array, yValue)+1]); \r\n\r\n // x-axis\r\n svg.append(\"g\")\r\n .attr(\"class\", \"x axis\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(xAxis)\r\n .append(\"text\")\r\n .attr(\"class\", \"label\")\r\n .attr(\"x\", width)\r\n .attr(\"y\", -6)\r\n .style(\"text-anchor\", \"end\")\r\n .text(\"Male Count\");\r\n\t \r\n\t // y-axis\r\n svg.append(\"g\")\r\n .attr(\"class\", \"y axis\")\r\n .call(yAxis)\r\n .append(\"text\")\r\n .attr(\"class\", \"label\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 6)\r\n .attr(\"dy\", \".71em\")\r\n .style(\"text-anchor\", \"end\")\r\n .text(\"Female Count\");\r\n \r\n// draw dots\r\n svg.selectAll(\".dot\")\r\n .data(fetch_data_array)\r\n .enter().append(\"circle\")\r\n .attr(\"class\", \"dot\")\r\n .attr(\"r\", 6.5)\r\n .attr(\"cx\", xMap)\r\n .attr(\"cy\", yMap)\r\n .style(\"fill\", function(d) { return color(cValue(d));}) \r\n .on(\"mouseover\", function(d) {\r\n tooltip.transition()\r\n .duration(200)\r\n .style(\"opacity\", .9);\r\n tooltip.html(d[\"cancertype\"] + \"<br/> (\" + xValue(d) \r\n\t + \", \" + yValue(d) + \")\")\r\n .style(\"left\", (d3.event.pageX + 5) + \"px\")\r\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\r\n })\r\n .on(\"mouseout\", function(d) {\r\n tooltip.transition()\r\n .duration(500)\r\n .style(\"opacity\", 0);\r\n });\r\n\r\n// draw legend\r\n var legend = svg.selectAll(\".legend\")\r\n .data(color.domain())\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"legend\")\r\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\r\n\r\n // draw legend colored rectangles\r\n legend.append(\"rect\")\r\n .attr(\"x\", width - 18)\r\n .attr(\"width\", 18)\r\n .attr(\"height\", 18)\r\n .style(\"fill\", color);\r\n\r\n // draw legend text\r\n legend.append(\"text\")\r\n .attr(\"x\", width - 24)\r\n .attr(\"y\", 9)\r\n .attr(\"dy\", \".35em\")\r\n .style(\"text-anchor\", \"end\")\r\n .text(function(d) { return d;})\r\n\t \r\n\t//d3.select(\"svg\").remove();\r\n\r\n}", "function demographic_info(index){\n let info_opt=d3.select(\".panel-body\");\n info_opt.html(\"\")\n d3.json(\"samples.json\").then(function(data){\n //getting the values from the data\n var metadata=Object.values(data.metadata);\n Object.entries(metadata[index]).forEach(([keys,values])=>{\n let new_opt=info_opt.append(\"p\")\n var item=`${keys} : ${values}`\n new_opt.text(item)\n })\n }) \n}", "function populateData() {\n let counts = {};\n let chartPieData = {'possible': 0, 'probable': 0, 'certain': 0, 'gueri': 0, 'mort': 0};\n let chartDateData = {};\n let chartAgeData = {\n 'total': [0,0,0,0,0,0,0,0,0,0],\n 'possible': [0,0,0,0,0,0,0,0,0,0],\n 'probable': [0,0,0,0,0,0,0,0,0,0],\n 'certain': [0,0,0,0,0,0,0,0,0,0],\n 'gueri': [0,0,0,0,0,0,0,0,0,0],\n 'mort': [0,0,0,0,0,0,0,0,0,0]\n };\n let chartSexData = {\n 'total': {'F': 0, 'M': 0},\n 'possible': {'F': 0, 'M': 0},\n 'probable': {'F': 0, 'M': 0},\n 'certain': {'F': 0, 'M': 0},\n 'gueri': {'F': 0, 'M': 0},\n 'mort': {'F': 0, 'M': 0}\n };\n for (let cas of cases) {\n let loc = cas['Domicile'];\n if (!(loc in counts)) {\n counts[loc] = {'total': 0, 'possible': 0, 'probable': 0, 'certain': 0, 'gueri': 0, 'mort': 0};\n }\n let filtered = (viewConfig.filter ? viewConfig.filter(cas) : viewFilterDefault(cas));\n if (filtered) {\n counts[loc]['total'] += 1;\n counts[loc][filtered['Condition']] += 1;\n\n chartPieData[filtered['Condition']] += 1;\n\n let date = new Date(filtered['Date symptomes']);\n if (!isNaN(date)) {\n date = date.toISOString();\n chartDateData[date] = (chartDateData[date] || 0 ) + 1;\n }\n\n chartAgeData['total'][Math.floor(filtered['Age']/10)] += 1;\n chartAgeData[filtered['Condition']][Math.floor(filtered['Age']/10)] += 1;\n\n chartSexData['total'][filtered['Sexe']] += 1;\n chartSexData[filtered['Condition']][filtered['Sexe']] += 1;\n }\n }\n data = {\n 'map': counts,\n 'globalpie': chartPieData,\n 'date': chartDateData,\n 'age': chartAgeData,\n 'sex': chartSexData,\n };\n}", "function Gender() {\n\tconst componentStyle = {\n\t\tmargin: \"4px\",\n\t\tminWidth: \"30%\"\n\t};\n\tconst options = {\n\t\tchart: {\n\t\t\ttype: \"pie\",\n\t\t\tmargin: 0,\n\t\t\t/* spacingTop: 0,\n\t\t\tspacingBottom: 0,\n\t\t\tspacingLeft: 0,\n\t\t\tspacingRight: 0, */\n\n\t\t\t// Explicitly tell the width and height of a chart\n\t\t\twidth: 300,\n\t\t\theight: 200\n\t\t},\n\t\ttitle: {\n\t\t\ttext: \"Gender Distribution\"\n\t\t},\n\t\tcredits: {\n\t\t\tenabled: false\n\t\t},\n\t\tplotOptions: {\n\t\t\tpie: {\n\t\t\t\tsize: \"50%\",\n\t\t\t\tinnerSize: \"80%\",\n\t\t\t\tdepth:\n\t\t\t\t\t\"90%\" /* ,\n\t\t\t\tdataLabels: {\n\t\t\t\t\tenabled: false,\n\t\t\t\t\tdistance: -14,\n\t\t\t\t\tcolor: \"white\",\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tfontweight: \"bold\",\n\t\t\t\t\t\tfontsize: 50\n\t\t\t\t\t}\n\t\t\t\t} */\n\t\t\t}\n\t\t},\n\t\tseries: [\n\t\t\t{\n\t\t\t\tdata: [[\"Male\", 38], [\"Female\", 22]]\n\t\t\t}\n\t\t]\n\t};\n\treturn (\n\t\t<div className='gender' style={componentStyle}>\n\t\t\t<HighchartsReact highcharts={Highcharts} options={options} />\n\t\t</div>\n\t);\n}", "function processData() {\n\tif (this.status == 200) { // 200 stands for we received a file\n\t\tcurrJSON = JSON.parse(this.responseText);\n\t\t// add vector for all category names (before filtering)\n \n var category_list = d3.set();\n for (var i=0; i<currJSON.length; i++) {\n\t\t\t category_list.add(currJSON[i].category);\n\t\t}\n \n \tif(dimension == \"class\"){\n\t\t\tcategory_domain = ['other','Non-Matriculated', 'Grad', '5th year', 'Senior', 'Junior', 'Sophomore', 'Freshman'];\n\t\t\tconsole.log(category_domain);\n \t\tcolor.domain(category_domain);\n \t}\n\t\telse if (dimension == \"spcl_prog_text\"){\n\t\t\tcategory_domain = [\"None\", \"ADM SAI\", \"ATHLETICS\", \"ATHLETICS-EOP\", \"EOP\", \"EOP Special Programs\", \"INTL/RES.TUIT.ELIG\", \"RESTRICTED ELIGIBLTY\", \"SP ATHLETICS\", \"STAFF/FAC EXEMPT\", \"UNDERGRAD EXCHANGE\", \"UNIV EXT\", \"WA ST CLASS EMPT\", \"WWAMI\"];\n\t\t\tcolor.domain(category_domain);\n\t\t}\n else if (dimension==\"subject\"){\n \t// hacky sort to intelligently group categories together\n \t// category_domain = category_list.values().sort();\n \tvar languages = [];\n \tvar stem = [];\n \tvar other = [];\n \tfor (var i = 0; i < category_list.values().length; i++) {\n \t\tvar category = category_list.values()[i];\n \t\n \t\n\n \t\t//Languages\n\n \t\tif ( category == \"Arabic\" \n \t\t\t|| category == \"Chinese\" \n \t\t\t|| category == \"French\"\n \t\t\t|| category == \"Japanese\"\n \t\t\t|| category == \"Korean\"\n \t\t\t|| category == \"Spanish\"\n \t\t\t|| category == \"Swedish\") {\n \t\t\t\n \t\t\tlanguages.push(category);\n \t\t}\n\n \t\t//STEM\n \t\telse if(category == \"Bio\" \n \t\t\t|| category == \"CSE\" \n \t\t\t|| category == \"Chem\"\n \t\t\t|| category == \"Math\"\n \t\t\t|| category == \"Physics\"\n \t\t\t|| category == \"Stats\") {\n \t\t\tstem.push(category);\n \t\t}\n\n \t\t//other\n \t\telse {\n \t\t\tother.push(category);\n \t\t\t//alert(other);\n \t\t}\n \t};\n \t// category_domain = [];\n \t// category_domain = category_domain.concat(languages.sort());\n \t// category_domain = category_domain.concat(stem.sort());\n \t// category_domain = category_domain.concat(other.sort());\n \t// console.log(category_domain);\n\t\t\tcategory_domain = [\"Arabic\", \"French\", \"Spanish\",\n\t\t\t\t\t\t \t \"Chinese\", \"Korean\", \"Japanese\", \n\t\t\t\t\t\t \t \"Bio\", \"Chem\", \"Physics\", \n\t\t\t\t\t\t \t \"CSE\", \"Math\", \"Stats\", \"ECON\"].reverse();\n \t// manually control the colors\n \tcolor = d3.scale.ordinal()\n\t\t\t\t\t\t .domain([\"Arabic\", \"French\", \"Spanish\",\n\t\t\t\t\t\t \t \"Chinese\", \"Korean\", \"Japanese\",\n\t\t\t\t\t\t \t \"Bio\", \"Chem\", \"Physics\", \n\t\t\t\t\t\t \t \"CSE\", \"Math\", \"Stats\", \"ECON\"])\n\t\t\t\t\t\t .range(['#3182bd', '#6baed6', '#9ecae1', \n\t\t\t\t\t\t \t '#756bb1', '#9e9ac8', '#bcbddc',\n\t\t\t\t\t\t \t '#31a354', '#74c476', '#a1d99b', \n\t\t\t\t\t\t \t '#e6550d', '#fd8d3c', '#fdae6b','#fdd0a2']);\n \t\n }\n else {\n \t // handle the numerical category\n\t // if(dimension == 'class'){\n\t\t\t\t// category_domain = category_list.values().sort(\n\t\t\t\t// \tfunction(a, b) {\n\t\t\t\t// \t return b - a;\n\t\t\t\t// \t});\n\t // }else{\n\t \tcategory_domain = category_list.values().sort();\n\t // }\n \tcolor.domain(category_domain);\n }\n \n \n\t}\n\t// handle redrawing of existing bar chart\n\tif (document.getElementById(\"barplot_svg\")) {\n\t\t//TODO is this actually doing anything? - kd\n\t\tbarplot.init();\n\t\tlineplot.init(7);\n\t}\n}", "function contaMedaglie(array, n) {\n var somma = d3.sum(array, function(d,i){\n // conta tutti\n if (n=='athletes') return 1\n if (n=='gold') return (d.gold_medals > 0) ? 1 : 0\n if (n=='silver') return (d.silver_medals > 0) ? 1 : 0\n if (n=='bronze') return (d.bronze_medals > 0) ? 1 : 0\n if (n=='any') return (d.total_medals > 0) ? 1 : 0\n if (n=='none') return (d.total_medals == 0) ? 1 : 0\n })\n return somma\n }", "function viewForcedLaborF() {\n var color = d3.scale.linear()\n .range([\"#fee5d9\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#99000d\"]);\n\n var val1 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesLabor, b.value.femalesLabor); })\n // take the first option\n [0];\n\n var val2 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesLabor, b.value.femalesLabor); })\n // take the first option\n [5];\n\n var val3 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesLabor, b.value.femalesLabor); })\n // take the first option\n [22];\n\n var val4 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesLabor, b.value.femalesLabor); })\n // take the first option\n [37];\n\n var val5 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesLabor, b.value.femalesLabor); })\n // take the first option\n [48];\n\n var val6 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesLabor, b.value.femalesLabor); })\n // take the first option\n [50];\n\n color.domain([\n val1.value.femalesLabor,\n val2.value.femalesLabor,\n val3.value.femalesLabor,\n val4.value.femalesLabor,\n val5.value.femalesLabor,\n val6.value.femalesLabor\n ]);\n\n var keys = Object.keys(data);\n /* Interpolate color according to the numbers of tracking crime reported*/\n keys.forEach(function(d){\n data[d].color = color(data[d].femalesLabor);\n /*data[d].color = d3.interpolate(\"#fee5d9\", \"#99000d\")((data[d].laborTotal)/30);\n console.log(data[d].color);*/\n });\n /* draw states on id #statesvg */\n var svg = uStates.draw(\"#statesvg\", data, tooltipHtmlLabor, \"femalesLabor\");\n}", "function demoInfo(id) {\r\n d3.json(\"data/cardata.json\").then((data)=> {\r\n //call in metadata to demographic panel//\r\n var car_data = data.cars;\r\n var result = car_data.filter(car => car.index_col.toString() === id)[0]\r\n\r\n console.log(`test ${result}`)\r\n\r\n //select demographic panel from html//\r\n var features = d3.select(\"#cardata-cars\");\r\n //empty the demographic panel for new data//\r\n features.html(\"\");\r\n Object.entries(result).forEach((key) => {\r\n features.append(\"h5\").text(key[0]+ \": \" + key[1]);\r\n });\r\n });\r\n}", "function affichageSysteme()\n\t{\n\t var i = null;\n\t var j = null;\n\t \n\t document.write('<br /><table>');\n\t \n\t for(i = 0; i < this.matrice_systeme.length; i++)\n\t {\n document.write('<tr>');\n\t for(j = 0; j <= this.matrice_systeme[i].length; j++)\n\t {\n\t document.write('<td>');\n\t if(j == this.matrice_systeme[i].length)\n\t {\n\t document.write(' = '+this.second_membre[i]);\n\t }\n\t else\n\t {\n\t if(this.matrice_systeme[i][j] != 0)\n\t\t{\n\t document.write(this.matrice_systeme[i][j] +'<span style=\"color:blue\">a'+ j +'</span>');\n\t\t \n\t\t if(j != this.matrice_systeme[i].length - 1)\n\t\t document.write(' + ');\n\t\t}\n }\n\t document.write('</td>');\n\t }\n\t document.write('</tr>');\n\t } \n\t document.write('</table>');\n\t}", "function getSurvivorsByGender(data, gender) {\n\treturn data.filter(p => p.fields.sex === gender && p.fields.survived === 'Yes').length\n}", "function getFemalePopulationPerDistrct(district_data)\n{\n let female_population_pre_district = [];\n for (let i = 0; i < district_data.length; i++)\n {\n female_population_pre_district.push(district_data[i].female);\n }\n return female_population_pre_district;\n}", "function peopleStats(){\n\n\t//Categories: alone, core, acquaintances, strangers, colleagues [for starters, let's group singular and plural instances - eg: colleague and colleagues to see what that data looks like]\n\n\t//Most frequently w/: \n\n\t//Greatest happiness on avg. for time range with, if available, must be 3 times to ensure that it isn't an outlier, when user is with...\n\n\t//Lowest aliveness w/\n\n}", "function showYearTitles() {\n // Another way to do this would be to create\n // the year texts once and then just hide them.\n let yearsData = d3.keys(yearsTitleX);\n let years = svg.selectAll('.year').data(yearsData);\n\n years\n .enter()\n .append('text')\n .attr('class', 'year')\n .attr('x', function (d) {\n return yearsTitleX[d];\n })\n .attr('y', 40)\n .attr('text-anchor', 'middle')\n .text(function (d) {\n return d;\n });\n }", "function createStudentGenderChart(selector, data) {\n\n var width = d3.select(selector).style('width').replace(\"px\", \"\") / 1.5;\n var height = width;\n\n var color = d3.scale.ordinal()\n .range(COLOR_LIST);\n\n var canvas = d3.select(selector)\n .append('svg')\n .attr('width', width)\n .attr('height', height);\n\n var group = canvas.append('g')\n .attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')');\n\n var arc = d3.svg.arc()\n .innerRadius(0)\n .outerRadius(width / 2);\n\n var pie = d3.layout.pie()\n .value(function(d) { return d.value; });\n\n var arcs = group.selectAll('.arc')\n .data(pie(data))\n .enter()\n .append('g')\n .attr('class', 'arc');\n\n arcs.append('path')\n .attr('d', arc)\n .attr('fill', function(d, i) { return color(i); })\n .style('opacity', 0)\n .transition()\n .duration(TRANSITION_DURATION)\n .style('opacity', 1);\n\n arcs.append('text')\n .attr('transform', function(d) {\n return 'translate(' + arc.centroid(d) + \")\"; })\n .attr('text-anchor', 'middle')\n .attr('font-size', '1.5em')\n .text(function(d) { return GENDER_CHOICES[d.data.label] + \" ( \" + d.data.value + \" )\"; });\n }", "function showDemographicInfo(selectedSampleID) {\n\n console.log(\"showDemographicInfo: sample =\", selectedSampleID);\n\n d3.json(\"samples.json\").then((data) => {\n\n var demographicInfo = data.metadata;\n\n var resultArray = demographicInfo.filter(sampleObj => sampleObj.id == selectedSampleID)\n var result = resultArray[0];\n console.log(result)\n\n var panel = d3.select(\"#sample-metadata\");\n // clear panel variable on every load\n panel.html(\"\");\n\n Object.entries(result).forEach(([key, value]) => {\n var labelsToShow = `${key}: ${value}`;\n panel.append(\"h6\").text(labelsToShow);\n });\n });\n\n}", "function updateGenderData(movie, gender, indexToChartData, fistValue) {\n\n if (genderMap.get(gender) == null) {\n genderMap.set(gender, new Map().set(movie, [fistValue]));\n genderChart.dataProvider[indexToChartData][movie] = fistValue;\n } else {\n var genderDetailMap = genderMap.get(gender);\n var array = genderDetailMap.get(movie);\n if (array == null) { array = []; }\n array.push(fistValue);\n genderDetailMap.set(movie, array);\n genderMap.set(gender, genderDetailMap);\n var sum = 0;\n var j = 0;\n for (; j < genderMap.get(gender).get(movie).length; j++) {\n sum += genderMap.get(gender).get(movie)[j];\n }\n genderChart.dataProvider[indexToChartData][movie] = Math.round((sum / j) * 10) / 10;\n }\n genderChart.validateData();\n // console.log(\"****** gender[\" + gender + \"] and movie[\" + movie + \"] now makes chartdata: \" + JSON.stringify(ageChart.dataProvider));\n }", "function lifeExpectancy(values){\n\tvar centuries = groupBy(values,function(person){\n\t\treturn (Math.ceil(person.died/100));\n\t});\n\n\tfor(key in centuries){\n\t\tvar cent = ages(centuries[key]);\n\t\tconsole.log(key + \" century average age: \" + average(cent));\n\t}\n}", "function showSelect() {\n let sexValue = document.getElementById(\"selectSex\").value;\n \n if (sexValue === \"female\") {\n document.getElementById(\"selectPregnantLactating\").style.display = \"inline-block\";\n document.getElementById(\"pregnantLactating\").style.display = \"inline-block\";\n }\n\n else {\n document.getElementById(\"selectPregnantLactating\").style.display = \"none\";\n document.getElementById(\"pregnantLactating\").style.display = \"none\";\n document.getElementById(\"selectPregnantLactating\").value = \"\";\n }\n }", "function getCasualitiesByGender(data, gender) {\n\tconst passengerCount = data.filter(passenger => passenger.fields.survived === \"No\").filter(passenger => passenger.fields.sex === gender)\n\tconsole.log(`${gender.toUpperCase()} PASSENGERS THAT DIDN'T SURVIVE: ${passengerCount.length}`)\n\treturn passengerCount.length\n}", "function displayVals(d, i){\n //Assign Country Name\n d3.select(\"#country\")\n .text(d.properties.name)\n if (per_capita == true){\n riskVal = riskData.get(d.id)\n d3.select(\"#emissions_tag\")\n .text(\"Emissions (Per Capita), Rank\")\n if (typeof riskVal == 'undefined') {\n d3.select(\"#risk_val\")\n .text(\"No Value\")\n } else {\n riskVal = Math.round((riskVal + Number.EPSILON) * 100) / 100\n riskRank = riskRankData.get(d.id)\n d3.select(\"#risk_val\")\n .text(String(riskVal) + \", \" + String(riskRank))\n }\n ghgVal = perCapGhgData.get(d.id)\n if (typeof ghgVal == 'undefined') {\n d3.select(\"#emissions_val\")\n .text(\"No Value\")\n } else {\n ghgVal = Math.round((ghgVal + Number.EPSILON) * 100) / 100\n ghgRank = perCapGhgRankData.get(d.id)\n d3.select(\"#emissions_val\")\n .text(String(ghgVal) + \", \" + String(ghgRank))\n }\n } else{\n riskVal = riskData.get(d.id)\n d3.select(\"#emissions_tag\")\n .text(\"Emissions (Total), Rank\")\n if (typeof riskVal == 'undefined') {\n d3.select(\"#risk_val\")\n .text(\"No Value\")\n } else {\n riskVal = Math.round((riskVal + Number.EPSILON) * 100) / 100\n riskRank = riskRankData.get(d.id)\n d3.select(\"#risk_val\")\n .text(String(riskVal) + \", \" + String(riskRank))\n }\n ghgVal = ghgData.get(d.id)\n if (typeof ghgVal == 'undefined') {\n d3.select(\"#emissions_val\")\n .text(\"No Value\")\n } else {\n ghgVal = Math.round((ghgVal + Number.EPSILON) * 100) / 100\n ghgRank = ghgRankData.get(d.id)\n d3.select(\"#emissions_val\")\n .text(String(ghgVal) + \", \" + String(ghgRank))\n }\n }\n}", "function showHseSkill(branch, generation) {\n var hseStudents = document.querySelector('.skill-students');\n hseStudents.textContent = hseSkills(branch, generation);\n var percentageHseStudents = document.querySelector('.percentage-skill-students');\n percentageHseStudents.textContent = percentageHseSkills(branch, generation);\n }", "function countCombinations() {\n var sets = [];\n for (var i in filteredInfo) {\n var genres = filteredInfo[i].Genre.split(\",\");\n for (var j in genres) {\n var genre = genres[j].trim();\n if (genres_count[genre] != undefined)\n genres_count[genre] += 1;\n else\n genres_count[genre] = 1;\n }\n }\n for (var i in genres_count)\n sets.push({\"Genre\": i, Size: genres_count[i], label: i});\n createDonutChart(sets);\n}", "function displayAll() {\n\n // use d3 to reference table body for adding data fields\n var tbody = d3.select(\"tbody\");\n\n //Loop through the data and log each UFO sighting\n data.forEach(function(sighting) {\n\n //check value. OK! Reads each object in sequence!\n //console.log(sighting);\n\n //make new row in tbody\n var row = tbody.append(\"tr\");\n\n //use Object.entries on sighting to get all key, value pairs.\n var ufos = Object.entries(sighting);\n\n //using map produces an listing of arrays for key, value pairs I called value.\n ufos.map(function(value) {\n //console.log(value[1]); gives second element in value arrays\n \n var cell = row.append(\"td\");\n \n //each array called value in the .map function has the value at [1]\n cell.text(value[1]);\n });\n\n });\n}", "generate_data() {\n const selections = this.state.selected;\n let total = 0;\n const { population } = this.props;\n for (let i = 0; i < population.length; i++) {\n let should_count_person = true;\n const person = population[i];\n for (const attribute in person['traits']) {\n if (selections[attribute] === undefined) {\n if (person['traits'][attribute]) {\n should_count_person = false;\n break;\n }\n } else if (selections[attribute] && person['traits'][attribute]) {\n should_count_person = false;\n break;\n }\n }\n if (should_count_person) {\n total += 1;\n }\n }\n\n return `${String(total)} people lack this combination of traits`;\n }", "function visualize(errors, data) {\n \n //data = data.filter((d) => d.Narrow != 'Total')\n data.forEach(function (d) {\n d.Female = +d.Female\n d.Male = +d.Male\n })\n\n data.sort(function (x, y) {return d3.ascending(x.Female, y.Female)})\n data.sort(function (x, y) {return d3.descending(x.Broad, y.Broad)})\n\n data.forEach(function (d) {\n if (d.Narrow == 'Total') {\n d.Female = 0\n d.Male = 0\n d.Narrow = d.Broad.replace(': Total', '').toUpperCase()\n }\n })\n\n x.domain([0, d3.max(data, (d) => d.Female) * 2.5])\n y.domain([0, data.length])\n\n svg\n .selectAll(\".female\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", d => (width / 2) - gap - x(d.Female))\n .attr(\"y\", (d, i) => y(i))\n .attr(\"width\", (d) => x(d.Female))\n .attr(\"fill\", (d) => (d.Female > d.Male) ? 'crimson' : chroma(\"crimson\").brighten(2))\n .attr(\"height\", 10)\n\n svg\n .selectAll(\".male\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", (width / 2) + gap)\n .attr(\"y\", (d, i) => y(i))\n .attr(\"width\", (d) => x(d.Male))\n .attr(\"fill\", (d) => (d.Male > d.Female) ? 'steelblue' : chroma(\"steelblue\").brighten(2))\n .attr(\"height\", 10)\n\n svg\n .selectAll(\".narrows\")\n .data(data)\n .enter().append(\"text\")\n .attr(\"x\", width / 2)\n .attr(\"y\", (d, i) => y(i) + 10)\n .text(d => d.Narrow)\n .attr(\"text-anchor\", \"middle\")\n\n svg\n .selectAll(\".female_count\")\n .data(data)\n .enter().append(\"text\")\n .attr(\"x\", (d) => width / 2 - gap - x(d.Female) - 5)\n .attr(\"y\", (d, i) => y(i) + 10)\n .attr(\"fill\", \"crimson\")\n .text(d => formatComma(d.Female))\n .attr(\"text-anchor\", \"end\")\n\n svg\n .selectAll(\".male_count\")\n .data(data)\n .enter().append(\"text\")\n .attr(\"x\", (d) => width / 2 + gap + x(d.Male) + 5)\n .attr(\"y\", (d, i) => y(i) + 10)\n .attr(\"fill\", \"steelblue\")\n .text(d => formatComma(d.Male))\n .attr(\"text-anchor\", \"start\")\n\n\n\n}", "function filterDataSet(sex, year){\n let result = _mainJson[year].filter((d) => {\n if (d[\"sex\"] == sex) {\n return true;\n }\n return false;\n });\n return result;\n}", "function showClients(n,sex) {\n\n //if sex wasnt input, show all \n var flag;\n if(sex==undefined) flag=true; //if filter option wasn't selected, turn flag to true, show all attendants\n console.log(\"\\n\");\n if(Events[n].Clients.length==0) console.log(\"There are no clients attending this event.\");\n else {\n console.log(\"Clients attending \"+Events[n].name);\n for(var i=0;i<Events[n].Clients.length;i++) {\n if(Events[n].Clients[i].sex==sex || flag) {\n console.log(Events[n].Clients[i].fname\n +\" \"+Events[n].Clients[i].sname\n +\" \"+Events[n].Clients[i].sex\n +\" \"+Events[n].Clients[i].age);\n }\n else if(Events[n].Clients[i].sex==sex || flag) {\n console.log(Events[n].Clients[i].fname\n +\" \"+Events[n].Clients[i].sname\n +\" \"+Events[n].Clients[i].sex\n +\" \"+Events[n].Clients[i].age);\n } \n }\n }\n}", "function updateInformationLabels() {\r\n // for each pyramid ...\r\n aleph.pyramids.forEach(function (d, i) {\r\n var chartSide = d;\r\n var index = i;\r\n\r\n var revisedTotalYearPopulation = 0;\r\n var revisedMaleYearPopulation = 0;\r\n var revisedFemaleYearPopulation = 0;\r\n\r\n var malePop = 0;\r\n var femalePop = 0;\r\n\r\n aleph.pyramidFullData_v2[chartSide].forEach(function (d, i) {\r\n malePop = malePop + d[\"male\"][aleph.pyramidYearIndex].count;\r\n femalePop = femalePop + d[\"female\"][aleph.pyramidYearIndex].count;\r\n });\r\n\r\n revisedMaleYearPopulation = malePop;\r\n revisedFemaleYearPopulation = femalePop;\r\n revisedTotalYearPopulation = malePop + femalePop;\r\n\r\n d3.selectAll(\".aleph-high-Level-Information-group-\" + chartSide)\r\n .selectAll(\".aleph-pyramid-subTitleAnnex\")\r\n .html(\r\n \"(\" +\r\n (\r\n (revisedTotalYearPopulation /\r\n aleph.nested_pure_year_all_data[aleph.pyramidYearIndex]\r\n .yearTotalPopulation) *\r\n 100\r\n ).toFixed(2) +\r\n \"% of total UK population)\"\r\n );\r\n\r\n d3.selectAll(\".aleph-pyramid-group.aleph-pyramid-group-\" + chartSide)\r\n .selectAll(\".aleph-fixed-summary-stats-top\")\r\n .text(numberWithCommas(revisedTotalYearPopulation) + \" people selected\");\r\n\r\n d3.selectAll(\".aleph-pyramid-group.aleph-pyramid-group-\" + chartSide)\r\n .selectAll(\".aleph-fixed-summary-stats-bottom\")\r\n .text(\r\n \"from total UK population of \" +\r\n numberWithCommas(\r\n aleph.nested_pure_year_all_data[aleph.pyramidYearIndex]\r\n .yearTotalPopulation\r\n ) +\r\n \" in \" +\r\n aleph.pyramidYear\r\n );\r\n\r\n // calculate locally the years total ALL population\r\n // var yearTotalPopulation =\r\n // aleph.nested_all_data_object[aleph.pyramidYear].yearTotalPopulation;\r\n\r\n // // calculate locally the years total MALE population\r\n // var yearMalePopulation =\r\n // aleph.nested_male_data_object[aleph.pyramidYear]\r\n // .yearGenderTotalPopulation;\r\n\r\n // // calculate locally the years total FEMALE population\r\n // var yearFemalePopulation =\r\n // aleph.nested_female_data_object[aleph.pyramidYear]\r\n // .yearGenderTotalPopulation;\r\n\r\n // calculate locally the years total MALE percetnage population of age band\r\n // var maleYearPercentageOfAgeBand = (\r\n // /* yearMalePopulation */ (revisedMaleYearPopulation /\r\n // /* yearTotalPopulation */ revisedTotalYearPopulation) *\r\n // 100\r\n // ).toFixed(1);\r\n\r\n // calculate male perc. of ageband\r\n var maleYearPercentageOfAgeBand = /* totalMaleYearPopulation */ (\r\n (revisedMaleYearPopulation /\r\n /* totalFemaleYearPopulation */ (revisedFemaleYearPopulation +\r\n /* totalMaleYearPopulation */ revisedMaleYearPopulation)) *\r\n 100\r\n ).toFixed(1);\r\n\r\n // calculate locally the years total FEMALE percetnage population of age band\r\n // var femaleYearPercentageOfAgeBand = /* yearFemalePopulation */ (\r\n // (revisedFemaleYearPopulation /\r\n // /* yearTotalPopulation */ revisedTotalYearPopulation) *\r\n // 100\r\n // ).toFixed(1);\r\n\r\n // calculate male perc. of ageband\r\n var femaleYearPercentageOfAgeBand = /* totalMaleYearPopulation */ (\r\n (revisedFemaleYearPopulation /\r\n /* totalFemaleYearPopulation */ (revisedFemaleYearPopulation +\r\n /* totalMaleYearPopulation */ revisedMaleYearPopulation)) *\r\n 100\r\n ).toFixed(1);\r\n\r\n // console.log(aleph.pyramidYear,chartSide,revisedTotalYearPopulation,revisedMaleYearPopulation,revisedFemaleYearPopulation,maleYearPercentageOfAgeBand,femaleYearPercentageOfAgeBand)\r\n\r\n // update \"people in YEAR\" label\r\n d3.selectAll(\".aleph-pyramid-dynamic-subtitle-value-\" + chartSide).text(\r\n numberWithCommas(revisedTotalYearPopulation) /* + \" people \" */\r\n /* \" people in \" +\r\n aleph.pyramidYear */\r\n );\r\n\r\n // update \"MALE people in YEAR\" label\r\n d3.selectAll(\".aleph-pyramid-dynamic-subtitle-male-\" + chartSide).text(\r\n numberWithCommas(revisedMaleYearPopulation) /* + \" males\" */\r\n );\r\n\r\n // update \"FEMALE people in YEAR\" label\r\n d3.selectAll(\".aleph-pyramid-dynamic-subtitle-female-\" + chartSide).text(\r\n numberWithCommas(revisedFemaleYearPopulation) /* + \" females\" */\r\n );\r\n\r\n // update \"MALE %age in YEAR\" label\r\n d3.selectAll(\r\n \".aleph-pyramid-dynamic-subtitle-male-percentage-\" + chartSide\r\n ).text(maleYearPercentageOfAgeBand + \"%\");\r\n\r\n // update \"FEMALE %age in YEAR\" label\r\n d3.selectAll(\r\n \".aleph-pyramid-dynamic-subtitle-female-percentage-\" + chartSide\r\n ).text(femaleYearPercentageOfAgeBand + \"%\");\r\n\r\n // update width of \"MALE %age\" data bar\r\n d3.selectAll(\".thumbnail.barChart.rect.male\").attr(\r\n \"width\",\r\n aleph.barChartScaleFactor * maleYearPercentageOfAgeBand\r\n );\r\n\r\n // update width of \"FEMALE %age\" data bar\r\n d3.selectAll(\".thumbnail.barChart.rect.female\").attr(\r\n \"width\",\r\n aleph.barChartScaleFactor * femaleYearPercentageOfAgeBand\r\n );\r\n }); // end forEach\r\n\r\n return;\r\n}", "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "function nbOfMale (){\n\n}", "function categoryTable() { }", "function femDev() {\n for (i = 0; i < devs.length - 1; i++) {\n if (devs[i].gender == 'f' || devs[i].gender == 'F') {\n console.log(devs[i]);\n }\n }\n }", "function render_drug_list() {\n for (var i = 0; i < healthMed.length; i++) {\n $(\"#drug-list\").append(\n \"<div class='drug-item' data-drugname='\" + healthMed[i][0] + \"'>\" +\n \"<span class='glyphicon glyphicon-ok'></span> \" +\n healthMed[i][0] + \"<br /><em>\" + healthMed[i][2] + \"GHS per \" + healthMed[i][1] + \"</em></div>\"\n );\n }\n \n // initialize bootstrap's collapsible behavior\n $('.drug-item').each(function () { $(this).collapse(); });\n \n $(\"#drug-filter\").change(function () {\n var filter = $(\"#drug-filter\").val().toLowerCase();\n $('.drug-item').each(function (i) {\n var drug = $(this).data( \"drugname\" ).toLowerCase();\n if (drug.indexOf(filter) > -1) {\n $(this).collapse('show');\n }\n else {\n $(this).collapse('hide');\n }\n });\n });\n}", "function categmd(catgs) {\n var categorical = \"## Contents\\n\\n\";\n categorical += Object.keys(catgs).sort().map(function(a) {\n var fn = catgs[a];\n return '### ' + a + '\\n\\n' +\n Object.keys(fn).sort().map(function(b) {\n return '- [' + fn[b].name + '](/doc' + fn[b].link + ')' + ' - ' + fn[b].summary;\n }).join('\\n') + '\\n';\n }).join('\\n');\n fs.writeFileSync(mainpath + 'doc/contents.md',categorical);\n }", "function donutGender(location, healthTotal, healthMale, healthFemale){\n if (currentGender == \"total\"){\n var dataDonut = donut(location, healthTotal);\n updateDonut(dataDonut);\n }\n else if (currentGender == \"male\"){\n var dataDonut = donut(location, healthMale);\n updateDonut(dataDonut);\n }\n else if (currentGender == \"female\"){\n var dataDonut = donut(location, healthFemale);\n updateDonut(dataDonut);\n };\n\n // get correct data on changing the gender in the dropdown\n // store in currentGender\n d3.selectAll(\".dropdown-item\").on(\"click\", function(){\n var value = this.getAttribute(\"value\");\n if (value == \"male\"){\n currentGender = \"male\";\n var dataDonut = donut(location, healthMale);\n updateDonut(dataDonut);\n }\n else if (value == \"female\"){\n currentGender = \"female\";\n var dataDonut = donut(location, healthFemale);\n updateDonut(dataDonut);\n }\n else if (value == \"total\"){\n currentGender = \"total\";\n var dataDonut = donut(location, healthTotal);\n updateDonut(dataDonut);\n };\n });\n}", "function showTable(category) {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Set the available unique values on datasets of the category;\n var dataOn = tableData.map( (ufoReport) => ufoReport[category])\n .filter((x, i, a) => a.indexOf(x) == i);\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#filter-key\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n // Clean up the previous results\n inputElement.property(\"value\", \"\");\n tbody.html(\"\");\n d3.select(\"#available-data\").html(\"\");\n\n // Show the table when the input value is available on dataset\n if (dataOn.includes(inputValue)) {\n // filter the data according to the input value\n filteredData = tableData.filter((ufoReport) => ufoReport[category] === inputValue );\n filteredData.forEach((ufoReport) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoReport).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n }); \n }\n //Show the avilable dates when the iput does not exist in dataset\n else {\n availableData(dataOn);\n } \n}", "function setCategories() {\n let categorySpaces = document.getElementsByClassName(\"category\");\n for (var i = 0; i < 6; i++) {\n categorySpaces[i].innerHTML = \"<span>\" + roundCategories[i].title.toUpperCase() + \"</span>\";\n }\n}", "function createDepartmentGenderChart(selector, data) {\n var containerWidth = d3.select(selector).style('width').replace(\"px\", \"\") / 1.5;\n var containerHeight = 240;\n\n var margin = {top: 20, right: 10, bottom: 30, left: 40};\n var width = containerWidth - margin.left - margin.right;\n var height = containerHeight - margin.top - margin.bottom;\n\n var x = d3.scale.ordinal()\n .rangeRoundBands([0, width], .1);\n\n var y = d3.scale.linear()\n .rangeRound([height, 0]);\n\n var color = d3.scale.ordinal()\n .range(COLOR_LIST);\n\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .tickFormat(d3.format(\".2s\"));\n\n var canvas = d3.select(selector)\n .append('svg')\n .attr('width', width + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n x.domain(data.map(function(d) { return d.label; }));\n y.domain([0, d3.max(data, function(d) {\n return d.value['M'] + d.value['F'];\n })]);\n\n var data_trans = data.map(function(d) {\n return {\n 'label': d.label,\n 'value': [\n {\n 'name': 'Male',\n 'y0': 0,\n 'y1': d.value['M']\n },\n {\n 'name': 'Female',\n 'y0': d.value['M'],\n 'y1': d.value['M'] + d.value['F']\n }\n ]\n };\n });\n\n // X Axis\n canvas.append(\"g\")\n .attr(\"class\", \"xaxis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n // Y Axis\n canvas.append(\"g\")\n .attr(\"class\", \"yaxis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\");\n\n // Create Depatment Groups\n var department = canvas.selectAll(\".department\")\n .data(data_trans)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"department\")\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.label) + \",0)\"; });\n\n // Create Stacks\n department.selectAll('rect')\n .data(function(d) { return d.value; })\n .enter()\n .append(\"rect\")\n .attr(\"width\", x.rangeBand())\n .attr(\"y\", function(d) { return y(0); })\n .transition()\n .duration(TRANSITION_DURATION)\n .attr(\"y\", function(d) { return y(d.y1); })\n .attr(\"height\", function(d) { return y(d.y0) - y(d.y1); })\n .style(\"fill\", function(d) { return color(d.name); });\n\n\n var legend = canvas.selectAll(\".legend\")\n .data(color.domain().slice().reverse())\n .enter()\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n\n legend.append(\"rect\")\n .attr(\"x\", width - 18)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", color);\n\n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d; });\n }", "function drawPieCharts(data) {\n\n if (!data) {\n return;\n }\n\n let radius = 100;\n let color = d3.scaleOrdinal(d3.schemeCategory10);\n let pie = d3.pie().value(function(d) {return d.value; }).sort(null);\n let arc = d3.arc().innerRadius(radius - 60).outerRadius(radius - 20);\n\n let g;\n let path;\n let text;\n let circle;\n\n let count = 0;\n\n svgGender.selectAll(\"*\").remove();\n\n let max = 0;\n for(let key in data[0].data) {\n max += data[0].data[key].value;\n }\n\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n\n g = svgGender.append(\"g\")\n .attr('class', 'center-container')\n //.attr(\"transform\", \"translate(\" + (radius * (2 * i + 1)) + \",\" + radius + \")\")\n .attr(\"transform\", \"translate(\" + (radius * (3 * i + 1)) + \",\" + ((2 * j + 1) * radius) + \")\")\n .attr('width', width * 0.8 + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom);\n\n path = g.datum(data[count].data).selectAll(\"path\")\n .data(pie)\n .enter().append(\"path\")\n .attr(\"fill\", function(d, i) {\n\n // Race\n if (count === 2) {\n return colorsRace[d.data.title];\n }\n\n // Sex\n else if (count === 3) {\n return colorsSex[d.data.title];\n }\n \n return color(i);\n })\n .attr(\"d\", arc)\n .on('mouseover', function (d) {\n d3.select(this.parentNode).append('text')\n .text(function () {\n return (Math.round((d.value / max) * 100)).toFixed(2) + \"%\";\n })\n .attr('id', 'tempText')\n .attr('x', function () {\n return - (d3.select(this).node().getBBox().width / 2);\n })\n .attr('y', function () {\n return (d3.select(this).node().getBBox().height / 2);\n })\n }).on('mouseout', function (d) {\n d3.select(this.parentNode).selectAll('#tempText').remove();\n })\n .each(function(d) { this._current = d; });\n\n circle = g.datum(data[count].data).selectAll(\"circle\")\n .data(function (d) {\n return d;\n })\n .enter()\n .append(\"circle\")\n .attr('r', 10)\n .attr('cx', radius * 1)\n .attr('cy', function (d) {\n return (radius * 0.5) + (d.id * -25);\n })\n .attr('fill', function (d) {\n // Race\n if (count === 2) {\n return colorsRace[d.title];\n }\n\n // Sex\n else if (count === 3) {\n return colorsSex[d.title];\n }\n\n return color(d.id);\n });\n\n g.datum(data[count].data).selectAll(\"text\")\n .data(function (d) {\n return d;\n }).enter()\n .append(\"text\")\n .attr('x', radius * 1.15)\n .attr('y', function (d) {\n return ((radius * 0.5) + (d.id * -25)) + 5;\n })\n .text(function (d) {\n return d.title;\n });\n\n text = g.append(\"text\")\n .attr('y', function (d) {\n return radius;\n })\n .style('font-style', 'italic')\n .text(function (d) {\n return \"Fig. \" + (count + 2) + \" : \" + data[count].title;\n }).attr('x', function () {\n return - (radius * 0.75);\n });\n\n count++;\n }\n }\n}", "function buildDemographics(id_idx) {\n let meta = samples_data.metadata[id_idx];\n let demo = [];\n // Capitalize the first letter of the label text\n // becaue it displays ugly if you don't.\n for (let key in meta) {\n let label = key[0].toUpperCase() + key.slice(1);\n let value = meta[key];\n let lbl = `${label}: ${value}`;\n demo.push(lbl);\n };\n console.log(demo);\n\n // Use d3 to create the table dynamically.\n d3.select('#sample-metadata').selectAll('*').remove();\n let ul = d3.select('#sample-metadata').append(\"ul\");\n ul.style('marginLeft' , '0px')\n ul.selectAll('li')\n .data(demo)\n .enter()\n .append('li')\n .text(d => d)\n .style('list-style', 'none')\n .style('marginLeft' , '0px')\n}", "function petsByType() {\n let dogs = 0, cats = 0;\n\n for (var i = 0; i < pets.length; i ++) {\n switch(pets[i].anType) {\n case \"Dog\" :\n dogs ++;\n break;\n case \"Cat\" :\n cats ++;\n break;\n \n }\n }\n\n document.getElementById(\"dog-count\").innerHTML=`<b>${dogs}</b>`;\n document.getElementById(\"cat-count\").innerHTML=`<b>${cats}</b>`;\n}", "function plotMarginals(labels, counts, resultDivSelector) {\n var categories = Object.keys(labels[0]);\n\n var result_div = d3.select(resultDivSelector);\n\n for (var i=0; i<categories.length; i++) {\n //marginals\n var category = categories[i];\n var category_data = make_data(labels, counts);\n var values = _.unique(_.map(category_data, function(datum) {return datum.value[category];}));\n var probabilities = _.map(values, function(value) {\n var relevant_data = _.filter(category_data, function(datum) {return datum.value[category] == value;});\n return (_.map(relevant_data, function(datum) { return datum.probability; })).reduce(function(a, b) {\n return a + b;\n });\n });\n var marginal_plot_tag = \"marginal_\" + category;\n var plotid = \"plot\" + $(resultDivSelector).children().length;\n var marginal_div = result_div.append(\"svg\")\n .attr(\"id\", plotid);\n plotSingleVariable(values, probabilities, resultDivSelector + \" #\" + plotid, graph_width/2, graph_height/2, category);\n\n }\n // plot all pairwise plots\n for (var i=0; i<categories.length; i++) {\n for (var j=0;j<i; j++) {\n if (i != j) {\n var category1 = categories[i];\n var category2 = categories[j];\n var values1 = labels.map(function(x) {return x[category1];});\n var values2 = labels.map(function(x) {return x[category2];});\n var probabilities = counts;\n var plotid = \"plot\" + $(resultDivSelector).children().length;\n var plot_container = result_div.append(\"svg\")\n .attr(\"id\", plotid);\n plotTwoVariables(values1, values2, counts, resultDivSelector + \" #\" + plotid, category1, category2);\n }\n }\n }\n}", "function randomData(groups, points) {//# groups,# points per group\n\t\t\tvar data = [], random = d3.random.normal(), keys = ['Concept', 'Development', 'Growth'];\n\n\t\t\tfor ( var i = 0; i < groups; i++) {\n\t\t\t\tdata.push({\n\t\t\t\t\tkey : keys[i],\n\t\t\t\t\tvalues : []\n\t\t\t\t});\n\n\t\t\t\tfor ( var j = 0; j < points; j++) {\n\t\t\t\t\tdata[i].values.push({\n\t\t\t\t\t\tx : generateRange(1,1,100)[0],\n\t\t\t\t\t\ty : generateRange(1,1,100)[0],\n\t\t\t\t\t\tsize : generateRange(1,1,100)[0]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}", "function loadSexList() {\n\tLookup.all({where: {'lookup_type':'SEX'}}, function(err, lookups){\n\t this.sex_list = lookups;\n\t next(); // process the next tick. If you don't put it here, it will stuck at this point.\n\t}.bind(this));\n}", "function deaths(val){\n by_1000 = val\n chooseCategory()\n}", "function myPlot(fid = '940') {\n d3.json('samples.json').then(data => {\n console.log('data:', data);\n\n var ids = data.samples.map(d => d.id);\n console.log('ids:', ids);\n\n var values = data.samples.map(d => d.sample_values[0]);\n console.log('values:', values);\n\n // Add ids to dropdown menu\n for (var i = 0; i < ids.length; i++) {\n selectBox = d3.select('#selDataset');\n selectBox.append('option').text(ids[i]);\n }\n\n // filter sample values by id\n var sample = data.samples.filter(i => i.id.toString() === fid)[0];\n console.log(sample);\n\n var id = sample.id;\n // console.log('id:', id);\n\n var washFrequency = data.metadata.filter(i => i.id.toString() === fid)[0]\n .wfreq;\n // console.log('washFrequency:', washFrequency);\n\n // getting sample-metadata\n var metadata = data.metadata.filter(i => i.id.toString() === fid)[0];\n // console.log('metadata:', metadata);\n\n var metadata_card = d3.select('#sample-metadata');\n\n // refreshing metadata_card\n metadata_card.html('');\n\n for (const [key, value] of Object.entries(metadata)) {\n console.log(key, value);\n metadata_card.append('p').text(`${key}: ${value}`);\n }\n\n // top 10 OTUs found in that individual\n // getting sample_values as the values for the bar chart.\n var sample_values = sample.sample_values.slice(0, 10).reverse();\n // console.log('sample_values:', sample_values);\n\n // getting otu_ids as the labels for the bar chart.\n var otu_ids = sample.otu_ids.slice(0, 10).reverse();\n console.log('otu_ids:', otu_ids);\n\n // getting otu_labels as the hovertext for the chart.\n var otu_labels = otu_ids.map(d => 'OTU ' + d);\n // console.log('otu_labels:', otu_labels);\n\n var trace1 = {\n x: sample_values,\n y: otu_labels,\n text: otu_ids,\n type: 'bar',\n orientation: 'h',\n marker: {\n color: '#83B588'\n }\n };\n\n // data\n var chartData = [trace1];\n\n // Apply the group bar mode to the layout\n var layout = {\n title: `Top 10 OTUs found in Subject ${id}`,\n xaxis: { title: 'Sample Values' },\n yaxis: { title: '' }\n };\n\n // Render the plot to the div tag with id \"plot\"\n Plotly.newPlot('bar', chartData, layout);\n\n // Create a bubble chart that displays each sample.\n // Use otu_ids for the x values.\n // Use sample_values for the y values.\n // Use sample_values for the marker size.\n // Use otu_ids for the marker colors.\n // Use otu_labels for the text values.\n\n var traceB = {\n x: otu_ids,\n y: sample_values,\n mode: 'markers',\n marker: {\n size: sample_values,\n color: otu_ids\n },\n text: otu_labels\n };\n\n // set the layout for the bubble plot\n var layoutB = {\n title: ` Bubble chart for each sample`,\n xaxis: { title: `OTU ID ${fid}` },\n tickmode: 'linear',\n\n yaxis: { title: 'Sample Values' }\n };\n\n // creating data variable\n var dataB = [traceB];\n\n // create the bubble plot\n Plotly.newPlot('bubble', dataB, layoutB);\n\n // the Gauge Chart\n // part of data to input\n var data = [\n {\n domain: { x: [0, 1], y: [0, 1] },\n value: washFrequency,\n type: 'indicator',\n mode: 'gauge+number',\n gauge: {\n axis: { range: [null, 9] },\n bar: { color: '#83A388' },\n steps: [\n { range: [0, 1], color: '#F8F3EB' },\n { range: [1, 2], color: '#F4F1E4' },\n { range: [2, 3], color: '#E9E7C8' },\n { range: [3, 4], color: '#D5E599' },\n { range: [4, 5], color: '#B6CD8F' },\n { range: [5, 6], color: '#8AC085' },\n { range: [6, 7], color: '#88BB8D' },\n { range: [7, 8], color: '#83B588' },\n { range: [8, 9], color: '#83A388' }\n ]\n }\n }\n ];\n\n var layout = {\n title: {\n text: `Belly Button Washing Frequency <br> Scrubs per Week`\n }\n };\n\n Plotly.newPlot('gauge', data, layout);\n });\n}", "function show_all() {\n\tcategories.forEach(category => show(category));\n}", "function addTitle (people) {\r\n //console.log(people);\r\n //console.log(people[0][1])\r\n \r\n var genderMale = '' ;\r\n var genderFemale = '';\r\n var isGenderFemale = '' ;\r\n \r\n if (people[0] === undefined || people[0] === ''){\r\n return [];\r\n }\r\n\r\n var hasilGender = '';\r\n for (var i=0; i< people.length; i++){\r\n if (people[i][1] === 'male') {\r\n genderMale = 'Mr. ' + people[i][0];\r\n }\r\n else if (people[i][1] === 'female' && people[i][2] === false) {\r\n genderFemale = 'Ms. ' +people[i][0];\r\n }\r\n else if (people[i][1] === 'female' && people[i][2] === true) {\r\n isGenderFemale = 'Mrs. ' +people[i][0];\r\n }\r\n }\r\n //console.log(genderMale);\r\n //console.log(genderFemale);\r\n //console.log(isGenderFemale);\r\n //console.log('Mr ' +genderMale.toString());\r\n\r\n //console.log(genderMale);\r\n //console.log(genderFemale);\r\n //console.log(isGenderFemale);\r\n hasilGender = genderMale +(', ') + genderFemale+ (', ') + isGenderFemale;\r\n //console.log(hasilGender);\r\n var hasil = '';\r\n for (var i=0; i< hasilGender.length-2; i++){\r\n hasil += hasilGender[i];\r\n }\r\n //console.log(hasil);\r\n return hasil;\r\n \r\n //return 'Mr. ' +genderMale.toString()+ ', Ms. ' +genderFemale.toString()+ ', Mrs. ' +isGenderFemale.toString(); \r\n}", "function showData(item) {\nvar string='';\nvar group = item;\n //Every object is an array\n for (i=0; i < group.length; i++) {\n string = string + 'Name: ' +group[i].name + ' ' + 'Noisy: ' + group[i].noisy + ' ' + 'FightsWith: ' +group[i].fights_with + '<br>'\n }\n //Every array can be accessed by name?\n return string;\n}", "function showCritCatList() {\n // reSets all Markers, removes all Popups and renders criteria list\n updateCategoryList(crtCritIndex);\n }", "function drawHistogram(gunData, cityName){\n\t\n\tvar cityData = gunData.filter(incident => (incident.age > 1 && incident.age < 100))\n\t\t\t\t\t\t.sort(function(a,b){\n\t\t\t\t\t\t\treturn a.age - b.age;\n\t\t\t\t\t\t});\n\tif(cityName != \"All Cities\"){\n\t\tcityData = cityData.filter(incident => incident.city == cityName)\n\t}\n\tvar digitMap = d3.nest()\n\t\t\t.key(function(d) {return Math.floor(d.age/10);})\n\t\t\t.sortKeys(d3.ascending)\n\t\t\t.entries(cityData);\n\t//console.log(digitMap.length);\n\td3.select(\"#graphTitle\").select('h2').text(cityName);\n\td3.select(\"#totalDeaths\").text(\"Total Deaths: \" + cityData.length);\n\td3.select(\"#averageAge\").text( \"Average Age: \" + d3.mean( cityData, function(d) {return d.age;}).toFixed(0) );\n\td3.select(\"#tablehead\").text(\"Stem-Leaf Plot of age distribution of deaths\");\n\tvar table = d3.selectAll(\"#thetable\");\n\tvar headers = table.selectAll('.stem')\n\t\t\t\t\t.data(digitMap);\n\t\t\t\t\t\n\theaders.enter().append('tr')\n\t\t.merge(headers)\n\t\t.attr('class','stem')\n\t\t.text(function(d){\n\t\t\treturn d.key;\n\t\t})\n\t\t.append('td')\n\t\t.text(function(d){\n\t\t\tvar innertext = \"| \";\n\t\t\t//console.log(d);\n\t\t\td.values.forEach(function(e){\n\t\t\t\tinnertext += e.age%10\n\t\t\t});\n\t\t\treturn innertext;\n\t\t});\n\t\t\t\t\n\theaders.exit().remove();\n}", "function sensspecnew(){ \n d3.select(\"#info5\")\n .text(\"Sensitivity: \" + round(((1-tprThreshold)*100), 0) + \"%\");\n \n d3.select(\"#info6\")\n .text(\"Specificity: \" + round(((1-fprThreshold)*100), 0) + \"%\");\n }", "function optionChanged(id){\n \n d3.csv(\"static/js/cleaned_data.csv\").then((importedData) => {\n\n var panel_body = d3.select(\".panel-body\");\n\n Object.entries(importedData).forEach(function([k, v]) {\n if (v.id == id){\n //console.log(v);\n panel_body.html(\"Employer ID: \" + v.enrollee_id +\n \"<br>City Development Index: \" + v.city_development_index +\n \"<br>Gender: \" + v.gender +\n \"<br>Experience Summary: \" + v.relevent_experience +\n \"<br>University Status: \" + v.enrolled_university +\n \"<br>Level of Education: \" + v.education_level +\n \"<br>Area of Study: \" + v.major_discipline +\n \"<br>Size of Current Company: \" + v.company_size+\n \"<br>Years Since Last Job Change: \" + v.last_new_job+\n \"<br>Training Hours: \" + v.training_hours+\n \"<br>Looking for Job? (1:Yes, 0:No): \" + v.target);\n };\n });\n \n\n//function that groups by columns_________________________________________________________________________\nfunction groupBy( array , f )\n{\n var groups = {};\n array.forEach( function( o )\n {\n var group = JSON.stringify( f(o) );\n groups[group] = groups[group] || [];\n groups[group].push( o ); \n });\n return Object.keys(groups).map( function( group )\n {\n return groups[group]; \n })\n}\n//_____________________________________________________________________________________________________\n//gender variable grouping\nvar gender_result = groupBy(importedData, function(item)\n{\n return [item.target, item.gender];\n});\n// console.log(gender_result);\n\n//assign variables for gender chart\nvar male_0_total = gender_result[0].length\nvar male_1_total = gender_result[1].length\nvar female_0_total = gender_result[2].length\nvar female_1_total = gender_result[3].length\nvar other_0_total = gender_result[4].length\nvar other_1_total = gender_result[5].length\nvar target_0 = [male_0_total, female_0_total, other_0_total];\nvar target_1 = [male_1_total, female_1_total, other_1_total];\n\n//PHD Values\nvar phd_arts_0 = 0;\nvar phd_arts_1 = 1;\nvar phd_business_0 = 0;\nvar phd_business_1 = 0;\nvar phd_humanities_0 = 9;\nvar phd_humanities_1 = 1;\nvar phd_stem_0 = 207;\nvar phd_stem_1 = 32;\n\n//Masters Values\nvar masters_arts_0 = 17;\nvar masters_arts_1 = 2;\nvar masters_business_0 = 39;\nvar masters_business_1 = 5;\nvar masters_humanities_0 = 120;\nvar masters_humanities_1 = 10;\nvar masters_stem_0 = 1858;\nvar masters_stem_1 = 335;\n\n//Bachelors Values\nvar bach_arts_0 = 103;\nvar bach_arts_1 = 6;\nvar bach_business_0 = 110;\nvar bach_business_1 = 16;\nvar bach_humanities_0 = 209;\nvar bach_humanities_1 = 29;\nvar bach_stem_0 = 4545;\nvar bach_stem_1 = 1012;\n\nvar art_target_0 = masters_arts_0 + bach_arts_0 + phd_arts_0;\nvar art_target_1 = masters_arts_1 + bach_arts_1 + phd_arts_1;\n\nvar bus_target_0 = masters_business_0 + phd_business_0 + bach_business_0;\nvar bus_target_1 = masters_business_1 + bach_business_1 + phd_business_1;\n\nvar hum_target_0 = masters_humanities_0 +phd_humanities_0 + bach_humanities_0;\nvar hum_target_1 = masters_humanities_1 +phd_humanities_1 + bach_humanities_1;\n\nvar stem_target_0 = bach_stem_0 + phd_stem_0 + masters_stem_0;\nvar stem_target_1 = bach_stem_1 + phd_stem_1 + masters_stem_1;\n\nvar majors_target_0 = [art_target_0, bus_target_0, hum_target_0, stem_target_0];\nvar majors_target_1 = [art_target_1, bus_target_1, hum_target_1, stem_target_1];\n\n//eduction_level variables\nvar bachelor_target_0 = bach_arts_0 + bach_business_0+ bach_humanities_0+ bach_stem_0;\nvar masters_target_0 = masters_arts_0 + masters_business_0+ masters_humanities_0+ masters_stem_0;\nvar phd_target_0 = phd_arts_0 + phd_business_0 + phd_humanities_0 + phd_stem_0 ;\n\nvar bachelor_target_1 = bach_arts_1 + bach_business_1 + bach_humanities_1+ bach_stem_1 ;\nvar masters_target_1 = masters_arts_1 + masters_business_1+ masters_humanities_1+ masters_stem_1;\nvar phd_target_1 = phd_arts_1 + phd_business_1 + phd_humanities_1 + phd_stem_1;\n\nvar education_target_0 = [bachelor_target_0, masters_target_0, phd_target_0];\nvar education_target_1 = [bachelor_target_1, masters_target_1, phd_target_1];\n\n//Education Level Chart\nvar educationtrace1 = {\n x: [\"Bachelors\", \"Masters\", \"PhD\"],\n y: education_target_0,\n name: \"Not Searching for Job\",\n type: 'bar'\n };\n \n var educationtrace2 = {\n x: [\"Bachelors\", \"Masters\", \"PhD\"],\n y: education_target_1,\n name: 'Searching for Job',\n type: 'bar'\n };\n\nvar educationbar_data = [educationtrace1, educationtrace2];\n\nvar educationbar_layout = {\n title: `Breakdown of Employee Pool by Degree Level`,\n barmode: 'stack'\n}\nPlotly.newPlot('education_bar', educationbar_data, educationbar_layout);\n\n\n//Major Chart\nvar majortrace1 = {\n x: [\"Arts\", \"Business\", \"Humanities\", \"STEM\"],\n y: majors_target_0,\n name: \"Not Searching for Job\",\n type: 'bar'\n };\n \n var majortrace2 = {\n x: [\"Arts\", \"Business\", \"Humanities\", \"STEM\"],\n y: majors_target_1,\n name: 'Searching for Job',\n type: 'bar'\n };\n\nvar majorbar_data = [majortrace1, majortrace2];\n\nvar majorbar_layout = {\n title: `Breakdown of Employee Pool by Major`,\n barmode: 'stack'\n}\nPlotly.newPlot('major_bar', majorbar_data, majorbar_layout);\n \n\n//Gender Chart Construction\n var trace1 = {\n x: [\"Male\", \"Female\", \"Other\"],\n y: target_0,\n name: \"Not Searching for Job\",\n type: 'bar'\n };\n \n var trace2 = {\n x: [\"Male\", \"Female\", \"Other\"],\n y: target_1,\n name: 'Searching for Job',\n type: 'bar'\n };\n \n var bar_data = [trace1, trace2]\n \n var bar_layout = {\n title: `Gender Breakdown of Employee Pool`,\n barmode: 'stack'\n }\n Plotly.newPlot('gender_bar', bar_data, bar_layout);\n\n});\n}", "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#patient-form-input\");\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\")\n console.log(inputValue);\n // Use the form input to filter the data by blood type\n var dataBloodType = people.filter(people => people.bloodType == inputValue);\n console.log(dataBloodType)\n\n \n // BONUS: Calculate summary statistics for the age field of the filtered data\n var ageArray = dataBloodType.map(person => person.age);\n console.log(ageArray);\n // First, create an array with just the age values\n\n // Next, use math.js to calculate the mean, median, mode, var, and std of the ages\n var meanAge = math.mean(ageArray);\n var medianAge = math.median(ageArray);\n var modeAge = math.mode(ageArray);\n var varAge = math.variance(ageArray);\n var stdAge = math.std(ageArray);\n\n console.log(`Average age : ${meanAge}`);\n console.log(`Median age : ${medianAge}`);\n console.log(`Mode age : ${modeAge}`);\n console.log(`Variance age : ${varAge}`);\n console.log(`Standard Deviation age : ${stdAge}`);\n\n // Finally, add the summary stats to the `ul` tag\n var summary_list = d3.select(\".summary\");\n summary_list.html(\"\");\n summary_list.append(\"li\").text(`Average age : ${meanAge}`);\n summary_list.append(\"li\").text(`Median age : ${medianAge}`);\n summary_list.append(\"li\").text(`Mode age : ${modeAge}`);\n summary_list.append(\"li\").text(`Variance age : ${varAge}`);\n summary_list.append(\"li\").text(`Standard Deviation age : ${stdAge}`);\n\n\n}", "function init() {\n // Grab a reference to the dropdown select element\n var selector = d3.select(\"#selDataset\");\n\n d3.json(samples).then(function(data) {\n\n var sampleNames = data.names;\n\n sampleNames.forEach((sample) => {\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n var metadata = data.metadata;\n // Filter the data for the object with the desired sample number\n var resultArray = metadata//.filter(sampleObj => sampleObj.id == sample);\n var result = resultArray[0];\n // Use d3 to select the panel with id of `#sample-metadata`\n var PANEL = d3.select(\"#sample-metadata\");\n\n // Use `.html(\"\") to clear any existing metadata\n PANEL.html(\"\");\n\n // Use `Object.entries` to add each key and value pair to the panel\n // Hint: Inside the loop, you will need to use d3 to append new\n // tags for each key-value in the metadata.\n Object.entries(result).forEach(([key, value]) => {\n PANEL.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n //add IDs to dropdown\n data.names.forEach(element => {\n option = document.createElement('option');\n option.text = element;\n option.value = element;\n dropdown.add(option); });\n \n //get biosample data \n data.samples.forEach(element => {\n //define variables\n var xvals = [];\n var ids = [];\n var labels = [];\n var idNoText = [];\n \n //push each sample value into list\n element.sample_values.forEach(item => {\n xvals.push(item)\n });\n //slice to get top 10\n var topTen = xvals.slice(0,10);\n //console.log(topTen);\n //push each otu id into list\n element.otu_ids.forEach(item => {\n ids.push(\"OTU \" + item);\n idNoText.push(item);\n });\n //slice to get top ten\n var topTenIDs = ids.slice(0,10);\n //console.log(topTenIDs);\n //push each otu label into list\n element.otu_labels.forEach(item => {\n labels.push(item)\n });\n //slice to get top ten\n var topTenLabels = labels.slice(0,10);\n //console.log(topTenlabels); \n\n //build bar chart\n var data = [\n {\n x: topTen,\n y: topTenIDs,\n text: topTenLabels,\n orientation: \"h\",\n type: 'bar'\n }\n ];\n var layout = {\n \"yaxis\": {\n \"autorange\": 'reversed'\n }\n };\n Plotly.newPlot('bar', data, layout);\n //build bubble chart\n var bubbleData = [\n {\n x: idNoText,\n y: xvals,\n mode: \"markers\",\n marker: {\n size: xvals,\n color: idNoText,\n text: labels\n }\n }\n ];\n Plotly.newPlot('bubble', bubbleData);\n });\n \n ;\n\n });\n}", "function show_number_staff(ndx) {\n\n var doctorsDim = ndx.dimension(dc.pluck('type'));\n var nursesDim = ndx.dimension(dc.pluck('type'));\n var counsellorsDim = ndx.dimension(dc.pluck('type'));\n var consultantsDim = ndx.dimension(dc.pluck('type'));\n\n\n var numberOfDoctorsGroup = doctorsDim.group().reduceSum(dc.pluck('doctors'));\n var numberOfNursesGroup = nursesDim.group().reduceSum(dc.pluck('nurses'));\n var numberOfCounsellorsGroup = counsellorsDim.group().reduceSum(dc.pluck('councillors'));\n var numberOfConsultantsGroup = consultantsDim.group().reduceSum(dc.pluck('consultants'));\n\n var stackedChart = dc.barChart(\"#staff_numbers\");\n stackedChart\n \n .margins({\n top: 30,\n right: 50,\n bottom: 40,\n left: 35\n })\n .dimension(doctorsDim)\n .group(numberOfDoctorsGroup, \"Doctors\")\n .stack(numberOfNursesGroup, \"Nurses\")\n .stack(numberOfCounsellorsGroup, \"Councillors\")\n .stack(numberOfConsultantsGroup, \"Consultants\")\n .transitionDuration(500)\n .renderLabel(true)\n .x(d3.scale.ordinal())\n .xUnits(dc.units.ordinal)\n .legend(dc.legend().x(75).y(0).horizontal(1).gap(5))\n .elasticY(true)\n .elasticX(true)\n .xAxisLabel(\"Facility\")\n .yAxisLabel(\"Staff\")\n .yAxis().ticks(10);\n\n}", "function viewAllTraffickingF() {\n var color = d3.scale.linear()\n .range([\"#fee5d9\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#99000d\"]);\n\n var val1 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesTotal, b.value.femalesTotal); })\n // take the first option\n [0];\n\n var val2 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesTotal, b.value.femalesTotal); })\n // take the first option\n [5];\n\n var val3 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesTotal, b.value.femalesTotal); })\n // take the first option\n [22];\n\n var val4 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesTotal, b.value.femalesTotal); })\n // take the first option\n [37];\n\n var val5 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesTotal, b.value.femalesTotal); })\n // take the first option\n [48];\n\n var val6 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.femalesTotal, b.value.femalesTotal); })\n // take the first option\n [50];\n\n color.domain([\n val1.value.femalesTotal,\n val2.value.femalesTotal,\n val3.value.femalesTotal,\n val4.value.femalesTotal,\n val5.value.femalesTotal,\n val6.value.femalesTotal\n ]);\n\n var keys = Object.keys(data);\n /* Interpolate color according to the numbers of tracking crime reported*/\n keys.forEach(function(d){\n data[d].color = color(data[d].femalesTotal);\n /*data[d].color = d3.interpolate(\"#fee5d9\", \"#99000d\")((data[d].totalCrimes)/30);\n console.log(data[d].color);*/\n });\n /* draw states on id #statesvg */\n var svg = uStates.draw(\"#statesvg\", data, tooltipHtml, \"femalesTotal\");\n}", "function donutData(location, valueYear){\n\n // select data for slider value year\n var healthYear = [];\n for (var k = 0; k < healthYears.length; k++){\n if (healthYears[k].YEAR == valueYear){\n healthYear.push(healthYears[k]);\n };\n };\n\n // filter data on gender\n var healthYearMale = [];\n var healthYearFemale = [];\n var healthYearTotal = [];\n for (var l = 0; l < healthYear.length; l++){\n if (healthYear[l].GENDER == \"male\"){\n healthYearMale.push(healthYear[l]);\n }\n else if (healthYear[l].GENDER == \"female\"){\n healthYearFemale.push(healthYear[l]);\n }\n else if (healthYear[l].GENDER == \"total\"){\n healthYearTotal.push(healthYear[l]);\n };\n };\n\n // pass filtered data on\n donutGender(location, healthYearTotal, healthYearMale, healthYearFemale);\n}", "function formatDataLabel(attr, val) {\n switch (attr) {\n case \"population\":\n return (val / 1000).toLocaleString(\"en-US\") + \"K\";\n case \"illiteracy\":\n default:\n return val + \"%\";\n }\n}", "function display()\n{\n generate(); // generate 36,000 combinations\n var data = \"<h1> Data </h1>\";\n data += \"<table border=2>\";\n data += \"<caption> <strong>Rolling Dice</strong></caption>\";\n data += \"<thead><tr><th>Sum</th><th># Rolls</th><th>Percentage</th></tr>\";\n data += \"<tbody>\";\n\n for(var j = 2; j < 13; j++)\n {\n data += \"<tr><td>\"+ j + \"</td>\"; // the sum.\n data += \"<td>\" + sumDict[j] +\"</td>\";// total occurance of the sum\n data += \"<td>\" + (sumDict[j] / 36000).toFixed(2) + \"</td></tr>\" // percentage of that sum\n }\n data += \"</tbody></table>\";\n\n document.getElementById('stats').innerHTML = data;\n \n}", "function builtDemdata(sample){\n d3.json(\"../data/samples.json\").then(function(data){\n var valueMeta=data.metadata;\n var resultArray=valueMeta.filter(object => object.id == sample);\n var result = resultArray[0];\n\n// Select html location for demographic information\n var selectDem = d3.select('#sample-metadata');\n selectDem.html(\" \");\n\n Object.entries(result).forEach(([key,value])=>{\n selectDem.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n});\n}", "function getgencat(){\n var catname = company.student.filter((c)=>{\n return c.cat === \"gen\";\n })\n return catname;\n}", "function onCategoryChanged() {\n var select = d3.select('#categorySelect').node();\n // Get current value of select element\n var category = select.options[select.selectedIndex].value;\n // Update chart with the selected category of letters\n updateChart(category);\n}", "function tooltipStats(countyName, race) {\n csvName = getCSVName(countyName.toLowerCase());\n d3.csv(csvName, function(error, data) {\n var groupByOffice = d3.nest()\n .key(function(d) {return d.office})\n .entries(data);\n raceVotes = getVotesByOffice(groupByOffice, race);\n var voteSummaryString = '';\n for (var i = 0; i < raceVotes.length; i++) {\n candidate = raceVotes[i].candidate;\n candidateVotes = raceVotes[i].votes;\n voteSummaryString += candidate + ': ' + candidateVotes + '<br>';\n }\n map[countyName.toLowerCase()] = voteSummaryString;\n return voteSummaryString;\n });\n}", "function setUpDistrictChart()\n{ \n let selection_area = document.getElementById(\"counties-selection-area\");\n district_selected_county = selection_area.options[selection_area.selectedIndex].text;\n let district_data = population_data.filter((population) =>\n {\n if (population.county === district_selected_county)\n {\n return true;\n }\n return false;\n });\n let districts_name = getDistrictName(district_data);\n let male_population_per_district = getMalePopulationPerDistrct(district_data);\n let female_population_per_district = getFemalePopulationPerDistrct(district_data);\n updateDistrictChart(district_chart,districts_name,male_population_per_district,female_population_per_district);\n}", "function gallery(dataset) {\n\n var totalRows = dataset.length;\n\t// console.log(totalRows);\n\n var name;\n\n\tif (dataset == woodData){\n\t\tname = \"Wood\";\n\t\tcall = \"woodData\"\n\t} else if (dataset == paperData) {\n\t\tname = \"Paper\";\n\t\tcall = \"paperData\"\n\t} else if (dataset == penData) {\n\t\tname = \"Pen\";\n\t\tcall = \"penData\"\n\t} else if (dataset == silkData) {\n\t\tname = \"Silk\";\n\t\tcall = \"silkData\"\n\t} else if (dataset == inkData) {\n\t\tname = \"Ink\";\n\t\tcall = \"inkData\"\n\t} else if (dataset == silverData) {\n\t\tname = \"Silver\";\n\t\tcall = \"silverData\"\n\t} else if (dataset == glassData) {\n\t\tname = \"Glass\";\n\t\tcall = \"glassData\"\n\t} else if (dataset == albumenData) {\n\t\tname = \"Albumen\";\n\t\tcall = \"albumenData\"\n\t} else if (dataset == goldData) {\n\t\tname = \"Gold\";\n\t\tcall = \"goldData\"\n\t} else if (dataset == porcelainData) {\n\t\tname = \"Porcelain\";\n\t\tcall = \"porcelainData\"\n\t} else if (dataset == allData) {\n\t\tname = \"All\";\n\t\tcall = \"allData\"\n\t};\n\n\tvar format = d3.format(\".0%\");\n\tvar formatThousands = d3.format(\",\");\n\n\tfunction imageExists(url){\n\t var image = new Image();\n\t image.src = url;\n\t if (!image.complete) {\n\t return false;\n\t }\n\t else if (image.height === 0) {\n\t return false;\n\t }\n\t return true;\n\t}\n\n\tobjectNames = d3.nest()\n\t\t.key(function(d) { return d.objectName; })\n\t\t \t.rollup(function(v) { return v.length; })\n\t\t \t.entries(dataset)\n\t\t \t.sort(function(a,b) {return d3.descending(a.value,b.value);})\n\t\t \t.filter(function (d, i) { return i === 0 | i === 1 | i === 2 | i === 3 | i === 4 | i === 5 | i === 6 | i === 7 | i === 8\n\t\t \t\t| i === 9;});\n\t\t// console.log(objectNames);\n\n\trepImg1 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[0].key });\n\n\trepImg2 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[1].key });\n\n\trepImg3 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[2].key });\n\n\trepImg4 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[3].key });\n\n\trepImg5 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[4].key });\n\n\trepImg6 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[5].key });\n\n\trepImg7 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[6].key });\n\n\trepImg8 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[7].key });\n\n\trepImg9 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[8].key });\n\n\trepImg10 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.objectName == objectNames[9].key });\n\t// console.log(repImg10);\n\n\t// Rep Image 1\n\n\td3.select(\".image1\").selectAll(\"img\").remove();\n\n\tvar img1random = Math.floor((Math.random() * repImg1.length) + 0);\n\n\tvar displayRepImg1 = d3.select(\".image1\").selectAll(\"#repImg1\")\n\t\t\t.data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"class\", \"target\")\n\t .attr(\"id\", \"target1\")\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image1\").selectAll(\"div\").remove();\n\n\tvar displayOverlay1 = d3.select(\".image1\").selectAll(\"#repImg1\")\n\t .data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay\")\n\t .attr(\"id\", \"overlay1\")\n\t .exit();\n\n\tvar displayTitle = d3.select(\".overlay\").selectAll(\"#overlay1\")\n\t .data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate = d3.select(\".overlay\").selectAll(\"#overlay1\")\n\t .data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist = d3.select(\".overlay\").selectAll(\"#overlay1\")\n\t .data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,30).replace(/[^ -~]+/g, \"\")})\n\t .exit();\n\n\tvar displayCulture = d3.select(\".overlay\").selectAll(\"#overlay1\")\n\t .data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay\").selectAll(\"#overlay1\")\n .data(repImg1.filter(function (d, i) { return i === img1random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject= d3.select(\".overlay\").selectAll(\"#overlay1\")\n\t .data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[0].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay\").selectAll(\"#overlay1\")\n\t .data(repImg1.filter(function (d, i) { return i === img1random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 2\n\n\tvar img2random = Math.floor((Math.random() * repImg2.length) + 0);\n\n\td3.select(\".image2\").selectAll(\"img\").remove();\n\n\tvar displayRepImg2 = d3.select(\".image2\").selectAll(\"#repImg2\")\n\t\t\t.data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\t\n\td3.select(\".image2\").selectAll(\"div\").remove();\n\n\tvar displayOverlay2 = d3.select(\".image2\").selectAll(\"#repImg2\")\n\t .data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay2\")\n\t .attr(\"id\", \"overlay2\")\n\t .exit();\n\n\tvar displayTitle2 = d3.select(\".overlay2\").selectAll(\"#overlay2\")\n\t .data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\")})\n\t .exit();\n\n\tvar displayDate2 = d3.select(\".overlay2\").selectAll(\"#overlay2\")\n\t .data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist2 = d3.select(\".overlay2\").selectAll(\"#overlay2\")\n\t .data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture2 = d3.select(\".overlay2\").selectAll(\"#overlay2\")\n\t .data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay2\").selectAll(\"#overlay2\")\n .data(repImg2.filter(function (d, i) { return i === img2random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject2= d3.select(\".overlay2\").selectAll(\"#overlay2\")\n\t .data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[1].value) + \")\"})\n\t .exit();\n\n\tvar displayLink2= d3.select(\".overlay2\").selectAll(\"#overlay2\")\n\t .data(repImg2.filter(function (d, i) { return i === img2random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 3\n\n\tvar img3random = Math.floor((Math.random() * repImg3.length) + 0);\n\n\td3.select(\".image3\").selectAll(\"img\").remove();\n\n\tvar displayRepImg3 = d3.select(\".image3\").selectAll(\"#repImg3\")\n\t\t\t.data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image3\").selectAll(\"div\").remove();\n\n\tvar displayOverlay3 = d3.select(\".image3\").selectAll(\"#repImg3\")\n\t .data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay3\")\n\t .attr(\"id\", \"overlay3\")\n\t .exit();\n\n\tvar displayTitle3 = d3.select(\".overlay3\").selectAll(\"#overlay3\")\n\t .data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate3 = d3.select(\".overlay3\").selectAll(\"#overlay3\")\n\t .data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist3 = d3.select(\".overlay3\").selectAll(\"#overlay3\")\n\t .data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture3 = d3.select(\".overlay3\").selectAll(\"#overlay3\")\n\t .data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay3\").selectAll(\"#overlay3\")\n .data(repImg3.filter(function (d, i) { return i === img3random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject3= d3.select(\".overlay3\").selectAll(\"#overlay3\")\n\t .data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[2].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay3\").selectAll(\"#overlay3\")\n\t .data(repImg3.filter(function (d, i) { return i === img3random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 4\n\n\tvar img4random = Math.floor((Math.random() * repImg4.length) + 0);\n\n\td3.select(\".image4\").selectAll(\"img\").remove();\n\n\tvar displayRepImg4 = d3.select(\".image4\").selectAll(\"#repImg4\")\n\t\t\t.data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image4\").selectAll(\"div\").remove();\n\n\tvar displayOverlay4 = d3.select(\".image4\").selectAll(\"#repImg4\")\n\t .data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay4\")\n\t .attr(\"id\", \"overlay4\")\n\t .exit();\n\n\tvar displayTitle4 = d3.select(\".overlay4\").selectAll(\"#overlay4\")\n\t .data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\")})\n\t .exit();\n\n\tvar displayDate4 = d3.select(\".overlay4\").selectAll(\"#overlay4\")\n\t .data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist4 = d3.select(\".overlay4\").selectAll(\"#overlay4\")\n\t .data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture4 = d3.select(\".overlay4\").selectAll(\"#overlay4\")\n\t .data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay4\").selectAll(\"#overlay4\")\n .data(repImg4.filter(function (d, i) { return i === img4random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject4= d3.select(\".overlay4\").selectAll(\"#overlay4\")\n\t .data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[3].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay4\").selectAll(\"#overlay4\")\n\t .data(repImg4.filter(function (d, i) { return i === img4random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 5\n\n\tvar img5random = Math.floor((Math.random() * repImg5.length) + 0);\n\n\td3.select(\".image5\").selectAll(\"img\").remove();\n\n\tvar displayRepImg5 = d3.select(\".image5\").selectAll(\"#repImg5\")\n\t\t\t.data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image5\").selectAll(\"div\").remove();\n\n\tvar displayOverlay5 = d3.select(\".image5\").selectAll(\"#repImg5\")\n\t .data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay5\")\n\t .attr(\"id\", \"overlay5\")\n\t .exit();\n\n\tvar displayTitle5 = d3.select(\".overlay5\").selectAll(\"#overlay5\")\n\t .data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate5 = d3.select(\".overlay5\").selectAll(\"#overlay5\")\n\t .data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist5 = d3.select(\".overlay5\").selectAll(\"#overlay5\")\n\t .data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture5 = d3.select(\".overlay5\").selectAll(\"#overlay5\")\n\t .data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay5\").selectAll(\"#overlay5\")\n .data(repImg5.filter(function (d, i) { return i === img5random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject5= d3.select(\".overlay5\").selectAll(\"#overlay5\")\n\t .data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[4].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay5\").selectAll(\"#overlay5\")\n\t .data(repImg5.filter(function (d, i) { return i === img5random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 6\n\n\tvar img6random = Math.floor((Math.random() * repImg6.length) + 0);\n\n\td3.select(\".image6\").selectAll(\"img\").remove();\n\n\tvar displayRepImg6 = d3.select(\".image6\").selectAll(\"#repImg6\")\n\t\t\t.data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image6\").selectAll(\"div\").remove();\n\n\tvar displayOverlay6 = d3.select(\".image6\").selectAll(\"#repImg6\")\n\t .data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay6\")\n\t .attr(\"id\", \"overlay6\")\n\t .exit();\n\n\tvar displayTitle6 = d3.select(\".overlay6\").selectAll(\"#overlay6\")\n\t .data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate6 = d3.select(\".overlay6\").selectAll(\"#overlay6\")\n\t .data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist6 = d3.select(\".overlay6\").selectAll(\"#overlay6\")\n\t .data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture6 = d3.select(\".overlay6\").selectAll(\"#overlay6\")\n\t .data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay6\").selectAll(\"#overlay6\")\n .data(repImg6.filter(function (d, i) { return i === img6random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject6= d3.select(\".overlay6\").selectAll(\"#overlay6\")\n\t .data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[5].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay6\").selectAll(\"#overlay6\")\n\t .data(repImg6.filter(function (d, i) { return i === img6random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 7\n\n\tvar img7random = Math.floor((Math.random() * repImg7.length) + 0);\n\n\td3.select(\".image7\").selectAll(\"img\").remove();\n\n\tvar displayRepImg7 = d3.select(\".image7\").selectAll(\"#repImg7\")\n\t\t\t.data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image7\").selectAll(\"div\").remove();\n\n\tvar displayOverlay7 = d3.select(\".image7\").selectAll(\"#repImg7\")\n\t .data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay7\")\n\t .attr(\"id\", \"overlay7\")\n\t .exit();\n\n\tvar displayTitle7 = d3.select(\".overlay7\").selectAll(\"#overlay7\")\n\t .data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate7 = d3.select(\".overlay7\").selectAll(\"#overlay7\")\n\t .data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist7 = d3.select(\".overlay7\").selectAll(\"#overlay7\")\n\t .data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture7 = d3.select(\".overlay7\").selectAll(\"#overlay7\")\n\t .data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay7\").selectAll(\"#overlay7\")\n .data(repImg7.filter(function (d, i) { return i === img7random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject7= d3.select(\".overlay7\").selectAll(\"#overlay7\")\n\t .data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[6].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay7\").selectAll(\"#overlay7\")\n\t .data(repImg7.filter(function (d, i) { return i === img7random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 8\n\n\tvar img8random = Math.floor((Math.random() * repImg8.length) + 0);\n\n\td3.select(\".image8\").selectAll(\"img\").remove();\n\n\tvar displayRepImg8 = d3.select(\".image8\").selectAll(\"#repImg8\")\n\t\t\t.data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image8\").selectAll(\"div\").remove();\n\n\tvar displayOverlay8 = d3.select(\".image8\").selectAll(\"#repImg8\")\n\t .data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay8\")\n\t .attr(\"id\", \"overlay8\")\n\t .exit();\n\n\tvar displayTitle8 = d3.select(\".overlay8\").selectAll(\"#overlay8\")\n\t .data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate8 = d3.select(\".overlay8\").selectAll(\"#overlay8\")\n\t .data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist8 = d3.select(\".overlay8\").selectAll(\"#overlay8\")\n\t .data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture8 = d3.select(\".overlay8\").selectAll(\"#overlay8\")\n\t .data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay8\").selectAll(\"#overlay8\")\n .data(repImg8.filter(function (d, i) { return i === img8random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject8= d3.select(\".overlay8\").selectAll(\"#overlay8\")\n\t .data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[7].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay8\").selectAll(\"#overlay8\")\n\t .data(repImg8.filter(function (d, i) { return i === img8random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 9\n\n\tvar img9random = Math.floor((Math.random() * repImg9.length) + 0);\n\n\td3.select(\".image9\").selectAll(\"img\").remove();\n\n\tvar displayRepImg9 = d3.select(\".image9\").selectAll(\"#repImg9\")\n\t\t\t.data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image9\").selectAll(\"div\").remove();\n\n\tvar displayOverlay9 = d3.select(\".image9\").selectAll(\"#repImg9\")\n\t .data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay9\")\n\t .attr(\"id\", \"overlay9\")\n\t .exit();\n\n\tvar displayTitle9 = d3.select(\".overlay9\").selectAll(\"#overlay9\")\n\t .data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate9 = d3.select(\".overlay9\").selectAll(\"#overlay9\")\n\t .data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist9 = d3.select(\".overlay9\").selectAll(\"#overlay9\")\n\t .data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture9 = d3.select(\".overlay9\").selectAll(\"#overlay9\")\n\t .data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay9\").selectAll(\"#overlay9\")\n .data(repImg9.filter(function (d, i) { return i === img9random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject9= d3.select(\".overlay9\").selectAll(\"#overlay9\")\n\t .data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[8].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay9\").selectAll(\"#overlay9\")\n\t .data(repImg9.filter(function (d, i) { return i === img9random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\t// Rep Image 10\n\n\tvar img10random = Math.floor((Math.random() * repImg10.length) + 0);\n\n\td3.select(\".image10\").selectAll(\"img\").remove();\n\n\tvar displayRepImg10 = d3.select(\".image10\").selectAll(\"#repImg10\")\n\t\t\t.data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"width\",\"100%\")\n\t .style(\"height\",\"100%\")\n\t .style(\"background-position\",\"center\")\n\t .style(\"background-size\",\"30%\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t .attr(\"onerror\", \"this.onerror=null;this.src='assets/refresh.jpg';\")\n\t .append('a').attr('href',function(d) {return d.URL;})\n\t .exit();\n\n\td3.select(\".image10\").selectAll(\"div\").remove();\n\n\tvar displayOverlay10 = d3.select(\".image10\").selectAll(\"#repImg10\")\n\t .data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append('div')\n\t .attr(\"class\", \"overlay10\")\n\t .attr(\"id\", \"overlay10\")\n\t .exit();\n\n\tvar displayTitle10 = d3.select(\".overlay10\").selectAll(\"#overlay10\")\n\t .data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectTitle\")\n\t .text(function(d) { return d.Title.substring(0,40).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayDate10 = d3.select(\".overlay10\").selectAll(\"#overlay10\")\n\t .data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectBeginDate\")\n\t .text(function(d) { return d.objectBeginDate })\n\t .exit();\n\n\tvar displayArtist10 = d3.select(\".overlay10\").selectAll(\"#overlay10\")\n\t .data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"artistDisplayName\")\n\t .text(function(d) { return \"Artist: \" + d.artistDisplayName.substring(0,20).replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayCulture10 = d3.select(\".overlay10\").selectAll(\"#overlay10\")\n\t .data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"where\")\n\t .text(function(d) { return \"Culture: \" + d.Culture.replace(/[^ -~]+/g, \"\") })\n\t .exit();\n\n\tvar displayMedium= d3.select(\".overlay10\").selectAll(\"#overlay10\")\n .data(repImg10.filter(function (d, i) { return i === img10random;}))\n .enter()\n .append(\"text\")\n .attr(\"id\", \"objectMedium\")\n .text(function(d) {return \"Medium: \" + d.Medium.replace(/[^ -~]+/g, \"\")})\n .exit();\n\n\tvar displayObject10= d3.select(\".overlay10\").selectAll(\"#overlay10\")\n\t .data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"objectName\")\n\t .text(function(d) {return \"Family: \" + d.objectName.replace(/[^ -~]+/g, \"\") +\"s (of \" + formatThousands(objectNames[9].value) + \")\"})\n\t .exit();\n\n\tvar displayLink= d3.select(\".overlay10\").selectAll(\"#overlay10\")\n\t .data(repImg10.filter(function (d, i) { return i === img10random;}))\n\t .enter()\n\t .append(\"a\")\n\t .attr(\"id\", \"link\")\n\t .attr(\"href\",function(d) {return d.linkResolution})\n\t .attr(\"target\",\"_blank\")\n\t .text(\"View\")\n\t .exit();\n\n\n\t // Total Count\n\n\td3.select(\".container-micro\").selectAll(\"text\").remove();\n\n\tvar displayTotal = d3.select(\".container-micro\").selectAll(\"#total\")\n\t\t\t.data(repImg3.filter(function (d, i) { return i === 0;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"class\", \"section-header\")\n\t .attr(\"id\", \"summary\")\n\t .text(formatThousands(totalRows) + \" Items\")\n\t .exit();\n\n\t// Department Filter\n\n\tvar departments = d3.nest()\n \t\t.key(function(d) { return d.Department; })\n\t \t.rollup(function(v) { return v.length; })\n\t \t.entries(dataset)\n\t \t.sort(function(a,b) {return d3.descending(a.value,b.value);});\n\t// console.log(departments);\n\n\tvar top1 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.Department == departments[0].key });\n\t// console.log(repImg1);\n\tvar top2 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.Department== departments[1].key });\n\t// console.log(repImg2);\n\tvar top3 = dataset.filter(function(d){return d.isPublic === \"True\" & d.URL != \"NA\" & d.Department == departments[2].key });\n\t// console.log(repImg3);\n\n\td3.select(\".departments1\").selectAll(\"img\").remove();\n\n\tvar top1random = Math.floor((Math.random() * top1.length) + 0);\n\tvar top2random = Math.floor((Math.random() * top2.length) + 0);\n\tvar top3random = Math.floor((Math.random() * top3.length) + 0);\n\n\tvar displayTop1= d3.select(\".departments1\").selectAll(\"#top1\")\n\t\t\t.data(top1.filter(function (d, i) { return i === top1random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"height\",\"150%\")\n\t .style(\"overflow-x\",\"hidden\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t \t.style(\"background-position\",\"center center\")\n\t // .style(\"background-size\",\"30%\")\n\t .style(\"position\",\"relative\")\n\t .exit();\n\n\td3.select(\".departments2\").selectAll(\"img\").remove();\n\n\tvar displayTop2= d3.select(\".departments2\").selectAll(\"#top2\")\n\t\t\t.data(top2.filter(function (d, i) { return i === top2random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"height\",\"150%\")\n\t .style(\"overflow-x\",\"hidden\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t \t.style(\"background-position\",\"center center\")\n\t // .style(\"background-size\",\"30%\")\n\t .style(\"position\",\"relative\")\n\t .exit();\n\n\td3.select(\".departments3\").selectAll(\"img\").remove();\n\n\tvar displayTop3= d3.select(\".departments3\").selectAll(\"#top3\")\n\t\t\t.data(top3.filter(function (d, i) { return i === top3random;}))\n\t .enter()\n\t .append('img')\n\t .style(\"height\",\"150%\")\n\t .style(\"overflow-x\",\"hidden\")\n\t .attr(\"src\",function(d) {return d.URL;})\n\t \t.style(\"background-position\",\"center center\")\n\t // .style(\"background-size\",\"30%\")\n\t .style(\"position\",\"relative\")\n\t .exit();\n\n\td3.select(\".info1\").selectAll(\"text\").remove();\n\n\t\n\td3.select(\".medium\").selectAll(\"text\").remove();\n\n\tvar choice1 = d3.select(\".medium\").selectAll(\"#choice1\")\n\t\t\t.data(departments.filter(function (d, i) { return i === 0;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"choice1\")\n\t .text(name)\n\t .exit();\n\n\td3.select(\".info1\").selectAll(\"text\").remove();\n\n\tvar dept1_percent = d3.select(\".info1\").selectAll(\"#dept1-percent\")\n\t\t\t.data(departments.filter(function (d, i) { return i === 0;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"dept1-percent\")\n\t .text(function(d) {return format(d.value/totalRows); })\n\t .exit();\n\n\td3.select(\".info2\").selectAll(\"text\").remove();\n\n\tvar info_dept1 = d3.select(\".info2\").selectAll(\"#dept1-name\")\n\t\t \t.data(departments.filter(function (d, i) { return i === 0;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"dept1-name\")\n\t .text(function(d) { return d.key })\n\t .exit();\n\n\td3.select(\".info3\").selectAll(\"text\").remove();\n\n\tvar dept2_percent = d3.select(\".info3\").selectAll(\"#dept2-percent\")\n\t\t\t.data(departments.filter(function (d, i) { return i === 1;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"dept2-percent\")\n\t .text(function(d) {return format(d.value/totalRows); })\n\t .exit();\n\n\td3.select(\".info4\").selectAll(\"text\").remove();\n\n\tvar info_dept2 = d3.select(\".info4\").selectAll(\"#dept2-name\")\n\t\t \t.data(departments.filter(function (d, i) { return i === 1;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"dept2-name\")\n\t .text(function(d) { return d.key })\n\t .exit();\n\n\td3.select(\".info5\").selectAll(\"text\").remove();\n\n\tvar dept2_percent = d3.select(\".info5\").selectAll(\"#dept3-percent\")\n\t\t\t.data(departments.filter(function (d, i) { return i === 2;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"dept3-percent\")\n\t .text(function(d) {return format(d.value/totalRows); })\n\t .exit();\n\n\td3.select(\".info6\").selectAll(\"text\").remove();\n\n\tvar info_dept2 = d3.select(\".info6\").selectAll(\"#dept3-name\")\n\t\t \t.data(departments.filter(function (d, i) { return i === 2;}))\n\t .enter()\n\t .append(\"text\")\n\t .attr(\"id\", \"dept3-name\")\n\t .text(function(d) { return d.key })\n\t .exit();\n }", "function showCats(jsonObj) {\n // Save reference to cats\n let cats = jsonObj.cats;\n\n // for every cat in the array\n for (let i = 0; i < cats.length; i++) {\n\n // build the elements\n let thisCat = document.createElement('div');\n let name = document.createElement('h2');\n let blurb = document.createElement('p');\n\n // Fill the elements\n name.innerHTML = cats[i].name;\n // build a description\n let descript = cats[i].name + ' is a ' + cats[i].age + ' year old '\n + cats[i].species + ' that loves';\n\n // get the array of favourite foods\n let favFoods = cats[i].favFoods;\n // loop through to add all foods to the description\n for (let a = 0; a < favFoods.length; a++) {\n // Add food\n descript = descript + ' ' + favFoods[a];\n\n if (a == (favFoods.length - 1)) {\n // end with a period if it's the last food\n descript = descript + '.';\n } else {\n // end with a comma if it's not the last food\n descript = descript + ',';\n }\n }\n\n // add description to the element\n blurb.innerHTML = descript;\n\n // append all elements into the cat's div\n thisCat.appendChild(name);\n thisCat.appendChild(blurb);\n // append the cat's div to the parent div\n div.appendChild(thisCat);\n }\n}" ]
[ "0.5959805", "0.59451514", "0.59236306", "0.59132034", "0.5898405", "0.5814487", "0.57751083", "0.57670313", "0.57618374", "0.57575333", "0.5697842", "0.55218154", "0.550682", "0.5409061", "0.5408525", "0.5245627", "0.5193849", "0.5162972", "0.5139002", "0.513693", "0.51311266", "0.5106883", "0.50899464", "0.5065094", "0.5051191", "0.50495553", "0.50399566", "0.5011716", "0.50004077", "0.49893454", "0.49709624", "0.49703822", "0.49516383", "0.49375883", "0.49356946", "0.49290505", "0.49271554", "0.49178523", "0.4898335", "0.48974863", "0.4892695", "0.4890594", "0.48904532", "0.4890127", "0.48812413", "0.48748034", "0.48696324", "0.4867658", "0.48602", "0.486003", "0.48551795", "0.4851467", "0.48304343", "0.48300102", "0.48299783", "0.4828452", "0.48257348", "0.4825581", "0.4821169", "0.4821126", "0.48114923", "0.4807196", "0.4800009", "0.47992334", "0.47959635", "0.47948763", "0.4788344", "0.47842947", "0.47842664", "0.47821075", "0.47774044", "0.4773235", "0.4757799", "0.47575808", "0.47575426", "0.4753196", "0.47519416", "0.47506908", "0.47485104", "0.4736905", "0.4727912", "0.47226462", "0.47194088", "0.47171795", "0.47160915", "0.4714161", "0.47075573", "0.47023073", "0.47010136", "0.46999532", "0.46969846", "0.4692713", "0.46914047", "0.46906775", "0.4688321", "0.46844077", "0.46843588", "0.46839502", "0.467643", "0.46756744" ]
0.6391051
0
RECURSIVE FUNCTION 4 (HELPER METHOD) IN HELPER METHOD, WE USE A VARIABLE IN OUTER SCOPE AND DECALRE ANOTHER FUNCTION INSIDE FUNCTION. THE INNER FUNCTION IS RECURSIVELY CALLED. THE OUTER VARIBLE VARIABLE VALUE IS NOT AFFECTED DURING THE RECURSION
function collectOddValues(arr) { oddArr = [] function oddValues(numarr) { if(numarr.length == 0){ return } if(numarr[0]%2 != 0) { oddArr.push(numarr[0]) } oddValues(numarr.slice(1)) } oddValues(arr) return oddArr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outer (input ) {\n var outerScopedVariable = []\n\n function helper (helperInput) {\n //modify the outerScopedVariable\n helper(helperInput --)\n }\n helper(input)\n return outerScopedVariable\n}", "function outer(input) {\n const outerScopedVariable = []\n\n function helper(helperInput) {\n helper(helperInput--)\n }\n\n helper(input)\n\n return outerScopedVariable\n}", "function outerFn() {\n var data = \"Something from outer\";\n var fact = \"Remember me!\";\n return function innerFn() {\n \n // in debugger console, value\n // of data is reference error\n // while fact is string\n // This is because, innerFn()\n // is evaluated and fact is \n // consequently able to be\n // established as a variable\n debugger\n return fact;\n }\n}", "function outFunc() {\n let a = 0;\n\n function innerOne() {\n a++;\n return a;\n }\n function innerTwo() {\n a++;\n return a;\n }\n function innerThree() {\n a--;\n return a;\n }\n return {\n one: innerOne(),\n two: innerTwo(),\n three: innerThree(),\n };\n}", "function top4(){\n var a;\n function inner1(){\n var b;\n function inner2(){\n console.log(a,b);\n }\n inner2();\n }\n inner1();\n}", "function doSomething(a){\n function doSomethingElse(a){\n return a -1;\n }\n let b = a + doSomething(a * 2);\n console.log(b * 3);\n}", "function localVars(x, y){\r\n var a = 6;\r\n function innerVars(){\r\n var a = 10;\r\n b = a;\r\n }\r\n var b = 7;\r\n function innerVars2(){\r\n var c = 11;\r\n var d = b;\r\n }\r\n innerVars();\r\n return b;\r\n}", "function outer(){\r\n var res=10;\r\n function inner(res){\r\n return res*res;\r\n }\r\n return inner;\r\n}", "function outerFunc() {\n let a = 1;\n return function gimmeTwo() {\n return a += 1;\n };\n }", "function check3() {\n let x = check3_inner();\n function check3_inner() {\n return x + 1;\n }\n return x;\n}", "function recusion() {\n // some serious code\n recusion();\n}", "function doSomething(a) {\n\tfunction doSomethingElse(a) {\n\t\treturn a - 1;\n\t}\n\n\tvar b;\n\tb = a + doSomethingElse( a * 2 );\n\tconsole.log( b * 3 );\n}", "function outerFn() {\n var data = \"something from outerFn\";\n var fact = \"Remember me!\";\n return function innerFn() {\n debugger\n return fact;\n //fact is available here but not data\n }\n}", "function outerFn() {\n var data = 'something from the outer function';\n var fact = 'Remember me!'\n return function innerFn() {\n debugger\n return fact;\n }\n}", "function outer(a){\n let sum = a;\n return function inner(b){\n if(b) {\n sum += b;\n return inner;\n } else {\n return sum;\n }\n }\n}", "function top3() {\n var a, b;\n function inner() {\n console.log(a);\n }\n return inner;\n}", "function innerFunc() {\n\t\tvar y = 5;\n\t\tprint(\"in innerFunc: y =\", y);\t// y = 5\n\t}", "function outerFn() {\n var data \"something from outer\";\n return function innerFn() {\n var innerData = \"something from inner\";\n return data + \" \" + innerData;\n }\n}", "function outer() {\n // outer has one local variable\n var num = 1;\n // inner can access outer's local variable because of scope\n function inner() {\n return num++;\n }\n // outer returns inner uninvoked\n return inner;\n}", "function outer()\n{\n let num=216\n function addTwo()\n {\n num=num+2\n return num\n }\n function subtractTwo()\n {\n num=num-2\n return num\n }\n function multiplyTwo()\n {\n num=num*2\n return num\n }\n return {\n addTwo:addTwo(),\n subtractTwo:subtractTwo(),\n multiplyTwo:multiplyTwo()\n }\n}", "function outer() {\n // outer has one local variable\n var num = 1;\n function inner() {\n // inner can access outer's local variables because of scope\n // inner modifies num and returns the new value.\n num++;\n console.log('current value of num: ', num);\n }\n // outer returns inner\n // NOTE: inner was not invoked.\n return inner;\n}", "function recipe_Function () {\r\n document.getElementById(\"Nested_Function\").innerHTML = Base();\r\n function Base() {\r\n var Servings = 4;\r\n function Double_Recipe() {Servings += 4;} // this is the nested function\r\n Double_Recipe();\r\n return Servings;\r\n }\r\n}", "function recur(userFn){\n var recursingFn = j.either(j.identity, userFn),\n localRecursor = j.partial(recursor, recursingFn),\n recurValue = j.apply(localRecursor, j.slice(1, arguments));\n\n while(verifyRecurValue(recurValue = recurValue(localRecursor)) && recursingFn !== j.identity);\n\n return recurValue;\n }", "recurseThis(callback) {\n function insideFunction(array) {\n for (const el of array) {\n if (callback(el)) {\n return el;\n } else if (el[\"nested\"]?.length > 0) {\n var hi = insideFunction(el[\"nested\"]);\n if (hi) {\n return hi;\n }\n }\n }\n }\n return insideFunction(App.todos);\n }", "function outerFunction( param){\n \tfunction innerFunction(input){\n \t\treturn input * 2;\n \t};\n\n \treturn ' The result is '+ innerFunction(param);\n}", "function complicated () {\n console.log(multiply(return4(), 8));\n}", "function outer(){\n var num = 9\n return function inner(){\n num ++\n return num\n }\n}", "function funcName(parm1, parm2=1) { // go through all the <li> elements\n\tglobalVar; // no var then it is global!\n\tvar internalVar;\n\tif (true) {var internalVar})\t// this is the same as outer internvar! so need let\n\tlet internalVarAbsolute=7;\t// strict to block // USE THIS TO LIMIT SCOPE TO THAT BLOCK\n\treturn parm1[parm2]=999;\n}", "function Z() {\n var b = 10;\n function T() {\n console.log(\"B:\", b); // will give output of 100 cuz before return it value change over refernece if we access it anywhere it will give new data\n }\n b = 100;\n return T;\n }", "function top2() {\n var a;\n function inner() {\n console.log(a);\n }\n inner();\n}", "function delcaredFunction() {\n return 4;\n}", "function fn(num){\n if(num>10){\n return 20;\n }\n if(num%3===0){\n return num + fn(num+1);\n }\n return fn(num+1);\n}", "function\nauxmain_3834_(a4x1)\n{\nlet a4y1;\nlet xtmp16;\nlet xtmp18;\ndo {\n;\nxtmp18 =\nfunction()\n{\nlet xtmp17;\n{\nxtmp17 = auxloop_3879_(XATS2JS_lazy_eval(a4x1));\n}\n;\nreturn xtmp17;\n} // lam-function\n;\nxtmp16 = XATS2JS_new_lazy(xtmp18);\nbreak;//return\n} while( true );\nreturn xtmp16;\n} // function // auxmain(8)", "function outer() {\r\n let counter = 0; \r\n function incrementCounter() {\r\n counter++; \r\n}\r\nreturn incrementCounter; \r\n}", "function outer () {\n let counter = 0;\n function incrementCounter () {\n counter++;\n return counter\n }\n return incrementCounter()\n}", "function f() {\n return function () { return function () { return function () {\n return function () { return function () { return function () {\n return function () { return function () { return function () {\n return function () { return function () { return function () {\n return function () { return function () { return function (a) {\n var v = a;\n\tassertEq(v, 42);\n\treturn function() { return v; };\n }; }; }; }; }; }; }; }; }; }; }; }; }; }; };\n}", "function checkscope2() {\n\t var scope = \"Local\";\n\t function nested() {\n\t\t var scope = \"nested\";\n\t\t return scope;\n\t }\n\t return nested();\n }", "function functionTut() {\n\n // function inside a function\n function outsideFunction() {\n \n \n var a = 10;\n var b = 20;\n function functionInFunction() {\n var result = a+b;\n return result;\n }\n \n // AFTER RETURN DO NOT DECLARE THE FUNCTION WITH \"()\"!\n return functionInFunction;\n }\n var result = outsideFunction();\n \n // without \"()\": outputs the code of the function\n console.log(result);\n // with \"()\": makes it a function outputs the result/return of the function\n console.log(result());\n \n // Closure = function inside a function, wich relyes on variables declared in the outer fnction\n // declaration of variables inside a function, inside a function\n var test = \"outside the function declared value\";\n console.log(\"tested before the function: \" + test);\n \n function insideDeclared() {\n var test = \"inside the function declared value\";\n console.log(\"tested inside the function: \" + test);\n }\n insideDeclared();\n console.log(\"tested after the function: \" + test);\n \n// ------------------------SWITCH--------------------\n// ---------------------------------------------------\n// ----------------------------------------------------\n\nvar animal = \"alien\";\n\nswitch(animal){\n case \"squirrel\":\n case \"wulf\":\n case \"tiger\":\n console.log(animal + \" is an animal\");\n break;\n case \"spoon\":\n console.log(animal + \" is not an animal\");\n break;\n default:\n console.log(animal + \" ...i dont know that beeing\");\n}\n\n\n\n// ---------------------IF... ELSE...-----------------\n// ---------------------------------------------------\n// ----------------------------------------------------\n\nfunction ifElseTut(){\n\n // LONG VERSION (inside var possible)------------------\n \n if( 2>=3 ){\n \n var output = \"long output var: if true, do that...\";\n console.log(output);\n } else{\n var output = \"long output var: otherwise, do that\";\n console.log(output);\n }\n \n // SHORT VERSION (no variable declaration possible) ----\n 2>1 ? \n console.log(\"short: if true, do that\")\n : console.log(\"short: otherwise do that\");\n \n // multiple things to do in squared scopes [... , ... , ...]\n 1>0 ?\n [console.log(\" if true, do that... \"),console.log(\" ...and that\")]\n : [console.log(\"it isnt \"), console.log(\"nopidope\")] ;\n \n console.log(\"-------------------------\");\n }\n ifElseTut();\n\n}", "function outer(){\n var out_var = 'outer';\n console.log(in_var); // error\n inner();\n function inner(){\n var in_var = 'inner';\n console.log(out_var); //outer\n }\n console.log(in_var); // error\n}", "function outerFunc() {\n var counter = 0;\n\n function innerFunc()\n {\n console.log(this);\n return counter += 1;\n }\n return innerFunc;\n}", "function googleSheetsOut(places,base){\n\nvar capted =startRecursion(places,base);\nreturn capted;\n}", "function getMysteryNumber2() {\n\n var chooseMystery = function() { // 1st this variable gets hoisted\n return 12; // 3rd this get executed \n }\n\n return chooseMystery(); // 4th this get executed and returns 3rd exectuion\n\n var chooseMystery = function() { // 2nd this varilable gets hoisted and overwrites the first\n return 7; // this never gets executed because at 4th it already returned\n }\n}", "function moreLearning() {\r\n alert(\r\n \"as long as we make a copy of the original list [['a','b'],['c','d'],['e','f']] passed into joinRecur or innerRecur then passed that copied version into the func call of secondInnerRecur\"\r\n );\r\n alert(\r\n \"our original list [['a','b'],['c','d'],['e','f']] will not be mutated \"\r\n );\r\n alert(\r\n \"every time we call innerRecur it will reset this variable: var copyOfList = innerList.slice(); or var copyOfList = list.slice();\"\r\n );\r\n}", "function deductions(nssf, paye) // I have named this function \"deductions\", and given it 2 parameters namely nssf and paye\n{\n let deductions = nssf(1000000)+ paye(1000000); // I have assigned arguments to these nested functions apye and nssf\n console.log(deductions)\n\n return deductions\n}", "function test(x){\n x = 10;\nx++;\nreturn function(){\n \nreturn x++; \n}\n}", "function foo() {\r\n var y = 20; // free variable within scope of bar\r\n\r\n function bar() {\r\n var z = 15; // not a free vairable, local variable\r\n var output = x + y + z;\r\n return output;\r\n }\r\n //console.log(bar()); 45\r\n return bar;\r\n}", "function outer() {\n // Step 1.3: Log arguments\n\n function inner() {\n // Step 1.4: Log arguments\n };\n\n // Step 1.2: Call inner with some other arguments\n}", "function outer() {\n const students = [];\n\n function inner(student) {\n if (student === \"l\") {\n return students;\n }\n\n students.push(student);\n // students.forEach(student => {\n // console.log(student)\n // });\n return students;\n }\n return inner;\n}", "function innerFunc(){\n console.log(\"Sono la funzione interna!: \" + myVar);\n }", "function myBigFunction() {\n var myValue;\n\n subFunction1();\n subFunction2();\n subFunction3();\n}", "function outerFunction1(){\n let parentVariable = 1000;\n function childfunction1(){\n console.log(parentVariable);\n }\n return childfunction1\n}", "function sum(num1, num2) {\n\tvar result =0 ;\n\tvar temp = [num1, num2];\n\t//console.log(temp);\n\tvar i=0; \n\n \n\n\tfunction inner(result, temp, i){\n\n\t\t//console.log(result);\n \n\t\tif (i === temp.length ){\n \treturn result;\n\n } else {\n\n result = result + temp[i];\n return inner(result, temp, i+1);\n\n }\n \n\t}\n\n\treturn inner(result, temp, i);\n\n}", "function f() {\n var a = 1;\n a = 2;\n var b = g();\n a = 3;\n return b;\n function g() {\n return a;\n }\n}", "function outer2() {\n \n\n let inner2 = () => {\n \n };\n\n \n}", "function outer(){\n var a=10;\n function inner(){\n a;\n console.log('I am inner Function');\n }\n inner();\n console.log('I am Outer function')\n}", "function foo() {\n var a = 2;\n\n function baz() {\n console.log( a ); // 2\n }\n\n bar( baz );\n}", "function outerFunction()\n{\n let count=0;\n function innerFunction() \n {\n count++\n return count\n }\n return innerFunction\n}", "function higherOrder(a) {\n a(); \n}", "function count_Function() {\n document.getElementById(\"Nested_Function\").innerHTML = Count();\n function Count() {\n var Starting_point = 9;\n function Plus_one() {Starting_point += 1;}\n Plus_one();\n return Starting_point;\n }\n}", "function outer(){\n console.log(\"This is outer!\")\n function inner(){\n console.log(\"This is inner!\")\n }\n return inner\n}", "function r(e,t,a){f(function(){e(t,a)})}", "function myBigFunction() {\n var myValue = 1;\n \n subFunction1(myValue);\n subFunction2(myValue);\n subFunction3(myValue);\n}", "function foo() {\n var a = 2;\n function bar() { // bar() has lexical scope access to inner scope of foo()\n console.log( a );\n }\n return bar; // passed as a value.. return function object itself that bar references\n}", "function solution(a) {\n var add = a;\n\n function f(b) {\n add = a;\n add += b\n return add;\n }\n\n return f;\n}", "function outer() {\n const data = \"Data content\";\n function inner() {\n console.log(data);\n }\n\n return inner;\n}", "function foo() {\n\tvar a = 1;\n\n\tfunction bar() {\n\t\tvar b = 2;\n\n\t\tfunction baz() {\n\t\t\tvar c = 3;\n\n\t\t\tconsole.log( a, b, c );\t// 1 2 3\n\t\t}\n\n\t\tbaz();\n\t\tconsole.log( a, b );\t\t// 1 2\n\t}\n\n\tbar();\n\tconsole.log( a );\t\t\t\t// 1\n}", "function outerFunction (outerArg) { // begin of scope outerFunction\r\n // Variable declared in outerFunction function scope \r\n var outerFuncVar = 'x'; \r\n // Closure self-invoking function \r\n function innerFunction (innerArg) { // begin of scope innerFunction\r\n // variable declared in innerFunction function scope\r\n var innerFuncVar = \"y\"; \r\n console.log( \r\n \"outerArg = \" + outerArg + \"\\n\" +\r\n \"outerFuncVar = \" + outerFuncVar + \"\\n\" +\r\n \"innerArg = \" + innerArg + \"\\n\" +\r\n \"innerFuncVar = \" + innerFuncVar + \"\\n\" +\r\n \"globalVar = \" + globalVar);\r\n \r\n }\r\n innerFunction(5);\r\n}", "function recurse(nextID, e) {\n var nextIDTerm = types_1.int(nextID);\n var simple = function (term) { return ({\n terms: [term],\n id: nextID,\n nextID: nextID + 1\n }); };\n switch (e.type) {\n case \"Var\":\n return simple(types_1.rec(\"ast.Var\", {\n id: nextIDTerm,\n name: types_1.str(e.name),\n location: spanToDL(e.span)\n }));\n case \"StringLit\":\n return simple(types_1.rec(\"ast.StringLit\", {\n id: nextIDTerm,\n val: types_1.str(e.val),\n location: spanToDL(e.span)\n }));\n case \"IntLit\":\n return simple(types_1.rec(\"ast.IntLit\", {\n id: nextIDTerm,\n val: types_1.int(e.val),\n location: spanToDL(e.span)\n }));\n case \"Placeholder\":\n return simple(types_1.rec(\"ast.Placeholder\", { id: nextIDTerm, location: spanToDL(e.span) }));\n case \"FuncCall\": {\n var _a = recurse(nextID + 1, e.func), funcExprTerms = _a.terms, funcExprID = _a.id, nid1 = _a.nextID;\n var _b = recurse(nid1, e.arg), argExprTerms = _b.terms, argExprID = _b.id, nid2 = _b.nextID;\n return {\n terms: __spreadArrays([\n types_1.rec(\"ast.FuncCall\", {\n id: types_1.int(nextID),\n funcID: types_1.int(funcExprID),\n argID: types_1.int(argExprID),\n location: spanToDL(e.span)\n })\n ], funcExprTerms, argExprTerms),\n id: nextID,\n nextID: nid2\n };\n }\n case \"Let\": {\n var _c = recurse(nextID + 1, e.binding), bindingID = _c.id, bindingsTerms = _c.terms, nid1 = _c.nextID;\n var _d = recurse(nid1, e.body), bodyID = _d.id, bodyTerms = _d.terms, nid2 = _d.nextID;\n var overallTerm = types_1.rec(\"ast.LetExpr\", {\n id: nextIDTerm,\n varName: types_1.str(e.name.ident),\n bindingID: types_1.int(bindingID),\n bodyID: types_1.int(bodyID),\n location: spanToDL(e.span),\n varLoc: spanToDL(e.name.span),\n letLoc: spanToDL(e.letT.span),\n inLoc: spanToDL(e.inT.span)\n });\n return {\n terms: __spreadArrays([overallTerm], bindingsTerms, bodyTerms),\n id: nextID,\n nextID: nid2\n };\n }\n case \"Lambda\": {\n var _e = recurse(nextID + 1, e.body), bodyID = _e.id, nid = _e.nextID, bodyTerms = _e.terms;\n var paramTerms = e.params.map(function (param, idx) {\n return types_1.rec(\"ast.LambdaParam\", {\n lambdaID: types_1.int(nextID),\n idx: types_1.int(idx),\n name: types_1.str(param.name.ident),\n ty: types_1.str(param.ty.ident),\n location: spanToDL(param.name.span),\n typeLoc: spanToDL(param.ty.span)\n });\n });\n return {\n id: nextID,\n nextID: nid + paramTerms.length,\n terms: __spreadArrays([\n types_1.rec(\"ast.Lambda\", {\n id: nextIDTerm,\n body: types_1.int(bodyID),\n retType: types_1.str(e.retType.ident),\n numParams: types_1.int(e.params.length),\n location: spanToDL(e.span),\n retTypeLoc: spanToDL(e.retType.span)\n })\n ], bodyTerms, paramTerms)\n };\n }\n }\n}", "function outer(){\n var count=0\n function inner(){\n count+=1;\n console.log(count);\n }\n return inner\n}", "function recursion2(number){\n number+=number;\n console.log(number)\n if(number<= 0) {\n return number;\n }else if(number<300){\n recursion2(number)\n }else{\n return number;\n }\n }", "function aaa(){\n \"use strict\";\n {\n function fn(){return 10;}\n console.log(fn()); \n {\n \n function fn(){return 2;}\n function fn2(){return 3;} //try to rename in fn\n console.log(fn());\n }\n console.log(fn());\n }\n}", "function solve() {\r\n // function sum is nested/local for solve function\r\n function sum(a, b) {\r\n return a + b;\r\n }\r\n\r\n const a = 10;\r\n const b = 20;\r\n\r\n console.log(sum(a, b));\r\n}", "function solve() {\r\n // function sum is nested/local for solve function\r\n function sum(a, b) {\r\n return a + b;\r\n }\r\n\r\n const a = 10;\r\n const b = 20;\r\n\r\n console.log(sum(a, b));\r\n}", "function outer(o){\r\n console.log(o);\r\n function inner(i){\r\n console.log(o+i);\r\n }\r\n return inner;\r\n}", "function outer() {\n\tvar counter = 0; // this variable is outside incrementCounter's scope\n\tfunction incrementCounter () {\n\t\tcounter ++;\n\t\tconsole.log('counter', counter);\n\t}\n\treturn incrementCounter;\n}", "function foo2() {\n var a = 2\n\n function bar() {\n console.log(a)\n }\n return bar\n}", "function outerFunction(b){\n let x=10;\n function innerFunction(){\n console.log(x); //10\n console.log(b); //5\n }\n return innerFunction;\n}", "function second() {\r\n return third();\r\n }", "function test() {\n\n console.log(a);\n \n console.log(foo());\n \n var a = 1;\n \n function foo() {\n \n return 2;\n \n }\n \n}", "function outerFn() {\n var data = \"something from outer\";\n return function innerFn() {\n return \"Just returned from the inner function\";\n }\n}", "function foo() {\n var a = 2;\n\n function bar() {\n console.log(a);\n }\n\n return bar;\n}", "function level1() {\n // var a = '2';\n function level2a() {\n console.log(a);\n }\n console.log(a);\n\n level2a();\n }", "function outer() {\n let counter = 0; // this variable is outside incrementCounter's scope\n function incrementCounter() {\n counter++;\n console.log(\"counter\", counter);\n }\n return incrementCounter;\n}", "function intermediate() { }", "function outerFunc(outerVar) {\n const hi = \"Hi\";\n\n return function innerFunc(innerVar) {\n console.log(hi);\n console.log(\"Outer Variable: \" + outerVar);\n console.log(\"Inner Variable: \" + innerVar);\n };\n}", "function inner() {\n return num++;\n }", "function outer(){\n var outervari = \"i am an outer variable\";\n console.log(outervari);\n function inner(){\n var innervari = \"i am an inner variable\";\n console.log(innervari);\n console.log(outervari);\n }\n inner();\n console.log(outervari);\n // console.log(innervari); will produce error\n}", "function nested() { // +1 nesting, nested\n if (x) { // +1 nesting, nested\n }\n return 1; // +0\n }", "function outer1(){\n\n console.log(\"Outer function executed\");\n\n function inner1(){\n console.log(\"Inner function executed\");\n }\n\n console.log(\"Out of Outer function\");\n return inner1;\n}", "function x() {\n var variable = 10;\n function y() {\n console.log(variable);\n }\n variable = 100;\n return y;\n}", "function outerFn() {\n \n function anony(name) {\n alert(name);\n }\n return anony;\n}", "function recursiveBacktracking(v, d, counter, i2, j2){\n counter ++;\n\n //forward checking\n FC(d, v, i2, j2);\n if(findEmptyDomains(d)){\n //if we find an empty domain, just return false\n return false;\n }\n\n var result =false;\n //if assignment is complete, return assignment\n if (checkCompletion(v)) {\n return true;\n }\n\n //var<-select unassignedvariable(variables[csp], assignment , csp)\n var mrvList = MRV(d);\n var maxDegreeValue = -100;\n var mrvListIndex;\n for (i = 0; i < mrvList.length; i++) { \n var degree = getDegree(d, mrvList[i][0], mrvList[i][1]);\n if (degree > maxDegreeValue) {\n maxDegreeValue = degree;\n mrvListIndex = i;\n }\n }\n\n var selectedVariableIndex = mrvList[mrvListIndex];\n var selectedVariableDomain = d[selectedVariableIndex[0]][selectedVariableIndex[1]];\n \n if (step <= 3) {\n log(\"Step \" + step + \": <br>a) Variable selected: \" + selectedVariableIndex);\n log(\"b) Domain: {\" + selectedVariableDomain + \"} | Domain size: \" + selectedVariableDomain.length);\n log(\"c) Degree of variable selected: \" + maxDegreeValue + \"<br>\");\n step++;\n }\n\n //for each value in orderdomainvalues(var,assignment,csp)do\n for (var i = 0; i < selectedVariableDomain.length; i++) {\n //if value is consistent with assignment given Constraints[csp] then\n var currentValue = selectedVariableDomain[i];\n\n if (isConsistent(selectedVariableIndex, currentValue, d)) {\n\n vClone = createVariables();\n dClone = clone(d);\n\n\n //add{var = value} to assignment\n vClone[selectedVariableIndex[0]][selectedVariableIndex[1]] = currentValue;\n setCellValue(selectedVariableIndex[0], selectedVariableIndex[1], currentValue);\n dClone[selectedVariableIndex[0]][selectedVariableIndex[1]] = [1,1,1,1,1,1,1,1,1,1,1,1]; //assign a big domain so it will never be selected\n \n //result<-RecursiveBacktracking(assignment,csp)\n result = recursiveBacktracking(vClone, dClone, counter, selectedVariableIndex[0], selectedVariableIndex[1]);\n //if reulst != failure then return result\n if (result != false) {\n v = vClone;\n d = dClone;\n return result;\n }\n //remove {var = value} from assignment\n removeCellValue(selectedVariableIndex[0], selectedVariableIndex[1]);\n } \n } \n \n return false;\n \n}", "function question4() {\n question2('functions in functions');\n}", "function outer() {\r\n var counter = 0; // this variable is outside incrementCounter's scope\r\n function incrementCounter () {\r\n counter ++;\r\n console.log('counter', counter);\r\n }\r\n return incrementCounter;\r\n}", "function outer2(){\n function inner(){\n var innerVar = 10;\n }\n console.log(innerVar); // gives error\n}", "function outer() {\n let counter = 0; // this variable is outside incrementCounter's scope\n function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }\n return incrementCounter;\n}", "function outer() {\n let counter = 0; // this variable is outside incrementCounter's scope\n function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }\n return incrementCounter;\n}", "function inner(param){\n //the inner function can see all of the variables \n //that are declared in the enclosing function\n equal(bar, \"bar\", \"the inner function can see bar\");\n equal(foo, \"bar\", \"the inner function also see the re-assigned foo\");\n\n //the inner function can read parameters\n ok(param,\"inner has a parameter\");\n\n //the inner function can also have late references to\n //things that are declared in the scope of the caller\n ok(wayTooLate, \"late variable declaration\");\n }", "function foo() {\n var count = 0;\n\n return function f(x) {\n if (x < 3) return f(x + 1);\n count = count + x;\n return count;\n }\n}", "function f1(){\n var i=0;\n\n function f2(){\n i++;\n console.log(i);\n }\n\n function f3(){\n i--;\n console.log(i);\n }\n\n f2();f2();f2();\n \n f3(); f3(); f2();\n}", "function outside(x){\n\n function inside(y){\n let val = x + y;\n return val;\n }\n return inside;\n}" ]
[ "0.6297085", "0.6172421", "0.585512", "0.58011854", "0.5790836", "0.57587135", "0.5732692", "0.5731859", "0.5727762", "0.57265776", "0.57254916", "0.568277", "0.568035", "0.56721884", "0.56441516", "0.5633229", "0.5621746", "0.5604635", "0.5580238", "0.55555457", "0.5541005", "0.55354196", "0.552651", "0.5525007", "0.55107653", "0.55054826", "0.5494945", "0.5481711", "0.54625773", "0.5425325", "0.5411168", "0.5366109", "0.5358501", "0.53564847", "0.5341436", "0.53364617", "0.53349936", "0.5325951", "0.531817", "0.53142726", "0.5273793", "0.52710736", "0.5256859", "0.525281", "0.5248846", "0.52381647", "0.5237435", "0.522862", "0.52280587", "0.5227993", "0.5225089", "0.52229047", "0.5221825", "0.5210813", "0.5208005", "0.52045697", "0.51996154", "0.5195392", "0.519537", "0.5183249", "0.51825327", "0.518192", "0.51660913", "0.51649195", "0.5153702", "0.51533335", "0.51409376", "0.513671", "0.513525", "0.51329654", "0.5123356", "0.51078033", "0.51078033", "0.5104153", "0.51034546", "0.51017344", "0.50955904", "0.50831395", "0.50779086", "0.5077806", "0.50754005", "0.5071272", "0.5071074", "0.5065521", "0.50596416", "0.5052047", "0.50502807", "0.50502217", "0.5049518", "0.5049087", "0.50477254", "0.5046907", "0.5045147", "0.5040649", "0.5033049", "0.5029518", "0.5029518", "0.50225466", "0.5016797", "0.5014621", "0.50146043" ]
0.0
-1
(PURE RECURSION) IN PURE RECURSION, WE USAULLY DONT USE A DATA STRUCTURE TO STORE THE RESULTS, WE PERFORM THE CALCULATION AND CALL THE FUNCTION AGAIN IN THE RETURN STATEMENT ITSELF
function collectOddValues(arr) { if(arr.length == 0){ return [] } let oddArr = []; if(arr[0]%2 != 0){ oddArr.push(arr[0]) } return oddArr.concat(collectOddValues(arr.splice(1))) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateResults() {\n return;\n}", "computeResult(result) {\n }", "function performCalculation(arr, symbol1 = '*',symbol2 = '/'){\n var found = false;\n var i = 0; \n\n while(found === false && i < arr.length - 1){ //using < than, since the last symbol will always be a number because of the validation perfomed in the method 'calculate'\n if(arr[i] === symbol1 || arr[i] === symbol2){\n found = true;\n\n arr[i] = window[operations[arr[i]]](arr[i-1], arr[i+1])\n arr.splice(i+1,1); arr.splice(i-1,1);\n\n //reccursive method to continue searching for and perform the same reccursive function only if array's length is more than 1\n if(arr.length <= 1){\n return arr; //the result\n } else {\n return performCalculation(arr,symbol1,symbol2)\n }\n } \n i++; \n }\n\n // this means that this round of the while loop did not find any * or / operations, time to move to + and -\n return performCalculation(arr,'+','-');\n\n}", "function evalResults() {\n var evaluated, selected, aggregated;\n results.length = 0;\n\n // Evaluation Step\n if ( evaluator ) {\n // In this case, we need to sort between filtering and selecting\n evaluated = filter.call(source, evalObject);\n }\n else {\n // Otherwise take a snapshot of the source\n evaluated = slice.call(source, 0);\n }\n\n // Pre-Select Sorting Step\n if ( sorter && sortFirst ) sorter(ctx, evaluated);\n\n // Select Step\n if ( selector ) {\n selected = [];\n for ( var i = 0, ilen = evaluated.length; i < ilen; i++ ) {\n spliceArrayItems(selected, selector(ctx, evaluated[i]));\n }\n }\n else {\n selected = evaluated;\n }\n\n // Post-Select Sorting Step\n if ( sorter && !sortFirst ) sorter(ctx, selected);\n\n // Aggregation Step\n aggregated = aggregator ? aggregator(ctx, selected) : selected;\n\n // Splice Results\n spliceArrayItems(results, aggregated);\n\n if ( results.contains ) {\n // Calling with no arguments clears its cache\n results.contains();\n }\n }", "function myReduce(arr, callFunction , accumulator = arr[0] ){\n\n\n\n // use let instead of var\n\n // if statement to check what we are doing\n\n\n // better way to inilize?\n // how to iniilize\n\n // maybe should be recursive?\n\n\n \n\n if (arguments.length === 3){\n\n var start = 0;\n\n // if an initial value was passed we need to look\n // at the first element\n\n\n\n\n } else {\n\n\n var start = 1;\n\n // if an initial value was not passed\n // we need to look at the first element\n\n\n\n\n }\n\n\n \n for (let i = start ; i < arr.length; i++){\n\n accumulator = callFunction(accumulator, arr[i]);\n\n \n\n // not always going to be +\n // not always going to be 0\n // will work in most cases I think\n\n\n\n }\n\n\n\n return accumulator;\n\n\n\n\n\n\n\n\n\n\n\n}", "function calculateResult() {\n return function () {\n changeDivideMultiply();\n screenResult.innerHTML = eval(screenResult.innerHTML);\n };\n }", "getResult() {}", "function calculate(){}", "function doThis(arr, fn){\n // create an empty array to hold return values \n var returnArr = [];\n // loop through the fed in array and perform the fed in function on each item\n for(var i=0;i<arr.length;i++){\n //update the value of the return array with the result of performing the fed in function with the array item as argument.\n returnArr.push(fn(arr[i]));\n } \n return returnArr; \n}", "function op_results(op, recs) {\n\tif (!recs.length) return [];\n\treturn [op(recs[0])].concat(op_results(op, recs.slice(1)));\n} // op_results is usually called \"map\"", "function compute(arr) // does not check for operation priorities\n{\n let tempArr = arr.map(x=>x);\n if (tempArr.length>2){\n let rslt = 'argtttt';\n if (tempArr[1]==='+') {\n rslt = add(tempArr[0],tempArr[2]);\n }\n else if (tempArr[1]==='-') {\n rslt = substract(tempArr[0],tempArr[2]);\n }\n tempArr.splice(0,3,rslt);\n return compute(tempArr);\n }\n else return tempArr[0];\n}", "function calcAll() {\n // Iteration 1.2\n\n}", "function calculate(arr,logic){\n let output = [];\n\n for(let i = 0; i < arr.length; i++){\n //console.log(logic);\n output.push(logic(arr[i]));\n }\n\n return output;\n}", "function add(){\n let sumFunc = sumOfThirty(30, 2, 20)\n let divFunc = divideProductFunc(sumFunc, 10, 2)\n return divFunc \n }", "function arrayCalc(arr, fn) {\n var arrResult = [];\n for (var i = 0; i < arr.length; i++) {\n arrResult.push(fn(arr[i]));\n }\n return arrResult;\n}", "function arrayCalc(arr, fn) {\n var arrResult = [];\n for (var i = 0; i < arr.length; i++) {\n arrResult.push(fn(arr[i]));\n }\n return arrResult;\n}", "function obtenerResultados(funcion, arr) {\n\tif (arr.length === 0) {\n\t\tthrow new Error(\n\t\t\t\"No se ingresaron números a operar\"\n\t\t);\n\t} else if ((arr.length % 2) !== 0) {\n\t\tthrow new Error(\n\t\t\t\"Se esperaba un número par de elementos para operar, \" + \n\t\t\t\"pero se ingresaron: \" + arr.length\n\t\t);\n\t} else {\n\t\tvar arrayOper = [];\n\t\tarr.reduce(function(valorPrevio, valorActual, indice, array) {\n\t\t\t//console.log(valorPrevio, valorActual) // Validación del funcionamiento del reduce()\n\t\t\tarrayOper.push(funcion(valorPrevio, valorActual));\n\t\t\treturn valorActual;\n\t\t});\n\t\tvar arrayResultado = [];\n\t\tfor (var i = 0; i < arrayOper.length; i += 2) {\n\t\t\tarrayResultado.push(arrayOper[i]);\n\t\t}\n\t\treturn arrayResultado;\n\t\t//return arrayOper; // Retorno si se multiplican todos los pares de elementos del array\n\t}\n}", "function doComputation(){\n let computation;\n const prev = parseFloat(previousOperand);\n const current = parseFloat(currentOperand);\n\n if(isNaN(prev) || isNaN(current)) return;\n switch(operation){\n case '+':\n computation=prev + current;\n break;\n case '-':\n computation=prev - current;\n break;\n case 'x':\n computation=prev * current;\n break;\n case '/':\n computation= prev / current;\n break;\n default :\n return;\n }\n\n currentOperand=computation;\n operation=undefined;\n previousOperand=''; \n}", "function arrayCalc(arr, fn) {\r\n var arrRes = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n arrRes.push(fn(arr[i]));\r\n }\r\n return arrRes;\r\n}", "function calculate(array) {\r\n array = multiAndDiv(array);\r\n array = addAndSub(array);\r\n return array;\r\n}", "function complicated () {\n console.log(multiply(return4(), 8));\n}", "function calculate() {\r\n if (operator) {\r\n if (!result) return; //To prevent errors when there's no operand\r\n nextVal = result;\r\n result = calculation();\r\n prevVal = result;\r\n } else if(result){\r\n prevVal = result;\r\n }\r\n displayResult();\r\n result = ''; //To empty the display for new operand\r\n}", "function part2(data) {\n let product = 1;\n product *= walk(data, 1, 1);\n product *= walk(data, 3, 1);\n product *= walk(data, 5, 1);\n product *= walk(data, 7, 1);\n product *= walk(data, 1, 2);\n return product;\n}", "function calculate(initial_age, initial_nest_egg, initial_salary, annual_contrib_percent, \n retire_age, annual_nest_egg_grow_percent, lame_age, death_age, \n active_years_income, lame_years_income) {\n \n /* Order of operations\n * \n * Not retired\n * - Increase salary by percent\n * - Make contribution from salary\n * - Compound the interest\n * \n * Retired\n * - Draw from nest egg\n * - Compound the interest\n */\n \n var returnData = [];\n var current_nest_egg = initial_nest_egg;\n var current_salary = initial_salary;\n \n for (var age = initial_age + 1; age <= death_age; age++) {\n var nest_egg_draw = 0;\n var actual_nest_egg_draw = 0;\n var is_retired = age >= retire_age ? true : false\n \n // Yearly salary increase\n current_salary = age >= retire_age ? 0 : current_salary + (current_salary * 0.02)\n \n // Annual contribution from salary at start of compounding period\n var contribution = age >= retire_age ? 0 : current_salary * annual_contrib_percent;\n current_nest_egg += contribution;\n \n // Draw from nest egg if retired\n if (age >= retire_age && age < lame_age) { // in active retirement years\n var rmd = getRmd(age, current_nest_egg);\n nest_egg_draw = active_years_income > rmd ? active_years_income : rmd \n } else if (age >= retire_age && age >= lame_age) { // in lame years\n var rmd = getRmd(age, current_nest_egg);\n nest_egg_draw = lame_years_income > rmd ? lame_years_income : rmd;\n }\n \n if (current_nest_egg < nest_egg_draw) {\n actual_nest_egg_draw = current_nest_egg;\n } else {\n actual_nest_egg_draw = nest_egg_draw;\n }\n current_nest_egg -= actual_nest_egg_draw;\n \n // Set nestegg to 0 if we've gone below 0\n if (current_nest_egg < 0) {\n current_nest_egg = 0;\n }\n \n // Compute interest and add to total\n var interest = current_nest_egg * annual_nest_egg_grow_percent;\n current_nest_egg += interest;\n \n var yearData = {age: age, retired: is_retired, salary: round2(current_salary),\n contrib: round2(contribution), draw: actual_nest_egg_draw, interest: round2(interest),\n nest_egg: round2(current_nest_egg)\n };\n \n returnData.push(yearData);\n }\n \n return returnData;\n}", "function myReduceFunc() {\n \n\n\n}", "function reduce(arr, func) {\n\n //vzimame purviq element\n let result = arr[0];\n\n //obhojdame ostanalite elementi\n for(let nextElement of arr.splice(1))\n result = func(result, nextElement);\n //prilagame funkciqta kato podavame purviq element i sledvahtiq\n //kato promenqme purviq element, i posle produljavame napred\n\n //vrushtame rezultata\n return result;\n}", "function findFirstResult(inputs, getResult) {\n for (const element of inputs) {\n const result = getResult(element);\n if (result !== undefined) {\n return result;\n }\n }\n return undefined;\n}", "function sum(num1, num2) {\n\tvar result =0 ;\n\tvar temp = [num1, num2];\n\t//console.log(temp);\n\tvar i=0; \n\n \n\n\tfunction inner(result, temp, i){\n\n\t\t//console.log(result);\n \n\t\tif (i === temp.length ){\n \treturn result;\n\n } else {\n\n result = result + temp[i];\n return inner(result, temp, i+1);\n\n }\n \n\t}\n\n\treturn inner(result, temp, i);\n\n}", "function calcular() {\n num2 = obtenerResultado();\n resolver();\n}", "function agregateFunc ( row, aggr, value, curr) {\r\n\t\t\t\t// default is sum\r\n\t\t\t\tvar arrln = aggr.length, i, label, j, jv;\r\n\t\t\t\tif($.isArray(value)) {\r\n\t\t\t\t\tjv = value.length;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tjv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tmember = [];\r\n\t\t\t\tmember.root = 0;\r\n\t\t\t\tfor(j=0;j<jv;j++) {\r\n\t\t\t\t\tvar tmpmember = [], vl;\r\n\t\t\t\t\tfor(i=0; i < arrln; i++) {\r\n\t\t\t\t\t\tif(value == null) {\r\n\t\t\t\t\t\t\tlabel = $.trim(aggr[i].member)+\"_\"+aggr[i].aggregator;\r\n\t\t\t\t\t\t\tvl = label;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tvl = value[j].replace(/\\s+/g, '');\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tlabel = (arrln === 1 ? vl : vl+\"_\"+aggr[i].aggregator+\"_\"+i);\r\n\t\t\t\t\t\t\t} catch(e) {}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcurr[label] = tmpmember[label] = calculation( aggr[i].aggregator, curr[label], aggr[i].member, row);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmember[vl] = tmpmember;\r\n\t\t\t\t}\r\n\t\t\t\treturn curr;\r\n\t\t\t}", "function reduce(arr, reduceFct, start) {\nvar sum = start; //before it was 0\n\n// iterate thru the initial array\n//need a variable to store the sum\nfor (var element of arr) {\n sum = reduceFct(sum, element);\n}\nreturn sum;\n}", "function element(arr, gen){ //should take an array and a generator\n if(gen){\n return() => arr[gen()] //return a function that will collect the results in the array\n }else{ //second argument should be optional\n let counter = -1\n return function (){ //produce elements from the array\n counter++\n return arr[counter]\n }\n } // not sure what's happening here\n\n}", "function arrayCalc(array, fn) {\n var result = [];\n array.forEach(element => {\n result.push(fn(element));\n });\n return result;\n}", "function calcResult() {\n \n /* This conditional deals with cases where there is no operation to perform.\n * Notice that if 1st operand is stored an operation was already chosen and 2nd operand is at least 0 by default\n * And that if NaN flag is found, the user has just pressed the operation button and there's no 2nd operand \n * The function is just left, but operands and currentOperation remain stored, allowing calculation to continue */ \n if (numbers[0] === \"\" || Number.isNaN(currentNumber)) {\n return;\n }\n\n //2nd operand is stored in numbers\n assignPosition(currentNumber);\n \n //Operands are removed and result is added in numbers by calling the execution of currentOperation\n numbers = [\"\", \"\", currentOperation()];\n\n displayResult();\n\n}", "function evaluate(criterios){\n for(let criterio of criterios){\n let modelo = criterio.notas.modelo\n let resultado = criterio.resultado\n \n /*\n #1\n modelo: {\n peso: 1,\n intervalo: {\n tipo: discreto,\n valor: [0, 5]\n }\n }\n resultado: 3\n \n #2\n modelo: {\n peso: 2,\n lista: [{\n texto: Danificada,\n valor: -1\n }, {...}, ...]\n }\n resultado: [0, 3]\n\n #3\n modelo: {\n peso: 2,\n boleano: {\n texto: Pets,\n valor: true/false\n }\n }\n resultado: true\n */\n \n let normal;\n if(modelo.intervalo){\n normal = (resultado - modelo.intervalo.valor[0])/(modelo.intervalo.valor[1] - modelo.intervalo.valor[0])\n }else if(modelo.booleano){\n normal = +(resultado == modelo.booleano.valor) * modelo.booleano.peso\n }else if(modelo.lista){\n let soma = modelo.lista.filter((v, i) => {\n return i in resultado\n }).reduce((acc, cur) => {\n return acc + cur.valor\n }, 0)\n let lista_ordenada = modelo.lista.sort((a, b) => a.valor - b.valor)\n let len_lista = modelo.lista.length\n \n let minimo = lista_ordenada[0].valor\n let maximo = lista_ordenada[len_lista-1].valor\n \n normal = (soma - minimo) / (maximo - minimo)\n }\n \n criterio.normal = normal\n criterio.normal_ponderada = normal * modelo.peso \n }\n \n let peso_total = criterios.reduce((acc, cur) => {\n return acc + cur.notas.peso\n }, 0)\n let nota_normal_ponderada_total = criterios.reduce((acc, cur) => acc + cur.normal_ponderada, 0)\n \n let nota_final = nota_normal_ponderada_total / peso_total\n \n return {\n final: nota_final,\n criterios: criterios.map(c => {\n return {\n resultado: c.resultado,\n normal: c.normal,\n peso: c.notas.peso,\n ponderada: c.ponderada\n }\n })\n }\n }", "function calculateResult(array) {\n let answer1 = array[0] * 12;\n let answerModified = turnToNumber(1);\n console.log(\"answerModified\", answerModified);\n let answer2 = (answer1 * answerModified) / 100 + answer1;\n console.log(\"answer2\", answer2);\n let terminalValue = answer2 * 2;\n console.log(\"treminalValue\", terminalValue);\n let postMV = terminalValue / 20;\n console.log(\"postMV\", postMV);\n let preMV = postMV - array[0];\n console.log(\"preMV\", preMV);\n let answerThreeModified = turnIndexToNumber(2);\n let answer3 = (answerThreeModified * 30) / 10000;\n console.log(\"answer3\", answer3);\n let answerFourModified = turnIndexToNumber(3);\n let answer4 = (answerFourModified * 25) / 10000;\n let answerFiveModified = turnIndexToNumber(4);\n let answer5 = (answerFiveModified * 15) / 10000;\n let answerSixModified = turnIndexToNumber(5);\n let answer6 = (answerSixModified * 10) / 10000;\n let answerSeventhModified = turnIndexToNumber(6);\n let answer7 = (answerSeventhModified * 10) / 10000;\n // //figure out how to make it prettier\n let answer81 = (answerSeventhModified * 100) / array[0];\n let answer8 = (answer81 * 5) / 10000;\n let answer9 = (array[8] * 5) / 10000;\n let sumOfFactors =\n answer3 + answer4 + answer5 + answer6 + answer7 + answer8 + answer9;\n let preFinalResult = sumOfFactors * preMV;\n //this is THE RESULT\n let finalResult = parseFloat(preFinalResult.toFixed(2));\n // console.log(\"sumOfFactors\", sumOfFactors)\n return finalResult;\n}", "function calculateResults(input, ratings){\n if (input.length === 1) {\n return input[0];\n } else {\n let count = 1;\n while (count < 5) {\n if (ratings.includes(count)) {\n let location = ratings.indexOf(count);\n let operator = input[location];\n let x = Number(input[location - 1]);\n let y = Number(input[location + 1]);\n let result = operations[operator](x, y);\n input.splice(location - 1, 3, result);\n ratings.splice(location - 1, 3, 0);\n return calculateResults(input, ratings);\n }\n count++;\n }\n }\n }", "function calcular(x) {\n return function(y) {\n return function(fn) {\n return fn(x, y)\n }\n }\n}", "function resultPageCalc() {\n const retAge = 58;\n const lifeExpectAge = 90;\n const inflationRate = 0.045;\n const expReturnsRate = 0.055;\n\n let yearsTillRet = retAge - curAgeVal;\n let postRetAge = lifeExpectAge - retAge;\n let expMultiAfterRet = 1;\n switch (rpRetireType) {\n case 'spending_more':\n expMultiAfterRet = (1 + 0.2); //expense increased by 20%\n break;\n case 'spending_less':\n expMultiAfterRet = (1 - 0.2); //expense decreased by 20%\n break;\n case 'spend_same':\n expMultiAfterRet = 1;\n break;\n default:\n break;\n }\n let postAnnualExp = rpExpenseVal * expMultiAfterRet * 12;\n let postAnnualExpPlusInfl = postAnnualExp * (Math.pow((1 + inflationRate), yearsTillRet));\n\n let reqCorpus = 0;\n //calculating net present value of customers post retirement expense\n for (i = 0; i < postRetAge; i++) {\n let thisYrAnnExp = ((i === 0) ? postAnnualExpPlusInfl : (postAnnualExpPlusInfl * (1 + inflationRate)));\n let presValPostRetExp = presentValue(expReturnsRate, i, thisYrAnnExp);\n reqCorpus += presValPostRetExp;\n }\n\n const percVsInvProf = { risk_averse: 0.06, conservative_type: 0.066, balanced_type: 0.076, growth_type: 0.088, aggressive_type: 0.096 };\n\n let totalInvest = (rpRetSavedVal + (rpMonthlySaveVal * 12 * yearsTillRet)) * (Math.pow((1 + percVsInvProf[rpInvestType]), yearsTillRet));\n\n let gapAmtPendingToSave = reqCorpus - totalInvest;\n\n let score = Math.round(((gapAmtPendingToSave <= 0) ? 1 : (totalInvest / reqCorpus)) * 100);\n\n let monthInvNeed = ((gapAmtPendingToSave <= 0) ? 0 : (PMT((percVsInvProf[rpInvestType] / 12), (yearsTillRet * 12), (gapAmtPendingToSave * (-1)))));\n\n const scoreArr = [65, 80, 95, 100];\n\n const statArr = [\n { heading: \"Your retirement score <strong>Needs Your Attention</strong>\", body: \"You are falling behind in planning your retirement. In order to relive life without any worries, we can make your wealth do the hard work.\" },\n { heading: \"Your retirement score is <strong>Fair</strong>\", body: \"While you are on the right track, you still need help in planning your retirement better! With our help, you can make your wealth do the hard work and relive life on your own terms.\" },\n { heading: \"Your retirement score is <strong>Good</strong>\", body: \"While you are saving enough for your retirement, you can still make your wealth do the hard work and relive life on your own terms.\" },\n { heading: \"Your retirement score is <strong>On Target</strong>\", body: \"Congratulations! You have planned your retirement right. But there is always scope for improvement! With our help, you can make your wealth do the hard work and relive life on your own terms.\" }\n ];\n const ageMsgArr = [\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can meet your aspirations with our curated investment portfolios, customized as per your investment behavior and get a lot more benefits.\" },\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can do goal based investments, consolidate and optimize investments, get a single view for easy investment tracking and enjoy a lot more benefits.\" },\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can manage your corpus efficiently, ensure a smooth transition from employer benefits, avail pension management services and get a lot more.\" },\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can rebalance your investments, do legacy planning, enjoy retirement benefits across lifestyle, healthy living and a lot more.\" }\n ];\n const colorArr = ['#FF4A42', '#FFB74A', '#BAD22F', '#58951D'];\n let scoreArrIndex = 0;\n\n scoreArr.some((item, index) => {\n if (score <= item) {\n scoreArrIndex = index;\n return true;\n }\n });\n\n $(\"#rp-score\").html(score);\n $(\"#rp-score\").css(\"color\", colorArr[scoreArrIndex]);\n // $(\"#rp-score-place\").css(\"left\", score + \"%\");\n $(\"#rp-score-place\").css(\"transform\", `rotate(${(score * 3.6) - 16}deg)`);\n\n $(\"#score-heading\").html(statArr[scoreArrIndex][\"heading\"]);\n $(\"#score-body\").html(statArr[scoreArrIndex][\"body\"]);\n\n $(\"#age-msg-body\").html(ageMsgArr[ageArrIndex][\"body\"]);\n\n $(\"#rp-corpus\").html(`₹ ${globalizeAmt(Math.round(reqCorpus))}`);\n $(\"#rp-invest-ret\").html(`₹ ${globalizeAmt(Math.round(totalInvest))}`);\n // $(\"#rp-pending-corpus\").html(`₹ ${globalizeAmt(Math.round(reqCorpus - totalInvest))}`);\n // $(\"#rp-month-invest\").html(`₹ ${globalizeAmt(Math.round(monthInvNeed))}`);\n }", "function walkThrough(program) {\n var workingProgram = program.slice();\n \n for (var i = 0; i < workingProgram.length; ) {\n \n if (workingProgram[i] === 1) {\n var value1 = workingProgram[i + 1];\n var value2 = workingProgram[i + 2];\n var result = workingProgram[i + 3];\n \n workingProgram[result] = workingProgram[value1] + workingProgram[value2];\n i += 4;\n }\n \n if (workingProgram[i] === 2) {\n var value1 = workingProgram[i + 1];\n var value2 = workingProgram[i + 2];\n var result = workingProgram[i + 3];\n \n workingProgram[result] = workingProgram[value1] * workingProgram[value2];\n i += 4;\n }\n \n if (workingProgram[i] === 99) {\n return workingProgram;\n }\n }\n \n}", "calc(){\n let lastIndex =\"\";\n //armazenando o ultimo operador\n this._lastOperator = this.getLastItem(true);\n\n if(this._operation.length < 3){\n let firstNumber = this._operation[0];\n this._operation =[];\n this._operation = [firstNumber, this._lastOperator, this._lastNumber];\n }\n\n //arrumando para quando o método for chamado pelo sinal de igual =\n if(this._operation.length > 3){\n\n lastIndex = this._operation.pop();\n //armazenando o ultimo número digitado na calcl\n this._lastNumber = this.getResult();\n\n }else if(this._operation.length == 3){\n //armazenando o ultimo número digitado na calcl\n this._lastNumber = this.getLastItem(false);\n }\n\n //transforma um vetor em uma string, usando um separador, qo separador é definido pelo parametro passado no método\n let result = this.getResult();\n\n if(lastIndex == \"%\"){\n result /= 100;\n this._operation = [result];\n }else{\n this._operation =[result];\n //se o ultimo index for diferente de vazio, então adiciona ele no vetor\n if(lastIndex){\n this._operation.push(lastIndex);\n }\n \n }\n this.setLastNumberToDisplay();\n \n }", "function helper(word, symbols, elements, weight) {\n console.log(\"HELPER RECURSIVE FUNC\", word, symbols, elements, weight);\n\n if(word.length === 0){\n return results.push({\n output: `${symbols} (${elements.join(', ')})`,\n weight: weight.toFixed(2)\n })\n }else{\n [1,2]\n .filter((numChars) => word.length - numChars >= 0)\n .map((numChars) =>\n getSymbol(word, numChars)\n )\n .filter((symbol) => ELEMENTS[symbol])\n .forEach((symbol) =>\n helper(\n word.substring(symbol.length),\n symbols + symbol,\n elements.concat(ELEMENTS[symbol].name),\n weight + ELEMENTS[symbol].weight\n )\n )\n }\n }", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // so I have to make sure that I have returned in here this property", "function calcular(x) {\n return function (y) {\n return function (fn) {\n return fn(x, y)\n }\n }\n}", "function solutionr(state, array, result) {\n console.log(\"it started\");\n\n if (!result){\n var result = state;\n }\n\n var newObject = {};\n Object.keys(array[0]).forEach(function(key) {\n if (key != \"name\"){\n newObject[key] = array[0][key];\n\n }\n })\n\n state[array[0][\"name\"]] = newObject;\n\n if (array[1]){\n solutionr(newObject, array.slice(1), result);\n }else{\n console.log(JSON.stringify(result));\n return result;\n }\n}", "function calculate(input1,input2,inputN)\r\n{\r\n\t\r\n\treturn output;\r\n}", "getRelatedRecords(results, dataStore){\n const relationships = this.relationships;\n let cnt = 0, finalCnt = 0; \n if(relationships && relationships.length > 0 ){\n results.map(result => { \n relationships.map(relation=>{\n cnt = 0;\n let relatedStore = dataStore[relation.model];\n let key = (relation.in_current === true) ? relation.primary_key : relation.foreign_key;\n let val = (relation.in_current === true) ? result[relation.foreign_key] : result[relation.primary_key];\n let items = this.getRelatedValue(relatedStore,key,val);\n items.map(item => {\n cnt++;\n let k = `${[relation.model]}_${cnt}`;\n if(k in result){\n cnt = finalCnt+1;\n }\n k = `${[relation.model]}_${cnt}`;\n //result[[relation.model]] = item[relation.return_value];\n result[k] = item[relation.return_value];\n finalCnt = cnt;\n }); \n }); \n });\n }\n return results;\n }", "function calculation(value1, value2) {\r\n let totalSum = value1 + value2 + value1*value2;\r\n let totalSum2 = value1 / value2;\r\n return [totalSum, totalSum2];\r\n}//return multiple values, using array", "function deductions(nssf, paye) // I have named this function \"deductions\", and given it 2 parameters namely nssf and paye\n{\n let deductions = nssf(1000000)+ paye(1000000); // I have assigned arguments to these nested functions apye and nssf\n console.log(deductions)\n\n return deductions\n}", "function evalExp(arr) {\n //Base case: When arr is length 1, return the value it contains.\n if(arr.length === 1){\n return Number.parseFloat(arr.pop());\n }\n //Calculate mult. and div. first.\n if (arr.includes('*') || arr.includes('/')){\n for (let i = 0; i < arr.length; i++){\n //Replace '*' and number on either side with their product or\n //replace '/' and numbers on either side with their quotient.\n //Recursively pass new array.\n if(arr[i] === '*'){\n return evalExp(arr.slice(0, i-1).concat(arr[i-1]*arr[i+1]).concat(arr.slice(i+2, arr.length)));\n }\n else if (arr[i] === '/'){\n return evalExp(arr.slice(0, i-1).concat(arr[i-1]/arr[i+1]).concat(arr.slice(i+2, arr.length)));\n }\n }\n }\n //Next evaluate addition and subtraction in same manner as above.\n else if (arr.includes('+') || arr.includes('-')){\n for (let i = 0; i < arr.length; i++){\n if(arr[i] === '+'){\n return evalExp(arr.slice(0, i-1).concat(arr[i-1]+arr[i+1]).concat(arr.slice(i+2, arr.length)));\n }\n else if (arr[i] === '-'){\n return evalExp(arr.slice(0, i-1).concat(arr[i-1]-arr[i+1]).concat(arr.slice(i+2, arr.length)));\n }\n }\n\n }\n\n\n}", "function helper(index,intermediate){\r\n return index===0 ? intermediate : helper(index-1,intermediate + index * (index + 1));\r\n }", "function generateResult() {\n if (firstNumb && operator && !toBeCleaned && !secondNumb) {\n setNumbers(getDisplayValue());\n return operate(Number(firstNumb), Number(secondNumb), operator);\n } else {\n return false;\n };\n}", "do_calculation( bunch_of_numerical_data)\n {\n var total = 0 ;\n bunch_of_numerical_data.forEach(element => {\n total += element\n });\n return total ;\n }", "function repearFirstClassFunction() {\n let years = [1990, 1965, 1937, 2005, 1998];\n\n function arrCalc(arr, fn) {\n let arrResult = [];\n for (let i = 0; i < arr.length; i++)\n arrResult.push(fn(arr[i]));\n return arrResult;\n }\n\n function calculateAge(el) {\n return 2019 - el;\n }\n\n function isFullAge(el) {\n return el >= 18;\n }\n\n function maxHeartRate(el) {\n if (el >= 18 && el <= 81)\n return Math.round(206.9 - (0.67 * el));\n else\n return -1;\n }\n\n let ages = arrCalc(years, calculateAge);\n let fullAges = arrCalc(ages, isFullAge);\n let rates = arrCalc(ages, maxHeartRate);\n console.log(ages, fullAges, rates);\n\n function interviewQuestion(job) {\n if (job === 'designer') {\n return (name) => {\n console.log(name + ', can you please explain what UX design is?');\n }\n } else if (job === 'teacher') {\n return (name) => {\n console.log('What subject do you teach, ' + name + '?');\n }\n } else {\n return (name) => {\n console.log('Hello ' + name + ', what do you do?');\n }\n }\n }\n let teacherQuestion = interviewQuestion('teacher');\n let designerQuestion = interviewQuestion('designer');\n teacherQuestion('John');\n designerQuestion('John');\n interviewQuestion('developer')('Mark');\n}", "function intermediate() { }", "function evaluate(indexStart, indexEnd, operators, operands) {\r\n\r\n for (var index = indexStart; index < indexEnd; index++) {\r\n\r\n var indexFirstOperand = index\r\n var indexNextOperand = index + 1\r\n var indexNextOperator = index\r\n\r\n if (operators[indexNextOperator] == null) {\r\n for (var indexNext = indexNextOperator + 1; indexNext < operators.length; indexNext++) {\r\n if (operators[indexNext] != null) {\r\n indexNextOperator = indexNext\r\n indexFirstOperand = indexNext\r\n indexNextOperand = indexNext + 1\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n if (operands[indexNextOperand] == null) {\r\n for (var indexNext = indexNextOperand + 1; indexNext < operands.length; indexNext++) {\r\n if (operands[indexNext] != null) {\r\n indexNextOperand = indexNext\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n // MULTIPLICATION \r\n if (operators[indexNextOperator] == '*') {\r\n result = operands[indexFirstOperand] * operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n // DIVISION\r\n else if (operators[indexNextOperator] == '/') {\r\n result = operands[indexFirstOperand] / operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n }\r\n\r\n // ADDITION and SUBSTRACTION\r\n for (var index = indexStart; index < indexEnd; index++) {\r\n\r\n var indexFirstOperand = index\r\n var indexNextOperand = index + 1\r\n var indexNextOperator = index\r\n\r\n if (operators[indexNextOperator] == null) {\r\n for (var indexNext = indexNextOperator + 1; indexNext < operators.length; indexNext++) {\r\n if (operators[indexNext] != null) {\r\n indexNextOperator = indexNext\r\n indexFirstOperand = indexNext\r\n indexNextOperand = indexNext + 1\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n if (operands[indexNextOperand] == null) {\r\n for (var indexNext = indexNextOperand + 1; indexNext < operands.length; indexNext++) {\r\n if (operands[indexNext] != null) {\r\n indexNextOperand = indexNext\r\n index = indexNext - 1\r\n break\r\n }\r\n }\r\n }\r\n\r\n // ADDITION \r\n if (operators[indexNextOperator] == '+') {\r\n result = operands[indexFirstOperand] + operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n // SUBSTRACTION\r\n else if (operators[indexNextOperator] == '-') {\r\n result = operands[indexFirstOperand] - operands[indexNextOperand]\r\n\r\n operands[indexNextOperand] = result\r\n operands[indexFirstOperand] = null\r\n operators[indexNextOperator] = null\r\n finalResult = result\r\n result = 0\r\n\r\n console.log(operands)\r\n console.log(operators)\r\n }\r\n }\r\n return finalResult\r\n}", "function iter$$1(f, xs) {\n for(var i = 0 ,i_finish = xs.length - 1 | 0; i <= i_finish; ++i){\n f(xs[i]);\n }\n return /* () */0;\n}", "function someLogicThatCalculatesState(x){\n console.log(\"[someLogicThatCalculatesState] working with data: \"+x);\n return {\"result\":x+50};\n }", "function compose(arr, fn, initial) {\r\n var total = initial;\r\n for( var i=0; i<arr.length; i++) {\r\n total = fn(total, arr[i]);\r\n }\r\n return total;\r\n}", "valueOf() {\n if (this.changed) {\n // check if the dependency is safe before evaluation\n this.dependencyOnList.forEach(d => {\n // check if there is a cycle after adding\n let visited = new Set();\n let toVisit = new Set();\n if (this.hasLoop(d, visited, toVisit)) {\n throw \"There is a loop from a dependency on \" + d.object.constructor.name + \".\" + d.propertyName;\n }\n });\n\n // re-evaluate our list of dependencies to feed\n // into the the provided function\n var params = this.dependencyOnList.map(d => d.object[d.propertyName]);\n // console.log(\"eval\")\n // console.log(params);\n\n this.value = this.func(...params);\n this.changed = false;\n }\n return this.value;\n }", "function passTesting(arr, func) {\n // let new_array = [];\n\n // Let's try this with a simple for() loop // *** THIS WORKS BUT LETS IMPROVE IT ***\n // for(let i = 0; i < arr.length; i++) {\n // let result = func(arr[i]);\n // if(result == true) {\n // new_array.push(arr[i]);\n // }\n // }\n // return the NEW_ARRAY\n\n // ** This is how we can use higher order functions and improve the above code\n let new_array = arr.filter( elem => func(elem));\n \n console.log(new_array);\n return new_array;\n}", "calculate(modify) {\n return this.total = [].slice.call(arguments, 1)\n .reduce((total, y) => modify(total, y), this.total);\n }", "function\nmap0$fopr_2343_(a5x1)\n{\nlet xtmp57;\n;\n{\nxtmp57 = a1x2(a5x1);\n}\n;\nreturn xtmp57;\n}", "function myReduce(array, func, initial) {\n var value, index;\n \n if (initial) {\n value = initial;\n index = 0;\n } else {\n value = array[0];\n index = 1;\n }\n \n array.slice(index).forEach(function(element) {\n value = func(value, element);\n });\n \n return value;\n}", "function recursion(some) {\n return some[0] + recursion(some.slice(1));\n //keep breaking it smaller and returning\n }", "function getResult(list, counter) {\n\tlet pro = list.slice(11);\n\tlet symp = list.slice(0, 5);\n\n\t//symptomes positive\n\n\tlet fievre = list[0] === 'oui';\n\tlet toux = list[2] === 'oui';\n\tlet malGorge = list[4] === 'oui';\n\tlet courbatures = list[3] === 'oui';\n\tlet diarrhee = list[5] === 'oui';\n\n\t//symptomes négatives\n\n\tlet noFievre = list[0] === 'non';\n\tlet noToux = list[2] === 'non';\n\tlet noMalGorge = list[4] === 'non';\n\tlet noCourbatures = list[3] === 'non';\n\tlet noDiarrhee = list[5] === 'non';\n\n\t//pas de symptomes\n\n\tlet noSypms = !symp.includes('oui');\n\n\t//facteurs pronostiques\n\n\tlet facteurPro = pro.includes('oui');\n\tlet nofacteurPro = !pro.includes('oui');\n\n\t//gravité mineures positives\n\n\tlet highTemp = list[1] > 39;\n\tlet exhausted = list[7] === 'oui';\n\tlet sickness = list[10] === 'fatigué' || list[10] === 'trop-fatigué';\n\n\t//gravité mineures négatives\n\n\tlet nohighTemp = list[1] < 39;\n\tlet noexhausted = list[7] === 'non';\n\tlet nosickness = list[10] === 'bien' || list[10] === 'moyen';\n\n\t// gravité majeures positives\n\n\tlet lowTemp = list[1] < 35.4;\n\tlet geneResp = list[9] === 'oui';\n\tlet foodDiff = list[8] === 'oui';\n\n\t// gravité majeures négatives\n\n\tlet nolowTemp = list[1] > 35.4;\n\tlet nogeneResp = list[9] === 'non';\n\tlet nofoodDiff = list[8] === 'non';\n\n\t// paramétres\n\n\tlet age = list[11];\n\n\tif (counter === 13 && age < 15) {\n\t\tcircles[1].style.display = 'none';\n\t\tcircles[2].style.display = 'block';\n\t\tquestions.classList.remove('visible');\n\t\tprogress.classList.remove('flex');\n\t\tresultat.style.display = 'block';\n\n\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t'Prenez contact avec votre médecin généraliste au moindre doute. Cette application n’est pour l’instant pas adaptée aux personnes de moins de 15 ans. En cas d’urgence, appeler le 15';\n\t}\n\n\tif (counter === 24) {\n\t\tcircles[1].style.display = 'none';\n\t\tcircles[2].style.display = 'block';\n\t\tquestions.classList.remove('visible');\n\t\tprogress.classList.remove('flex');\n\t\tresultat.style.display = 'block';\n\n\t\tif (fievre || (toux && malGorge) || (toux && courbatures)) {\n\t\t\tif (lowTemp || geneResp || foodDiff) {\n\t\t\t\tresultat.children[1].lastElementChild.textContent = 'veuillez appeler le numéro 141';\n\t\t\t} else if (\n\t\t\t\t(facteurPro &&\n\t\t\t\t\tnogeneResp &&\n\t\t\t\t\tnofoodDiff &&\n\t\t\t\t\tnolowTemp &&\n\t\t\t\t\t((highTemp && exhausted && sickness) ||\n\t\t\t\t\t\t(highTemp && exhausted) ||\n\t\t\t\t\t\t(exhausted && sickness) ||\n\t\t\t\t\t\t(highTemp && sickness))) ||\n\t\t\t\t(facteurPro && nogeneResp && nofoodDiff && nolowTemp && highTemp && noexhausted && nosickness) ||\n\t\t\t\t(facteurPro && nogeneResp && nofoodDiff && nolowTemp && exhausted && nohighTemp && nosickness) ||\n\t\t\t\t(facteurPro && nogeneResp && nofoodDiff && nolowTemp && sickness && nohighTemp && noexhausted)\n\t\t\t) {\n\t\t\t\tresultat.children[1].lastElementChild.textContent = 'veuillez appeler le numéro 141';\n\t\t\t} else if (facteurPro && nohighTemp && noexhausted && nosickness && nogeneResp && nofoodDiff && nolowTemp) {\n\t\t\t\tresultat.children[1].firstElementChild.textContent =\n\t\t\t\t\t'téléconsultation ou médecin généraliste ou visite à domicile ';\n\t\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t\t'appelez le 141 si une gêne respiratoire ou des difficultés importantes pour s’alimenter ou boire pendant plus de 24h apparaissent';\n\t\t\t} else if (\n\t\t\t\t(age > 50 &&\n\t\t\t\t\tage <= 69 &&\n\t\t\t\t\t(nofacteurPro && nohighTemp && noexhausted && nosickness && nogeneResp && nofoodDiff && nolowTemp)) ||\n\t\t\t\t(nofacteurPro && nolowTemp && nogeneResp && nofoodDiff && (highTemp || exhausted || sickness))\n\t\t\t) {\n\t\t\t\tresultat.children[1].firstElementChild.textContent =\n\t\t\t\t\t'téléconsultation ou médecin généraliste ou visite à domicile ';\n\t\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t\t'appelez le 141 si une gêne respiratoire ou des difficultés importantes pour s’alimenter ou boire pendant plus de 24h apparaissent';\n\t\t\t} else if (\n\t\t\t\tage < 50 &&\n\t\t\t\tnofacteurPro &&\n\t\t\t\tnohighTemp &&\n\t\t\t\tnoexhausted &&\n\t\t\t\tnosickness &&\n\t\t\t\tnogeneResp &&\n\t\t\t\tnofoodDiff &&\n\t\t\t\tnolowTemp\n\t\t\t) {\n\t\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t\t'nous vous conseillons de rester à votre domicile et de contacter votre médecin en cas d’apparition de nouveaux symptômes. Vous pourrez aussi utiliser à nouveau l’application pour réévaluer vos symptômes';\n\t\t\t} else {\n\t\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t\t'Votre situation ne relève probablement pas du Covid-19. N’hésitez pas à contacter votre médecin en cas de doute. Vous pouvez refaire le test en cas de nouveau symptôme pour réévaluer la situation. Pour toute information concernant le Covid-19 allez vers la page d’accueil.';\n\t\t\t}\n\t\t} else if (\n\t\t\t(fievre && noToux && noDiarrhee) ||\n\t\t\t(noFievre && toux && noMalGorge && noCourbatures) ||\n\t\t\t(noFievre && noToux && malGorge) ||\n\t\t\t(noToux && courbatures) ||\n\t\t\t(noFievre && diarrhee)\n\t\t) {\n\t\t\tif (nohighTemp && noexhausted && nosickness && nogeneResp && nofoodDiff && nolowTemp) {\n\t\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t\t'Votre situation ne relève probablement pas du Covid-19. Consultez votre médecin au moindre doute.';\n\t\t\t} else if (\n\t\t\t\t(nofacteurPro && nogeneResp && nofoodDiff && nolowTemp && highTemp && noexhausted && nosickness) ||\n\t\t\t\t(nofacteurPro && nogeneResp && nofoodDiff && nolowTemp && exhausted && nohighTemp && nosickness) ||\n\t\t\t\t(nofacteurPro && nogeneResp && nofoodDiff && nolowTemp && sickness && nohighTemp && noexhausted) ||\n\t\t\t\t(facteurPro && nogeneResp && nofoodDiff && nolowTemp && nosickness && nohighTemp && noexhausted)\n\t\t\t) {\n\t\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t\t'Votre situation ne relève probablement pas du Covid-19. Un avis médical est recommandé. Au moindre doute, appelez le 141. ';\n\t\t\t} else {\n\t\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t\t'Votre situation ne relève probablement pas du Covid-19. N’hésitez pas à contacter votre médecin en cas de doute. Vous pouvez refaire le test en cas de nouveau symptôme pour réévaluer la situation. Pour toute information concernant le Covid-19 allez vers la page d’accueil.';\n\t\t\t}\n\t\t} else {\n\t\t\tresultat.children[1].lastElementChild.textContent =\n\t\t\t\t'Votre situation ne relève probablement pas du Covid-19. N’hésitez pas à contacter votre médecin en cas de doute. Vous pouvez refaire le test en cas de nouveau symptôme pour réévaluer la situation. Pour toute information concernant le Covid-19 allez vers la page d’accueil.';\n\t\t}\n\t}\n}", "function composer(arr,cb)\r\n{let total=arr[0];\r\n\r\nfor(let i=1;i<arr.length;i++) {total=cb(total,arr[i]);}\r\n return total;\r\n }", "function finalfun(arg1, arg2, arg3) {\n if (arg1 != undefined && arg2 == undefined && arg3 == undefined){\n return arg1\n }\n else if (arg1 != undefined && arg2 != undefined && arg3 == undefined){\n return arg1 + arg2\n }\n else if (arg1 != undefined && arg2 != undefined && arg3 != undefined){\n return (arg1 + arg2)/ arg3\n }\n else {\n return false\n }\n return null\n}", "function someRecursive(arr, func) {\n\tif (arr.length === 1) return func(arr[0]);\n\tlet result = func(arr[0]) + someRecursive(arr.slice(1), func);\n\treturn result > 0;\n}", "function compute () {\n\t // set value\n\t util.forEach(expressions, function(exp, index) {\n\t var v = that.$exec(exp)\n\t if (!v[0]) caches[index] = v[1]\n\t })\n\t // get content\n\t var frags = []\n\t util.forEach(parts, function(item, index) {\n\t frags.push(item)\n\t if (index < expressions.length) {\n\t frags.push(caches[index])\n\t }\n\t })\n\t return Expression.unveil(frags.join(''))\n\t }", "function reduce(data, f) {\n return data.reduce(function(prev, current, index, array) {\n return f(prev, current);\n });\n }", "function result(f, g, a) {\n if (a.tag) {\n return _1(g, a[0]);\n } else {\n return _1(f, a[0]);\n }\n }", "function arrayCalculation(array, someFxn) {\n var resultingArray = [];\n for (var i = 0 ; i < array.length ; i++) {\n resultingArray.push(someFxn(array[i]));\n }\n return resultingArray;\n}", "function\nfilter0$test_2547_(a4x1)\n{\nlet xtmp83;\n;\n{\nxtmp83 = a1x2(a4x1);\n}\n;\nreturn xtmp83;\n}", "function getDiscount3(people) {\n const [ _, result ] = [\n [ function (valor) { return valor < 10 }, 500 ],\n [ function (valor) { return valor >= 10 && valor < 25}, 350 ],\n [ function (valor) { return valor >= 25 && valor < 100 }, 250 ],\n [ function (valor) { return valor >= 100 }, 200 ],\n ].find(function([ teste ]) {\n return teste(people)\n })\n\n return result\n}", "function f(b) {\n currentSum += b;\n return f; // <-- does not call itself, returns itself\n}", "function recusion() {\n // some serious code\n recusion();\n}", "calc() {\n\n let last = '';\n\n this._lastOperator = this.getLastItem(true); //verifica o ultimo operador\n //a variavel e menor que tres elementos \n if (this._operation.length < 3) {\n let firstItem = this._operation[0]; //primeiro item do array e 0\n this._operation = [firstItem, this._lastOperator, this._lastNumber]; //o array fica o primeiro, o ultimo operador e o numero\n }\n //tira o ultimo se for maior que 3 itens\n if (this._operation.length > 3) {\n last = this._operation.pop();\n this._lastNumber = this.getResult();\n } else if (this._operation.length == 3) {\n this._lastNumber = this.getLastItem(false);\n }\n\n let result = this.getResult();\n\n if (last == '%') {\n result /= 100;\n this._operation = [result];\n } else {\n this._operation = [result];\n //se for diferente de vazio\n if (last) this._operation.push(last);\n }\n\n this.setLastNumberToDisplay();\n\n }", "static Sum(a,b) {\n //create new object, good for data + actions\n let calculation = new Calculation(a,b,Sum);\n Calculator.Calculations.push(calculation);\n return calculation.GetResults();\n }", "function reduce(arr, func, intitial_value){\n accumulator = intitial_value\n for(let i =0; i< arr.length; i++){\n accumulator = func(arr[i], accumulator)\n }\n return accumulator\n}", "function collectOddValues(arr){\n let result = [];\n\n// result is out of scope of helper so it wont reset\n\n function helper(helperInput){\n if(helperInput.length === 0){\n return\n }\n\n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n console.log(helperInput)\n \n helper(helperInput.slice(1))\n }\n\n helper(arr)\n\n return result\n}", "function FuncResult(internalQCM)\r\n{\r\n this.id = InternalQCM.newId();\r\n this.qcm = internalQCM;\r\n this.composedFuncs = {};\r\n this.numComposedFuncs = 0;\r\n this.composedActive = {};\r\n this.composedActiveNum = 0;\r\n this.composedSupportMultiProjNum = 0;\r\n this.composedQueryResultNum = 0;\r\n this.composedMatchTransparentNum = 0;\r\n this.composedOrderStar = undefined; // may often remain empty\r\n this.composedSelectingNum = 0;\r\n\r\n if(this.DebugTracing !== undefined)\r\n this.DebugTracing(0, debugTracingFuncResult);\r\n}", "function recur(userFn){\n var recursingFn = j.either(j.identity, userFn),\n localRecursor = j.partial(recursor, recursingFn),\n recurValue = j.apply(localRecursor, j.slice(1, arguments));\n\n while(verifyRecurValue(recurValue = recurValue(localRecursor)) && recursingFn !== j.identity);\n\n return recurValue;\n }", "function computeScore(userchoices){\n minIndex = 0; //reset value of minIndex each time function is called.\n var mathArray = []; //create array of absolute value \"scores\"\n var comparisonArray = []; // create array for individual array score calculation\n for (var x = 0; x < tableArray.length; x++) {\n for (var o = 0; o < 9; o++) {\n var score = Math.abs(userchoices[o] - tableArray[x].answers[o]);\n comparisonArray[o] = score; \n }\n (function myFunction() {//calculates score of individual array\n mathArray[x] = comparisonArray.reduce(getSum);\n })();\n }\n indexOfMin(mathArray);\n winner = tableArray[minIndex];\n console.log(winner);\n return winner;\n }", "function simpleCalc(arg1, arg2) {\n\treturn arg1 += arg2;\n}", "function fn(n, src, got, all, subsets_total) \n{\t\n\tif (n == 0) \n\t{\n\t\tif (got.length > 0) \n\t\t{\n\t\t\tall[all.length] = got;\n\t\t}\n\t\treturn;\n\t}\n\t\n\tfor (var j = 0; j < src.length; j++) \n\t{\t\n\t\tvar curr_price = Number(src[j][\"price\"].replace(\"$\", \"\"));\n\t\tsubsets_total += curr_price;\t\n\t\tif(subsets_total <= total){\n\t\t\tfn(n - 1, src.slice(j + 1), got.concat([src[j]]), all, subsets_total);\t\t//different products with lesser difference is cost are considered\n\t\t} else {\n\t\t\tsubsets_total = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn;\n}", "function calculate(result, operator){\n if(operator=='^'){\n temp = Math.pow(result[result.length-2] , result[result.length-1]);\n }else if(operator=='*'){\n temp = result[result.length-2] * result[result.length-1];\n }else if(operator=='/'){\n temp = result[result.length-2] / result[result.length-1];\n }else if(operator=='+'){\n temp = result[result.length-2] + result[result.length-1];\n }else if(operator=='-'){\n temp = result[result.length-2] - result[result.length-1];\n } \n \n result.pop();\n result.pop();\n result.push(temp);\n}", "function result(number1, number2) {\n if (number1 === number2) {\n return (number1 + number2) * 3;\n } else {\n return number1 + number2;\n }\n}", "function performCalc(numArr, operArr) {\n\n for (var i = 0; i < numArr.length; i++) {\n numArr[i] = parseFloat(numArr[i]);\n }\n\n while (operArr.length > 0) {\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"/\") {\n tempAns = numArr[i] / numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"x\") {\n tempAns = numArr[i] * numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"+\") {\n tempAns = numArr[i] + numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"-\") {\n tempAns = numArr[i] - numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n }\n\n numArr[0] = Math.round(100 * numArr[0]) / 100;\n\n return numArr[0];\n\n}", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // the reduce function which is in itself a higher order function", "function attachToPrevious(arr, prevResults=[]){\n if(arr && arr.length && arr.length != 0){\n // console.log(arr)\n var p = arr.shift();\n return p.func.call().then(x=>{\n // console.log(\"result:\",x, \"p:\",p)\n //if restricts registered\n if(p.restrict.length > 0){\n // console.log(, \"\\n\")\n //verification failed\n if(noNegatives(x.answer, p.restrict)){\n prevResults.push(x)\n }else{\n arr.unshift(p);\n }\n // console.log(p.verifier.failed)\n }else{\n prevResults.push(x)\n }\n // console.log(\"x:\",x)\n //recurse until ready\n return attachToPrevious(arr, prevResults)\n })\n }else{\n return new Promise(r=>{r(prevResults)})\n }\n}", "function apply(dataArray,funct,accum=[]) {\n if (dataArray.length === 0) return accum;\n accum.push(funct(dataArray.shift()));\n return apply(dataArray, funct, accum);\n}", "function addition() {\n calculateResult(\"ADD\");\n}", "function getRecursionInput(metadata, data, result, cb) {\r\n var fkpk = metadata.constraints;\r\n if (!result || !result.length) {\r\n return cb(null, []);\r\n }\r\n var newinput = [];\r\n var element = {};\r\n var alreadyPresent = false;\r\n //for all the results\r\n result.forEach(function (eachResult) {\r\n //check all the foreign key primary key constraints\r\n fkpk.constraint.forEach(function (eachConst) {\r\n //create new seed for dbcrawler\r\n if (eachConst.table_name === data.table && eachResult[eachConst.column_name]) {\r\n //seed for dbcrawler\r\n element = {\r\n table: eachConst.referenced_table_name,\r\n result: [{\r\n column: eachConst.referenced_column_name,\r\n value: eachResult[eachConst.column_name]\r\n }],\r\n };\r\n alreadyPresent = false;\r\n if (result.lengt < 1000) {\r\n newinput.forEach(function (input) {\r\n if (deepEqual(input, element)) {\r\n alreadyPresent = true;\r\n }\r\n });\r\n }\r\n if (!alreadyPresent) {\r\n newinput.push(element);\r\n }\r\n } //ends if eachConst\r\n }); //ends fkpk.constraint.Foreach\r\n }); //ends resultForEach\r\n return cb(null, newinput);\r\n}", "function adouble(arr){\n\nresult = arr.reduce((total ,elem)=>{\n return total += elem * 2\n},0)\nreturn result\n}", "function actual_Result(\n db//: MongoClient.connect.then() obj\n ,collection//: db.collection obj <- optional\n ,collection_Name//: str\n ,query//: obj\n ) {//: => Promise | thenable ((dict | obj) | undefined | error)\n if (collection) {\n if (is_Debug_Mode) {console.log(\"using passed collection parameter\");}\n } else {\n collection = db\n .collection(collection_Name);\n }\n\n return collection\n .find(\n query\n )\n .project({\"_id\": false, \"original_url\": true, \"short_url\": 1})\n .toArray()\n .then((docs) => {\n if (is_Debug_Mode) {console.log(\"documents found:\", docs.length);}\n if (is_Debug_Mode) {console.log(docs);}\n if (is_Debug_Mode) {\n // Logging property names and values using Array.forEach\n Object\n //.getOwnPropertyNames(obj)\n .keys(docs)\n .forEach((val, idx, array) => {\n //!(is_Debug_Mode) ||\n console.log(\n val, '->', docs[val]);\n });\n }\n //*** find original_Link in docs ***//\n //var filtered = arr.filter(func);\n results = docs.filter((doc) => {return doc.original_url == original_Link;});\n if (results.length > 0) {\n result = {\"document\": results[0], \"is_New\": false};//, \"db\": db};\n } else {\n //*** find Arrays / lists difference ***//\n documents = [];\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[0]});\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[1]});\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[2]});\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[3]});\n\n results = comparator.lists_Difference(\n documents//: list (of obj)\n ,docs//: list (of obj)\n ,is_Debug_Mode\n );\n result = results.hasOwnProperty(0) ? results[0] : result;\n result = {\"document\": result, \"is_New\": true};//, \"db\": db};\n }\n if (is_Debug_Mode) {console.log(\"result\", result);}\n result.db = db;\n //db.close();\n\n return Promise.resolve(\n result\n );\n }\n )\n .catch((err) => {\n if (is_Debug_Mode) {console.log(\"cursor.then():\", err.stack);}\n return Promise.reject(err);\n }\n );\n }", "function operateResult(i) {\n return function () { \n if (buttonsArray[i].innerHTML === \"C\") {\n screenResult.innerHTML = \"0\";\n } else if (buttonsArray[i].innerHTML === \"+/-\") {\n changePlusMinus();\n } else {\n\t\t\t\t hideDisplayZero(i);\n if (checkOperators(i)) {\n screenResult.innerHTML += buttonsArray[i].innerHTML;\n }\n }\n };\n }", "function doSomething(a){\n function doSomethingElse(a){\n return a -1;\n }\n let b = a + doSomething(a * 2);\n console.log(b * 3);\n}", "function calc(params) {\n return 22; \n}", "function avg(a)\r\n{\r\n\r\n//assigning the avg to coursework(90) divide by a.\r\nlet avg =coursework(90)/a\r\n\r\n//the function should produce avg as the result after it's execution\r\nreturn avg\r\n\r\n}", "function add(arr1, arr2) {\n\n// console.log(arr1[0]);\n var result = [0, 0, 0, 0, 0, 0, 0];\n var start = halfAdder(arr1[7], arr2[7]);\n\n result[7] = start.s;//SUM\n var c = start.c; //CARRY\nconsole.log(result);\n\n for (var i = 6; i >= 0; i--) {\n var a = arr1[i];\n var b = arr2[i];\n\n var temp = fullAdder(a, b, c);\n console.log(temp);\n result[i] = temp.s;\n c = temp.c;\n }\n\n if(c === 1){\n alert(\"Overflow\");\n return [0, 0, 0, 0, 0, 0, 0, 0];\n }\n else{\n return result;\n }\n\n}" ]
[ "0.6300613", "0.6035255", "0.58923197", "0.58891886", "0.5757814", "0.56782854", "0.56354636", "0.56230783", "0.56163865", "0.55804276", "0.5542391", "0.55254304", "0.54675186", "0.5454702", "0.5398135", "0.5398135", "0.53931785", "0.53738964", "0.53692526", "0.53636414", "0.53602684", "0.5341799", "0.53407544", "0.5334692", "0.53314525", "0.53276163", "0.5298316", "0.5291287", "0.52879775", "0.5266778", "0.5266659", "0.5259601", "0.52566993", "0.5255075", "0.5243301", "0.5242789", "0.5237302", "0.52289355", "0.5223", "0.5217519", "0.5208083", "0.52001715", "0.5198813", "0.5197998", "0.51792717", "0.51772064", "0.5176357", "0.5169175", "0.5165342", "0.5157228", "0.5151423", "0.51492107", "0.51459086", "0.5129299", "0.51281834", "0.5127175", "0.51243895", "0.5121869", "0.5119831", "0.51175785", "0.50882256", "0.50792974", "0.5073386", "0.5071208", "0.50653803", "0.5065155", "0.50562584", "0.5048602", "0.5047296", "0.50446516", "0.50428236", "0.50395364", "0.5036572", "0.5034524", "0.50308484", "0.5027663", "0.5026263", "0.502091", "0.50182897", "0.500924", "0.50035644", "0.50024325", "0.4989311", "0.49860334", "0.49829292", "0.4974648", "0.4967025", "0.49647975", "0.49601752", "0.49554452", "0.49526742", "0.49464163", "0.49463573", "0.4944658", "0.49426332", "0.49421042", "0.4941428", "0.49364161", "0.49362487", "0.4935649", "0.4934142" ]
0.0
-1
1 is used because the length is always 1 greater than the greatest index
function printReverse(arr){ for(var i = arr.length - 1; i >= 0 ; i--){ // now we will console.log arr with the index of i // it should print out 5 in this case console.log(arr[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "size() { return 1; }", "function length1(a) {\n var len = 0;\n while (a[len] !== undefined)\n len++;\n\n}", "get _length () {\n return 1\n }", "get _length () {\n return 1\n }", "get length () {\n return 1\n }", "function uniqueSkipHelper(index, length) {\n return Math.floor(index / length) + 1;\n }", "getLastIndex() {\n return (this.maxIndex - Math.floor(this.index) - 1) % this.maxIndex;\n }", "function z(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}", "removeEnd(arr, length) {\n if (length > 0) {\n // Overwrite last element with some default value.\n // We would also consider the length to be decreased by 1.\n arr[length - 1] = 0;\n length--;\n }\n }", "length(): number {\n return Math.max(0, this.stop - this.start + 1);\n }", "function shorterInArray(arr){\n\tvar short= arr[0].length;\n for (i=0 ; i<arr.length ; i++){\n if (short > arr[i].length){\n \tshort=arr[i];\n }\n }return short;\n}", "function fitTheFirstValue(arr){\n if(arr[0] > arr.length){\n console.log(\"Too big!\");\n } else if (arr[0] < arr.length) {\n console.log(\"Too small!\");\n } else {\n console.log(\"Just right!\");\n }\n}", "function caml_array_bound_error () {\n caml_invalid_argument(\"index out of bounds\");\n}", "empty () {\n return !(this.length >= 1);\n }", "function rltlength () {\n}", "function getLastIndex(){\n return questions.length - 1;\n }", "function checkPosition(){\n if (i > (data.omicron.length - 1)) {\n i = 0;\n } else if (i < 0) {\n i = (data.omicron.length - 1);\n }\n }", "static mpReduceSize(x) {\n if(!x) {\n throw new Error(\"mpReduceSize incorrect imput\");\n } \n\n while(x.length > 0) {\n if(x[x.length - 1] == 0) {\n x.pop();\n continue;\n }\n break;\n } \n\n if(x.length == 0) {\n x.push(0);\n } \n }", "deletemin() {\n\t\tif (this.empty()) return 0;\n\t\tlet i = this.itemAt(1); this.delete(i);\n\t\treturn i;\n\t}", "size() {\n return ((this.isEmpty()) ? 0 : (this.lastIndex + 1));\n }", "get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }", "function fix(v, size) {\n return v < 0 ? (size + 1 + v) : v;\n}", "function ex_1_R(a) {\n if (a.length == 0 || a[0] < 0) {\n return 0;\n } else {\n return a[0] + ex_1_R(a.slice(1));\n }\n}", "function last$1(a){return a.length>0?a[a.length-1]:null;}", "function checkValue(value){\n let len = testimony.length-1\n // console.log(len);\n if (value>len) {\n return 0;\n }\n if (value<0) {\n return len;\n }\n // console.log(value);\n return value;\n \n }", "isFull() {\n return (this.lastIndex === (this.capacity() - 1));\n }", "function end(x){ \n return x[x.length-1] ;\n}", "function last$1(arr) {\n return arr.slice(-1)[0];\n}", "length () {\n return this.queue.length - 1\n }", "function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n\t return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n\t }", "function shorterInArray(arr){\r\n\t\tvar short=arr[0]\r\n\t\tvar length=short.length\r\n\t\tfor(i=1;i<arr.length;i++){\r\n\t\t\tif(arr[i].length<length){\r\n\t\t\t\tshort=arr[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn short;\r\n\t}", "function veciOdNule(element, index, array)\n{\n\treturn element >= 0;\n}", "function hookLength(part, i, j) {\n var k = 0;\n while (i + k + 1 < part.length && part[i + k + 1] > j)\n k++;\n return k + part[i] - j;\n}", "hasMore() {\n return this.length > this.#index + 1;\n }", "get length() {\n return this._index.length;\n }", "function length(array)\n{\n\tif (array.height === 0)\n\t{\n\t\treturn array.table.length;\n\t}\n\telse\n\t{\n\t\treturn array.lengths[array.lengths.length - 1];\n\t}\n}", "function length(array)\n{\n\tif (array.height === 0)\n\t{\n\t\treturn array.table.length;\n\t}\n\telse\n\t{\n\t\treturn array.lengths[array.lengths.length - 1];\n\t}\n}", "function length(array)\n{\n\tif (array.height === 0)\n\t{\n\t\treturn array.table.length;\n\t}\n\telse\n\t{\n\t\treturn array.lengths[array.lengths.length - 1];\n\t}\n}", "function length(array)\n{\n\tif (array.height === 0)\n\t{\n\t\treturn array.table.length;\n\t}\n\telse\n\t{\n\t\treturn array.lengths[array.lengths.length - 1];\n\t}\n}", "function length(array)\n{\n\tif (array.height === 0)\n\t{\n\t\treturn array.table.length;\n\t}\n\telse\n\t{\n\t\treturn array.lengths[array.lengths.length - 1];\n\t}\n}", "function length(array)\n{\n\tif (array.height === 0)\n\t{\n\t\treturn array.table.length;\n\t}\n\telse\n\t{\n\t\treturn array.lengths[array.lengths.length - 1];\n\t}\n}", "function fitFirst(arr){\n if (arr[0] > arr.length){\n console.log(\"Too big!\")\n }else if (arr[0] < arr.length){\n console.log(\"Too small!\")\n }else{\n console.log(\"Just right!\")\n }\n}", "isFull() {\n return ((this.tail + 1) % this.size) === this.head;\n }", "function cutIt(arr){\n var min = Math.min(...arr.map(({ length }) => length));\n //map over array slice it by min.\n<<<<<<< HEAD\n \n \n}", "size(){ return this.end-this.start }", "set length(value) {}", "set length(value) {}", "function getLength(array) {\n console.log(array);\n // base case\n if (array[0] === undefined) return 0;\n // recursive call\n // return 1+ getLength(array without the first value)\n return 1 + getLength(array.slice(1));\n}", "length() {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }", "function getIncrement(len) {\n return Math.max(1, (len - 1) / 1000);\n}", "function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}", "function caml_string_bound_error () {\n caml_invalid_argument (\"index out of bounds\");\n}", "getFirstIndex() {\n // index of the top item\n return (this.maxIndex - Math.floor(this.index)) % this.maxIndex; \n }", "function lastIndex(length) {\n var mod = length % 10;\n if (mod === 0) {\n return 10;\n }\n else {\n return mod;\n }\n }", "if (!this._array.hasOwnProperty(indexStart)) {\n indexStart = this._count;\n }", "last () { return this[ this.length - 1 ] }", "function Bigglesize(arr){\n for(var i=0; i<arr.length;i++){\n if(arr[i]>0){\n arr[i]='big';\n }\n }\n return arr;\n}", "function getLengthOfShortestElement(arr) {\n\t// EDGE CASE:\n\t// if the arr length is 0\n\tif (arr.length === 0) {\n\t\t// return 0\n\t\treturn 0;\n\t}\n\t// create a variable min assign it to a value of 0\n\tlet min = arr[0];\n\t// iterate through the arr to get the element\n\tfor (let i = 1; i < arr.length; i++) {\n\t\t// if the element length is less than min\n\t\tif (arr[i].length < min.length) {\n\t\t\t// reassign min to to element.length\n\t\t\tmin = arr[i];\n\t\t}\n\t}\n\t// return min\n\treturn min.length;\n}", "if (!this._array.hasOwnProperty(index)) {\n if (index >= this._array.length || index < 0) {\n throw new RangeError('Out of range index');\n }\n // find the next or previous open slot\n if (this._direction) {\n index = this._count;\n } else {\n index = this._array.length - this._count - 1;\n }\n }", "function getIncrement(len) {\n return Math.max(1, (len - 1) / 1000);\n}", "findmin() { return this.empty() ? 0 : this.itemAt(1); }", "function getLast(arr){\r\n return arr[arr.length - 1]\r\n}", "length(){ return this.end-this.start }", "last() {\n if (this.size <= 0)\n return undefined;\n return Array.from(this.values())[Array.from(this.values()).length - 1];\n }", "getLastIndex(){\n return this.list.length;\n }", "wrap(index) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }", "function lookupLastCompletedLesion() {\n\n if( meCompletedLesions[0] == 0 )\n\treturn 0;\n\n for( var i = 1; i < myDefaultArrayLength; i++ ) {\n\tif( meCompletedLesions[i] == 0 ) {\n\t return i-1;\n\t}\n }\n\n return myDefaultArrayLength;\n}", "function a(t,i){return-1<t.indexOf(i)}", "function length(array) {\n return array.length | 0;\n}", "function length(array) {\n return array.length | 0;\n}", "function lastOf(array1){\n var last = array1.length-1;\n return array1[last];\n}", "function nLast(arr, num){\n if(arr.length < num){\n return null\n }\n else{\n return arr[arr.length - num]\n }\n}", "removeOnIndex(index) {\n if (index < 0) {\n console.error(`Index must be greater than 0!`);\n return false;\n }\n\n index = index = Math.floor(index);\n\n if (this.length < index) {\n this.remove();\n } else {\n for (let i = index; i < this.length; i++) {\n this.data[i] = this.data[i + 1];\n }\n\n delete this.data[this.length - 1];\n this.length--;\n }\n }", "function almostIncreasingSequence(sequence){\n\n}", "function length(array)\n\t{\n\t\tif (array.height == 0)\n\t\t{\n\t\t\treturn array.table.length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array.lengths[array.lengths.length - 1];\n\t\t}\n\t}", "capacity() {\n return this.capacity - 1;\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n }", "function myArray(len){\n\tvar a = [];\n\tfor(var i=0; i<len; i++){\n\t\ta[i] = {val:0};\n\t}\n\ta[len-1].val = 1;\n\treturn a;\n}", "get(index) {\n return index < 0 || index >= this.size() ? undefined : this._switch(this.min, () => String.fromCharCode(this.min.charCodeAt(0) + index), () => this.min + index);\n }", "function last(arr) {\n return arr.slice(-1)[0];\n}", "function last(arr) {\n return arr.slice(-1)[0];\n}", "function last(arr) {\n return arr.slice(-1)[0];\n}", "function last(value){\n return value[value.length-1];// returns last value in sequence\n}", "isFull() {\n return (this.tail + 1) % this.capacty == this.head\n }", "function Fourth(){\n let params = arguments[0] \n console.log(params.filter((x,index)=>index>0&&index<=params[0]?x:false\n ).join(\" \"))\n\n console.log(params.filter((x,index)=>index>=params.length-params[0]?x:false \n ).join(\" \"))\n}", "function smallestIndex(accumulator) {\n 'use strict';\n // find the first smallest index in accumulator\n if (accumulator.length === 0)\n throw \"Empty accumulator\";\n var i = 0;\n var length = accumulator[0].length;\n for (var index = 1; index < accumulator.length; ++index) {\n if (accumulator[index].length < length) {\n length = accumulator[index].length;\n i = index;\n }\n }\n return i;\n }", "adjustIndex(index) {\n return index - this.hiddenIndices.filter(i => i < index).length;\n }", "function r(t,e){if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0}", "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}" ]
[ "0.67777175", "0.67533755", "0.62122124", "0.62122124", "0.61302584", "0.59990984", "0.59589976", "0.5951627", "0.59500414", "0.5934609", "0.5929344", "0.5911807", "0.59104544", "0.5903936", "0.5890701", "0.5885549", "0.58737946", "0.5865932", "0.5865827", "0.585605", "0.5846918", "0.58369344", "0.58296853", "0.58235675", "0.5795556", "0.57686967", "0.5768325", "0.5767862", "0.57530373", "0.5727899", "0.5716508", "0.5712222", "0.569619", "0.56951755", "0.56906176", "0.5675411", "0.5675411", "0.5675411", "0.5675411", "0.5675411", "0.5675411", "0.5661938", "0.56536055", "0.5642227", "0.56231546", "0.5622806", "0.5622806", "0.5622592", "0.5621706", "0.5619109", "0.5618344", "0.56157726", "0.5609249", "0.5602057", "0.5598355", "0.5597866", "0.55953974", "0.5594126", "0.5591898", "0.5590221", "0.5586889", "0.55840385", "0.55816996", "0.5579915", "0.55782497", "0.5577159", "0.55601597", "0.55600214", "0.5558596", "0.5558596", "0.5553271", "0.5551948", "0.5549552", "0.5549107", "0.5546753", "0.5541729", "0.55406886", "0.55406886", "0.55406886", "0.55406886", "0.55406886", "0.55406886", "0.55406886", "0.55406886", "0.55406886", "0.5538482", "0.5534447", "0.5534416", "0.5534416", "0.5534416", "0.5533883", "0.55335367", "0.5532116", "0.5527732", "0.5525143", "0.55229074", "0.5520159", "0.5520159", "0.5520159", "0.5520159", "0.5520159" ]
0.0
-1
isUiniform write a function which takes and array as an arguement and returns true if all elements in the array are identicle we use a for loop here becuase a forEach will only run the intial function and next function and not iterate through the same way?
function isUniform(arr) { var first = arr[0]; for (var i = 1; i < arr.length; i++) { if(arr[i] !== first) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function every(array, test) {\n // Interesting this did not work below because the return does not break out of the entire function when returning false, therfore will always return true if done this way.\n // array.forEach(function(element) {\n // if (test(element) != true) {\n // return false;\n // }\n // })\n for (var i=0;i<array.length;i++){\n if (test(array[i]) != true) {\n return false;\n }\n }\n return true;\n}", "function every (array, f){\n for (var i =0; i<array.length; i++){ \n if (!f(array[i]))\n return false;\n }\n return true;\n}", "function all(func, array){\n for (var i=0; i<array.length; i++){\n\t if (!func(array[i])) return false;\n }\n return true;\n }", "function testAny(arr, fn) {\n for(var i=0;i<arr.length;i++) {\n if(fn(arr[i])) {\n return true;\n }\n }\n return false;\n }", "function any(func, array){\n for (var i=0; i<array.length; i++){\n\t if (func(array[i])) return true;\n }\n return false;\n }", "function every(array, test) {\n var it = true;\n array.forEach(function(value){\n if(test(value) === false){\n it = false;\n }\n });\n return it;\n}", "function testForEach(arr) {\n return arr.forEach( element => { console.log(element)});\n}", "function some(array, f){\n\t// var status = false;\n\tfor (var i = 0; i < array.length; i++){\n\t\tif (f(array[i])) return true;\n\t}\n\treturn false;\n}", "function some(array, test) {\n for (let element of array) {\n if (test(element)) {\n return true;\n }\n }\n\n return false;\n}", "function every(arrayArg,test){\n//loop through the array \n for(var i=0; i<arrayArg.length; i++){\n//the array is accepted as an argument to the function argument (test)\n//if the function evaluates to false within the loop then return false\n if(!test(arrayArg[i]))\n return false;\n \t\t}\n//if the array is looped through and never false, then return true \n return true;\n }", "function some(array, f) {\n var acc = false;\n\n for (var i = 0; i < array.length; i++) {\n acc = f(array[i], i, array);\n\n if (acc) {\n return acc;\n }\n }\n\n return acc;\n }", "every(callback) {\n for (const ele of this.arr) {\n if (!callback(ele)) {\n return false;\n }\n }\n\n return true;\n }", "function every(array, test) {\n for (var i = 0; i < array.length; i++) {\n if (!test(array[i])) {\n return false;\n }\n }\n return true;\n}", "function isUniform(array) {\n var result = true;\n array.forEach(function (element) {\n if (element !== array[0]) {\n result = false;\n }\n });\n console.log(result);\n}", "function some(arrayArg,test){\n//loop through the array \n for(var i=0; i<arrayArg.length; i++){\n//if the function ever evaluates to true within the loop then return true\n if(test(arrayArg[i]))\n return true;\n \t\t}\n //if the function never evaluates as true, then return false\n return false;\n }", "function forEach(array, callback) {\n\n}", "every(callback) {\r\n for (let i = 0; i < this.array.length; i++) {\r\n const item = this.array[i];\r\n if (!callback(item)) return false;\r\n }\r\n return true;\r\n }", "function forEach(arr, func){\n for(let i =0; i< arr.length; i++){\n func(arr[i]);\n }\n}", "function every(array, test) {\n // Your code here.\n return !(array.some(item => !test(item)));\n}", "function forEach(arr, func)\n{\n\tif (arr.length == 0) return;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tfunc(arr[i], i, arr);\n\t}\n}", "function ourvery(myArray , callback){\n\n for(let i = 0 ; i < myArray.length;i++){\n if(!callback(myArray[i])){\n return false;\n }\n }\n\n return true;\n \n}", "function every(array, test) {\n // Your code here.\n }", "function every(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (!f(arr[k], k, i++)) {\n return false;\n }\n }\n return true;\n }", "function executeforEach(arr, func) {\n\tfor(let i of arr) {\n\t\tfunc(i);\n\t}\n}", "function every(array, callback) {\n const { length } = array;\n\n for (let index = 0; index < length; index += 1) {\n const value = array[index];\n\n if (!callback(value, index, array)) {\n return false;\n }\n }\n\n return true;\n}", "function ifArray(input_array) {\n for (let i=0; i<input_array.length; i++) {\n allFood(input_array[i])\n }\n}", "function isUniform(array) {\n var mainNum = array[0];\n for(var i = 1; array[i] < array.length; i++){\n if(array[i] !== mainNum){ //array[i] !== mainNum ? return false;\n return false;\n }\n }\n return true;\n \n \n // array.forEach(function(num) {\n // if(num !== mainNum) {\n // return false;\n // } else {\n // return true;\n // }\n // }); \n}", "function doesForEachActuallyWork() {\n \tvar ret = false;\n \n \t(new Set([true])).forEach(function (el) {\n \t\tret = el;\n \t});\n \n \treturn ret === true;\n }", "function forEach(list, callback) {\n if (list !== undefined) {\n [].forEach.call(list, callback);\n }\n return false;\n }", "function every(arr, func)\n{\n\tvar result = true;\n\tif (arr.length == 0) return result;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tif (!func(arr[i], i, arr))\n\t\t{\n\t\t\tresult = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}", "function any(array, test) {\n var length = array.length;\n for (var i = 0; i < length; ++i) {\n if (test(array[i])) {\n return true;\n }\n }\n return false;\n}", "function mutation(arr) { //arr will just contain 2 string elements\n for (var i = 0; i < arr[1].length; i++) {\n if ()\n }\n\n}", "function forEach (arr, func) {\n\tconst len = arr.length\n\tlet i\n\n\tfor (i = 0; i < len; i++) {\n\t\tfunc(arr[i], i, arr)\n\t}\n}", "function forEach(array, action){\n\t for (var i = 0; i < array.length; i++)\n\t action(array[i]);\n\t}", "function forEach(seq,fn) { for (var i=0,n=seq&&seq.length;i<n;i++) fn(seq[i]); }", "function forEach(arr, func) {\n for (var i = 0; i < arr.length; i++)\n func(arr[i]);\n}", "function every(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (!f(arr[k], k, i++)) {\n return false;\n }\n }\n return true;\n}", "function doesForEachActuallyWork() {\n\t\tvar ret = false;\n\n\t\t(new Set([true])).forEach(function (el) {\n\t\t\tret = el;\n\t\t});\n\n\t\treturn ret === true;\n\t}", "function some(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (f(arr[k], k, i++)) {\n return true;\n }\n }\n return false;\n }", "function forEach(arr, cb) {\nfor (let i=0; i < arr.length; i++){\n cb(arr[i]); // cb is a function that outputs each element of array!\n}\n}", "function every1(array, test){\n return !array.some(element => !test(element));\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}", "function myforEach (array, myFunction){\n for(let i=0; i<array.length;i++){\n myFunction(array[i]);\n }\n}", "forEach(callback, subject, predicate, object, graph) {\n this.some(quad => {\n callback(quad);\n return false;\n }, subject, predicate, object, graph);\n }", "function forEach(array, action){\n\tfor (var i = 0; i < array.length; i++){\n\t\taction(array[i]);\n\t}\n}", "function forEach(collection, fn) {\n if (!collection) {\n return false;\n }\n var i = 0,\n limit = collection.length;\n for (; i < limit; i++) {\n fn(collection[i], i);\n }\n }", "function forEach(arr, log) {\n for (let i = 0; i < arr.length; i++) {\n log(arr[i]);\n }\n\n}", "function forEach(array, action) {\n for (var i=0; i<array.length; i++) {\n action(array[i]);\n }\n}", "function forEach(arr, callback) {\n for(let i = 0; i < arr.length; i++){\n if (typeof callback === 'function') {\n callback(arr[i]);\n }\n }\n}", "function example(arr) {\n const isUneven = (num) => num % 2 == 0;\n\n console.log(arr.every(isUneven));\n}", "function forEach(array, func) {\n\tfor (var i = 1; i < array.length; i++) {\n\t\tfunc(array[i], array[i - 1]);\n\t}\n}", "function myForEach(array, callback) {\n\n}", "function forEach(array, action) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\taction(array[i])\n\t}\n}", "function myForEach(arr, func) {\n // loop thorought the array\n for (let i = 0; i < arr.length; i++) {\n // call the func inside the array\n func(arr[i]);\n }\n}", "function isArray(array) {\n //Write your code here\n}", "function callbackForEvery(elem, index, array) {\n return elem%2!==0;\n}", "forEach(func, firstVerse = 0, lastVerse){\n if(lastVerse == undefined) lastVerse = this.verses.length-1;\n if(firstVerse < 0) throw new Error(\"first verse number has to be greater than zero!\")\n let includeBasmalas = this.getPolicy(\"includeBasmalas\")\n if(firstVerse == 0 && ( !includeBasmalas || this.no == 1 || this.no == 9)) firstVerse = 1;\n for(let i = firstVerse; i <= lastVerse; i++){\n func(this.verses[i], this.no, i)\n }\n }", "function forEach(arr, callback){\n for(let i=0; i<arr.length; i++){\n callback(arr[i])\n }\n}", "function test (input) {\n for (var i = 0; i < input.length; i++) {\n\n if (Array.isArray(input[i])) {\n\n stringifier (input[i]);\n\n }\n \n else {\n \n converter (input[i]);\n \n \n }\n\n }\n \n }", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n //inputs an array of strings, and a function that tests string values, returing a boolean\n //outputs a boolean of true if all values in strings passed, or false if any failed\n //a for loop incrementing over strings\n \n // a variable to be set to false if any fail\n let weGood = true;\n for (let i = 0; i<strings.length; i++){\n //pass string at this value to test function. if false, return false\n if (test(strings[i])===false){\n weGood = false;\n }\n \n }\n return weGood;\n \n \n // YOUR CODE ABOVE HERE //\n}", "function myEvery_foreach(arr, condition) {\n\t\tvar comp = true;\n\t\tarr.forEach(function(element) {\n\t\t\tcomp = (condition(element) && comp);\n\t\t});\n\t\treturn comp;\t\t\n\t}", "function SearchContainsFromArray() {\r\n var students = [\"Akhil\", \"Nilay\", \"Akshay\", \"Jinu\"];\r\n var n = students.forEach(containschar);\r\n}", "function passAllTests(arr,num) {\n\t var passTest = true\n \tarr.forEach( function(test) {\n if (test(num) === false) {\n passTest = false\n }\n })\n // console.log(passTest)\n \treturn passTest\n}", "function forEach(array, cb){\n\tfor (let item of arrayGenerator(array)){\n\t\tcb(item)\n\t}\n}", "function every(array, callbackFunction) {\n var doesEveryElementMatch = true;\n array.forEach(function(element, index) {\n if(element !== callbackFunction(element, index)) {\n doesEveryElementMatch = false;\n }\n });\n return doesEveryElementMatch;\n}", "function isUniform(array) {\n // use the first element as reference, it doenst matter which element is used\n var check = array[0];\n var isUniform = true;\n\n // Check all the elements of the array against this\n array.forEach(function(element) {\n if (element !== check){\n\n // If any one of the array elements does not match, return false\n isUniform = false;\n }\n });\n\n // If we made it to this point, we iterated through all the elements and they all matched, so return true\n return isUniform;\n}", "function every(arr, boo) {\n return arr.forEach(function(el) {console.log(boo(el)); return boo(el)})\n}", "function every(ary, predicate) {\n for(var i = 0 ; i < ary.length ; i++) {\n if(!iteratee(predicate)(ary[i], i, ary)) {\n return false\n }\n }\n return true\n }", "function some(array, callback) {\n const { length } = array;\n\n for (let index = 0; index < length; index += 1) {\n const value = array[index];\n\n if (callback(value, index, array)) {\n return true;\n }\n }\n\n return false;\n}", "function customEvery(array){\n var answer = true\n array.forEach(function(i){\n if(i % 2 != 0){\n answer = false\n console.log(answer)\n return answer\n }\n })\n return answer\n}", "function some(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (f(arr[k], k, i++)) {\n return true;\n }\n }\n return false;\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n // We need to loop over the array\n for(var i = 0; i <= strings.length - 1; i++){\n // we need to pass each index to the test\n // What we are doing here is testing every string in our array aginast test and if they all resolve to pass the test \n // then it will return true, even if one string does not pass it will return false.\n if(strings.every(test)){\n return true;\n } else {\n return false;\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}\n \n}", "function isFilter(arr){\n for(let i=0;i<arr.length;i++)\n {\n let val = isEven(arr[i]);\n console.log(val);\n }\n \n}", "function newEvery(callback, array){\n \n for(let i = 0; i < array.length; i++){\n callback(array[i], i, array)\n if (callback(array[i]) === false){\n return false\n }\n}\nreturn true\n\n}", "function forEach(array, callback) {\n\t\tif (typeof array[0] === 'undefined' ||\n\t\t\t!array.length ||\n\t\t\t!callback) { return; }\n\n\t\tvar i = 0;\n\n\t\tfor (i = 0; i < array.length; i += 1) {\n\t\t\tcallback(array[i]);\n\t\t}\n\t}", "function arrayFor(array) {\n //Write your code here\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n // determine if all strings in the strings array pass the test\n // first we need to loop through the strings array and pass it through the test function\n // outside the loop the code block apply the conditional statement on whether are strings pass\n var tester = [];\n for(var i = 0; i < strings.length; i++){\n if(!test(strings[i])){\n return false;\n }\n \n }\n return true;\n // tester should contain an array of boolean values either true or false\n // have to say if just one tester element is false\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function foreach(a, f) {\n for (var i = 0; i < a.length; i++) {\n f(a[i]);\n }\n}", "function every(array, predicate) {\n // go through each element of the array, and if the element noes not matches the predicate funtion return false\n for (let element of array) {\n if (!predicate(element)) return false;\n }\n //retrun true if we make it through the who loop.\n return true;\n}", "function forEach(array, callback){\r\n array.forEach(callback);\r\n}", "function executeForEach(arr, func) {\n for (let i = 0; i < arr.length; i++) {\n func(arr[i]);\n }\n}", "function executeforEach(arr, callback) {\n for(let i of arr) {\n callback(i);\n } \n}", "function FindElementFromArray() {\r\n var students = [\"Akhil\", \"Nilay\", \"Akshay\", \"Jinu\"];\r\n var n = students.forEach(checkname);\r\n}", "forEach(callback, subject, predicate, object, graph) {\n this.some(function (quad) {\n callback(quad);\n return false;\n }, subject, predicate, object, graph);\n }", "function myForEach(arr, func) {\n \n for (var index = 0; index < arr.length; index++) {\n func(arr[index], index, arr);\n \n }\n}", "function forEach(arr, func, ctx) {\n if (!isArrayLike(arr)) {\n throw new Error(\"#forEach() takes an array-like argument. \" + arr);\n }\n for (var i=0, n=arr.length; i < n; i++) {\n func.call(ctx, arr[i], i);\n }\n }", "function executeforEach(arr, func) {\n arr.forEach((elem) => {\n func(elem);\n });\n}", "function every(arr, f) {\n var i = 0;\n\n var _iterator6 = _createForOfIteratorHelper(arr.entries()),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var _step6$value = _slicedToArray(_step6.value, 2),\n k = _step6$value[0],\n a = _step6$value[1];\n\n if (!f(a, k, i++)) {\n return false;\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n return true;\n }", "function every(array, test) {\n\treturn !(array.some(element => !test(element)))\n}", "function checkFun( pre, next ) {\n\n let trueArr = [];\n\n for ( let i = 0; i < next.length; i++ ) {\n\n for ( let j = 0; j < next.length; j++ ) {\n\n if ( pre[j] === next[i] ) {\n\n trueArr.push( true );\n\n } else {\n\n trueArr.push( false );\n\n }\n }\n }\n\n if ( trueArr[0] || trueArr[1] || trueArr[2] || trueArr[3] || trueArr[4] || trueArr[5] || trueArr[6] || trueArr[7] || trueArr[8] ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n\n}", "function exercise5(arr, s) {\n var exists = false;\n\n arr.forEach(function(value) {\n if (value === s)\n exists = true;\n });\n\n return exists;\n }", "function forEach(arr, fn, ctx) {\n var k;\n\n if ('length' in arr) {\n for (k = 0; k < arr.length; k++) fn.call(ctx || this, arr[k], k);\n } else {\n for (k in arr) fn.call(ctx || this, arr[k], k);\n }\n }", "function every(array, predicate) {\n for (let element of array) {\n if (!predicate(element)) return false;\n }\n return true;\n}" ]
[ "0.6763052", "0.6682481", "0.6554121", "0.6545657", "0.6519714", "0.6447185", "0.64454", "0.6443193", "0.638791", "0.63709885", "0.63571316", "0.6331026", "0.632854", "0.62873733", "0.62701064", "0.6269117", "0.6261136", "0.62598795", "0.6182335", "0.61697644", "0.6161084", "0.61584115", "0.6150443", "0.61417377", "0.6136656", "0.6135441", "0.6129111", "0.6125967", "0.60405153", "0.60328674", "0.6021114", "0.60197145", "0.6002115", "0.5993693", "0.5989723", "0.598665", "0.5971698", "0.59699726", "0.59682125", "0.5961539", "0.5960265", "0.5955278", "0.5955278", "0.5955278", "0.5955278", "0.5955278", "0.5955278", "0.5955278", "0.5955278", "0.5955278", "0.5943456", "0.59199333", "0.5914808", "0.5903238", "0.58953434", "0.5882802", "0.5879701", "0.5862861", "0.5861943", "0.58538073", "0.5843161", "0.5842884", "0.5834289", "0.58279014", "0.5812479", "0.5810439", "0.5805618", "0.58038104", "0.5802683", "0.5790309", "0.57898533", "0.57858896", "0.5780201", "0.5778485", "0.5777917", "0.57680875", "0.5766255", "0.5763717", "0.57633805", "0.5760685", "0.5760113", "0.57584864", "0.57543623", "0.57541174", "0.57448554", "0.57357913", "0.57339466", "0.5726449", "0.57099265", "0.57058644", "0.5702211", "0.57004684", "0.568575", "0.5682035", "0.5681117", "0.56800425", "0.567808", "0.56760377", "0.56750005", "0.56739664", "0.5668272" ]
0.0
-1
handles mouse events over the lines
function handleMouseOverLines(lambdaList) { canvas.addEventListener("mousemove", e => showLineNumberInBox(e, lambdaList)); canvas.addEventListener("mouseleave", unshowLineNumberInBox); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interMouseMove() {\n var m = d3.mouse(this);\n line.attr(\"x2\", m[0]-3)\n .attr(\"y2\", m[1]-3);\n}", "function interMouseMove() {\n var m = d3.mouse(this);\n line.attr(\"x2\", m[0]-3)\n .attr(\"y2\", m[1]-3);\n}", "function updateMouseHoverLine() {\r\n for (var i=0; i<lineSegments.length; ++i) {\r\n ls = lineSegments[i];\r\n //determine if cursor position is on or very near a line\r\n var TOLERANCE = CELL_SIZE/2;\r\n var mousePos = {x:mouseX,y:mouseY};\r\n var closestPoint = Geometry.getClosestPointOnLineSegment(ls.p1, ls.p2, mousePos, TOLERANCE)\r\n if (closestPoint != false) {\r\n ls.hover = true;\r\n if (debug && currentTool == \"select-line\" || currentTool == \"delete-line\") {\r\n //draw dot for p2\r\n ctx.beginPath();\r\n ctx.arc(closestPoint.x, closestPoint.y, 2, 0, Math.PI*2, true); \r\n ctx.closePath();\r\n ctx.fillStyle = \"purple\";\r\n ctx.fill();\r\n }\r\n } else {\r\n ls.hover = false;\r\n }\r\n }\r\n}", "function lineMouseOutHandler() {\n for (i = 0; i < dynamicFileList.length; i++) {\n var id = filenameToId(dynamicFileList[i]);\n if (\"line\" + id != this.id) {\n turnOn(filenameToId(dynamicFileList[i]), colorMap.get(id));\n\n }\n }\n}", "function handoffMouseMove() {\n console.log(\"in the mouse move\");\n var m = d3.mouse(this);\n line.attr(\"x2\", m[0])\n .attr(\"y2\", m[1]);\n //timeline_svg.on(\"click\", handoffMouseClick);\n}", "function drawline() {\n\n if (isDrawing) {\n linePoint2 = d3.mouse(this);\n gContainer.select('line').remove();\n gContainer.append('line')\n .attr(\"x1\", linePoint1.x)\n .attr(\"y1\", linePoint1.y)\n .attr(\"x2\", linePoint2[0] - 2) //arbitary value must be substracted due to circle cursor hover not working\n .attr(\"y2\", linePoint2[1] - 2); // arbitary values must be tested\n\n }\n }", "function toolTipLine(){\n var mouseG = svgTs.append(\"g\")\n .attr(\"class\", \"mouse-over-effects\");\n\n mouseG.append(\"path\") // this is the black vertical line to follow mouse\n .attr(\"class\", \"mouse-line\")\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", \"1px\")\n .style(\"opacity\", \"0\");\n\n var lines = document.getElementsByClassName('line');\n\n var mousePerLine = mouseG.selectAll('.mouse-per-line')\n .data(dataset)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"mouse-per-line\");\n\n // mousePerLine.append(\"circle\")\n // .attr(\"r\", 4)\n // .style(\"stroke\", function(d) {\n // return getColorTs(d.key);\n // })\n // .style(\"fill\", \"none\")\n // .style(\"stroke-width\", \"1px\")\n // .style(\"opacity\", \"0\");\n //\n // mousePerLine.append(\"text\")\n // .attr(\"transform\", \"translate(10,3)\")\n\n mouseG.append('svg:rect') // append a rect to catch mouse movements on canvas\n .attr('width', tsWidth) // can't catch mouse events on a g element\n .attr('height', tsHeight)\n .attr('fill', 'none')\n .attr('pointer-events', 'all')\n .on('mouseout', function() { // on mouse out hide line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"0\");\n // d3.selectAll(\".mouse-per-line circle\")\n // .style(\"opacity\", \"0\");\n // d3.selectAll(\".mouse-per-line text\")\n // .style(\"opacity\", \"0\");\n })\n .on('mouseover', function() { // on mouse in show line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"1\");\n // d3.selectAll(\".mouse-per-line circle\")\n // .style(\"opacity\", \"1\");\n // d3.selectAll(\".mouse-per-line text\")\n // .style(\"opacity\", \"1\");\n })\n .on('mousemove', function() { // mouse moving over canvas\n var mouse = d3.mouse(this);\n d3.select(\".mouse-line\")\n .attr(\"d\", function() {\n var d = \"M\" + mouse[0] + \",\" + tsHeight;\n d += \" \" + mouse[0] + \",\" + 0;\n return d;\n });\n\n\n d3.selectAll(\".mouse-per-line\")\n .attr(\"transform\", function(d, i) {\n console.log(tsWidth/mouse[0])\n\n var xDate = tsxScale.invert(mouse[0]);\n var x1 = d3.timeMinute.every(5).round(xDate),\n\n idx = bisectDate(d.values, x1);\ndebugger\n var beginning = 0,\n end = lines[i].getTotalLength(),\n target = null;\n\n while (true){\n target = Math.floor((beginning + end) / 2);\n pos = lines[i].getPointAtLength(target);\n if ((target === end || target === beginning) && pos.x !== mouse[0]) {\n break;\n }\n if (pos.x > mouse[0]) end = target;\n else if (pos.x < mouse[0]) beginning = target;\n else break; //position found\n }\n\n d3.select(this).select('text')\n .text(tsyScale.invert(pos.y))\n .attr(\"font-size\",\"11px\");\n // \"#dot-\" + d.key + \"-\" + idx.style(\"fill\",\"white\").style(\"opacity\",1);\n let xPos = d3.select(\"#dot-\" + d.key + \"-\" + idx).attr(\"cx\");\n\n let yPos = d3.select(\"#dot-\" + d.key + \"-\" + idx).attr(\"cy\");\ndebugger\n d3.select(\"#carIcon-\" + d.key )\n .transition()\n .duration(2000)\n // .attrTween(\"transform\", translateAlong(tsRoutes.node()))\n .ease(d3.easeLinear)\n .attr(\"x\", xPos-5)\n .attr(\"y\", yPos-5);\n // .attr(\"transform\", (d,i)=> {\n // return \"translate(\" + [projectionTs([d.values[i].Long,d.values[i].Lat])[0]-5,projectionTs([d.values[i].Long,d.values[i].Lat])[1]-5] + \")\";\n // });\n// debugger\n return \"translate(\" + mouse[0] + \",\" + pos.y +\")\";\n });\n });\n }", "function mousePressed(){\n\tnext = 0;\n\tdrawing = true;\n\tlast.x = mouseX;\n\tlast.y = mouseY;\n\tlines.push(new Line());\n}", "function mouseoverTrainLine() {\n var lineID = d3.select(this).attr(\"id\");\n d3.select(this).attr(\"style\", \"cursor:pointer\");\n\n var circleID = lineID.replace(\"line\", \"circle\");\n var circle = d3.select(\"#\" + circleID);\n\n if ((popupOpen && circleID != currentCircleID) || editting)\n return;\n\n currentCircleID = circleID;\n currentCircle = circle;\n\n // currentCircle\n // .transition().duration(200)\n // .attr(\"style\", \"cursor:pointer\")\n // .attr(\"r\", 5);\n\n defineChangesFromLine(circleID);\n\n popupOpen = true;\n\n // updatePopupCircleSize(currentCircle);\n // updatePopupCircleContent();\n}", "mousemove_handler(e) {\n if (!this.mouseDown) { return true; }\n\n const local = this.getLocalCoords(this.mainCanvas, e);\n\n this.scratchLine(local.x, local.y, false);\n\n e.preventDefault();\n return false;\n }", "function lineMouseOverHandler() {\n for (i = 0; i < dynamicFileList.length; i++) {\n var id = filenameToId(dynamicFileList[i]);\n if (\"line\" + id != this.id) {\n turnOff(filenameToId(dynamicFileList[i]));\n }\n }\n}", "function onMouseMove(e){\n if (!drawing) { return; }\n drawLine(current.x, current.y, e.clientX, e.clientY, current.color, getLineWidth(), true);\n current.x = e.clientX;\n current.y = e.clientY;\n }", "function handlePencil(e)\n {\n if(isMousePressed)\n {\n let strokeStyle = state.ctx.strokeColor,\n strokeWidth = state.ctx.lineWidth;\n\n $cvs.drawLine({\n strokeStyle: strokeStyle,\n strokeWidth: strokeWidth,\n rounded: true,\n x1: lastX,\n y1: lastY,\n x2: endX,\n y2: endY,\n layer: true,\n groups: [group]\n });\n\n lastX = endX;\n lastY = endY;\n }\n }", "function Line(type){\n this.type = type;\n this.position = {\n x1: null, x2: null, y1: null, y2: null\n };\n this.init = function(){\n this.coordinate.hover(true);\n this.coordinate.show(true)\n artboard.on('mousedown',function(e){\n var data = {};\n \n if(e.originalEvent.detail == 2){\n this.clearPosition();\n data.plot = false;\n }\n else\n {\n ($(e.target).hasClass('coordinate') ? \n\n (\n data.x = Number($(e.target).attr('data-x')) + 2 ,\n data.y = Number($(e.target).attr('data-y')) + 2,\n data.plot = false\n ) \n\n :\n\n ( data.x = e.offsetX, data.y = e.offsetY, data.plot = true)\n\n );\n\n data.isFirst = true;\n data.event = e;\n\n if(this.position.x1 == null)\n {\n this.position.x1 = data.x;\n this.position.y1 = data.y;\n }\n else\n {\n this.position.x2 = data.x;\n this.position.y2 = data.y;\n data.isFirst = false;\n }\n\n this.exe(data);\n }\n \n }.bind(this));\n \n }\n this.fin = function(){\n this.coordinate.hover(false);\n this.clearPosition();\n this.coordinate.show(false);\n artboard.off('mousedown');\n } \n }", "function canvas_mouseDown() {\n mouseDown=1;\n drawLine(ctx,mouseX,mouseY,12);\n\n}", "function handleMouseDown(event) {\n var lLabel = document.getElementById( \"debug-label-2\" );\n gMmouseDown = true;\n var oldX = gLastMouseXdown;\n var oldY = gLastMouseYdown; \n\n if (event.x != undefined && event.y != undefined) {\n gLastMouseXdown = event.x + document.body.scrollLeft +\n document.documentElement.scrollLeft;\n gLastMouseYdown = event.y + document.body.scrollTop +\n document.documentElement.scrollTop;\n lLabel.innerHTML = \"event.x=\" + event.x + \" event.y=\" + event.y;\n } else {\n // Firefox method to get the position\n gLastMouseXdown = event.clientX + document.body.scrollLeft +\n document.documentElement.scrollLeft;\n gLastMouseYdown = event.clientY + document.body.scrollTop +\n document.documentElement.scrollTop;\n lLabel.innerHTML = \"event.clientX=\" + event.clientX + \" event.clientY=\" + event.clientY;\n }\n\n gLastMouseXdown -= gCanvas.offsetLeft;\n gLastMouseYdown -= gCanvas.offsetTop;\n lLabel.innerHTML += \" handleMouseDown: old(\"+oldX+\",\"+oldY+\")\"+\" new(\"+gLastMouseXdown+\",\"+gLastMouseYdown+\")\"\n\n if (lProx) {\n lEdit = true;\n } else if (vGProx || !moved) {\n vEdit = true;\n } else {\n gLineVertices = [\n oldX, oldY,\n gLastMouseXdown, gLastMouseYdown\n ]; \n }\n\n// refreshCanvas();\n}", "function lineMouseOver(l, i) {\n var major = getMajorAsClass(l[0].major);\n\n changeElementOpacityForDifferentMajors(\"vis2-line\", major, '.1');\n changeElementOpacityForDifferentMajors(\"vis2-dot\", major, '.1');\n\n // this makes the tooltip visible\n div.transition()\n .duration(50)\n .style(\"opacity\", .9);\n\n var string = \"Women majoring in <i>\" + l[0]['major'] + '</i>';\n\n // this sets the location and content of the tooltip to the point's location/coordinates\n div.html(string)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n}", "function onMouseDown(event){\n xSpot = event.clientX;\n ySpot = event.clientY;\n if (xSpot<(window.innerWidth-96) && 96<xSpot && ySpot<(window.innerHeight-32) && 32<ySpot){\n var whichLineInDocuY = Math.floor((ySpot+window.pageYOffset)/(16+lineSpace));\n var whichCharInLineX = Math.floor((xSpot-96)/12);\n var characterLineClickedOn = 0;\n\n if ((whichLineInDocuY-1)<arrayOfLines.length){\n for (var line = 0; line<whichLineInDocuY-1; line++){\n if (arrayOfLines[line].length<lineLength){\n characterLineClickedOn+=arrayOfLines[line].length+1; \n }\n else{\n characterLineClickedOn+=arrayOfLines[line].length;\n }\n }\n\n if (whichCharInLineX < arrayOfLines[whichLineInDocuY-1].length){\n currentCursorSpot=characterLineClickedOn+whichCharInLineX; \n }\n else{\n currentCursorSpot=characterLineClickedOn+arrayOfLines[whichLineInDocuY-1].length;\n }\n draw();\n }\n }\n}", "function mousemove() {\r\n if (drawing_line && !should_drag) {\r\n var m = d3.mouse(svg.node());\r\n var x = Math.max(0, Math.min(width, m[0]));\r\n var y = Math.max(0, Math.min(height, m[1]));\r\n // debounce - only start drawing line if it gets a bit big\r\n var dx = selected_node.x - x;\r\n var dy = selected_node.y - y;\r\n if (Math.sqrt(dx * dx + dy * dy) > 10) {\r\n // draw a line\r\n if (!new_line) {\r\n new_line = linesg.append(\"line\").attr(\"class\", \"new_line\");\r\n }\r\n new_line.attr(\"x1\", function(d) { return selected_node.x; })\r\n .attr(\"y1\", function(d) { return selected_node.y; })\r\n .attr(\"x2\", function(d) { return x; })\r\n .attr(\"y2\", function(d) { return y; });\r\n }\r\n }\r\n update();\r\n}", "function mousemove() {\n if (drawing_line && selected_node) {\n var m = d3.mouse(d3.select(\"svg\").node());\n m = d3.zoomTransform(d3.select(\"svg\").node()).invert(m);\n var x = Math.max(0, Math.min(width, m[0]));\n var y = Math.max(0, Math.min(height, m[1]));\n // debounce - only start drawing line if it gets a bit big\n var dx = selected_node.x - x;\n var dy = selected_node.y - y;\n //console.log(\"mouse move: dx=\"+dx+\", dy=\"+dy)\n if (Math.sqrt(dx * dx + dy * dy) > 10) {\n \n // draw a line\n if (!new_line) {\n new_line = g.append(\"line\").attr(\"class\", \"new_line\");\n }\n new_line.attr(\"x1\", function(d) { return selected_node.x; })\n .attr(\"y1\", function(d) { return selected_node.y; })\n .attr(\"x2\", function(d) { return x; })\n .attr(\"y2\", function(d) { return y; });\n }\n }\n //update(link_data, node_data);\n}", "onLineMouseOver(part) {\n this.setState({...this.state,selectedPart: part})\n }", "function mouseoutTrainLine() {\n var lineID = d3.select(this).attr(\"id\");\n\n var circleID = lineID.replace(\"line\", \"circle\");\n var circle = d3.select(\"#\" + circleID);\n\n circle\n .transition().duration(200)\n .attr(\"r\", 2);\n if (!editting) {\n popup.style(\"visibility\", \"hidden\");\n popupRect.style(\"visibility\", \"hidden\");\n popupOpen = false;\n }\n}", "setLineCoordinates() {\n if (this.shown) {\n //if not self link && not linker modified pep\n if (!this.crosslink.isSelfLink() && this.crosslink.toProtein) {\n let x, y;\n const source = this.renderedFromProtein.getRenderedInteractor();\n const target = this.renderedToProtein.getRenderedInteractor();\n if (!source.ix || !source.iy) {\n console.log(\"NOT\");\n }\n // from end\n if (source.type === \"group\" || !source.expanded) {\n x = source.ix;\n y = source.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.fromResidue, this.renderedFromProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x1\", x);\n this.line.setAttribute(\"y1\", y);\n this.highlightLine.setAttribute(\"x1\", x);\n this.highlightLine.setAttribute(\"y1\", y);\n\n // to end\n if (target.type === \"group\" || !target.expanded) {\n x = target.ix;\n y = target.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.toResidue, this.renderedToProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x2\", x);\n this.line.setAttribute(\"y2\", y);\n this.highlightLine.setAttribute(\"x2\", x);\n this.highlightLine.setAttribute(\"y2\", y);\n\n }\n }\n }", "mousedown_handler(e) {\n const local = this.getLocalCoords(this.mainCanvas, e);\n this.mouseDown = true;\n\n this.scratchLine(local.x, local.y, true);\n\n e.preventDefault();\n return false;\n }", "function showCrosshair(e, show){\n if (show){\n var mouseX = d3.mouse(e)[0];\n var mouseY = d3.mouse(e)[1];\n\n hLine.attr(\"y1\", mouseY).attr(\"y2\", mouseY).style(\"opacity\", 1);\n vLine.attr(\"x1\", mouseX).attr(\"x2\", mouseX).style(\"opacity\", 1);\n }else{\n hLine.style(\"opacity\", 0);\n vLine.style(\"opacity\", 0);\n } \n}", "function started() {\r\n d3.selectAll(\".mouse-line\").classed(\"aleph-hide\", true);\r\n d3.selectAll(\".mouse-per-line\").classed(\"aleph-hide\", true);\r\n d3.selectAll(\".aleph-toolTip-Div\").classed(\"aleph-hide\", true);\r\n\r\n var p = d3.mouse(aleph.mouseoverRectangle);\r\n\r\n aleph.selectionRectangle.rectElement = d3\r\n .select(\"#aleph-line-chart\")\r\n .append(\"rect\")\r\n .attr(\"class\", \"selection\")\r\n .attr(\"rx\", 0)\r\n .attr(\"ry\", 0)\r\n .attr(\"x\", 0)\r\n .attr(\"y\", 0)\r\n .attr(\"width\", 0)\r\n .attr(\"height\", 0);\r\n\r\n aleph.selectionRectangle.originX = p[0];\r\n aleph.selectionRectangle.originY = p[1];\r\n\r\n aleph.selectionRectangle.currentX = p[0];\r\n aleph.selectionRectangle.currentY = p[1];\r\n\r\n getNewAttributes();\r\n\r\n aleph.chartStartDragX = aleph.xMain.invert(\r\n p[0] - aleph.margin.line[aleph.windowSize].left\r\n );\r\n\r\n aleph.chartStartDragY = aleph.yMain.invert(\r\n p[1] - aleph.margin.line[aleph.windowSize].top\r\n );\r\n\r\n aleph.chartDraggedCoordinates = [\r\n [aleph.chartStartDragX, aleph.chartStartDragY],\r\n [0, 0],\r\n ];\r\n\r\n // var chartWidth = aleph.xMain.range()[1] - aleph.xMain.range()[0];\r\n // var chartHeight = aleph.yMain.range()[0] - aleph.yMain.range()[1];\r\n\r\n // d3.selectAll(\".aleph-line-chart\")\r\n // .append(\"svg:image\")\r\n // .attr(\"class\", \"aleph-wasteBin\")\r\n // .attr(\"id\", \"aleph-wasteBin\")\r\n // .attr(\"xlink:href\", \"image/wasteBin.svg\")\r\n // .attr(\"width\", 50)\r\n // .attr(\"height\", 50)\r\n // .attr(\"x\", aleph.margin.line[aleph.windowSize].left + 10)\r\n // .attr(\"y\", aleph.margin.line[aleph.windowSize].top + chartHeight - 55);\r\n\r\n // document.getElementById(\"line-reset-axes\").disabled = false;\r\n\r\n return;\r\n}", "function OnMouseMove(e) {\n if (!pressed) return;\n en = { x: e.x - rect.left, y: e.y - rect.top };\n clearCanvas();\n drawLineUpperLayer(st, en);\n}", "function viewport_line(e){\n\tsettings.colors.line=e.srcElement.value;\n\tvp.line=settings.colors.line;\t\n}", "function mousemove() {\n var x0 = x.invert(d3.mouse(this)[0]),\n i = bisectDate(data, x0, 1),\n d0 = data[i - 1],\n d1 = data[i],\n d = x0 - d0.date > d1.date - x0 ? d1 : d0;\n\n focus\n .select(\".lineHover\")\n .attr(\"transform\", \"translate(\" + x(d.date) + \",\" + height + \")\");\n\n focus\n .select(\".lineHoverDate\")\n .attr(\n \"transform\",\n \"translate(\" + x(d.date) + \",\" + (height + margin.bottom) + \")\"\n )\n .text(formatDate(d.date));\n\n focus\n .selectAll(\".hoverCircle\")\n .attr(\"cy\", (e) => y(d[e]))\n .attr(\"cx\", x(d.date));\n\n focus\n .selectAll(\".lineHoverText\")\n .attr(\"transform\", \"translate(\" + x(d.date) + \",\" + height / 2.5 + \")\")\n .text((e) => e + \" \" + formatValue(d[e]) + \"%\");\n\n x(d.date) > width - width / 4\n ? focus\n .selectAll(\"text.lineHoverText\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"dx\", -10)\n : focus\n .selectAll(\"text.lineHoverText\")\n .attr(\"text-anchor\", \"start\")\n .attr(\"dx\", 10);\n\n //reorders Gantt bars depending on the mouse position\n reorderGanttBars(d.date);\n }", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.stroke = 2;\n this.mouseover = true;\n }\n else {\n this.stroke = 1;\n this.mouseover = false;\n }\n }", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.mouseover = true;\n this.stroke = 3;\n }\n else {\n this.mouseover = false;\n this.stroke = 2;\n }\n }", "function handleMouseOver() { // Add interactivity\n// Use D3 to select element, change color and size\n\td3.select(this)\n\t\t.style(\"fill\", \"orange\")\n\t\t.attr(\"r\", 15);\n\t\n}", "function drawLine(){\n if(mouseDown){\n c.beginPath();\n c.strokeStyle = 'rgba(0,0,0, 0.75)'; \n c.moveTo(ballX + (ballRadius/2), ballY + (ballRadius/2));\n c.lineTo(mouseX, mouseY);\n c.lineWidth = \"2\";\n c.stroke();\n }\n}", "function handleMouseOver(){\r\n d3.select(this)\r\n .transition(\"mouse\")\r\n .attr(\"fill\",\"#A04000\")\r\n .attr(\"stroke\", \"#641E16\")\r\n .attr(\"stroke-width\", 5)\r\n .style(\"cursor\", \"pointer\")\r\n }", "function pinselada() {\n ctx.lineWidth = tamLinea;\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n ctx.lineTo(mouse.x, mouse.y);\n ctx.stroke();\n }", "function drawHere(e, canvas, isLine){\n var mouseX = e.pageX - canvas.offsetLeft;\n var mouseY = e.pageY - canvas.offsetTop;\n\tif(isLine == 'line'){\n doTo(['all'], 'draw', myColor, pastX, pastY, mouseX, mouseY);\n\t}else{\n doTo(['all'], 'draw', myColor, mouseX -1, mouseY, mouseX, mouseY);\n\t}\n\tpastX = mouseX;\n\tpastY = mouseY;\n}", "function node_mouseover(d) {\r\n if (drawing_line && d !== selected_node) {\r\n // highlight and select target node\r\n selected_target_node = d;\r\n }\r\n}", "function mouseDraw(event) {\n // stop if not mouse down\n if (!isDrawing) return;\n\n // * set the stroke color\n ctx.strokeStyle = color;\n\n // draw the line\n ctx.beginPath();\n ctx.moveTo(lastX, lastY);\n // console.log(lastX, lastY);\n // console.log(event.offsetX, event.offsetY);\n\n ctx.lineTo(event.offsetX * 2, event.offsetY * 2);\n ctx.stroke();\n\n // reset lastX and lastY to be current event's offsetX and offsetY\n [lastX, lastY] = [event.offsetX * 2, event.offsetY * 2];\n}", "function mousemove() {\n if(!mousedown_node) return;\n\n // update drag line\n drag_line.attr('d', 'M' + mousedown_node.x + ',' + mousedown_node.y + 'L' + d3.mouse(this)[0] + ',' + d3.mouse(this)[1]);\n\n /////////////////restart();\n }", "function sketchpad_mouseMove(e) { \n // Update the mouse co-ordinates when moved\n getMousePos(e);\n\n // Draw a line if the mouse button is currently being pressed\n if (mouseDown==1) {\n drawLine(ctx, mouseX, mouseY);\n }\n}", "function lineMouseOut(l, i) {\n var major = getMajorAsClass(l[0].major);\n\n changeElementOpacityForDifferentMajors(\"vis2-line\", major, '1');\n changeElementOpacityForDifferentMajors(\"vis2-dot\", major, '1');\n\n div.transition()\n .duration(100)\n .style(\"opacity\", 0);\n}", "function mouseMoveHandler(event){\n\t\t\tif(event.pageX == null && event.clientX != null){\n\t\t\t\tvar de = document.documentElement, b = document.body;\n\t\t\t\tlastMousePos.pageX = event.clientX + (de && de.scrollLeft || b.scrollLeft || 0);\n\t\t\t\tlastMousePos.pageY = event.clientY + (de && de.scrollTop || b.scrollTop || 0);\n\t\t\t}else{\n\t\t\t\tlastMousePos.pageX = event.pageX;\n\t\t\t\tlastMousePos.pageY = event.pageY;\n\t\t\t}\n\t\t\t\n\t\t\tvar offset = overlay.cumulativeOffset();\n\t\t\tvar pos = {\n\t\t\t\tx: xaxis.min + (event.pageX - offset.left - plotOffset.left) / hozScale,\n\t\t\t\ty: yaxis.max - (event.pageY - offset.top - plotOffset.top) / vertScale\n\t\t\t};\n\t\t\t\n\t\t\tif(options.mouse.track && selectionInterval == null){\t\t\t\t\n\t\t\t\thit(pos);\n\t\t\t}\n\t\t\t\n\t\t\ttarget.fire('flotr:mousemove', [event, pos]);\n\t\t}", "function mousemove() {\n d3.event.preventDefault();\n if (drawing_line && !should_drag) {\n var m = d3.mouse(d3.select(\"svg\").node());\n m = d3.zoomTransform(d3.select(\"svg\").node()).invert(m);\n var x = Math.max(0, Math.min(width, m[0]));\n var y = Math.max(0, Math.min(height, m[1]));\n // debounce - only start drawing line if it gets a bit big\n var dx = selected_node.x - x;\n var dy = selected_node.y - y;\n if (Math.sqrt(dx * dx + dy * dy) > 10) {\n // draw a line\n if (!new_line) {\n new_line = linkg.append(\"line\").attr(\"class\", \"new_line\");\n }\n new_line.attr(\"x1\", function(d) { return selected_node.x; })\n .attr(\"y1\", function(d) { return selected_node.y; })\n .attr(\"x2\", function(d) { return x; })\n .attr(\"y2\", function(d) { return y; });\n }\n }\n update(link_data, node_data);\n}", "function ListBox_Line_Mousedown(event)\n{\n\t//get event type\n\tvar evtType = Browser_GetMouseDownEventType(event);\n\t//valid?\n\tif (evtType)\n\t{\n\t\t//in touch browser? event was touch start?\n\t\tif (__BROWSER_IS_TOUCH_ENABLED && evtType == __BROWSER_EVENT_MOUSEDOWN)\n\t\t{\n\t\t\t//convert touchstarts to double clicks\n\t\t\tevtType = __BROWSER_EVENT_DOUBLECLICK;\n\t\t}\n\t\t//block the event\n\t\tBrowser_BlockEvent(event);\n\t\t//destroy menus\n\t\tPopups_TriggerCloseAll();\n\t\t//get the line we clicked on\n\t\tvar theLine = Browser_GetEventSourceElement(event);\n\t\t//search for the correct item\n\t\twhile (theLine && !theLine.Item)\n\t\t{\n\t\t\t//iterate\n\t\t\ttheLine = theLine.parentNode;\n\t\t}\n\t\t//valid?\n\t\tif (theLine && theLine.Item)\n\t\t{\n\t\t\t//retrieve our item\n\t\t\tvar item = theLine.Item;\n\t\t\t//retrieve our object\n\t\t\tvar theObject = item.InterpreterObject;\n\t\t\t//indicate to the simulator that we detected something on us\n\t\t\t__SIMULATOR.NotifyFocusEvent(null, false, theObject);\n\t\t\t//the selection state of the line\n\t\t\tvar bSelected = item.Selected;\n\t\t\t//want to reset?\n\t\t\tvar bReset = false;\n\t\t\t//event to trigger\n\t\t\tvar eEvent = false;\n\t\t\t//switch on the event\n\t\t\tswitch (evtType)\n\t\t\t{\n\t\t\t\tcase __BROWSER_EVENT_CLICK:\n\t\t\t\t\t//we in multi selection? or not selected or in designer\n\t\t\t\t\tif (theObject.MultiSelection || !bSelected || __DESIGNER_CONTROLLER)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set event as click\n\t\t\t\t\t\teEvent = __NEMESIS_EVENT_SELECT;\n\t\t\t\t\t\t//toggle selection\n\t\t\t\t\t\tbSelected = !bSelected;\n\t\t\t\t\t\t//reset if we are arent multiselection\n\t\t\t\t\t\tbReset = !theObject.MultiSelection;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase __BROWSER_EVENT_MOUSERIGHT:\n\t\t\t\t\t//set event as right click\n\t\t\t\t\teEvent = __NEMESIS_EVENT_RIGHTCLICK;\n\t\t\t\t\tbreak;\n\t\t\t\tcase __BROWSER_EVENT_DOUBLECLICK:\n\t\t\t\t\t//set event as double click\n\t\t\t\t\teEvent = __NEMESIS_EVENT_DBLCLICK;\n\t\t\t\t\t//ensure it will be selected\n\t\t\t\t\tbSelected = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//valid event?\n\t\t\tif (eEvent)\n\t\t\t{\n\t\t\t\t//update creation point\n\t\t\t\tPopupMenu_UpdateCreationPoint(event);\n\t\t\t\t//get the data\n\t\t\t\tvar data = \"\" + (item.Index + 1);\n\t\t\t\t//create a result for unselecting it\n\t\t\t\tvar result = (theObject.MultiSelection && eEvent == __NEMESIS_EVENT_SELECT) ? {} : __SIMULATOR.ProcessEvent(new Event_Event(theObject, eEvent, data));\n\t\t\t\t//not blocking it? always block in designer\n\t\t\t\tif (!result.Block && !__DESIGNER_CONTROLLER)\n\t\t\t\t{\n\t\t\t\t\t//not an action?\n\t\t\t\t\tif (!result.AdvanceToStateId)\n\t\t\t\t\t{\n\t\t\t\t\t\t//mark as we have a user data\n\t\t\t\t\t\ttheObject.HasUserInput = true;\n\t\t\t\t\t\t//notify that we have changed data\n\t\t\t\t\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_USER_DATA, Name: theObject.GetDesignerName(), Data: data });\n\t\t\t\t\t}\n\t\t\t\t\t//need reset?\n\t\t\t\t\tif (bReset)\n\t\t\t\t\t{\n\t\t\t\t\t\t//loop through all the items\n\t\t\t\t\t\tfor (var i = 0, c = theObject.Items.length; i < c; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//unselect it\n\t\t\t\t\t\t\ttheObject.Items[i].Selected = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//update the state of our line\n\t\t\t\t\titem.Selected = bSelected;\n\t\t\t\t\t//refresh the listbox\n\t\t\t\t\tListBox_Paint(theObject);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function prepareLineTooltip(e) {\n var boxData = this.getBoundingClientRect();\n var currentXPosition = e.pageX - (boxData.left + (document.documentElement.scrollLeft || document.body.scrollLeft));\n var currentYPosition = e.pageY - (boxData.top + (document.documentElement.scrollTop || document.body.scrollTop));\n var closestPointOnX = getClosestNumberFromArray(currentXPosition, pointValues);\n\n var pointElements = chart.container.querySelectorAll('.' + chart.options.classNames.point + '[x1=\"' + closestPointOnX + '\"]');\n var pointElement;\n\n if (pointElements.length <= 1) {\n pointElement = pointElements[0];\n } else {\n var yPositions = [];\n var closestPointOnY;\n\n Array.prototype.forEach.call(pointElements, function(point) {\n yPositions.push(point.getAttribute('y1'));\n });\n\n closestPointOnY = getClosestNumberFromArray(currentYPosition, yPositions);\n pointElement = chart.container.querySelector('.' + chart.options.classNames.point + '[x1=\"' + closestPointOnX + '\"][y1=\"' + closestPointOnY + '\"]');\n }\n\n if (!pointElement || matches(pointElement, '.' + hoverClass)) {\n return;\n }\n\n showTooltip(pointElement);\n }", "function handleOnMouseOver(oTr)\n{\ndeselectAll();\noTr.className = \"highlightrow\";\nposition = oTr.id.substring(2, oTr.id.length);\n}", "function startLine(e){\n\t\t\tcontext.beginPath();\n\t\t\tcontext.strokeStyle = \"black\";\n\t\t\tcontext.lineCap = \"round\";\n\t\t\tcontext.lineWidth = 5;\n\t\t\tcontext.moveTo(e.clientX - theCanvas.offsetLeft, e.clientY - theCanvas.offsetTop);\n\t\t}", "function drawingLayerMouseMove (e) {\n // This function is fired when mouse cursor moves\n // over the drawing layer.\n var mousePosition = mouseposition(e, this);\n mouseStatus.currX = mousePosition.x;\n mouseStatus.currY = mousePosition.y;\n\n // Change a cursor according to the label type.\n // $(this).css('cursor', )\n if ('ribbon' in svl) {\n var cursorImagePaths = svl.misc.getLabelCursorImagePath();\n var labelType = svl.ribbon.getStatus('mode');\n if (labelType) {\n var cursorImagePath = cursorImagePaths[labelType].cursorImagePath;\n var cursorUrl = \"url(\" + cursorImagePath + \") 6 25, auto\";\n\n if (rightClickMenu && rightClickMenu.isAnyOpen()) {\n cursorUrl = 'default';\n }\n\n $(this).css('cursor', cursorUrl);\n }\n } else {\n throw self.className + ': Import the RibbonMenu.js and instantiate it!';\n }\n\n\n if (!status.drawing) {\n var ret = isOn(mouseStatus.currX, mouseStatus.currY);\n if (ret && ret.className === 'Path') {\n self.showLabelTag(status.currentLabel);\n ret.renderBoundingBox(ctx);\n } else {\n self.showLabelTag(undefined);\n }\n }\n self.clear();\n self.render2();\n mouseStatus.prevX = mouseposition(e, this).x;\n mouseStatus.prevY = mouseposition(e, this).y;\n }", "function canvasMouseMoveEv(event) {}", "e_mouseOver(e)\n\t{\n\n\t}", "function drawLines() {\n}", "function drawLines() {\n}", "function onMouseUp(e){\n if (!drawing) { return; }\n drawing = false;\n drawLine(current.x, current.y, e.clientX, e.clientY, current.color, getLineWidth(), true);\n }", "startdraw(ev) {\n this.is_drawing = true;\n var rect = this.canvas.getBoundingClientRect();\n this.ctx.beginPath();\n this.ctx.lineWidth = 5;\n this.ctx.lineCap = 'round';\n this.ctx.strokeStyle = 'red';\n var x = ev.pageX - rect.left;\n var y = ev.pageY - rect.top;\n this.ctx.moveTo(x, y);\n ev.preventDefault();\n }", "function highlightSpecialLines() {\n // identify all lines\n find_lines();\n\n d3.select('.increase')\n .on('click', function() {\n // if the lines were already filtered out\n if (state.green) {\n resetSelection();\n state.green = false;\n } else {\n highlightNav(special_lines.green);\n highlightLine(special_lines.green);\n highlightLabel(special_lines.green);\n state.green = true;\n }\n // update graph filter status and reset button\n checkFiltered();\n updateReset();\n })\n\n d3.select('.decrease')\n .on('click', function() {\n if (state.red) {\n resetSelection();\n state.red = false;\n } else {\n state.red = true;\n highlightNav(special_lines.red);\n highlightLine(special_lines.red);\n highlightLabel(special_lines.red);\n }\n // determine if graph is filtered\n checkFiltered();\n updateReset();\n })\n }", "function mouseMoved(){\n stroke(r, g, b, 120);\n strokeWeight(5);\n fill(r, g, b, 100);\n ellipse(mouseX, mouseY, 10);\n}", "_onMovedLineClicked(e) {\n e.preventDefault();\n e.stopPropagation();\n\n this.trigger('moveFlagClicked', $(e.target).data('line'));\n }", "_handleMouseEnter() {\n this._hovered.next(this);\n }", "function touchlines()\n{\n\tfamilyMapOps.foreachperc(function( perid, famid){\n\n\t\t//console.log(\"touch\", perid, famid);\n\n\t\tvar e = new CustomEvent(\"dragmove\", {target: {attrs: {x:10, y:10}}}),\n\t\t\to = uniqueGraphOps.getFam(famid).nodes[perid].graphics;\n\n\t\to.dispatchEvent(e);\n\t});\n}", "function onMouse_Item(event, source, typeView) {\r\n\tif (typeView == 'border') {\r\n\t\tif (event.type == 'mouseover') {\r\n\t\t\t//mouseover\r\n\t\t\tevent.cancelBubble=true;\r\n\t\t\treturn showBorder(source);\r\n\t\t} else {\r\n\t\t\t//mouseout\r\n\t\t\tevent.cancelBubble=true;\r\n\t\t\treturn removeBorder(source);\r\n\t\t}\r\n\t} else {\r\n\t\tif (event.type == 'mouseover') {\r\n\t\t\tevent.cancelBubble=true;\r\n\t\t\treturn highlight(source);\r\n\t\t} else {\r\n\t\t\tevent.cancelBubble=true;\r\n\t\t\treturn lowlight(source);\r\n\t\t}\r\n\t}\r\n}", "function drawLine(e, clientX, clientY) {\r\n e.preventDefault();\r\n var rect = ctx.canvas.getBoundingClientRect();\r\n line.push([clientX, clientY]);\r\n for (i = 1; i <= line.length - 1; i++) {\r\n ctx.beginPath();\r\n\r\n //Set starting point for new line\r\n ctx.moveTo(line[i - 1][0], line[i - 1][1]);\r\n\r\n //Set thick red line style\r\n ctx.lineWidth = 5;\r\n ctx.strokeStyle = \"rgba(255,0,0, .5)\";\r\n ctx.fillStyle = \"#FF0000\";\r\n\r\n //Create line from last point to new point\r\n ctx.lineTo(line[i][0], line[i][1]);\r\n //Draw line\r\n ctx.stroke();\r\n }\r\n }", "function mouseOver(x, y) {\r\n\t//debugOut(\"mouse over, x=\"+x+\" y=\"+y);\r\n\t\r\n\t//*** Your Code Here\r\n}", "function drawAllLines() {\n var j;\n\n for(j=0; j< series.length; j++) {\n var color = graph.options.colors[j+seriesIndex],\n line = graph.paper.path(\"M0 0\").attr({\n 'stroke': color,\n 'stroke-width': graph.options.lines.width,\n 'opacity': graph.options.lines.opacity\n });\n\n drawLine({\n series:series[j],\n line:line,\n isLineFilled:graph.seriesOptions[seriesIndex].fillLines,\n color:color,\n units:graph.seriesOptions[seriesIndex].pointLabelUnits\n });\n\n\n }\n\n var rollOvers = graph.paper.set();\n for(j=0; j< graph.numPoints; j++) {\n if (graph.tooltips && graph.tooltips[j]) {\n rollOvers.push(lineHover(series, graph.yTicks[seriesIndex], j, graph.seriesOptions[seriesIndex]));\n }\n }\n rollOvers.toFront();\n }", "function dibujoMouseMove(evento)\n{\n \n if (estado == true)//paso2: como el estado es igual a true se ejecuta el bloque de codigo \n {\n dibujarLinea(color, xinic, yinic, evento.offsetX , evento.offsetY , trazo);//paso2: se ejecuta la funcion dibujarLinea\n }\n\n xinic = evento.offsetX;//paso2: al mover el mause asigna esa posicion en x \n yinic = evento.offsetY;//paso2: al mover el mause asigna esa posicion en y\n console.log(xinic+\"*-*\"+yinic);\n}", "function mouseOverGraphic(ev) {\n map.setMapCursor(\"crosshair\");\n}", "function triggerEvents (line) {\n var type = line.getAttribute('_type');\n\n // line event\n trigger('line', line, [line]);\n\n // line type event\n trigger(type, line, [line]);\n\n // highlight event\n if (line.getAttribute('highlight') === 'true') {\n trigger('line:highlight', line, [line]);\n }\n\n // fire events for all elements in the line\n var els = line.querySelectorAll('*');\n for (var i = 0, l = els.length; i < l; i++) {\n triggerElementEvents(els[i], line);\n }\n }", "_strikeMouseMove() {\n for (let i = 0; i < this._mouseMoveCallbacks.length; i++) {\n let currentCallback = this._mouseMoveCallbacks[i][0];\n\n currentCallback(this, event);\n }\n\n for (let i = 0; i < this._mouseMoveCallbacks.length; i++) {\n if (this._mouseMoveCallbacks[i][1])\n this._mouseMoveCallbacks.splice(i--, 1);\n }\n }", "function onLineClicked(e) {\n e.target.style.stroke = getRandomColorHSL();\n}", "hover(x, y){\n var self = this;\n self.startX = x || self.startX;\n self.startY = y || self.startY;\n self.draw(self.selected ? self.line.keyboard.keySelectedHoverBorderColor : self.line.keyboard.keyHoverBorderColor, true);\n }", "function onPolylineMouseOver(e) {\n\tvar tooltipContent = \"\";\n\tthis.setOptions(onPolylineHoverColorOptions);\n\tif (this.linkColor != \"undefined\") {\n\t\tthis.icons[0].icon.fillColor = this.linkColor;\n\t}\n\ttooltipContent = \"<span>\" + this.linkName + \"</span><hr>number of records: \" + this.numberOfRecords;\n\ttooltipContent += \"<br>approx. median travel-time: \" + this.medianTtString;\n\ttooltipContent += \"<br>approx. median speed (mph): \" + this.medianSpeedMph;\n\ttooltipContent += \"<br>median record timestamp: \" + moment(this.medianTtDatetime).format(\"M-DD-YY h:mm:ss a\");\n\ttooltipContent += \"<br>segment length: \" + this.linkLength + \" meters (\" + (this.linkLength * 3.2808).toFixed(2) + \" ft)\";\n\ttooltipContent += \"<br>segment ID \" + this.sid;\n\ttooltipContent += \"<br>segment points: \" + this.lid0 + \" to \" + this.lid1;\n\tlinkToolTip.setContent(tooltipContent);\n\t//here e is the overlay object and whenever we hover over the overlay we can get the coords to use with our infobox tooltip\n\tlinkToolTip.setPosition(e.latLng);\n\tlinkToolTip.open(map);\n}", "function writeHandoff() {\n handoff_counter++;\n DRAWING_HANDOFF = true;\n var m = d3.mouse(this);\n console.log(\"x: \" + m[0] + \" y: \" + m[1]);\n line = timeline_svg.append(\"line\")\n .attr(\"class\", \"handOffLine\")\n .attr(\"id\", function() {\n return \"handoff_\" + handoff_counter;\n })\n .attr(\"x1\", m[0])\n .attr(\"y1\", m[1])\n .attr(\"x2\", m[0])\n .attr(\"y2\", m[1])\n .attr(\"stroke-width\", 3)\n .attr(\"stroke\", \"gray\");\n console.log(line);\n timeline_svg.on(\"mousemove\", handoffMouseMove);\n}", "function onMoveLine(direction, lineId) {\n moveLine(direction, lineId);\n showImg();\n drawText()\n}", "function draw_line(e){\n\n //console.log(\"PrevX:\"+prevX);\n draw_dot(e);\n \n ctx.lineTo(e.offsetX,e.offsetY);\n \n ctx.stroke();\n\n //console.log(\"PrevX:\"+prevX);\n}", "function touchMoved() {\n strokeWeight(10);\n stroke(252, 74, 26);\n\n line(mouseX, mouseY, pmouseX, pmouseY);\n return false;\n}", "function onMouseDown(event) {\n // get the location of the mouse on the canvas\n let [x, y] = getXY(event);\n\n // if this is a brand new curve, add the first control point\n if (_model.points.count === 0) { //it adds the new point to the point list\n _model.points.add(x, y, 0);\n }\n // add a new control point that will be saved on the next mouse click\n // (the location of the previous control point is now frozen)\n _model.points.add(x, y, 0);\n draw();\n}", "function draw() {\n if (mouseIsPressed) {\n stroke(currentColor);\n strokeWeight(currentStroke)\n line(mouseX, mouseY, pmouseX, pmouseY);\n }\n}", "function sketchpad_mouseDown() {\n mouseDown=1;\n ctx.beginPath();\n drawLine(ctx,mouseX,mouseY);\n console.log('A line is drawn!')\n}", "function drawLine(name,x0, y0, x1, y1, thickness, color, emit){\n listOfCanvas[name].context.beginPath();\n\t\tlistOfCanvas[name].context.globalCompositeOperation=\"source-over\";\n\t\tlistOfCanvas[name].context.moveTo((x0 + $(\"#canvasContainer\" + listOfCanvas[name].container).scrollLeft()), y0);\n\t\tlistOfCanvas[name].context.lineTo((x1 + $(\"#canvasContainer\" + listOfCanvas[name].container).scrollLeft()), y1);\n\t\tlistOfCanvas[name].context.strokeStyle = color;\n\t\tlistOfCanvas[name].context.lineWidth = thickness*scale;\n\t\tlistOfCanvas[name].context.stroke();\n listOfCanvas[name].context.closePath();\n }", "function handlePointHoverEnter (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleHover;\n point.redraw();\n }", "function handlePointHoverEnter (e) {\n var point = $(this).data(\"point\");\n point.style = pointStyleHover;\n point.redraw();\n }", "function highlightLine(highlight) {\n d3.selectAll('.elm')\n .transition()\n .style('opacity', 0.1)\n .style('stroke-width', 1)\n\n var n = highlight.length;\n for (var i = 0; i < n; i++) {\n d3.selectAll('.sel-'+highlight[i]).transition()\n .style('opacity', 1).style('stroke-width', 3);\n }\n }", "function clickFunction(e){\n var currLine = getCurrentLine(this);\n num_lines_selected = 1; //returns to default, in case just clicking, if it is selected that's taken care of in subsequent onselect\n prevLine = currLine;\n}", "function handleMouseOverElement(e) {\n\t\t\te.currentTarget.addClassName('highlight');\n\t\t\ttheInterface.emit('ui:emphElement', {\n\t\t\t\tid : e.currentTarget.getAttribute('id'),\n\t\t\t\tlayer : e.currentTarget.getAttribute('data-layer')\n\t\t\t});\n\t\t}", "function f_addMouseOver(){\n mxGraph.addMouseListener({\n //set tmp cell\n cell: null,\n mouseMove: function(sender, me) {\n //check, if selected cell changed\n var currentCell = me.getCell();\n if (me.getCell() !== this.cell) {\n if (this.cell !== null) {\n this.dragLeave(me.getEvent(), this.cell);\n }\n this.cell = currentCell;\n if (this.cell !== null) {\n this.dragEnter(me.getEvent(), this.cell);\n }\n }\n },\n dragEnter: function(evt, cell) {\n f_updateStyle(this.cell, true);\n f_highlightPublications(this.cell.id);\n },\n dragLeave: function(evt, cell) {\n f_clearHighlightPublications();\n f_updateStyle(cell, false);\n },\n mouseDown: function(sender, me) {\n //do nothing\n },\n mouseUp: function(sender, me) {\n //do nothing\n }\n });\n}", "function createPointerEnterLinkHandler(polyline){\n return function(evt){\n polyline.setStyle(HOVER_LINK_STYLE);\n };\n}", "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {\n this.plugins.lineRenderer.highlightCanvas.resetCanvas();\n this.plugins.lineRenderer.highlightCanvas = null;\n }\n \n this.plugins.lineRenderer.highlightedSeriesIndex = null;\n this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.lineRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }", "function mouseOver() {\n setMouseOver(true);\n }", "function draw() {\n \n//This is checking the mouses position for both the x/y cords to see it its within the\n//area I have limited it to (x of 0 to 594, and y of 0 to 841)\nif(mouseX >= 0 && mouseX <= 0+594 && mouseY >= 0 && mouseY <= 0+841){\n clickArea = true;\n} \nelse{\n clickArea = false;\n}\n\n//Checking if 'clickArea' is equal to true, then if 'cleanUp' is equal to true.\n//If both are true then it will continuously update the background colour with the\n//set colour, creating this effect of clearing all previous lines that have been drawn.\nif(clickArea == true){ //This has been set so the user can only 'clearUp' if their mouse is over the canvas.\n if(cleanUp == true){ \n background(231,255,255); //** See lines '52' to '64' for the related functions**\n }\n}\n\n \n//Sets up a loop to display equal to the number of 'units' in the string in 'lineArray'\n for (let z=0; z<lineArray.length; z++){\n//Makes the array adhere to both the functions, 'moveLineFunction' and 'drawLineFunction'\n lineArray[z].moveLineFunction();\n lineArray[z].drawLineFunction();\n }\n}", "function doLINE(connections,color){\n\tvar connection;\n\tstroke(color);\n\tfor (connection in connections){\n\t\t[X1,Y1] = moving_point(stops[connections[connection][0]][0], stops[connections[connection][0]][1],stops[connections[connection][0]][2],stops[connections[connection][0]][3],speed);\n\t\t[X2,Y2] = moving_point(stops[connections[connection][1]][0], stops[connections[connection][1]][1],stops[connections[connection][1]][2],stops[connections[connection][1]][3],speed);\n\t\tline(X1,Y1,X2,Y2);\n\t}\n}", "_strikeMouseDown() {\n for (let i = 0; i < this._mouseDownCallbacks.length; i++) {\n let currentCallback = this._mouseDownCallbacks[i][0];\n\n currentCallback(this, event);\n }\n\n for (let i = 0; i < this._mouseDownCallbacks.length; i++) {\n if (this._mouseDownCallbacks[i][1])\n this._mouseDownCallbacks.splice(i--, 1);\n }\n }", "function startLine() {\n picking_photo = false;\n line_started = true;\n updateLabels();\n}", "function mainLoop(){\n if(mouse.click && mouse.move && mouse.pos_prev){\n socket.emit('draw_line',{line:[mouse.pos,mouse.pos_prev],txtcolor:color});\n mouse.move = false;\n }\n mouse.pos_prev = {x:mouse.pos.x,y:mouse.pos.y};\n setTimeout(mainLoop,25);\n}", "_onMouseMove(event) {\n // If the mousemove listener is active it means that a selection is\n // currently being made, we should stop propagation to prevent mouse events\n // to be sent to the pty.\n event.stopImmediatePropagation();\n // Do nothing if there is no selection start, this can happen if the first\n // click in the terminal is an incremental click\n if (!this._model.selectionStart) {\n return;\n }\n // Record the previous position so we know whether to redraw the selection\n // at the end.\n const previousSelectionEnd = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;\n // Set the initial selection end based on the mouse coordinates\n this._model.selectionEnd = this._getMouseBufferCoords(event);\n if (!this._model.selectionEnd) {\n this.refresh(true);\n return;\n }\n // Select the entire line if line select mode is active.\n if (this._activeSelectionMode === 2 /* LINE */) {\n if (this._model.selectionEnd[1] < this._model.selectionStart[1]) {\n this._model.selectionEnd[0] = 0;\n }\n else {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n }\n else if (this._activeSelectionMode === 1 /* WORD */) {\n this._selectToWordAt(this._model.selectionEnd);\n }\n // Determine the amount of scrolling that will happen.\n this._dragScrollAmount = this._getMouseEventScrollAmount(event);\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n if (this._activeSelectionMode !== 3 /* COLUMN */) {\n if (this._dragScrollAmount > 0) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n else if (this._dragScrollAmount < 0) {\n this._model.selectionEnd[0] = 0;\n }\n }\n // If the character is a wide character include the cell to the right in the\n // selection. Note that selections at the very end of the line will never\n // have a character.\n const buffer = this._bufferService.buffer;\n if (this._model.selectionEnd[1] < buffer.lines.length) {\n const line = buffer.lines.get(this._model.selectionEnd[1]);\n if (line && line.hasWidth(this._model.selectionEnd[0]) === 0) {\n this._model.selectionEnd[0]++;\n }\n }\n // Only draw here if the selection changes.\n if (!previousSelectionEnd ||\n previousSelectionEnd[0] !== this._model.selectionEnd[0] ||\n previousSelectionEnd[1] !== this._model.selectionEnd[1]) {\n this.refresh(true);\n }\n }", "function brushLine(x,y,px,py) {\n var dis = dist(x,y,px,py);\n if (dis > 0) {\n var step = sidebar.sliders[1].val/dis;\n var myx,myy,t = 0;\n for (var i = 0; i <= dis; i+= step/5) {\n t = max(i / dis);\n myx = mouseX + (pmouseX-mouseX) * t;\n myy = mouseY + (pmouseY-mouseY) * t;\n mainBrush.show(myx,myy);\n }\n } else {\n mainBrush.show(x,y);\n }\n}", "on_mousemove(e, localX, localY) {\n\n }", "function ShowDetectLine() {\n\t//ClearDetectLine()\n\tfor(control of controllist){\n\t\tchartx = chartlist[controllist.indexOf(control)],\n\t\tsbss = 0, aps = 0, hid = 0;\n\t\tfor(var detect of NODE[dest].inter){\n\t\t\tif(showrolelist.indexOf(NODE[detect]['role']) != -1){\n\t\t\t\tvar p = chartx.append(\"path\")\n\t\t\t\t\t.attr(\"d\", line([[NODE[dest].x, NODE[dest].y, NODE[dest].z], [NODE[detect].x, NODE[detect].y, NODE[detect].z]]))\n\t\t\t\t\t.attr(\"class\", \"mouse-line_\" + control + src + '_' + dest)\n\t\t\t\t\t.style(\"stroke-width\", \"1px\")\n\t\t\t\t\t.style(\"opacity\", \"0.5\");\n\t\t\t\tif(NODE[detect].act == 'AP') aps++;\n\t\t\t\tif(NODE[detect].bss == NODE[dest].bss){\t// AP\n\t\t\t\t\tp.style(\"stroke\", \"black\");\n\t\t\t\t\tsbss++;\n\t\t\t\t}else if(NODE[src].inter.indexOf(detect) == -1){\t// Hidden terminal for UL\n\t\t\t\t\tp.style(\"stroke\", \"red\");\n\t\t\t\t\thid++;\n\t\t\t\t}else p.style(\"stroke\", \"black\");\t// other\n\t\t\t}\n\t\t}\n\t}\n\n\tpresource = src\n\tpredestination = dest\n}", "function mousemove(e) {\n\tif (!e) var e = event;\n\t\tstate.canvasX = e.pageX - state.canvas.offsetLeft;\n state.canvasY = e.pageY - state.canvas.offsetTop;\n state.context.strokeStyle = state.penColor;\n state.context.lineWidth = state.penWidth;\n if (isDrawing) {\n state.context.lineTo(state.canvasX, state.canvasY);\n state.context.stroke();\n console.log(isDrawing);\n }\n}", "function applyLines(){\t\t\t\n\t\t\tscope.clearLines();\n\t\t\t_.chain(controller.lines).each(function(line){\n\t\t\t\t_.chain(line.columns).each(function(column, columnIdx){\t\t\t\t\n\t\t\t\t\tvar $cell = $findCell(line.row, column);\n\t\t\t\t\tscope.addCellState($cell, line, columnIdx);\n\t\t\t\t\tcontroller.onLineCellDrawn(controller, $cell, line, columnIdx);\n\t\t\t\t});\n\t\t\t\tcontroller.onLineDrawn(controller, line);\n\t\t\t});\n\t\t}", "function mouseMoved(event) {\n\t// what happens when the mouse is moved?\n\tprevX = currX;\n\tprevY = currY;\n\tcurrX = event.clientX - canvas.offsetLeft;\n\tcurrY = event.clientY - canvas.offsetTop;\n\tcoordinateLabel.innerHTML = \"Coordinates: (\" + currX + \", \" + currY + \")\";\n\tdrawLine();\n}" ]
[ "0.7554375", "0.7554375", "0.74858207", "0.7247059", "0.7206811", "0.71695733", "0.71290773", "0.7072641", "0.7054814", "0.70529497", "0.69415504", "0.68399286", "0.67913026", "0.674144", "0.67294276", "0.67154515", "0.6698092", "0.667147", "0.6644009", "0.662962", "0.66225624", "0.6600536", "0.6578939", "0.65654266", "0.65609515", "0.65538156", "0.6546982", "0.65384036", "0.6459691", "0.6444862", "0.6444123", "0.6427804", "0.6425287", "0.6404312", "0.6388083", "0.63829714", "0.6354985", "0.6348492", "0.6347311", "0.6334733", "0.6333707", "0.6331743", "0.63298976", "0.6310536", "0.63079816", "0.6274237", "0.62545675", "0.62482375", "0.6228414", "0.6219709", "0.62161154", "0.62161154", "0.6213666", "0.6212927", "0.6210712", "0.6207701", "0.62052107", "0.6204644", "0.61880904", "0.61788696", "0.6169124", "0.61560863", "0.61523014", "0.61493427", "0.61399454", "0.61349005", "0.61177814", "0.61176366", "0.611308", "0.6110129", "0.6109387", "0.6109078", "0.6091841", "0.6086975", "0.60866165", "0.6049162", "0.6048164", "0.6045959", "0.6042653", "0.6042653", "0.60392416", "0.60389525", "0.60260355", "0.6023392", "0.60186744", "0.5985329", "0.59798425", "0.59754056", "0.5975296", "0.5973323", "0.5972776", "0.5968069", "0.59620154", "0.5957925", "0.59499013", "0.59487563", "0.5946582", "0.59462905", "0.5940945" ]
0.78415483
1
addes legend to the given map
function createLegend(mymap) { var legend = L.control({ position: 'bottomleft' }); legend.onAdd = function (map) { var div = L.DomUtil.create("div", "legend"); div.style.backgroundColor = 'WHITE'; div.innerHTML += '<p>Number of Links<b>: XX</b></p>'; div.innerHTML += '<p>xxxx xxxx xxxx<b>: XX</b></p>'; return div; }; legend.addTo(mymap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMapLegend() {\n\n}", "function mapLegend() {\n let legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function(map) {\n\n var div = L.DomUtil.create('div', 'info legend');\n var mags = [0, 1, 2, 3, 4, 5];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < mags.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(mags[i]) + '\"></i> ' +\n mags[i] + (mags[i + 1] ? '&ndash;' + mags[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n return legend;\n}", "function addEarthquakeColorLegend(map) {\n\n // Legend object (bottom right)\n var legend = L.control({\n position: \"bottomright\"\n });\n\n // Add div for legend\n legend.onAdd = function() { \n var div = L.DomUtil.create(\"div\", \"colorlegend\");\n return div;\n }\n \n // return legend\n map.addControl(legend);\n\n}", "addLegend () {\n \n }", "function legend(){\r\n var legend = L.control({position: is_mobile ? 'topleft' : 'topright'});\r\n\r\n legend.onAdd = function (map) {\r\n\r\n var div = L.DomUtil.create('div', 'infos legend'),\r\n grades = [\"Buona\", \"Discreta\", \"Mediocre\", \"Scadente\", \"Pessima\"];\r\n\r\n div.innerHTML = is_mobile ? \"\" : \"<p style='margin-top: 0;'><strong>Qualit\" + \"&agrave;\" +\" dell'aria</strong></p>\";\r\n for (var i = 0; i < grades.length; i++) {\r\n div.innerHTML += (is_mobile ?\r\n \"<img style='position: relative; top: -4px;' src=\" + markerPath[i] + \" width='12px' height='20px' align='middle'> \" + grades[i] + \"<br>\"\r\n :\r\n \"<p style='margin-top: 0;\" + ((i == grades.length-1) ? \"margin-bottom: 0px;\" : \"margin-bottom: 6px;\") +\"'><img style='position: relative; top: -4px;' src=\" + markerPath[i] + \" width='15px' height='25px' align='middle'>\" + grades[i] + \"</p>\" ) ;\r\n }\r\n return div;\r\n };\r\n\r\n legend.addTo(map1);\r\n}", "function addLegend() {\n // Create a legend for the map\n var legend = L.control({ position: 'bottomleft' });\n // Legend will be called once map is displayed\n legend.onAdd = function () {\n\n var div = L.DomUtil.create('div', 'info legend');\n\n var legendInfo = \"<p>GDP per capita (Int$)</p>\";\n\n div.innerHTML = legendInfo;\n\n // setup the depth \n var limits = [0, 2000, 5000, 10000, 20000, 35000, 50000];\n // Loop through our magnitude intervals and generate a label with a colored square for each interval\n for (var i = 0; i < limits.length; i++) {\n var newHtml = `<i style=\"background: ${getColorValue(limits[i])}\"></i>`;\n newHtml += limits[i] + (limits[i + 1] ? '&ndash;' + limits[i + 1] + '<br>' : '+');\n div.innerHTML += newHtml;\n }\n\n return div;\n };\n // Add the legend to the map\n return legend;\n}", "function addMapClose (mapId, img, legendId, legend){\r\n $(mapId).append(img);\r\n $(legendId).append(legend);\r\n}", "addMapLegend() {\r\n if ($(`.${this.mapLegend}`).length) {\r\n $(`.${this.mapLegend}`).remove();\r\n }\r\n\r\n let colorScale = this.activeLayerPropertyProperties.colorScale;\r\n let steps = this.activeLayerPropertyProperties.step;\r\n\r\n // Reverse the legend\r\n if (this.options.mapConfig.legendReverse) {\r\n colorScale = colorScale.slice().reverse();\r\n steps = steps.slice().reverse();\r\n }\r\n\r\n let rows = '';\r\n let stepsLength = steps.length;\r\n\r\n\r\n colorScale.forEach((color, index) => {\r\n let rowTitle;\r\n\r\n if (this.options.mapConfig.legendReverse) {\r\n if (index === 0) {\r\n rowTitle = `${steps[index]}+`;\r\n } else {\r\n rowTitle = `${steps[index]} – ${steps[index - 1]}`;\r\n }\r\n } else {\r\n if (index < (stepsLength-1)) {\r\n rowTitle = `${steps[index]} – ${steps[index + 1]}`;\r\n } else {\r\n rowTitle = `${steps[index]}+`;\r\n } \r\n }\r\n\r\n rows += `\r\n <div class=\"mapboxgl-choropleth-legend__row\">\r\n <div class=\"mapboxgl-choropleth-legend__fill\" style=\"background-color: ${color};\"></div>\r\n <div class=\"mapboxgl-choropleth-legend__row-title\">\r\n ${rowTitle}\r\n </div>\r\n </div>\r\n `;\r\n })\r\n\r\n let legendTitle = `<h3 class=\"mapboxgl-choropleth-legend__title\">${this.activeLayerPropertyProperties.title}</h3>`;\r\n\r\n this.$mapContainer.append(`\r\n <div class=\"${this.mapLegend}\">\r\n <div class=\"mapboxgl-choropleth-legend__wrapper\">\r\n ${legendTitle}\r\n ${rows}\r\n </div>\r\n </div>\r\n `)\r\n }", "function createMap(quakeLayer, faultLayer){\n var baseMaps = {\n \"Outdoor Map\": outdoorsMap,\n \"Grayscale Map\": lightMap,\n \"Satelite Map\": satelliteMap\n };\n\nvar overlayMaps = {\n \"Earthquakes\": quakeLayer,\n \"Fault Lines\": faultLayer\n \n };\nvar mymap = L.map('mapid', {\n center: [42.877742, -97.380979],\n zoom: 2.5,\n minZoom: 2.5,\n layers: [lightMap, faultLayer, quakeLayer],\n maxBounds: L.latLngBounds([90, -180], [-90, 180]),\n maxBoundsViscosity: 1,\n scrollWheelZoom: false\n \n}); \n\nvar legend = L.control({position: 'bottomright'});\n\nlegend.onAdd = function (mymap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [];\n\n div.innerHTML += '<p><u>Magnitude</u></p>'\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n};\n\nlegend.addTo(mymap);\n\nL.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(mymap);\n}", "function setupSightingsLegend(){\n let legend = L.control({position: 'bottomleft'});\n legend.onAdd = function (map) {\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [-100, -50, 0, 50, 100, 150, 200],\n labels = [\"-100%\",\"-50%\",\"0\",\"+50%\",\"+100%\",\"+150%\", \"+200%\"];\n div.innerHTML += '<p>Sichtungen im Vergleich zum Vormonat</p><br>'\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + sigthingsColorScale(grades[i]) + '; border: 0.2px solid black\"></i> ' +\n labels[i] + '<br>';\n }\n return div;\n };\n return legend.addTo(map); \n}", "function updateLegend(map) {\r\n for(var i=0; i<10; i++) {\r\n $('#legend' + i).html(legend[map.toLowerCase().replace(' ', '')][i]);\r\n }\r\n}", "function updateLegend(map){\n\n removeElement(\"point-text\");\n removeElement(\"point-legend\");\n\t\n if (popDenValue['max']==0)\n return;\n\n var container = document.getElementsByClassName(\"legend-control-container\")[0];\n\n $(container).append('<text id=\"point-text\">Pop Density Affected</text>');\n\n var svg = '<svg id=\"point-legend\" width=\"120px\" height=\"70px\">';\n var circles = {\n max: 25,\n mean: 45,\n min: 65\n };\n for (var circle in circles){\n svg += '<circle class=\"legend-circle\" id=\"' + circle + '\" fill=\"#000000\" fill-opacity=\"0\" stroke=\"#666666\" stroke-width=\"2\" opacity=\"1\" cx=\"35\"/>';\n svg += '<text id=\"' + circle + '-text\" fill=\"#FFFFFF\" x=\"75\" y=\"' + circles[circle] + '\"></text>';\n };\n svg += \"</svg>\";\n\n $(container).append(svg);\n\n for (var key in popDenValue){\n var radius = calcPropRadius(popDenValue[key]);\n $('#'+key).attr({\n cy: 69 - radius,\n r: radius\n });\n $('#'+key+'-text').text(Math.round(popDenValue[key]*100)/100);\n };\n}", "function makeLegend() {\n let legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function(map) {\n\n let div = L.DomUtil.create('div', 'info legend');\n let grades = [0, 1, 2, 3, 4, 5];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i]) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n\n return legend;\n}", "function resetLegend(toggle){\n var legend = $(\"#map-legend\");\n if(toggle){\n legend.toggle();\n }\n legend.css({\n bottom:offset,\n left: offset\n });\n }", "function makeLegend() {\n var margin = { top: 50, left: -40 },\n legendWidth = 250,\n legendHeight = 150;\n\n var legend = mapSvg.append('g')\n .attr('width', legendWidth)\n .attr('height', legendHeight)\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var legends = legend.selectAll(\".legend\")\n .data(colorScale.domain())\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n\n // draw legend colored rectangles\n legends.append(\"rect\")\n .attr(\"x\", legendWidth - 18)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", colorScale);\n\n // draw legend text\n legends.append(\"text\")\n .attr(\"x\", legendWidth - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d.toLowerCase(); });\n}", "function updateEarthquakeColorLegend(map) {\n\n // Add HTML code to legend \n legend = d3.select(\".colorlegend\");\n // Clear any existing details \n legend.html(\"\");\n // color legend html\n var html = [\n '<div style = \"background:#ccebff\">',\n '<b> <u> Magnitude </u> </b> <span style=\"padding-left:20px\"> </span> </br>',\n '<span style =\"background:#ff0000\"> .... </span> <span style=\"padding-left:5px\"> </span> Above 5 </br>',\n '<span style =\"background:#ff8080\"> .... </span> <span style=\"padding-left:5px\"> </span> 4 - 5 </br>',\n '<span style =\"background:#ff9933\"> .... </span> <span style=\"padding-left:5px\"> </span> 3 - 4 </br>',\n '<span style =\"background:#ffe066\"> .... </span> <span style=\"padding-left:5px\"> </span> 2 - 3 </br>',\n '<span style =\"background:#ffff00\"> .... </span> <span style=\"padding-left:5px\"> </span> 1 - 2 </br>',\n '<span style =\"background:#80ff00\"> .... </span> <span style=\"padding-left:5px\"> </span> Below 1',\n '</div>'\n ].join(\"\");\n legend.html(html);\n\n // var html = [\n // '<p style =\"background-color:#ff0000\"> <b> Magnitude 5 & above </b> </p>',\n // '<p style =\"background-color:#ff8080\"> <b> Magnitude 4 - 5 </b> </p>',\n // '<p style =\"background-color:#ff9933\"> <b> Magnitude 3 - 4 </b> </p>',\n // '<p style =\"background-color:#ffe066\"> <b> Magnitude 2 - 3 </b> </p>',\n // '<p style =\"background-color:#ffff00\"> <b> Magnitude 1 - 2 </b> </p>',\n // '<p style =\"background-color:#80ff00\"> <b> Magnitude < 1 </b> </p>'\n // ].join(\"\");\n\n}", "function createMap(earthquake, faultLine){\n var baseMaps = {\n \"Outdoor Map\": streetmap,\n \"Grayscale Map\": lightMap,\n \"Satelite Map\": satelliteMap\n };\n// overlay toggle on and off\n var overlayMaps = {\n \"Earthquakes\": earthquake,\n \"Fault Lines\": faultLine\n \n };\n// create mymap\n var mymap = L.map('map', {\n // center: [40.7128, -74.0060], //nyc coordinate\n maxzoom: 0,\n minZoom: 0,\n layers: [lightMap, faultLine, earthquake],\n scrollWheelZoom: false //diable scroll and zoom in the map\n }); \n mymap.setView([40.7128, -74.0060], 3); //nyc coordinates, zoom level 3\n\n// create legend for circle marker colors\n var legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function (mymap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5], \n labels = [];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n};\n\nlegend.addTo(mymap);\n//add layer control to map\nL.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(mymap);\n}", "function makeLegend(map, attrib, colorScheme, thresholds, params) {\n // Define a vertical scale for the legend\n const yScale = d3.scaleBand()\n .domain(colorScheme)\n .range([params.height / 2, 0])\n .paddingOuter(1);\n\n // Add the legend to the map as a group\n const legend = map.append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", \"translate(\" + (params.width - 40) + \",0)\");\n\n // Color bands for the legend based on the color scale\n legend.selectAll(\"rect\")\n .data(colorScheme)\n .enter()\n .append(\"rect\")\n .attr(\"x\", 4)\n .attr(\"y\", d => yScale(d))\n .attr(\"width\", 10)\n .attr(\"height\", yScale.bandwidth())\n .style(\"fill\", d => d)\n\n // Threshold labels for the transitions between bands\n legend.selectAll(\"text\")\n .data(thresholds)\n .enter()\n .append(\"text\")\n .attr(\"y\", (d, i) => yScale(colorScheme[i]))\n .text(d => formatDataLabel(attrib, d));\n\n // Lower bound label\n legend.append(\"text\")\n .attr(\"y\", params.height / 2 - yScale.bandwidth())\n .text(formatDataLabel(attrib, 0));\n\n // Upper bound label\n legend.append(\"text\")\n .attr(\"y\", yScale.bandwidth())\n .text(\"Above\");\n\n legend.append(\"line\")\n .attr(\"x1\", 3)\n .attr(\"y1\", params.height - yScale.bandwidth())\n .attr(\"x2\", 15)\n .attr(\"y2\", params.height - yScale.bandwidth());\n}", "function createLegend(map, attributes){\r\n //creates our legend in the bottom right of the map\r\n var LegendControl = L.Control.extend({\r\n options: {\r\n position: 'bottomright'\r\n },\r\n \r\n //our function which adds the a legend-control-container class and \r\n //our temporal legend\r\n onAdd: function (map){\r\n var container = L.DomUtil.create('div', 'legend-control-container');\r\n \r\n $(container).append('<div id=\"temporal-legend\">');\r\n \r\n var svg = '<svg id=\"attribute-legend\" width=\"180px\" height=\"180px\">';\r\n \r\n \r\n var circles = [\"max\", \"mean\", \"min\"];\r\n // var values = getCircleValues(map, attributes);\r\n for(var i=0; i < circles.length; i++){\r\n svg += '<circle class=\"legend-circle\" id=\"' + circles[i] + '\" fill=\"#0000ff\" fill-opacity=\"0.8\" stroke=\"#000000\" cx=\"30\"/>';\r\n \r\n //svg += '<text id=\"' + circles[i] + '-text\" x=\"65\" y=\"' +circles[i] +'\"></text>';\r\n };\r\n \r\n \r\n svg += \"</svg>\";\r\n \r\n \r\n $(container).append(svg);\r\n return container;\r\n }\r\n });\r\n \r\n \r\n map.addControl(new LegendControl());\r\n updateLegend(map, attributes);\r\n}", "function buildLegend(colors, assoColors) {\n var elemStr = '<h4><a href=\"#\" id=\"map-legend-close\" class=\"text-info\"><i class=\"material-icons md-28 align-middle\">keyboard_arrow_right</i><span class=\"align-middle\">Sensors</span></a></h4>';\n for (var k = 0; k < assoColors.length; k++) {\n\n if (assoColors[k] != null) {\n\n // Currently, we want to display human-friendly names on the front-end. This is a hack\n if (assoColors[k] == \"luftdaten\") {\n (kilolima = \"Luftdaten\")\n }\n else if (assoColors[k] == \"smart-citizen-kits\") {\n (kilolima = \"Smart Citizen Kit\")\n }\n else if (assoColors[k] == \"automatic-urban-and-rural-network-aurn\") {\n kilolima = \"DEFRA AURN\";\n }\n else if (assoColors[k] == \"air-quality-data-continuous\") {\n kilolima = \"Bristol Air Quality Continuous\";\n }\n\n else if (assoColors[k] == \"air-quality-no2-diffusion-tube-data\") {\n kilolima = \"Bristol NO2 Diffusion Tubes\";\n }\n\n else {\n kilolima = assoColors[k]\n }\n }\n if (k !== colors.length) {\n if (kilolima != null) {\n elemStr += '<div><span style=\"background-color: ' + colors[k] + '\"></span>' + kilolima + '</div>';\n\n } else {\n elemStr += '<div><span style=\"background-color: ' + colors[k] + '\"></span>' + assoColors[k] + '</div>';\n }\n }\n\n }\n if (window.location.href.indexOf(\"datalocation\") > -1) {\n elemStr += '<div><span style=\"background-color: #97CBFF\"></span>Chosen location</div>';\n }\n $(\"#map-legend\").html(elemStr);\n}", "function createLegend(map) {\n //Create a SequenceControl object\n var LegendControl = L.Control.extend({\n options: {\n position: 'topright'\n },\n onAdd: function (map) {\n //Create a DOM container to append to on to the map\n var container = L.DomUtil.create('div', 'legend-control-container');\n //Append the title\n $(container).append('<div id=\"temporal-legend\" style=\"font-size:15px; margin:2px\"><b>LEGEND</b></div>')\n\n //Append the legend symbols\n var cityArea = '<img src = img/SVG/cityarea.svg width=40></img><text> City Area</text><br>'\n var stateBoundary = '<img src = img/SVG/stateboundary.svg width=40></img><text> State Boundary</text><br>'\n var hCategory = '<text><b>Hurricane Categories</b></text><br>'\n hCategory += '<img src = img/SVG/h5.png width=40 height=4.65></img>'\n hCategory += '<text> H5</text><br>'\n hCategory += '<img src = img/SVG/h4.png width=40 height=4.15></img>'\n hCategory += '<text> H4</text><br>'\n hCategory += '<img src = img/SVG/h3.png width=40 height=3.65></img>'\n hCategory += '<text> H3</text><br>'\n hCategory += '<img src = img/SVG/h2.png width=40 height=3.15></img>'\n hCategory += '<text> H2</text><br>'\n hCategory += '<img src = img/SVG/h1.png width=40 height=2.65></img>'\n hCategory += '<text> H1</text><br>'\n hCategory += '<img src = img/SVG/ts.png width=40 height=2.15></img>'\n hCategory += '<text> TS</text><br>'\n hCategory += '<img src = img/SVG/td.png width=40 height=2.15></img>'\n hCategory += '<text> TD</text><br>'\n hCategory += '<img src = img/SVG/ex.png width=40 height=2.15></img>'\n hCategory += '<text> EX</text><br>'\n hCategory += '<img src = img/SVG/other.png width=40 height=1.15></img>'\n hCategory += '<text> Others</text><br>'\n\n //add attribute legend to container\n $(container).append(cityArea);\n $(container).append(stateBoundary);\n $(container).append(hCategory);\n\n return container;\n }\n });\n\n map.addControl(new LegendControl());\n\n}", "function updateLegend(map, attribute){\r\n //create content for legend\r\n var year = attribute.substring(1,5);\r\n var content = \"Number of U.S. Bound Emigrants in \" + year;\r\n\r\n //replace legend content\r\n $('#temporal-legend').html(content);\r\n \r\n //get the max, mean, and min values as an object\r\n var circleValues = getCircleValues(map, attribute);\r\n \r\n for (var key in circleValues){\r\n //get the radius\r\n var radius = calcPropRadius(circleValues[key]);\r\n\r\n //Step 3: assign the cy and r attributes\r\n $('#'+key).attr({\r\n cy: 70 - radius,\r\n cx: 25,\r\n r: radius\r\n });\r\n //Step 4: add legend text\r\n $('#'+key+'-text').text(Math.round(circleValues[key]*100)/100);\r\n };\r\n \r\n \r\n \r\n}", "function drawMap() {\n am4core.useTheme(am4themes_animated);\n //Making properties amCharts readable...\n mapData = [];\n for (var i = 0; i < window[mortalityData].length; i++) {\n mapData.push({\n name: window[mortalityData][i][\"Country Name\"],\n id: window[mortalityData][i].id,\n value: window[mortalityData][i][currentYear]\n });\n }\n // console.log(mapData);\n //Start map creation\n mapChart = am4core.create(\"mapdiv\", am4maps.MapChart);\n mapChart.geodata = am4geodata_worldLow;\n mapChart.projection = new am4maps.projections.Miller();\n\n //Configure map's data...\n mapPolygonSeries = mapChart.series.push(new am4maps.MapPolygonSeries());\n mapPolygonSeries.useGeodata = true;\n mapPolygonSeries.data = mapData;\n mapPolygonSeries.exclude = [\"AQ\"];\n\n polygonTemplate = mapPolygonSeries.mapPolygons.template;\n polygonTemplate.applyOnClones = true;\n polygonTemplate.togglable = true;\n polygonTemplate.tooltipText = \"[bold]{name} ({id})[/]\";\n polygonTemplate.nonScalingStroke = true;\n polygonTemplate.strokeOpacity = 0.6;\n // polygonTemplate.fill = mapChart.colors.getIndex(0);\n\n //Create heat rules for country colors\n mapPolygonSeries.heatRules.push({\n property: \"fill\",\n target: polygonTemplate,\n min: am4core.color(\"#ff4e50\"),\n max: am4core.color(\"#f9d423\")\n });\n\n var heatLegend = mapChart.createChild(am4maps.HeatLegend);\n heatLegend.series = mapPolygonSeries;\n heatLegend.width = am4core.percent(100);\n heatLegend.valueAxis.renderer.labels.template.fontSize = 20;\n // heatLegend.valueAxis.renderer.minGridDistance = 3000;\n // heatLegend.orientation = \"vertical\";\n heatLegend.markerCount = 10;\n heatLegend.valueAxis.stroke = \"#000000\";\n\n var selectState = polygonTemplate.states.create(\"active\");\n selectState.properties.fill = mapChart.colors.getIndex(2);\n var hoverState = polygonTemplate.states.create(\"hover\");\n hoverState.properties.fill = mapChart.colors.getIndex(4);\n\n polygonTemplate.events.on(\"hit\", function(event) {\n target = event.target;\n target.isActive = target.isActive;\n var id = target.dataItem.dataContext.id;\n toggleLineSeries(id);\n });\n\n //Configure legend tooltip\n var legendTooltip = heatLegend.valueAxis.tooltip;\n legendTooltip.background.stroke = am4core.color(\"#ffffff\");\n legendTooltip.text = \"[bold]{value}[/]\";\n legendTooltip.fontSize = 20;\n\n //Add tooltip animation for value axis\n polygonTemplate.events.on(\"over\", function(ev) {\n if (!isNaN(ev.target.dataItem.value)) {\n heatLegend.valueAxis.showTooltipAt(ev.target.dataItem.value);\n } else {\n heatLegend.valueAxis.hideTooltip();\n }\n });\n\n polygonTemplate.events.on(\"out\", function(ev) {\n heatLegend.valueAxis.hideTooltip();\n });\n\n // mapChart.smallMap = new am4maps.SmallMap();\n // mapChart.smallMap.align = \"right\";\n // mapChart.smallMap.valign = \"top\";\n // mapChart.smallMap.series.push(mapPolygonSeries);\n // mapChart.smallMap.background = am4core.color(\"#000000\");\n\n //Zoom controls\n mapChart.zoomControl = new am4maps.ZoomControl();\n\n //Add Home Button for Map\n var homeButton = new am4core.Button();\n homeButton.events.on(\"hit\", function() {\n mapChart.goHome();\n });\n homeButton.icon = new am4core.Sprite();\n homeButton.padding(7, 5, 7, 5);\n homeButton.width = 30;\n homeButton.icon.path =\n \"M16,8 L14,8 L14,16 L10,16 L10,10 L6,10 L6,16 L2,16 L2,8 L0,8 L8,0 L16,8 Z M16,8\";\n homeButton.marginBottom = 5;\n homeButton.parent = mapChart.zoomControl;\n homeButton.insertBefore(mapChart.zoomControl.plusButton);\n\n //Add timeline slider to the chart\n //Create slider in new DIV\n var slider = am4core.create(\"map_slider\", am4core.Slider);\n slider.valign = \"bottom\";\n slider.paddingLeft = 15;\n slider.paddingRight = 15;\n slider.startGrip.background.fill = mapChart.colors.getIndex(2);\n slider.startGrip.background.states.getKey(\n \"hover\"\n ).properties.fill = mapChart.colors.getIndex(4);\n var yearText = document.getElementById(\"year_text\");\n slider.events.on(\"up\", function() {\n updateChart();\n });\n slider.events.on(\"rangechanged\", function() {\n currentYear = getYearFromSlider(slider.start);\n yearText.innerHTML = currentYear;\n });\n}", "function loadLegend(){\r\n // add location legend \r\n \tvar item = document.createElement('div'); \r\n \tvar value = document.createElement('span');\r\n \tvalue.innerHTML = \"<strong>Homeless Resources</strong>\";\r\n \titem.appendChild(value);\r\n \tvar legend = document.getElementById(\"legend\");\r\n \tlegend.appendChild(item);\r\n \r\n var layers = [\" Food Bank\", \" Homeless Shelters\"];\r\n var images = [\"./data/food_icon.png\", \"./data/shelter_icon.png\"];\r\n for (var i = 0; i < layers.length; i++) {\r\n var layer = layers[i];\r\n var thisItem = document.createElement('div');\r\n var thisKey = document.createElement('span');\r\n var myImage = document.createElement('img');\r\n myImage.src = images[i];\r\n myImage.style.height = \"17px\";\r\n myImage.style.width = \"17px\";\r\n thisKey.appendChild(myImage); \r\n thisKey.className = 'legend-key';\r\n var thisValue = document.createElement('span');\r\n thisValue.innerHTML = layer;\r\n thisValue.style.margin = \"0 0 10px 3px\";\r\n\r\n thisItem.appendChild(thisKey);\r\n thisItem.appendChild(thisValue);\r\n legend.appendChild(thisItem);\r\n }\r\n\r\n \r\n \tvar item = document.createElement('div'); \r\n \tvar value = document.createElement('span');\r\n \tvalue.innerHTML = \"<br><strong>Population Density</strong>\";\r\n \titem.appendChild(value);\r\n \tlegend.appendChild(item);\r\n \r\n \t// add population density legend \r\n \tvar pop_density = ['2355/mi', '3922/mi', '5388/mi', '8676/mi', '53437/mi'];\r\n \tvar pop_colors = ['#FFEDA0', '#FED976', '#FEB24C', '#FD8D3C', '#E31A1C'];\r\n \tfor (var i = 0; i < pop_density.length; i++) {\r\n var pop_d = pop_density[i];\r\n var pop_c = pop_colors[i];\r\n var item = document.createElement('div');\r\n var key = document.createElement('span');\r\n key.className = 'legend-pop';\r\n key.style.backgroundColor = pop_c;\r\n var value = document.createElement('span');\r\n value.innerHTML = pop_d;\r\n item.appendChild(key);\r\n item.appendChild(value);\r\n legend.appendChild(item);\r\n \t}\r\n }", "function createLegend(map, attributes){\n \n var LegendControl = L.Control.extend({\n options: {\n position: 'bottomright'\n },\n\n onAdd: function (map) {\n // create the control container with a particular class name\n var container = L.DomUtil.create('div', 'legend-control-container');\n\n //add temporal legend div to container\n $(container).append('<div id=\"temporal-legend\">')\n\n //start attribute legend svg string\n var svg = '<svg id=\"attribute-legend\" width=\"300px\" height=\"300px\">';\n \n //create values for placement of the circle lables in the legend\n var circles = {\n max: 110,\n mean: 180,\n min: 245\n };\n\n //loop to add each circle and text to svg string\n for (var circle in circles){\n //circle string\n svg += '<circle class=\"legend-circle\" id=\"' + circle + \n '\" fill=\"#BA1125\" fill-opacity=\"0.8\" stroke=\"#A51126\" cx=\"110\"/>';\n \n svg += '<text id=\"' + circle + '-text\" x=\"250\" y=\"' + circles[circle] + '\"></text>';\n };\n\n //close svg string\n svg += \"</svg>\";\n\n //add attribute legend svg to container\n $(container).append(svg);\n \n //disable propagation from clicking on the legend\n L.DomEvent.disableClickPropagation(container);\n return container;\n }\n \n });\n\n map.addControl(new LegendControl());\n \n updateLegend(map, attributes[0]);\n \n}", "function createLegend(map, attributes, attribute){\n // Creates legend control variable\n var LegendControl = L.Control.extend({\n options: {\n position: 'bottomright' // sets position on screen\n },\n onAdd: function (map) {\n // create the control container with a particular class name\n var container = L.DomUtil.create('div', 'legend-control-container');\n\n //add temporal legend div to container\n $(container).append('<div id=\"temporal-legend\">');\n\n //Step 1: start attribute legend svg string\n var svg = '<svg id=\"attribute-legend\" width=\"160px\" height=\"60px\">';\n\n //variable for circle names and positions\n var circles = {\n max: 20,\n mean: 40,\n min: 60\n };\n\n //loop to add each circle and text to svg string\n for (var circle in circles){\n //circle string\n svg += '<circle class=\"legend-circle\" id=\"' + circle + '\" fill=\"#228B22\" fill-opacity=\"0.8\" stroke=\"#000000\" cx=\"30\"/>';\n\n //text string\n svg += '<text id=\"' + circle + '-text\" x=\"65\" y=\"' + circles[circle] + '\"></text>';\n };\n\n //close svg string\n svg += \"</svg>\";\n\n //add attribute legend svg to container\n $(container).append(svg);\n // return container as object\n return container;\n }\n });\n // adds to map\n map.addControl(new LegendControl());\n // calls update legend function\n updateLegend(map, attributes[0]);\n}", "function createLegend(map, attributes){\n var LegendControl = L.Control.extend({\n options: {\n position: 'bottomright'\n },\n onAdd: function (map) {\n // create the control container with a particular class name\n var container = L.DomUtil.create('div', 'legend-control-container');\n\n //add temporal legend div to container\n $(container).append('<div id=\"temporal-legend\">')\n //start attribute legend svg string\n var svg = '<svg id=\"attribute-legend\" width=\"230px\" height=\"120px\">';\n \n //array of circle names to base loop on\n var circles = {\n max: 55,\n mean: 75,\n min: 95\n // max: 80,\n // mean: 120,\n // min: 160 \n }\n // \t\tfillColor: '#5a9903',\n\t\t// color: '#7fdb00',\n \n //loop to add each circle and text to svg string\n for (var circle in circles){\n //circle string\n svg += \n '<circle class=\"legend-circle\" id=\"' + circle + \n '\" fill=\"#db0015\" fill-opacity=\"0.6\" stroke=\"#fff\" stroke-width=\"1\" cx=\"80\" />';\n \n svg += '<text id=\"' + circle + '-text\" x=\"150\" y=\"' + circles[circle] + '\"></text>';\n };\n \n svg += \"</svg>\";\n\n //add attribute legend svg to container\n $(container).append(svg);\n\n return container;\n }\n });\n\n map.addControl(new LegendControl());\n updateLegend(map, attributes[0]);\n}", "function legendClosure(name, key) {\n google.maps.event.addDomListener(document.getElementById(name + '_div'), 'click', function () {\n // the real legend toggling\n showDict[key] = !showDict[key];\n if (showDict[key]!=true) {\n document.getElementById(name).src=\"https://maps.google.com/mapfiles/ms/icons/ltblue-dot.png\";\n } else {\n document.getElementById(name).src=icons[key].icon;\n }\n handlePlotRequest(\"all\");\n });\n }", "function updateLegend(map, attribute){\n //create content for legend\n var year = attribute;\n\n var content = \"<h2>Acres burned in \" + year + \"</h2>\";\n\n // replace legend content\n $('#temporal-legend').html(content);\n\n // get the max, mean, and min values as an object\n var circleValues = getCircleValues(map, attribute);\n\n for (var key in circleValues){\n // get the radius\n var radius = calcPropRadius(circleValues[key]);\n\n //Step 3: assign the cy and r attributes\n $('#'+key).attr({\n cy: 59 - radius,\n r: radius\n });\n\n // add legend text\n $('#'+key+'-text').text(circleValues[key] + \" acres\");\n\n }; \n}", "function createLegend(layer) {\n first = false;\n HeatLayer = layer;\n overlays = {\n \"Heat Map\": HeatLayer\n };\n ctrl = L.control.layers(baseLayers, overlays).addTo(map);\n //getWMS();\n}", "function createLegend(layer) {\n // if the legend already exists, then update it with the new layer\n if (legend) {\n legend.layerInfos = [{\n layer: layer,\n title: \"Magnitude\"\n }];\n }\n else {\n legend = new Legend({\n view: view,\n layerInfos: [\n {\n layer: layer,\n title: \"Earthquake\"\n }]\n }, \"infoDiv\");\n }\n }", "function createLegend(map, attributes){\n var LegendControl = L.Control.extend({\n options: {\n position: 'topright'\n },\n\n onAdd: function (map) {\n // create the control container with a particular class name\n var container = L.DomUtil.create('div', 'legend-control-container');\n\n // add temporal legend div to container\n $(container).append('<div id=\"temporal-legend\">')\n\n // start attribute legend svg string\n var svg = '<svg id=\"attribute-legend\" width=\"200px\" height=\"80px\">';\n\n // array of circle names to base loop on\n var circles = {\n max: 20,\n mean: 40,\n min: 60\n };\n\n // loop to add each circle and text to svg string\n for (var circle in circles){\n //circle string\n\n svg += '<circle class=\"legend-circle\" id=\"' + circle + '\" fill=\"#DC143C\" fill-opacity=\"0.9\" stroke=\"#000000\" cx=\"30\"/>';\n\n //text string\n svg += '<text id=\"' + circle + '-text\" x=\"120\" y=\"' + circles[circle] + '\"></text>';\n\n };\n\n // close svg string\n svg += \"</svg>\";\n // add attribute legend svg to container\n $(container).append(svg);\n\n return container;\n }\n });\n\n map.addControl(new LegendControl());\n updateLegend(map, attributes[0]);\n}", "function legendMaker(domain, range, units, legendTitleText, notes, sourceText){\n\tif(legendExists){\n\t\tlegend.remove();\n\t}\n\t\n\t\n\t\n\tlegend = d3.select(\"#map\").append(\"div\")\n\t\t.attr(\"id\", \"legend\");\n\n\txDomain = {};\n\t\tfor(var i=0; i< domain.length; i++){\n\t\t\tvar DText = parseFloat(domain[i-1]+.9) + \"-\" + parseFloat(domain[i]-.1) + units;\n\t\t\t\tif(i==0){\n\t\t\t\t\tDText = \"≤ \" + parseFloat(domain[i]-.1) + units;\n\t\t\t\t\tif(units==\"%\"){\n\t\t\t\t\t\tDText = \"0%\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(i==1){\n\t\t\t\t\tif(units==\"%\"){\n\t\t\t\t\t\tDText = \".01-\" + parseFloat(domain[i]-.1) + units;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(i==4 && units==\"%\"){\n\t\t\t\t\t\tDText = \"> 71\" + units;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tif(units==\"/gal.\"){\n\t\t\t\tvar DText = \"$\" + parseFloat((domain[i-1]+1)/100).toFixed(2) + \"-\" + parseFloat(domain[i]/100).toFixed(2) + units;\n\t\t\t\t\tif(i==0){\n\t\t\t\t\t\tDText = \"≤ \" + \"$\" + parseFloat(domain[i]/100).toFixed(2) + units;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tvar RColor = range[i];\n\t\t\t\t//we don't have this key yet, so make a new one\n\t\t\t\txDomain[DText] = RColor;\n\t\t}\n\t\t\n\tif(units==\"binary\"){\n\t\txDomain = {\n\t\t\t\"No\": 'rgb(201, 228, 242)',\n\t\t\t\"Yes\": 'rgb(255, 166, 1)',\n\t\t};\n\t} \n\tif(units==\"categorical\"){\n\t\txDomain = {\n\t\t\t\"Both property tax rate and assessment limit\": 'rgb(10,132,193)',\n\t\t\t\"Only assessment limit\": 'rgb(201,228,242)', \n\t\t\t\"Only property tax rate limit\": 'rgb(255,166,1)', \n\t\t\t\"Neither property tax rate nor assessment limit\": 'rgb(96,175,215)',\n\t\t\t\"Counties do not have authority to levy property taxes on their own\": 'rgb(255,204,102)',\n\t\t};\n\t}\n\tif(units==\"gasType\"){\n\t\txDomain = {\n\t\t\t\"Fixed rate\": 'rgb(255,166,1)',\n\t\t\t\"Variable rate\": 'rgb(255,204,102)',\n\t\t\t\"Fixed and variable rate\": 'rgb(10,132,193)', \n\t\t};\n\t}\n\tif(units==\"localGasTax\"){\n\t\txDomain = {\n\t\t\t\"Not authorized\": 'rgb(255,166,1)',\n\t\t\t\"Authorized but not adopted\": 'rgb(96,175,215)',\n\t\t\t\"Adopted\": 'rgb(10,132,193)', \n\t\t};\n\t}\n\t\n\tvar legendTitle = legend.append(\"div\").attr(\"id\", \"legendTitle\");\n\t\tlegendTitle.append(\"strong\").text(legendTitleText);\n\t\t\n\tlegend.selectAll(\"legendoption\").data(d3.values(xDomain)).enter().append(\"legendoption\")\n\t\t \t.attr(\"class\", \"legendOption\")\n\t\t \t.append(\"i\").style(\"background-color\", function(d){ return d; });\n\td3.selectAll(\"legendoption\")\n\t\t.append(\"p\").data(d3.keys(xDomain)).text(function(d){ return d; });\n\t\n\textraNote.remove();\n\textraNote = d3.select(\"#underMap\").append(\"div\");\n\t\textraNote.append(\"p\").text(notes);\n\t\t\n\tsource.remove();\n\tsource = d3.select(\"#dataSource\").append(\"div\").attr(\"id\", \"source\");\n\t\tsource.html(sourceText);\n\t\n\tlegendExists = true;\n}", "function updateLegend() {\n c.legend.title.setValue(c.selectDEM.selector.getValue() + ' Height in m');\n c.legend.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['grey', 'lightgreen', 'khaki', 'brown', 'white']\n });\n c.legend.leftLabel.setValue(c.selectMinMax.Min.getValue());\n c.legend.centerLabel.setValue(c.selectMinMax.Max.getValue() / 2);\n c.legend.rightLabel.setValue(c.selectMinMax.Max.getValue());\n}", "function createMap(earthquakes) {\n\n // set up darkmap layer\n var darkmap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox/dark-v10',\n accessToken: \"pk.eyJ1IjoiYWx4cHJ5IiwiYSI6ImNrYW9saHZjNDA0Z3ozMG82cHZpcm0xbm8ifQ.yM3ZhZhGelQpcJBz0wtaiw\"\n });\n\n // set up baseMaps to store darkmap layer\n var baseMaps = {\n \"Dark Map\": darkmap\n };\n\n // set up overlayMaps \n var overlayMaps = {\n Earthquakes: earthquakes\n };\n\n // set variable to store map where formatting is held\n var myMap = L.map(\"map\", {\n center:[\n 40.09, -110.71\n ],\n zoom: 5,\n layers: [darkmap, earthquakes]\n });\n \n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n // set up the legend\n var legend = L.control({ position: \"bottomleft\" });\n \n // add legend capabilities where color scole of the earthquake magnitude is shown \n legend.onAdd = function() {\n var div = L.DomUtil.create(\"div\", \"info legend\");\n var magScale = [0, 1, 2, 3, 4, 5]\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < magScale.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + markerColor(magScale[i]) + '\"></i> ' +\n magScale[i] + (magScale[i + 1] ? '&ndash;' + magScale[i + 1] + '<br>' : '+');\n }\n return div;\n};\n\n // add legend to the map\n legend.addTo(myMap);\n\n }", "function createMap(earthquakes) {\n\n var apiKey = \"pk.eyJ1IjoiaGFwcHlmYXRpIiwiYSI6ImNrN21oc3V4ejAwZm8zaWxrZTJhazgwazYifQ.2GjEX8oy8IesOGNjWJhq-w\";\n\n // Set up map layer\n var streetmap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n maxZoom: 18,\n id: \"mapbox.streets\",\n accessToken: apiKey\n });\n \n // Set up overlay layer\n var overlayMaps = {\n Earthquakes: earthquakes\n };\n \n // Create our map, giving it the streetmap and earthquakes layers to display on load\n var myMap = L.map(\"map\", {\n center: [37.09, -95.71],\n zoom: 5,\n layers: [streetmap, earthquakes]\n });\n \n // creating the legend\n var legend = L.control({position: 'bottomright'});\n\n // adding the legend to map\n legend.onAdd = function () {\n \n var div = L.DomUtil.create('div', 'info legend')\n \n div.innerHTML = \"<h4>Legend</h4><table><tr><th>0-1</th><td>Dark Green</td></tr><tr><th>1-2</th><td>Light Green</td></tr><tr><th>2-3</th><td>Yellow</td></tr><tr><th>3-4</th><td>Orange</td></tr><tr><th>4-5</th><td>Red</td></tr></table>\";\n\n return div;\n };\n \n legend.addTo(myMap);\n\n }", "function appendLegend() {\n var legend = svg.selectAll(\".legend\")\n .data(Object.keys(countries))\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) {\n return \"translate(0,\" + i * 20 + \")\";\n });\n\n legend.append(\"rect\")\n .attr(\"x\", w + 20)\n .attr(\"y\", 0)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", function(d, i) {\n return \"rgb(\" + Object.values(countries)[i] + \")\";\n });\n\n legend.append(\"text\")\n .attr(\"x\", w + 40)\n .attr(\"y\", 15)\n .text(function(d) {\n return d;\n });\n }", "draw(){\n for(let y = 0; y < this.map.length; y++){\n for(let x = 0; x < this.map[y].length; x++){\n ctx.fillStyle = this.legendChar(x,y).color;\n ctx.fillRect(x*this.sqsize - this.xpos,y*this.sqsize - this.ypos,this.sqsize +1,this.sqsize+1);\n }\n }\n }", "function updateLegend(map, attribute){\n //create content for legend\n var year = attribute.substring(2);\n var content = (\"Oak \" + year + \" years ago\").bold().fontsize(3);\n //replace legend content\n $('#temporal-legend').html(content);\n\n //get the max, mean, and min values as an object\n var circleValues = getCircleValues(map, attribute);\n\n // for loop through mean, max, min circle values\n for (var key in circleValues){\n //get the radius\n var radius = calcPropRadius(circleValues[key]);\n\n // assign the cy and r attributes\n $('#'+key).attr({\n cy: 59 - radius,\n r: radius\n });\n\n // add legend text\n $('#'+key+'-text').text(Math.round(circleValues[key]*100)/100 + \"%\");\n\t};\n}", "function legendCreate(code, canvas){\n let json = typeof (code) == \"string\"\n ? JSON.parse(code)[\"legend\"]\n : code[\"legend\"];//JSON.parse(JSON.stringify(code['legend'])); //deepcopy\n const offsetX = 10;\n const offsetY = 10;\n const marginY = 5;\n\n const note = json['note'] || []\n const colorscale = json['colorscale'] || {}\n const mark = json[\"mark\"] || {}\n\n // delete json['note'];\n // delete json['colorscale'];\n\n\n const createBase =(cnv, h)=>{\n cnv.attr('version', '1.1')\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .attr(\"width\", 200)\n .attr(\"height\", h * 15 + offsetY * 2 - marginY);\n cnv.append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"y\",0)\n .attr(\"width\", 200)\n .attr(\"height\", h * 15 + offsetY * 2 - marginY)\n .attr(\"stroke-width\",1)\n .attr(\"stroke\",\"black\")\n .attr(\"fill\", \"none\");\n }\n\n const createNote =()=>{\n note.forEach((n, i) =>{\n let hoge = canvas.append(\"g\");\n let y = i * (10 + marginY) + offsetY;\n canvas.append(\"text\")\n .attr(\"x\", offsetX)\n .attr(\"y\", y + 10/2)\n .attr(\"text-anchor\", \"left\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",12)\n .text(n);\n });\n }\n\n const createMark =()=>{\n Object.keys(mark).forEach((n, i) =>{\n let hoge = canvas.append(\"g\");\n let y = (note.length + i) * (10 + marginY) + offsetY;\n hoge.append(\"rect\")\n .attr(\"x\", offsetX)\n .attr(\"y\", y)\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .attr(\"stroke-width\",1)\n .attr(\"stroke\",\"black\")\n .attr(\"fill\", mark[n][\"background\"] || \"white\" );\n hoge.append(\"text\")\n .attr(\"x\", offsetX + 10 / 2)\n .attr(\"y\", y + 10/2)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",10)\n .text(mark[n][\"mark\"] || \"\");\n hoge.append(\"text\")\n .attr(\"x\", offsetX + 10 + 10)\n .attr(\"y\", y + 10/2)\n .attr(\"text-anchor\", \"left\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",12)\n .text(mark[n][\"text\"] || \"\");\n });\n }\n\n const createColorScale =()=>{\n let cell_width = 10\n let domain = json[\"colorscale\"][\"domain\"]\n let data_set = d3.range(\n domain[0],\n domain[domain.length - 1] ,\n (domain[domain.length - 1] - domain[0]) / 10) ;\n\n console.log(data_set)\n let data_set2 =[domain[0], domain[domain.length - 1]]\n let y = note.length * (10 + marginY) + offsetY;\n let colorScaler = d3.scaleLinear()\n .domain(json[\"colorscale\"][\"domain\"]) // 入力データ範囲:-1~1\n .range(json[\"colorscale\"][\"range\"]) // 出力色範囲: 赤―黄色―緑\n let hoge = canvas.append(\"g\");\n hoge.selectAll( \"rect\" )\n .data(data_set)\n .enter()\n .append(\"rect\")\n .attr(\"x\", (d,i)=> offsetX + i*cell_width)\n .attr(\"y\", y)\n .attr(\"width\", cell_width)\n .attr(\"height\", 10)\n .style(\"fill\", (d,i) => colorScaler(d))\n hoge.selectAll( \"text\" )\n .data(data_set2)\n .enter()\n .append(\"text\")\n .attr(\"x\", (d,i)=> offsetX + i*cell_width*10 )\n .attr(\"y\", (note.length + 1 + 0.5) * (10 + marginY) + offsetY)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",12)\n .text((n)=>n);\n }\n\n let y_length;\n switch (json['mode']) {\n case \"mark\":\n y_length = Object.keys(mark).length + note.length;\n createBase(canvas, y_length);\n createNote();\n createMark();\n break;\n case \"colorscale\":\n y_length = 2 + note.length;\n createBase(canvas, y_length);\n createNote();\n createColorScale();\n break;\n default:\n break;\n }\n}", "function setupMap(){\n // LEAFLET CODE - \"L\" means the leaflet - L.map('mapid') or L.circle([lat, long]) \n mymap = L.map('quake-map', {\n center: [37.08195496473745, -121.81099891662599], // mymap.getCenter() -> Will return the current center of the moved map\n zoom: 6 //Zoom level - Only integer\n });\n L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}', {\n subdomains: 'abcd',\n minZoom: 0,\n maxZoom: 20,\n ext: 'png'\n }).addTo(mymap);\n mymap.addControl(new L.Control.Fullscreen()); //Add fullscreen control to an existing map: \n //Find out where you are \n mymap.on('click', onClick);\n function onClick(loc) {\n console.log(\"The clicked location is \" + loc.latlng);\n }\n //*** Info & Legend: Reference: https://leafletjs.com/examples/choropleth/\n //Basic Info \n let info = L.control();\n info.onAdd = function (mymap) {\n this._div = L.DomUtil.create('div', 'info'); // create a div with a class \"info\"\n this.update();\n return this._div;\n };\n // method that we will use to update the control based on feature properties passed\n info.update = function (props) {\n this._div.innerHTML = '<h4>Seismic Effects in California, 2019</h4>';\n };\n info.addTo(mymap);\n\n //legend - Magnitude\n let legend = L.control({position: 'bottomleft'});\n legend.onAdd = function (mymap) {\n let legendDiv = L.DomUtil.create('div', 'info legend'),\n grades = [-1, 0, 1, 2, 3, 4, 5], //Magnitude levels;\n labels = [];\n // loop through our magnitudes and generate a label with a colored circle for each interval\n legendDiv.innerHTML = \"Magnitude\"+ '<br><br>';\n for (let i = 0; i < grades.length; i++) {\n legendDiv.innerHTML +=\n '<i style=\"background:' + magScale(grades[i]).hex() + '\"></i> ' +\n grades[i] + '<br>';\n }\n return legendDiv;\n };\n legend.addTo(mymap);\n}", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "function createLegend(map, attributes) {\n //set up custom control, put it in the top right along with the sequence control.\n var LegendControl = L.Control.extend ({\n options: {\n position: 'topright'\n },\n //contains code that creates DOM elements for the layer\n onAdd: function(map) {\n //create control container with a class name, style in style.css\n var container = L.DomUtil.create('div', 'legend-control-container');\n //svg for the legend \n var svg = '<svg id=\"attribute-legend\" width=\"300px\" height=\"190px\">';\n //set up nested circles so they look nice\n var circles = {\n max: 130,\n mean: 150,\n min: 170\n };\n //loop to add each circle and text to the svg string\n for (var circle in circles){\n //here is the circle string, including styling properties\n svg += '<circle class=\"legend-circle\" id=\"' + circle + '\" fill=\"#FFA900\" fill-opacity=\"0.7\" stroke=\"#ffffff\" cx=\"85\"/>';\n //here is the text string with an x value but no y\n svg += '<text id=\"' + circle + '-text\" x=\"140\" y=\"' + circles[circle] + '\"></text>';\n }\n //this closes the svg string\n svg += \"</svg>\";\n //add attribute legend svg to container\n $(container).append(svg); \n return container;\n }\n });\n//add the legend control to the map\n map.addControl(new LegendControl());\n //calls function to update the legend as the user clicks thru the years\n updateLegend(map, attributes[0]);\n}", "function updateLegend(map, attributes){\n var year = attributes.split(\"_\")[0];\n //legend title\n var content = \"<strong>Pertussis Cases in \" + year + \"</strong>\";\n \n //cycle the legend with the slider bar\n $('#temporal-legend').html(content);\n \n //retrieves max/mean/min values\n var circleValues = getCircleValues(map, attributes);\n \n for (var key in circleValues){\n //get the radius\n var radius = calcPropRadius(circleValues[key]);\n \n //nests the circles from the bottom up at a point\n $('#'+key).attr({\n cy: 250 - radius,\n r: radius\n });\n\n //add legend text\n $('#'+key+'-text').text(Math.round(circleValues[key]*100)/100 + \" cases\");\n };\n \n}", "function drawMap(error, usdata) {\n\n var d = [],\n d1 = [];\n\n if (scselection == \"county\") {\n\n usdata.splice(0, 1);\n countyNameObj.length = 0;\n usdata.forEach(function(element) {\n var nameObj = {};\n nameObj[Math.floor(element[1])] = element[0];\n countyNameObj.push(nameObj);\n if (element[1] > 0)\n d.push(parseInt(element[1]));\n if (element[1] > 0)\n d1.push(parseInt(element[2] + element[3]));\n });\n } else {\n usdata.splice(0, 1);\n stateNameObj.length = 0;\n usdata.forEach(function(element) {\n var nameObj = {};\n nameObj[Math.floor(element[1])] = element[0]; //for age variables\n nameObj[element[2]] = element[0];\n stateNameObj.push(nameObj);\n if (element[1] > 0)\n d.push(parseInt(element[1]));\n if (element[1] > 0)\n d1.push(parseInt(element[2]));\n\n });\n }\n\n var arr = [];\n arr.push(d);\n arr.push(d1);\n\n\n //linear scale for linear gradient from color1 to color2\n var quantize = d3.scale.linear()\n .domain([d3.min(arr[0]), d3.max(arr[0])])\n .range([\"#f7fcfd\", \"#00441b\"]);\n\n var projection = d3.geo.albersUsa()\n .scale(960)\n .translate([width / 2, height / 2]);\n\n\n var path = d3.geo.path()\n .projection(projection);\n svg.selectAll('g').remove();\n if (scselection == \"county\") {\n\n /**\n * d3 legend\n */\n\n\n\n svg.append(\"g\")\n .attr(\"class\", \"legendLinear\")\n .attr(\"transform\", \"translate(200,10)\");\n\n var legendLinear = d3.legend.color()\n .shapeWidth(30)\n .orient('horizontal')\n .cells(10)\n .labelFormat(d3.format('.2s'))\n .scale(quantize);\n\n\n\n /**\n * d3 legend end code\n */\n\n\n /**\n * tooltip code trial\n */\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) {\n\n var prop = arr[0][arr[1].indexOf(d.id)];\n var index = parseFloat([arr[1].indexOf(d.id)]);\n //if(index!=-1)\n return \"<strong>\" + countyNameObj[index][prop] + \" : </strong> <span>\" + d3.format('.2s')(prop) + \"<span>\";\n });\n\n /**\n * tooltip code ends\n */\n\n svg.call(tip);\n svg.select(\".legendLinear\")\n .call(legendLinear);\n\n //to show county borders\n svg.append(\"g\")\n .attr(\"class\", \"counties\")\n .selectAll(\"path\")\n .data(topojson.feature(us, us.objects.counties).features)\n .enter().append(\"path\")\n .style(\"fill\", function(d) {\n\n //console.log(arr[0][arr[1].indexOf(d.id)]);\n return quantize(arr[0][arr[1].indexOf(d.id)]);\n })\n .attr(\"d\", path)\n .on(\"mouseover\", tip.show)\n .on(\"mouseleave\", tip.hide);\n\n //to show state borders as well\n svg.append(\"g\")\n .selectAll(\"path\")\n .data(topojson.feature(us, us.objects.states).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .classed(\"states\", \"true\");\n }\n // else for state selection\n else {\n\n svg.append(\"g\")\n .attr(\"class\", \"legendLinear\")\n .attr(\"transform\", \"translate(650,250)\");\n\n var legendLinear = d3.legend.color()\n .shapeWidth(30)\n .orient('vertical')\n .cells(10)\n .labelFormat(d3.format('.2s'))\n .scale(quantize);\n\n /**\n * tooltip code trial\n */\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) {\n\n var prop = arr[0][arr[1].indexOf(d.id)];\n console.log(prop);\n var index = parseFloat([arr[1].indexOf(d.id)]);\n\n console.log(stateNameObj[index][prop]);\n\n return \"<strong>\" + stateNameObj[index][prop] + \" : </strong> <span>\" + d3.format('.2s')(prop) + \"<span>\";\n\n });\n /**\n * tooltip code ends\n */\n\n svg.call(tip);\n svg.select(\".legendLinear\")\n .call(legendLinear);\n\n //to show state borders only\n svg.append(\"g\")\n .selectAll(\"path\")\n .data(topojson.feature(us, us.objects.states).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .style(\"fill\", function(d) {\n // console.log(\"data\", d);\n // console.log(\"data id\", arr[1].indexOf(d.id));\n return quantize(arr[0][arr[1].indexOf(d.id)]);\n })\n .classed(\"states\", \"true\")\n .on(\"mouseover\", tip.show)\n .on(\"mouseleave\", tip.hide);\n\n }\n pieChart(\"pie1\");\n}", "function createMap () {\n console.log(\"create map called\");\n \n //give the graph a background color of some kind using a recangle coverting the background of the entire svg\n map.append(\"rect\")\n .attr(\"width\", mapwidth + mapPaddingRight + mapPaddingLeft)\n .attr(\"height\" , mapheight + mapPaddingTop + mapPaddingBottom)\n .style(\"fill\" , \"white\");\n \n mapInterior = map.append(\"g\")\n .attr(\"class\" , \"background\")\n .attr(\"transform\", \"translate(\" + mapPaddingLeft + \",\" + mapPaddingTop + \")\");\n \n \n //add and style county geometries\n var districts = mapInterior\n .selectAll(\".districtGeo\")\n .data(dataList)\n .enter()\n .append(\"path\")\n .attr(\"d\", pathGenerator)\n .attr(\"class\" , function(d) {\n return \"districtGeo\" + \" \" + d.AFFGEOID\n })\n .style(\"stroke\" , \"black\")\n .attr(\"stroke-width\" , \"0.3px\")\n .style(\"fill\" , function (d) {\n return colorScale(d[selectedField]);\n })\n .on(\"mouseover\", highlight)\n .on(\"mouseout\" , dehighlight);//apply event binding so quick popups will show up on each element\n \n //setting up data to be used in the legend\n var legendItems = [{val : d3.max(dataList , returnValue) , label : \"Max\"} , \n {val : ((d3.max(dataList , returnValue) + d3.min(dataList, returnValue)) / 2) , label : \"Middle\"}, \n {val : d3.min(dataList, returnValue), label : \"Min\" }];\n \n \n //add a group which will contain all elements inside of the legend\n mapLegendGroup = mapInterior.append(\"g\")\n .attr(\"id\" , \"map-legend\");\n \n\n \n //add the legend rectangles\n mapLegendGroup.selectAll(\"rect.legend\")\n .data(legendItems)\n .enter()\n .append(\"rect\")\n .attr(\"class\" , \"legend\")\n .attr(\"width\" , \"20px\")\n .attr(\"height\" , \"10px\")\n .attr(\"x\" , 0)\n .attr(\"y\" , function (d , i) {\n return (i * 15) + 10;\n })\n .style(\"stroke-width\" , 0.5)\n .style(\"stroke\" , \"black\")\n .style(\"fill\" , function (d) {\n return colorScale(d.val);\n });\n \n //add the labels next to the rectangles\n mapLegendGroup.selectAll(\"text\")\n .data(legendItems)\n .enter()\n .append(\"text\")\n .attr(\"class\" , \"legendText\")\n .text(function (d) {return d.label + \" - \" + selectedFormat(d.val) ;})\n .attr(\"x\" , 23)\n .attr(\"y\" , function (d , i) {\n return (i * 15 ) + 10 + 10;\n })\n ;\n \n //add a dynamic label to the legend\n mapLegendGroup.append(\"text\")\n .text(selectedLabel)\n .attr(\"x\" , 35)\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\" , \"dynamicFieldLabel\");\n\n }", "function mainLegend() {\n\t\t\t// var ldata = data.filter(function(i) {return REGIONS[i.name].selected});\n\t\t\tldata = data;\n\t\t\tLegend(ldata, null,\n\t\t\t\tfunction(i){\n\t\t\t\t\tprovinceHoverIn(shapes.selectAll(\".circle\")[0][i]);\n\t\t\t\t}, function(i) {\n\t\t\t\t\tprovinceHoverOut(shapes.selectAll(\".circle\")[0][i]);\n\t\t\t\t}, function(i) {\n\t\t\t\t\tprovinceClick(shapes.selectAll(\".circle\")[0][i]);\n\t\t\t\t});\t\n\t\t}", "function legend(types){\n\n //color guide\n colors[c].setAlpha(20);\n fill(colors[c]);\n colors[c].setAlpha(255);\n stroke(colors[c]);\n ellipse(width-40, h,20,20);\n\n //text\n fill('black');\n noStroke();\n text(types, width-60,h+5);\n c++;\n h+=25;\n}", "function createMap(earthquakes) {\n\n// define streetmap layer\n var streetmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"© <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> <strong><a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a></strong>\",\n tileSize: 512,\n maxZoom: 18,\n zoomOffset: -1,\n id: \"mapbox/streets-v11\",\n accessToken: API_KEY\n });\n\n\n // create darkmap tile layer\n var darkmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"dark-v10\",\n accessToken: API_KEY\n });\n\n\n // define basemap object to hold base layers\n var baseMaps = {\n \"Street Map\": streetmap,\n \"Dark Map\": darkmap\n };\n\n \n // define overlay object\n var overlayMaps = {\n Earthquakes: earthquakes\n };\n\n \n // create map\n var myMap = L.map('map', {\n center: [37.09, -95.71],\n zoom: 5,\n layers: [streetmap, earthquakes]\n});\n \n\n // create layer control\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n\n // create legend\n var legend = L.control({\n position: 'bottomright'\n });\n\n // when layer control is added, insert div with class of legend\n legend.onAdd = function() {\n var div = L.DomUtil.create(\"div\", \"legend\");\n div.innerHTML += \"<h3>Depth of Earthquake</h3>\",\n\n // found some help in this article for this section: https://www.igismap.com/legend-in-leafletjs-map-with-topojson/\n categories = [-1,3,5,7,9,11];\n\n for (var i=0; i < categories.length; i++) {\n div.innerHTML += '<i style=\"background:' + getColor(categories[i] + 1 ) + '\"></i>' + categories[i] + (categories[i + 1] ? '&ndash;' + categories[i + 1] + '<br>':'+');\n\n }\n return div;\n }\n\n legend.addTo(myMap);\n\n\n}", "function createLegend() {\r\n // Create legend as a leaflet control extension\r\n var LegendControl = L.Control.extend({\r\n options: { position: 'topleft' },\r\n onAdd: function () {\r\n var container = L.DomUtil.create('div', 'legend-control-container');\r\n L.DomEvent.disableClickPropagation(container);\r\n var legendTitle = '<div class=\"legend-title\"><h3 class=\"title-content\">Legend</h3></div>';\r\n $(container).append(legendTitle);\r\n\r\n var legendClickMe = L.DomUtil.create('div', 'legendClickMe');\r\n legendClickMe.innerHTML += \"Click to show\";\r\n $(container).append(legendClickMe);\r\n\r\n\r\n var legendContent = L.DomUtil.create('div', 'legendContent');\r\n\r\n var a = \"<2,500 residents or <250 residents per square mile\";\r\n var b = \"2,500-9,999 residents and >250 residents per square mile\"\r\n var c = \"10,000-49,999 residents and >250 residents per square mile\" \r\n\r\n legendContent.innerHTML += \"<b>≥100 miles from a population center</b><br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"1a\") + '\"></i> ' + \"1a: \" + a + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"1b\") + '\"></i> ' + \"1b: \" + b + \"<br>\";\r\n // legendContent.innerHTML += \"<br>\";\r\n\r\n legendContent.innerHTML += \"<b>57-99 miles from a population center</b><br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"2a\") + '\"></i> ' + \"2a: \" + a + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"2b\") + '\"></i> ' + \"2b: \" + b + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"2c\") + '\"></i> ' + \"2c: \" + c + \"<br>\";\r\n // legendContent.innerHTML += \"<br>\";\r\n\r\n legendContent.innerHTML += \"<b>50-74 miles from a population center</b><br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"3a\") + '\"></i> ' + \"3a: \" + a + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"3b\") + '\"></i> ' + \"3b: \" + b + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"3c\") + '\"></i> ' + \"3c: \" + c + \"<br>\";\r\n // legendContent.innerHTML += \"<br>\";\r\n\r\n legendContent.innerHTML += \"<b>25-49 miles from a population center</b><br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"4a\") + '\"></i> ' + \"4a: \" + a + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"4b\") + '\"></i> ' + \"4b: \" + b + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"4c\") + '\"></i> ' + \"4c: \" + c + \"<br>\";\r\n // legendContent.innerHTML += \"<br>\";\r\n\r\n legendContent.innerHTML += \"<b><25 miles from a population center</b><br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"5a\") + '\"></i> ' + \"5a: \" + a + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"5b\") + '\"></i> ' + \"5b: \" + b + \"<br>\";\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"5c\") + '\"></i> ' + \"5c: \" + c + \"<br>\";\r\n legendContent.innerHTML += \"<br>\";\r\n\r\n legendContent.innerHTML += '<i style=\"background:' + getColor(\"6\") + '\"></i> 6: ≥50,000 residents<br>';\r\n // legendContent.innerHTML += \"<br>\";\r\n\r\n $(container).append(legendContent);\r\n\r\n return container;\r\n }\r\n });\r\n map.addControl(new LegendControl());\r\n\r\n // Add click event listener to show/hide legend\r\n $('.legend-control-container').on('click', function (e) {\r\n // Show menu if hidden\r\n if ($('.legendContent')[0].style.display == \"\" || $('.legendContent')[0].style.display == \"none\") {\r\n $('.legendContent').fadeIn(50);\r\n $('.legendClickMe')[0].innerHTML = 'Click to hide';\r\n $('.title-content').remove();\r\n $('.legendClickMe')[0].style.textAlign = 'right';\r\n $('.legendClickMe')[0].style.marginTop = '15px';\r\n $('.legendClickMe')[0].style.marginRight = '15px';\r\n $('.legendClickMe')[0].style.textDecoration = 'underline';\r\n $('.legendClickMe')[0].style.textDecorationColor = 'blue';\r\n // Hide menu if visible\r\n }else{\r\n $('.legendContent').fadeOut(50);\r\n $('.legendClickMe')[0].innerHTML = 'Click to show';\r\n var legendTitle = '<h3 class=\"title-content\">Legend</h3>';\r\n $('.legend-title').append(legendTitle);\r\n $('.legendClickMe')[0].style.textAlign = 'center';\r\n $('.legendClickMe')[0].style.margin = '5px';\r\n $('.legendClickMe')[0].style.marginBottom = '10px';\r\n $('.legendClickMe')[0].style.textDecoration = 'none';\r\n $('.legendClickMe')[0].style.textDecorationColor = 'black';\r\n }\r\n\r\n })\r\n\r\n}", "function createMap(plates, earthquakes, legend){\n\n // Define satellite and grayscale and outdoors layers\n var satellite = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: API_KEY\n });\n\n var grayscale = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.light\",\n accessToken: API_KEY\n });\n\n var outdoors = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.outdoors\",\n accessToken: API_KEY\n });\n\n // Define a baseMaps object to hold our base layers\n var baseMaps = {\n \"Satellite\": satellite,\n \"Grey scale\": grayscale,\n \"Outdoors\": outdoors\n };\n\n // Create overlay object to hold our overlay layer\n var overlayMaps = {\n Earthquakes: earthquakes,\n \"Tectonic Plates\" : plates\n };\n\n earthquakes.bringToFront();\n plates.bringToBack();\n // Create our map, giving it the streetmap and earthquakes layers to display on load\n var myMap = L.map(\"map\", {\n center: [\n 37.09, -95.71\n ],\n zoom: 4,\n layers: [satellite, earthquakes]\n });\n\n // Create a layer control\n // Pass in our baseMaps and overlayMaps\n // Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false,\n autoZIndex: true\n }).addTo(myMap);\n\n// add legend to map\n legend.addTo(myMap);\n\n}", "function updateLegend2() {\n // Get value of Layer selector\n var current_layer = c.selectLayer.selector.getValue();\n // Check layer\n if (current_layer == 'Time Zone'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue());\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(-12);\n c.legend2.centerLabel.setValue(0);\n c.legend2.rightLabel.setValue(12);\n } else if (current_layer == 'Solar Azimuth'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(90);\n c.legend2.centerLabel.setValue(180);\n c.legend2.rightLabel.setValue(270);\n } else if (current_layer == 'Solar Elevation'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(45);\n c.legend2.rightLabel.setValue(90);\n } else if (current_layer == 'Solar Zenith'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(45);\n c.legend2.rightLabel.setValue(90);\n } else if (current_layer == 'Solar-Surface Azimuth'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(180);\n c.legend2.rightLabel.setValue(360);\n } else if (current_layer == 'Solar-Surface Elevation'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(45);\n c.legend2.rightLabel.setValue(90);\n } else if (current_layer == 'Solar-Surface Zenith'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(45);\n c.legend2.rightLabel.setValue(90);\n } else if (current_layer == 'Slope'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(45);\n c.legend2.rightLabel.setValue(90);\n } else if (current_layer == 'Aspect'){\n c.legend2.title.setValue(c.selectLayer.selector.getValue() + ' in degrees');\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['green', 'yellow', 'yellow', 'orange', 'orange', 'blue', 'blue', 'green']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(180);\n c.legend2.rightLabel.setValue(360);\n // For hillshade\n } else {\n c.legend2.title.setValue(c.selectLayer.selector.getValue());\n c.legend2.colorbar.setParams({\n bbox: [0, 0, 1, 0.1],\n dimensions: '100x10',\n format: 'png',\n min: 0,\n max: 1,\n palette: ['black', 'white']\n });\n c.legend2.leftLabel.setValue(0);\n c.legend2.centerLabel.setValue(127.5);\n c.legend2.rightLabel.setValue(255);\n }\n}", "function addDataToMap(dataIndex) {\n\n // data container\n var plotData = {};\n\n // loop over the original dataset to fix the data format and find minMax\n $.each(internetData, function(_, entry) {\n\n // if first time using the data transform to 3 letter ISO country code\n if (entry.ISO.length < 3) {\n entry.ISO = countryConverter(entry.ISO);\n }\n });\n\n /* Remove the old legend. \n * While this is a bit of a 'hacky way to do it' it seems like datamaps \n * is actually working pretty smoothly when doing it this way.\n * More fancy 'd3-type' changes caused all kinds of complications, making\n * them not worth my time to fix.\n */\n $('.datamaps-legend').remove();\n // set the new map scale\n var scale = setMapScale(dataIndex);\n\n // remake the legend\n var mapLegend = {\n legendTitle: cleanText(dataIndex),\n defaultFillName: 'No data',\n labels: {}\n };\n\n // all data entries will be 9 categories, so again a bit of an 'ugly' fix\n for (var i = 0; i < 9; i++) {\n\n // this functions gives you the upper and lower bounds of a quantized scale\n var bounds = scale.invertExtent(i);\n mapLegend.labels[i] = String(parseInt(bounds[0])) + '-' + String(parseInt(bounds[1]));\n }\n\n // prepare the new data to be visualized\n $.each(internetData, function(_, entry) {\n plotData[entry.ISO] = {\n value: entry[dataIndex],\n fillKey: scale(entry[dataIndex])\n }\n });\n\n // update both map and legend\n map.updateChoropleth(plotData);\n map.legend(mapLegend);\n}", "function updateLegend(map, attribute){\n var year = attribute.split(\"_\")[1];\n var content = \"Deposits in \" + year;\n $(\"#temporal-legend\").text(content);\n\n //Get the max, mean, and min values as an object\n var circleValues = getCircleValues(map, attribute);\n\n for (var key in circleValues){\n //Get the radius\n var radius = calcPropRadius(circleValues[key]);\n\n //Assign the cy and r attributes\n $(\"#\"+key).attr({\n cy: 90 - radius,\n r: radius\n });\n\n //Add legend text\n $(\"#\"+key+'-text').text(Math.round(circleValues[key]*100)/100 + \" thousand\");\n };\n}", "function createLegend() {\n return L.control({ position: 'bottomright' });\n}", "function addMapServerLegend(layerName, layerDetails) {\n\n\n if (layerDetails.wimOptions.layerType === 'agisFeature') {\n\n //for feature layer since default icon is used, put that in legend\n var legendItem = $('<div align=\"left\" id=\"' + camelize(layerName) + '\"><img alt=\"Legend Swatch\" src=\"https://raw.githubusercontent.com/Leaflet/Leaflet/master/dist/images/marker-icon.png\" /><strong>&nbsp;&nbsp;' + layerName + '</strong></br></div>');\n $('#legendDiv').append(legendItem);\n\n }\n\n else if (layerDetails.wimOptions.layerType === 'agisWMS') {\n\n //for WMS layers, for now just add layer title\n var legendItem = $('<div align=\"left\" id=\"' + camelize(layerName) + '\"><img alt=\"Legend Swatch\" src=\"https://placehold.it/25x41\" /><strong>&nbsp;&nbsp;' + layerName + '</strong></br></div>');\n $('#legendDiv').append(legendItem);\n\n }\n\n else if (layerDetails.wimOptions.layerType === 'agisDynamic') {\n\n //create new legend div\n var legendItemDiv = $('<div align=\"left\" id=\"' + camelize(layerName) + '\"><strong>&nbsp;&nbsp;' + layerName + '</strong></br></div>');\n $('#legendDiv').append(legendItemDiv);\n\n //get legend REST endpoint for swatch\n $.getJSON(layerDetails.url + '/legend?f=json', function (legendResponse) {\n\n console.log(layerName,'legendResponse',legendResponse);\n\n\n\n //make list of layers for legend\n if (layerDetails.options.layers) {\n //console.log(layerName, 'has visisble layers property')\n //if there is a layers option included, use that\n var visibleLayers = layerDetails.options.layers;\n }\n else {\n //console.log(layerName, 'no visible layers property', legendResponse)\n\n //create visibleLayers array with everything\n var visibleLayers = [];\n $.grep(legendResponse.layers, function(i,v) {\n visibleLayers.push(v);\n });\n }\n\n //loop over all map service layers\n $.each(legendResponse.layers, function (i, legendLayer) {\n\n //var legendHeader = $('<strong>&nbsp;&nbsp;' + legendLayer.layerName + '</strong>');\n //$('#' + camelize(layerName)).append(legendHeader);\n\n //sub-loop over visible layers property\n $.each(visibleLayers, function (i, visibleLayer) {\n\n //console.log(layerName, 'visibleLayer', visibleLayer);\n\n if (visibleLayer == legendLayer.layerId) {\n\n console.log(layerName, visibleLayer,legendLayer.layerId, legendLayer)\n\n //console.log($('#' + camelize(layerName)).find('<strong>&nbsp;&nbsp;' + legendLayer.layerName + '</strong></br>'))\n\n var legendHeader = $('<strong>&nbsp;&nbsp;' + legendLayer.layerName + '</strong></br>');\n $('#' + camelize(layerName)).append(legendHeader);\n\n //get legend object\n var feature = legendLayer.legend;\n /*\n //build legend html for categorized feautres\n if (feature.length > 1) {\n */\n\n //placeholder icon\n //<img alt=\"Legend Swatch\" src=\"http://placehold.it/25x41\" />\n\n $.each(feature, function () {\n\n //make sure there is a legend swatch\n if (this.imageData) {\n var legendFeature = $('<img alt=\"Legend Swatch\" src=\"data:image/png;base64,' + this.imageData + '\" /><small>' + this.label.replace('<', '').replace('>', '') + '</small></br>');\n\n $('#' + camelize(layerName)).append(legendFeature);\n }\n });\n /*\n }\n //single features\n else {\n var legendFeature = $('<img alt=\"Legend Swatch\" src=\"data:image/png;base64,' + feature[0].imageData + '\" /><small>&nbsp;&nbsp;' + legendLayer.layerName + '</small></br>');\n\n //$('#legendDiv').append(legendItem);\n $('#' + camelize(layerName)).append(legendFeature);\n\n }\n */\n }\n }); //each visible layer\n }); //each legend item\n }); //get legend json\n }\n }", "function legendClickHandler(d, i) {\n\tsn.runtime.excludeSources.toggle(d.source);\n\tregenerateChart(sn.runtime.powerIOAreaChart);\n}", "function updateMap() {\n d3.selectAll(\".mapfeature\")\n .attr(\"fill\", function (d) {\n return getColor(d);\n })\n updateScale()\n}", "function buildLegend(map, width, height, margin, firstColor, lastColor, domain, isos, pBar = 2 / 3, barWidth = 10) {\n\n\t// adds some margin to the right\n\tmap.svg.attr('width', width + margin.right);\n\n\t// creates a definition element for legend\n\tvar defs = map.svg.append('defs');\n\n\t// sets vertical gradient from 0 to 100%, no horizontal gradient\n\tvar legendBar = defs.append('linearGradient')\n\t\t.attr('id', 'linear-gradient')\n\t\t.attr('x1', '0%')\n\t\t.attr('y1', '0%')\n\t\t.attr('x2', '0%')\n\t\t.attr('y2', '100%');\n\n\t// sets the color for the start at 0% of the firstColor value\n\tlegendBar.append('stop') \n\t\t.attr('offset', '0%') \n\t\t.attr('stop-color', firstColor);\n\n\t// sets the color for the end at 100% of the lastColor value\n\tlegendBar.append('stop') \n\t\t.attr('offset', '100%') \n\t\t.attr('stop-color', lastColor);\n\n\t// sets the legendBar dimensions\n\tvar barHeight = pBar * height,\n\t\tbarStart = (height - barHeight) / 2,\n\t\tbarEnd = barStart + barHeight;\n\n\t// returns a float representation of the number of races\n\tvar getLegendValue = d3.scale.linear().domain([barStart, barEnd])\n\t\t.range(domain);\n\n\t// fill with value from on mousemove function.\n\tvar value;\n\n\t// displays a tip div with the number of races coupled to the legendBar\n\tvar tip = d3.tip().html(function() {\n\n\t \treturn '<span>Races: ' + value + '</span>';\n\t})\n\t.offset(function() {\n\t\treturn [d3.event.offsetY - barStart + 10, 0]; \n\t})\n\t.attr('class', 'bar tip');\n\n\t// call the tooltip\n\tmap.svg.call(tip);\n\n\t// select all countries\n\tvar countries = map.svg.selectAll('.datamaps-subunit');\n\n\t// draw the rectangle and fill with gradient\n\tmap.svg.append('rect')\n\t\t.attr('width', barWidth)\n\t\t.attr('height', barHeight)\n\t\t.attr('x', width + barWidth)\n\t\t.attr('y', barStart)\n\t\t.style('fill', 'url(#linear-gradient)')\n\t\t.on('mousemove', function() {\n\n\t\t\tvalue = Math.round(getLegendValue(d3.event.offsetY));\n\t\t\ttip.show();\n\t\t\tborderChange(map, isos, value);\n\t\t})\n\t\t.on('mouseout', tip.hide);\n}", "function updateLegend(map, attribute){\n //create content for legend\n var month = attribute.split(\"_\")[0];\n var content = \"<b> Median Rent: </b>\" + month + \" '17\";\n\n //replace legend content\n $('#temporal-legend').html(\"<id='legend-month'> \"+content);\n \n var circleValues = getCircleValues(map, attribute);\n\n for (var key in circleValues){\n //get the radius\n var radius = calcPropRadius(circleValues[key]);\n\n\n //Step 3: assign the cy and r attributes\n $('#'+key).attr({\n cy: 100 - radius,\n r: radius\n });\n $('#'+key+'-text').text( \"$\"+ Math.round(circleValues[key]*100)/100);\n// $('#'+key+'-text').html(\"&euro;\" + Math.round(circleValues[key]*100)/100 + \" million\");\n };\n}", "function updateLegend() {\n d3.selectAll('.legend div, .legend h6')\n .remove();\n }", "function updateLegend(value) {\n let legendContainer = document.getElementById(\"collapseOne\");\n \n // create a color scale\n let legendContent = \"\";\n let feature = roadDevelopment.toGeoJSON().features[0];\n\n if(value == \"status\") {\n legendContent = getLegendContent(status, feature, \"status\", value);\n } else if (value == \"contractor\") {\n legendContent = getLegendContent(contractors, feature, \"contractor\", value);\n } else if (value == \"funding\") {\n legendContent = getLegendContent(funding, feature, \"funding\", value);\n } else if (value == \"developmentType\") {\n legendContent = getLegendContent(developmentNature, feature, \"nature_dvp\", value);\n } else if (value == \"maintenanceType\") {\n legendContent = getLegendContent(maintenanceType, feature, \"maint_type\", value);\n } \n\n\n legendContainer.innerHTML = legendContent;\n}", "function legendOut(curYr, begYr, endYr,posY){\r\n\r\nvar curtxt = \"Unemployment Rate: \" + curYr;\r\nvar prevtxt = \"Unemployment Rate: \" + (curYr - 1);\r\nvar midtxt = \"Midpoint of Unemployment Rate, \" + begYr + \"-\" + endYr;\r\nvar rngtxt = \"Range of Unemployment Rate, \" + begYr + \"-\" + endYr;\r\n\r\nvar outArr = [ {\"color\" : \"red\",\"text\" : curtxt, \"ypos\" : posY},\r\n\t\t\t{\"color\" : 'brown',\"text\" : prevtxt, \"ypos\" : posY + 10},\r\n\t\t\t{\"color\" : 'black', \"text\" : midtxt, \"ypos\" : posY + 20},\r\n\t\t\t{\"color\" : 'blue', \"text\" : rngtxt, \"ypos\" : posY + 30} ];\r\n\r\nreturn outArr;\r\n}", "async function main2() {\r\n\tconst arrond2 = await getDataArrond2()\r\n\tconst toits = await getDataToits()\r\n\r\nvar pot_flt = L.layerGroup().addTo(map2);\r\n\r\n\r\n//Ajout de la couche des toits avec une symbologie correspondant à son roof'potentiel\r\nlet toit = L.choropleth(toits, {\r\n\tvalueProperty: 'scoring', // which property in the features to use\r\n\tscale: ['EBF9ED', 'CCF1D2', '6EC6BA', '008080'], // chroma.js scale - include as many as you like\r\n\tsteps: 6, // number of breaks or steps in range\r\n\tmode: 'q', // q for quantile, e for equidistant, k for k-means\r\n\tonEachFeature: onEachFeature,\r\n\tstyle: {\r\n\t\tcolor: '#fff', // border color\r\n\t\tweight: 0.5,\r\n\t\tfillOpacity: 0.8, \r\n\t}\r\n}).addTo(pot_flt); \r\n\r\n//Ajout de la légende\r\nvar legend = L.control({position: 'bottomleft'});\r\nlegend.onAdd = function (map2) {\r\n\t\r\n var div = L.DomUtil.create('div', 'info legend')\r\n var limits = toit.options.limits\r\n var colors = toit.options.colors\r\n var labels = []\r\n\r\n // Add min & max\r\n\tdiv.innerHTML = \r\n\t'Roofpotentiel<div class=\"labels\"><div class=\"min\">' + '0' + '</div> \\\r\n\t<div id=\"limit0\" class=\"50 %\">' + limits[0] + '</div> \\\r\n\t\t\t<div id=\"limit1\" class=\"50 %\">' + limits[1] + '</div> \\\r\n\t\t\t<div id=\"limit2\" class=\"step\">' + limits[2] + '</div> \\\r\n\t\t\t<div id=\"limit3\" class=\"step\">' + limits[3] + '</div> \\\r\n\t\t\t<div id=\"limit4\" class=\"step\">' + limits[4] + '</div> \\\r\n\t\t\t<div class=\"max\">' + limits[limits.length - 1] + '</div></div>'\r\n limits.forEach(function (limit, index) {\r\n labels.push('<li style=\"background-color: ' + colors[index] + '\"></li>')\r\n })\r\n\r\n div.innerHTML += '<ul>' + labels.join('') + '</ul>'\r\n return div\r\n }\r\n legend.addTo(map2)\r\n\r\n// //pour la mise en évidence de la séléction du toit\r\nfunction highlight (layer) {\r\n\tlayer.setStyle({\r\n\t\tcolor: '#FCF3CF', \r\n\t\tweight: 5\r\n\t});\r\n}\r\nfunction dehighlight (layer) {\r\n if (selected === null || selected._leaflet_id !== layer._leaflet_id) {\r\n\t toit.resetStyle(layer);\r\n }\r\n}\r\n\r\n\r\n//Fonction pour filter les toits en cliquant sur un bouton\r\n$('#validateform').click(function(event) {\r\n\tpot_flt.clearLayers();\r\n\tevent.preventDefault();\r\n\tvar surf = $('#inputform').val()\r\n\tvar score = $('#scoringInputId').val()\r\n\tvar prop = $('#propinput').val()\r\n\tL.choropleth(toits, {\r\n\t\tvalueProperty: 'scoring', // which property in the features to use\r\n\t\tscale: ['EBF9ED', 'CCF1D2', '6EC6BA', '008080'], // chroma.js scale - include as many as you like\r\n\t\tsteps: 6, // number of breaks or steps in range\r\n\t\tmode: 'q', // q for quantile, e for equidistant, k for k-means\r\n\t\tfilter: function (feature, layer) {\r\n if (prop == \"...\")\r\n\t\t\t\treturn(feature.properties.shape_area > surf && feature.properties.scoring >= score)\r\n\t\t\telse\r\n\t\t\t\treturn (feature.properties.shape_area > surf && feature.properties.scoring >= score && feature.properties.prop == prop)\r\n\t\t\t\t\r\n\t\t},\r\n\t\tonEachFeature: onEachFeature, \r\n\t\tstyle: {\r\n\t\t\tcolor: '#fff', // border color\r\n\t\t\tweight: 0.5,\r\n\t\t\tfillOpacity: 0.8, \r\n\t\t}\r\n\t}).addTo(pot_flt);\r\n});\r\n\r\n//Fonction pour réinitialiser la couche en cliquant sur le bouton\r\n$('#reinitialiserform').click(function(event) {\r\n\t$('#inputform').val(0)\r\n\t$('#scoringInputId').val(0)\r\n\t$('#propinput').val(\"...\")\r\n\tpot_flt.clearLayers();\r\n\tevent.preventDefault();\r\n\ttoit.addTo(pot_flt);\r\n});\r\n\r\n// selection des toits et zoom \r\nfunction select (layer) {\r\n if (selected !== null) {\r\n\tvar previous = selected;\r\n }\r\n\tmap2.fitBounds(layer.getBounds());\r\n\tselected = layer;\r\n\tif (previous) {\r\n\t dehighlight(previous);\r\n\t}\r\n}\r\n\r\nvar selected = null;\r\n\r\n//groupe de couche et de basemaps et layerControl\r\nvar baseMaps2 = {\r\n \"OSM\": osm2,\r\n \"OSM Humanitarian\": osmhuman2, \r\n \"Satellite\": Esri_WorldImagery2\r\n};\r\nvar overlayMaps2 = {\r\n\t\"Toits plats\" : pot_flt, \r\n \"Arrondissements\": arrond2\r\n};\r\n\r\n//Ajout d'un bouton de gestion des calques\r\nL.control.layers(baseMaps2, overlayMaps2).addTo(map2);\r\n\r\n//Interaction au click sur la couche des toits\r\nfunction onEachFeature(feature, layer) {\r\n layer.on({\r\n\t\t'mouseover': function (e) {\r\n\t\t\thighlight(e.target);\r\n\t\t },\r\n\t\t 'mouseout': function (e) {\r\n\t\t\tdehighlight(e.target);\r\n\t\t }, \r\n\t\t'click': function(e)\r\n\t\t\t{\r\n\t\t\t\t// enlever les interaction avec la carte sur une div \r\n\t\t\t\t$('#mySidepanel.sidepanel').mousedown( function() {\r\n\t\t\t\t\tmap2.dragging.disable();\r\n\t\t\t\t });\r\n\t\t\t\t $('html').mouseup( function() {\r\n\t\t\t\t\tmap2.dragging.enable();\r\n\t\t\t\t});\r\n\t\t\t\t// ouverture du panel \r\n\t\t\topenNav(e.target),\r\n\t\t\t// affichage des graphiques \r\n\t\t\tdocument.getElementById(\"myChart\").style.display='block';\r\n\t\t\tdocument.getElementById(\"myChart3\").style.display='none';\r\n\t\t\t// fermeture de la comparaison \r\n\t\t\t// selection des toits \r\n\t\t\tselect(e.target), \r\n\t\t\t// information dans le panel sur le toit sélectionné \r\n\t\t\tdocument.getElementById(\"5\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\" + \"<hr>\"\r\n// graphique sur l'influence des critères dans le roofpotentiel \r\n\t\t\tvar ctx1 = document.getElementById('myChart2').getContext('2d');\r\nvar chart1 = new Chart(ctx1, { \r\n // The type of chart we want to create\r\n type: 'horizontalBar',\r\n\r\n // The data for our dataset\r\n data: {\r\n labels: ['Pluviométrie', 'Surface', 'Ensoleillement', 'Solidité'],\r\n datasets: [{\r\n\t\t\tbackgroundColor: ['rgb(26, 196, 179)', \r\n\t\t\t'rgb(26, 196, 179)', \r\n\t\t\t'rgb(26, 196, 179)', 'rgb(26, 196, 179)'], \r\n borderColor: 'rgb(255, 99, 132)',\r\n data: [e.target.feature.properties.pluviok, e.target.feature.properties.surfacek, e.target.feature.properties.expok, e.target.feature.properties.solidek]\r\n }]\r\n },\r\n\r\n // Configuration options go here\r\n\toptions: {\r\n\t\t// animation: {\r\n // duration: 0 // general animation time\r\n // },\r\n\t\tevents: [], \r\n\t\tlegend: {\r\n\t\t\tdisplay: false}, \r\n\t\t\tscales: {\r\n\t\t\t\txAxes: [{\r\n\t\t\t\t\tticks: {\r\n\t\t\t\t\t\tmax: 5,\r\n\t\t\t\t\t\tmin: 0,\r\n\t\t\t\t\t\tstepSize: 1, \r\n\t\t\t\t\t\tdisplay: false\r\n\t\t\t\t\t}\r\n\t\t\t\t}]\r\n\t\t\t}\r\n\t}\r\n}); \r\n// graphique du roofpotentiel \r\nvar ctx2 = document.getElementById('myChart').getContext('2d');\r\n$('#PluvioInputId').val(1)\r\n$('#PluvioOutputId').val(1)\r\n$('#SurfaceInputId').val(1)\r\n$('#SurfaceOutputId').val(1)\r\n$('#ExpoInputId').val(1)\r\n$('#ExpoOutputId').val(1)\r\n$('#SoliInputId').val(1)\r\n$('#SoliOutputId').val(1)\r\n\tvar chart2 =new Chart(ctx2, {\r\n\t\t// The type of chart we want to create\r\n\t\ttype: 'horizontalBar',\r\n\t\r\n\t\t// The data for our dataset\r\n\t\tdata: {\r\n\t\t\tdatasets: [{\r\n\t\t\t\tbackgroundColor: function(feature){\r\n\t\r\n\t\t\t\t\tvar score = e.target.feature.properties.scoring;\r\n\t\t\t\t\tif (score > 90) {\r\n\t\t\t\t\t\treturn '#008080'; \r\n\t\t\t\t\t } \r\n\t\t\t\t\t else if (score > 80) {\r\n\t\t\t\t\t\treturn '#6EC6BA';\r\n\t\t\t\t\t } \r\n\t\t\t\t\t else if (score > 75) {\r\n\t\t\t\t\t\treturn '#A8E1CE';\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else if (score > 70) {\r\n\t\t\t\t\t\treturn ' #CCF1D2';\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else if (score >= 0) {\r\n\t\t\t\t\t\treturn '#EBF9ED';\r\n\t\t\t\t\t };\r\n\r\n\t\t\t\t},\r\n\t\t\t\tdata: [e.target.feature.properties.scoring],\r\n\t\t\t\tbarThickness: 2,\r\n\t\t\t}]\r\n\t\t},\r\n\t\t// Configuration options go here\r\n\t\toptions: {\r\n\t\t\tevents: [], \r\n\t\t\tlegend: {\r\n\t\t\t\tdisplay: false}, \r\n\t\t\t\tscales: {\r\n\t\t\t\t\txAxes: [{\r\n\t\t\t\t\t\tticks: {\r\n\t\t\t\t\t\t\tmax: 100,\r\n\t\t\t\t\t\t\tmin: 0,\r\n\t\t\t\t\t\t\tstepSize: 20\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}]\r\n\t\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n//Fonction pour faire varier le poids des critéres et calculer à nouveau le scoring\r\n$('#valideform').click(function(event) {\r\n\tdocument.getElementById(\"myChart3\").style.display='block';\r\n\tdocument.getElementById(\"myChart\").style.display='none';\r\n\tvar ctx3 = document.getElementById('myChart3').getContext('2d');\r\n\tdocument.getElementById('mySidepanel').scroll({top:0,behavior:'smooth'});\r\n\tvar pluvio = $('#PluvioInputId').val()\r\n\tvar surface = $('#SurfaceInputId').val()\r\n\tvar ensoleillement = $('#ExpoInputId').val()\r\n\tvar solidite = $('#SoliInputId').val()\r\n\tvar somme = (100/((5*pluvio)+(5*surface)+(5*ensoleillement)+(5*solidite)))*(e.target.feature.properties.pluviok * pluvio + e.target.feature.properties.expok * ensoleillement + e.target.feature.properties.surfacek * surface + e.target.feature.properties.solidek * solidite)\r\n\t\tvar chart3 =new Chart(ctx3, {\r\n\t\t\t// The type of chart we want to create\r\n\t\t\ttype: 'horizontalBar',\r\n\t\t\r\n\t\t\t// The data for our dataset\r\n\t\t\tdata: {\r\n\t\t\t\tdatasets: [{\r\n\t\t\t\t\tbackgroundColor: function(feature){\r\n\t\t\r\n\t\t\t\t\t\tvar score = somme;\r\n\t\t\t\t\t\tif (score > 90) {\r\n\t\t\t\t\t\t\treturn '#008080'; \r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t\t else if (score > 80) {\r\n\t\t\t\t\t\t\treturn '#6EC6BA';\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t\t else if (score > 75) {\r\n\t\t\t\t\t\t\treturn '#A8E1CE';\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else if (score > 70) {\r\n\t\t\t\t\t\t\treturn ' #CCF1D2';\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else if (score >= 0) {\r\n\t\t\t\t\t\t\treturn '#EBF9ED';\r\n\t\t\t\t\t\t };\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdata: [somme],\r\n\t\t\t\t\tbarThickness: 2,\r\n\t\t\t\t}]\r\n\t\t\t},\r\n\t\t\r\n\t\t\r\n\t\t\t// Configuration options go here\r\n\t\t\toptions: {\r\n\t\t\t\tevents: [], \r\n\t\t\t\tlegend: {\r\n\t\t\t\t\tdisplay: false}, \r\n\t\t\t\t\tscales: {\r\n\t\t\t\t\t\txAxes: [{\r\n\t\t\t\t\t\t\tticks: {\r\n\t\t\t\t\t\t\t\tmax: 100,\r\n\t\t\t\t\t\t\t\tmin: 0,\r\n\t\t\t\t\t\t\t\tstepSize: 20\r\n\t\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}\r\n\t\t});\r\n});\r\n\r\n//Fonction pour réinitialiser les critères par un bouton \r\n$('#renitform').click(function(event) {\r\n\tdocument.getElementById(\"myChart3\").style.display='none';\r\n\tdocument.getElementById(\"myChart\").style.display='block';\r\n\tdocument.getElementById('mySidepanel').scroll({top:0,behavior:'smooth'});\r\n\t$('#PluvioInputId').val(1)\t//replace le slider sur la valeur 1\r\n\t$('#PluvioOutputId').val(1)\r\n\t$('#SurfaceInputId').val(1)\r\n\t$('#SurfaceOutputId').val(1)\r\n\t$('#ExpoInputId').val(1)\r\n\t$('#ExpoOutputId').val(1)\r\n\t$('#SoliInputId').val(1)\r\n\t$('#SoliOutputId').val(1)\r\n})\r\n\r\n\r\n//Fonction pour ouvrir les fiches en fonction du scoring \r\nfunction showButton(){\r\n\tvar type = e.target.feature.properties.scoring\r\n\t if (type >= 90) {\r\n\t\treturn document.getElementById(\"fiche1\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche1body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche2\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche3\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne1\").innerHTML = ((feature.properties.shape_area)*3.5/127).toFixed(0); \r\n\t } \r\n\t else if (type >= 70) {\r\n\t\treturn document.getElementById(\"fiche2\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche2body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche1\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche3\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne2\").innerHTML = ((feature.properties.shape_area)*2.5/127).toFixed(0); \r\n\t } \r\n\t else {\r\n\t\treturn document.getElementById(\"fiche3\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche3body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche1\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche2\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne3\").innerHTML = ((feature.properties.shape_area)*1.5/127).toFixed(0); \r\n\t }\r\n }; \r\nshowButton(e.target); \r\n\r\n// destruction des graphiques a la fermeture du panel \r\n(function() { // self calling function replaces document.ready()\r\n\t//adding event listenr to button\r\ndocument.querySelector('#closesidepanel').addEventListener('click',function(){\r\n\t\tchart1.destroy();\r\n\t\tchart2.destroy(); \r\n\t\t});\r\n\t})();\r\n}\r\n})\r\n}\r\n// enlever les interactions sur la div du filtre des toits \r\n$(\"#filterlogo\").click(function(event) {\r\n\topenFlt(),\r\n\t$('#PotFilter.sidefilter').mousedown( function() {\r\n\t\tmap2.dragging.disable();\r\n\t });\r\n\t $('html').mouseup( function() {\r\n\t\tmap2.dragging.enable();\r\n\t});\r\n });\r\n\r\n// ouverture du didacticiel \r\n$(\"#didacopen\").click(function(event) {\r\n\tdocument.getElementById(\"carou\").style.display='block'\r\n});\r\n// fermeture du didacticiel \r\n$(\"#closedidac\").click(function(event) {\r\n\tdocument.getElementById(\"carou\").style.display='none'\r\n});\r\n\r\n\r\n//Fonction pour passer en mode comparaison des toits\r\n$(\"#comparaisonlogo\").click(function(event) {\r\n\tcloseNav();\r\n\tpot_flt.clearLayers();\r\n\tevent.preventDefault();\r\n\tlet t = L.choropleth(toits, {\r\n\t\tvalueProperty: 'scoring', // which property in the features to use\r\n\t\tscale: ['EBF9ED', 'CCF1D2', '6EC6BA', '008080'], // chroma.js scale - include as many as you like\r\n\t\tsteps: 5, // number of breaks or steps in range\r\n\t\tmode: 'q', // q for quantile, e for equidistant, k for k-means\r\n\t\tonEachFeature: onEachFeatureComp,\r\n\t\tstyle: {\r\n\t\t\tcolor: '#fff', // border color\r\n\t\t\tweight: 0.5,\r\n\t\t\tfillOpacity: 0.8, \r\n\t\t}\r\n\t}).addTo(pot_flt); \r\n\topenComp()\r\n\r\n// passage en mode comparaison\r\n\tfunction onEachFeatureComp(feature, layer) {\r\n\t\tlayer.on({\r\n\t\t\t'mouseover': function(e){\r\n\t\t\t\tlayer.bindTooltip(\"Toit n°: \" + String(layer.feature.properties.id).substr(14))\t\t\t},\r\n\t\t\t 'click': function(e) {\r\n\t\t\t\topenComp()\r\n\t\t\t\tvar layer = e.target;\r\n\t\t\t\tif (layer.options.color == '#00FFFF') {\r\n\t\t\t\t\tt.resetStyle(e.target);\r\n\t\t\t\t\r\n\t\t\t\t\te.target.feature.properties.selected = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlayer.setStyle({\r\n\t\t\t\t\t\tweight: 3,\r\n\t\t\t\t\t\tcolor: \"#00FFFF\",\r\n\t\t\t\t\t\topacity: 1,\r\n\t\t\t\t\t\tfillOpacity: 0.1\r\n\t\t\t\t\t});\r\n\t\t\t\t\te.target.feature.properties.selected = true;\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t// suppremier la selection des toits \r\n\t\t\t\t$('#zero').click(function(event) {\r\n\t\t\t\t\tvar layer = e.target;\r\n\t\t\t\t\tif (layer.options.color == '#00FFFF') {\r\n\t\t\t\t\t\tt.resetStyle(e.target);\r\n\t\t\t\t\t\te.target.feature.properties.selected = false;}\r\n\t\t\t\t\tdocument.getElementById(\"tablecomp\").style.display='none';\r\n\t\t\t\t\t$('#selectedCount').text(\"0\");\r\n\t\t\t\t});\r\n\t\t\t\t// quitter le mode comparaison \r\n\t\t\t\t$('#fin').click(function(event) {\r\n\t\t\t\t\tcloseComp();\r\n\t\t\t\t\tdocument.getElementById(\"filterlogo\").style.pointerEvents='auto';\r\n\t\t\t\t\tdocument.getElementById(\"filter\").style.background='';\r\n\t\t\t\t\tdocument.getElementById(\"tablecomp\").style.display='none';\r\n\t\t\t\t\tvar layer = e.target;\r\n\t\t\t\t\tif (layer.options.color == '#00FFFF') {\r\n\t\t\t\t\t\te.target.feature.properties.selected = false;}\r\n\t\t\t\t\t$('#selectedCount').text(\"0\");\r\n\t\t\t\t\tpot_flt.clearLayers();\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\ttoit.addTo(pot_flt);\r\n\t\t\t\t});\t\t\r\n\t\t\t\t//recuperer les information des toits selectionnés \r\n\t\t\t\tgetAllElements();\r\n\t\t\t\tif (!L.Browser.ie && !L.Browser.opera) {\r\n\t\t\t\t\tlayer.bringToFront();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n});\r\n\r\n// définition de la fonction de recuperation des informations des toits \r\nfunction getAllElements() {\r\n\tvar selectedFeatureScore = new Array();\r\n\tvar selectedFeatureSurface = [];\r\n\tvar selectedFeatureEnso = [];\r\n\tvar selectedFeatureProp = [];\r\n\tvar selectedFeatureID = [];\r\n\r\n\t// ajoutes les infomrations dans un array \r\n\t$.each(map2._layers, function (ml) {\r\n\t\tif (map2._layers[ml].feature && map2._layers[ml].feature.properties.selected === true) {\r\n\t\t\tselectedFeatureScore.push(map2._layers[ml].feature.properties.scoring);\r\n\t\t\tselectedFeatureSurface.push(map2._layers[ml].feature.properties.shape_area.toFixed(2));\r\n\t\t\tselectedFeatureEnso.push(map2._layers[ml].feature.properties.sr_mwh.toFixed(2));\r\n\t\t\tselectedFeatureProp.push(map2._layers[ml].feature.properties.prop);\r\n\t\t\tselectedFeatureID.push(map2._layers[ml].feature.properties.id);\r\n\t\t}\r\n\t});\r\n\t$('#selectedCount').text( selectedFeatureScore.length );\r\n\tlet showInfo = \"\";\r\n\tlet somme = 0;\r\n\tlet sommeSurface = 0;\r\n\tlet sommeEnso = 0;\r\n\ttableau();\r\n// creation du tableau avec l'ensemble des informations sur les toits sélectionnés\r\n\tfunction tableau (){\r\n\t\tfor(let i = 0;i<selectedFeatureScore.length;i++){\r\n\t\t\tlet n = 1 + i;\r\n\t\t\tsomme += selectedFeatureScore[i];\r\n\t\t\tsommeSurface += Number(selectedFeatureSurface[i]);\r\n\t\t\tsommeEnso += Number(selectedFeatureEnso[i]);\r\n\t\t\tlet result = (somme/n).toFixed(2);\r\n\t\t\tlet resultEnso = (sommeEnso/n).toFixed(2);\r\n\t\t\tlet resultSurface = (sommeSurface/n).toFixed(2);\r\n\t\t\tshowInfo += `\r\n\t\t\t<tbody>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th scope=\"row\"> <FONT size=\"1\">${String(selectedFeatureID[i]).substr(14)}</FONT></th>\r\n\t\t\t\t\t<td>${selectedFeatureScore[i]}</td>\r\n\t\t\t\t\t<td>${selectedFeatureSurface[i]}</td>\r\n\t\t\t\t\t<td>${selectedFeatureEnso[i]}</td>\r\n\t\t\t\t\t<td>${selectedFeatureProp[i]}</td>\r\n\t\t\t\t</tr>\r\n\t\t\t </tbody>\r\n\t\t\t`;\t\r\n\t\t\tmeantab = `\r\n\t\t\t<tr>\r\n\t\t\t\t<th scope=\"row\">Moyenne</th>\r\n\t\t\t\t<td>${result}</td>\r\n\t\t\t\t<td>${resultSurface}</td>\r\n\t\t\t\t<td>${resultEnso}</td>\r\n\t\t\t</tr>\r\n\t\t\t`;\t\r\n\t\t\tdocument.getElementById('display').innerHTML = showInfo;\r\n\t\t\tdocument.getElementById('moyenne').innerHTML = meantab;\r\n\t\t\tdocument.getElementById(\"tablecomp\").style.display='block';\r\n\t\t}\r\n\t\t\r\n\r\n\t}\r\n};\r\n}", "function updateMap() {\n // Make a Turf collection for analysis\n collection = turf.featurecollection(counties.features);\n\n // Basic UI for select Jenks or Quantile classification\n if (type == \"jenks\") {\n breaks = turf.jenks(collection, \"pop_density\", 8);\n } else {\n breaks = turf.quantile(collection, \"pop_density\", [25, 50, 75, 99]);\n }\n // Get the color when adding to the map\n var layer = L.geoJson(counties, { style: getStyle })\n layer.addTo(map);\n // Fit to map to counties and set the legend\n map.fitBounds(layer.getBounds());\n updateLegend();\n \n function getStyle(feature) {\n var pop = feature.properties.POP;\n var pop_density = feature.properties.pop_density;\n return {\n fillColor: getColor(pop_density),\n fillOpacity: 0.7,\n weight: 1,\n opacity: 0.2,\n color: 'black'\n }\n }\n \n function updateLegend() {\n $(\".breaks\").html();\n for(var i = 0; i < breaks.length; i++) {\n var density = Math.round(breaks[i] * 100) / 100;\n var background = scale(i / (breaks.length));\n $(\".breaks\").append(\"<p><div class='icon' style='background: \" + background + \"'></div><span> \" + density + \" <span class='sub'>pop / mi<sup>2</sup></span></span></p>\");\n }\n }\n}", "function draw_map_by_metric_and_scale(data, metric, scale)\n{\n //Get this year's data\n current_year = get_map_data(data);\n\n var axis_legend = [];\n var legend_text_unit = \"\";\n\n emissions_scale = emissions_per_capita_scale_rainbow;\n\n d3.selectAll(\"path\")\n .datum(function(d)\n {\n return {\"name\" : d3.select(this).attr(\"id\")};\n })\n .data(current_year, //Ensure we map correctly\n function(d, i)\n {\n return d.name;\n })\n .transition()\n .duration(500)\n .style('fill',\n function(d)\n {\n if(metric == 'total_co2')\n {\n axis_legend = [\"0\", \"100K\", \"300K\", \"500K\", \"1M\", \"2M\", \"3M\", \"6M\", \"12M\"];\n legend_text_unit = \"Tons of CO2\";\n if(scale == 'rainbow')\n {\n emissions_scale = emissions_scale_rainbow;\n return emissions_scale_rainbow(d.total_emissions);\n }\n else\n {\n emissions_scale = emissions_scale_gradient;\n return emissions_scale_gradient(d.total_emissions);\n }\n\n }\n else if(metric == 'co2_per_capita')\n {\n axis_legend = [\"0\", \"1\", \"2\", \"3\", \"5\", \"10\", \"15\", \"20\", \"44\"];\n legend_text_unit = \"Tons of CO2/Capita\";\n if(scale == 'rainbow')\n {\n emissions_scale = emissions_per_capita_scale_rainbow;\n return emissions_per_capita_scale_rainbow(d.co2_per_capita);\n }\n else\n {\n emissions_scale = emissions_per_capita_scale_gradient;\n return emissions_per_capita_scale_gradient(d.co2_per_capita);\n }\n }\n else if(metric == 'emissions_productivity')\n {\n axis_legend = [\"0\", \"100K\", \"300K\", \"500K\", \"1M\", \"2M\", \"3M\", \"6M\", \"12M\"];\n legend_text_unit = \"USD/Tons of CO2\";\n if(scale == 'rainbow')\n {\n emissions_scale = emissions_productivity_scale_rainbow;\n return emissions_productivity_scale_rainbow(d.emissions_productivity);\n }\n else\n {\n emissions_scale = emissions_productivity_scale_gradient;\n return emissions_productivity_scale_gradient(d.emissions_productivity);\n }\n }\n\n });\n //Update scale key\n var linearGradient = map_svg.selectAll(\"#gradient\");\n\n //Append multiple color stops by using D3's data/enter step\n linearGradient.selectAll(\"stop\")\n .data( emissions_scale.range() )\n .attr(\"offset\", function(d,i) { return i/(emissions_scale.range().length-1); })\n .attr(\"stop-color\", function(d) { return d; });\n\n //A function that returns the axis'tick text\n var formatEmissions = function(d)\n {\n return axis_legend[d];\n }\n\n //the axis scale. range 0-->300 for a 300 pixles wide key, domain 0-->8 for a 9 tick axis\n var gradient_axis_scale = d3.scale.linear()\n .range([0, 300])\n .domain([0, 8]);\n\n //Axis to be put below the color gradient key to explain it\n var gradient_axis = d3.svg.axis().scale(gradient_axis_scale)\n .orient(\"bottom\").ticks(9).tickFormat(formatEmissions);\n\n map_svg.selectAll(\"#map_legend_axis\")\n .call(gradient_axis)\n\n map_svg.selectAll(\"#map_legend_text\")\n .text(legend_text_unit);\n}", "function buildLegend() {\n\n // Fill in legend area with colors\n var gradientColor;\n\n for (i = 0; i < 100; i++) {\n //$(\"#rainbow-legend-container\").append(\"\" + rainbow.colourAt(i));\n $(\"#legend-gradient\").append('<div style=\"display:inline-block; max-width:2px; background-color:#' + rainbow.colourAt(i) + ';\">&nbsp;</div>');\n }\n}", "function onLegendAfterUpdate() {\n var colorAxes = this.chart.colorAxis;\n if (colorAxes) {\n colorAxes.forEach(function (colorAxis) {\n colorAxis.update({}, arguments[2]);\n });\n }\n }", "function updateLegend(map, attribute){\n //create content for legend\n var year = attribute.split(\"M\")[1];\n //set up content variable equal to the title for the legend\n var content = \"<h3><b>\" + \"Injuries in \" + year + \"</b></h3>\" + \"<br>\";\n //add variable content to the temporal legend\n $('#temporal-legend').html(content);\n //set up a variable to grab the circle values from that function\n var circleValues = getCircleValues(map, attribute);\n //for the variable key in circleValues\n for (var key in circleValues){\n //find the radius\n var radius = calcPropRadius(circleValues[key]);\n //assign cy and r attributes to the circles\n $('#'+key).attr({\n cy: 170 - radius,\n r: radius\n });\n //add a unit to the end of the max/mean/min totals\n $('#'+key+'-text').text(Math.round(circleValues[key]) + \" injuries\");\n }\n}", "function refresh_map() {\n var ly_id = 1\n var ly_parts = [\n \"1235\", \"2475\", \"2455\", \"1110\", \"1240\", \"2460\", \"2470\", \"1120\",\n \"1101\", \"2465\", \"1125\", \"1350\", \"1230\", \"1105\", \"1115\", \"1345\"\n ]\n var ly_values = [141, 140, 155, 147, 132, 146, 151, 137, 146,\n 136, 145, 141, 149, 151, 138, 164]\n var ly_type = 1 // Palestine\n var ly_label = ''\n var ly_color = 'rgb(255,0,0)'\n map.add_layer(1,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n\n var ly_id = 1345\n var ly_parts = [\n 13452415\n ]\n var ly_values = [1041]\n var ly_type = 2 // localities\n var ly_label = 'Econmics'\n var ly_color = 'rgb(0,0,255)'\n map.add_layer(2,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n}", "displayLegend() {\n let colorChangeCounter = -1;\n const marginYChange = margin.top;\n const marginYChangeText = margin.top+10;\n let marginYMultiplier = -1;\n\n return this.state.cases.map( help => {\n colorChangeCounter++;\n marginYMultiplier++;\n return (<g><rect x={margin.left+25} y={marginYChange+(marginYMultiplier*15)} width=\"10\" height=\"10\" fill={this.state.color(colorChangeCounter)}></rect>\n <text y={marginYChangeText+(marginYMultiplier*15)} x={margin.left+36}>{this.state.counties[marginYMultiplier]}</text></g>);\n marginYChange+=10;\n });\n }", "function createTemporalLegend(map, attributes){\n var LegendControl = L.Control.extend({\n options: {\n position: \"bottomright\"\n },\n\n onAdd: function(map){\n var timestamp = L.DomUtil.create(\"div\", \"timestamp-container\");\n $(timestamp).append('<div id=\"temporal-legend\">');\n\n //Start attribute legend svg string\n var svg = '<svg id=\"attribute-legend\" width=\"220px\" height=\"100px\">';\n\n //Create an array of circle names to base loop on\n var circles = {\n max: 20,\n mean: 49,\n min: 80\n };\n\n //Loop to add each circle and text to svg string\n for (var circle in circles){\n svg += '<circle class=\"legend-circle\" id=\"' + circle +\n '\"fill=\"#117ACA\" fill-opacity=\"0.8\" stroke=\"#000000\" cx=\"45\"/>';\n\n //Add text\n svg += '<text id=\"' + circle + '-text\" x=\"92\" y=\"' + circles[circle] + '\"></text>';\n };\n\n //Close the svg string\n svg += \"</svg>\";\n\n //Add the attribute legend svg to the container\n $(timestamp).append(svg);\n return timestamp;\n }\n });\n map.addControl(new LegendControl());\n updateLegend(map, attributes);\n}", "function makeMap() {\n // Make containers\n\n const div = mapsContainer.append('div').attr('class', 'map-container');\n const svg = div.append('svg').html(DEFS);\n\n const pathContainer = svg.append('g').attr('class', 'features');\n const baselineContainer = svg.append('g').attr('class', 'baseline');\n const chart19Container = svg.append('g').attr('class', 'slopes-19');\n const chart20Container = svg.append('g').attr('class', 'slopes-20');\n const textContainer = svg\n .append('g')\n .attr('class', 'text')\n // Create separate groups for white background and black foreground\n .selectAll('g')\n .data([true, false])\n .enter()\n .append('g');\n\n const riverLabel = svg\n .append('text')\n .attr('class', 'river-label')\n .selectAll('tspan')\n .data(['Hudson', 'River'])\n .join('tspan')\n .text(d => d);\n const campusLabel = svg\n .append('g')\n .attr('class', 'campus-labels')\n // Create separate groups for white background and black foreground\n .selectAll('text')\n .data([true, false])\n .enter()\n .append('text')\n .classed('white-background', d => d)\n .selectAll('tspan')\n .data(['Main', 'Campus'])\n .join('tspan')\n .text(d => d);\n\n const labelContainer = svg.append('g');\n const neighborhoodLabelsBg = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .attr('class', 'white-background')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n const neighborhoodLabels = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n\n // Extract census tract features (contains all tracts in Manhattan)\n\n const allTracts = feature(influxData, influxData.objects.tracts);\n\n // Create a separate GeoJSON object that holds only the tracts we want to fit\n // the projection around\n\n const tracts = {\n type: 'FeatureCollection',\n features: allTracts.features.filter(({ properties: { census_tract } }) =>\n [36061018900, 36061021900].includes(+census_tract),\n ),\n };\n\n // Extract census tract centroids\n\n const centroids = feature(influxData, influxData.objects.tracts_centroids);\n\n // Create the paths that will become census tracts.\n // The `d` attribute won't be set until the resize function is called.\n\n const paths = pathContainer\n .selectAll('path')\n .data(allTracts.features)\n .enter()\n .append('path')\n .classed(\n 'columbia-outline',\n d => d.properties.census_tract === '36061020300',\n );\n paths\n .filter(\n ({ properties: { aug20, oct20, aug19, oct19 } }) =>\n (oct20 - aug20) / aug20 > (oct19 - aug19) / aug19,\n )\n .style('fill', shadedColor);\n\n // Create the things that will become the slope chart (e.g. line, arrow, circles)\n\n const circles = chart20Container\n .selectAll('circle')\n .data(centroids.features)\n .enter()\n .append('circle')\n .attr('r', 3);\n\n const baseline = baselineContainer\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line');\n\n /* const text = textContainer\n .selectAll('text')\n .data(centroids.features)\n .enter()\n .append('text')\n .classed('white-background', function () {\n return this.parentNode.__data__;\n }); */\n\n const slopes2020 = chart20Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c20);\n\n const slopes2019 = chart19Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c19);\n\n // Make a handleResize method that handles the things that depend on\n // width (path generator, paths, and svg)\n\n function handleResize() {\n // Recompute width and height; resize the svg\n\n const width = Math.min(WIDTH, document.documentElement.clientWidth - 30);\n const isMobile = width < 460;\n const height = (width * (isMobile ? 36 : 28)) / 30;\n arrowSize = isMobile ? 32 : 45;\n svg.attr('width', width);\n svg.attr('height', height);\n\n // Create the projection\n\n const albersprojection = geoAlbers()\n .rotate([122, 0, 0])\n .fitSize([width, height], tracts);\n\n // Create the path generating function; set the `d` attribute to the path\n // generator, which is called on the data we attached to the paths earlier\n\n const pathGenerator = geoPath(albersprojection);\n paths.attr('d', pathGenerator);\n\n // Define some commonly used coordinate functions\n\n const x = d => albersprojection(d.geometry.coordinates)[0];\n const y = d => albersprojection(d.geometry.coordinates)[1];\n const endpointX = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const x = arrowSize * Math.cos(Math.atan(slope * 2));\n return albersprojection(d.geometry.coordinates)[0] + x;\n };\n const endpointY = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const y = arrowSize * Math.sin(Math.atan(slope) * 2);\n return albersprojection(d.geometry.coordinates)[1] - y;\n };\n\n // Modify the positions of the elements\n\n circles.attr('cx', x).attr('cy', y);\n slopes2020\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(20))\n .attr('y2', endpointY(20));\n slopes2019\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(19))\n .attr('y2', endpointY(19));\n\n /* text\n .attr('x', x)\n .attr('y', y)\n .text(d => {\n let difference =\n (100 * (d.properties.oct - d.properties.aug)) / d.properties.aug;\n difference =\n difference < 10 ? difference.toFixed(1) : Math.round(difference);\n if (difference > 0) return '+' + difference + '%';\n else return '–' + Math.abs(difference) + '%';\n }); */\n\n baseline\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', d => x(d) + arrowSize)\n .attr('y2', y);\n\n riverLabel\n .attr('x', isMobile ? 0 : width / 6)\n .attr('y', (_, i) => height / 2 + i * 22);\n\n campusLabel\n .attr('x', albersprojection(CAMPUS_LABEL_LOC)[0])\n .attr('y', (_, i) => albersprojection(CAMPUS_LABEL_LOC)[1] + i * 18);\n\n neighborhoodLabels\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n\n neighborhoodLabelsBg\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n }\n\n // Call the resize function once; attach it to a resize listener\n\n handleResize();\n window.addEventListener('resize', debounce(handleResize, 400));\n}", "function createMap(quakeLocations) {\n \n // Add the 'outdoors' map from mapbox.\n var outdoormap = L.tileLayer(MAPBOX_URL, {\n attribution: ATTRIBUTION,\n maxZoom: 18,\n id: \"mapbox.outdoors\",\n accessToken: API_KEY\n });\n\n // Add the 'satellite' map from mapbox.\n var satellitemap = L.tileLayer(MAPBOX_URL, {\n attribution: ATTRIBUTION,\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: API_KEY\n });\n\n // Add the 'outdoors' and 'satellite' maps as base maps.\n var baseMaps = {\n \"Topography Map\": outdoormap,\n \"Satellite Map\": satellitemap\n };\n\n // Add the earthquake locations map layer as an overlay map.\n var overlayMaps = {\n \"Earthquakes\": quakeLocations\n };\n\n // Create a legend variable and dictate the location.\n var legend = L.control({ position: \"bottomleft\" });\n\n // Add legend attributes including the scales and the related colors.\n legend.onAdd = function(map) {\n var div = L.DomUtil.create(\"div\", \"legend\");\n div.innerHTML += '<i style=\"background: #FFD709\"></i><span>0 - 3.9 ~ Usually not felt</span><br>';\n div.innerHTML += '<i style=\"background: #FF9D09\"></i><span>3.9 - 4.9 ~ Often felt</span><br>';\n div.innerHTML += '<i style=\"background: #FF7C09\"></i><span>4.9 - 5.9 ~ Slight damage to structures</span><br>';\n div.innerHTML += '<i style=\"background: #FF5309\"></i><span>5.9 - 6.9 ~ A lot of damage in populated areas</span><br>';\n div.innerHTML += '<i style=\"background: #FF3209\"></i><span>6.9 - 7.9 ~ Serious damage</span><br>';\n div.innerHTML += '<i style=\"background: #FF0909\"></i><span>7.9 - 10 ~ Destroy communities near epicenter</span><br>';\n \n return div;\n };\n\n // Create the map, add it to the html, and zoom in to the western United States.\n var usgsMap = L.map(\"map\", {\n center: [\n 41, -118\n ],\n zoom: 4.5,\n layers: [outdoormap, quakeLocations]\n });\n\n // Add controls to switch between base maps and turn on/off overlay layer.\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(usgsMap);\n\n // Add the legend to the map.\n legend.addTo(usgsMap);\n\n}", "function drawLegend(dataVar,pos)\n{\n var data_temp = dataset;\n var max = 0;\n var min = 100000;\n // Everytime, clean out the legend div first and draw the new one.\n $(\"#legend_\"+pos).html(\"\");\n\n // Logic to assign minimum and maximum value of the legend\n data_temp.forEach(function(d) {\n if(d[dataVar] > max && d[dataVar]>0 && d.year > 0)\n {\n max = +d[dataVar];\n }\n if(d[dataVar] < min && d[dataVar]>0 && d.year > 0)\n {\n min = +d[dataVar];\n }\n });\n\n // The jump in every ticks of the legend\n var tick = max/9;\n\n // Assign a color scheme of schemeGreens to the left choropleth and schemeBlues to the right one\n if(pos == \"left\") { color[pos] = d3.scaleThreshold().domain(d3.range(0, max, tick)).range(d3.schemeGreens[9]); }\n else if(pos == \"right\") { color[pos] = d3.scaleThreshold().domain(d3.range(0, max, tick)).range(d3.schemeBlues[9]); }\n\n var ssvg = d3.select(\"#legend_\"+pos);\n\n ssvg.append(\"g\")\n .attr(\"class\", \"legendLinear\")\n .attr(\"transform\", \"translate(100,10)\");\n\n var legendLinear = d3.legendColor()\n .shapeWidth(35)\n .orient('horizontal')\n .scale(color[pos]);\n\n ssvg.select(\".legendLinear\")\n .call(legendLinear);\n}", "async setLegend(_) {\n if (!arguments.length)\n return this._nodeEdgeLegend;\n this._nodeEdgeLegend = _;\n }", "function colour_legend(colours) {\n for(legend_key in colours)\n document.getElementById(legend_key).style.color = colours[legend_key];\n}", "function legend() {\n obj.extend(config_, defaults_);\n return legend;\n }", "function legendDraw(){\n\n let legWidth = Math.min($(\"#heat-legend\").width(),300);\n let gridSize = legWidth/10;\n\n\n //// Heatmap legend\n var x = [0,20,40,60,80,100];\n\n // set colormap (color varies from white to steelblue)\n let color_heat = d3v5.scaleSequential(\n d3v5.interpolateBlues//function(t) { return d3v5.interpolate(\"white\", \"steelblue\")(t); }\n )\n .domain([0, 1]);\n\n // Collect legend characteristics\n heat_legend = new Array();\n for(ii=0 ; ii<x.length; ii++){\n heat_legend.push({\n x: (gridSize+5)*(ii+1) ,\n y: 0,\n width: gridSize,\n height: gridSize,\n fill:color_heat(x[ii]/100),\n label: x[ii]+\"%\"\n })\n }\n\n // Draw legend svg\n let legend = d3v4.select(\"#heat-legend\").append(\"svg\")\n .attr(\"width\",legWidth )\n .attr(\"height\", legWidth/5)\n .append(\"g\");\n\n // Colors\n legend.selectAll('rect')\n .data(heat_legend)\n .enter().append('rect')\n .attr(\"x\", function(d) { return d.x; })\n .attr(\"y\", function(d) { return d.y; })\n .attr(\"width\", function(d) { return d.width; })\n .attr(\"height\", function(d) { return d.height; })\n .attr('fill',function(d){return d.fill});\n\n // Values\n legend.selectAll('text')\n .data(heat_legend)\n .enter().append('text')\n .attr(\"x\", function(d) { return (d.x+gridSize/2); })\n .attr(\"y\", function(d) { return (d.y+gridSize*3/2); })\n .attr(\"text-anchor\",\"middle\")\n .attr(\"alignment-baseline\",\"middle\")\n .attr(\"font-size\",\"10\")\n .text(function(d) {return d.label;});\n\n //// Cluster Number Legend\n //// Cluster legend\n let radWidth = Math.min($(\"#cluster-legend\").width(),50);\n let circleEx = d3v4.select(\"#cluster-legend\").append(\"svg\")\n .attr(\"width\",legWidth )\n .attr(\"height\", radWidth);\n\n circleEx.append(\"circle\")\n .attr(\"cx\", gridSize*1.5)\n .attr(\"cy\", radWidth/2)\n .attr(\"r\", radWidth/3)\n .attr('fill',\"#343a40\");\n\n circleEx.append(\"text\")\n .attr(\"x\", gridSize*1.5)\n .attr(\"y\", radWidth/2)\n .attr(\"fill\",\"#F0F8FF\")\n .attr(\"alignment-baseline\",\"middle\")\n .attr(\"text-anchor\",\"middle\")\n .attr(\"font-size\",\"12\")\n .text(\"38\");\n}", "function redrawUsMap(minyear, maxyear) {\n var min_year_var = viz_config.year_map[minyear];\n var max_year_var = viz_config.year_map[maxyear];\n\n var col_domain = get_color_scale_range(minyear, maxyear);\n\n // quantize color scale\n var color = d3.scale.quantize()\n .domain([-col_domain, 0, col_domain])\n .range(viz_config.map_colors);\n\n $(\"#us_legend\").html(\"\");\n\n var d3_legend = d3.select('#us_legend')\n .append('ul')\n .attr('class', 'list-inline');\n\n var keys = d3_legend.selectAll('li.key')\n .data(color.range());\n\n keys.enter().append('li')\n .attr('class', 'key')\n .style('border-top-color', String)\n .text(function(d) {\n var r = color.invertExtent(d);\n var pct = d3.format('%');\n return pct(r[0]);\n });\n\n d3.selectAll('.counties path')\n .style(\"fill\", function(d) {\n // fill color, if it exists\n if(typeof fipsDict[+d.id] !== \"undefined\") {\n var rec = fipsDict[+d.id];\n var pct_ch = pct_change(rec[max_year_var], rec[min_year_var]);\n return color(pct_ch);\n }\n })\n .attr('d', path)\n // bind the mouseover event\n .on('mouseover', function(d) {\n if(typeof fipsDict[+d.id] !== \"undefined\") {\n // highlight the county border\n d3.select(this).style({\n \"stroke\": \"#aaa\",\n \"stroke-width\": 3\n });\n // retrieve the correct record\n var rec = fipsDict[+d.id];\n\n // get pct change\n var pct_ch = pct_change(rec[max_year_var], rec[min_year_var]);\n\n // format text color and prefix\n var pre = \"\";\n if (pct_ch > 0) {\n pre = \"+\";\n }\n\n var data_to_template = {\n county: rec.county + \", \" + rec.state,\n oldyear: {\n year: minyear,\n val: viz_config.comma_format(rec[min_year_var])\n },\n newyear: {\n year: maxyear,\n val: viz_config.comma_format(rec[max_year_var])\n },\n pct_change: pre + viz_config.pct_format(pct_ch)\n };\n\n $us_hover_output.html(map_template(data_to_template));\n\n }\n })\n .on('mouseout', function(d) {\n // reset county border style\n d3.select(this).style({\n \"stroke\": \"#eee\",\n \"stroke-width\": 1\n });\n // clear the div\n $us_hover_output.html('');\n });\n }", "function initHeatmapLegend() {\n setHmapLegendScale();\n heatmapLegendWidth = heatmapLegendWidthScale(leader.Emissions)\n\n hmapKey = d3.select(\".heatmap\")\n .append(\"svg\")\n .attr(\"width\", heatmapWidth)\n .attr(\"height\", h+scalePadding*1.3)\n .attr(\"y\", heatmapHeight-h-scalePadding*1.3)\n\n heatmapLegend = hmapKey.append(\"defs\")\n .append(\"svg:linearGradient\")\n .attr(\"id\", \"gradient\")\n .attr(\"x1\", \"0%\")\n .attr(\"y1\", \"100%\")\n .attr(\"x2\", \"100%\")\n .attr(\"y2\", \"100%\")\n .attr(\"spreadMethod\", \"pad\");\n\n heatmapLegend.append(\"stop\")\n .attr(\"offset\", \"0%\")\n .attr(\"stop-color\", \"#feeeee\")\n .attr(\"stop-opacity\", 1);\n\n heatmapLegend.append(\"stop\")\n .attr(\"offset\", \"100%\")\n .attr(\"stop-color\", \"#ce5755\")\n .attr(\"stop-opacity\", 1);\n\n heatmapLegendKey = hmapKey.append(\"rect\")\n .attr(\"class\", \"heatmap-legend\")\n .attr(\"width\", 0)\n .attr(\"height\", h/2)\n .attr(\"y\", scalePadding)\n .attr(\"rx\", 10)\n .attr(\"ry\", 10)\n .style(\"fill\", \"url(#gradient)\")\n\n heatmapLegendKey.transition().duration(2000)\n .attr(\"width\", heatmapLegendWidth)\n\n // set equal to 0 to get transition\n hmapRange = d3.scaleLinear().domain(d3.extent(dataArr, d => d.Emissions)).range([0, 0])\n var hmapAxis = d3.axisTop()\n .scale(hmapRange)\n .ticks(10)\n .tickSize(0)\n .tickSizeOuter(0);\n\n heatmapLegendAxis = hmapKey.append(\"g\")\n .attr(\"transform\", \"translate(0,\"+ scalePadding/1.2 + \")\")\n .call(hmapAxis)\n\n heatmapLegendAxisTitle = hmapKey\n .append(\"text\")\n .attr(\"x\",hmapRange.range()[1]/2)\n .attr(\"y\", scalePadding *.2)\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", 15)\n .style(\"font-family\", \"\\\"Open Sans\\\", sans-serif\");\n //.text(\"Emissions (Mt CO2)\");\n\n hmapRange = d3.scaleLinear().domain(d3.extent(dataArr, d => d.Emissions)).range([0, heatmapLegendWidth])\n hmapAxis = d3.axisTop()\n .scale(hmapRange)\n .ticks(10)\n .tickSize(0)\n .tickSizeOuter(0);\n\n d3.select(\".domain\").attr(\"stroke\", \"none\")\n\n heatmapLegendAxis\n .transition().duration(2000)\n .call(hmapAxis)\n\n heatmapLegendAxisTitle\n .transition().duration(2000)\n .attr(\"x\",hmapRange.range()[1]/2)\n .attr(\"y\", scalePadding *.25)\n\n flagLegend = hmapKey\n .append(\"image\")\n .attr(\"y\", scalePadding - h/2)\n .attr(\"height\", flagLegendSize)\n .attr(\"width\", flagLegendSize)\n\n flagLegendStroke = hmapKey\n .append(\"circle\")\n .attr(\"r\", flagLegendSize/2)\n .attr(\"stroke\", \"#fff\")\n .attr(\"fill\", \"none\")\n .attr(\"stroke-width\", 2)\n}", "function updateLegend() {\n\n let legendRange = [];\n for (let i=0; i <= 1000; i+=100) {\n legendRange.push(i);\n }\n\n let legendHTML = legendRange.map(function(val) {\n let lightness = linearMapping(val, 0, 1000, 30, 100);\n lightness = Math.floor(lightness/7) * 7;\n let hexColor = hslToHex(120, 100, 100 - lightness);\n\n let range = val + \"km to <\" + (val+100) + \"km\";\n if (val === 1000) {\n range = `${val}km`;\n }\n return `<div>\n <div style='display: inline-block; width: 1rem; height: 1rem; background-color: ${hexColor}'></div>\n <div style='display: inline-block;'>${range}</div>\n </div>`\n });\n\n document.querySelector(\".legend\").innerHTML = legendHTML.join(\"\");\n\n}", "function createMap(earthquakes){\n //need street map & darkmap layers--tho i think we could take these out\n var streetmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"© <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> <strong><a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a></strong>\",\n tileSize: 512,\n maxZoom: 18,\n zoomOffset: -1,\n id: \"mapbox/streets-v11\",\n accessToken: API_KEY\n });\n\n var darkmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"dark-v10\",\n accessToken: API_KEY\n });\n\n // Define a baseMaps object to hold our base layers\n var baseMaps = {\n \"Street Map\": streetmap,\n \"Dark Map\": darkmap\n };\n\n \n // Create overlay object to hold our overlay layer\n var overlayMaps = {\n Earthquakes: earthquakes,\n \"Depth and Magnitude\" : depthMagnitude\n\n };\n \n // Create our map, giving it the streetmap and earthquakes layers to display on load\n var myMap = L.map(\"map\", {\n center: [\n 37.09, -95.71\n ],\n zoom: 5,\n layers: [streetmap, earthquakes]\n });\n\n\n //legend \n var legend = L.control({position: \"bottomright\"});\n legend.onAdd = function(){\n var div = L.DomUtil.create(\"div\", \"info legend\");\n var depth_limits = [\"0-10\", \"10-20\", \"20-50\", \"50-100\", \"100-200\", \"200-300\", \"300-450\" ]\n var colors = [\"#ffffb2\", \"#fed976\", \"#feb24c\", \"#fd8d3c\", \"#fc4e2a\", \"#e31a1c\", \"#b10026\" ];\n var labels = [];\n \n //put in min & max\n var legendInfo = \"<h1>Earthquake Depth</h1>\"; \n // \"<div class=\\\"labels\\\">\" +\n // \"<div class=\\\"min\\\">\" + depth_limits[0] + colors[0] \"</div>\" +\n // \"<div class=\\\"min\\\">\" + depth_limits[1] + \"</div>\" +\n // \"<div class=\\\"min\\\">\" + depth_limits[2] + \"</div>\" +\n // \"<div class=\\\"min\\\">\" + depth_limits[3] + \"</div>\" +\n // \"<div class=\\\"min\\\">\" + depth_limits[4] + \"</div>\" +\n // \"<div class=\\\"min\\\">\" + depth_limits[5] + \"</div>\" +\n // \"<div class=\\\"min\\\">\" + depth_limits[6] + \"</div>\" \n // \"</div>\";\n\n div.innerHTML = legendInfo;\n\n depth_limits.forEach(function(depth, index){\n labels.push(`<li style = background-color:${colors[index]}>${depth}</li>`);\n });\n\n div.innerHTML += \"<ul>\" + labels.join(\"\") + \"</ul>\";\n return div\n }\n console.log(legend);\n //why doesn't this work????? WHHY DOESN'T IT WORK\n legend.addTo(myMap);\n \n//control layer to toggle on/off overlays\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n // legend.addTo(myMap);\n}", "makeLegend ( ) {\n const categories = this.treeLeaves\n .map( leaf => leaf.data.category )\n .filter( ( cat, i, obj ) => obj.indexOf( cat ) === i );\n const WIDTH = this.chartWidth;\n const HEIGHT = this.canvasHeight;\n const TILE_SIZE = 10;\n const TILE_OFFSET = 120;\n const Y_SPACE = 10;\n const COLUMNS = Math.floor( WIDTH / TILE_OFFSET );\n\n const legend = this.canvas\n .append( 'g' )\n .attr( 'id', 'legend' )\n .attr( 'transform', 'translate( 20, 10 )' )\n .selectAll( 'g' )\n .data( categories )\n .enter( )\n .append( 'g' )\n .attr( 'transform', ( d, i ) => \n `translate(\n ${ ( i % COLUMNS ) * TILE_OFFSET },\n ${ HEIGHT + Math.floor( i / COLUMNS ) * TILE_SIZE + Y_SPACE * Math.floor( i / COLUMNS ) } \n )` );\n \n legend.append( 'rect' )\n .attr( 'width' , TILE_SIZE )\n .attr( 'height' , TILE_SIZE )\n .attr( 'class' , 'legend-item' )\n .attr( 'fill' , d => this.colorScale( d ) );\n \n legend.append(\"text\")\n .attr( 'class', 'legend-text')\n .attr( 'x' , TILE_SIZE + 5 )\n .attr( 'y' , TILE_SIZE )\n .text( d => d );\n\n return this;\n }", "function updateLegend(colorScale) {\n svg_legend.selectAll('*').remove();\n makeLegend(colorScale);\n}", "function initLegend(el, schema){\n el.empty();\n for ( var i=0; i<schema.cols.length; i++){\n el.append('<div style=\"margin-right:5px; background-color:#'+\n schema.cols[i].color+'\" class=\"div-legend-color left\"></div>'+\n '<div class=\"left\" style=\"margin-right:10px;\">'+\n schema.cols[i].name+'</div>');\n }\n el.append ('<div class=\"clear\"></div>');\n}", "function createLegend(attribute){\n var LegendControl = L.Control.extend({\n options: {\n position: 'bottomright'\n },\n\n onAdd: function () {\n // create the control container with a particular class name\n var container = L.DomUtil.create('div', 'legend-control-container');\n\n var year = attribute.split(\" \")[0];\n $(container).append('<h2 id=\"year-step\" ><b>Acres Burned in ' + year + '</h2>');\n\n //Start attribute legend svg string\n var svg = '<svg id=\"attribute-legend\" width=\"270px\" height=\"180px\">';\n\n //array of circle names to base loop on\n var circles = [\"max\", \"mean\", \"min\"];\n\n //Loop to add each circle and text to svg string\n for (var i=0; i<circles.length; i++){\n //Assign the r and cy attributes\n var radius = calcPropRadius(dataStatsAcres[circles[i]]); //Manually set radius of circles\n var cy = 180 - radius;\n\n //circle string\n svg += '<circle class=\"legend-circle\" id=\"' + circles[i] + '\" r=\"' + radius + '\"cy=\"' + cy + '\" fill=\"#990000\" fill-opacity=\"0.8\" stroke=\"#000000\" cx=\"88\"/>';\n\n //evenly space out labels\n var textY = i * 60 + 40;\n\n //text string\n svg += '<text id=\"' + circles[i] + '-text\" x=\"180\" y=\"' + textY + '\">' + Math.round(dataStatsAcres[circles[i]]*100)/100 + \" acres\" + '</text>';\n };\n\n //close svg string\n svg += \"</svg>\";\n\n //add attribute legend svg to container\n $(container).append(svg);\n\n L.DomEvent.disableClickPropagation(container);\n\n return container;\n }\n });\n map.addControl(new LegendControl());\n}", "function legendClickHandler(d, i) {\n\tsn.runtime.excludeSources.toggle(d.source);\n\tregenerateChart();\n}", "function updateMap() {\n\t\t\tid = trail_select.value;\n\t\t\tconsole.log(id);\n\t\t\tvar newlayer = layer.getLayer(id);\n\t\t\tnewlayer.removeFrom(map);\n\t\t\tnewlayer.setStyle({\n\t\t\t\t\tweight: 5,\n\t\t\t\t\tcolor: '#00ff00',\n\t\t\t\t\topacity: 1.0\n\t\t\t});\n\t\t\tnewlayer.addTo(map)\n\t\t\tvar prevlayer = layer.getLayer(previd);\n\t\t\tif (previd !== id) {\n\t\t\t\tprevlayer.setStyle({\n\t\t\t\t\tcolor: '#ff7800',\n\t\t\t\t\topacity: 1.0,\n\t\t\t\t\tweight: (prevlayer.feature.properties.annual*0.17)**4\n\t\t\t\t});\n\t\t\t\tprevlayer.addTo(map);\n\t\t\t\tprevid = id;\n\t\t\t}\n\t\t}" ]
[ "0.8194461", "0.73534685", "0.73008513", "0.71193564", "0.70771456", "0.7072417", "0.70456195", "0.7044891", "0.69986147", "0.68637806", "0.6860625", "0.6810632", "0.67819047", "0.6752372", "0.6745674", "0.6726528", "0.66957486", "0.6654741", "0.66539806", "0.6603126", "0.66003966", "0.65553546", "0.6505126", "0.6499154", "0.6471985", "0.64704794", "0.6468618", "0.6429586", "0.64226687", "0.6415173", "0.6412117", "0.6404902", "0.6390329", "0.63882756", "0.63846135", "0.63500714", "0.63465494", "0.63452286", "0.6341195", "0.6335399", "0.6310663", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.6294318", "0.62911296", "0.62501514", "0.6235625", "0.6234559", "0.6230801", "0.62305015", "0.62263405", "0.6193536", "0.61472446", "0.6147128", "0.6144415", "0.6135539", "0.61214846", "0.60917467", "0.6086892", "0.608325", "0.6074769", "0.607278", "0.60726273", "0.60704255", "0.6059012", "0.6055802", "0.6049063", "0.60470945", "0.60411894", "0.6036627", "0.60289776", "0.6013643", "0.6012313", "0.600329", "0.60023534", "0.599491", "0.59715176", "0.59699947", "0.59530234", "0.5945761", "0.59429896", "0.5924423", "0.592328", "0.5905668", "0.59048814", "0.5901085", "0.58890504", "0.5879625", "0.58706886", "0.58634365", "0.58632994" ]
0.68788475
10